Generate OPC-UA Discovery Reports

See the Reports section of the API documentation.

There are two types of reports that can be generated by the OPC-UA discovery:
  • opcua-servers
  • opcua-nodes

The "opcua-servers" type finds servers known to a Local Discovery Server (LDS) for which the endpoint is defined in the input parameters of the report request.

The "opcua-nodes" type discovers nodes available at an OPC-UA endpoint defined in the input parameters of the report request.

Discovery Type: OPC-UA Servers Known to Local Discovery Server

The following API request is used to request the "opcua-servers" report generation:

POST /reports/discovery/opcua-servers

with request body (fill in the correct values)

{
    "opcua-servers": {
        "input": {
            "endpoint": "opc.tcp://localhost:4840",
            "format": "json",
            "authConfig":{
                "auth": "username",
                "username": "my-user",
                "password": "my-password"
            }
        }
    }
}

The endpoint is required and needs to be reachable from the OPC-UA driver.

The format defaults to JSON if omitted. Available options are json and csv.

The authConfig section is optional; it can be used to specify authentication parameters required by the OPC-UA server. The parameters are the same as the ones described in the Advanced Options section of the "Construct the @type" part of Create OPC-UA Thing Description.

The API response will include an href parameter that can be used to retrieve report details. It is structured as follows:

/reports/discovery/{discovery_type}/{report_id}

The report details returned include the status of the report.

Once the report has been completed details of the uploaded reports (by the OPC-UA driver to the core driver service) can be retrieved using the following API call:

GET /reports/discovery/{discovery_type}/{report_id}/uploads

The returned uploadId values can be used to retrieve the reports bu using the following API call:

GET /reports/discovery/{discovery_type}/{report_id}/uploads/{upload_id}

An example response (truncated) is as follows:

{
    {
        "ApplicationURI": "urn:localhost:Node-OPCUA-Server",
        "ProductURI": "Node-OPCUA-Server",
        "ApplicationName": "NodeOPCUA",
        "ApplicationType": "ApplicationTypeServer",
        "GatewayServerURI": "",
        "DiscoveryProfileURI": "",
        "DiscoveryURLs": [
            "opc.tcp://localhost:26543"
        ]
    },

Discovery Type: OPC-UA Nodes at Endpoint

The following API request is used to request the "opcua-nodes" report generation:

POST /reports/discovery/opcua-nodes

with request body (fill in the correct values)

{
    "opcua-nodes": {
        "input": {
            "endpoint": "opc.tcp://localhost:26543",
            "startNodeID": "objects",
            "browseDepth": 10,
            "retrieveValue": false,
            "ignoreErrors": true,
            "format": "json",
            "authConfig":{
                "auth": "username",
                "username": "my-user",
                "password": "my-password"
            }
        }
    }
}

The endpoint is required and needs to be reachable from the OPC-UA driver.

The startNodeID can be any valid NodeID on the OPC-UA endpoint and will default to the objects keyword if omitted.

The browseDepth defaults to 10 if omitted.

The retrieveValue defaults to true if omitted. For larger browseDepth values it is recommended to set this to false.

The ignoreErrors defaults to true if omitted. If set to false the report generation will fail if the OPC-UA node browsing runs into any error. The error itself will be uploaded as an error report.

The format defaults to json if omitted. Available options are json and csv.

The authConfig section is optional; it can be used to specify authentication parameters required by the OPC-UA server. (See explanation at the "opcua-servers" report section.)

The API response will include an href parameter that can be used to retrieve report details. It is structured as follows:

/reports/discovery/{discovery_type}/{report_id}

The report details returned include the status of the report.

Once the report has been completed details of the uploaded reports (by the OPC-UA driver to the core driver service) can be retrieved using the following API call:

GET /reports/discovery/{discovery_type}/{report_id}/uploads

The returned uploadId values can be used to retrieve the reports bu using the following API call:

GET /reports/discovery/{discovery_type}/{report_id}/uploads/{upload_id}

An example response (truncated) is as follows:

{
    "Objects": {
        "MyDevices": {
            "Incrementor0": {
                "BrowseName": "Incrementor0",
                "DataType": "float64",
                "Description": "",
                "DisplayName": "Incrementor0",
                "NodeID": "ns=1;s=Incrementor0",
                "Value": 154412.20000450008,
                "Writable": false
            },
            "Temperature": {
                "BrowseName": "Temperature",
                "DataType": "float64",
                "Description": "",
                "DisplayName": "Temperature",
                "NodeID": "ns=1;s=Temperature",
                "Value": 34.52512524858854,
                "Writable": false
            },