Log In by Account
Body
{
"logInByAccount": {
"accountName": "test",
"password": "password",
"captchaUuid": "39bd748906ad301793c64f688dc197a9",
"verifyCode": "test"
},
"systemTags": [],
"userTags": []
}In the above example, the systemTags and userTags fields can be omitted. They are listed to show that these two fields can be included in the body.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-X PUT -d '{"logInByAccount":{"accountName":"test","password":"password","captchaUuid":"39bd748906ad301793c64f688dc197a9","verifyCode":"test"}}' \
http://localhost:8080/zstack/v1/accounts/loginParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| accountName | String | body (contained in the logInByAccount structure) | Account name | 0.6 | |
| password | String | body (contained in the logInByAccount structure) | Password | 0.6 | |
| captchaUuid (optional) | String | body (contained in the logInByAccount structure) | Captcha UUID | 2.6.0 | |
| verifyCode (optional) | String | body (contained in the logInByAccount structure) | Verification code | 2.6.0 | |
| clientInfo (optional) | Map | body (contained in the logInByAccount structure) | Client information | 3.5.0 | |
| systemTags (optional) | List | body | System tags | 0.6 | |
| userTags (optional) | List | body | User tags | 0.6 | |
| accountType (optional) | String | body (contained in the logInByAccount structure) | 3.4.0 |
API Response
Response example
{
"inventory": {
"uuid": "5d77893e242d39ec8b9856a7b8762eab",
"accountUuid": "7ab57f322e4a396b8124ed4fda810966",
"expiredDate": "Nov 14, 2017 2:20:57 PM",
"noSessionEvaluation": false
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 0.6 | |
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error | 0.6 |
| inventory | SessionInventory | For details, see inventory | 0.6 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number, a globally unique identifier for the error, e.g., SYS.1000, HOST.1001 | 0.6 |
| description | String | A brief description of the error | 0.6 |
| details | String | The detailed error information | 0.6 |
| elaboration | String | Reserved field. Defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field. Defaults to null | 0.6 |
| cause | ErrorCode | The root error, the cause of the current error. This field is null if there is no root error | 0.6 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID, uniquely identifying this resource | 0.6 |
| accountUuid | String | Account UUID | 0.6 |
| userUuid | String | User UUID | 0.6 |
| expiredDate | Timestamp | Session expiration date | 0.6 |
| createDate | Timestamp | Creation time | 0.6 |
SDK Examples
Java SDK
LogInByAccountAction action = new LogInByAccountAction();
action.accountName = "test";
action.password = "password";
action.captchaUuid = "39bd748906ad301793c64f688dc197a9";
action.verifyCode = "test";
LogInByAccountAction.Result res = action.call();
Python SDK
LogInByAccountAction action = LogInByAccountAction()
action.accountName = "test"
action.password = "password"
action.captchaUuid = "39bd748906ad301793c64f688dc197a9"
action.verifyCode = "test"
LogInByAccountAction.Result res = action.call()