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