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:
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?
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.