Schedule Service
The Schedule Service allows you to retrieve schedules, create new schedules, delete schedules, retrieve the number of current schedules. Only a single event can be created or modified for each REST request.
URI Definition
Method | URI and Fields | |||||||
GET | /iap/sev/{schedule} | |||||||
Retrieves all schedules that the current user can read. Parameter
Query ParametersThe following optional parameters can be used in addition to those listed in Query Parameters.
Success ResponseCollection of Schedules. Example | ||||||||
/iap/sev/{schedule}/count | ||||||||
Returns the number of schedules that the current user can read. Parameter
Query ParametersThe following optional parameters can be used in addition to those listed in Query Parameters.
Success ResponseCount of schedule that current user is permitted to read. ExampleGET Example /iap/sev/{schedule}/count https://localhost/iap/sev/*/count https://localhost/iap/sev/*+name=+^lamp/count RESPONSE { "value": 12 } | ||||||||
POST | /iap/sev | |||||||
Creates a new schedule with the specified properties. Only a single event can be created at a time. Typically you will create events for the entire day for a datapoint. You can create an all day event at one priority (say priority 16) and add one or more other events at a higher priority (say priority 15). In this way you know what value a datapoint is supposed to be unless someone or another process relinquishes the priority or issues a request with the same or higher priority. Query ParametersThe following optional parameter can be used in addition to those listed in Query Parameters.
Request PayloadThe request payload must contain the ID of the customer owning the schedules to be created and the properties of the schedule to be created. Success ResponseSuccessfully created Schedule. Example | ||||||||
PUT | /iap/sev/{id} | |||||||
Updates an existing schedule with the specified properties. Parameters
Request PayloadThe request payload must contain the properties to be used to update the schedule. Success ResponseSuccessfully updated schedule. Exampleid https://localhost/iap/sev/1 REQUEST PAYLOAD { "customerId": 31, "tags": [ ], "stagger": 0, "presetName": "High", "priority": 17, "color": "#EEEEEE", "name": "event2", "datapoints": [ "1/lon/1/LightSensor/2/nciLowLightAlarm", "1/lon/1/LightSensor/2/nvoLuxLevel" ], "startingTime": "20:30", "endingTime": "22:30", "start": "2020-03-12", "end": "2020-03-12", "startingDate": "2020-03-12", "endingDate": "2020-03-12" } RESPONSE { "id": 360, "name": "event2", "customerId": 32, "priority": 17, "start": "2020-03-12", "end": "2020-03-12", "repeat": null, "weekly": null, "datapoints": [ "1/lon/1/LightSensor/2/nciLowLightAlarm", "1/lon/1/LightSensor/2/nvoLuxLevel" ], "tags": [ ], "stagger": 0, "color": "#EEEEEE", "metadata": { "repeatOption": "NO_REPEAT", "datapoints": [ { "deviceName": "device", "blockName": "LightSensor", "blockIndex": "2", "dpQualifier": "1/lon/1/LightSensor/2/nciLowLightAlarm", "datapointName": "nciLowLightAlarm" }, { "deviceName": "device", "blockName": "LightSensor", "blockIndex": "2", "dpQualifier": "1/lon/1/LightSensor/2/nvoLuxLevel", "datapointName": "nvoLuxLevel" } ], "targetType": "datapoints", "startingOffset": { "isNegative": false }, "startingOffsetType": "LOCAL_TIME", "endingOffset": { "isNegative": false }, "endingOffsetType": "LOCAL_TIME", "endDateType": "DATE" }, "startingDate": "2020-03-12", "startingTime": "20:30", "endingDate": "2020-03-12", "endingTime": "22:30", "exceptions": [ { "date": { "ot": "date:single", "year": 2020, "month": 3, "day": 12 }, "events": { "20:30": "High", "22:30": null }, "prio": 17 } ], "presetName": "High" } | ||||||||
/iap/sev/delete | ||||||||
Deletes the schedules with the specified IDs. If no Ids are specified, deletes all schedules. Request PayloadThe request payload must contain the IDs of the schedules to be deleted. Success ResponseResponse code 200 in case of success or an error code otherwise. ExamplePUT Example /iap/sev/delete https://localhost/iap/sev/delete RESPONSE Response 200 |
Query and Path Parameters
Optional query parameters can be used with your REST request. Specifying queries is described under Queries and Parameters.
{schedule} Path Parameters
The following list describes the optional path parameters for the Schedule Service endpoints.
Path Parameter | Description |
---|---|
device | Filters for schedules created for a device with the specified name |
geozone | Filters for schedules created for devices located in geozone with the specified name |
group | Filters for schedules created for devices that belong to group with the specified name |
id | Filters for schedules with the specified schedule ID |
name | Filters for schedules with the specified name |
priority | Filters for schedules with the specified priority |
scId | Filters for schedules created for devices connected to Edge Server with the specified ID |
scName | Filters for schedules created for devices connected to Edge Server with the specified name |
tag | Filters for schedules with the specified tag |
zone | Filters for schedules created for devices located in zone with the specified name |