Changing the Password of a DCS Instance¶
Function¶
This API is used to change the password of a DCS instance.
URI¶
PUT /v1.0/{project_id}/instances/{instance_id}/password
Table 1 describes the parameters.
Parameter | Type | Mandatory | Description |
---|---|---|---|
project_id | String | Yes | Project ID. |
instance_id | String | Yes | DCS instance ID. |
Request¶
Request parameters
Table 2 describes the request parameters.
Parameter | Type | Mandatory | Description |
---|---|---|---|
old_password | String | Yes | Old password. |
new_password | String | Yes | New password. Password complexity requirements:
|
Example request
Request URL:
PUT https://{dcs_endpoint}/v1.0/{project_id}/instances/{instance_id}/password
Example:
{ "old_password": "XXXXXX", "new_password": "XXXXXX" }
Response¶
Response parameters
Table 3 describes the response parameters.
Parameter | Type | Description |
---|---|---|
result | String | An indicator of whether the password is successfully changed: Options:
|
message | String | Result of password change. |
retry_times_left | String | Number of remaining password attempts. If the old password is incorrect, the value of this parameter is not null. |
lock_time | String | Account lockout duration. If the old password is incorrect or the account is locked, the value of this parameter is not null. |
lock_time_left | String | Remaining time before the account is unlocked. If the account is locked, the value of this parameter is not null. |
Example response
//Change password success.
{
"result" : "Success",
"message" : "Modify DCSInstance password success.",
"retry_times_left" : "5",
"lock_time" : "0",
"lock_time_left" : "0"
}
//Change password failed.
{
"result" : "passwordFailed",
"message" : "verify password failed.",
"retry_times_left" : "4",
"lock_time" : "5",
"lock_time_left" : "5"
}
Status Code¶
Table 4 describes the status code of successful operations. For details about other status codes, see Table 1.
Status Code | Description |
---|---|
200 | Password changed successfully. |