Document navigation

Ticket Operations

CreateTicket

API Request

URLs
POST zstack/v1/tickets
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "this is a new ticket",
    "requests": [
      {
        "requestName": "create vm",
        "apiName": "org.zstack.header.vm.APICreateVmInstanceMsg",
        "executeTimes": 1.0,
        "apiBody": {
          "name": "vm name",
          "instanceOfferingUuid": "46466abc6c8931fdaab7a8df43e4f175",
          "imageUuid": "43e997234af63863b28a5e9987e1d122",
          "l3NetworkUuids": [
            "8b4ddd66c7ba30598cdc7ab835e04f96"
          ],
          "strategy": "InstantStart",
          "timeout": -1.0,
          "headers": {},
          "id": "a9a029dba17842939f0227420d197121",
          "createdTime": 1.545993580705E12
        }
      }
    ],
    "accountSystemType": "iam2",
    "accountSystemContext": {
      "projectUuid": "28c9a199e3e842d28c9805eb89be56cb",
      "virtualIDUuid": "1c255722caf34cb888b57d11a744248c"
    }
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"this is a new ticket","requests":[{"requestName":"create vm","apiName":"org.zstack.header.vm.APICreateVmInstanceMsg","executeTimes":1.0,"apiBody":{"name":"vm name","instanceOfferingUuid":"46466abc6c8931fdaab7a8df43e4f175","imageUuid":"43e997234af63863b28a5e9987e1d122","l3NetworkUuids":["8b4ddd66c7ba30598cdc7ab835e04f96"],"strategy":"InstantStart","timeout":-1.0,"headers":{},"id":"590ee3ceb92248e08967bf413de91e26","createdTime":1.545993580708E12}}],"accountSystemType":"iam2","accountSystemContext":{"projectUuid":"a497d61cc2d848f2a1101ebd7bc7362f","virtualIDUuid":"c0df7a66330f4cc3b83d1c3695aac291"}}}' http://localhost:8080/zstack/v1/tickets
Request Parameters
Name Type Location Description Optional Value Starting Version
name String body (contained in the params structure) The resource name. 3.0.0
description String body (contained in the params structure) Optional. The detailed description of the resource. 3.0.0
requests List body (contained in the params structure) 3.0.0
flowCollectionUuid String body (contained in the params structure) Optional. 3.0.0
accountSystemType String body (contained in the params structure) 3.0.0
accountSystemContext Object body (contained in the params structure) 3.0.0
resourceUuid String body (contained in the params structure) Optional. 3.0.0
systemTags List body Optional. 3.0.0
userTags List body Optional. 3.0.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
"error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
}
}

SDK Sample

Java SDK
CreateTicketAction action = new CreateTicketAction();
action.name = "this is a new ticket";
action.requests = asList([requestName:create vm, apiName:org.zstack.header.vm.APICreateVmInstanceMsg, executeTimes:1.0, apiBody:[name:vm name, instanceOfferingUuid:46466abc6c8931fdaab7a8df43e4f175, imageUuid:43e997234af63863b28a5e9987e1d122, l3NetworkUuids:[8b4ddd66c7ba30598cdc7ab835e04f96], strategy:InstantStart, timeout:-1.0, headers:[:], id:0132535043b04abf9f56eb9a1fb4c87b, createdTime:1.545993580749E12]]);
action.accountSystemType = "iam2";
action.accountSystemContext = [projectUuid:01ce66b048c5477195b5d6e43507239c, virtualIDUuid:cd120a6130884e4ca80a01b10e59de86];
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateTicketAction.Result res = action.call();
Python SDK
CreateTicketAction action = CreateTicketAction()
action.name = "this is a new ticket"
action.requests = [[requestName:create vm, apiName:org.zstack.header.vm.APICreateVmInstanceMsg, executeTimes:1.0, apiBody:[name:vm name, instanceOfferingUuid:46466abc6c8931fdaab7a8df43e4f175, imageUuid:43e997234af63863b28a5e9987e1d122, l3NetworkUuids:[8b4ddd66c7ba30598cdc7ab835e04f96], strategy:InstantStart, timeout:-1.0, headers:[:], id:379419159124407c903a2b3f13ca6f96, createdTime:1.54599358075E12]]]
action.accountSystemType = "iam2"
action.accountSystemContext = [projectUuid:629c222d0b834ec3aa3af9f5a0e5d986, virtualIDUuid:bf3198f5680341ac88f54d59e94ad7ab]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateTicketAction.Result res = action.call()

