autonet_cumulus.driver

Module Contents

Classes

CumulusDriver

Attributes

cl_opts

autonet_cumulus.driver.cl_opts
class autonet_cumulus.driver.CumulusDriver(device: autonet.core.device.AutonetDevice)

Bases: autonet.drivers.device.driver.DeviceDriver

property dynamic_vlans(self) [int]

A list of integers that represent VLAN IDs that have been reserved for dynamic allocation.

Returns:

property bridge(self) str

Return the name of the bridge device. If the bridge name is explicitly configured, that will be used. Otherwise, the bridge name will be inferred from the first bridge defined.

Returns:

property loopback_address(self)

Returns the first IPv4 /32 address attached to the loopback interface. An exception is raised if the loopback cannot be found.

Returns:

property version(self) str

The OS version string.

Returns:

property major_version(self) int

The OS major version number. :return:

property minor_version(self) int

The OS Minor version number. :return:

property evpn_mh_supported(self) bool

Indicate that the device has support for EVPN MH.

Returns:

static _format_net_command(command: str, json: bool) str

Properly formats a NETd command.

Parameters:
  • command – The command to set to NETd.

  • json – Indicate if JSON output is desired.

Returns:

_exec_raw_command(self, command: str) Tuple[str, str]

Execute a raw command on the device and returns the raw output. Returns a tuple of stdout, and stderr strings.

Parameters:

command – The command to execute.

Returns:

_exec_net_commands(self, commands: [str], json: bool = True, cache: bool = True) autonet_cumulus.commands.CommandResultSet

Executes a list of NETd commands on the device and returns a list of results. Attempt will be made to send the command requesting output formatted as JSON unless json is set to False. JSON results will be returned already parsed by json.loads().

Parameters:
  • commands – A list of commands to be executed.

  • json – Attempt to get the command’s JSON output and parse it accordingly.

  • cache – Search the command result cache for previously cached results for the same command.

Returns:

_exec_config_abort(self) autonet_cumulus.commands.CommandResultSet

Executes the net abort command and returns the result set.

Returns:

_exec_config_commands(self, commands: [str]) autonet_cumulus.commands.CommandResultSet

Executes a list of configuration commands. Once the commands are applied an attempt to execute a commit will be performed. If the commit fails an attempt to execute a config abort will be made and an exception will be raised.

Parameters:

commands

Returns:

_get_interface_type(self, int_name) str

Gets the type of interface, vlan, bond, vrf, etc.

Parameters:

int_name – The name of the interface

Returns:

_get_vxlan_data(self) dict

Collect data about VXLAN configuration from several commands and return a parsed object containing information that can be used by various other methods.

Returns:

_get_dynamic_vlan(self) int

Get a vlan from the configured dynamic vlan pool.

Returns:

_get_bgp_evpn_data(self) dict

Collects the BGP ASN and router ID for the EVPN address family and returns them in a dictionary.

Returns:

_interface_read(self, request_data: str = None, cache=True) [autonet.core.objects.interfaces.Interface]
_interface_create(self, request_data: autonet.core.objects.interfaces.Interface) autonet.core.objects.interfaces.Interface
_interface_update(self, request_data: autonet.core.objects.interfaces.Interface, update) autonet.core.objects.interfaces.Interface
_interface_delete(self, request_data: str)
_bridge_vlan_read(self, request_data: Optional[Union[str, int]] = None, show_dynamic: bool = False) Union[List[autonet.core.objects.vlan.VLAN], autonet.core.objects.vlan.VLAN]
_bridge_vlan_create(self, request_data: autonet.core.objects.vlan.VLAN) autonet.core.objects.vlan.VLAN
_bridge_vlan_delete(self, request_data: str) None
_vrf_read(self, request_data: str = None) Union[List[autonet.core.objects.vrf.VRF], autonet.core.objects.vrf.VRF]
_vrf_create(self, request_data: autonet.core.objects.vrf.VRF) autonet.core.objects.vrf.VRF
_vrf_delete(self, request_data: str) None
_tunnels_vxlan_read(self, request_data: str = None) Union[List[autonet.core.objects.vxlan.VXLAN], autonet.core.objects.vxlan.VXLAN]
_tunnels_vxlan_create(self, request_data: autonet.core.objects.vxlan.VXLAN) autonet.core.objects.vxlan.VXLAN
_tunnels_vxlan_delete(self, request_data: str) None
_interface_lag_read(self, request_data: str, cache=True) Union[List[autonet.core.objects.lag.LAG], autonet.core.objects.lag.LAG]
_interface_lag_create(self, request_data: autonet.core.objects.lag.LAG) autonet.core.objects.lag.LAG
_interface_lag_update(self, request_data: autonet.core.objects.lag.LAG, update: bool) autonet.core.objects.lag.LAG
_interface_lag_delete(self, request_data: str) None