DHCP updates are not applied to MX when calling `appliance/singleLan` endpoint

SOLVED
HazemGomaa
Conversationalist

DHCP updates are not applied to MX when calling `appliance/singleLan` endpoint

I'm trying to update DHCP settings under security&sdwan->DHCP via API call to the following end point (not totally sure why the example body is empty in the documentation):

 

https://developer.cisco.com/meraki/api-v1/#!update-network-appliance-single-lan.

 

Screen Shot 2021-09-03 at 12.05.55 PM.png

 

Although the call is returning success code (200), the setting never got really updated.

For example, if the current dhcpLeaseTime is 4 hours and I send the following request:

 

url = f"https://api.meraki.com/api/v1/networks/{_my_net_id}/appliance/singleLan"

headers = {'Accept': "*/*", 'Content-Type': "application/json", "X-Cisco-Meraki-API-Key": API_KEY}

data = {"subnet":"192.168.128.0/24",
"applianceIp":"192.168.128.1",
"dhcpLeaseTime":"1 day",
}
res = requests.put(url, headers=headers, data=json.dumps(data))

 

The request will be successful, but the dhcpLeaseTime will never be actually updated. So, the res variable in the last line will still show "4 hours"

 

what do I miss ? 

1 ACCEPTED SOLUTION
John-K
Meraki Employee

The single LAN GET returns the existing settings, but the PUT endpoint does not update those settings.

 

If you'd like to control these settings via API, your best bet is to GET the existing settings, enable VLANs on the appliance (even if you only plan to use one VLAN), and then PUT the settings to the endpoints that modify DHCP settings for VLANs.

 

Single LAN mode has a place for small deployments where users don't use advanced features like the API. If you want to use API, then you'll be better served enabling VLANs as well. 

View solution in original post

2 REPLIES 2
John-K
Meraki Employee

The single LAN GET returns the existing settings, but the PUT endpoint does not update those settings.

 

If you'd like to control these settings via API, your best bet is to GET the existing settings, enable VLANs on the appliance (even if you only plan to use one VLAN), and then PUT the settings to the endpoints that modify DHCP settings for VLANs.

 

Single LAN mode has a place for small deployments where users don't use advanced features like the API. If you want to use API, then you'll be better served enabling VLANs as well. 

View solution in original post

HazemGomaa
Conversationalist

that was it. thanks @John-K !

Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.