UpdateTicketRequest

API Request

URLs
PUT zstack/v1/tickets/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateTicketRequest": {
    "requests": [
      {
        "requestName": "create vm",
        "apiName": "org.zstack.header.vm.APICreateVmInstanceMsg",
        "executeTimes": 1.0,
        "apiBody": {
          "name": "vm name",
          "instanceOfferingUuid": "dba186c0f4e73c8b853e36b37a028761",
          "imageUuid": "a3688b0adaaf3745b9919d6bcbf374b1",
          "l3NetworkUuids": [
            "cc68b29962063148a2b5434d434f1f90"
          ],
          "strategy": "InstantStart",
          "timeout": -1.0,
          "headers": {},
          "id": "779c0969ca40422a9f371710c245e271",
          "createdTime": 1.564025557712E12
        }
      }
    ]
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateTicketRequest":{"requests":[{"requestName":"create vm","apiName":"org.zstack.header.vm.APICreateVmInstanceMsg","executeTimes":1.0,"apiBody":{"name":"vm name","instanceOfferingUuid":"dba186c0f4e73c8b853e36b37a028761","imageUuid":"a3688b0adaaf3745b9919d6bcbf374b1","l3NetworkUuids":["cc68b29962063148a2b5434d434f1f90"],"strategy":"InstantStart","timeout":-1.0,"headers":{},"id":"151dc242428a4b39a81a9b31712e7f09","createdTime":1.564025557718E12}}]}}' http://localhost:8080/zstack/v1/tickets/3d7955e800593abcb49e89c372d6a5ce/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 3.0.0
requests List body (contained in the updateTicketRequest structure) 3.0.0
systemTags List body Optional. The system tags. 3.0.0
userTags List body Optional. The user tags. 3.0.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "14b4cced263d4e0b8511292980c7984f",
    "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": "c14ffce45a924c7c89b29b472b0cc6a5",
          "imageUuid": "21bc6910199d44b3bbd0e336bb88f424",
          "l3NetworkUuids": [
            "ff4916c36d9a4c1683c20e5a22ceceb7"
          ],
          "strategy": "InstantStart",
          "timeout": -1.0,
          "headers": {},
          "id": "bde85ab4eb754339bc6bb42623097c56",
          "createdTime": 1.564025557751E12
        }
      }
    ],
    "accountSystemType": "iam2",
    "ticketTypeUuid": "3b933e9aaf2d49b9a3dcf0c92867790f",
    "accountSystemContext": {
      "projectUuid": "2294a0edf109447bafa802bb73b29cd3",
      "virtualIDUuid": "178c834b9bc84bac9e77460b42eb3494"
    },
    "flowCollectionUuid": "9fbbac8054d54f0490438eaaba3e1cf8"
  }
}
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
inventory TicketInventory See inventory. 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
#inventory
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
UpdateTicketRequestAction action = new UpdateTicketRequestAction();
action.uuid = "3d7955e800593abcb49e89c372d6a5ce";
action.requests = asList([requestName:create vm, apiName:org.zstack.header.vm.APICreateVmInstanceMsg, executeTimes:1.0, apiBody:[name:vm name, instanceOfferingUuid:dba186c0f4e73c8b853e36b37a028761, imageUuid:a3688b0adaaf3745b9919d6bcbf374b1, l3NetworkUuids:[cc68b29962063148a2b5434d434f1f90], strategy:InstantStart, timeout:-1.0, headers:[:], id:ac92123f5b9144159389b4d3d5e95fcf, createdTime:1.564025557873E12]]);
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateTicketRequestAction.Result res = action.call();
Python SDK
UpdateTicketRequestAction action = UpdateTicketRequestAction()
action.uuid = "3d7955e800593abcb49e89c372d6a5ce"
action.requests = [[requestName:create vm, apiName:org.zstack.header.vm.APICreateVmInstanceMsg, executeTimes:1.0, apiBody:[name:vm name, instanceOfferingUuid:dba186c0f4e73c8b853e36b37a028761, imageUuid:a3688b0adaaf3745b9919d6bcbf374b1, l3NetworkUuids:[cc68b29962063148a2b5434d434f1f90], strategy:InstantStart, timeout:-1.0, headers:[:], id:2be0f869588b4051907cd550a9913683, createdTime:1.564025557879E12]]]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateTicketRequestAction.Result res = action.call()

ChangeTicketStatus

API Request

