POST /tasks/schedules/actions
Use this method to register a new predefined action at the runtime.
Authentication
Authentication with username 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:
| ||
restURL | Required | String | REST URL of the job to be run. |
The following example registers a new predefined action at the runtime..
{
"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 | 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. |
404 | Not found | A specified resource cannot be found. A descriptive error message is returned in the response body. |
409 | Conflict | There is a conflict with the current state of the resource. 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
Give documentation feedback