nautobot_ssot_ipfabric.utilities

Utilities.

Submodules

Package Contents

Functions

create_device_role_object(role_name, role_color)

Create specified device role in Nautobot.

create_device_type_object(device_type, vendor_name)

Create a specified device type in Nautobot.

create_interface(device_obj, interface_details)

Verify interface exists on specified device. If not, creates interface.

create_ip(ip_address, subnet_mask[, status, object_pk])

Verify ip address exists in Nautobot. If not, creates specified ip.

create_manufacturer(vendor_name)

Create specified manufacturer in Nautobot.

create_site(site_name[, site_id])

Creates a specified site in Nautobot.

create_status(status_name, status_color[, ...])

Verify status object exists in Nautobot. If not, creates specified status. Defaults to dcim | device.

create_vlan(vlan_name, vlan_id, vlan_status, site_obj, ...)

Creates or obtains VLAN object.

clean_slate()

Delete all objects synced.

json_fixture(json_file_path)

Load and return JSON Fixture.

nautobot_ssot_ipfabric.utilities.create_device_role_object(role_name, role_color)

Create specified device role in Nautobot.

Args:

role_name (str): Role name. role_color (str): Role color.

nautobot_ssot_ipfabric.utilities.create_device_type_object(device_type, vendor_name)

Create a specified device type in Nautobot.

Args:

device_type (str): Device model gathered from DiffSync model. vendor_name (str): Vendor Name

nautobot_ssot_ipfabric.utilities.create_interface(device_obj, interface_details)

Verify interface exists on specified device. If not, creates interface.

Args:

device_obj (Device): Device object to check interface against. interface_details (dict): interface details.

nautobot_ssot_ipfabric.utilities.create_ip(ip_address, subnet_mask, status='Active', object_pk=None)

Verify ip address exists in Nautobot. If not, creates specified ip.

Utility behavior is manipulated by settings if duplicate ip’s are allowed.

Args:

ip_address (str): IP address. subnet_mask (str): Subnet mask used for IP Address. status (str): Status to assign to IP Address. object_pk: Object primary key

nautobot_ssot_ipfabric.utilities.create_manufacturer(vendor_name)

Create specified manufacturer in Nautobot.

nautobot_ssot_ipfabric.utilities.create_site(site_name, site_id=None)

Creates a specified site in Nautobot.

Args:

site_name (str): Name of the site. site_id (str): ID of the site.

nautobot_ssot_ipfabric.utilities.create_status(status_name, status_color, description='', app_label='dcim', model='device')

Verify status object exists in Nautobot. If not, creates specified status. Defaults to dcim | device.

Args:

status_name (str): Status name. status_color (str): Status color. description (str): Description app_label (str): App Label (“DCIM”) model (str): Django Model (“DEVICE”)

nautobot_ssot_ipfabric.utilities.create_vlan(vlan_name: str, vlan_id: int, vlan_status: str, site_obj: nautobot.dcim.models.Site, description: str)

Creates or obtains VLAN object.

Args:

vlan_name (str): VLAN Name vlan_id (int): VLAN ID vlan_status (str): VLAN Status site_obj (Site): Site Django Model description (str): VLAN Description

Returns:

(VLAN): Returns created or obtained VLAN object.

nautobot_ssot_ipfabric.utilities.clean_slate()

Delete all objects synced.

Use this with caution. Never use in production env.

nautobot_ssot_ipfabric.utilities.json_fixture(json_file_path)

Load and return JSON Fixture.