Varp

Module for managing the VARP configuration in EOS

This module provides an API for configuring VARP resources using EOS and eAPI.

param name:The interface name the configuration is in reference to. The interface name is the full interface identifier
type name:string
param address:The interface IP address in the form of address/len.
type address:string
param mtu:The interface MTU value. The MTU value accepts integers in the range of 68 to 65535 bytes
type mtu:integer
class pyeapi.api.varp.Varp(*args, **kwargs)

Bases: pyeapi.api.abstract.EntityCollection

get()

Returns the current VARP configuration

The Varp resource returns the following:

  • mac_address (str): The virtual-router mac address
  • interfaces (dict): A list of the interfaces that have a
    virtual-router address configured.
Returns:A Python dictionary object of key/value pairs that represents the current configuration of the node. If the specified interface does not exist then None is returned:
{
    "mac_address": "aa:bb:cc:dd:ee:ff",
    "interfaces": {
        "Vlan100": {
            "addresses": [ "1.1.1.1", "2.2.2.2"]
        },
        "Vlan200": [...]
    }
}
interfaces
set_mac_address(mac_address=None, default=False, disable=False)

Sets the virtual-router mac address

This method will set the switch virtual-router mac address. If a virtual-router mac address already exists it will be overwritten.

Parameters:
  • mac_address (string) – The mac address that will be assigned as the virtual-router mac address. This should be in the format, aa:bb:cc:dd:ee:ff.
  • default (bool) – Sets the virtual-router mac address to the system default (which is to remove the configuration line).
  • disable (bool) – Negates the virtual-router mac address using the system no configuration command
Returns:

True if the set operation succeeds otherwise False.

class pyeapi.api.varp.VarpInterfaces(node)

Bases: pyeapi.api.abstract.EntityCollection

The VarpInterfaces class helps manage interfaces with virtual-router configuration.

get(name)
getall()
set_addresses(name, addresses=None, default=False, disable=False)
pyeapi.api.varp.instance(node)

Returns an instance of Ipinterfaces

This method will create and return an instance of the Varp object passing the value of node to the instance. This function is required for the resource to be autoloaded by the Node object

Parameters:node (Node) – The node argument provides an instance of Node to the Varp instance