Retrieving connections between devices

You can use the Topology API to retrieve connections between devices, optionally filtered by layer.

Syntax

Specify the following parameters within a REST client.

Table 1. Parameters for retrieving connections between devices

Parameter

Value
Method POST
URL root
https://HOST:PORT/ROOT-CONTEXT/nm_rest/topology/connections/entityIds
Where:
  • HOST is the hostname or IP address of the Dashboard Application Services Hub server.
  • PORT is the secure port number of the Dashboard Application Services Hub server. By default, this is 16311.
  • ROOT-CONTEXT is the path from the root of your file system to the Topology API. This path is usually ibm/console.
  • nm_rest/topology completes the path to the Topology API.
  • locations is the name of the function that retrieves data related to geographic views.
Mandatory parameters
entityIds
The entity IDs of the required devices must be passed as a comma-separated list in the request body.
Optional parameters

The following parameters can be included in any order.

layer
A comma-separated list of the IDs of the topology layers to exclude from the results. If this parameter is included, connections on the local VLAN topology layer (ID 82) are always excluded regardless of whether that layer is in the list.
Example URL
https://myHost:16311/ibm/console/nm_rest/topology//connections/connections/entityIds?layer=72,73

The entity IDs, for example, 1,2, must be included in the request body.

Content Type application/json

Example output

The example output is for this query:

https://myHost:16311/ibm/console/nm_rest/topology//connections/

The output is formatted for readability and has comments added.

{
  "interfaceIdsList": "168051933,168051934,168051272", // Entity IDs of interfaces that are a source or target in the connections array.
  "connections": [ // Array of connections between the given devices.
    {
      "sourcedeviceid": 7, // Entity ID of the source device
      "layertype": 72, // Numeric ID of the layer that this connection exists on
      "sourceinterfaceid": 168051272, // Entity ID of source interface
      "sourceinterfacename": "172.20.3.21[ IP1 ]",
      "sourcedevicename": "172.20.3.21",
      "layername": "Layer 2 Topology", // Name of the layer that this connection exists on
      "targetinterfacename": "172.20.5.1[ me0 ]",
      "targetdeviceid": 10262 // Entity ID of target device
    },
    {
      "sourcedeviceid": 7,
      "layertype": 73,
      "sourceinterfaceid": 168051272,
      "sourceinterfacename": "172.20.3.21[ IP1 ]",
      "sourcedevicename": "172.20.3.21",
      "layername": "Layer 3 Meshed Topology",
      "targetinterfacename": "172.20.5.1[ me0.0 ]",
      "targetdeviceid": 10262
    }
  ],
    "instrumentation": { // Metadata
    "countByLayer": [ // For each layer that has connections between the given devices, how many connections exist on each layer?
      {
        "count": 1, // Number of connections on this layer.
        "label": "Layer 2 Topology", // Name of layer.
        "value": 72 // Numeric ID of layer.
      },
      {
        "count": 1,
        "label": "Layer 3 Meshed Topology",
        "value": 73
      }
    ],
    "count": 2, // Total number of connections in the output.
    "queryTime": 9, // Time in milliseconds to run the SQL query
    "processTime": 2, // Time in milliseconds to convert the SQL results to JSON
    "totalExecTime": 11 // queryTime + processTime
  }
}