LoginIAM2VirtualID
API Request
URLs
PUT zstack/v1/iam2/virtual-ids/login
Body
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"loginIAM2VirtualID": {
"name": "id1",
"password": "password"
},
"systemTags": [],
"userTags": []
}

Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-X PUT -d '{"loginIAM2VirtualID":{"name":"id1","password":"password"}}' http://localhost:8080/zstack/v1/iam2/virtual-ids/login
Request Parameters
Note:
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
name | String | body (contained in the loginIAM2VirtualID structure) | The resource name. | 2.4.0 | |
password | String | body (contained in the loginIAM2VirtualID structure) | 2.4.0 | ||
systemTags | List | body | Optional. The system tags. | 2.4.0 | |
userTags | List | body | Optional. The user tags. | 2.4.0 | |
captchaUuid | String | body (contained in the loginIAM2VirtualID structure) | Optional. | 2.4.0 | |
verifyCode | String | body (contained in the loginIAM2VirtualID structure) | Optional. | 2.4.0 | |
clientInfo | Map | body (contained in the loginIAM2VirtualID structure) | Optional. The client information. | 3.5.0 |

- When you log in to ZStack Cloud as a user, you
can use the two-factor authentication method by adding the
twofatoken option to SystemTags.
- Format of the twofatoken option:
twofatoken::6-digit two-factor authentication code
- Example:
twofatoken::123456
- Format of the twofatoken option:
API Response
Sample
Response
{
"inventory": {
"uuid": "7fcdc9d9e4bf3d8681a4472f38951dc0",
"noSessionEvaluation": false
}
}
Name | Type | Description | Starting Version |
---|---|---|---|
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 2.4.0 |
inventory | SessionInventory | See inventory. | 2.4.0 |
#error
Name | Type | Description | Starting Version |
---|---|---|---|
code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 2.4.0 |
description | String | The brief description of the error. | 2.4.0 |
details | String | The details about the error. | 2.4.0 |
elaboration | String | The reserved field. Default value: null. | 2.4.0 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 2.4.0 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 2.4.0 |
#inventory
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 2.4.0 |
accountUuid | String | The account UUID. | 2.4.0 |
userUuid | String | The user UUID. | 2.4.0 |
expiredDate | Timestamp | 2.4.0 | |
createDate | Timestamp | The creation date. | 2.4.0 |
SDK Sample
Java
SDK
LoginIAM2VirtualIDAction action = new LoginIAM2VirtualIDAction();
action.name = "id1";
action.password = "password";
LoginIAM2VirtualIDAction.Result res = action.call();
Python
SDK
LoginIAM2VirtualIDAction action = LoginIAM2VirtualIDAction()
action.name = "id1"
action.password = "password"
LoginIAM2VirtualIDAction.Result res = action.call()