Schedules
Use Schedules to determine when your Storage Policies are applied, multiple Schedules and Storage Policies can be configured to provide fine control of your data storage - this is achieved by setting which conversations to move/archive/purge using Storage Policies and then when to apply those policies using Schedules. Schedules can be configured to apply policies on specified frequencies, at specified times and time zones. These frequencies include by minutes, hourly, daily, weekly, monthly and yearly.
This topic details how to get, add, update, and delete Schedules using API requests, but new Schedules can also be configured during the Create Storage Policy requests, See either Add Move Media Storage Policy, Add an Archive Metadata Policy, or Add a Purge Policy for details.
Also see Get Policies for Schedules for a list of all policies that use specified schedules.
Get all Schedules
Use the get all schedules request to get information on all of the schedules in your U-Capture system.
Endpoint
Method: GET
URL: /policy/schedules
Request Parameter
Unlike other requests the get all schedules request does not require a request body.
Response and Error Code
Response Code | Condition |
---|---|
200 | OK |
Response Parameter
Parameter Name | Data Type | Description |
---|---|---|
| Array | The list of Schedules in your U-Capture system, each with a combination of the following parameters in this table |
| Number | The unique ID for the Schedule. |
Type, either | Array | Determines the frequency type of the Schedule, used in combination with the Schedule Each type has different sub-parameters, these are detailed in Add a Schedule. |
| Number | Determines the frequency value of the Schedule, used in combination with the Schedule Type (see above) to determine how often the Schedule repeats, for example setting |
| String | The useful name for the Schedule. |
| String | The useful description of the Schedule if configured. |
Sample Response
{ "schedule": [ { "id": "35", "weekly": { "daysOfWeek": [ "MON", "TUE" ], "executionTime": "00:00", "timezone": "UTC" }, "interval": "3", "name": "3 week schedule", "description": "weekly schedule to trigger every 3 weeks on Monday and Tuesday" }, { "id": "217", "hourly": { "executionTime": "17:00", "timezone": "UTC" }, "interval": "12", "name": "12 hours schedule", "description": "hourly schedule to trigger twice a day" } ] }
Get a Schedule
Use the get a schedule request to get the information for a specific Schedule in your U-Capture system.
Endpoint
Method: GET
URL: /policy/Schedule/:scheduleId
Path Parameter
Parameter Name | Data Type | Description | Required/Optional |
---|---|---|---|
| Number | The unique ID of the Schedule. | Required |
Response and Error Code
Response Code | Condition |
---|---|
200 | OK |
Response Parameter
Parameter Name | Data Type | Description |
---|---|---|
| Array | The details of the Schedule specified in the request path parameter, detailed using a combination of the following parameters in this table. |
| Number | The unique ID of the Schedule, this will match the |
Type, either | Array | Determines the frequency type of the Schedule, used in combination with the Schedule Each type has different sub-parameters, these are detailed in Add a Schedule. |
| Number | Determines the frequency value of the Schedule, used in combination with the Schedule Type (see above) to determine how often the Schedule repeats, for example setting |
| String | The useful name for the Schedule. |
| String | The useful description of the Schedule if configured. |
Sample Response
{ "schedule": { "id": "35", "weekly": { "daysOfWeek": [ "MON", "TUE" ], "executionTime": "00:00", "timezone": "UTC" }, "interval": "3", "name": "3 week schedule", "description": "weekly schedule to trigger every 3 weeks on Monday and Tuesday" } }
Add a Schedule
Use the add a schedule request to create a new Schedule in your U-Capture system, as mentioned previously Schedules are used to determine the frequency and time that Storage Policies are applied.
Endpoint
Method: POST
URL: /policy/schedule
Request Parameter
Parameter Name | Data Type | Description | Required/Optional |
---|---|---|---|
| Array | Set the details for the schedule using the following parameters in this table. | Required |
| Number | Determine the frequency value of the Schedule, used in combination with the Schedule Type (see below) to determine how often the Schedule repeats, for example setting Valid values depend on the frequency type:
| Required |
Type: either | Array | Determine the frequency type of the Schedule, used in combination with the Schedule | Required |
| String | Set a useful name for the Schedule. | Required |
| String | Set a useful description for the Schedule. | Optional |
For example Requests, see Sample Requests.
Types
As mentioned above there are different types of Schedule that can be used to specify the frequency that affected policies are applied, and the type of Schedule works with the interval
parameter. In order to provide fine control of your captured data the following types and their sub parameters are available. For example create schedule requests for each type, see Sample Requests.
Use minutes
to apply affected policies every set amount of minutes.
There are no sub-parameters for the minutes
frequency type.
If minutes
is used, then valid interval
values are 1
to 59
.
Note
For minutes
the affected policies will be applied from the first hour mark using the specified interval
. For example if a Schedule was created at 5:12 with the interval
value of 15
then the policy would be applied at 5:15, 5:30, 5:45 and so on.
Use hourly
to apply affected policies every set amount of hours.
Use sub-parameter
executionTime
to determine when to first apply the Schedule, the value is a 24 hour time value, for example17:00
.Use sub-parameter
timezone
to set the timezone to base the Schedule on.
If hourly
is used, then valid interval
values are 1
to 99
.
Use daily
to apply affected policies every set amount of days.
Use sub-parameter
executionTime
to determine when to first apply the Schedule, the value is a 24 hour time value, for example17:00
.Use sub-parameter
timezone
to set the timezone to base the Schedule on (values need to be in all caps).
If daily
is used, then valid interval
values are 1
to 99
.
Use weekly
to apply affected policies every set amount of weeks.
Use sub-parameter
executionTime
to determine when to first apply the Schedule, the value is a 24 hour time value, for example17:00
.Use sub-parameter
timezone
to set the timezone to base the Schedule on.Use sub-parameter
daysOfWeek
to determine which days of the week to apply the affected policies on, you can use a comma separated list to specify multiple days, for example you could setdaysOfWeek
tomon, tue
andinterval
to12
to apply policies every 12 weeks on Monday and Tuesday.
If weekly
is used, then valid interval
values are 1
to 99
.
Use monthly
to apply affected policies every specific day of the month, either by date (for example the 15th day) or specific day of a specific week of the month (for example the Tuesday of the last week of the month).
Use sub-parameter
executionTime
to determine when to first apply the Schedule, the value is a 24 hour time value, for example17:00
.Use sub-parameter
timezone
to set the timezone to base the Schedule on.To determine the specific day of the month to apply the affected policies, use either of the below sub-parameter arrays:
To apply affected policies on a specific date of the month (for example the 15th day), use the
schedule_by_day
array, and sub-parameterdayOfMonth
with a value of1
to31
.Caution
If
dayOfMonth
is set to a value that not every month has (29, 30, or 31) the Schedule will not be triggered on that month, for example a Schedule set to trigger on the 30th of every month will not be triggered in February.To apply affected policies on a specific day of a specific week of the month (for example the Tuesday of the last week of the month), use the
scheduleByOccurance
array, with sub-parametersnth_occurence
andnth_occurance_day
.Valid values for
nthOccurence
includefirst
,second
,third
,forth
, andlast
.Valid values for
nthOccurence_day
includemonday
,tuesday
,wednesday
,thursday
,friday
,saturday
, andsunday
.
If monthly
is used, then valid interval
values are 1
to 99
.
Use yearly
to apply affected policies every specific day of the year, either by date (for example the 15th or July) or specific day of a specific week of a specific month (for example the Tuesday of the last week of the July).
Use sub-parameter
executionTime
to determine when to first apply the Schedule, the value is a 24 hour time value, for example17:00
.Use sub-parameter
timezone
to set the timezone to base the Schedule on.Use sub-parameter
month
to determine the month of the year to apply affected policies (use a capital letter for the first letter of the month here for example July).To determine the specific day of the month to apply the affected policies, use either of the below sub-parameter arrays:
To apply affected policies on a specific date of the month (for example the 15th day), use the
scheduleByDay
array, and sub-parameterdayOfMonth
with a value of1
to31
.Caution
If
dayOfMonth
is set to a value that not every month has (29, 30, or 31) the Schedule will not be triggered on that month, for example a Schedule set to trigger on the 30th of every month will not be triggered in February.To apply affected policies on a specific day of a specific week of the month (for example the Tuesday of the last week of the month), use the
scheduleByOccurance
array, with sub-parametersnthOccurence
andnthOccuranceDay
.Valid values for
nthOccurence
includefirst
,second
,third
,forth
, andlast
.Valid values for
nthOccurence_day
includemonday
,tuesday
,wednesday
,thursday
,friday
,saturday
, andsunday
.
If yearly
is used, then valid interval
values are 1
to 99
.
Response and Error Code
Response Code | Condition |
---|---|
201 | Created |
Response Parameter
Parameter Name | Data Type | Description |
---|---|---|
| Integer | The automatically generated ID of the new Schedule. |
For an example response, see Sample Response.
Sample Requests
Add a Schedule with minutes frequency:
{"schedule":{ "interval": 15, "minute": { }, "name":"15 minute schedule", "description":"minute schedule to trigger every 15 minutes" }}
Add a Schedule with hourly frequency:
{"schedule":{ "interval": 12, "hourly": { "executionTime": "17:00", "timezone": "UTC" }, "name":"12 hours schedule", "description":"hourly schedule to trigger twice a day" }}
Add a Schedule with daily frequency:
{"schedule":{ "interval": 10, "daily": { "executionTime": "17:00", "timezone": "UTC" }, "name":"10 days schedule", "description":"schedule to trigger every 10 days" }}
Add a Schedule with weekly frequency:
{"schedule":{ "interval": 3, "weekly": { "executionTime": "00:00", "timezone": "UTC", "daysOfWeek":["mon","tue"] }, "name":"3 week schedule", "description":"weekly schedule to trigger every 3 weeks on Monday and Tuesday" }}
Add a Schedule with monthly frequency (specific date of the month):
{"schedule": { "interval": 1, "monthly": { "executionTime": "17:00", "timezone": "UTC", "scheduleByDay": { "dayOfMonth": "15" } }, "name":"monthly schedule", "description":"monthly schedule to trigger every 15th day of the month" }}
Add a Schedule with monthly frequency (nth day of the nth week of a month):
{"schedule": { "interval": 2, "monthly": { "executionTime": "17:00", "timezone": "UTC", "scheduleByOccurrence": { "nthOccurrence": "last", "nthOccurrence_day": "tuesday" } }, "name":"monthly schedule", "description":"monthly schedule to trigger on the last Tuesday of every other month" }}
Add a Schedule with yearly frequency (specific day of a specific month):
{"schedule": { "interval": 2, "yearly": { "executionTime": "17:00", "timezone": "UTC", "month": "July", "scheduleByDay": { "day_of_month": "19" } }, "name":"yearly schedule", "description":"yearly schedule to trigger on the 19 of July every other year" }}
Add a Schedule with yearly frequency (nth day of the nth week of a specific month):
{"schedule": { "interval": 3, "yearly": { "executionTime": "17:00", "timezone": "UTC", "month": "July", "scheduleByOccurrence": { "nthOccurrence": "first", "nthOccurrenceDay": "monday" } }, "name":"yearly schedule", "description":"yearly schedule to trigger on the first Monday of July every 3 years" }}
Sample Response
{ "scheduleId": "407" }
Update a Schedule
Use the update schedule request to update one or more of a Schedule's parameters.
Endpoint
Method: PUT
URL: /policy/schedule/:scheduleId
Path Parameter
Parameter Name | Data Type | Description | Required/Optional |
---|---|---|---|
| Number | The ID of the Schedule to update. | Required |
Request Parameter
Parameter Name | Data Type | Description | Required/Optional |
---|---|---|---|
| Array | A list of the Schedule's parameters to update. If any of the following parameters in this table are specified in the request then their associated values will be used to update the matching parameter values in the existing Schedule specified in the path parameter. | Required |
| Number | Update the frequency value of the Schedule, used in combination with the Schedule Type (see below) to determine how often the Schedule repeats, for example setting Valid values depend on the frequency type:
| Optional |
Type, either | Array | Update the frequency type of the Schedule, used in combination with the Schedule When updating the frequency type, all of the the type's sub-parameters must be included in the request, even if only one of the sub-parameters is to be updated (see Types below for a list of the required sub-parameters for each type). A Schedule can be updated to use a different frequency type, for example a Schedule currently operating using | Optional |
| String | Update the name of the Schedule. | Optional |
| String | Update the description of the Schedule. | Optional |
For an example Request, see Sample Request.
Types
for an extensive understanding on the frequency types available see the add a schedule topic, this topic covers the sub-parameters required when updating frequency type.
Required no sub-parameters.
Requires the following sub-parameters:
executionTime
timezone
Requires the following sub-parameters:
executionTime
timezone
Requires the following sub-parameters:
executionTime
timezone
daysOfWeek
Requires the following sub-parameters:
executionTime
timezone
dayOfMonth
ORscheduledByOccurance
(scheduledByOccurance
includes the sub-parametersnth_occurence
andnth_occurance_day
).
Required the following sub-paramters:
executionTime
timezone
month
dayOfMonth
ORscheduledByOccurance
(scheduledByOccurance
includes the sub-parametersnth_occurence
andnth_occurance_day
).
Response and Error Code
Response Code | Condition | Description |
---|---|---|
202 | Accepted | The update has been completed, use the get a schedule request to view the updated Schedule. |
400 | Bad Request | The update has not been completed, the response body will indicate why the request has failed, as mentioned above the type parameter requires all of its sub-paramters to be listed in the request even if only one of the sub-paramters is to be updated. |
The above 202 Accepted response i
Response Parameter
Parameter Name | Data Type | Description |
---|---|---|
| Number | The ID of the Schedule that has been updated. |
For an example response, see Sample Response.
Sample Request
The sample request below would update the Schedule name
, description
, and the sub-parameters for the weekly
type. As mentioned above for the type sub-parameters all sub-parameters must be listed for a valid request, even if only one of the sub-parameters is to be updated.
{ "schedule":{ "name": "Updated Weekly", "description": "Updated Mon Tue Wed weekly schedule 15-09-24", "weekly": { "daysOfWeek": [ "MON", "TUE", "WED" ], "executionTime": "00:00", "timezone": "UTC" } }}
Sample Response
{ "scheduleId": "412" }
Delete Schedules
Use the delete schedules request to remove schedules from your U-Capture system, Schedules that are used by policies can not be deleted.
Caution
Deleting a Schedule can not be undone, a new schedule would need to be created in the event that a Schedule was mistakenly deleted.
Endpoint
Method: DELETE
URL: /policy/schedule
Request Parameter
Parameter Name | Data Type | Description |
---|---|---|
| Array | A comma separated list of schedule IDs to remove from the U-Capture system. |
For an example Request, see Sample Request.
Response and Error Code
Response Code | Condition | Description |
---|---|---|
204 | No Content | The Schedule/s specified in the request body have been deleted from the system, the get all schedules request cna be used to double check that they are removed if needed. |
404 | Not Found | One or more of the specified Schedules does not exist in the system. |
412 | Precondition Failed | One or more of the specified Schedules is used by a policy, and can therefore not be deleted. |
Sample Request
{ "schedule_ids": [ 412, 425 ] }