Skip to main content

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

AttributesRequired / OptionalTypeDescription
bundleKeyRequiredStringThe bundle in which the user action is declared
bundleTitleRequiredStringThe bundle in which the translated user action is located
idRequiredStringID of the job to be performed.

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

restBodyOptionalStringREST request body for the job to be run.
restHeadersOptionalArray of objectsREST request header for the job to be run.
 headerKeyRequiredString 
 headerValueRequiredString 
restMethodRequiredStringREST method of the job to be run. This can be one of the following values:
  • GET
  • PUT
  • POST
  • DELETE
restURLRequiredStringREST 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

CodeDescriptionComments
200OKThe request completed successfully.
400Bad RequestA 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.
401UnauthorizedThe user cannot be authenticated. Authentication has not been provided or has failed. A descriptive error message is returned in the response body.
403ForbiddenThe 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.
404Not foundA specified resource cannot be found. A descriptive error message is returned in the response body.
409ConflictThere is a conflict with the current state of the resource. A descriptive error message is returned in the response body.
500Internal Server ErrorAn internal error occurred. A descriptive error message is returned in the response body.

Response body

None