Deleting ECSs

Function

This interface is used to delete ECSs based on a specified ECS ID list. The ECSs can be deleted one by one or in batches.

URI

  • URI format

    POST /v1/{project_id}/cloudservers/delete

  • Parameter description

    Name

    Mandatory

    Description

    project_id

    Yes

    Specifies the tenant ID.

Request

  • Parameter description

    Name

    Mandatory

    Type

    Description

    servers

    Yes

    List data structure [1]

    Specifies the ECSs to be deleted.

    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 of this parameter can be true or 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 of this parameter is false or true.

    • 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.

[1] servers field data structure description

Name

Mandatory

Type

Description

id

Yes

String

Specifies the ID of the ECS to be deleted.

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

Response

See Response.

Returned Values

See Returned Values.

Registration