Skip to main content

POST /tasks/schedules

Use this method to create a scheduled job (task).

Authentication

Authentication with username and password is required.

Request URL

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

Query parameters

None

Request body

AttributesRequired / OptionalTypeDescription
actionOptionalStringAction to take. This can be one of the following values.
  • CREATE (default) Creates a scheduled job that can be run now.

  • CLONE. Creates a copy of a scheduled job.

  • POSTPONE. Creates a scheduled job that can be run later. If you specify this value, you must also specify the triggerActions attribute.

componentIDsRequiredArray 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.

execDateRequired when schedule type is ONE_TIMEStringTimestamp when the scheduled job is to run next.
matchEverythingOptionalBooleanIndicates 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.

nameRequiredStringName of the scheduled job
ruleRequired when schedule type is RECURRINGObjectInformation about the scheduling rules
 dayOfWeekRequired when rule type is weekly or monthly, or yearlyStringDay of each week when the job is to run. This can be one of the following values.
  • monday

  • tuesday

  • wednesday

  • thursday

  • friday

  • saturday

  • sunday

 daysRequired when rule type is dailyArray of stringsDays when the job is to run. This can be one or more of the following values.
  • monday

  • tuesday

  • wednesday

  • thursday

  • friday

  • saturday

  • sunday

 endDateRequired when noEnd is falseStringDate and time when the job stops running
 monthOfYearRequired when rule type is yearlyStringMonth of each year when the job is to run. This can be one of the following values.
  • january

  • february

  • march

  • april

  • june

  • july

  • august

  • september

  • october

  • november

  • december

 noEndOptionalBooleanIndicates whether the schedule has no end date. This can be one of the following values.
  • true. The schedule has no end date.

  • false. (default) The schedule has an end date.

 recurEveryOptional when rule type is weekly, monthly, or yearlyIntegerInterval for running the job (for example, specify 2 for every two weeks)

The default is 1.

 startDateRequiredStringDate and time when the job starts running
 timeZoneRequiredStringTime zone for the schedule (for example, GMT-0)
 typeRequiredStringType of recurring schedule. This can be one of the following values.
  • daily

  • weekly

  • monthly

  • yearly

 weekOfMonthRequired when rule type is monthly or yearlyIntegerWeek of each month when the job is to run. This can be one of the following values.
  • 1

  • 2

  • 3

  • 4

  • 5

eventFilterRequired when schedule type is EVENT_TRIGGEREDObjectInformation about the events that trigger the job to run
 eventIDOptionalStringList of IDs, separated by a comma, for events that trigger the job to run
 eventServiceOptionalArray of stringsService type. This can be one or both of the following values.
  • support

  • user

 eventClassOptionalArray of objectsInformation about the event class - severity mapping.
  nameRequiredStringName of the event class. This can be one of the following values.
  • unknown

  • audit

  • cooling

  • power

  • disks

  • memory

  • processor

  • rackserver

  • test

  • adapter_card

  • expansion_board

  • flexswitch

  • computenode

  • rackswitch

  severitiesRequiredArray of stringsList of severities that trigger the job to run. This can be one or more of the following values.
  • Unknown. Unknown severity.

  • Informational. Informational

  • Warning. User can decide if action is needed.

  • Minor. Action is needed, but the situation is not serious at this time.

  • Major. Action is needed now.

  • Critical. Action is needed now and the scope is broad (perhaps an imminent outage to a critical resource will result).

  • Fatal. A non-recoverable error has occurred.

scopeRequired when schedule type is EVENT_TRIGGEREDObjectDate interval on which the event triggered scheduler will be active
 startDateRequiredStringDate and time when the schedule starts, in the GMT-0 time zone
 endDateRequired if noEnd is trueStringDate and time when the schedule ends, in the GMT-0 time zone
 noEndOptionalBooleanIndicates whether the schedule has no end date. This can be one of the following values.
  • true. The schedule has no end date.

  • false. (default) The schedule has an end date.

