- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
API scripting - Bulk creation and serial numbers
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you checked it?
https://github.com/meraki/automation-scripts
Please, if this post was useful, leave your kudos and mark it as solved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Network IDs are globally unique, so org ID isn't needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
