Created
November 3, 2019 07:34
-
-
Save afaqk9394/0c1693350e0a9c34a97d80b069b6b5bd to your computer and use it in GitHub Desktop.
Update device attribute
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'] | |
| #Update Device Location | |
| new_address = 'San Francisco, CA' | |
| meraki.updatedevice(api_key, my_netid, my_serial, my_name, my_tags, address=new_address, move='true') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment