PUT /tasks/{job_list}

Use this method to cancel one or more jobs (tasks).

Note: This API requires Lenovo XClarity Administrator v1.4.0 or later.

Authentication

Authentication with user name and password is required.

Request URL

PUT https://{management_server_IP}/tasks/{job_list}

where {job_list} is a list of one or more job IDs, separated by a comma (for example, 10,11,12). To obtain the job IDs, use the GET /tasks method.

Query parameters

None

Request body

Table 1. Add a cancel callback to a created job
Attributes Required / Optional Type Description
cancelRESTBody Required when cancelRESTMethod is PUT or POST Object Request body for the cancel action, specified as a JSON key-value pair (for example, "a":"b"). JSON formatted request body that is required to cancel the job, specified as a key-value pairs
cancelRESTMethod Required String REST method to cancel the job. This can be one of the following values.
  • GET

  • POST

  • PUT

  • DELETE

cancelURL Required String URL to cancel the job
expirationTimeOut Required Integer Number of seconds after which the job expires. Use -1 for jobs that do not expire.
The following example cancels the specified jobs.
{
   "cancelRESTBody": {
      "DeviceList": [{
         "ServerList": [{ 
            "UUID": "8BFBADCC33CB11E499F740F2E9903640",
            "Components": [{
               "Fixid": "lnvgy_fw_imm2_tcoo17g-3.00_anyos_noarch",
               "Component": "IMM2 (Backup)"
            },
            {
               "Fixid": "lnvgy_fw_imm2_tcoo17g-3.00_anyos_noarch",
               "Component": "IMM2 (Primary)"
            }]
         }]
      }]
   },
   "cancelRESTMethod":"PUT",
   "cancelURL":"/updatableComponents?action=cancelApply&jobID=1",
   "expirationTimeOut": 60
}

Response codes

Code Description Comments
200 OK The request completed successfully.
400 Bad Request A query parameter or request attribute is missing or not valid, or the operation is not supported. A descriptive error message is returned in the response body.
401 Unauthorized The user cannot be authenticated. Authentication has not been provided or has failed. A descriptive error message is returned in the response body.
403 Forbidden The orchestrator server was prevented from fulfilling the request. A descriptive error message is returned in the response body. Ensure that you have privileges to perform the request.

For XClarity Administrator advanced functions, ensure that you have active licenses for each managed server that supports the advanced functions.

404 Not found A specified resource cannot be found. A descriptive error message is returned in the response body.
412 Precondition failed Specified data is invalid because of missing values. A descriptive error message is returned in the response body.
500 Internal Server Error An internal error occurred. A descriptive error message is returned in the response body.

Response body

None

The following example is returned when you create a subtask without using the custom ID.
["152", "153"]
The following example is returned when you create a subtask using the custom ID.
[{
   "customUid": "D",
   "uid": "70"
},
...,
{
   "customUid": "C",
   "uid": "69"
}]