Modifying ECS Details in a Batch
Function
This API is used to modify ECS details in a batch.
Currently, only ECS names can be changed in a batch, and a maximum of 100 ECSs can be modified at a time.
URI
PUT /v1/{project_id}/cloudservers/server-name
Table 1 describes the parameter in the URI.
| Parameter | Mandatory | Description |
|---|---|---|
| project_id | Yes | Definition Specifies the project ID. For details about how to obtain the ID, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
Request
Table 2 describes the request parameters.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| name | String | Yes | Definition Specifies the changed name of the ECSs. Constraints The parameter value consists of 1 to 128 characters, including letters, digits, underscores (_), hyphens (-), and periods (.). After you change ECS names in a batch, the system does not automatically add a digital suffix to the changed names. For example, there are three ECSs, test_0001, test_0002, and test_0003. After their names are changed to develop in a batch, their changed names are all develop. Range N/A Default Value N/A |
| dry_run | Boolean | No | Definition Specifies whether the system checks the request. If this parameter is set to true, the system checks the request, but the ECS name will not be changed. Constraints N/A Range
Default Value false |
| servers | Array of objects | Yes | Definition Specifies the IDs of the target ECSs. For details, see Table 3. Constraints N/A Range N/A Default Value N/A |
Response
Table 4 describes the response parameters.
| Parameter | Type | Description |
|---|---|---|
| response | Array of objects | Definition Specifies the response returned after a request is delivered. For details, see Table 1. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition Specifies the ID of the ECS on which the operation is successful. Range N/A |
Example Request
Batch modify the names of the ECSs whose IDs are 260a0917-f7df-4b25-93ac-950da6c6b5d6 and f6d8df1a-e257-48e2-b617-1dd92ced8c20 to new-server-name.
PUT https://{endpoint}/v1/{project_id}/cloudservers/server-name
{
"name": "new-server-name",
"dry_run": false,
"servers": [
{
"id":"260a0917-f7df-4b25-93ac-950da6c6b5d6"
},
{
"id":"f6d8df1a-e257-48e2-b617-1dd92ced8c20"
}
]
} Example Response
See Responses (Batch Requests).
{
"response": [
{
"id": "616fb98f-46ca-475e-917e-2563e5a8cd19"
},
{
"id": "516fb98f-46ca-475e-917e-2563e5a8cd12"
}
]
} Returned Values
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.