User Management
Overview
The User Management feature provides you with access control to system resources. With User Management, you can perform fine-grained managements on resource ownership and permission control.
User Management provides managements of accounts, user groups, and users, and involves concepts such as policy and quota.
The overall structure of User Management is shown in User Management.
Concepts
Account
Account is the root identity that owns all your resources. An account can perform multiple operations, such as create, delete, share, and recall, on resources of its ownership. Account consists of admin account and normal account.
User
User is created by account to achieve fine-grained permission controls. Users created by an admin account are admin users who inherit all permissions of the admin account.
User Group
User group is created by normal account to perform batch permission controls on users in the same group.
Resource Quota
Resource quota, also referred to as quota, is used by admin account to limit the resource amount of a normal account.
- Resource quota involves the following parameters: VM count, CPU count, memory capacity, maximum number of data volumes, and maximum capacity of all volumes.
- The admin account can modify the preceding parameters to adjust the resource quota of each normal account. If a resource is deleted but not expunged, the resource still consumes the primary storage and volume resources.
Inventory
Properties
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The UUID. For more information, see Resource Property. | 0.6 | ||
| name | The name. For more information, see Resource Property. | 0.6 | ||
| description | The description. For more information, see Resource Property. | Yes | 0.6 | |
| state | The state. |
|
0.6 | |
| createDate | The creation date. For more information, see Resource Property. | 0.6 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 0.6 | ||
| type | The reserved field for internal use. | 0.6 |
Sample
{
"inventories": [
{
"createDate": "Mar 10, 2018 2:13:11 PM",
"lastOpDate": "Mar 10, 2018 2:13:11 PM",
"name": "admin",
"type": "SystemAdmin",
"uuid": "36c27e8ff05c4780bf6d2fa65700f22e"
}
],
"success": true
}
Two-Factor Authentication Inventory
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The UUID. For more information, see Resource Property. | 3.4.0 | ||
| secret | The two-factor authentication secret. | 3.4.0 | ||
| userUuid | The user UUID. | Yes | 3.4.0 | |
| userType | The user type. | 3.4.0 | ||
| status | The status. | 3.4.0 | ||
| groupBy | Groups rows into subgroups based on values of columns or expressions. This field is equivalent to the Group By clause in MySQL, such as groupBy=type. | Yes | 3.4.0 | |
| createDate | The creation date. For more information, see Resource Property. | 3.4.0 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 3.4.0 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 3.4.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 3.4.0 |
Sample
{
"inventories": [
{
"createDate": "Mar 12, 2019 7:50:41 PM",
"lastOpDate": "Mar 12, 2019 7:50:41 PM",
"secret": "75BLH2NDTNIVE364",
"status": "NewCreated",
"userType": "AccountVO",
"userUuid": "2dce5dc485554d21a3796500c1db007a",
"uuid": "060a5b419c894c0bbc57e7e6ca2084fd"
}
]
}
Account Inventory
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The UUID. For more information, see Resource Property. | 0.6 | ||
| name | The name. For more information, see Resource Property. | 0.6 | ||
| description | The description. For more information, see Resource Property. | Yes | 0.6 | |
| type | The account type, including admin account and normal account. | 0.6 | ||
| groupBy | Groups rows into subgroups based on values of columns or expressions. This field is equivalent to the Group By clause in MySQL, such as groupBy=type. | Yes | 0.6 | |
| createDate | The creation date. For more information, see Resource Property. | 0.6 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 |
Sample
{
"inventories": [
{
"uuid": "c5962adc77ff40d980bcfe68a39b6fc5",
"name": "test",
"type": "Normal"
}
]
}
Account and Resource Reference Inventory
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| accountUuid | The account UUID. | 0.6 | ||
| resourceUuid | The resource UUID. | 0.6 | ||
| resourceType | The resource type. | 0.6 | ||
| groupBy | Groups rows into subgroups based on values of columns or expressions. This field is equivalent to the Group By clause in MySQL, such as groupBy=type. | Yes | 0.6 | |
| createDate | The creation date. For more information, see Resource Property. | 0.6 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 |
Sample
{
"inventories": [
{
"id": 1.0,
"accountUuid": "a27e124c2a8441be8212a622848c28cd",
"ownerAccountUuid": "b22d5d9b1c084589aa1abe30d2783bb8",
"resourceUuid": "c2fa286ab4ac41f18ce5219cc4482641",
"resourceType": "ImageVO",
"permission": 1.0,
"isShared": false
}
]
}
User Group Inventory
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The UUID. For more information, see Resource Property. | 0.6 | ||
| name | The name. For more information, see Resource Property. | 0.6 | ||
| description | The description. For more information, see Resource Property. | Yes | 0.6 | |
| accountUuid | The account UUID. | 0.6 | ||
| groupBy | Groups rows into subgroups based on values of columns or expressions. This field is equivalent to the Group By clause in MySQL, such as groupBy=type. | Yes | 0.6 | |
| createDate | The creation date. For more information, see Resource Property. | 0.6 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 |
Sample
{
"inventories": [
{
"uuid": "775eb58ab79a41c9803cc8ffc4996f80",
"accountUuid": "a3511b57fa06498b85c6c7150770120e",
"name": "usergroup"
}
]
}
User Inventory
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The UUID. For more information, see Resource Property. | 0.6 | ||
| name | The name. For more information, see Resource Property. | 0.6 | ||
| description | The description. For more information, see Resource Property. | Yes | 0.6 | |
| accountUuid | The account UUID. | 0.6 | ||
| groupBy | Groups rows into subgroups based on values of columns or expressions. This field is equivalent to the Group By clause in MySQL, such as groupBy=type. | Yes | 0.6 | |
| createDate | The creation date. For more information, see Resource Property. | 0.6 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 |
Sample
{
"inventories": [
{
"uuid": "b369a13fbbf64812802612040590a682",
"accountUuid": "9cf0fc6c3d8146dab03a5727da5ebe2b",
"name": "testuser"
}
]
}
Policy Inventory
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The UUID. For more information, see Resource Property. | 0.6 | ||
| name | The name. For more information, see Resource Property. | 0.6 | ||
| accountUuid | The account UUID. | 0.6 | ||
| statements | 0.6 | |||
| groupBy | Groups rows into subgroups based on values of columns or expressions. This field is equivalent to the Group By clause in MySQL, such as groupBy=type. | Yes | 0.6 | |
| createDate | The creation date. For more information, see Resource Property. | 0.6 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 |
Sample
{
"inventories": [
{
"statements": [
{
"name": "user-reset-password-10e0d5dc0a4846c8b7e2e204aa014370",
"effect": "Allow",
"actions": [
"identity:APIUpdateUserMsg"
]
}
],
"name": "USER-RESET-PASSWORD",
"uuid": "10e0d5dc0a4846c8b7e2e204aa014370",
"accountUuid": "2884beb74bff43569096365a90e696fb"
}
]
}
Quota Inventory
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| name | The name. For more information, see Resource Property. | 0.6 | ||
| identityUuid | The identity UUID, including account UUID and user UUID. | 0.6 | ||
| identityType | The identity type, including account and user | 0.6 | ||
| value | The default quota. | 0.6 | ||
| groupBy | Groups rows into subgroups based on values of columns or expressions. This field is equivalent to the Group By clause in MySQL, such as groupBy=type. | Yes | 0.6 | |
| createDate | The creation date. For more information, see Resource Property. | 0.6 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 |
Sample
{
"inventories": [
{
"name": "quota",
"identityUuid": "bdb6f9724a0d40d69ffa47856a916f93",
"value": 20.0
}
]
}
Shared Resource inventory
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| ownerAccountUuid | The owner account UUID. | 0.6 | ||
| receiverAccountUuid | The receiver account UUID. | 0.6 | ||
| toPublic | Whether to share the resource globally. | 0.6 | ||
| resourceType | The resource type. | 0.6 | ||
| resourceUuid | The resource UUID. | 0.6 | ||
| groupBy | Groups rows into subgroups based on values of columns or expressions. This field is equivalent to the Group By clause in MySQL, such as groupBy=type. | Yes | 0.6 | |
| createDate | The creation date. For more information, see Resource Property. | 0.6 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 |
Sample
{
"inventories": [
{
"ownerAccountUuid": "459f08b3915d4c06817e36587bd91fbb",
"receiverAccountUuid": "3de68725726544209999d5ec8172926e",
"toPublic": false,
"resourceType": "ImageVO",
"resourceUuid": "01f2f1309e9f4d67955a0648df6963a0"
}
]
}
Operations
CreateAccount
Creates an account. For example,
CreateAccount name=normal password=password
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| name | The resource name. | 0.6 | ||
| password | The password. | 0.6 | ||
| type | The account type. | Yes |
|
0.6 |
| description | The detailed description of the resource. | Yes | 0.6 | |
| resourceUuid | The resource UUID. | Yes | 0.6 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is AccountVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is AccountVO. | Yes | 0.6 | |
| timeout | Yes |
DeleteAccount
Deletes an account. For example,
DeleteAccount uuid=fb955f42278149a7b93e238a8c8bd272
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 0.6 | ||
| deleteMode | The delete mode. For more information, see Delete Resources. | Yes |
|
0.6 |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is AccountVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is AccountVO. | Yes | 0.6 | |
| timeout | Yes |
QueryAccount
Queries an account. For example,
QueryAccount uuid=c1a0038cfc004f59bf7a56c6da8d856b
QueryAccount user.uuid=523024a60fb4437ab141ce965eb50f05
Primitive Fields of Query
See Account Inventory.
Nested and Expanded Fields of Query
| Field | Inventory | Description | Starting Version |
|---|---|---|---|
| group | Group Inventory | 0.6 | |
| policy | Policy Inventory | 0.6 | |
| quota | Quota Inventory | 0.6 | |
| user | User Inventory | 0.6 |
UpdateAccount
Updates an account. For example,
UpdateAccount uuid=f536739a077040afa74af59ac085252b
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The account UUID. | 0.6 | ||
| name | The account name. | Yes | 0.6 | |
| password | The password. | Yes | 0.6 | |
| description | The detailed description of the resource. | Yes | 0.6 | |
| resourceUuid | The resource UUID. | Yes | 0.6 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is AccountVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is AccountVO. | Yes | 0.6 | |
| timeout | Yes |
LogInByAccount
Logs in to the cloud by using an account. For example,
LogInByAccount accountName=account1 password=password
# Use two-factor authentication.
LogInByAccount accountName=account1 password=password systemTags=twofatoken::123456
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| accountName | The account name. | 0.6 | ||
| password | The password. | 0.6 | ||
| captchaUuid | The verification code UUID. | Yes | 2.6.0 | |
| verifyCode | The verification code. | Yes | 2.6.0 | |
| clientInfo | The client information. | Yes | 3.5.0 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is AccountVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is AccountVO. | Yes | 0.6 | |
| timeout | Yes |
When you log in to ZStack Cloud by using an account, 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:
GetLoginCaptcha
Obtains login verification code. For example,
GetLoginCaptcha resourceName=admin loginType=Test
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| resourceName | The resource name. | 2.6.0 | ||
| loginType | The login type. | 2.6.0 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is AccountVO. | Yes | 2.6.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is AccountVO. | Yes | 2.6.0 | |
| timeout | Yes |
RefreshCaptcha
Refreshes login verification code. For example,
RefreshCaptcha uuid=4f9643d18f34440babd971793f6d0b3a
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 2.6.0 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is AccountVO. | Yes | 2.6.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is AccountVO. | Yes | 2.6.0 | |
| timeout | Yes |
GetTwoFactorAuthenticationSecret
Obtains a two-factor authentication secret. For example,
GetTwoFactorAuthenticationSecret name=admin password=password type=account
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| name | The resource name. | 2.6.0 | ||
| password | 2.6.0 | |||
| type |
|
2.6.0 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is AccountVO. | Yes | 2.6.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is AccountVO. | Yes | 2.6.0 | |
| timeout | Yes |
QueryTwoFactorAuthentication
Queries a two-factor authentication secret. For example,
QueryTwoFactorAuthentication uuid=b86c9016b4f24953a9edefb53ca0678c
Primitive Fields of Query
GetTwoFactorAuthenticationState
Obtains the two-factor authentication state. For example,
GetTwoFactorAuthenticationState
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| userTags | The user tags. For more information, see CreateUserTag. The resource type is AccountVO. | Yes | 2.6.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is AccountVO. | Yes | 2.6.0 | |
| timeout | Yes |
GetAccountQuotaUsage
Obtains the quota usage of an account. For example,
GetAccountQuotaUsage uuid=c1a0038cfc004f59bf7a56c6da8d856b
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is AccountVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is AccountVO. | Yes | 0.6 | |
| timeout | Yes |
QueryAccountResourceRef
Queries the reference between an account and a resource. For example,
QueryAccountResourceRef accountUuid=36c27e8ff05c4780bf6d2fa65700f22e resourceType=VolumeVO
Primitive Fields of Query
ShareResource
Shares resources to accounts. For example,
ShareResource resourceUuids=e29e00c1d18a486b8802a8f53c6a6e4f /
accountUuids=f536739a077040afa74af59ac085252b
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| resourceUuids | The resource UUID list. | 0.6 | ||
| accountUuids | The account UUID list. | Yes | 0.6 | |
| toPublic | Whether to share a resource globally. If false, you must specify the account UUID. | Yes | 0.6 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 | |
| timeout | Yes |
GetResourceAccount
Queries the account that a resource belongs to. For example,
GetResourceAccount resourceUuids=c1a0038cfc004f59bf7a56c6da8d856b
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| resourceUuids | The resource UUID. | 2.6.0 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.6.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.6.0 | |
| timeout | Yes |
CreateUserGroup
Creates a user group. For example,
CreateUserGroup name=usergroup1
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| name | The resource name. | 0.6 | ||
| description | The detailed description of the resource. | Yes | 0.6 | |
| resourceUuid | The resource UUID. | Yes | 0.6 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is UserGroupVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is UserGroupVO. | Yes | 0.6 | |
| timeout | Yes |
DeleteUserGroup
Deletes a user group. For example,
DeleteUserGroup uuid=f0f6fc4d36a341e3a61b560bd176b351
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 0.6 | ||
| deleteMode | The delete mode. For more information, see Delete Resources. | Yes |
|
0.6 |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is UserGroupVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is UserGroupVO. | Yes | 0.6 | |
| timeout | Yes |
QueryUserGroup
Queries a user group. For example,
QueryUserGroup accountUuid=f536739a077040afa74af59ac085252b
QueryUserGroup accountUuid=f536739a077040afa74af59ac085252b
Primitive Fields of Query
See User Group Inventory.
Nested and Expanded Fields of Query
| Field | Inventory | Description | Starting Version |
|---|---|---|---|
| account | Account Inventory | The account to which the user group belongs. | 0.6 |
| policy | Policy Inventory | The policy that is attached to the user group. | 0.6 |
| user | User Inventory | The user in the user group. | 0.6 |
UpdateUserGroup
Updates a user group. For example,
UpdateUserGroup uuid=101a72b491024d8fba5a946a9fb5ddb0
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 0.6 | ||
| name | The resource name. | Yes | 0.6 | |
| description | The detailed description of the resource. | Yes | 0.6 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is UserGroupVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is UserGroupVO. | Yes | 0.6 | |
| timeout | Yes |
AddUserToGroup
Adds a user to a user group. For example,
AddUserToGroup groupUuid=42a53ca7dec74b538bdbee48caa6e27a \
userUuid=ec6f8785d7344214a0e9adf94790aebe
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| userUuid | The user UUID. | 0.6 | ||
| groupUuid | The user group UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is UserGroupVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is UserGroupVO. | Yes | 0.6 | |
| timeout | Yes |
AttachPolicyToUserGroup
Attaches a policy to a user group. For example,
AttachPolicyToUserGroup groupUuid=101a72b491024d8fba5a946a9fb5ddb0 \
policyUuid=ffb698fe5c7d41b1a913fc3cb83e234c
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| policyUuid | The policy UUID. | 0.6 | ||
| groupUuid | The user group UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is UserGroupVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is UserGroupVO. | Yes | 0.6 | |
| timeout | Yes |
DetachPolicyFromUserGroup
Detaches a policy from a user group. For example,
DetachPolicyFromUserGroup groupUuid=101a72b491024d8fba5a946a9fb5ddb0 \
policyUuid=ffb698fe5c7d41b1a913fc3cb83e234c
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| policyUuid | The policy UUID. | 0.6 | ||
| groupUuid | The user group UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is UserGroupVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is UserGroupVO. | Yes | 0.6 | |
| timeout | Yes |
RemoveUserFromGroup
Removes a user from a user group. For example,
RemoveUserFromGroup groupUuid=101a72b491024d8fba5a946a9fb5ddb0 \
userUuid=523024a60fb4437ab141ce965eb50f05
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| userUuid | The user UUID. | 0.6 | ||
| groupUuid | The user group UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is UserGroupVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is UserGroupVO. | Yes | 0.6 | |
| timeout | Yes |
CreateUser
Creates a user. For example,
CreateUser name=user password=password
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| name | The user name. | 0.6 | ||
| password | The password. | 0.6 | ||
| description | The detailed description of the resource. | Yes | 0.6 | |
| resourceUuid | The resource UUID. | Yes | 0.6 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is UserVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is UserVO. | Yes | 0.6 | |
| timeout | Yes |
DeleteUser
Deletes a user. For example,
DeleteUser uuid=c9b34d9721394c45b6a70529f0aeb39b
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 0.6 | ||
| deleteMode | The delete mode. For more information, see Delete Resources. | Yes |
|
0.6 |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is UserVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is UserVO. | Yes | 0.6 | |
| timeout | Yes |
QueryUser
Queries a user. For example,
QueryUser accountUuid=36c27e8ff05c4780bf6d2fa65700f22e
QueryUser account.uuid=36c27e8ff05c4780bf6d2fa65700f22e
Primitive Fields of Query
See User Inventory.
Nested and Expanded Fields of Query
| Field | Inventory | Description | Starting Version |
|---|---|---|---|
| account | Account Inventory | The account to which the user belongs. | 0.6 |
| policy | Policy Inventory | The policy that is attached to the user. | 0.6 |
| group | Group Inventory | The user group to which the user belongs. | 0.6 |
UpdateUser
Updates a user. For example,
UpdateUser uuid=523024a60fb4437ab141ce965eb50f05
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | Yes | 0.6 | |
| name | The user name. | Yes | 0.6 | |
| password | The password. | Yes | 0.6 | |
| description | The detailed description of the resource. | Yes | 0.6 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is UserVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is UserVO. | Yes | 0.6 | |
| timeout | Yes |
LogInByUser
Logs in to the cloud as a user. For example,
LogInByUser userName=12user password=password accountName=12
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| accountUuid | The account UUID. | Yes | 0.6 | |
| accountName | The account name. | Yes | 0.6 | |
| userName | The user name. | 0.6 | ||
| password | The password. | 0.6 | ||
| clientInfo | The client information. | Yes | 3.5.0 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is UserVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is UserVO. | Yes | 0.6 | |
| timeout | Yes |
AttachPolicyToUser
Attaches a policy to a user. For example,
AttachPolicyToUser userUuid=5fb5b7ba87fb4c07ad3ec89ed0b41379 \
policyUuid=8dadd2b163c14d639e03ea9c8bc17b9f
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| userUuid | The user UUID. | 0.6 | ||
| policyUuid | The policy UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is UserVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is UserVO. | Yes | 0.6 | |
| timeout | Yes |
DetachPolicyFromUser
Detaches a policy from a user group. For example,
DetachPolicyFromUser policyUuid=8dadd2b163c14d639e03ea9c8bc17b9f \
userUuid=5fb5b7ba87fb4c07ad3ec89ed0b41379
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| userUuid | The user UUID. | 0.6 | ||
| policyUuid | The policy UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is UserVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is UserVO. | Yes | 0.6 | |
| timeout | Yes |
AttachPoliciesToUser
Attaches multiple policies to a user. For example,
AttachPoliciesToUser userUuid=5fb5b7ba87fb4c07ad3ec89ed0b41379 \
policyUuids=9e092aafa9a14af187d67b4072dd8eda,5cde60162d6e4f9a8e1984bd0fda542b
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| userUuid | The user UUID. | 0.6 | ||
| policyUuids | The policy UUID list. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is UserVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is UserVO. | Yes | 0.6 | |
| timeout | Yes |
DetachPoliciesFromUser
Detaches multiple policies from a user. For example,
DetachPoliciesFromUser userUuid=5fb5b7ba87fb4c07ad3ec89ed0b41379 \
policyUuids=9e092aafa9a14af187d67b4072dd8eda,5cde60162d6e4f9a8e1984bd0fda542b
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| userUuid | The user UUID. | 0.6 | ||
| policyUuids | The policy UUID list. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is UserVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is UserVO. | Yes | 0.6 | |
| timeout | Yes |
CreatePolicy
Creates a policy. For example,
CreatePolicy name=all statements='[{"actions":[".*"], "effect":"Allow"}]'
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| name | The resource name. | 0.6 | ||
| description | The detailed description of the resource. | Yes | 0.6 | |
| statements | The policy statements. | 0.6 | ||
| resourceUuid | The resource UUID. | Yes | 0.6 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is PolicyVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is PolicyVO. | Yes | 0.6 | |
| timeout | Yes |
DeletePolicy
Deletes a policy. For example,
DeletePolicy uuid=9e092aafa9a14af187d67b4072dd8eda
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 0.6 | ||
| deleteMode | The delete mode. For more information, see Delete Resources. | Yes |
|
0.6 |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is PolicyVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is PolicyVO. | Yes | 0.6 | |
| timeout | Yes |
QueryPolicy
Queries a policy. For example,
QueryPolicy uuid=5cde60162d6e4f9a8e1984bd0fda542b
QueryPolicy account.uuid=2cfc587668474aa9ae544c014bfbd36e
Primitive Fields of Query
See Policy Inventory.
Nested and Expanded Fields of Query
| Field | Inventory | Description | Starting Version |
|---|---|---|---|
| account | Account Inventory | 0.6 | |
| group | Group Inventory | 0.6 | |
| user | User Inventory | 0.6 |
QueryQuota
Queries a quota. For example,
QueryQuota name=vm.num
QueryQuota account.uuid=f536739a077040afa74af59ac085252b
Primitive Fields of Query
See Quota Inventory.
Nested and Expanded Fields of Query
| Field | Inventory | Description | Starting Version |
|---|---|---|---|
| account | Account Inventory | 0.6 |
UpdateQuota
Updates a quota. For example,
UpdateQuota identityUuid=f536739a077040afa74af59ac085252b name=vm.num value=25
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| identityUuid | The identity UUID of an account. | 0.6 | ||
| name | The resource name. | 0.6 | ||
| value | The quota value. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is QuotaVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is QuotaVO. | Yes | 0.6 | |
| timeout | Yes |
GetResourceNames
Obtains resource names. For example,
GetResourceNames uuids=bd73a3d1e6784d49897be5ae785305d8
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuids | The resource UUID list. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is ResourceVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is ResourceVO. | Yes | 0.6 | |
| timeout | Yes |
QuerySharedResource
Queries a shared resource. For example,
QuerySharedResource resourceUuid=6ec89e13f4a05ed4be42dabfcdad6dd7
Nested and Expanded Fields of Query
RevokeResourceSharing
Revokes resource sharing. For example,
RevokeResourceSharing resourceUuids=6ec89e13f4a05ed4be42dabfcdad6dd7 all=true
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| resourceUuids | The resource UUID list. | 0.6 | ||
| toPublic | Whether to share the resource globally. | Yes | 0.6 | |
| accountUuids | The account UUID list. | Yes | 0.6 | |
| all | If false, the account UUID is required. | Yes | 0.6 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 | |
| timeout | Yes |
ChangeResourceOwner
Changes the resource owner. For example,
ChangeResourceOwner accountUuid=2cfc587668474aa9ae544c014bfbd36e \
resourceUuid=1ad7f7f385d64e2fb7531ee3a06bcf8d
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| accountUuid | The account UUID. | 0.6 | ||
| resourceUuid | The resource UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 | |
| timeout | Yes |
CheckApiPermission
Checks the API permission. For example,
CheckApiPermission apiNames=org.zstack.storage.primary.local.APIQueryLocalStorageResourceRefMs
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| userUuid | The user UUID. | 0.6 | ||
| apiNames | The API name list. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 | |
| timeout | Yes |
ValidateSession
Validates a session. For example,
ValidateSession sessionUuid=7f69ae7ed38941adb54ba8777ae68cb5
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| sessionUuid | The session UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 | |
| timeout | Yes |
LogOut
Logs out of the current session. For example,
LogOut sessionUuid=d22049be779b455f86bc3484becad10f
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| sessionUuid | The session UUID. | Yes | 0.6 | |
| clientInfo | The client information. | Yes | 3.5.0 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 0.6 | |
| timeout | Yes |
RenewSession
Renews a session. For example,
RenewSession sessionUuid=7b93b7648aea3c8d9109498a32288470
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| duration | Yes | 2.3 | ||
| sessionUuid | The session UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is PolicyVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is PolicyVO. | Yes | 0.6 | |
| timeout | Yes |
Tags
You can create a user tag on a user by using CreateUserTag resourceType=UserTagVO. For example,
CreateUserTag resourceType=UserTagVO tag=Test1 \
resourceUuid=3214e0dcd01d4e2aa8407968e1c51d58
