summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatthew.hodgins <matthew.hodgins@calxeda.com>2013-12-11 10:15:07 -0600
committermatthew.hodgins <matthew.hodgins@calxeda.com>2013-12-11 10:38:12 -0600
commit733f3bce52811fec3de009ec21bbdfba9112b8ae (patch)
tree6829b0df3b917655151c9d52533a8d306abe0d56
parent7436b9599d3ecc8530bb071dc612fa3879568cfb (diff)
downloadcxmanage-733f3bce52811fec3de009ec21bbdfba9112b8ae.tar.gz
CXMAN-258 expose get/set iface to network assignment
Signed-off-by: matthew.hodgins <matthew.hodgins@calxeda.com>
-rw-r--r--cxmanage_api/fabric.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/cxmanage_api/fabric.py b/cxmanage_api/fabric.py
index fcdf61b..4682ae6 100644
--- a/cxmanage_api/fabric.py
+++ b/cxmanage_api/fabric.py
@@ -393,6 +393,37 @@ class Fabric(object):
uplink=uplink
)
+ def assign_interface_to_network(self, interface, network):
+ """Assigns the interface to the network
+
+ >>> fabric.assign_interface_to_network(0, 'foo')
+
+ :param interface: The network interface (0, 1 or 2)
+ :type interface: int
+ :param network: The network name
+ :type network: str
+
+ """
+ self.primary_node.bmc.fabric_config_set_mac(
+ mac=interface,
+ network=network
+ )
+
+ def get_network_assignment(self, interface):
+ """Returns the network the given interface is assigned to
+
+ >>> fabric.get_network_assignment(0)
+ 'default_eth0'
+
+ :param interface: The network interface (0, 1 or 2)
+ :type interface: int
+
+ """
+ return self.primary_node.bmc.fabric_config_get_mac_network(
+ mac=interface
+ )
+
+
def get_uplinks(self):
"""Gets the fabric uplinks