VM Related Interfaces

Query VM CD-ROM

GET/zstack/v1/vm-instances/cdroms
GET/zstack/v1/vm-instances/cdroms/{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/cdroms?q=name=cd-1
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vm-instances/cdroms/cd0360ac748b3983897eb41913e97a6b

Query Fields

Run the CLI command, enter QueryVmCdRom and press Tab to view all queryable fields and resources that can be queried across tables.

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "68d090e26a0539f9b1b5d37229ee97de",
      "deviceId": 0,
      "isoUuid": "539acd1389523fb9ab243096d9842a05",
      "name": "cd-1",
      "description": "desc",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. When the operation succeeds, this field is null. For details, see error3.3.0
inventoriesListFor details, see inventories3.3.0

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier of the error, for example SYS.1000, HOST.10013.3.0
descriptionStringBrief description of the error3.3.0
detailsStringDetailed error information3.3.0
elaborationStringReserved field, defaults to null3.3.0
opaqueLinkedHashMapReserved field, defaults to null3.3.0
causeErrorCodeRoot cause. The error that triggered the current error. If there is no original error, this field is null3.3.0

inventories

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource3.3.0
vmInstanceUuidStringVirtual Machine UUID3.3.0
deviceIdIntegerCD-ROM device number3.3.0
isoUuidStringISO Image UUID3.3.0
isoInstallPathStringISO image mount path3.3.0
nameStringResource name3.3.0
descriptionStringResource description3.3.0
createDateTimestampCreate time3.3.0
lastOpDateTimestampLast update time3.3.0

SDK Examples

Java SDK

QueryVmCdRomAction action = new QueryVmCdRomAction();
action.conditions = asList("name=cd-1");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryVmCdRomAction.Result res = action.call();

Python SDK

QueryVmCdRomAction action = QueryVmCdRomAction()
action.conditions = ["name=cd-1"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryVmCdRomAction.Result res = action.call()