Query VM Scheduling History

API Request

URLs

GET zstack//v1/vm/sched-history
GET zstack//v1/vm/sched-history/{vmInstanceUuid}

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/sched-history?q=vmInstanceUuid=15b5b8ab631d300592bf83d66331f914
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vm/sched-history/{vmInstanceUuid}?q=vmInstanceUuid=4240a319fabf3728960d1d7639f3fc0f

Queryable Fields

Run the CLI tool, enter QueryVmSchedHistory and press Tab to view all queryable fields and cross-table queryable resource names.

API Response

{
  "inventories": [
    {
      "id": 0.0,
      "vmInstanceUuid": "ec8fe40b4b0a38bc8f195bfc8bfc72e9",
      "accountUuid": "b07dda064256343c894cecfa5d50b42c",
      "schedType": "VMHA",
      "success": true,
      "lastHostUuid": "d4d26f65cfff3fafb98d3da284290455",
      "destHostUuid": "bc001bb4d762395db4b2ed97c6d6dae3"
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 0.6
inventoriesListFor details, see inventories4.4.24
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error0.6

inventories

NameTypeDescriptionStarting Version
vmInstanceUuidStringVirtual Machine UUID4.4.24
accountUuidStringAccount UUID4.4.24
schedTypeString 4.4.24
successBoolean 4.4.24
lastHostUuidString 4.4.24
destHostUuidString 4.4.24
createDateTimestampCreation time4.4.24
lastOpDateTimestampLast modification time4.4.24

error

NameTypeDescriptionStarting Version
codeStringError code number. A globally unique identifier for the error, for example, SYS.1000, HOST.10014.4.24
descriptionStringBrief description of the error4.4.24
detailsStringDetailed information about the error4.4.24
elaborationStringReserved field. Default is null4.4.24
opaqueLinkedHashMapReserved field. Default is null4.4.24
causeErrorCodeRoot error. The source error that caused the current error. This field is null if no root error exists4.4.24

SDK Examples

Java SDK

QueryVmSchedHistoryAction action = new QueryVmSchedHistoryAction();
action.conditions = asList("vmInstanceUuid=b35d14e4af4c3f4c8f745e73df083020");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryVmSchedHistoryAction.Result res = action.call();

Python SDK

QueryVmSchedHistoryAction action = QueryVmSchedHistoryAction()
action.conditions = ["vmInstanceUuid=f9bd0652c3843cb285c2e7b8c9f4561b"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryVmSchedHistoryAction.Result res = action.call()