Cisco Prime API Filtering output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2021 07:29 AM
Hello team,
I have to get some information from lots of devices.
In this case, I need information such as ip address, device name and serial number.
When I send the request, it takes so long (we have more than 11k devices) because serial number does not appear in "data/Devices.json"
So, I have to get a "data/InventoryDetails.json" and I am getting so much information that I don't need.
Is there any way to send the request to get only needed fileds?
In this case, should be summary and chassis information.
I attach my request.
ruta_url = "data/InventoryDetails.json"
args = {
"summary.productFamily": ['"Switches and Hubs", "Unsupported Cisco Device", "Wireless Controller"'],
".full": "true",
".maxResults": 1000
}
r = session.get(url_prime + ruta_url, params=args)
Then, I have to parse all that big output to get needed fields.
May I request just for mentioned fields?
- Labels:
-
Prime Infrastructure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2021 09:19 AM
Unfortunately no. We investigated adding support for this, as we called it "user-defined projections". Ultimately, there were too many impacts and issues caused by trying to support this, and only a few cases where there were noticeable improvements in API response time.
Aside from our standard recommendations for improving your API throughput, the only thing I could recommend would be putting serial numbers in a data warehouse after you've fetched them once because they won't change (unlike the configured name and management IP). Then you can rely on GET data/Devices to fetch everything, and only query GET data/InventoryDetails when you need a serial number for a newly managed device.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2021 08:27 AM
Ok Spencer, thanks anyway
