Skip to content

Added support for Enable/Disbale MX VLAN - #33

Closed
bmoore235 wants to merge 1 commit into
meraki:masterfrom
bmoore235:master
Closed

Added support for Enable/Disbale MX VLAN#33
bmoore235 wants to merge 1 commit into
meraki:masterfrom
bmoore235:master

Conversation

@bmoore235

Copy link
Copy Markdown

No description provided.

@pocc

pocc commented Jan 25, 2019

Copy link
Copy Markdown
Contributor

You need to change vlansEnableState to vlansEnabledState on line 3657 for this to work. Otherwise this looks good.

@Divzro Divzro left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I ended up using based on your pull:

Needs a True or False to post to enable vlan

https://dashboard.meraki.com/api_docs#enable/disable-vlans-for-the-given-network

def enableVlans(apikey, networkid, vstate, suppressprint=False):
calltype = "VLAN"
puturl = "{0}/networks/{1}/vlansEnabledState".format(str(base_url), str(networkid))
headers = {
"x-cisco-meraki-api-key": format(str(apikey)),
"Content-Type": "application/json",
}
putdata = {"enabled": vstate}
putdata = json.dumps(putdata)
dashboard = requests.put(puturl, data=putdata, headers=headers)
#
# Call return handler function to parse Dashboard response
#
result = __returnhandler(
dashboard.status_code, dashboard.text, calltype, suppressprint
)
return result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants