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>:8443/historian-rest-api/v1/alarms/deleteSAMPLE URI
Payloadhttps://<historianservername>:8443/historian-rest-api/v1/alarms/deletehttps://<historianservername>:8443/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://:8443/historian-rest-api/v1/ alarms/deleteTable 5. Query Parameters Parameter Description Required? Values StartTimeThe start time or time stamp of the alarm or event. Yes EndTimeThe end time of the alarm or event. Yes Table 6. Response Parameters Parameter Data Type Required? Description ErrorCodeInteger Yes For example, -26 A&E Server not connected ErrorMessageString 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>:8443/historian-rest-api/v1/alarms/backupSAMPLE URI
Payloadhttps://<historianservername>:8443/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://:8443/historian-rest-api/v1/ alarms/ backupTable 7. Query Parameters Parameter Description Required? Values BackupFileNamePath of the backup file. Yes C:\\Proficy Historian Data\\Archives\\abc.zip StartTimeThe start time or time stamp of the alarm or event. Yes EndTimeThe end time of the alarm or event. Yes Table 8. Response Parameters Parameter Data Type Required? Description ErrorCodeInteger Yes For example, -26 A&E Server not connected. ErrorMessageString 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>:8443/historian-rest-api/v1/alarms/restoreSAMPLE URI
Payload:https://<historianservername>:8443/historian-rest-api/v1/alarms/restoreC:\\Proficy Historian Data\\Archives\\abc.zipSAMPLE 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://:8443/historian-rest-api/v1/ alarms/ restoreTable 9. Query Parameters Parameter Description Required? Values C:\\Proficy Historian Data\\Archives\\abc.zipPath of the restore file. Yes C:\\Proficy Historian Data\\Archives\\abc.zip Table 10. Response Parameters Parameter Data Type Required? Description ErrorCodeInteger Yes For example, 10 invalid parameter. ErrorMessageString Yes For example, NULL.
