Created
November 3, 2019 07:33
-
-
Save afaqk9394/a497d07af6d36222115fee375e0dcad8 to your computer and use it in GitHub Desktop.
claim device into network
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from meraki import meraki | |
| api_key = 'e1cf05af36ef9fccf579a556537112fe66a60549' | |
| org_id = '641762946900403561' | |
| #New Network Details | |
| my_name = 'FSN Dmeo' | |
| my_tags = ['Trial', 'West', 'CA'] | |
| my_time = 'US/Pacific' | |
| #Create a network or choose an existing one (and get the ID) | |
| my_network = meraki.addnetwork(api_key, org_id, my_name, 'Demo', my_tags, my_time) | |
| my_netid = my_network['id'] | |
| myinventory = meraki.getorginventory(api_key, org_id) | |
| #Find Unused devices or pick one yourself that is unused | |
| unused = [device for device in myinventory if device['networkId'] is None] | |
| my_ap = unused[0] | |
| my_serial = my_ap['serial'] | |
| #Our New Network doesn't contain any device yet | |
| my_network_devices = meraki.getnetworkdevices(api_key, my_netid) | |
| #Claim device | |
| meraki.adddevtonet(api_key, my_netid, my_serial) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment