Long Job
Overview
In a distributed system, for time-consuming tasks, ZStack Cloud uses the Flowchain technology to segment your business logic into multiple flows. In this way, the flows can be performed in sequence, which helps to avoid task failure led by API timeouts.
Inventory
Properties
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The UUID. For more information, see Resource Property. | 2.3 | ||
| name | The name. For more information, see Resource Property. | 2.3 | ||
| description | The description. For more information, see Resource Property. | Yes | 2.3 | |
| jobName | The job name. | 2.3 | ||
| jobData | The job data. | 2.3 | ||
| jobResult | The job result. | 2.3 | ||
| managementNodeUuid | The management node UUID. | 2.3 | ||
| apiId | The API ID used to associate with the task progress. | 2.3 | ||
| targetResourceUuid | The target resource UUID. | 2.3 | ||
| state | The job state. | 2.3 | ||
| groupBy | ||||
| createDate | The creation date. For more information, see Resource Property. | 2.3 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 2.3 |
Sample
{
"apiId": "faf95996726e4381aa5226f912857338",
"createDate": "Jan 30, 2018 3:56:43 PM",
"jobData": "{"volumeUuid":"3d261d02dc2142eb9806750847d6a4fb","srcPri 04e5aa031fc92e8ddff31","type":"NFSTONFSVOLUME","vmInstanceUuid":"682c775b19f546f 6c27e8ff05c4780bf6d2fa65700f22e","userUuid":"36c27e8ff05c4780bf6d2fa65700f22e"," :-1,"headers":{},"id":"85fb934a7b8e40ab9d9a730c63429a36","createdTime":151729900
"jobName": "APIPrimaryStorageMigrateVolumeMsg",
"jobResult": "Succeeded",
"lastOpDate": "Jan 30, 2018 3:56:43 PM",
"managementNodeUuid": "b44bfa17ef294a75824db6e455b183fa",
"name": "APIPrimaryStorageMigrateVolumeMsg",
"state": "Succeeded",
"uuid": "b7e65467cffe4bcd9d7ca09ec77d35e8"
}
Operations
SubmitLongJob
Submits a long job. For
example,
SubmitLongJob jobData={volumeUuid:3d261d02dc2142eb9806750847d6a4fb,dstPrimaryStorageUuid:3024617c6eee45e0845430fef8b8a7f3} \
jobName=APIPrimaryStorageMigrateVolumeMsgParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| name | The resource name. | Yes | 2.3 | |
| description | The detailed description of the resource. | Yes | 2.3 | |
| jobName | The job name. | 2.3 | ||
| jobData | The job data. | 2.3 | ||
| resourceUuid | The resource UUID. | Yes | 2.3 | |
| targetResourceUuid | Yes | 2.3 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
UpdateLongJob
Updates a long job. For
example,
UpdateLongJob uuid=dee3e1e3706f3e52a2cb9a47850508e7Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 3.9.0 | ||
| name | The resource name. | Yes | 3.9.0 | |
| description | The detailed description of the resource. | Yes | 3.9.0 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 3.9.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 3.9.0 | |
| timeout | Yes |
DeleteLongJo
Deletes a long job. For
example,
DeleteLongJob uuid=7e42d390839e4fb2afe94e032de2f19dParameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The job UUID. | 2.3 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 2.3 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 2.3 | |
| timeout | Yes |
QueryLongJob
Queries a long job. For
example,
QueryLongJob jobName=APIPrimaryStorageMigrateVolumeMsgPrimitive Fields of Query
See Long Job Inventory.
Tags
You can create a user tag on a long job by using CreateUserTag
resourceType=LongJobVO. For
example,
CreateUserTag resourceType=LongJobVO tag=Test1 \
resourceUuid=3fd25b9e5b87423bba5612a45c1f5ecc