triggerActionRequiredObjectInformation about the action to run on the target devices
  • You can run a predefined action by specifying the id attribute.

  • You can create a custom action based on a REST API by specifying the options, restBody, restMethod, restURL, and type attributes.

 idRequired if options, restBody, restMethod, restURL, and type are not specifiedStringID of the action to run

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

 optionsRequired if id is not specifiedStringSchedule type. This can be one of the following values.
  • ONE_TIME. The action 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.

 restBodyRequired if id is not specifiedObjectResponse body of the REST API
  {response_body}RequiredvariesList of attributes in the response body of the specified REST API
 restMethodRequired if id is not specifiedStringMethod of the REST API. This can be one of the following values.
  • GET

  • POST

  • PUT

  • DELETE

 restURLRequired if id is not specifiedStringURL of the REST API
 typeRequired if id is not specifiedStringAction type. This value is always CUSTOM_REST.
typeRequiredStringType 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 create a schedule to collect service data one time.
{
"componentIDs" : ["784A050844A0E5119A9E008CFAE82560"],
"execDate" : "2017-09-19T12:22:00.000Z",
"matchEverything": false,
"name": "CollectServiceData - One-time",
"triggerAction": {
"id": "ServiceDataCollect",
},
"type": "ONE_TIME"
}
The following example create a schedule to collect service data daily.
{
"componentIDs": ["784A050844A0E5119A9E008CFAE82560"],
"matchEverything": false,
"name": "CollectServiceData - Daily",
"rule": {
"days": ["monday","wednesday"],
"endDate": "2017-10-27 18:39:00"
"startDate": "2017-10-18 18:39:00",
"timeZone": "Europe/Bucharest",
"type": "daily"
},
"triggerAction": {
"id": "ServiceDataCollect",
},
"type": "RECURRING"
}
The following example create a schedule to backup the management server every other week.
{
"action": "postpone"
"name": "BackupCreation",
"rule": {
"dayOfWeek": "monday",
"noEnd": true,
"recurEvery": 2,
"startDate": "2020-06-17 10:30:00",
"timeZone": "America/New_York",
"type": "weekly"
},
"triggerAction": {
"restMethod": "POST",
"restURL": "/managementServer/data",
"restBody": {
"action": "start",
"includeOS": false,
"includeFW": false,
"label": "test",
"operation": "backup",
"passphrase": "CME44lenovo",
"remoteShareDestination": ""
},
"options": ["ONE_TIME","RECURRING"],
"type": "CUSTOM_REST"
},
"type": "RECURRING",
}
The following example create a schedule to collect service data monthly.
{
"componentIDs": ["784A050844A0E5119A9E008CFAE82560"],
"matchEverything": false,
"name": "CollectServiceData - Monthly",
"rule": {
"dayOfWeek": "monday",
"endDate": "2017-10-27 18:39:00",
"recurEvery": 1,
"startDate": "2017-10-18 18:39:00",
"timeZone": "Europe/Bucharest",
"type": "monthly",
"weekOfMonth": 1
},
"triggerAction": {
"id": "ServiceDataCollect",
},
"type": "RECURRING"
}
The following example create a schedule to collect service data yearly.
{
"componentIDs": ["784A050844A0E5119A9E008CFAE82560"],
"matchEverything": false,
"name": "CollectServiceData - Yearly",
"rule": {
"endDate": "2017-10-27 18:39:00",
"dayOfWeek": "monday",
"monthOfYear": "january",
"recurEvery": 1,
"startDate": "2017-10-18 18:39:00",
"timeZone": "Europe/Bucharest",
"type": "yearly",
"weekOfMonth": 1
},
"triggerAction": {
"id": "ServiceDataCollect",
},
"type": "RECURRING"
}
The following example create a schedule to collect service data for a device when a specific event occurs.
{ 
"componentIDs": ["72075DA6ADAC11E5868702E0EC2EC4F3"],
"eventFilter": {
"eventID": "0001D600"
},
"matchEverything": false,
"name": "Collect device service data - Event-triggered",
"scope": {
"endDate": "2017-11-02T22:00:00.000Z",
"noEnd": false
"startDate": "2017-10-17T21:00:00.000Z",
},
"type": "EVENT_TRIGGERED",
"id": "FfdcCollect1"
}
}

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
scheduleIdStringID of the job schedule

The following example is returned if the request is successful.

{
"scheduleId": "1505827038623"
}