Jobs: GET
Gets details about the asynchronous jobs.
Availability
Available on all IBM Storage Scale editions.
Description
The GET jobs request gets information about the asynchronous jobs.
Request URL
https://<IP address or host name of API server>:<port>/scalemgmt/v2/jobs
where- jobs
- Specifies running jobs as the resource of this GET call. Required.
Request headers
Content-Type: application/json
Accept: application/json
Request parameters
The following parameters can be used in the request URL to customize the
request:
Parameter name | Description and applicable keywords | Required/optional |
---|---|---|
fields | Comma separated list of fields to be included in response. ':all:' selects all available fields. | Optional. |
filter | Filter objects by expression. For example, 'status=HEALTHY,entityType=FILESET' | Optional. |
Request data
No request data.
Response data
{
"status": {
"code":ReturnCode",
"message":"ReturnMessage"
},
"paging":
{
"next": "URL"
},
jobs: [
{
"result":"",
{
"commands":"String",
"progress":"String,
"exitCode":"Exit code",
"stderr":"Error",
"stdout":"String",
},
"request":" ",
{
"type":"{GET | POST | PUT | DELETE}",
"url":"URL",
"data":""",
}
"jobId":"ID",
"submitted":"Time",
"completed":Time",
"status":"Job status",
}
],
}
For
more information about the fields in the following data structures, see the links at the end of this
topic.- "status":
- Return status.
- "message": "ReturnMessage",
- The return message.
- "code": ReturnCode
- The return code.
- "paging"
- The URL to retrieve the next page. Paging is enabled when more than 1000 objects are returned by the query.
- "jobs":
- An array of elements that describe jobs. Each element describes one job.
- "result"
-
- "commands":"String'
- Array of commands that are run in this job.
- "progress":"String'
- Progress information for the request.
- "exitCode":"Exit code"
- Exit code of command. Zero is success, nonzero denotes failure.
- "stderr":"Error"
- CLI messages from stderr.
- "stdout":"String"
- CLI messages from stdout.
- "request"
-
- "type":"{GET | POST | PUT | DELETE}"
- HTTP request type.
- "url":"URL"
- The URL through which the job is submitted.
- "data":" "
- Optional.
- "jobId":"ID",
- The unique ID of the job.
- "submitted":"Time"
- The time at which the job was submitted.
- "completed":Time"
- The time at which the job was completed.
- "status":"RUNNING | COMPLETED | FAILED"
- Status of the job.
Examples
The following example gets information about the jobs.
Request URL:
curl -k -u admin:admin001 -X GET --header 'accept:application/json'
'https://198.51.100.1:443/scalemgmt/v2/jobs
The request URL with no field or filter parameter returns only the
details that uniquely identify the object.Response data:
Note: In the JSON data that is returned, the return code indicates whether the
command is successful. The response code 200 indicates that the command successfully retrieved the
information. Error code 400 represents an
invalid request and 500 represents internal server error.
{
"jobs" : [ {
"jobId" : 1000000000001,
"status" : "COMPLETED",
"submitted" : "2017-03-21 15:49:20,100",
"completed" : "2017-03-21 15:49:24,251"
}, {
"jobId" : 1000000000002,
"status" : "COMPLETED",
"submitted" : "2017-03-21 15:52:13,776",
"completed" : "2017-03-21 15:52:16,030"
} ],
"status" : {
"code" : 200,
"message" : "The request finished successfully"
}
}
Using the field parameter ":all:" returns entire details of the jobs. For example:
curl -k -u admin:admin001 -X GET --header 'accept:application/json'
'https://198.51.100.1:443/scalemgmt/v2/jobs?fields=:all:'
{
"jobs" : [ {
"jobId" : 1000000000001,
"status" : "COMPLETED",
"submitted" : "2017-03-21 15:49:20,100",
"completed" : "2017-03-21 15:49:24,251",
"request" : {
"data" : {
"snapshotName" : "mySnap1"
},
"type" : "POST",
"url" : "/scalemgmt/v2/filesystems/gpfs0/snapshots"
},
"result" : {
"progress" : [ ],
"commands" : [ "mmcrsnapshot 'gpfs0' 'mySnap1' " ],
"stdout" : [ "EFSSG0019I The snapshot mySnap1 has been successfully created." ],
"stderr" : [ ],
"exitCode" : 0
}
}, {
"jobId" : 1000000000002,
"status" : "COMPLETED",
"submitted" : "2017-03-21 15:52:13,776",
"completed" : "2017-03-21 15:52:16,030",
"request" : {
"data" : {
"snapshotName" : "mySnap1"
},
"type" : "POST",
"url" : "/scalemgmt/v2/filesystems/gpfs0/filesets/fset1/snapshots"
},
"result" : {
"progress" : [ ],
"commands" : [ "mmcrsnapshot 'gpfs0' 'mySnap1' -j 'fset1' " ],
"stdout" : [ "EFSSG0019I The snapshot mySnap1 has been successfully created." ],
"stderr" : [ ],
"exitCode" : 0
}
} ],
"status" : {
"code" : 200,
"message" : "The request finished successfully"
}
}