Help Center/ Huawei Cloud Flexus_Huawei Cloud Flexus L Instance/ API Reference/ API/ Resetting Cloud Server Passwords in a Batch
Updated on 2024-09-27 GMT+08:00

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

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"
  }
 ]
}