11-11-2020 10:55 AM
First let me say thank you, I am a network guy trying to learn Python.
I put together the follow ing code and I am having an issue with the DNA API rate limit. The error and the code is below. What I am trying to do is get a report/CSV that has the AP info and switch port it's connected to. I have a list of 150 IP address to loop over. Once I loop over 5 I get the limit error. Should I be using a different URI to pull the data I need? Am I going about this all wrong?
ERROR Message
{'error': "Rate Limit exceeded; BapiName: Get Device Enrichment Details, RateLimit config details: RateLimitContext{rate=5, windowUnit='minute', windowDuration=1, maxConc=5, windowUnit='minute', windowDuration=1, maxConcurrentExecutionsPermitted=0}", 'bapiExtendedStatusCode': 'REJECTED_ABO': 'For BAPI: Get Device Enrichment Details, maximVE_THROTTLE_LIMIT', 'bapiExtendedStatusDescription': 'For BAPI: Get Device Enrichment Details, maximum allowed BAPI instUTC 2020 and now'}ances per 1 minute is 5. The limit has been reached for the time-window between Wed Nov 11 18:44:46 UTC 2020 and now'}
Code
Solved! Go to Solution.
11-12-2020 03:57 AM
You're using the device enrichment API which is limited to 5 per minute (which is what the BAPI error also tells you). Most of our GET/POST APIs (if not all) should be moving up to 100 per minute (GET) and 50 per minute (POST) with Cyclops (2.1.2.x).
11-11-2020 12:18 PM - edited 11-11-2020 12:20 PM
Not sure what version of DNAC you are running, but certain APIs have rate-limits (throttling). Your issue is identified in your DNAC error:
{'error': "Rate Limit exceeded; BapiName: Get Device Enrichment Details, RateLimit config details: RateLimitContext{rate=5, windowUnit='minute', windowDuration=1, maxConc=5, windowUnit='minute', windowDuration=1, maxConcurrentExecutionsPermitted=0}", 'bapiExtendedStatusCode': 'REJECTED_ABO': 'For BAPI: Get Device Enrichment Details, maximVE_THROTTLE_LIMIT', 'bapiExtendedStatusDescription': 'For BAPI: Get Device Enrichment Details, maximum allowed BAPI instUTC 2020 and now'}ances per 1 minute is 5. The limit has been reached for the time-window between Wed Nov 11 18:44:46 UTC 2020 and now'}
I have had similar throttling issues/concerns. AFAIK certain APIs are road-mapped to bump rate-limits to 20 requests per minute in later DNAC releases. If you wish to rely on APIs for your task you would need to implement some sort of timing constraint in your code to delay your loop. The downside is the time spent figuring that out, and the fact that current API limits would cause your task to take at least 30 minutes (150 IPs/5 per minute). Your best bet is to mention the concern to Cisco reps, make-a-wish within DNAC admin UI, and keep an eye on later DNAC releases and API updates. HTH!
11-12-2020 03:57 AM
You're using the device enrichment API which is limited to 5 per minute (which is what the BAPI error also tells you). Most of our GET/POST APIs (if not all) should be moving up to 100 per minute (GET) and 50 per minute (POST) with Cyclops (2.1.2.x).
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide