Query Long Job

GET/zstack/v1/longjobs
GET/zstack/v1/longjobs/{uuid}

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/longjobs
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/longjobs/f031e4ea64673a5f96e022f4eb81fc59

Queryable Fields

Run the CLI command line tool, enter QueryLongJob and press Tab to view all queryable fields and cross-table queryable resource names.

API Response

Response example

{
  "inventories": [
    {
      "uuid": "e8a3fcaa8c393684b78a6dc1b20db49f"
    }
  ]
}
NameTypeDescriptionStarting Version
errorErrorCodeThe error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error2.3
inventoriesListFor details, see inventories2.3

error

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

inventories

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource. Uniquely identifies the resource.2.3
nameStringResource name2.3
descriptionStringDetailed description of the resource2.3
apiIdStringThe API ID used to associate with TaskProgress2.3
jobNameStringJob name2.3
jobDataStringJob data2.3
jobResultStringJob result2.3
targetResourceUuidStringTarget resource UUID2.3
managementNodeUuidStringManagement node UUID2.3
createDateTimestampCreation time2.3
lastOpDateTimestampLast modification time2.3
stateLongJobStateFor details, see state2.3

state

NameTypeDescriptionStarting Version
nameStringResource name2.3
ordinalint 2.3

SDK Examples

Java SDK

QueryLongJobAction action = new QueryLongJobAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryLongJobAction.Result res = action.call();

Python SDK

QueryLongJobAction action = QueryLongJobAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryLongJobAction.Result res = action.call()