Get PrimarySerial and SpareSerial through API (devices)

Gini_Dev_Team
Here to help

Get PrimarySerial and SpareSerial through API (devices)

Hello,

 

In order to get the PrimarySerial and SpareSerial 

today I am using the following endpoint : /networks/{networkId}/appliance/warmSpare

 

However, that means that I have to realize a loop on all the networkid of one customer.

 

But, today I also already use the following endpoint :  /organizations/{organizationId}/devices

 

My question is : Could it be possible to add the SpareSerial attribute into the response of the endpoint

/organizations/{organizationId}/devices

 

This will increase my efficiency and decrease your API sollicitation.

 

Many thanks in advance for you response

 

Christian C.

 

4 REPLIES 4
AutomationDude
Building a reputation

Hello @Gini_Dev_Team,

 

I'm afraid the organization level devices will probably never contain a SpareSerial attribute as this mostly wouldn't make sense. The use case you mention is quite specific and wouldn't really apply to the general use of that endpoint. I also wouldn't worry about how much API you're consuming as Meraki has plenty of bandwidth and a limit of 10 calls per org. 

 

Now thankfully the loop you're trying to create is quite easy and would only involve a couple lines of code! You can reuse what I've shown below. I hope this helps.

 

networks = dashboard.organizations.getOrganizationNetworks(org_id)
 
for n in range(len(networks)){
 
    network_id = networks['n']['id']
    print(dashboard.appliance.getNetworkApplianceWarmSpare( network_id ))
 
# You can do whatever you want instead of print with this information
 
}
    
 
    
 
 

Hello,

Thank you for your response.

The difficulty is not managing a loop but rather than already have a end-point with informations on a device.

From my point of view, adding a simple attribute (empry or filled) containing his "partner" device (the spare one) could be an added value.

And in fact, this improvement will avoid to request again on each network_id.

 

In terms of bandwidth ... for sure the threshold is high but it is reachable if we create some monitoring automation.

 

Regards

Chris

Hey Chris,

 

I understand better now. I would still suggest reprogramming what you've already got going on. Meraki isn't going to add an attribute to an endpoint based on one request on the community. I'm guessing there's already a pretty long pipe of API endpoints to be worked on so you're still probably better off doing the work on your end than expecting them to come through on this. 

 

Good luck!

Hello,

For sure, I have to chose between waiting for a Meraki development or implementing a solution.

Whatever the solution will be I would like to thanks for our exchange !

That's a community state of mind that I appreciate

Chris

Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.