URLs
PUT zstack/v1/tickets/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "changeTicketStatus": {
    "statusEvent": "approve",
    "comment": "this is the comment for change status operation"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeTicketStatus":{"statusEvent":"approve","comment":"this is the comment for change status operation"}}' http://localhost:8080/zstack/v1/tickets/e9377476db3f375bbff78dc3b9204f00/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 3.0.0
statusEvent TicketStatusEvent body (contained in the changeTicketStatus structure)
  • open
  • approve
  • cancel
  • reject
  • reopen
3.0.0
comment String body (contained in the changeTicketStatus structure) Optional. 3.0.0
systemTags List body Optional. 3.0.0
userTags List body Optional. 3.0.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "f4483251fdfd48cdae0dbb966a2652c9",
    "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": "e539401d4cf74a6c93b173b9fa01d4e6",
          "imageUuid": "16e0a61a2ca145eaaae6c7e9ef72ae31",
          "l3NetworkUuids": [
            "0fbf9d6545e6480790ee9b2f7da59f65"
          ],
          "strategy": "InstantStart",
          "timeout": -1.0,
          "headers": {},
          "id": "3f1b84f2f3ca453caf3086625d57eff5",
          "createdTime": 1.56402555717E12
        }
      }
    ],
    "accountSystemType": "iam2",
    "ticketTypeUuid": "3b933e9aaf2d49b9a3dcf0c92867790f",
    "accountSystemContext": {
      "projectUuid": "21423d5537cc4891b33745b3ad9045f8",
      "virtualIDUuid": "1470a380fe454b4298ba178245aa499c"
    },
    "flowCollectionUuid": "6aa051e47de74658885bca987b9c4a35"
  }
}
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
inventory TicketInventory See inventory. 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
#inventory
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
ChangeTicketStatusAction action = new ChangeTicketStatusAction();
action.uuid = "e9377476db3f375bbff78dc3b9204f00";
action.statusEvent = "approve";
action.comment = "this is the comment for change status operation";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeTicketStatusAction.Result res = action.call();
Python SDK
ChangeTicketStatusAction action = ChangeTicketStatusAction()
action.uuid = "e9377476db3f375bbff78dc3b9204f00"
action.statusEvent = "approve"
action.comment = "this is the comment for change status operation"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeTicketStatusAction.Result res = action.call()

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()

QueryArchiveTicket

API Request

URLs
GET zstack/v1/tickets/archives
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/archives

Queryable Fields

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

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
"error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
}
}

SDK Sample

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

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()

CreateIAM2TickFlowCollection

API Request

URLs
POST zstack/v1/tickets/flow-collections
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "flows": [
      {
        "name": "flow1",
        "approverUuid": "1c4db59a73b63f968889764bcb2bae9d"
      },
      {
        "name": "flow2",
        "approverUuid": "eb9dc5050030323281c255864ca6c633"
      }
    ],
    "projectUuid": "bdd993eb57c13134967b15ed38ba33c4",
    "name": "flow collection",
    "description": "flow collection description",
    "isDefault": false
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"flows":[{"name":"flow1","approverUuid":"1c4db59a73b63f968889764bcb2bae9d"},{"name":"flow2","approverUuid":"eb9dc5050030323281c255864ca6c633"}],"projectUuid":"bdd993eb57c13134967b15ed38ba33c4","name":"flow collection","description":"flow collection description","isDefault":false}}' http://localhost:8080/zstack/v1/tickets/flow-collections
Request Parameters
Name Type Location Description Optional Value Starting Version
flows List body (contained in the params structure) Optional. 3.0.0
name String body (contained in the params structure) The resource name. 3.0.0
description String body (contained in the params structure) Optional. The detailed description of the resource. 3.0.0
isDefault Boolean body (contained in the params structure) Optional. 3.0.0
resourceUuid String body (contained in the params structure) Optional. 3.0.0
systemTags List body Optional. 3.0.0
userTags List body Optional. 3.0.0
projectUuid String body (contained in the params structure) 3.0.0

API Response

Sample Response
{
  "inventory": {
    "state": "Enabled",
    "status": "Valid",
    "lastOpDate": "Dec 28, 2018 6:50:31 PM",
    "isDefault": true,
    "flows": [
      {
        "name": "flow name",
        "description": "flow description",
        "flowContextType": "iam2",
        "createDate": "Dec 28, 2018 6:50:31 PM",
        "lastOpDate": "Dec 28, 2018 6:50:31 PM",
        "collectionUuid": "1dffd5fae83f3f55be42c56a0c2b266b"
      }
    ]
  }
}
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
inventory TicketFlowCollectionInventory See inventory. 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
#inventory
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
state String 3.0.0
status String 3.0.0
createDate Timestamp The creation date. 3.0.0
lastOpDate Timestamp The last operation date. 3.0.0
isDefault Boolean 3.0.0
flows List See flows. 3.0.0
#flows
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
parentFlowUuid String 3.0.0
flowContext String 3.0.0
flowContextType String 3.0.0
createDate Timestamp The creation date. 3.0.0
lastOpDate Timestamp The creation date. 3.0.0
collectionUuid String 3.0.0

