How to determin if TOPOLOGY is valid for a network

Gini_Dev_Team
Here to help

How to determin if TOPOLOGY is valid for a network

Hello,

 

I am using the end-point : GET /networks/{networkId}/topology/linkLayer

 

The doc describing it is there : https://developer.cisco.com/meraki/api-v1/#!get-network-topology-link-layer

 

It responds correctly in some cases.

But in some cases I have the following response :

      "errors": [
        "Invalid network for topology"
      ]

 

Because I would like to not request anymore on these networks

I would like to have an attribute bringing the information that it is not a valid network for topology.

 

Do you know if there is any end-point API which could give me such info (Network valid for topology or not) ?

 

Many thanks in advance

Chris

6 Replies 6
sungod
Head in the Cloud

There are other calls that have similar behaviour, it'd have been better to return a 'None' than an error.

 

I'd guess the network needs to have at least one switch to have a topology, so using the call on a system manager network, or an appliance-only network would cause the error.

 

There are two basic approaches...

i) figure out the rule and do API calls and code to determine which networks you can make the topology call on, i.e. look for networks that include at least one switch.

ii) just make the call on every network and ignore those that give the error.

 

I'd say ii) is the simplest approach, also more reliable as you can be sure you didn't inadvertently miss any topologies.

 

The second one suits me.

However that's mean that I have to manage by myself and from my perspective it is more a Meraki rule and so on the Meraki side.

GreenMan
Meraki Employee
Meraki Employee

As @sungod has suggested - a switch is definitely a requirement for the Topology feature, so maybe iterate through your discovered Networks to remove any that have no MS

That's a good idea but from my perspective it is a rule that should be implemented into Meraki and the result be exposed to the client (thanks to an attribute such as "elligibleToTopologyRequest")

GreenMan
Meraki Employee
Meraki Employee

I'm not sure there's too much advantage is there, in creating another endpoint that effectively says the same thing as "Invalid network for topology" ?

John-K
Meraki Employee
Meraki Employee

Hi @Gini_Dev_Team do you only see this issue on networks without switches?

 

https://developer.cisco.com/meraki/api-v1/#!get-network-topology-link-layer

Get notified when there are additional replies to this discussion.