libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [2/3] libcloud git commit: Allow ex_list_firewall_rules to accept network domain id and pageSize, pageNumber as params
Date Fri, 01 Jan 2016 20:37:23 GMT
Allow ex_list_firewall_rules to accept network domain id and pageSize, pageNumber as params


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

Branch: refs/heads/trunk
Commit: 7a6a54894c098c32cb5d649a87b0a89a1aa54d79
Parents: 5e5f7a5
Author: Ming Sheng <mingsheng36@gmail.com>
Authored: Wed Dec 30 21:13:51 2015 +0800
Committer: anthony-shaw <anthony.p.shaw@gmail.com>
Committed: Sat Jan 2 07:36:41 2016 +1100

----------------------------------------------------------------------
 libcloud/common/dimensiondata.py          | 8 ++++----
 libcloud/compute/drivers/dimensiondata.py | 9 ++++++---
 2 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/7a6a5489/libcloud/common/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/common/dimensiondata.py b/libcloud/common/dimensiondata.py
index 5df3e22..a998500 100644
--- a/libcloud/common/dimensiondata.py
+++ b/libcloud/common/dimensiondata.py
@@ -341,7 +341,7 @@ class DimensionDataNetworkDomain(object):
         self.plan = plan
 
     def __repr__(self):
-        return (('<DimensionDataNetworkDomain: id=%s, name=%s,'
+        return (('<DimensionDataNetworkDomain: id=%s, name=%s, '
                  'description=%s, location=%s, status=%s>')
                 % (self.id, self.name, self.description, self.location,
                    self.status))
@@ -362,7 +362,7 @@ class DimensionDataPublicIpBlock(object):
         self.status = status
 
     def __repr__(self):
-        return (('<DimensionDataNetworkDomain: id=%s, base_ip=%s,'
+        return (('<DimensionDataNetworkDomain: id=%s, base_ip=%s, '
                  'size=%s, location=%s, status=%s>')
                 % (self.id, self.base_ip, self.size, self.location,
                    self.status))
@@ -419,7 +419,7 @@ class DimensionDataFirewallRule(object):
         self.enabled = enabled
 
     def __repr__(self):
-        return (('<DimensionDataNetworkDomain: id=%s, name=%s,'
+        return (('<DimensionDataNetworkDomain: id=%s, name=%s, '
                  'action=%s, location=%s, status=%s>')
                 % (self.id, self.name, self.action, self.location,
                    self.status))
@@ -612,7 +612,7 @@ class DimensionDataPoolMember(object):
 
     def __repr__(self):
         return (('<DimensionDataPool: id=%s, name=%s, '
-                 'ip=%s, status=%s, port=%s, node_id=%s')
+                 'ip=%s, status=%s, port=%s, node_id=%s>')
                 % (self.id, self.name,
                    self.ip, self.status, self.port,
                    self.node_id))

http://git-wip-us.apache.org/repos/asf/libcloud/blob/7a6a5489/libcloud/compute/drivers/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py
index c37a1ab..8348ec7 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -929,9 +929,12 @@ class DimensionDataNodeDriver(NodeDriver):
             'server/server/%s' % id).object
         return self._to_node(node)
 
-    def ex_list_firewall_rules(self, network_domain):
-        params = {}
-        params['networkDomainId'] = network_domain.id
+    def ex_list_firewall_rules(self, network_domain, page_size=50, page_number=1):
+        params = {'pageSize': page_size, 'pageNumber': page_number}
+        if isinstance(network_domain, str):
+            params['networkDomainId'] = network_domain
+        else:
+            params['networkDomainId'] = network_domain.id
 
         response = self.connection \
             .request_with_orgId_api_2('network/firewallRule',


Mime
View raw message