SDK Sample

Java SDK
CreateIAM2TickFlowCollectionAction action = new CreateIAM2TickFlowCollectionAction();
action.flows = asList([name:flow1, approverUuid:1c4db59a73b63f968889764bcb2bae9d],[name:flow2, approverUuid:eb9dc5050030323281c255864ca6c633]);
action.projectUuid = "bdd993eb57c13134967b15ed38ba33c4";
action.name = "flow collection";
action.description = "flow collection description";
action.isDefault = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateIAM2TickFlowCollectionAction.Result res = action.call();
Python SDK
CreateIAM2TickFlowCollectionAction action = CreateIAM2TickFlowCollectionAction()
action.flows = [[name:flow1, approverUuid:1c4db59a73b63f968889764bcb2bae9d], [name:flow2, approverUuid:eb9dc5050030323281c255864ca6c633]]
action.projectUuid = "bdd993eb57c13134967b15ed38ba33c4"
action.name = "flow collection"
action.description = "flow collection description"
action.isDefault = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateIAM2TickFlowCollectionAction.Result res = action.call()

DeleteTicketFlowCollection

API Request

URLs
DELETE zstack/v1/tickets/flow-collections/{uuid}?deleteMode={deleteMode}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/tickets/flow-collections/657b0e4c4b21394db32f1c7c1066efa9?deleteMode=Permissive
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 3.0.0
deleteMode String body Optional. The delete mode. 3.0.0
systemTags List body Optional. The system tags. 3.0.0
userTags List body Optional. The user tags. 3.0.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
"error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
}
}

SDK Sample

Java SDK
DeleteTicketFlowCollectionAction action = new DeleteTicketFlowCollectionAction();
action.uuid = "657b0e4c4b21394db32f1c7c1066efa9";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteTicketFlowCollectionAction.Result res = action.call();
Python SDK
DeleteTicketFlowCollectionAction action = DeleteTicketFlowCollectionAction()
action.uuid = "657b0e4c4b21394db32f1c7c1066efa9"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteTicketFlowCollectionAction.Result res = action.call()

UpdateIAM2TicketFlowCollection

API Request

URLs
PUT zstack/v1/tickets/flow-collections/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateIAM2TicketFlowCollection": {
    "flows": [
      {
        "name": "flow1",
        "approverUuid": "8603f9c875a23cf1815b85e16f0d972e"
      },
      {
        "name": "flow2",
        "approverUuid": "9563991259ad3820bf48e5d8b86b5da4"
      }
    ]
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateIAM2TicketFlowCollection":{"flows":[{"name":"flow1","approverUuid":"8603f9c875a23cf1815b85e16f0d972e"},{"name":"flow2","approverUuid":"9563991259ad3820bf48e5d8b86b5da4"}]}}' http://localhost:8080/zstack/v1/tickets/flow-collections/610687f0ec5c3ca286a27fa13888df2e/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
flows List body (contained in the updateIAM2TicketFlowCollection structure) Optional. 3.0.0
uuid String url The resource UUID. 3.0.0
name String body (contained in the updateIAM2TicketFlowCollection structure) Optional. The resource name. 3.0.0
description String body (contained in the updateIAM2TicketFlowCollection structure) Optional. The detailed description of the resource. 3.0.0
isDefault Boolean body (contained in the updateIAM2TicketFlowCollection structure) Optional. 3.0.0
systemTags List body Optional. 3.0.0
userTags List body Optional. 3.0.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "7db7660049ba42fc95de91ac238145a5",
    "name": "collection name",
    "state": "Enabled",
    "status": "Valid",
    "isDefault": false,
    "flows": []
  }
}
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
inventory TicketFlowCollectionInventory See inventory. 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
#inventory
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
state String 3.0.0
status String 3.0.0
createDate Timestamp The creation date. 3.0.0
lastOpDate Timestamp The last operation date. 3.0.0
isDefault Boolean 3.0.0
flows List See flows. 3.0.0
#flows
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
parentFlowUuid String 3.0.0
flowContext String 3.0.0
flowContextType String 3.0.0
createDate Timestamp The creation date. 3.0.0
lastOpDate Timestamp The creation date. 3.0.0
collectionUuid String 3.0.0

