Add gateway_ip arg for static bindings

Change-Id: I9c54023d0c59840829bf311900621228696ce24e
This commit is contained in:
Shih-Hao Li 2016-12-14 15:42:56 -08:00
parent c52244b8b9
commit a78c9ca11c

View File

@ -544,7 +544,7 @@ class LogicalDhcpServer(AbstractRESTResource):
return _do_update()
def create_binding(self, server_uuid, mac, ip, hostname=None,
lease_time=None, options=None):
lease_time=None, options=None, gateway_ip=False):
body = {'mac_address': mac, 'ip_address': ip}
if hostname:
body['host_name'] = hostname
@ -552,6 +552,9 @@ class LogicalDhcpServer(AbstractRESTResource):
body['lease_time'] = lease_time
if options:
body['options'] = options
if gateway_ip is not False:
# Note that None is valid for gateway_ip, means deleting it.
body['gateway_ip'] = gateway_ip
url = "%s/static-bindings" % server_uuid
return self._client.url_post(url, body)