VM Related Interfaces

Query VM Template

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

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vm-instances/templatedVmInstance?q=uuid=2ed42f5960c43ba287bb486badfdd727
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vm-instances/templatedVmInstance/8152b4c564f537808ae6e46dd8d8c245

Queryable Fields

Run the CLI command tool, enter QueryTemplatedVmInstance and press Tab to view all queryable fields and resource names that can be queried across tables.

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "e0746082b05030a1ac908cc43a424b84",
      "name": "templatedVmInstance",
      "zoneUuid": "ecf920e0ded43afe831b2c9fbde1c0d9",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 4.2.6
inventoriesListFor details, see inventories4.2.6
errorErrorCodeError code. If not null, the operation failed. When the operation is successful, this field is null. For details, see error4.2.6

inventories

NameTypeDescriptionStarting Version
uuidStringUUID of the resource, uniquely identifying the resource4.2.6
nameStringResource name4.2.6
zoneUuidStringData Center UUID4.2.6
createDateTimestampCreate time4.2.6
lastOpDateTimestampLast modification time4.2.6

error

NameTypeDescriptionStarting Version
codeStringError code number, 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, default is null0.6
opaqueLinkedHashMapReserved field, default is null0.6
causeErrorCodeRoot cause: the source error that triggered the current error. If there is no original error, this field is null0.6

SDK Examples

Java SDK

QueryTemplatedVmInstanceAction action = new QueryTemplatedVmInstanceAction();
action.conditions = asList("uuid=5866861926f03755a9855f15f892a446");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryTemplatedVmInstanceAction.Result res = action.call();

Python SDK

QueryTemplatedVmInstanceAction action = QueryTemplatedVmInstanceAction()
action.conditions = ["uuid=49a7e94d15fb3e2092dd8ea3c8d7ecdf"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryTemplatedVmInstanceAction.Result res = action.call()