10-10-2023 06:19 AM
I was wondering if anyone could help. I am trying to write Python scripts. One of the scripts I am writing is to create networks. I can't seem to find any Meraki API code that would allow me to create networks and assign serial numbers to the newly created network (Meraki MX for SD-WAN). You can if you manually use Bulk network creator but this may be closed of by Meraki when it comes to scripting. Any help would be great.
Solved! Go to Solution.
10-11-2023 06:27 AM
A device (serial number) can only exist in one org. If you attempt to claim a device serial into the network which you don't have in the org inventory, you'll receive an error:
{ "errors": [ "Device with serial Q234-ABCD-0001 not found" ] }
If you attempt to claim a serial already in the network:
{ "errors": [ "Device with serial QXXV-FXXR-XXD7 is already claimed and in Test Network (network ID: L_9906373669455549372)" ] }
Otherwise, success is just a 200, OK; success.
The Meraki Dashboard will not allow you (or your API key) access to inventory that you don't have privileges for.
10-10-2023 07:55 AM
Have you checked it?
https://github.com/meraki/automation-scripts
10-10-2023 01:09 PM
Thanks for the reply, but unfortunately it does not appear to have a create network, or update device with serial number. I can create networks with everything apart from the assigning serials of Meraki MX's to the network.
10-10-2023 01:51 PM
You can claim a device from inventory into a network using the following endpoint:
https://developer.cisco.com/meraki/api-v1/claim-network-devices/
If they are not yet in inventory, you can use:
https://developer.cisco.com/meraki/api-v1/claim-into-organization-inventory/
10-11-2023 02:52 AM
Thanks David, I have seen that but here is my worry, and please correct me if I am wrong. When you run this code it simply asks for a NetworkID. Which is fine, but I have 3 organizations. How does it know which organization it is for and does this just pull from the Meraki database not the inventory ? Just worries me a little
10-11-2023 06:27 AM
A device (serial number) can only exist in one org. If you attempt to claim a device serial into the network which you don't have in the org inventory, you'll receive an error:
{ "errors": [ "Device with serial Q234-ABCD-0001 not found" ] }
If you attempt to claim a serial already in the network:
{ "errors": [ "Device with serial QXXV-FXXR-XXD7 is already claimed and in Test Network (network ID: L_9906373669455549372)" ] }
Otherwise, success is just a 200, OK; success.
The Meraki Dashboard will not allow you (or your API key) access to inventory that you don't have privileges for.
10-11-2023 11:49 AM
Network IDs are globally unique, so org ID isn't needed.
10-12-2023 12:50 AM
Funny story for you both, I was pulling and playing with the data and saw a network that was supposed to be in another organization pull through. I thought, Network_ID's must not be unique, only unique to the organization. Turns out, my work colleague was replicating the company in our lab so I was pulling through the correct one but it looked like the other. Thanks John and David for the advice. I am going to try all of the above today, much appreciated.
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