cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
74
Views
0
Helpful
0
Replies
Highlighted
Beginner

Meraki unable to get vlan info

I am just trying to use Meraki SDK to retrieve vlan information using the sandbox, but get error when run the code. Any advice will be appreciated.

When I run postman to inquiry the vlan information, I got return error says "Vlans are not enabled for this network", I thought may be it is the reason, but when login to sandbox, vlan 1 is there.

Here is the code.

from meraki_sdk.meraki_sdk_client import MerakiSdkClient
import json
from pprint import pprint

token = '6bec40cf957de430a6f1f2baa056b99a4fac9ea0'
meraki = MerakiSdkClient(token)
orgs = meraki.organizations.get_organizations()

for org in orgs :
if org['name'] == 'DevNet Sandbox' :
orgId = org['id']

params = {}
params['organization_id'] = orgId
networks = meraki.networks.get_organization_networks(params)
pprint(networks)
for network in networks :
if network['name'] == 'DevNet Sandbox Always on READ ONLY' :
netId = network['id']

vlans = meraki.vlans.get_network_vlans(netId) 

 Here is the error.

Traceback (most recent call last):
File "C:/Users/user/PycharmProjects/Meraki/Meraki_SDK1.py", line 30, in <module>
vlans = meraki.vlans.get_network_vlans(netId)
File "C:\Users\user\PycharmProjects\Meraki\venv\lib\site-packages\meraki_sdk\controllers\vlans_controller.py", line 60, in get_network_vlans
self.validate_response(_context)
File "C:\Users\user\PycharmProjects\Meraki\venv\lib\site-packages\meraki_sdk\controllers\base_controller.py", line 94, in validate_response
raise APIException('HTTP response not OK.', context)
meraki_sdk.exceptions.api_exception.APIException: HTTP response not OK.

This widget could not be displayed.