Update Long Job

PUT/zstack/v1/longjobs/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateLongJob": {
    "name": "new-name",
    "description": "new-description"
  },
  "systemTags": [],
  "userTags": []
}

In the above example, the systemTags and userTags fields are optional. They are listed to indicate that these two fields can be included in the body.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateLongJob":{"name":"new-name","description":"new-description"}}' http://localhost:8080/zstack/v1/longjobs/dee3e1e3706f3e52a2cb9a47850508e7/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlThe UUID of the resource. Uniquely identifies the resource. 3.9.0
name (Optional)Stringbody (contained in the updateLongJob structure)Resource name 3.9.0
description (Optional)Stringbody (contained in the updateLongJob structure)Detailed description of the resource 3.9.0
systemTags (Optional)ListbodySystem tags 3.9.0
userTags (Optional)ListbodyUser tags 3.9.0

API Response

Response example

{
  "inventory": {
    "uuid": "464cdf695427358696dae171544b67ef",
    "name": "new-name",
    "description": "new-description"
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeThe error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error3.9.0
inventoryLongJobInventoryFor details, see inventory3.9.0

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, such as SYS.1000, HOST.1001.3.9.0
descriptionStringA brief description of the error3.9.0
detailsStringThe detailed error information3.9.0
elaborationStringA reserved field. Default is null.3.9.0
opaqueLinkedHashMapA reserved field. Default is null.3.9.0
causeErrorCodeThe root error. The source error that caused the current error. This field is null if there is no root error.3.9.0

inventory

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource. Uniquely identifies the resource.3.9.0
nameStringResource name3.9.0
descriptionStringDetailed description of the resource3.9.0
apiIdStringThe API ID used to associate with TaskProgress3.9.0
jobNameStringJob name3.9.0
jobDataStringJob data3.9.0
jobResultStringJob result3.9.0
targetResourceUuidStringTarget resource UUID3.9.0
managementNodeUuidStringManagement node UUID3.9.0
createDateTimestampCreation time3.9.0
lastOpDateTimestampLast modification time3.9.0
stateLongJobStateFor details, see state3.9.0

state

NameTypeDescriptionStarting Version
WaitingLongJobState 3.9.0
SuspendedLongJobState 3.9.0
RunningLongJobState 3.9.0
SucceededLongJobState 3.9.0
CancelingLongJobState 3.9.0
CanceledLongJobState 3.9.0
FailedLongJobState 3.9.0

SDK Examples

Java SDK

UpdateLongJobAction action = new UpdateLongJobAction();
action.uuid = "dee3e1e3706f3e52a2cb9a47850508e7";
action.name = "new-name";
action.description = "new-description";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateLongJobAction.Result res = action.call();

Python SDK

UpdateLongJobAction action = UpdateLongJobAction()
action.uuid = "dee3e1e3706f3e52a2cb9a47850508e7"
action.name = "new-name"
action.description = "new-description"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateLongJobAction.Result res = action.call()