Bgp¶
API module for Bgp
- class pyeapi.api.bgp.Bgp(*args, **kwargs)[source]¶
Bases:
pyeapi.api.abstract.Entity
The Bgp class implements global BGP router configuration
- property neighbors¶
- class pyeapi.api.bgp.BgpNeighbors(node)[source]¶
Bases:
pyeapi.api.abstract.EntityCollection
- command_builder(name, cmd, value, default, disable)[source]¶
Builds a command with keywords
Notes
- Negating a command string by overriding ‘value’ with None or an
assigned value that evalutates to false has been deprecated. Please use ‘disable’ to negate a command.
Parameters are evaluated in the order ‘default’, ‘disable’, ‘value’
- Parameters
string (str) – The command string
value (str) – The configuration setting to subsititue into the command string. If value is a boolean and True, just the command string is used
default (bool) – Specifies the command should use the default keyword argument. Default preempts disable and value.
disable (bool) – Specifies the command should use the no keyword argument. Disable preempts value.
- Returns
A command string that can be used to configure the node
- configure(cmd)[source]¶
Sends the commands list to the node in config mode
This method performs configuration the node using the array of commands specified. This method wraps the configuration commands in a try/except block and stores any exceptions in the error property.
Note
If the return from this method is False, use the error property to investigate the exception
- Parameters
commands (list) – A list of commands to be sent to the node in config mode
- Returns
- True if the commands are executed without exception otherwise
False is returned