clone organization timeout

Ozgur
Here to help

clone organization timeout

We are using the api to clone an organization ( https://developer.cisco.com/meraki/api-v1/#!clone-organization )

 

This call automatically copies organization-level settings and config templates. It works fine for low number of config templates, but when the organization has more than 14-15 config templates, api call times out.

 

I have tried to clone an organizaton that has 25 config templates via the dashboard (and not via the api), and the operation succeeded in around 2 minutes. So indeed, looking like the time it takes for the clone to run is proportional to the number of config templates, and it can be done over the dashboard as they do not have a timeout there, but can't be done via the api because of the 60-second hard timeout.

 

I checked action batches as well but this operantion is not supported by action batches.

 

Any idea how we can make this work via the api, for organizations that have more then ~15 config templates?

5 Replies 5
Inderdeep
Kind of a big deal
Kind of a big deal

@Ozgur When you say 25 Templates, how many API calls are there. As i think there is a rate limit on it as below

 

  • The Dashboard API is limited to 5 requests per second, per organization.
  • A burst of 5 additional requests are allowed in the first second, so a maximum of 15 requests in the first 2 seconds.
  • The rate limiting technique is based off of the token bucket model.
  • Furthermore, a concurrency limit of 10 concurrent requests per IP is enforced

Source
https://developer.cisco.com/meraki/api/#!rate-limit 

 

Check this as well

https://meraki.cisco.com/blog/2019/06/action-batches-a-recipe-for-success/ 

 

Regards
Inderdeep Singh

www.thenetworkdna.com 

Regards/Inder
Cisco IT Blogs awarded in 2020 & 2021
www.thenetworkdna.com
Ozgur
Here to help

Hi @Inderdeep , thanks for your reply.

 

Its a single api call actually that does all of this: https://developer.cisco.com/meraki/api-v1/#!clone-organization

 

So probably this is not related to rate limits, but the problem is this single api call taking more than a minute to complete. 

Inderdeep
Kind of a big deal
Kind of a big deal

yes this is sure it is not related to the time limit but need to figure out why your API call takes 60 minutes. Let me check if i can find anything related to this or if someone in my circle had this issue in past.

 

Regards
Inderdeep Singh

www.thenetworkdna.com 

Regards/Inder
Cisco IT Blogs awarded in 2020 & 2021
www.thenetworkdna.com
PhilipDAth
Kind of a big deal
Kind of a big deal

Try something like this in the setup (untested):

 

dashboard = meraki.DashboardAPI(
	api_key=MERAKI_API_KEY,
	output_log=False,
	print_console=False,
	single_request_timeout=300
)

 

This appears to be the list of everything you can specify (from reset_session.py):

class RestSession(object):
    def __init__(
        self,
        logger,
        api_key,
        base_url=DEFAULT_BASE_URL,
        single_request_timeout=SINGLE_REQUEST_TIMEOUT,
        certificate_path=CERTIFICATE_PATH,
        requests_proxy=REQUESTS_PROXY,
        wait_on_rate_limit=WAIT_ON_RATE_LIMIT,
        nginx_429_retry_wait_time=NGINX_429_RETRY_WAIT_TIME,
        action_batch_retry_wait_time=ACTION_BATCH_RETRY_WAIT_TIME,
        retry_4xx_error=RETRY_4XX_ERROR,
        retry_4xx_error_wait_time=RETRY_4XX_ERROR_WAIT_TIME,
        maximum_retries=MAXIMUM_RETRIES,
        simulate=SIMULATE_API_CALLS,
        be_geo_id=BE_GEO_ID,
        caller=MERAKI_PYTHON_SDK_CALLER,
        use_iterator_for_get_pages=False,
    😞

 

 

Ozgur
Here to help

@PhilipDAth thanks for the reply.

 

Even if I set single_request_timeout to 300 seconds or any other value, I get back a gateway error from the api after 60 seconds. That's probably where the hard limit is for the api, so we can not set it to a bigger value than 60 seconds.

Get notified when there are additional replies to this discussion.