SDK Sample

Java SDK
UpdateIAM2TicketFlowCollectionAction action = new UpdateIAM2TicketFlowCollectionAction();
action.flows = asList([name:flow1, approverUuid:8603f9c875a23cf1815b85e16f0d972e],[name:flow2, approverUuid:9563991259ad3820bf48e5d8b86b5da4]);
action.uuid = "610687f0ec5c3ca286a27fa13888df2e";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateIAM2TicketFlowCollectionAction.Result res = action.call();
Python SDK
UpdateIAM2TicketFlowCollectionAction action = UpdateIAM2TicketFlowCollectionAction()
action.flows = [[name:flow1, approverUuid:8603f9c875a23cf1815b85e16f0d972e], [name:flow2, approverUuid:9563991259ad3820bf48e5d8b86b5da4]]
action.uuid = "610687f0ec5c3ca286a27fa13888df2e"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateIAM2TicketFlowCollectionAction.Result res = action.call()

QueryTicketFlowCollection

API Request

URLs
GET zstack/v1/tickets/flow-collections
GET zstack/v1/tickets/flow-collections/{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/flow-collections
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/tickets/flow-collections/19575ca3d82838a39763f3081e3f5055

Queryable Fields

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

API Response

Sample Response
{
  "inventories": [
    {
      "uuid": "aafa04d2d3b447bb866a62457aa24fdd",
      "name": "collection name",
      "state": "Enabled",
      "status": "Valid",
      "isDefault": false,
      "flows": []
    }
  ]
}
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
state String 3.0.0
status String 3.0.0
createDate Timestamp The creation date. 3.0.0
lastOpDate Timestamp The last operation date. 3.0.0
isDefault Boolean 3.0.0
flows List See flows. 3.0.0
#flows
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
parentFlowUuid String 3.0.0
flowContext String 3.0.0
flowContextType String 3.0.0
createDate Timestamp The creation date. 3.0.0
lastOpDate Timestamp The last operation date. 3.0.0
collectionUuid String 3.0.0

SDK Sample

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

ChangeTicketFlowCollectionState

API Request

URLs
PUT zstack/v1/tickets/flow-collections/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "changeTicketFlowCollectionState": {
    "stateEvent": "disable"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeTicketFlowCollectionState":{"stateEvent":"disable"}}' http://localhost:8080/zstack/v1/tickets/flow-collections/b2a1edfb81d73aea989b25727b7a1417/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 3.0.0
stateEvent String body (contained in the changeTicketFlowCollectionState structure)
  • enable
  • disable
3.0.0
systemTags List body Optional. The system tags. 3.0.0
userTags List body Optional. The user tags. 3.0.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "34d5466ff50d4e719aa854c2a1d58e81",
    "name": "collection name",
    "state": "Enabled",
    "status": "Valid",
    "isDefault": false,
    "flows": []
  }
}
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
inventory TicketFlowCollectionInventory See inventory. 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
#inventory
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
state String 3.0.0
status String 3.0.0
createDate Timestamp The creation date. 3.0.0
lastOpDate Timestamp The last operation date. 3.0.0
isDefault Boolean 3.0.0
flows List See flows. 3.0.0
#flows
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
parentFlowUuid String 3.0.0
flowContext String 3.0.0
flowContextType String 3.0.0
createDate Timestamp The creation date. 3.0.0
lastOpDate Timestamp The last operation date. 3.0.0
collectionUuid String 3.0.0

SDK Sample

Java SDK
ChangeTicketFlowCollectionStateAction action = new ChangeTicketFlowCollectionStateAction();
action.uuid = "b2a1edfb81d73aea989b25727b7a1417";
action.stateEvent = "disable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeTicketFlowCollectionStateAction.Result res = action.call();
Python SDK
ChangeTicketFlowCollectionStateAction action = ChangeTicketFlowCollectionStateAction()
action.uuid = "b2a1edfb81d73aea989b25727b7a1417"
action.stateEvent = "disable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeTicketFlowCollectionStateAction.Result res = action.call()

QueryTicketFlow

API Request

URLs
GET zstack/v1/tickets/flow
GET zstack/v1/tickets/flow/{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/flow
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/tickets/flow/c6c9263205103dd3b6194140c5c06b74

Queryable Fields

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

API Response

Sample Response
{
  "inventories": [
    {
      "uuid": "ea0457b5994a4710a182015cef690d75",
      "name": "flow1",
      "description": "flow description",
      "parentFlowUuid": "8d7b4b6b72bf4ff2bcf945b313320dc1",
      "flowContextType": "{\"approverUuid\":\"139bcc292cb141bea1e8d40bf8bbaed9\"}",
      "createDate": "Dec 28, 2018 6:39:29 PM",
      "lastOpDate": "Dec 28, 2018 6:39:29 PM",
      "collectionUuid": "a87c7cb15468456dbce88da5f65c0073"
    },
    {
      "uuid": "8d7b4b6b72bf4ff2bcf945b313320dc1",
      "name": "flow2",
      "description": "flow description",
      "flowContextType": "{\"approverUuid\":\"1cc3e1575809468dba5cedcfe8cc5a4c\"}",
      "createDate": "Dec 28, 2018 6:39:29 PM",
      "lastOpDate": "Dec 28, 2018 6:39:29 PM",
      "collectionUuid": "a87c7cb15468456dbce88da5f65c0073"
    }
  ]
}
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
parentFlowUuid String 3.0.0
flowContext String 3.0.0
flowContextType String 3.0.0
createDate Timestamp The creation date. 3.0.0
lastOpDate Timestamp The last operation date. 3.0.0
collectionUuid String 3.0.0

SDK Sample

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

AddIAM2TicketFlow

API Request

URLs
POST zstack/v1/tickets/flow
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "approverUuid": "92b1b555f19531df9a94ce42c8959fa9",
    "approverTitle": "SystemAdmin",
    "name": "example flow",
    "collectionUuid": "d72760c4e3b24c45be267f5aa0a2c5a1"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"approverUuid":"92b1b555f19531df9a94ce42c8959fa9","approverTitle":"SystemAdmin","name":"example flow","collectionUuid":"82b6111a0d7f47bd955f385f959b1eb7"}}' http://localhost:8080/zstack/v1/tickets/flow
Request Parameters
Name Type Location Description Optional Value Starting Version
approverUuid String body (contained in the params structure) 3.0.0
approverTitle String body (contained in the params structure) Optional. 3.0.0
name String body (contained in the params structure) Optional. The resource name. 3.0.0
description String body (contained in the params structure) Optional. The detailed description of the resource. 3.0.0
collectionUuid String body (contained in the params structure) 3.0.0
parentFlowUuid String body (contained in the params structure) Optional. 3.0.0
resourceUuid String body (contained in the params structure) Optional. 3.0.0
systemTags List body Optional. 3.0.0
userTags List body Optional. 3.0.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "f9b5298fc4d2429294513ffe340215c8",
    "name": "flow1",
    "description": "flow description",
    "parentFlowUuid": "4ca39493ec06407cb50fa92880f9bcbc",
    "flowContextType": "{\"approverUuid\":\"99a8ba4f86564f0787ab2c8b11bfadb0\"}",
    "createDate": "Dec 28, 2018 6:38:25 PM",
    "lastOpDate": "Dec 28, 2018 6:38:25 PM",
    "collectionUuid": "5d32a7a22ea645409dd7b12b5223f723"
  }
}
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
inventory TicketFlowInventory See inventory. 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
#inventory
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
parentFlowUuid String 3.0.0
flowContext String 3.0.0
flowContextType String 3.0.0
createDate Timestamp The creation date. 3.0.0
lastOpDate Timestamp The last operation date. 3.0.0
collectionUuid String 3.0.0

SDK Sample

Java SDK
AddIAM2TicketFlowAction action = new AddIAM2TicketFlowAction();
action.approverUuid = "92b1b555f19531df9a94ce42c8959fa9";
action.approverTitle = "SystemAdmin";
action.name = "example flow";
action.collectionUuid = "4913282e13a64fe29b802c78b67e2c84";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddIAM2TicketFlowAction.Result res = action.call();
Python SDK
AddIAM2TicketFlowAction action = AddIAM2TicketFlowAction()
action.approverUuid = "92b1b555f19531df9a94ce42c8959fa9"
action.approverTitle = "SystemAdmin"
action.name = "example flow"
action.collectionUuid = "12d574495c074cf59de72c911391b8bb"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddIAM2TicketFlowAction.Result res = action.call()

UpdateIAM2TicketFlow

API Request

