POST /tasks/schedules/actions

Use this GET method to register a new predefined action at the runtime.

Note: This API requires Lenovo XClarity Administrator v2.0.0 or later

Authentication

Authentication with user name and password is required.

Request URL

POST https://<management_server_IP>/tasks/schedules/actions

Query parameters

None

Request body

Attributes Required / Optional Type Description
bundleKey Required String The bundle in which the user action is declared
bundleTitle Required String The bundle in which the translated user action is located
id Required String ID of the job to be performed.

To obtain the action IDs, use GET /tasks/schedules/actions.

restBody Optional String REST request body for the job to be run.
restHeaders Optional Array of objects REST request header for the job to be run.
  headerKey Required String  
  headerValue Required String  
restMethod Required String REST method of the job to be run. This can be one of the following values:
  • GET

  • PUT

  • POST

  • DELETE

restURL Required String REST URL of the job to be run.

Request example

{
   "bundleKey": "ActionBundleKey",
   "bundleTitle": "com.lenovo.lxca.job.bundle.scheduleTest",
   "id": "actionID",
   "restBody": "{\"key1\":\"keyValue\", \"key2\":2, \"key3\":true}",
   "restHeaders": [{
      "headerKey": "aaa",
      "headerValue": "bbb"
   },
   {
      "headerKey": "ccc",
      "headerValue": "ddd"
   }],
   "restMethod": "PUT",
   "restURL": "/path/to/job"
}

Response codes

Code Description
200 OK
400 Bad request
401 Unauthorized
403 Forbidden
404 Not found
409 Conflict
500 Internal server error

Response body

None