How to obtain connectivity information for Fanout models via REST API in DX NetOps Spectrum
search cancel

How to obtain connectivity information for Fanout models via REST API in DX NetOps Spectrum

book

Article ID: 447102

calendar_today

Updated On:

Products

Network Observability Spectrum

Issue/Introduction

We are using the following reference to query neighbour information from OneClick:

TechDocs : DX NetOps Spectrum 25.4 : GET connectivity

However, when a device model is connected to a Fanout model, it defeats the purpose. Since the reference uses IP addresses, is there any other way to expand Fanout models to the actual neighbor models via REST API queries?

For example:

So as to get the latest data on-demand, querying information via REST API instead of a static file from some command is preferable. This article shows how.

Environment

DX NetOps Spectrum all currently supported releases

Cause

A Fanout has two sides to it - one connected to your device and the other side with somewhat ambiguous connections to other interfaces. So the API requires a two-step approach to "traverse" it. You can achieve this by querying the associations of the Fanout model.

Resolution

To retrieve the neighbour information, do the following:

  1. Identify the Fanout Handle: Run your current connectivity query. Note the Model_Handle of the Fanout model returned in the results.

  2. Query the Fanout's Neighbours: Use the following REST API call to find all models connected to that Fanout. We use the Is_Adjacent_to relation handle (0x10007):

    • GET http://<OneClick_Host>:<Port>/spectrum/restful/associations/relation/0x10007/model/<Fanout_Model_Handle>?side=left

    • You can also use the VNM shell (vnmsh):

      cd $SPECROOT/vnmsh
      ./connect
      ./show associations mh=<Fanout_Model_Handle> rel=0x10007

      This will return a clean table of all the neighbour models sharing that adjacency link.

  3. Get Device Details: The above call will return a list of model handles. You can then query each handle for the attributes you need (e.g., Name 0x1006e or IP 0x12d7f):

    • GET http://<OneClick_Host>:<Port>/spectrum/restful/model/<Model_Handle>?attr=0x1006e&attr=0x12d7f