• Elastic Cloud Server

ecs
  1. Help Center
  2. Elastic Cloud Server
  3. API Reference
  4. Extension ECS APIs
  5. Lifecycle Management
  6. Deleting ECSs

Deleting ECSs

Function

This interface is used to delete ECSs based on a specified ECS ID list.

You can delete a single ECS or multiple ECSs in batches. A maximum of 1000 ECSs can be deleted in a batch.

URI

POST /v1/{project_id}/cloudservers/delete

Table 1 describes the parameters in the URI.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

Request

Request parameters

Table 2 describes the request parameters.
Table 2 Request parameters

Parameter

Mandatory

Type

Description

servers

Yes

List data structure

Specifies the ECSs to be deleted. For details, see Table 3.

delete_publicip

No

Boolean

Specifies whether to delete the elastic IP address bound to the ECS when deleting the ECS. If you do not want to delete the elastic IP address, the system only unbinds the elastic IP address from the ECS and reserves the IP address.

The value can be true or false. The default value is false.

  • true: indicates to delete the elastic IP address bound to the ECS when deleting the ECS.
  • false: indicates only to unbind the elastic IP address bound to the ECS when deleting the ECS.

delete_volume

No

Boolean

Specifies whether to delete the data disk of the ECS. If you do not want to delete the elastic IP address, the system only unbinds the disks from the ECS and reserves the disks.

The value can be true or false. The default value is false.

  • true: indicates to delete the data disks attached to the ECS when deleting the ECS.
  • false: indicates only to detach the data disks attached to the ECS when deleting the ECS.
Table 3 servers field description

Parameter

Mandatory

Type

Description

id

Yes

String

Specifies the ID of the ECS to be deleted.

Response

See Responses (Task).

Examples

  • Example request
    {
        "servers": [
            {
                "id": "616fb98f-46ca-475e-917e-2563e5a8cd19"
            }
        ], 
        "delete_publicip": false, 
        "delete_volume": false
    }
  • Example response

    None

Returned Values

See General Request Returned Values.

Error Code

See Error Code Description.