Hello everyone. I'm starting new on Dashboard API. Currently using Postman and the collections Meraki has. Im having a little bit of issues with the DHCP and DHCP options when creating VLAN. I can create VLAN with no issues. But when I put Do not respond to DHCP Request, it defaults to Run a DHCP Server. It really does not matter what option I put for dhcpHandling, it still defaults to Run a DHCP Server (see screen capture below). It also does not put my dhcp options (for my other collection). Any help is greatly appreciated.
Hi @sec1jrs I sometimes say "pictures or it didn't happen" but you attached a screen shot! Anyway, I just tried this and it worked fine using my own Postman on my own home lab environment.
Make sure you are using this call:
https://n7.meraki.com/Meraki-San-Franc/n/Ykbfgdh/manage/support/api_docs/v0#update-a-vlan
Your call in Postman looks like it is the "List the VLANs" but should be the "Update" call, which includes a VLAN id # in the call. Such as PUT /networks/{{networkId}}/vlans/{{vlanId}} so the VLAN id: value of 100 is in the PUT command itself, not in the body.
You should be able to use PUT {{baseUrl}}/networks/{{networkid}}/vlans/100
and then the body could simply consist of:
{
"dhcpHandling": "Do not respond to DHCP requests"
}
Then run the GET {{baseUrl}}/networks/{{networkid}}/vlans to confirm you see the change.
And of course, you should probably use a {{my_vlanId}} variable for the VLAN versus hard-coding it to 100.
Hope that helps!
@MerakiDave - Thank you for your reply. I was actually doing a POST since I need to add VLANS. But I just tested the PUT on my created VLAN and it worked! If I have to do 1 collections (with 2 rules), that's fine POST/PUT. The end result is the same. Thanks again for your assistance.
Hi...
I had some issues as well in changing the dhcp option using python, but now it is working..
As an example i have the function i have created including the API call. It is one of my first function so a bit messy...
Hmmmmm maybe rewrite it with my current knowledge of Meraki API programming
Anyway.... check it out.... Postman is nice to check things, but create your own organisation and add some devices to it for testing purposes.. Makes life much easier
This example changes DNS names, Creates Reservations, and changes some dhcpoptions
@Edgar-VO - Thanks for the reply. I'm just a beginner in API and took the Postman route. So I have not learn Python yet. This will come in handy once I start using Python.
Just try..... It is so much more powerful than Postman (which is great for sending a few API calls). Python is very easy to learn, and you have so much examples on the net.... And of course members of this forum which are highly motivated and skilled