Skip to main content

GET /tasks/schedules

Use this method to return information about all scheduled jobs.

Authentication

Authentication with username and password is required.

Request URL

GET https://{management_server_IP}/tasks/schedules

Query parameters

None

Request body

None

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

AttributesTypeDescription
componentIDsArray of stringsList of UUIDs of the devices or resource groups that are the target for the action.

To obtain the device and resource group IDs, use GET /chassis, GET /nodes, GET /storage, GET /switches, and GET /resourceGroups.

createdByStringUser name that created the scheduled job
creationDateStringTimestamp when the scheduled job was created
descriptionStringDescription of the scheduled job
execDateStringTimestamp when the scheduled job is to run next.
idStringID of the scheduled job
jobIDsArray of stringsList of IDs for all jobs that were started from the schedule
lastExecDateStringTimestamp when the scheduled job was last run
matchEverythingBooleanIndicates whether the action is to be run against all managed devices. This can be one of the following values.
  • true. The action is to be run against all managed devices

  • false. The action is run against only the managed device that is specified by the target attribute.

nameStringName of the scheduled job
nextExecDateStringTimestamp for the next scheduled run time of the job
stateStringState of the scheduled job. This can be one of the following values:
  • ACTIVE

  • ENDED

  • PAUSED

targetsStringDevice or resource group name that is the target for the job. If not application, the value is NONE. If more there is more than one target, the value is Multiple Targets.
triggerActionObjectInformation about the action that you want to schedule.
 actionBundleKeyStringThe bundle in which the user action is declared
 actionBundleTitleStringThe bundle in which the translated user action is located
 actionIDStringID of the action to be performed.

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

 actionTypeStringType of action to be performed. This can be one of the following value:
  • CUSTOM_REST
  • REST
 restBodyStringREST request body for the action to be run.
 restHeadersArray of objectsREST request header for the action to be run.
  headerKeyString 
  headerValueString 
 restMethodStringREST method of the action to be run. This can be one of the following values:
  • GET
  • PUT
  • POST
  • DELETE
 restURLStringREST URL of the job to be run.
typeStringType of schedule. This can be one of the following values.
  • ONE_TIME. The job runs one time on all target devices. If the specified start and end date are in the past, the job runs imminently.
  • RECURRING. The job runs on the specified dates and times on all target devices.
  • EVENT_TRIGGERED. The job runs when a specified event occurs. This job runs only on the device that generated the event.
The following example is returned if the request is successful.
[{
"componentIDs": [
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
"CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"],
"createdBy": "ADMIN",
"creationDate": "2017-10-26T15:14:44Z",
"description": "",
"execDate": "2017-10-26T04:00:00Z",
"id": "1509030884611",
"jobIDs": [],
"lastExecDate": "2017-10-26T15:15:13Z",
"matchEverything": false,
"name": "Power off",
"nextExecDate": "Not Available",
"state": "ENDED"
"targets": " Multiple Targets",
"triggerAction": {
"bundleTitle": "com.lenovo.lxca.discovery.bundle.jobs.jobActions",
"bundleKey": "PowerOff1",
"id": "PowerOff001",
"restBody": "{}",
"restHeaders": [],
"restMethod": "PUT",
"restURL": "/manage/power",
"type": "REST"
},
"type": "ONE_TIME"
}]