Skip to content
Snippets Groups Projects
Commit 867552b3 authored by Ubuntu's avatar Ubuntu Committed by Neda Moeini
Browse files

NAT-243 removed all custom fields code

parent 0be44f4d
No related branches found
No related tags found
1 merge request!77Netbox integration including intial CLI for populating base data and ...
......@@ -83,13 +83,13 @@ def get_device_by_name(nbclient, device_name):
# get all interfaces for a device
def get_interfaces_by_device(nbclient, device_name):
def get_interfaces_by_device(nbclient, device_name: str, speed: str):
device = get_device_by_name(nbclient, device_name)
return list(nbclient.dcim.interfaces.filter(device_id=device.id,
# enabled=False,
# mark_connected=False,
custom_fields={"states": "UNUSED"}
enabled=False,
mark_connected=False,
speed=speed
))
......@@ -97,6 +97,7 @@ def get_interfaces_by_device(nbclient, device_name):
def create_interface(nbclient,
iface_name: str,
type: str,
speed: str,
device_name: str) -> dict:
"""
Creates a new interface on
......@@ -110,9 +111,9 @@ def create_interface(nbclient,
new_iface = nbclient.dcim.interfaces.create(name=iface_name,
type=type,
speed=speed,
enabled=False,
mark_connected=False,
custom_fields={"states": "RESERVED"},
device=device.id)
return dict(new_iface)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment