Add Users
This API is used to add one or more users.
Description
You can call this operation to add one or more users. You can specify the user group to which you want to add users. Two user groups are available: users
and wheel
. If you add users to the wheel
group, the users are assigned the sudo permission.
Request parameters
Field | Type | Required | Default value | Description |
---|---|---|---|---|
Action | String | Yes | - | Operation interface name, required parameter; value: AddUsers. |
RegionId | String | Yes | - | Region ID. |
ClusterId | String | Yes | - | Cluster ID. |
User.n.Name | String | Yes | - | User name of the nth account to be added (n starts from 1. You can enter n multiple times.) It is a string of 6 to 30 uppercase/lowercase letters, numbers, and “.”. It must begin with a letter. |
User.n.Group | String | Yes | - | User group of the nth account to be added (n starts from 1. You can enter n multiple times.) Currently, only user groups ‘users’ and ‘wheel’ are supported. ‘wheel’ is the user group with sudo permissions. |
User.n.Password | String | Yes | - | Password of the nth account to be added (n starts from 1. You can enter n multiple times.) The password is a string of 8 to 30 characters and must contain uppercase/lowercase letters, numbers, and special characters. Call API by HTTPS to prevent password leakage. |
Return parameters
This operation returns only common response parameters. For more information, see common response parameters.
Error codes
For more information about E-HPC error codes,see Error codes. For a list of error codes, visit the API Error Center.
DeleteUsers
Delete one or more users.
Description
You can call this operation to delete one or more users. Before you delete users, we recommend that you call the following operation: AddUsers.
Request parameters
Field | Type | Required | Default value | Description |
---|---|---|---|---|
Action | String | Yes | - | Operation interface name, required parameter; value: DeleteUsers |
RegionId | String | Yes | - | Region ID |
ClusterId | String | Yes | - | Cluster ID |
User.n.Name | String | Yes | - | User name of the nth account to be deleted (n starts from 1. Multiple entries are supported.) |
Note: Files in the home directory cannot be deleted.
Return parameters
This operation returns only common response parameters. For more information, see common response parameters.
Error codes
For more information about E-HPC error codes,see Error codes. For a list of error codes, visit the API Error Center.
ListUsers
Query the users of a cluster.
Description
You can call this operation to query the users of a cluster.
Request parameters
Field | Type | Required | Default value | Description |
---|---|---|---|---|
Action | String | Yes | - | Operation interface name, required parameter; value: ListUsers |
RegionId | String | Yes | - | Region ID |
ClusterId | String | Yes | - | Cluster ID |
PageNumber | Integer | No | 1 | Displayed page number; initial value: 1 |
PageSize | Integer | No | 10 | Number of entries per page; value range: 1 to 50 |
Return parameters
The response parameters include both common parameters and the following parameters:
Field | Type | Description |
---|---|---|
Users | Array<UserInfo> | Array of user accounts |
TotalCount | Integer | Total number of entries in the list |
PageNumber | Integer | Current page number |
PageSize | Integer | Number of entries on the current page |
Each element of the UserInfo structure includes the following fields:
Field | Type | Description |
---|---|---|
Name | String | User name. |
Group | String | User permission group. Currently, user groups ‘users’ and ‘wheel’ are supported. Users in user group ‘users’ have general permissions, and users in user group ‘wheel’ have sudo permissions. |
AddTime | String | User addition time. |
Error codes
For more information about E-HPC error codes,see Error codes. For a list of error codes, visit the API Error Center.
ModifyUserGroups
Change the user groups to which one or more users belong.
Description
You can call this operation to change the user groups to which one or more users belong.
Request parameters
Field | Type | Required | Default value | Description |
---|---|---|---|---|
Action | String | Yes | - | Operation interface, required; value: ModifyUserGroups. |
RegionId | String | Yes | - | Region ID. |
ClusterId | String | Yes | - | Cluster ID. |
Users | String | Yes | - | Array of modified user information, in JSON string format, for example, ‘[{“Username”:”somename1”,”Group”:”users”},{“Username”:”somename2”,”Group”:”wheel”}]’. |
User.n.Name | String | Yes | - | User name of the nth account whose user group to be modified. (n starts from 1. Multiple entries are sepported.) |
User.n.Group | String | Yes | - | User group of the nth account to be modified (n starts from 1. You can enter n multiple times.) Currently, only user groups ‘users’ and ‘wheel’ are supported. ‘wheel’ is the user group with sudo permissions. |
Return parameters
This operation returns only common response parameters. For more information, see common response parameters.
Error codes
For more information about E-HPC error codes,see Error codes. For a list of error codes, visit the API Error Center.
ModifyUserPasswords
Modify one or more user passwords.
Description
You can call this operation to modify the passwords of one or more users in a cluster.
Request parameters
Field | Type | Required | Default value | Description |
---|---|---|---|---|
Action | String | Yes | - | Operation interface name, required parameter; value: ModifyUserPasswords. |
RegionId | String | Yes | - | Region ID. |
ClusterId | String | Yes | - | Cluster ID. |
User.n.Name | String | Yes | - | User name of the nth account whose to be modified. (n starts from 1. Multiple extries are supported.) |
User.n.Password | String | Yes | - | New password of the nth account (n starts from 1. You can enter n multiple times.) The password is a string of 8 to 30 characters and must contain uppercase/lowercase letters, numbers, and special characters. Call API by HTTPS to prevent password leakage. |
Return parameters
This operation returns only common response parameters. For more information, see common response parameters.
Error codes
For more information about E-HPC error codes,see Error codes. For a list of error codes, visit the API Error Center.