Ipinterfaces¶
Module for working the logical IP interfaces in EOS
This module provides an API for configuring logical IP interfaces 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.ipinterfaces.Ipinterfaces(node)[source]¶
Bases:
pyeapi.api.abstract.EntityCollection
- create(name)[source]¶
Creates a new IP interface instance
This method will create a new logical IP interface for the specified physical interface. If a logical IP interface already exists then this operation will have no effect.
Note
Configuring a logical IP interface on a physical interface will remove any existing logical switchports have have been created
- Parameters
name (string) – The interface identifier to create the logical layer 3 IP interface for. The name must be the full interface name and not an abbreviated interface name (eg Ethernet1, not Et1).
- Returns
- True if the create operation succeeds otherwise False. If the
specified interface is already created the this method will have no effect but will still return True
- delete(name)[source]¶
Deletes an IP interface instance from the running configuration
This method will delete the logical IP interface for the specified physical interface. If the interface does not have a logical IP interface defined, then this method will have no effect.
- Parameters
name (string) – The interface identifier to create the logical layer 3 IP interface for. The name must be the full interface name and not an abbreviated interface name (eg Ethernet1, not Et1).
- Returns
True if the delete operation succeeds otherwise False.
- get(name)[source]¶
Returns the specific IP interface properties
The Ipinterface resource returns the following:
name (str): The name of the interface
- address (str): The IP address of the interface in the form
of A.B.C.D/E
mtu (int): The configured value for IP MTU.
- Parameters
name (string) – The interface identifier to retrieve the configuration for
- 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.
- getall()[source]¶
Returns all of the IP interfaces found in the running-config
- Returns
A Python dictionary object of key/value pairs keyed by interface name that represents all of the IP interfaces on the current node:
{ 'Ethernet1': {...}, 'Ethernet2': {...} }
- set_address(name, value=None, default=False, disable=False)[source]¶
Configures the interface IP address
- Parameters
name (string) – The interface identifier to apply the interface config to
value (string) – The IP address and mask to set the interface to. The value should be in the format of A.B.C.D/E
default (bool) – Configures the address parameter to its default value using the EOS CLI default command
disable (bool) – Negates the address parameter value using the EOS CLI no command
- Returns
True if the operation succeeds otherwise False.
- set_mtu(name, value=None, default=False, disable=False)[source]¶
Configures the interface IP MTU
- Parameters
name (string) – The interface identifier to apply the interface config to
value (integer) – The MTU value to set the interface to. Accepted values include 68 to 65535
default (bool) – Configures the mtu parameter to its default value using the EOS CLI default command
disable (bool) – CLI no command
- Returns
True if the operation succeeds otherwise False.
- Raises
ValueError – If the value for MTU is not an integer value or outside of the allowable range
- pyeapi.api.ipinterfaces.instance(node)[source]¶
Returns an instance of Ipinterfaces
This method will create and return an instance of the Ipinterfaces 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 Ipinterfaces instance