charmhelpers.contrib.network.ovs package¶
Helpers for interacting with OpenvSwitch
-
charmhelpers.contrib.network.ovs.
add_bridge
(name, datapath_type=None)¶ Add the named bridge to openvswitch
-
charmhelpers.contrib.network.ovs.
add_bridge_port
(name, port, promisc=False)¶ Add a port to the named openvswitch bridge
-
charmhelpers.contrib.network.ovs.
add_ovsbridge_linuxbridge
(name, bridge)¶ Add linux bridge to the named openvswitch bridge :param name: Name of ovs bridge to be added to Linux bridge :param bridge: Name of Linux bridge to be added to ovs bridge :returns: True if veth is added between ovs bridge and linux bridge, False otherwise
-
charmhelpers.contrib.network.ovs.
check_for_eni_source
()¶ Juju removes the source line when setting up interfaces, replace if missing
-
charmhelpers.contrib.network.ovs.
del_bridge
(name)¶ Delete the named bridge from openvswitch
-
charmhelpers.contrib.network.ovs.
del_bridge_port
(name, port)¶ Delete a port from the named openvswitch bridge
-
charmhelpers.contrib.network.ovs.
disable_ipfix
(bridge)¶ Diable IPFIX on target bridge. :param bridge: Bridge to modify
-
charmhelpers.contrib.network.ovs.
enable_ipfix
(bridge, target, cache_active_timeout=60, cache_max_flows=128, sampling=64)¶ Enable IPFIX on bridge to target. :param bridge: Bridge to monitor :param target: IPFIX remote endpoint :param cache_active_timeout: The maximum period in seconds for
which an IPFIX flow record is cached and aggregated before being sentParameters: - cache_max_flows – The maximum number of IPFIX flow records that can be cached at a time
- sampling – The rate at which packets should be sampled and sent to each target collector
-
charmhelpers.contrib.network.ovs.
full_restart
()¶ Full restart and reload of openvswitch
-
charmhelpers.contrib.network.ovs.
get_bridge_ports
(name)¶ Return a list the ports on a named bridge
Parameters: name (str) – the name of the bridge to list Returns: List of ports on the named bridge Return type: List[str] Raises: subprocess.CalledProcessError if the ovs-vsctl command fails. If the named bridge doesn’t exist, then the exception will be raised.
-
charmhelpers.contrib.network.ovs.
get_bridges
()¶ Return list of the bridges on the default openvswitch
Returns: List of bridge names Return type: List[str] Raises: subprocess.CalledProcessError if ovs-vsctl fails
-
charmhelpers.contrib.network.ovs.
get_bridges_and_ports_map
()¶ Return dictionary of bridge to ports for the default openvswitch
Returns: a mapping of bridge name to a list of ports. Return type: Dict[str, List[str]] Raises: subprocess.CalledProcessError if any of the underlying ovs-vsctl command fail.
-
charmhelpers.contrib.network.ovs.
get_certificate
()¶ Read openvswitch certificate from disk
-
charmhelpers.contrib.network.ovs.
is_linuxbridge_interface
(port)¶ Check if the interface is a linuxbridge bridge :param port: Name of an interface to check whether it is a Linux bridge :returns: True if port is a Linux bridge
-
charmhelpers.contrib.network.ovs.
port_to_br
(port)¶ Determine the bridge that contains a port :param port: Name of port to check for :returns str: OVS bridge containing port or None if not found
-
charmhelpers.contrib.network.ovs.
set_Open_vSwitch_column_value
(column_value)¶ Calls ovs-vsctl and sets the ‘column_value’ in the Open_vSwitch table.
Parameters: column_value – See http://www.openvswitch.org//ovs-vswitchd.conf.db.5.pdf for details of the relevant values. :type str :raises CalledProcessException: possibly ovsdb-server is not running
-
charmhelpers.contrib.network.ovs.
set_manager
(manager)¶ Set the controller for the local openvswitch