cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2494
Views
3
Helpful
5
Replies

Performance of GET Devices API

smp
Level 4
Level 4

I am developing automation to compare a list of devices in a SQL database against the current list of devices in PI 3.1. My goal is to dynamically add/remove devices in PI based on what exists in this SQL database. In order to do the comparison, I need a full export of device IPs from PI and I am using the GET Devices API for this purpose. But it takes about 5 minutes to get the first 1000 results - does this this seem a bit long? I also seem to be getting 500 errors intermittently too. Here's the URI I'm using:

"/webacs/api/v2/data/Devices.json?.full=true&.nocount=true&.maxResults=1000"

Is there any recommendation on the most efficient way to export IP address of every device in the PI inventory?

5 Replies 5

Spencer Zier
Cisco Employee
Cisco Employee

Yeah, that would be the way I would recommend.  5 minutes is definitely too long a time.  How many devices do you have on that appliance?

Whoa, sorry. I modified my post a few times before I pulled the trigger, and I unintentionally left this out. I have 5438 devices in PI today. Based on the doc, I don't believe this is too many, is it? I don't find much documentation that can help me debug what is going on, so I'm not sure what to do about it other than maybe use the default .maxevents of 100 to try and keep the connection alive?

Something happened in our environment because when I ran a query for 1000 devices today, it returned in 20 seconds.

OK, yeah, that sounds a lot more reasonable.  If this happens again, you can check to see if you have any scheduled reports running, or if any of the background jobs in the system look like they're stuck or taking too long.  Sometimes database contention can cause the API response times to spike, but in normal circumstances it shouldn't last for a long time.

Depending on the configuration you're using, you could be above the safe scaling limits for PI 3.1.  But if you're running Standard, Professional, or Gen2 hardware then you should be safe.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: