Resetting Cloud Server Passwords in a Batch
Function
This API is used to reset the password of the cloud server management accounts (root or Administrator) in a batch. It is the API for resetting the passwords of ECS management accounts in a batch. This section lists the key information about using the API. For more information about the API, see Resetting the Passwords for Logging In to ECSs in a Batch.
This API used by cloud servers in the FlexusL instances is the same as that used by ECSs. The response parameter description, API usage example, and return values of ECSs also apply to the FlexusL instances.
Constraints
- Before using this API, you must install the password reset plug-in.
By default, the password reset plug-in has been installed in the system images and application images provided by the FlexusL instances.
If the private image is created from a server on another cloud platform or downloaded from a third party, the image may not have the password reset plug-in installed, so the password reset function is unavailable. Install the plug-in by following the instructions provided in What Should I Do If the Password Cannot Be Reset After I Use a Private Linux Image to Create a FlexusL Instance or Change the OS of an Existing Instance and I Forgot the Initial Password of the Private Image?
- 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 cloud server is started or restarted.
- This API allows you to reset passwords when the target cloud servers are running or stopped.
URI
PUT /v1/{project_id}/cloudservers/os-reset-passwords
Request Message
In the request message, id in the servers field is the cloud server ID. Obtain the cloud server ID based on Querying a Created FlexusL Instance.
Example Request
Reset the passwords of the FlexusL instances whose cloud server IDs are 72a270de-665a-4f46-8d64-24ad6edccdd1 or 72a270de-665a-4f46-8d64-24ad6edccdd2 to password@123.
PUT https://{endpoint}/v1/{project_id}/cloudservers/os-reset-passwords { "new_password": "password@123", "servers": [ { "id": "72a270de-665a-4f46-8d64-24ad6edccdd1" }, { "id": "72a270de-665a-4f46-8d64-24ad6edccdd2" } ] }
Example Response
{ "response": [ { "id": "72a270de-665a-4f46-8d64-24ad6edccdd1" } { "id": "72a270de-665a-4f46-8d64-24ad6edccdd2" } ] }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot