QueryTicketHistory

API Request

URLs
GET zstack/v1/tickets/histories
GET zstack/v1/tickets/histories/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/tickets/histories?
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/tickets/histories/2cbcaa4913f73d968a9b075a1607bbee

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryTicketHistory, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {
      "fromStatus": "Pending",
      "toStatus": "IntermediateApproved",
      "comment": "approve ticket",
      "operationContextType": "StatusChanged",
      "operationContext": {
        "requestResults": [
          {
            "requestName": "org.zstack.header.vm.APICreateVmInstanceMsg",
            "successTimes": 1.0,
            "failureTimes": 0.0,
            "errors": []
          }
        ]
      },
      "operatorUuid": "f2bf860263bc3856b0c50d712b0d4b7b",
      "createDate": "Dec 28, 2018 6:38:12 PM",
      "lastOpDate": "Dec 28, 2018 6:38:12 PM"
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.0.0
inventories List See inventories. 3.0.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.0.0
description String The brief description of the error. 3.0.0
details String The details about the error. 3.0.0
elaboration String The reserved field. Default value: null. 3.0.0
opaque LinkedHashMap The reserved field. Default value: null. 3.0.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.0.0
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 3.0.0
ticketUuid String 3.0.0
comment String 3.0.0
operationContextType String 3.0.0
operationContext LinkedHashMap 3.0.0
operatorType String 3.0.0
operatorUuid String 3.0.0
createDate Timestamp The creation date. 3.0.0
lastOpDate Timestamp The last operation date. 3.0.0
fromStatus TicketStatus See fromStatus. 3.0.0
toStatus TicketStatus See toStatus. 3.0.0
#fromStatus
Name Type Description Starting Version
name String The resource name. 3.0.0
ordinal int 3.0.0
#toStatus
Name Type Description Starting Version
name String The resource name. 3.0.0
ordinal int 3.0.0

SDK Sample

Java SDK
QueryTicketHistoryAction action = new QueryTicketHistoryAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryTicketHistoryAction.Result res = action.call();
Python SDK
QueryTicketHistoryAction action = QueryTicketHistoryAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryTicketHistoryAction.Result res = action.call()