Deleting ECSs
Function
This API is used to delete ECSs based on a specified ECS ID list.
This API is an asynchronous API. After the deletion request is successfully delivered, a job ID is returned. This does not mean the deletion is complete. You need to call the API by referring to Querying Task Execution Status to query the job status. The SUCCESS status indicates that the deletion is successful.
You can delete a single ECS or multiple ECSs in a batch. A maximum of 1,000 ECSs can be deleted in a batch.
Only ECSs billed in the pay-per-use mode can be deleted.
URI
POST /v1/{project_id}/cloudservers/delete
Parameter |
Mandatory |
Description |
---|---|---|
project_id |
Yes |
Specifies the project ID. For details about how to obtain the ID, see Obtaining a Project ID. |
Request
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
servers |
Yes |
Array of objects |
Specifies the ECSs to be deleted. For details, see Table 3. |
delete_publicip |
No |
Boolean |
Specifies whether to delete the EIP bound to the ECS when deleting the ECS. If you do not want to delete the EIP, the system only unbinds the EIP from the ECS and reserves the EIP. The value can be true or false.
NOTE:
If delete_publicip is not specified, the delete_on_termination value of the EIP decides whether the EIP is released when the ECS is deleted.
|
delete_volume |
No |
Boolean |
Specifies whether to delete the data disks attached to an ECS when deleting the ECS. If you set the parameter value to false, the system only detaches the disks from the ECS and reserves the disks. The default value is false.
|
Response
See Responses (Task).
Example Request
POST https://{endpoint}/v1/{project_id}/cloudservers/delete { "servers": [ { "id": "616fb98f-46ca-475e-917e-2563e5a8cd19" } ], "delete_publicip": false, "delete_volume": false }
Example Response
{ "job_id": "ff80808288d415d80189901d8eb81cbb" }
Or
{ "error": { "message": "request body is illegal.", "code": "Ecs.0005" } }
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot