Log In

PUT/zstack/v1/login

Headers

Authorization: OAuth the-session-uuid

Body

{
  "logIn": {
    "username": "admin",
    "password": "password",
    "loginType": "iam1"
  },
  "systemTags": [],
  "userTags": []
}

In the example above, the systemTags and userTags fields are optional. They are listed to indicate that these two fields can be included in the body.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-X PUT -d '{"logIn":{"username":"admin","password":"password","loginType":"iam1"}}' \
http://localhost:8080/zstack/v1/login

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
usernameStringbody (contained in the logIn structure)Username 4.6.0
passwordStringbody (contained in the logIn structure)User password 4.6.0
loginTypeStringbody (contained in the logIn structure)User type 4.6.0
captchaUuid (Optional)Stringbody (contained in the logIn structure)CAPTCHA UUID 4.6.0
verifyCode (Optional)Stringbody (contained in the logIn structure)Verification code 4.6.0
clientInfo (Optional)Mapbody (contained in the logIn structure)Client information 4.6.0
properties (Optional)Mapbody (contained in the logIn structure)Login properties 4.6.0
systemTags (Optional)ListbodySystem tags 4.6.0
userTags (Optional)ListbodyUser tags 4.6.0

API Response

Response example

{
  "inventory": {
    "uuid": "5d77893e242d39ec8b9856a7b8762eab",
    "accountUuid": "7ab57f322e4a396b8124ed4fda810966",
    "expiredDate": "Nov 14, 2017 2:20:57 PM",
    "noSessionEvaluation": false
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. This field is null on success. For details, see error0.6
inventorySessionInventoryFor details, see inventory0.6

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.10010.6
descriptionStringA brief description of the error0.6
detailsStringDetailed information about the error0.6
elaborationStringReserved field. Default is null0.6
opaqueLinkedHashMapReserved field. Default is null0.6
causeErrorCodeThe root error that caused the current error. This field is null if there is no root cause0.6

inventory

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource, uniquely identifying this resource0.6
accountUuidStringAccount UUID0.6
userUuidStringUser UUID0.6
expiredDateTimestamp 0.6
createDateTimestampCreation time0.6

SDK Examples

Java SDK

LogInAction action = new LogInAction();
action.username = "admin";
action.password = "password";
action.loginType = "iam1";
LogInAction.Result res = action.call();

Python SDK

LogInAction action = LogInAction()
action.username = "admin"
action.password = "password"
action.loginType = "iam1"
LogInAction.Result res = action.call()