Support adding the DHCP range with the client

This commit is contained in:
2018-09-29 02:54:48 -04:00
parent 560fa57176
commit 15f26f9fa3
2 changed files with 71 additions and 31 deletions

View File

@ -604,19 +604,29 @@ def cli_network():
default=False,
help='Enable/disable DHCP for clients on subnet.'
)
@click.option(
'--dhcp-start', 'dhcp_start',
default=None,
help='DHCP range start address.'
)
@click.option(
'--dhcp-end', 'dhcp_end',
default=None,
help='DHCP range end address.'
)
@click.argument(
'vni'
)
def net_add(vni, description, domain, ip_network, ip_gateway, dhcp_flag):
def net_add(vni, description, domain, ip_network, ip_gateway, dhcp_flag, dhcp_start, dhcp_end):
"""
Add a new virtual network with VXLAN identifier VNI to the cluster.
Example:
pvc network add 1001 --domain test.local --ipnet 10.1.1.0/24 --gateway 10.1.1.1 --dhcp
pvc network add 1001 --domain test.local --ipnet 10.1.1.0/24 --gateway 10.1.1.1
"""
zk_conn = pvc_common.startZKConnection(zk_host)
retcode, retmsg = pvc_network.add_network(zk_conn, vni, description, domain, ip_network, ip_gateway, dhcp_flag)
retcode, retmsg = pvc_network.add_network(zk_conn, vni, description, domain, ip_network, ip_gateway, dhcp_flag, dhcp_start, dhcp_end)
cleanup(retcode, retmsg, zk_conn)
###############################################################################