The networking_cisco.plugins.cisco.cfg_agent.device_drivers.devicedriver_api
Module¶
-
class
networking_cisco.plugins.cisco.cfg_agent.device_drivers.devicedriver_api.
RoutingDriverBase
¶ Bases:
object
Base class that defines an abstract interface for the Routing Driver.
This class defines the abstract interface/API for the Routing and NAT related operations. Driver class corresponding to a hosting device should inherit this base driver and implement its methods. RouterInfo object ( networking_cisco.plugins.cisco.cfg_agent.router_info.RouterInfo) is a wrapper around the router dictionary, with attributes for easy access to parameters.
-
cleanup_invalid_cfg
(hosting_device, routers)¶ Cleanup any invalid configuration in backend.
Parameters: - hosting_device – hosting_device dictionary for backend
- routers – list of router dictionaries for routers on backend
Returns: None
-
disable_internal_network_NAT
(router_info, port, ext_gw_port)¶ Disable NAT on an internal network.
Parameters: - router_info – RouterInfo object for this router
- port – port dictionary for the port where the internal network is connected
- ext_gw_port – port dictionary for the port where the external gateway network is connected
Returns: None
-
enable_internal_network_NAT
(router_info, port, ext_gw_port)¶ Enable NAT on an internal network.
Parameters: - router_info – RouterInfo object for this router
- port – port dictionary for the port where the internal network is connected
- ext_gw_port – port dictionary for the port where the external gateway network is connected
Returns: None
-
external_gateway_added
(router_info, ext_gw_port)¶ An external network was added to a router.
Parameters: - router_info – RouterInfo object of the router
- ext_gw_port – port dictionary for the port where the external gateway network is connected
Returns: None
-
external_gateway_removed
(router_info, ext_gw_port)¶ An external network was removed from the router.
Parameters: - router_info – RouterInfo object of the router
- ext_gw_port – port dictionary for the port where the external gateway network was connected
Returns: None
-
floating_ip_added
(router_info, ext_gw_port, floating_ip, fixed_ip)¶ A floating IP was added.
Parameters: - router_info – RouterInfo object for this router
- ext_gw_port – port dictionary for the port where the external gateway network is connected
- floating_ip – Floating IP as a string
- fixed_ip – Fixed IP of internal internal interface as a string
Returns: None
-
floating_ip_removed
(router_info, ext_gw_port, floating_ip, fixed_ip)¶ A floating IP was removed.
Parameters: - router_info – RouterInfo object for this router
- ext_gw_port – port dictionary for the port where the external gateway network is connected
- floating_ip – Floating IP as a string
- fixed_ip – Fixed IP of internal internal interface as a string
Returns: None
-
get_configuration
()¶ Return configuration of hosting_device for driver instance
Returns: configuration as a text string
-
internal_network_added
(router_info, port)¶ An internal network was connected to a router.
Parameters: - router_info – RouterInfo object for this router
- port – port dictionary for the port where the internal network is connected
Returns: None
-
internal_network_removed
(router_info, port)¶ An internal network was removed from a router.
Parameters: - router_info – RouterInfo object for this router
- port – port dictionary for the port where the internal network was connected
Returns: None
-
router_added
(router_info)¶ A logical router was assigned to the hosting device.
Parameters: router_info – RouterInfo object for this router Returns: None
-
router_removed
(router_info)¶ A logical router was de-assigned from the hosting device.
Parameters: router_info – RouterInfo object for this router Returns: None
-
routes_updated
(router_info, action, route)¶ Routes were updated for router.
Parameters: - router_info – RouterInfo object for this router
- action – Action on the route , either ‘replace’ or ‘delete’
- route – route dictionary with keys ‘destination’ & ‘next_hop’
Returns: None
-