Managing Alarms and Events
- Overview
- Historian includes Alarms and Events (A&E) archiving to provide the ability to retrieve and store Alarms and Events Data from any OPC-compliant A&E server through the OPC Classic Alarms and Events collector.
- Add Alarm or Event
- Add alarm API allows you to create alarm in Historian Server.
- Query Alarm or Event
- The following table contains the query parameters for alarms and events data.
- Delete Alarms or Events
- This REST API allows to purge the alarms between time frame.
METHOD POST URI https://<historianservername>:443/historian-rest-api/v1/alarms/delete
SAMPLE URI
Payloadhttps://<historianservername>:443/historian-rest-api/v1/alarms/delete
https://<historianservername>:443/historian-rest-api/v1/alarms/delete Payload: { "StartTime":"2022-09-21T5:58:00.000Z", "EndTime":"2022-09-21T6:58:00.000Z" }
SAMPLE CURL COMMAND curl -i -H "Accept: application/json" -i -H "Con tent-Type: application/json" -H "Authorization: Bearer ” -d “{ \"StartTime\":\"2022-09-21T5:58:00.000Z\", \"EndTime\":\"2022-09-21T6:58:00.000Z\" }” -X PUT https://:443/historian-rest-api/v1/ alarms/delete
Table 5. Query Parameters Parameter Description Required? Values StartTime
The start time or time stamp of the alarm or event. Yes EndTime
The end time of the alarm or event. Yes Table 6. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, -26 A&E Server not connected ErrorMessage
String Yes For example, NULL. - Backup Alarms or Events
-
This REST API allows to create a copy of the alarm data in an offline file that can be restored later. The alarms are not removed from the online system.
METHOD POST URI https://<historianservername>:443/historian-rest-api/v1/alarms/backup
SAMPLE URI
Payloadhttps://<historianservername>:443/historian-rest-api/v1/alarms/backup
{ "BackupFileName":"C:\\Proficy Historian Data\\Archives\\abc.zip, "StartTime":"2022-09-21T5:58:00.000Z", "EndTime":"2022-09-21T6:58:00.000Z" }
SAMPLE CURL COMMAND curl -i -H "Accept: application/json" -i -H "Con tent-Type: application/json" -H "Authorization: Bearer ” -d “{ \"BackupFileName\":\"C:\\Proficy Historian Data\\Archives\\abc.zip\", \"StartTime\":\"2022-09-21T5:58:00.000Z\", \"EndTime\":\"2022-09-21T6:58:00.000Z\" }” -X PUT https://:443/historian-rest-api/v1/ alarms/ backup
Table 7. Query Parameters Parameter Description Required? Values BackupFileName
Path of the backup file. Yes C:\\Proficy Historian Data\\Archives\\abc.zip StartTime
The start time or time stamp of the alarm or event. Yes EndTime
The end time of the alarm or event. Yes Table 8. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, -26 A&E Server not connected. ErrorMessage
String Yes For example, NULL. - Restoring Alarms or Events
-
Restoring alarms to a running system makes them available for query and analysis. You can restore alarms that have been backed up previously..
METHOD POST URI https://<historianservername>:443/historian-rest-api/v1/alarms/restore
SAMPLE URI
Payload:https://<historianservername>:443/historian-rest-api/v1/alarms/restore
C:\\Proficy Historian Data\\Archives\\abc.zip
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -i -H "Con tent-Type: application/json" -H "Authorization: Bearer ” -d “C:\\Proficy Historian Data\\Archives\\abc.zip” -X PUT https://:443/historian-rest-api/v1/ alarms/ restore
Table 9. Query Parameters Parameter Description Required? Values C:\\Proficy Historian Data\\Archives\\abc.zip
Path of the restore file. Yes C:\\Proficy Historian Data\\Archives\\abc.zip Table 10. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, 10 invalid parameter. ErrorMessage
String Yes For example, NULL.