VM Related Interfaces

Get VM Capabilities

GET/zstack/v1/vm-instances/{uuid}/capabilities

Get the capabilities of a Virtual Machine to determine whether the Virtual Machine can perform specific operations. Currently defined capabilities include:

NameDescriptionType
LiveMigrationWhether live migration is supportedBoolean
VolumeMigrationWhether root disk migration is supportedBoolean

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b883d676f4514489ab993c87f6a8ee70" \
-X GET http://localhost:8080/zstack/v1/vm-instances/7a6c30c6de654cdf9d29b18a78c83a64/capabilities

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlVirtual Machine UUID 0.6
systemTags (Optional)ListquerySystem Tags 0.6
userTags (Optional)ListqueryUser Tags 0.6

API Response

Response Example

{
  "capabilities": {
    "LiveMigration": false,
    "Reimage": false,
    "VolumeMigration": true
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
capabilitiesMapVirtual Machine capabilities result0.6
errorErrorCodeError code. If not null, the operation failed. When the operation succeeds, this field is null. For details, see error0.6

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier of the error, for example SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, defaults to null0.6
opaqueLinkedHashMapReserved field, defaults to null0.6
causeErrorCodeRoot cause. The error that triggered the current error. If there is no original error, this field is null0.6

SDK Examples

Java SDK

GetVmCapabilitiesAction action = new GetVmCapabilitiesAction();
action.uuid = "2323ae79b3894f0a85018a2a458247aa";
action.sessionId = "05233d04bc144482a5b4a74fdea06408";
GetVmCapabilitiesAction.Result res = action.call();

Python SDK

GetVmCapabilitiesAction action = GetVmCapabilitiesAction()
action.uuid = "0fb5a5b4a3e54314ba1c5fa2e07384d2"
action.sessionId = "71df5d9cf30845dba8d1ef804bdf2108"
GetVmCapabilitiesAction.Result res = action.call()