UpdateTicketRequest
API Request
URLs
PUT zstack/v1/tickets/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"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": []
}

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