Query Virtualization Software Information of Resource

GET/zstack/v1/hosts/kvm/hypervisor/info

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/hosts/kvm/hypervisor/info?q=uuid=dd025c0199ef3b7080120db73772234f

Queryable Fields

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

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "a3097e5ebe8a35929e1f2fe4304893f1",
      "hypervisor": "qemu-kvm",
      "version": "4.2.0-632.g6a6222b.el7",
      "matchState": "Matched",
      "createDate": "Nov 14, 2017 2:20:57 PM",
      "lastOpDate": "Nov 14, 2017 2:20:57 PM"
    }
  ]
}
NameTypeDescriptionStarting Version
successbooleanWhether the query succeeded4.6.21
inventoriesListSee details inventories4.6.21
errorErrorCodeError code. If not null, the operation failed. If null, the operation succeeded. See details error4.6.21

inventories

NameTypeDescriptionStarting Version
uuidStringResource UUID, can be the UUID of a Host or a Virtual Machine4.6.21
hypervisorStringVirtualization software name, for example qemu-kvm4.6.21
versionStringVersion number, for example 4.2.0-632.g6a6222b.el74.6.21
matchStateStringMatch status with expected version number, possible values are Matched, Unmatched,Unknown4.6.21
createDateTimestampCreation time4.6.21
lastOpDateTimestampLast modification time4.6.21

error

NameTypeDescriptionStarting Version
codeStringError code number, globally unique identifier of the error, e.g. SYS.1000, HOST.10014.6.21
descriptionStringBrief description of the error4.6.21
detailsStringDetailed error information4.6.21
elaborationStringReserved field, default is null4.6.21
opaqueLinkedHashMapReserved field, default is null4.6.21
causeErrorCodeRoot cause, the error that caused the current error. If there is no original error, this field is null4.6.21

SDK Examples

Java SDK

QueryKvmHypervisorInfoAction action = new QueryKvmHypervisorInfoAction();
action.conditions = asList("uuid=0601103239cd30c2bd738b98d4440199");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryKvmHypervisorInfoAction.Result res = action.call();

Python SDK

QueryKvmHypervisorInfoAction action = QueryKvmHypervisorInfoAction()
action.conditions = ["uuid=838e20e529cc3a19a9f0efa50e9e2409"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryKvmHypervisorInfoAction.Result res = action.call()