Community Record
36
Posts
12
Kudos
2
Solutions
Badges
May 14 2020
7:49 AM
The sdk is depricated. You should use pip install meraki --upgrade Please note, the library is supported on Python 3.6 or above.
... View more
May 13 2020
5:50 PM
All endpoints should be in the latest Python package. Make sure you have downloaded and installed the latest.
... View more
Apr 8 2020
5:37 AM
If your API key is tied to multiple orgs, this will only get the devices of the last org it pulls back in the list. To get all serials in all orgs, you would need to put everything in the "for org in my_org: loop".
... View more
Apr 7 2020
9:52 AM
4 Kudos
Below should get you what you want for updating address, tags, etc. This scrip assumes you don't know your org Id and the network Id associated with each serial number. If you know that information, you can modify the script to suit your needs. To get your serial numbers into a list, you could read through a file and populate it that way also. The firewall rules would follow the same concept. import meraki apiKey = '123YourAPI_Key' # You could also use an environmental variable for this dashboard = meraki.DashboardAPI(api_key=apiKey) # You will have to get the serial numbers you want to modify into a list. devicesToModifyList = ['XXXX-XXXX-XXXX', 'XXXX-XXXX-XXXX'] # The address you want to update on the devices newAddress = '123 Any Street, Small Town USA' # The tags you want to update on the devices. They must be separated by a space. newTags = ' tag1 tag2 ' # This list will be populated with dictionaries of the network ID and serial number of the devices. serialAndNetworkIdList = list() print('Finding Org ID...') # You first have to find your Org ID. Replace 'Your Org Name' with whatever your org name is in the dashboard. # If you know your org Id, you can skip this part and set the orgId variable to it. try: myOrgs = dashboard.organizations.getOrganizations() except meraki.APIError as e: print( f'Meraki API error: {e}') except Exception as e: print(f'some other error: {e}') for orgs in myOrgs: if orgs['name'] == 'Your Org Name': orgId = orgs['id'] print('DONE!') # Pulls back all the devices that are assigned to a network in your org. This can take some time if you have many devices. # If you have many devices, it's recommended you use pagination. devices = dashboard.devices.getOrganizationDevices(orgId, total_pages = 'all') # This loops through all of the devices in your dashboard. If the serial number is in your devicesToModifyList, # it adds the network Id and serial number to the devicesToModifyDict. The devicesToModifyDict is then appended # to the serialAndNetworkIdList. for device in devices: devicesToModifyDict = dict() if device['serial'] in devicesToModifyList: devicesToModifyDict['networkId'] = device['networkId'] devicesToModifyDict['serial'] = device['serial'] serialAndNetworkIdList.append(devicesToModifyDict) # This loops through serialAndNetworkIdList to update the devices. You can add and remove things to the kwargs dictionary as needed. Check the API docs # for what you can add. for device in serialAndNetworkIdList: networkId = device['networkId'] serial = device['serial'] kwargs = { 'address': newAddress, 'moveMapMarker': True, 'tags': newTags } try: updateDevices = dashboard.devices.updateNetworkDevice(networkId, serial, **kwargs) print(updateDevices) except meraki.APIError as e: print( f'Meraki API error: {e}') continue except Exception as e: print(f'some other error: {e}') continue
... View more
Apr 7 2020
8:12 AM
To be honest, I don't sue Postman so I can't comment on that. If you want to update any attribute of a device, you have to do them one by one as the API identifies devices by serial number. You could do a simple Python loop to take care of this for you. You don't have to update all attributes, you can only update the ones you want. If you have, say, 100 devices in your dashboard and only want to update 10-25 devices, how do you identify those 10-25 devices? By name, tag, serial number, etc.?
... View more
Mar 31 2020
12:24 PM
That's one of my biggest complaints with Meraki is the logging is not where I would prefer it to be. Seems crazy that we have to setup a syslog server for this.
... View more
Mar 26 2020
5:35 PM
You're welcome. Glad I could help!
... View more
Mar 26 2020
5:27 PM
2 Kudos
The MX64 does return WAN2 data. Below is what I got back from the call. (I of course changed my public IP address.) { 'interface': 'WAN 1', 'status': 'Active', 'ip': '1.1.1.1', 'gateway': '1.1.1.2', 'publicIp': '1.1.1.1', 'dns': '1.1.1.2', 'usingStaticIp': False }, { 'interface': 'WAN 2', 'status': 'Not connected' }
... View more
Mar 26 2020
5:19 PM
If you login to your dashboard and click the Help dropdown in the top right and select API Docs. Scroll down on the left until you see Devices. Under that look for Return the uplink information for a device. I don't know how to find a link outside my dashboard. The issue you may be facing is that the MX64 and MX67 don't have dedicated Internet 2 ports. You are essentially taking on of the lan ports and making it a WAN port. Let me do some testing on a MX64 I have.
... View more
Mar 26 2020
3:56 PM
I poll all my MX devices using the uplinkstatus endpoint and it pull back both WAN1 and WAN2 stats. What model MX are you using?
... View more
Mar 26 2020
3:52 PM
Unfortunately it looks like you are out of luck. Maybe use the make a wish function?
... View more
Mar 26 2020
2:17 PM
If you have auto-generated IP addresses, it won't pull those back for some reason.
... View more
My Accepted Solutions
Subject | Views | Posted |
---|---|---|
12142 | Apr 7 2020 9:52 AM | |
7379 | Mar 26 2020 5:27 PM |
My Top Kudoed Posts
Subject | Kudos | Views |
---|---|---|
4 | 12142 | |
2 | 7379 |