Help Center/ Elastic Cloud Server/ API Reference/ APIs/ Batch Operations/ Modifying ECS Details in a Batch
Updated on 2026-03-19 GMT+08:00

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.

Debugging

You can debug this API in API Explorer.

Authorization

Each account has all of the permissions required to call all APIs, but IAM users must have the required permissions specifically assigned.
  • If you are using role/policy-based authorization, see the required permissions in Permissions and Supported Actions.
  • If you are using identity policy-based authorization, the permissions listed below are required.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

ecs:cloudServers:batchUpdateServersName

write

instance *

-

ecs:cloudServers:put

-

URI

PUT /v1/{project_id}/cloudservers/server-name

Table 1 describes the parameter in the URI.

Table 1 Parameter description

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.

Table 2 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

  • true: The system checks the request. Check items include mandatory parameters, request format, and constraints.
    • If the check fails, the system returns an error.
    • If the check is successful, the system returns a normal response.

      For details about the response structure, see Responses (Batch Requests).

  • false: The system sends the request without checking the request body.

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

Table 3 servers field description

Parameter

Type

Mandatory

Description

id

String

Yes

Definition

Specifies the ECS ID.

Constraints

N/A

Range

N/A

Default Value

N/A

Response

Table 4 describes the response parameters.

Table 4 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

Table 5 response field description

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

Error Codes

See Error Codes.