Modifying IAM User Information (Recommended)
Function
This API is provided for the administrator to modify IAM user information.
The API can be called using both the global endpoint and region-specific endpoints. For IAM endpoints, see Regions and Endpoints.
URI
PUT /v3.0/OS-USER/users/{user_id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| user_id | Yes | String | IAM user ID. For details about how to obtain a user ID, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | Yes | String | Fill application/json;charset=utf8 in this field. |
| X-Auth-Token | Yes | String | Token with Security Administrator permissions. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Yes | Object | IAM user information. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | No | String | New IAM user name, which consists of 1 to 32 characters. It can contain letters, digits, spaces, hyphens (-), underscores (_), and periods (.) and cannot start with a digit. |
| password | No | String | Password of the user. The password must meet the following requirements:
|
| | No | String | Email address, which can contain not more than 255 characters. |
| areacode | No | String | Country code. The country code must be used together with a mobile number. The country code of the Chinese mainland is 0086. |
| phone | No | String | New mobile number, which can contain a maximum of 32 digits. The mobile number must be used together with a country code. |
| enabled | No | Boolean | Enabling status of the IAM user. true (default value) indicates that the user is enabled. false indicates that the user is disabled. |
| pwd_status | No | Boolean | Password status. true means that the password needs to be changed, and false means that the password is normal. |
| xuser_type | No | String | Type of the IAM user in the external system. The user type can contain a maximum of 64 characters. xuser_type must be used together with xuser_id and will be verified based on xaccount_type and xdomain_type of the same account. NOTE: An external system refers to an enterprise management system connected to HUAWEI CLOUD. Parameters xaccount_type, xaccount_id, xdomain_type, xdomain_id, xuser_type, and xuser_id cannot be obtained from HUAWEI CLOUD. Please contact your enterprise administrator. |
| xuser_id | No | String | ID of the IAM user in the external system. The user ID can contain a maximum of 128 characters, and must be used together with xuser_type. NOTE: An external system refers to an enterprise management system connected to HUAWEI CLOUD. Parameters xaccount_type, xaccount_id, xdomain_type, xdomain_id, xuser_type, and xuser_id cannot be obtained from HUAWEI CLOUD. Please contact your enterprise administrator. |
| access_mode | No | String | Access type of the IAM user.
|
| description | No | String | Description of the IAM user. |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| Object | IAM user information. |
| Parameter | Type | Description |
|---|---|---|
| pwd_status | Boolean | Password status. true means that the password needs to be changed, and false means that the password is normal. |
| xuser_id | String | ID of the IAM user in the external system. NOTE: An external system refers to an enterprise management system connected to HUAWEI CLOUD. Parameters xaccount_type, xaccount_id, xdomain_type, xdomain_id, xuser_type, and xuser_id cannot be obtained from HUAWEI CLOUD. Please contact your enterprise administrator. |
| xuser_type | String | Type of the IAM user in the external system. NOTE: An external system refers to an enterprise management system connected to HUAWEI CLOUD. Parameters xaccount_type, xaccount_id, xdomain_type, xdomain_id, xuser_type, and xuser_id cannot be obtained from HUAWEI CLOUD. Please contact your enterprise administrator. |
| access_mode | String | Access type of the IAM user.
|
| description | String | Description of the IAM user. |
| name | String | New IAM user name with 5 to 32 characters. The username can contain special characters, but only hyphens (-), underscores (_), and spaces are allowed. It cannot start with a digit. |
| phone | String | New mobile number, which can contain a maximum of 32 digits. The mobile number must be used together with a country code. |
| domain_id | String | ID of the account to which the IAM user belongs. |
| enabled | Boolean | Enabling status of the IAM user. true (default value) indicates that the user is enabled. false indicates that the user is disabled. |
| areacode | String | Country code. The country code of the Chinese mainland is 0086. |
| | String | New email address. |
| id | String | IAM user ID. |
| Object | IAM user resource link information. | |
| password_expires_at | String | Password expiration time (UTC time) This parameter will not be returned if its value is null. |
Example Request
PUT https://iam.myhuaweicloud.com/v3.0/OS-USER/users/{user_id} {
"user": {
"email": "IAMEmail@huawei.com",
"areacode": "0086",
"phone": "12345678910",
"enabled": true,
"name": "IAMUser",
"password": "IAMPassword@",
"pwd_status": false,
"xuser_type": "",
"xuser_id": "",
"access_mode" : "default",
"description": "IAMDescription"
}
} Example Response
Status code: 200
The request is successful.
{
"user": {
"description": "IAMDescription",
"areacode": "0086",
"enabled": true,
"pwd_status": false,
"xuser_id": "",
"access_mode" : "default",
"domain_id": "d78cbac186b744899480f25bd0...",
"phone": "12345678910",
"name": "IAMUser",
"links": {
"self": "https://iam.huaweicloud.com/3.0/OS-USER/users/076934ff9f0010cd1f0bc003..."
},
"id": "076934ff9f0010cd1f0bc0031019...",
"xuser_type": "",
"email": "IAMEmail@huawei.com"
}
} Status Codes
| Status Code | Description |
|---|---|
| 200 | The request is successful. |
| 400 | Invalid parameters. |
| 401 | Authentication failed. |
| 403 | Access denied. |
| 404 | The requested resource cannot be found. |
| 405 | The method specified in the request is not allowed for the requested resource. |
| 409 | A resource conflict occurs. |
| 413 | The request entity is too large. |
| 500 | Internal server error. |
| 503 | Service unavailable. |
Error Codes
For details, see Error Codes.
Last Article: Modifying IAM User Information (Recommended)
Next Article: Modifying User Information
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.