Calendar schedules tips
When creating schedules, you can set multiple timing criteria. The following examples show schedules with advanced timing. For basic schedules, see the Schedules Endpoint.
Bi-weekly calendar schedule with specific days
This schedule is set to run biweekly, indicated by the "type": "WEEKLY"
and "interval": 2
fields. As indicated by the daysOfWeek
array, this schedule is active on Monday, Wednesday, and Friday.
InputDTO:
{
"displayName":"Schedule1",
"endDate":"2020-07-10",
"endTime":"2020-05-06T19:30",
"startTime":"2020-05-06T15:30",
"timeZone":"America/Denver",
"recurrence":{
"type":"WEEKLY",
"interval":2,
"daysOfWeek":[
"Mon",
"Wed",
"Fri"
]
}
}
The API response for this schedule:
{
"uuid":"284559431391120",
"displayName":"DallasTest",
"endDate":"2020-07-10",
"startTime":"2020-05-06T15:30",
"endTime":"2020-05-06T19:30",
"recurrence":{
"type":"WEEKLY",
"daysOfWeek":[
"Mon",
"Wed",
"Fri"
],
"interval":2
},
"timeZone":"America/Denver",
"nextOccurrence":"2020-05-06T15:30:00",
"nextOccurrenceTimestamp":1588800600000
}
Six-month calendar schedule with specific week of the month
This schedule is set to run every six months, indicated by the "type": "MONTHLY"
and "interval": 6
fields. As indicated by the daysOfWeek
array this schedule is active on Wednesday, and the "weekOfTheMonth": 2
indicates that this schedule will only run on the second week of the month.
This schedule was created on May 5th, 2020. Converting the timestamp in the API Response to a human-readable date, you see that the next run is on Wednesday, May 13, 2020 3:30:00 PM, the second Wednesday in May.
Input DTO:
{
"displayName":"DallasTest2",
"endDate":"2020-10-19",
"endTime":"2020-05-06T19:15",
"startTime":"2020-05-06T15:30",
"timeZone":"America/Denver",
"recurrence":{
"type":"MONTHLY",
"interval":6,
"daysOfWeek":[
"Wed"
],
"weekOfTheMonth":[
2
]
}
}
The API response for this schedule:
{
"uuid":"284559434037456",
"displayName":"DallasTest2",
"endDate":"2020-10-19",
"startTime":"2020-05-06T15:30",
"endTime":"2020-05-06T19:15",
"recurrence":{
"type":"MONTHLY",
"daysOfWeek":[
"Wed"
],
"weekOfTheMonth":[
2
],
"interval":6
},
"timeZone":"America/Denver",
"nextOccurrence":"2020-05-13T15:30:00",
"nextOccurrenceTimestamp":1589405400000
}
Getting policies attached to a specific calendar schedule
In order to see what policies are using a schedule, use the https://10.10.10.10/api/v3/schedules/{schedule_UUID}/settingsPolicy
request.
Response: An array of SettingspolicyApiDTO
s that represent the policies using the specified schedule, whose details are also included.
[
{
"uuid": "284466929430656",
"displayName": "DalStorage",
"entityType": "Storage",
"scopes": [
{
"uuid": "284460958528132",
"displayName": "HawthorneHC_datastore",
"isStatic": true,
"logicalOperator": "AND"
}
],
"settingsManagers": [
{
"uuid": "automationmanager",
"displayName": "Action Mode Settings",
"category": "Automation",
"settings": [
{
"uuid": "suspend",
"displayName": "Suspend",
"value": "MANUAL",
"defaultValue": "MANUAL",
"valueType": "STRING",
"valueObjectType": "String",
"options": [
{
"label": "Disabled",
"value": "DISABLED"
},
{
"label": "Recommend",
"value": "RECOMMEND"
},
{
"label": "Manual",
"value": "MANUAL"
},
{
"label": "Automatic",
"value": "AUTOMATIC"
}
],
"entityType": "Storage"
}
]
}
],
"schedule": {
"uuid": "284466929277824",
"displayName": "DalSched2",
"startTime": "2020-02-29T16:30",
"endTime": "2020-02-29T17:45",
"recurrence": {
"type": "MONTHLY",
"daysOfMonth": [
5
],
"interval": 3
},
"timeZone": "America/Denver",
"nextOccurrence": "2020-05-05T16:30:00",
"nextOccurrenceTimestamp": 1588717800000
},
"disabled": false,
"readOnly": false,
"default": false
}
]