V0 Uplink API

diablo24
Building a reputation

V0 Uplink API

Hi,

 

I have an App that uses the following API in V0:

api/v0/networks/{networkId}/devices/{serial}/uplink

Can someone tell me the equivalent of this API in V1? Its no longer there under Devices.

 

Thanks,

-Jerome

11 Replies 11
diablo24
Building a reputation

Thanks @PhilipDAth 

 

Yeah I checked both of those already. The loss and latency doesn't give any IP information. And the Org Uplink status gives the the correct info, but for every MX devices in the Org! Which completely breaks my code and would require iteration thru the list of MX device (which could be 1000s) just to get the IP address of a single device. I'm still unable to find anything for other devices (MR, MS, etc).

I don't understand why this would be removed when this is the only API that gives you one of the most important IPs on the device.

PhilipDAth
Kind of a big deal
Kind of a big deal

If you just want the IP address how about:

https://developer.cisco.com/meraki/api-v1/#!get-device 

diablo24
Building a reputation

@PhilipDAthYeah I seen this as well. But its missing the public IP that we use to identify site location.

FYI @diablo24 you can now use a query param with this endpoint to specify one or more networkIds and your result will only contain those.

Here's an example format for the URI:

{{baseUrl}}/organizations/:organizationId/appliance/uplink/statuses?networkIds[]={{networkId1}}&networkIds[]={{networkId2}}

Hi @John-K , great for the query param, very useful!

Unfortunately it looks like there's no replacement of https://developer.cisco.com/meraki/api/#!get-network-device-uplink for MR's and MS's. Will this be added in the future ?

Thanks for your reply, unfortunately this doesn't give the status (Active/Failed/Ready/...) of the uplinks (WAN interfaces), which is what I'm looking for.

Right, but MS/MR don’t have ‘wan’ interfaces.

JGill
Building a reputation

I'm using this v1 call that I think will give you what you are looking for "IF" you are using VPN Hubs and "IF" all you need is network Name with Public IP for each WAN link.

 

vpnstatuses = dashboard.appliance.getOrganizationApplianceVpnStatuses(organization_id, total_pages='all')

 

It pulls my whole org in a few seconds, and has the Network Name and Uplink IP addresses. A lot faster than iterating through with a call for each network. 

 

You still need to do a loop for the elements but Network Name, and Public IP are part of the base data set. Example data of one item (IP info at bottom under uplinks:

 

{'deviceSerial': 'Q2PN-XXX-XXXX',
'deviceStatus': 'online',
'exportedSubnets': [{'name': 'Office', 'subnet': '10.23.0.0/24'},
{'name': 'DMZ', 'subnet': '10.23.1.0/24'},
{'name': 'Wireless', 'subnet': '10.23.2.0/24'}],
'merakiVpnPeers': [{'networkId': 'N_***************',
'networkName': 'Hub Network Name 1*****',
'reachability': 'reachable'},
{'networkId': 'N_****************',
'networkName': 'Hub Network Name 2',
'reachability': 'reachable'},
{'networkId': 'N_***************',
'networkName': 'Hub Network Name 3',
'reachability': 'reachable'}],
'networkId': 'N_********************',
'networkName': 'This Network Name ***',
'thirdPartyVpnPeers': [],
'uplinks': [{'interface': 'wan1', 'publicIp': '198.167.###.###'},
{'interface': 'wan2', 'publicIp': '67.###.###.###'}],
'vpnMode': 'spoke'}

 

 

Sounds like a similar v0 report I run that includes IP's for each WAN link and Cell connections.  Its slow, but works, just haven't gotten around to updating it.  I'll look to see if I can convert it to v1 today and I'll post an update if it works faster than the v0 report.  That report has the following data elements: 

 

Network,Device,Serial,MAC,Model,WAN1 Status,WAN1 IP,WAN1 Gateway,WAN1 Public IP,WAN1 DNS,WAN1 Static,WAN2 Status,WAN2 IP,WAN2 Gateway,WAN2 Public IP,WAN2 DNS,WAN2 Static,Cellular Status,Cellular IP,Cellular Provider,Cellular Public IP,Cellular Model,Cellular Connection,Performance

 

 

JGill
Building a reputation

Yep,  I see what you mean, seems to be missing.   As noted above this one looks like the best option. 

 

response = dashboard.appliance.getOrganizationApplianceUplinkStatuses( organization_id, total_pages='all' )

 

or 

 

url = "https://api.meraki.com/api/v1/organizations/{organizationId}/appliance/uplink/statuses"

 

Looks like a 99% hit.   All the relevant data is included in this one "very fast call" call including WAN and cell information with the notable exception of the Network Name!   

 

#****** Rant*****

Meraki anywhere you return networkID please return networkName!  I've not seen any business report that wants to see N_83732618e91 vs a name "Anywhere".  You will cut our API calls in half if we don't need to first lookup all the networks by ID / Name, and build a lookup table.  

#****End Rant*****

 

So other than needing to lookup the network name, I think this is going to be the upgrade path. Uplinks blows out into all the relevant fields your looking for.

 

dict_keys(['networkId', 'serial', 'model', 'lastReportedAt', 'uplinks'])

 

{'networkId': 'L_**************', 'serial': 'Q2PN-****-****', 'model': 'MX84', 'lastReportedAt': '2021-01-03T19:43:44Z', 'uplinks': [{'interface': 'wan1', 'status': 'active', 'ip': '10.251.###.###', 'gateway': '10.251.###.###', 'publicIp': '198.###.###.###', 'primaryDns': '10.###.###.###', 'secondaryDns': '10.###.###.###', 'ipAssignedBy': 'static'}, {'interface': 'wan2', 'status': 'active', 'ip': '192.168.###.###', 'gateway': '192.168.###.###', 'publicIp': '216.###.###.###', 'primaryDns': '192.168.###.###', 'secondaryDns': '0.0.0.0', 'ipAssignedBy': 'dhcp'}]}

 

Guess it's time to build a lookup routine as this is a lot faster than the v0 method... 

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.