Hello,
I have two organization migration scripts that basically do the following:
- Script A backups an entire network config (ie. network general config + devices general config + product-related configs for the network and its devices) from organization A and then unclaim every device in that network.
- Script B recreates this network in organization B, applies the network parameters as they where in org A, claim devices in org B and then add them in the newly created network and finally re-apply every device configs.
During that step, if the device is a switch, script B deserialize an array containing each port configs and then parse it in a for loop that calls PUT /devices/{serial}/switch/ports/{portId}
The problem is that this API call sometimes fails with a 404 error but after some time it succeeds. I'm guessing it's because after importing a device in a new network there's a process that recreates HTTP routes based on this device's id and this process takes some time.
Is anyone here have any idea how much time we're talking about? I've put some delays in the code but even after a minute it still fails with the same HTTP code.