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.
|
Parameter |
Value |
|---|---|
| Method | POST |
| URL root |
Where:
|
| Mandatory parameters |
|
| Optional parameters |
The following parameters can be included in any order.
|
| Example URL |
The entity IDs, for example,
|
| 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
}
}