libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [01/19] libcloud git commit: Allow ex_list_firewall_rules to accept network domain id and pageSize, pageNumber as params
Date Mon, 29 Feb 2016 04:12:14 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk 02fa4f640 -> 5b2a26c0a


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/71063f67
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/71063f67
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/71063f67

Branch: refs/heads/trunk
Commit: 71063f679cb438242d5bcc8db75b0cfb2ace4c4d
Parents: 60b5661
Author: Ming Sheng <mingsheng36@gmail.com>
Authored: Wed Dec 30 21:13:51 2015 +0800
Committer: Ming Sheng <mingsheng36@gmail.com>
Committed: Wed Dec 30 21:13:51 2015 +0800

----------------------------------------------------------------------
 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/71063f67/libcloud/common/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/common/dimensiondata.py b/libcloud/common/dimensiondata.py
index 3fc6e3c..573afe3 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/71063f67/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