URLs
PUT zstack/v1/tickets/flow/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateIAM2TicketFlow": {
    "name": "new ticket flow name",
    "description": "new ticket flow description",
    "approverUuid": "714d3eedb96f32a39598fb11ae0d9927"
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateIAM2TicketFlow":{"name":"new ticket flow name","description":"new ticket flow description","approverUuid":"714d3eedb96f32a39598fb11ae0d9927"}}' http://localhost:8080/zstack/v1/tickets/flow/919e8fbb3b3b30f480b41563e36839cc/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 3.0.0
name String body (contained in the updateIAM2TicketFlow structure) Optional. The resource name. 3.0.0
description String body(contained in the updateIAM2TicketFlow structure) Optional. The detailed description of the resource. 3.0.0
approverUuid String body (contained in the updateIAM2TicketFlow structure) Optional. 3.0.0
approverTitle String body (contained in the updateIAM2TicketFlow structure) Optional. 3.0.0
systemTags List body Optional. 3.0.0
userTags List body Optional. 3.0.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "1dc3521c3ec74b81813121404e5941e6",
    "name": "flow1",
    "description": "flow description",
    "parentFlowUuid": "bb2897de253e497f94587fc09b5ef969",
    "flowContextType": "{\"approverUuid\":\"da8cc8c2412246b6b29b38328b7dab88\"}",
    "createDate": "Dec 28, 2018 6:39:33 PM",
    "lastOpDate": "Dec 28, 2018 6:39:33 PM",
    "collectionUuid": "2b9bdd8b1c1d4163864e55d16840954f"
  }
}
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
inventory TicketFlowInventory See inventory. 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
#inventory
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
parentFlowUuid String 3.0.0
flowContext String 3.0.0
flowContextType String 3.0.0
createDate Timestamp The creation date. 3.0.0
lastOpDate Timestamp The last operation date. 3.0.0
collectionUuid String 3.0.0

SDK Sample

Java SDK
UpdateIAM2TicketFlowAction action = new UpdateIAM2TicketFlowAction();
action.uuid = "919e8fbb3b3b30f480b41563e36839cc";
action.name = "new ticket flow name";
action.description = "new ticket flow description";
action.approverUuid = "714d3eedb96f32a39598fb11ae0d9927";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateIAM2TicketFlowAction.Result res = action.call();
Python SDK
UpdateIAM2TicketFlowAction action = UpdateIAM2TicketFlowAction()
action.uuid = "919e8fbb3b3b30f480b41563e36839cc"
action.name = "new ticket flow name"
action.description = "new ticket flow description"
action.approverUuid = "714d3eedb96f32a39598fb11ae0d9927"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateIAM2TicketFlowAction.Result res = action.call()

DeleteIAM2TicketFlow

API Request

URLs
DELETE zstack/v1/tickets/flow/{uuid}?deleteMode={deleteMode}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/tickets/flow/482baf2f2f4f3315b81064ecc5b3625c?deleteMode=Permissive
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 3.0.0
deleteMode String body Optional. The delete mode. 3.0.0
systemTags List body Optional. The system tags. 3.0.0
userTags List body Optional. The user tags. 3.0.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
"error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
}
}

SDK Sample

Java SDK
DeleteIAM2TicketFlowAction action = new DeleteIAM2TicketFlowAction();
action.uuid = "482baf2f2f4f3315b81064ecc5b3625c";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteIAM2TicketFlowAction.Result res = action.call();
Python SDK
DeleteIAM2TicketFlowAction action = DeleteIAM2TicketFlowAction()
action.uuid = "482baf2f2f4f3315b81064ecc5b3625c"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteIAM2TicketFlowAction.Result res = action.call()

AddTicketTypesToTicketFlowCollection

API Request

URLs
POST zstack/v1/tickets/flow-collections/{ticketFlowCollectionUuid}/ticket-types
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "ticketTypeUuids": [
      "3b933e9aaf2d49b9a3dcf0c92867790f",
      "ef064ef45fb446d381db7b7d5f71695c"
    ]
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"ticketTypeUuids":["3b933e9aaf2d49b9a3dcf0c92867790f","ef064ef45fb446d381db7b7d5f71695c"]}}' http://localhost:8080/zstack/v1/tickets/flow-collections/4f4bf50d510f4bf1959d8c5baa218cc4/ticket-types
Request Parameters
Name Type Location Description Optional Value Starting Version
ticketFlowCollectionUuid String url The ticket process UUID. 3.6.0
ticketTypeUuids List body (contained in the params structure) The ticket type UUIDs. 3.6.0
systemTags List body Optional. The system tags. 3.6.0
userTags List body Optional. The user tags. 3.6.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
"error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
}
}

