Managing Systems
- The Get DHS Machines API
- Using the Get DHS Machines API, you can view the list of DHS machines in a
location.
METHOD GET URI https://<historianservername>/historian-rest-api/v1/dhsmachines?storageName=
SAMPLE QUERY PARAM GET URL https://<historianservername>/historian-rest-api/v1/dhsmachines?storageName=xx
SAMPLE RESPONSE { "ErrorCode": 0, "ErrorMessage": null, "Data": [ { "NodeName": "xyz", "IsAlreadyAdded": true } ] } }
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>” https://<historianservername>/historian-rest-api/v1/dhsmachines?storageName=xxx
Table 1. Query Parameters Parameter Description Required? Values storageName
The value of the location whose DHS machines you want to view. Yes String Table 2. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, ErrorCode = 0 implies the operation was successful. ErrorMessage
String Yes For example, NULL. - The Get DHS Services API
- Using the Get DHS Services API, you can view the list of DHS services in a
data store.
METHOD GET URI https://<historianservername>/historian-rest-api/v1/dhsservices?dHSServiceMask=&withReason=false
SAMPLE QUERY PARAM GET URL https://<historianservername>/historian-rest-api/v1/dhsservices?dHSServiceMask =*&withReason=false
SAMPLE RESPONSE { "ErrorCode": 0, "ErrorMessage": null, "Data": [ { "LogicalName": "ConfigManager_NPI212611749M1", "NodeName": "NPI212611749M1", "ServiceType": 4, "Status": 1, "TCPPort": 14002 }, { "LogicalName": "DataArchiver_NPI212611749M1", "NodeName": "NPI212611749M1", "ServiceType": 2, "Status": 1, "TCPPort": 14001 }, { "LogicalName": "ClientManager_NPI212611749M1", "NodeName": "NPI212611749M1", "ServiceType": 3, "Status": 1, "TCPPort": 14000 }, { "LogicalName": "DiagnosticsManager_NPI212611749M1", "NodeName": "NPI212611749M1", "ServiceType": 5, "Status": 1, "TCPPort": 14003 }, { "LogicalName": "DataArchiver_distmachine2", "NodeName": "distmachine2", "ServiceType": 2, "Status": 0, "TCPPort": 14001 }, { "LogicalName": "DataArchiver_distmachine1", "NodeName": "distmachine1", "ServiceType": 2, "Status": 1, "TCPPort": 14001 }, { "LogicalName": "ClientManager_distmachine1", "NodeName": "distmachine1", "ServiceType": 3, "Status": 1, "TCPPort": 14000 }, { "LogicalName": "DiagnosticsManager_distmachine1", "NodeName": "distmachine1", "ServiceType": 5, "Status": 0, "TCPPort": 14003 } ] } }
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>” https://<historianservername>/historian-rest-api/v1/dhsservices?dHSServiceMask=*&withReason=false
Table 3. Query Parameters Parameter Description Required? Values withReason
Indicates whether the reason must be retrieved in the API response. Yes Boolean dHSServiceMask
The value of the DHS service mask. Yes String Table 4. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, ErrorCode = 0 implies the operation was successful. ErrorMessage
String Yes For example, NULL. - The Get Server Properties API
- Using the Get Server Properties API, you can view the list of properties of
a server.
METHOD GET URI https://<historianservername>/historian-rest-api/v1/serverproperties
SAMPLE QUERY PARAM GET URL https://<historianservername>/historian-rest-api/v1/serverproperties
SAMPLE RESPONSE { "ErrorCode": 0, "ErrorMessage": null, "Data": { "Storages": [ { "StorageName": "System Storage", "StorageType": 2, "NumberOfDataStores": 1, "NumberOfArchivers": 0, "DataStores": [ "System" ], "Id": "861C2743-72E0-46FC-9B31-90E28CC39B8D", "IsDefault": false, "LastModifiedUser": null, "LastModifiedTime": "1970-01-01T00:00:00.000Z", "ArchiverServices": [] }, { "StorageName": "xyz", "StorageType": 0, "NumberOfDataStores": 3, "NumberOfArchivers": 1, "DataStores": [ "ScadaBuffer", "DHSSystem", "User" ], "Id": "5F267DF3-879A-4222-8A0E-D31EDEA83C14", "IsDefault": true, "LastModifiedUser": null, "LastModifiedTime": "1970-01-01T00:00:00.000Z", "ArchiverServices": [ { "LogicalName": "DataArchiver_xyz", "NodeName": "xyz", "ServiceType": 2, "IsAlreadyAdded": true, "TCPPort": 14001 } ] } ], "Servers": [ { "LogicalName": "DataArchiver_xyz0", "NodeName": "xyz", "ServiceType": 2, "Status": 1, "TCPPort": 14001, "MemoryVMSize": "4778", "TotalFailedWrites": "0", "WriteCacheHitRatio": "0.748", "TotalOutOfOrder": "3", "CompressionRatio": "0.321", "ReadQueueSize": "0", "WriteQueueSize": "0", "MsgQueueSize": "0", "ReadQueueProcessingRate": "1", "WriteQueueProcessingRate": "31", "MsgQueueProcessingRate": "0" } ] } }
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>” https://<historianservername>/historian-rest-api/v1/serverproperties
Table 5. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, ErrorCode = 0 implies the operation was successful. ErrorMessage
String Yes For example, NULL. - The Get System Statistics API
- Using the Get System Statistics API, you can view the statistics of a
system.
METHOD GET URI https://<historianservername>/historian-rest-api/v1/systemstats
SAMPLE QUERY PARAM GET URL https://<historianservername>/historian-rest-api/v1/systemstats
SAMPLE RESPONSE { "ErrorCode": 0, "ErrorMessage": null, "Data": { "Utilization": { "WriteCacheHitRatio": "0.499", "SpaceConsumptionRate": "", "CompressionRatio": "0.199", "ReadQueueSize": "0", "WriteQueueSize": "0", "MsgQueueSize": "0", "ReadQueueProcessRate": "3", "WriteQueueProcessRate": "0", "MsgQueueProcessRate": "0", "MemoryVMUsage": "62", "OutOfOrderRate": "0", "ReadThreadUsage": "0", "WriteThreadUsage": "0", "FailedWriteRate": "0", "DiskFreeSpace": "59828" }, "AlarmEvents": { "AverageAlarmRate": "" }, "TotalCollectors": { "TotalCollectors": 1, "RunningCollectors": 1, "StoppedCollectors": 0, "UnknownCollectors": 0 }, "Licence": { "ActualDataStores": 3, "MaxDataStores": 200, "ActualTags": 0, "MaxTags": 2147483647, "ActualUsers": 0, "MaxUsers": 1000 } } }
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>” https://<historianservername>/historian-rest-api/systemstats
Table 6. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, ErrorCode = 0 implies the operation was successful. ErrorMessage
String Yes For example, NULL. - The Get Read Sample and Receive Rate API
- Using the Get Read Sample and Receive Rate API, you can view the read rate
and receive rate of a system.
METHOD GET URI Read Sample Ratehttps://<historianservername>/historian-rest-api/v1/performancecounter/perftagdata/ PerfTag_AverageEventRate/-/-/starttime/endtime/interval
Receive Ratehttps://<historianservername>/historian-rest-api/v1/performancecounter/perftagdata/ PerfTag_AverageReadRawRate/-/-/starttime/endtime/interval
SAMPLE GET URI https://<historianservername>/historian-rest-api/v1/performancecounter/ perftagdata/PerfTag_AverageEventRate/-/-/2020-12-15T11:19:01.719Z/2020-12-15T12:19:01.719Z/360000
SAMPLE RESPONSE { "ErrorCode": 0, "ErrorMessage": null, "Data": [ { "TagName": "PerfTag_AverageEventRate", "ErrorCode": 0, "DataType": "DoubleFloat", "Samples": [ { "TimeStamp": "2020-11-18T05:35:22.612Z", "Value": "0", "Quality": 0 }, { "TimeStamp": "2020-11-18T05:47:22.612Z", "Value": "0", "Quality": 0 }, { "TimeStamp": "2020-11-18T05:53:22.612Z", "Value": "0", "Quality": 0 }, { "TimeStamp": "2020-11-18T06:11:22.612Z", "Value": "0", "Quality": 0 }, { "TimeStamp": "2020-11-18T06:29:22.612Z", "Value": "0", "Quality": 0 } ] } ] }
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>” https://<historianservername>/historian-rest-api/v1/performancecounter/perftagdata/ PerfTag_AverageEventRate/-/-/2020-12-15T11:19:01.719Z/2020-12-15T12:19:01.719Z/360000
Table 7. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, ErrorCode = 0 implies the operation was successful. ErrorMessage
String Yes For example, NULL. - The Get Storages API
- Using the Get Storages API, you can view the list of locations in a
system.
METHOD GET URI https://<historianservername>/historian-rest-api/v1/storages?storageMask=
SAMPLE QUERY PARAM GET URL https://<historianservername>/historian-rest-api/v1/storages?storageMask=*
SAMPLE RESPONSE { "ErrorCode": 0, "ErrorMessage": null, "Data": [ { "StorageName": "System Storage", "StorageType": 2, "NumberOfDataStores": 1, "NumberOfArchivers": 0, "DataStores": [ "System" ], "Id": "861C2743-72E0-46FC-9B31-90E28CC39B8D", "IsDefault": false, "LastModifiedUser": null, "LastModifiedTime": "1970-01-01T00:00:00.000Z", "ArchiverServices": [] }, { "StorageName": "srinivaswin10", "StorageType": 0, "NumberOfDataStores": 3, "NumberOfArchivers": 1, "DataStores": [ "ScadaBuffer", "DHSSystem", "User" ], "Id": "5F267DF3-879A-4222-8A0E-D31EDEA83C14", "IsDefault": true, "LastModifiedUser": null, "LastModifiedTime": "1970-01-01T00:00:00.000Z", "ArchiverServices": [ { "LogicalName": "DataArchiver_xyz", "NodeName": "xyz", "ServiceType": 2, "TCPPort": 14001 } ] } ] }
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>” https://<historianservername>/historian-rest-api/v1/storages?storageMask=*
Table 8. Query Parameters Parameter Description Required? Values storageMask
The value of the location mask. No String Table 9. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, ErrorCode = 0 implies the operation was successful. ErrorMessage
String Yes For example, NULL. - The Add Machine API
- Using the Add Machine API, you can add a server in a Historian system.
METHOD POST URI https://<historianservername>/historian-rest-api/v1/machine
SAMPLE URI https://<historianservername>/historian-rest-api/v1/machine Payload { "nodeName": "node1" }
SAMPLE RESPONSE { "ErrorCode": 0, "ErrorMessage": null }
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" -H "Authorization: Bearer <TOKEN>” -d “{ \”nodeName \”:\”name\”}” -X POST https://<historianservername>/historian-rest-api/v1/machine
Table 10. Query Parameters Parameter Description Required? Values Payload
Contains the machine name of the server that you want to add. Yes Multiple Table 11. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, ErrorCode = 0 implies the operation was successful. ErrorMessage
String Yes For example, NULL. - The Delete Machine API
-
Using the Delete Machine API, you can remove a server from a Historian system.
METHOD DELETE URI https://<historianservername>/historian-rest-api/v1/machine
SAMPLE URI https://<historianservername>/historian-rest-api/v1/machine Payload { "nodeName": "", }
SAMPLE RESPONSE { "ErrorCode": 0, "ErrorMessage": null }
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" -H "Authorization: Bearer <TOKEN>” -d “{ \”nodeName \”:\”name\”}” -X DELETE https://<historianservername>/historian-rest-api/v1/machine
Table 12. Query Parameters Parameter Description Required? Values Payload
Contains the name of the machine that you want to remove. Yes Multiple Table 13. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, ErrorCode = 0 implies the operation was successful. ErrorMessage
String Yes For example, NULL. - The Create Mirror Group API
- Using the Create Mirror Group API, you can create a mirror group.
METHOD POST URI https://<historianservername>/historian-rest-api/v1/mirrorgroup
SAMPLE URI https://<historianservername>/historian-rest-api/v1/mirrorgroup Payload { "mirrorStorageName": "storagename", "nodes": "node1;node2" }
SAMPLE RESPONSE { "ErrorCode": 0, "ErrorMessage": null }
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" -H "Authorization: Bearer <TOKEN>” -d “{ \” mirrorStorageName \”:\”name\”,\" nodes \": \"xx;yy\"}” -X POST https://<historianservername>/historian-rest-api/v1/mirrorgroup
Table 14. Query Parameters Parameter Description Required? Values Payload
Contains the mirror group name and the servers you want to add to the group. Yes Multiple Table 15. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, ErrorCode = 0 implies the operation was successful. ErrorMessage
String Yes For example, NULL. - The Add Mirror Machine API
- Using the Add Mirror Machine API, you can add a server to a mirror
group.
METHOD POST URI https://<historianservername>/historian-rest-api/v1/mirrormachine
SAMPLE URI https://<historianservername>/historian-rest-api/v1/mirrormachine Payload { "mirrorStorageName": "Mirror2", "mirrorMachineName": "distmachine1" }
SAMPLE RESPONSE { "ErrorCode": 0, "ErrorMessage": null }
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" -H "Authorization: Bearer <TOKEN>” -d “{ \” mirrorStorageName \”:\”name\”,\" nodes \": \"xx;yy\"}” -X POST https://<historianservername>/historian-rest-api/v1/mirrormachine
Table 16. Query Parameters Parameter Description Required? Values Payload
Contains the machine name of the server that you want to add. Yes Multiple Table 17. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, ErrorCode = 0 implies the operation was successful. ErrorMessage
String Yes For example, NULL. - The Mirror Group Update API
- Using the Mirror Group Update API, you can update the name of a mirror
group.
METHOD PUT URI https://<historianservername>/historian-rest-api/v1/mirrorgroup
SAMPLE URI https://<historianservername>/historian-rest-api/v1/mirrorgroup Payload { "mirrorStorageName": "Mirror2", "mirrorStorageNewName": "Mirror3" }
SAMPLE RESPONSE { "ErrorCode": 0, "ErrorMessage": null }
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" -H "Authorization: Bearer <TOKEN>” -d “{ \”mirrorStorageName \”:\”name\”,\" mirrorStorageNewName \": \"sname\"}” -X PUT https://<historianservername>/historian-rest-api/v1/mirrorgroup
Table 18. Query Parameters Parameter Description Required? Values Payload
Contains the existing and new names of the mirror group that you want to rename. Yes Multiple Table 19. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, ErrorCode = 0 implies the operation was successful. ErrorMessage
String Yes For example, NULL. - The Delete Mirror Machine API
- Using the Delete Mirror Machine API, you can remove a server from a mirror
group.
METHOD DELETE URI https://<historianservername>/historian-rest-api/v1/mirrormachine
SAMPLE URI https://<historianservername>/historian-rest-api/v1/mirrormachine Payload { "mirrorStorageName": "Mirror 2", "mirrorMachineName": "distmachine1" }
SAMPLE RESPONSE { "ErrorCode": 0, "ErrorMessage": null }
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" -H "Authorization: Bearer <TOKEN>” -d “{ \”mirrorStorageName \”:\”name\”, \” mirrorMachineName\”:\”name\”}” -X DELETE https://<historianservername>/historian-rest-api/v1/mirrormachine
Table 20. Query Parameters Parameter Description Required? Values Payload
Contains the name of the machine that you want to remove and the name of the mirror group. Yes Multiple Table 21. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, ErrorCode = 0 implies the operation was successful. ErrorMessage
String Yes For example, NULL. - The Delete Mirror Group API
- Using the Delete Mirror Group API, you can delete a mirror group.
METHOD DELETE URI https://<historianservername>/historian-rest-api/v1/mirrorgroup
SAMPLE URI https://<historianservername>/historian-rest-api/v1/mirrorgroup Payload { "mirrorStorageName": "Mirror3", }
SAMPLE RESPONSE { "ErrorCode": 0, "ErrorMessage": null }
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" -H "Authorization: Bearer <TOKEN>” -d “{ \”mirrorStorageName \”:\”name\”}” -X DELETE https://<historianservername>/historian-rest-api/v1/mirrorgroup
Table 22. Query Parameters Parameter Description Required? Values Payload
Contains the name of the machine that you want to remove. Yes Multiple Table 23. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, ErrorCode = 0 implies the operation was successful. ErrorMessage
String Yes For example, NULL. - The Local OPC Servers API
- Using the Local OPC Servers API, you can view the list of OPC servers
installed on a specified machine.
METHOD GET URI http://<historianservername>/v1/localopcservers/<machine name>
SAMPLE QUERY PARAM GET URL http://<historianservername>/v1/localopcservers/<machine name>
SAMPLE RESPONSE { "ErrorCode": 0, "ErrorMessage": null, "ServerIDs": [ "ID1", "ID2 " ] }
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>” https://<historianservername>/historian-rest-api/v1/localopcservers/xyz
Table 24. Query Parameters Parameter Description Required? Values machine name
The machine name of the OPC server. Yes String Table 25. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, ErrorCode = 0 implies the operation was successful. ErrorMessage
String Yes For example, NULL. - The Local OPC AE Servers API
- Using the Local OPC AE Servers API, you can view the list of OPC Alarms and
Events servers installed on a specified machine.
METHOD GET URI http://<historianservername>/v1/localopcaeservers/<machine name>
SAMPLE QUERY PARAM GET URL http://<historianservername>/v1/localopcaeservers/<machine name>
SAMPLE RESPONSE { "ErrorCode": 0, "ErrorMessage": null, "ServerIDs": [ "ID1", "ID2 " ] }
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>” https://<historianservername>/historian-rest-api/v1/localopcaeservers/abc
Table 26. Query Parameters Parameter Description Required? Values machine name
The machine name of the OPC Alarms and Events server. Yes String Table 27. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, ErrorCode = 0 implies the operation was successful. ErrorMessage
String Yes For example, NULL. - The Local OPC HDA Servers API
- Using the Local OPC HDA Servers API, you can view the list of OPC HDA
servers installed on a specified machine.
METHOD GET URI http://<historianservername>/v1/localopchdaservers/<machine name>
SAMPLE QUERY PARAM GET URL http://<historianservername>/v1/localopchdaservers/<machine name>
SAMPLE RESPONSE { "ErrorCode": 0, "ErrorMessage": null, "ServerIDs": [ "ID1", "ID2 " ] }
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -H "Authorization: Bearer <TOKEN>” https://<historianservername>/historian-rest-api/v1/localopchdaservers/xyz
Table 28. Query Parameters Parameter Description Required? Values machine name
The machine name of the OPC HDA server. Yes String Table 29. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, ErrorCode = 0 implies the operation was successful. ErrorMessage
String Yes For example, NULL. - The DHS Service Port Update API
- Using the DHS Service Port Update API, you can change the port and other
details of a DHS service.
METHOD PUT URI https://<historianservername>/historian-rest-api/v1/dhsservice/<DHS service name>
SAMPLE URI https://<historianservername>/historian-rest-api/v1/dhsservice/ DataArchiver_xxx { "LogicalName": "DataArchiver_xxx", "NodeName": "xxx", "ServiceType": 2, "Status": 1, "TCPPort": 14005 }
SAMPLE RESPONSE { "ErrorCode": 0, "ErrorMessage": null, "Data": { "LogicalName": "DataArchiver_xxx", "NodeName": "xxx", "ServiceType": 2, "Status": 1, "TCPPort": 14005 } }
SAMPLE cURL COMMAND curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" -H "Authorization: Bearer <TOKEN>” -d “{ \” LogicalName \”:\” DataArchiver_xxx \”, \" NodeName \": \"xxx\"\”,\" ServiceType \": 2,\" Status\": 1, \" TCPPort \": 14005}” -X PUT https://<historianservername>/historian-rest-api/v1/dhsservice/DataArchiver_xxx
Table 30. Query Parameters Parameter Description Required? Values Payload
Contains the values of the attributes of the data store that you want to change. Yes Multiple Table 31. Response Parameters Parameter Data Type Required? Description ErrorCode
Integer Yes For example, ErrorCode = 0 implies the operation was successful. ErrorMessage
String Yes For example, NULL.