Resetting the Passwords for Logging In to ECSs in a Batch
Function
This API is used to reset the passwords of the ECS management account, root or Administrator, in a batch.
Constraints
- Before using this API, you must install password reset plug-ins. For instructions about how to download and install the password reset plug-ins, see Installing One-Click Password Reset Plug-ins in Elastic Cloud Server User Guide.
- After the request for resetting the password is issued, this API does not report an error if executing the script failed.
- A new password takes effect after the ECS is started or restarted.
- This API allows you to reset passwords when the target ECSs are running or stopped.
URI
PUT /v1/{project_id}/cloudservers/os-reset-passwords
Table 1 lists the URI parameters.
|
Parameter |
Mandatory |
Description |
|---|---|---|
|
project_id |
Yes |
Specifies the project ID. For details about how to obtain the ID, see Obtaining a Project ID. |
Request
Table 2 describes the request parameters.
|
Parameter |
Type |
Mandatory |
Description |
|---|---|---|---|
|
new_password |
String |
Yes |
Specifies the new password. This field is mandatory only if dry_run is set to false.
A new password must comply with the following rules:
|
|
dry_run |
Boolean |
No |
Specifies whether to check the request and reset ECS passwords.
The default value is false. |
|
servers |
Array of objects |
Yes |
Specifies the IDs of the target ECSs. For details, see Table 3. |
Response
Example Request
PUT https://{endpoint}/v1/{project_id}/cloudservers/os-reset-passwords
{
"new_password": "Test@123",
"dry_run": true,
"servers": [
{
"id":"1bd0eb17-4466-4c15-a9ce-87727ad311b5"
},
{
"id":"fd6b6e9d-64a1-40fa-b7dc-f491be42fdd2"
}
]
}
Example Response
Returned Values
Error Codes
Last Article: Modifying ECSs in a Batch
Next Article: Attaching a Specified Shared EVS Disk to Multiple ECSs
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.