SDK Sample

Java SDK
AddTicketTypesToTicketFlowCollectionAction action = new AddTicketTypesToTicketFlowCollectionAction();
action.ticketFlowCollectionUuid = "d8aa14d3ea224e36bd071b2355c94882";
action.ticketTypeUuids = asList("3b933e9aaf2d49b9a3dcf0c92867790f","ef064ef45fb446d381db7b7d5f71695c");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddTicketTypesToTicketFlowCollectionAction.Result res = action.call();
Python SDK
AddTicketTypesToTicketFlowCollectionAction action = AddTicketTypesToTicketFlowCollectionAction()
action.ticketFlowCollectionUuid = "5682400944cd4ca0acb82ff8d67462a6"
action.ticketTypeUuids = [3b933e9aaf2d49b9a3dcf0c92867790f, ef064ef45fb446d381db7b7d5f71695c]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddTicketTypesToTicketFlowCollectionAction.Result res = action.call()

RemoveTicketTypesFromTicketFlowCollection

API Request

URLs
DELETE zstack/v1/tickets/flow-collections/{ticketFlowCollectionUuid}/ticket-types
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/tickets/flow-collections/839c88649a804cf6b56f3e80aac1c578/ticket-types
Request Parameters
Name Type Location Description Optional Value Starting Version
ticketFlowCollectionUuid String url 3.6.0
ticketTypeUuids List body 3.6.0
systemTags List body Optional. The system tags. 3.6.0
userTags List body Optional. The user tags. 3.6.0

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
"error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
}
}

SDK Sample

Java SDK
RemoveTicketTypesFromTicketFlowCollectionAction action = new RemoveTicketTypesFromTicketFlowCollectionAction();
action.ticketFlowCollectionUuid = "f4ccacf67bb04b4698d01ffbfed57134";
action.ticketTypeUuids = asList("3b933e9aaf2d49b9a3dcf0c92867790f","ef064ef45fb446d381db7b7d5f71695c");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RemoveTicketTypesFromTicketFlowCollectionAction.Result res = action.call();
Python SDK
RemoveTicketTypesFromTicketFlowCollectionAction action = RemoveTicketTypesFromTicketFlowCollectionAction()
action.ticketFlowCollectionUuid = "97e30e33bea34366850c62781d342e22"
action.ticketTypeUuids = [3b933e9aaf2d49b9a3dcf0c92867790f, ef064ef45fb446d381db7b7d5f71695c]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RemoveTicketTypesFromTicketFlowCollectionAction.Result res = action.call()

QueryTicketType

API Request

URLs
GET zstack/v1/ticket-types
GET zstack/v1/ticket-types/{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/ticket-types?q=uuid=8cab296e0d8e3c86aef43d7e76c874c6
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/ticket-types/e3e9345750b93455ad7336be8bd60420

Queryable Fields

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

API Response

Sample Response
{
  "inventories": [
    {
      "uuid": "3b933e9aaf2d49b9a3dcf0c92867790f",
      "name": "CREATE_VM_INSTANCE_TICKET_TYPE",
      "adminOnly": false,
      "createDate": "Jul 18, 2019 4:09:46 PM",
      "lastOpDate": "Jul 18, 2019 4:09:46 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.6.0
inventories List See inventories. 3.6.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.6.0
description String The brief description of the error. 3.6.0
details String The details about the error. 3.6.0
elaboration String The reserved field. Default value: null. 3.6.0
opaque LinkedHashMap The reserved field. Default value: null. 3.6.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.6.0
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 3.6.0
name String The resource name. 3.6.0
description String The detailed description of the resource. 3.6.0
type String 3.6.0
requests String 3.6.0
createDate Timestamp The creation date. 3.6.0
lastOpDate Timestamp The last operation date. 3.6.0

SDK Sample

Java SDK
QueryTicketTypeAction action = new QueryTicketTypeAction();
action.conditions = asList("uuid=bbeba1e02a88309192252bbfe409df4f");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryTicketTypeAction.Result res = action.call();
Python SDK
QueryTicketTypeAction action = QueryTicketTypeAction()
action.conditions = ["uuid=60ebfd64ef4238f9bbdd77c3c0569d64"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryTicketTypeAction.Result res = action.call()
API Reference | 4.8.38 | ZStack Cloud · ZCF | ZStack Resource Center