Asynchronous jobs
All POST, PUT, and DELETE requests always run asynchronously and a job object is returned in the response data. The returned job ID can then be used to retrieve the status of a job by using the GET /scalemgmt/v2/jobs/{jobId} endpoint.
The following example shows how to get information about the job 12345.
Request URL:
curl -k -u admin:admin001 -X GET --header 'accept:application/json'
'https://198.51.100.1:443/scalemgmt/v2/jobs/12345'
Response data:
{
"status": {
"code": "200",
"message": "..."
},
"paging": {
"next": "https://localhost:443/scalemgmt/v2/filesystems/gpfs0/filesets?lastId=1001"
},
"jobs": [
{
"result": {
"commands": "[''mmcrfileset gpfs0 restfs1001'', ...]",
"progress": "[''(2/3) Linking fileset'']",
"exitCode": "0",
"stderr": "[''EFSSG0740C There are not enough resources available to create
a new independent file set.'', ...]",
"stdout": "[''EFSSG4172I The file set {0} must be independent.'', ...]"
},
"request": {
"type": "GET",
"url": "/scalemgmt/v2/filesystems/gpfs0/filesets",
"data": "{\"config\":{\"filesetName\":\"restfs1001\",\"owner\":\"root\",\"path\":
\"/mnt/gpfs0/rest1001\",\"permissions\":\"555\"}"
},
"jobId": "12345",
"submitted": "2016-11-14 10.35.56",
"completed": "2016-11-14 10.35.56",
"status": "COMPLETED"
}
]
}
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 an internal server error.
The following endpoints are available to monitor or delete a job:
GET /jobs
: Get details of asynchronous jobs.GET /jobs/{jobId}
: Get details of a specific asynchronous job.DELETE /jobs/{jobId}
: Cancel an asynchronous job that is running.