You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2015/08/30 14:32:56 UTC

[08/21] libcloud git commit: [LIBCLOUD-737] Created function for creating a node.

[LIBCLOUD-737] Created function for creating a node.


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/b4ed5ea6
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/b4ed5ea6
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/b4ed5ea6

Branch: refs/heads/trunk
Commit: b4ed5ea6701eacdc3688527a53dbc86a7a451a6c
Parents: b90c561
Author: Anthony Shaw <an...@gmail.com>
Authored: Wed Aug 26 19:48:31 2015 +1000
Committer: Anthony Shaw <an...@gmail.com>
Committed: Wed Aug 26 19:48:31 2015 +1000

----------------------------------------------------------------------
 libcloud/loadbalancer/drivers/dimensiondata.py | 30 ++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/b4ed5ea6/libcloud/loadbalancer/drivers/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/loadbalancer/drivers/dimensiondata.py b/libcloud/loadbalancer/drivers/dimensiondata.py
index d294a9a..e44b77e 100644
--- a/libcloud/loadbalancer/drivers/dimensiondata.py
+++ b/libcloud/loadbalancer/drivers/dimensiondata.py
@@ -83,9 +83,13 @@ class DimensionDataLBDriver(Driver):
         kwargs['region'] = self.selected_region
         return kwargs
 
+    def create_balancer(self, name, port, protocol, algorithm, members):
+        
+        return True
+
     def list_balancers(self):
         """
-        List all loadbalancers inside a gepgraphy.
+        List all loadbalancers inside a geography.
         
         In Dimension Data terminology these are known as virtual listeners
 
@@ -150,12 +154,36 @@ class DimensionDataLBDriver(Driver):
     def balancer_attach_member(self, balancer, member):
         return True
 
+    def balancer_attach_compute_node(self, balancer, node):
+        return True
+
     def balancer_detach_member(self, balancer, member):
         return True
 
     def destroy_balancer(self, balancer):
         return True
 
+    def ex_create_node(self,
+                       network_domain_id,
+                       name,
+                       ip,
+                       ex_description,
+                       connectionLimit=25000,
+                       connectionRateLimit=2000):
+        create_node_elm = ET.Element('createNode', {'xmlns': SERVER_NS})
+        ET.SubElement(create_node_elm, "networkDomainId").text = network_domain_id
+        ET.SubElement(create_node_elm, "description").text = ex_description
+        ET.SubElement(create_node_elm, "name").text = name
+        ET.SubElement(create_node_elm, "ipv4Address").text = ip
+        ET.SubElement(create_node_elm, "connectionLimit").text = connectionLimit
+        ET.SubElement(create_node_elm, "connectionRateLimit").text = connectionRateLimit
+
+        self.connection.request_with_orgId_api_2(
+            'networkDomainVip/createNode',
+            method='POST',
+            data=ET.tostring(create_node_elm)).object
+        return True
+
     def ex_get_pools(self):
         pools = self.connection \
             .request_with_orgId_api_2('networkDomainVip/pool').object