06-24-2014 09:41 AM
It appears that the End Hosts Present query (/api/2.9/spm_end_hosts_default_grids/index) is the only way to retrieve connected end host information, such as MAC address and dotted IP, yet there is no way to limit the size of the result set for this query (ours returns at 10000+ hosts), which is very expensive (30+ seconds on average) over the wire, aside from paging logic, etc. I feel that I must be doing something wrong. I should at least be able to filter it down to a particular switch, yes? Also, a hierarchical diagram of the various objects in use by NA would be helpful too, if this exists.
Looking for any guidance...
06-24-2014 09:53 AM
Have your tried adding "?limit=" to your query?
Or for a specific device add "&InfraDeviceID=" then add a valid id to the end.
The API Index page should have a listing of all the available attributes.
06-24-2014 09:55 AM
Take a look at the "End Host Mac Addresses" API, that may server your purposes better. They only issue would be that you need to lookup the switch DeviceID before using that API.
06-24-2014 10:02 AM
Good call, but the particular call doesn't support adding InfraDeviceID or anything like it. As I read it, I can only pass the following params:
- starttime Optional DateTime, Default: today
endtime Optional DateTime, Default: tomorrow
start Optional Integer, Default: 0
limit Optional Integer, Default: 1000
sort Optional String, Default: id
- Which doesn't limit anything really. I'm familiar with the limit param, but this just increases the result set size...
06-24-2014 10:08 AM
Yeah, I tried that as well, but unfortunately, no matter which device ID I query I get this:
Which looks like an empty response to me...thoughts?
06-24-2014 10:23 AM
Sorry, I should have been more clear. The query:
I've substituted in several DeviceIDs for this and all are empty results...here's a sample query result for device 3:
Like I said, I feel like I'm doing something wrong...
06-24-2014 11:53 AM
Sadly no, but I'm now looking at the switch_port_fwds/index/ call, which seems to pull the data I need and can be limited to a particular device. Thanks!
06-24-2014 11:57 AM
That will include all downstream MACs from a given port. So, for switch-switch interconnects (whether trunks or not), there will be all the downstream MACs in there. I think instead you should use Switch Forward Neighbors, which prunes out that data by looking at the entire spanning tree (this is the source of the data in several of these different tables).
06-24-2014 11:59 AM
From that API you'll need to use the NeighborID to get the Neighbor object which will contain the DeviceID and InterfaceID. In this neighbor relationship, the source device is the switch (DeviceID/InterfaceID), the neighbor device is the host (if it is in the discovery ranges).