Change with API after a claim

Solved
CarolineD
Here to help

Change with API after a claim

Hi,

 

Since now, when I deployed a MX thanks to the API, I was able to modify his config with API also in the 5-10 second after the claim. Modifications are like renaming, add traffic policy, etc.

 

But since this morning, I have to wait some seconds (I didn't count exactely but put some time.sleep(60) to be sure.

 

meraki.exceptions.APIError: appliance, updateDeviceApplianceUplinksSettings - 404 Not Found, <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtmplease wait a minute if the key or org was just newly created.

 

Does someone have a clue about it ?

 

Thanks

 

1 Accepted Solution
sungod
Kind of a big deal
Kind of a big deal

Ah, I see.

 

The time from claim to everything working varies, and changes are not 'instant'. I don't recall seeing any specific time in documentation, allowing a delay is recommended, see below.

 

There is a rate limit on claiming, see... https://developer.cisco.com/meraki/api-v1/claim-into-organization-inventory/

 

"This operation can be used up to ten times within a single five minute window."

 

This same rate limit is also there for https://developer.cisco.com/meraki/api-v1/claim-network-devices/

 

...and note that the description says "...for recently claimed devices, it may take a few minutes for API requests against that device to succeed...", which implies that a 60 second wait may not always be sufficient.

 

If you need to do multiple claims into network(s), action batches might be an option.

 

View solution in original post

3 Replies 3
sungod
Kind of a big deal
Kind of a big deal

Well 404 means the request was for something that doesn't exist or that you don't have access to.

 

Check the API key and serial number.

 

If you post the code for the actual request it would allow checking - be sure to x-out the API key, serial number and any other sensitive details.

CarolineD
Here to help

In my case I just had a time.sleep(60) and it works well, so no big deal, I just have to wait some times that I wasn't waiting for before

Looks like the "claimed" command made earlier wasn't already passed. Usually it makes less than 10sec, but today more like 60sec. (experienced on several sites, not juste one)

I just wondered if there is an explanation, and if I can reduce this timing soon. Especially when I deploy and configure multiples sites in parallel.

 

sungod
Kind of a big deal
Kind of a big deal

Ah, I see.

 

The time from claim to everything working varies, and changes are not 'instant'. I don't recall seeing any specific time in documentation, allowing a delay is recommended, see below.

 

There is a rate limit on claiming, see... https://developer.cisco.com/meraki/api-v1/claim-into-organization-inventory/

 

"This operation can be used up to ten times within a single five minute window."

 

This same rate limit is also there for https://developer.cisco.com/meraki/api-v1/claim-network-devices/

 

...and note that the description says "...for recently claimed devices, it may take a few minutes for API requests against that device to succeed...", which implies that a 60 second wait may not always be sufficient.

 

If you need to do multiple claims into network(s), action batches might be an option.

 

Get notified when there are additional replies to this discussion.