Managing Systems

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://<NLB DNS:9090>/historian-rest-api/v1/serverproperties
SAMPLE QUERY PARAM GET URL
https://<NLB DNS:9090>/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://<NLB DNS:9090>/historian-rest-api/v1/serverproperties
Table 1. 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://<NLB DNS:9090>/historian-rest-api/v1/systemstats
SAMPLE QUERY PARAM GET URL
https://<NLB DNS:9090>/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://<NLB DNS:9090>/historian-rest-api/systemstats
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 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 Rate
https://<NLB DNS:9090>/historian-rest-api/v1/performancecounter/perftagdata/
PerfTag_AverageEventRate/-/-/starttime/endtime/interval
Receive Rate
https://<NLB DNS:9090>/historian-rest-api/v1/performancecounter/perftagdata/
PerfTag_AverageReadRawRate/-/-/starttime/endtime/interval
SAMPLE GET URI
https://<NLB DNS:9090>/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://<NLB DNS:9090>/historian-rest-api/v1/performancecounter/perftagdata/
PerfTag_AverageEventRate/-/-/2020-12-15T11:19:01.719Z/2020-12-15T12:19:01.719Z/360000
Table 3. 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://<NLB DNS:9090>/v1/localopcservers/<machine name>
SAMPLE QUERY PARAM GET URL
http://<NLB DNS:9090>/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://<NLB DNS:9090>/historian-rest-api/v1/localopcservers/xyz
Table 4. Query Parameters
Parameter Description Required? Values
machine name The machine name of the OPC server. Yes String
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 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://<NLB DNS:9090>/v1/localopcaeservers/<machine name>
SAMPLE QUERY PARAM GET URL
http://<NLB DNS:9090>/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://<NLB DNS:9090>/historian-rest-api/v1/localopcaeservers/abc
Table 6. Query Parameters
Parameter Description Required? Values
machine name The machine name of the OPC Alarms and Events server. Yes String
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 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://<NLB DNS:9090>/v1/localopchdaservers/<machine name>
SAMPLE QUERY PARAM GET URL
http://<NLB DNS:9090>/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://<NLB DNS:9090>/historian-rest-api/v1/localopchdaservers/xyz
Table 8. Query Parameters
Parameter Description Required? Values
machine name The machine name of the OPC HDA server. Yes 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.