Request a Node Discovery Report from an OPC-UA Server

To request any discovery report from the Edge Asset, it is necessary to make API calls directly to the asset. This can be done using the API Client in IoT Studio:

  1. Go to EdgeOps > Fleet Management > Asset Management and click on your Asset (Raspberry Pi 4) to open up the Details pane.
  2. Click on the API Client button in the top right corner.


    Figure 1.

    The API Client is now available to make direct API calls to the Edge Asset.



    Figure 2.

    The API documentation to generate discovery reports can be found at: https://openapi.swx.altairone.com/ecp/reports#/discovery/requestDiscovery

For this tutorial, you will use an OPC-UA demo server from the Eclipse project with the following endpoint: opc.tcp://milo.digitalpetri.com:62541/milo

If you are using your own OPC-UA server make sure you fill in the correct authentication configuration when requesting the discovery report.

  1. Make a POST request to /reports/discovery/opcua-nodes with the following request body:
    { 
      "opcua-nodes": { 
        "input": { 
          "endpoint": "opc.tcp://milo.digitalpetri.com:62541/milo", 
          "startNodeID": "objects", 
          "browseDepth": 4, 
          "retrieveValue": false, 
          "ignoreErrors": true, 
          "format": "json", 
          "authConfig": { 
            "policy": "None", 
            "mode": "None", 
            "auth": "Anonymous" 
          } 
        } 
      } 
    } 

    The response is a JSON object with details on the requested report. Take note of the report href and status (pending).



    Figure 3.
  2. Copy the href and replace the value in the API Client form with it. Change the request method to GET and run the API request.


    Figure 4.
    The status has changed to requested and the discovery is in progress. The complete discovery can take a significant amount of time (anywhere from a few minutes to hours) depending on the connection speed between the edge and the OPC-UA server, the number of nodes defined on the server and the browse depth requested.