QueryTicket
API Request
URLs
GET zstack/v1/tickets
GET zstack/v1/tickets/{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?q=uuid=b17f50a117f0320588b55c24947a5fbf
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/tickets/dc7a48ed388b3a2da9939c4e84151d05
Queryable Fields
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryTicket, and pressing the Tab key.
API Response
Sample
Response
{
"inventories": [
{
"uuid": "b891de634d914b93957e2824c6297295",
"name": "ticket",
"description": "ticket description",
"status": "IntermediateApproved",
"request": [
{
"requestName": "create vm",
"apiName": "org.zstack.header.vm.APICreateVmInstanceMsg",
"executeTimes": 1.0,
"apiBody": {
"name": "vm name",
"instanceOfferingUuid": "8166c9b945954375b7bf649fd734b63d",
"imageUuid": "da8c8c3174704a2eac160f0c9c373a3c",
"l3NetworkUuids": [
"0858e5fd17524673bbbcb8f275d45c86"
],
"strategy": "InstantStart",
"timeout": -1.0,
"headers": {},
"id": "8f9fbb135562492e8f713b913334b7fb",
"createdTime": 1.564025557548E12
}
}
],
"accountSystemType": "iam2",
"ticketTypeUuid": "3b933e9aaf2d49b9a3dcf0c92867790f",
"accountSystemContext": {
"projectUuid": "92594abfcbd34543b38a793b004f97ba",
"virtualIDUuid": "fc9c42f94a194a4e9718fa764dcc5599"
},
"flowCollectionUuid": "2719925626f3464787071d4ba22f9cc7"
}
]
}
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 |
name | String | The resource name. | 3.0.0 |
description | String | The detailed description of the resource. | 3.0.0 |
accountSystemType | String | 3.0.0 | |
ticketTypeUuid | String | The ticket type UUID. | 3.6.0 |
accountSystemContext | Object | 3.0.0 | |
currentFlowUuid | String | 3.0.0 | |
flowCollectionUuid | String | 3.0.0 | |
createDate | Timestamp | The creation date. | 3.0.0 |
lastOpDate | Timestamp | The last operation date. | 3.0.0 |
status | TicketStatus | See status. | 3.0.0 |
request | List | See request. | 3.0.0 |
#status
Name | Type | Description | Starting Version |
---|---|---|---|
name | String | The resource name. | 3.0.0 |
ordinal | int | 3.0.0 |
#request
Name | Type | Description | Starting Version |
---|---|---|---|
requestName | String | 3.0.0 | |
apiName | String | 3.0.0 | |
executeTimes | int | 3.0.0 | |
apiBody | Object | 3.0.0 |
SDK Sample
Java
SDK
QueryTicketAction action = new QueryTicketAction();
action.conditions = asList("uuid=e397806ebbe0376b96d7c857e06b9714");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryTicketAction.Result res = action.call();
Python
SDK
QueryTicketAction action = QueryTicketAction()
action.conditions = ["uuid=0198e730d1dc334da8aab9b3a219ba35"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryTicketAction.Result res = action.call()