Document navigation

DestroyVmInstance

API Request

URLs

DELETE zstack/v1/vm-instances/{uuid}?deleteMode={deleteMode}

Headers

Authorization: OAuth the-session-uuid

Curl Sample

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 8d618c25ba3b4eb7bc6dda7e47d1b6b4" \
-X DELETE http://localhost:8080/zstack/v1/vm-instances/5e22e2b1c4ab40739cd0b7717368dfa7?deleteMode=Permissive

Request Parameters

Name Type Location Description Optional Value Starting Version
uuid String url The VM instance UUID. 0.6
deleteMode String body Optional. The delete mode. 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,

{
    "error": {
        "code": "SYS.1001",
        "description": "A message or a operation timeout",
        "details": "Create VM on KVM timeout after 300s"
    }
}

SDK Sample

Java SDK

DestroyVmInstanceAction action = new DestroyVmInstanceAction();
action.uuid = "c0b82973fbed42a09f3a30ce142fb168";
action.deleteMode = "Permissive";
action.sessionId = "97ddb4b10e34452c90d8591927cf3de5";
DestroyVmInstanceAction.Result res = action.call();

Python SDK

action = DestroyVmInstanceAction()
action.uuid = "0de3629902f1449d86256934552d5b3d"
action.deleteMode = "Permissive"
action.sessionId = "931c9e7e586c4b5fa44ed1155985ac1a"
res = action.call()