diff --git a/utils/netboxcli.py b/utils/netboxcli.py index 45c3415390c80e93a53a4776dda85961507a2c2c..2ba7e2ed628db2f44286efa0ba0236eccd3dbc4f 100644 --- a/utils/netboxcli.py +++ b/utils/netboxcli.py @@ -158,5 +158,23 @@ def interface(fqdn: str, iface: str, lag: str): attach.add_command(interface) +# The reserve command +@cli.group() +def reserve(): + pass + + +@reserve.command() +@click.option('--fqdn', help='Device name where to get interface to reserve') +@click.option('--iface', help='Interface name to reserve') +def interface(fqdn: str, iface: str): + click.echo(f"Reserving interface: device ={fqdn}, interface name={iface}") + reserved_iface = nc.reserve_interface(nbclient, fqdn, iface) + print(reserved_iface ) + + +reserve.add_command(interface) + + if __name__ == '__main__': cli()