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
Attributes | Required / Optional | Type | Description | ||
---|---|---|---|---|---|
action | Optional | String | Action to take. This can be one of the following values.
| ||
componentIDs | Required | Array of strings | List 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. | ||
execDate | Required when schedule type is ONE_TIME | String | Timestamp when the scheduled job is to run next. | ||
matchEverything | Optional | Boolean | Indicates whether the action is to be run against all managed devices. This can be one of the following values.
| ||
name | Required | String | Name of the scheduled job | ||
rule | Required when schedule type is RECURRING | Object | Information about the scheduling rules | ||
dayOfWeek | Required when rule type is weekly or monthly, or yearly | String | Day of each week when the job is to run. This can be one of the following values.
| ||
days | Required when rule type is daily | Array of strings | Days when the job is to run. This can be one or more of the following values.
| ||
endDate | Required when noEnd is false | String | Date and time when the job stops running | ||
monthOfYear | Required when rule type is yearly | String | Month of each year when the job is to run. This can be one of the following values.
| ||
noEnd | Optional | Boolean | Indicates whether the schedule has no end date. This can be one of the following values.
| ||
recurEvery | Optional when rule type is weekly, monthly, or yearly | Integer | Interval for running the job (for example, specify 2 for every two weeks) The default is 1. | ||
startDate | Required | String | Date and time when the job starts running | ||
timeZone | Required | String | Time zone for the schedule (for example, GMT-0) | ||
type | Required | String | Type of recurring schedule. This can be one of the following values.
| ||
weekOfMonth | Required when rule type is monthly or yearly | Integer | Week of each month when the job is to run. This can be one of the following values.
| ||
eventFilter | Required when schedule type is EVENT_TRIGGERED | Object | Information about the events that trigger the job to run | ||
eventID | Optional | String | List of IDs, separated by a comma, for events that trigger the job to run | ||
eventService | Optional | Array of strings | Service type. This can be one or both of the following values.
| ||
eventClass | Optional | Array of objects | Information about the event class - severity mapping. | ||
name | Required | String | Name of the event class. This can be one of the following values.
| ||
severities | Required | Array of strings | List of severities that trigger the job to run. This can be one or more of the following values.
| ||
scope | Required when schedule type is EVENT_TRIGGERED | Object | Date interval on which the event triggered scheduler will be active | ||
startDate | Required | String | Date and time when the schedule starts, in the GMT-0 time zone | ||
endDate | Required if noEnd is true | String | Date and time when the schedule ends, in the GMT-0 time zone | ||
noEnd | Optional | Boolean | Indicates whether the schedule has no end date. This can be one of the following values.
| ||
triggerAction | Required | Object | Information about the action to run on the target devices
| ||
id | Required if options, restBody, restMethod, restURL, and type are not specified | String | ID of the action to run To obtain the action IDs, use GET /tasks/schedules/actions. | ||
options | Required if id is not specified | String | Schedule type. This can be one of the following values.
| ||
restBody | Required if id is not specified | Object | Response body of the REST API | ||
{response_body} | Required | varies | List of attributes in the response body of the specified REST API | ||
restMethod | Required if id is not specified | String | Method of the REST API. This can be one of the following values.
| ||
restURL | Required if id is not specified | String | URL of the REST API | ||
type | Required if id is not specified | String | Action type. This value is always CUSTOM_REST. | ||
type | Required | String | Type of schedule. This can be one of the following values.
|
{
"componentIDs" : ["784A050844A0E5119A9E008CFAE82560"],
"execDate" : "2017-09-19T12:22:00.000Z",
"matchEverything": false,
"name": "CollectServiceData - One-time",
"triggerAction": {
"id": "ServiceDataCollect",
},
"type": "ONE_TIME"
}
{
"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"
}
{
"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",
}
{
"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"
}
{
"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"
}
{
"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
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
Attributes | Type | Description | ||
---|---|---|---|---|
scheduleId | String | ID of the job schedule |
The following example is returned if the request is successful.
{
"scheduleId": "1505827038623"
}