libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [10/13] libcloud git commit: Add sample code for Edit FW, CRUD for ipaddresslist and portlist
Date Mon, 10 Oct 2016 00:02:04 GMT
Add sample code for Edit FW, CRUD for ipaddresslist and portlist

Add sample codes and rename port_list_list to portlist_list to avoid
confusion


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

Branch: refs/heads/trunk
Commit: 9e3c7da2403b30da67441e5a63ca79fff6236e3d
Parents: 026c973
Author: Samuel Chong <samuelchong1@gmail.com>
Authored: Fri Oct 7 17:05:40 2016 +1100
Committer: Samuel Chong <samuelchong1@gmail.com>
Committed: Fri Oct 7 17:05:40 2016 +1100

----------------------------------------------------------------------
 libcloud/compute/drivers/dimensiondata.py   | 350 +++++++++++++++++++++--
 libcloud/test/compute/test_dimensiondata.py | 128 ++++-----
 2 files changed, 384 insertions(+), 94 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/9e3c7da2/libcloud/compute/drivers/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py
index a76fcdc..08343ad 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -1481,6 +1481,44 @@ class DimensionDataNodeDriver(NodeDriver):
         """
         Edit a firewall rule
 
+        >>> from pprint import pprint
+        >>> from libcloud.compute.types import Provider
+        >>> from libcloud.compute.providers import get_driver
+        >>> import libcloud.security
+        >>>
+        >>> # Get dimension data driver
+        >>> libcloud.security.VERIFY_SSL_CERT = True
+        >>> cls = get_driver(Provider.DIMENSIONDATA)
+        >>> # driver = cls('myusername','mypassword', region='dd-au')
+        >>>
+        >>> # Get location
+        >>> location = driver.ex_get_location_by_id(id='AU9')
+        >>>
+        >>> # Get network domain by location
+        >>> networkDomainName = "Baas QA"
+        >>> network_domains = driver.ex_list_network_domains(location=location)
+        >>> my_network_domain = [d for d in network_domains if d.name ==
+                              networkDomainName][0]
+        >>>
+        >>>
+        >>> # List firewall rules
+        >>> firewall_rules = driver.ex_list_firewall_rules(my_network_domain)
+        >>>
+        >>> # Get Firewall Rule by name
+        >>> pprint("List specific firewall rule by name")
+        >>> fire_rule_under_test = (list(filter(lambda x: x.name ==
+                                   'My_New_Firewall_Rule', firewall_rules))[0])
+        >>> pprint(fire_rule_under_test.source)
+        >>> pprint(fire_rule_under_test.destination)
+        >>>
+        >>> # Edit Firewall
+        >>> fire_rule_under_test.destination.address_list_id =
+                '5e7c323f-c885-4e4b-9a27-94c44217dbd3'
+        >>> fire_rule_under_test.destination.port_list_id =
+                'b6557c5a-45fa-4138-89bd-8fe68392691b'
+        >>> result = driver.ex_edit_firewall_rule(fire_rule_under_test, 'LAST')
+        >>> pprint(result)
+
         :param rule: (required) The rule in which to create
         :type  rule: :class:`DimensionDataFirewallRule`
 
@@ -2496,6 +2534,30 @@ class DimensionDataNodeDriver(NodeDriver):
         """
         List IP Address List by network domain ID specified
 
+        >>> from pprint import pprint
+        >>> from libcloud.compute.types import Provider
+        >>> from libcloud.compute.providers import get_driver
+        >>> import libcloud.security
+        >>>
+        >>> # Get dimension data driver
+        >>> libcloud.security.VERIFY_SSL_CERT = True
+        >>> cls = get_driver(Provider.DIMENSIONDATA)
+        >>> driver = cls('myusername','mypassword', region='dd-au')
+        >>>
+        >>> # Get location
+        >>> location = driver.ex_get_location_by_id(id='AU9')
+        >>>
+        >>> # Get network domain by location
+        >>> networkDomainName = "Baas QA"
+        >>> network_domains = driver.ex_list_network_domains(location=location)
+        >>> my_network_domain = [d for d in network_domains if d.name ==
+                              networkDomainName][0]
+        >>>
+        >>> # List IP Address List of network domain
+        >>> ipaddresslist_list = driver.ex_list_ip_address_list(
+        >>>     ex_network_domain=my_network_domain)
+        >>> pprint(ipaddresslist_list)
+
         :param  ex_network_domain: The network domain or network domain ID
         :type   ex_network_domain: :class:`DimensionDataNetworkDomain` or 'str'
 
@@ -2513,6 +2575,32 @@ class DimensionDataNodeDriver(NodeDriver):
         """
         Get IP Address List by name in network domain specified
 
+        >>> from pprint import pprint
+        >>> from libcloud.compute.types import Provider
+        >>> from libcloud.compute.providers import get_driver
+        >>> import libcloud.security
+        >>>
+        >>> # Get dimension data driver
+        >>> libcloud.security.VERIFY_SSL_CERT = True
+        >>> cls = get_driver(Provider.DIMENSIONDATA)
+        >>> driver = cls('myusername','mypassword', region='dd-au')
+        >>>
+        >>> # Get location
+        >>> location = driver.ex_get_location_by_id(id='AU9')
+        >>>
+        >>> # Get network domain by location
+        >>> networkDomainName = "Baas QA"
+        >>> network_domains = driver.ex_list_network_domains(location=location)
+        >>> my_network_domain = [d for d in network_domains if d.name ==
+                              networkDomainName][0]
+        >>>
+        >>> # Get IP Address List by Name
+        >>> ipaddresslist_list_by_name = driver.ex_get_ip_address_list(
+        >>>     ex_network_domain=my_network_domain,
+        >>>     ex_ip_address_list_name='My_IP_AddressList_1')
+        >>> pprint(ipaddresslist_list_by_name)
+
+
         :param  ex_network_domain: (required) The network domain or network
                                    domain ID in which ipaddresslist resides.
         :type   ex_network_domain: :class:`DimensionDataNetworkDomain` or 'str'
@@ -2536,6 +2624,47 @@ class DimensionDataNodeDriver(NodeDriver):
         """
         Create IP Address List. IP Address list.
 
+        >>> from pprint import pprint
+        >>> from libcloud.compute.types import Provider
+        >>> from libcloud.compute.providers import get_driver
+        >>> from libcloud.common.dimensiondata import DimensionDataIpAddress
+        >>> import libcloud.security
+        >>>
+        >>> # Get dimension data driver
+        >>> libcloud.security.VERIFY_SSL_CERT = True
+        >>> cls = get_driver(Provider.DIMENSIONDATA)
+        >>> driver = cls('myusername','mypassword', region='dd-au')
+        >>>
+        >>> # Get location
+        >>> location = driver.ex_get_location_by_id(id='AU9')
+        >>>
+        >>> # Get network domain by location
+        >>> networkDomainName = "Baas QA"
+        >>> network_domains = driver.ex_list_network_domains(location=location)
+        >>> my_network_domain = [d for d in network_domains if d.name ==
+                              networkDomainName][0]
+        >>>
+        >>> # IP Address collection
+        >>> ipAddress_1 = DimensionDataIpAddress(begin='190.2.2.100')
+        >>> ipAddress_2 = DimensionDataIpAddress(begin='190.2.2.106',
+                                                 end='190.2.2.108')
+        >>> ipAddress_3 = DimensionDataIpAddress(begin='190.2.2.0',
+                                                 prefix_size='24')
+        >>> ip_address_collection = {ipAddress_1, ipAddress_2, ipAddress_3}
+        >>>
+        >>> # Create IPAddressList
+        >>> result = driver.ex_create_ip_address_list(
+        >>>     ex_network_domain=my_network_domain,
+        >>>     name='My_IP_AddressList_2',
+        >>>     ip_version='IPV4',
+        >>>     description='Test only',
+        >>>     ip_address_collection=ip_address_collection,
+        >>>     child_ip_address_list='08468e26-eeb3-4c3d-8ff2-5351fa6d8a04'
+        >>> )
+        >>>
+        >>> pprint(result)
+
+
         :param  ex_network_domain: The network domain or network domain ID
         :type   ex_network_domain: :class:`DimensionDataNetworkDomain` or 'str'
 
@@ -2628,6 +2757,35 @@ class DimensionDataNodeDriver(NodeDriver):
         """
         Edit IP Address List. IP Address list.
 
+        >>> from pprint import pprint
+        >>> from libcloud.compute.types import Provider
+        >>> from libcloud.compute.providers import get_driver
+        >>> from libcloud.common.dimensiondata import DimensionDataIpAddress
+        >>> import libcloud.security
+        >>>
+        >>> # Get dimension data driver
+        >>> libcloud.security.VERIFY_SSL_CERT = True
+        >>> cls = get_driver(Provider.DIMENSIONDATA)
+        >>> driver = cls('myusername','mypassword', region='dd-au')
+        >>>
+        >>> # IP Address collection
+        >>> ipAddress_1 = DimensionDataIpAddress(begin='190.2.2.100')
+        >>> ipAddress_2 = DimensionDataIpAddress(begin='190.2.2.106',
+        >>>                                      end='190.2.2.108')
+        >>> ipAddress_3 = DimensionDataIpAddress(
+        >>>                   begin='190.2.2.0', prefix_size='24')
+        >>> ip_address_collection = {ipAddress_1, ipAddress_2, ipAddress_3}
+        >>>
+        >>> # Edit IP Address List
+        >>> ip_address_list_id = '5e7c323f-c885-4e4b-9a27-94c44217dbd3'
+        >>> result = driver.ex_edit_ip_address_list(
+        >>>      ex_ip_address_list=ip_address_list_id,
+        >>>      description="Edit Test",
+        >>>      ip_address_collection=ip_address_collection,
+        >>>      child_ip_address_lists=None
+        >>>      )
+        >>> pprint(result)
+
         :param    ex_ip_address_list:  (required) IpAddressList object or
                                        IpAddressList ID
         :type     ex_ip_address_list: :class:'DimensionDataIpAddressList'
@@ -2700,8 +2858,22 @@ class DimensionDataNodeDriver(NodeDriver):
         """
         Delete IP Address List by ID
 
+        >>> from pprint import pprint
+        >>> from libcloud.compute.types import Provider
+        >>> from libcloud.compute.providers import get_driver
+        >>> import libcloud.security
+        >>>
+        >>> # Get dimension data driver
+        >>> libcloud.security.VERIFY_SSL_CERT = True
+        >>> cls = get_driver(Provider.DIMENSIONDATA)
+        >>> driver = cls('myusername','mypassword', region='dd-au')
+        >>>
+        >>> ip_address_list_id = '5e7c323f-c885-4e4b-9a27-94c44217dbd3'
+        >>> result = driver.ex_delete_ip_address_list(ip_address_list_id)
+        >>> pprint(result)
+
         :param    ex_ip_address_list:  IP Address List object or IP Address
-        List ID (required)
+                                        List ID (required)
         :type     ex_ip_address_list: :class:'DimensionDataIpAddressList'
                     or ``str``
 
@@ -2721,9 +2893,34 @@ class DimensionDataNodeDriver(NodeDriver):
         response_code = findtext(response, 'responseCode', TYPES_URN)
         return response_code in ['IN_PROGRESS', 'OK']
 
-    def ex_list_port_list(self, ex_network_domain):
-        """
-        List Port List by network domain ID specified
+    def ex_list_portlist(self, ex_network_domain):
+        """
+        List Portlist by network domain ID specified
+
+        >>> from pprint import pprint
+        >>> from libcloud.compute.types import Provider
+        >>> from libcloud.compute.providers import get_driver
+        >>> import libcloud.security
+        >>>
+        >>> # Get dimension data driver
+        >>> libcloud.security.VERIFY_SSL_CERT = True
+        >>> cls = get_driver(Provider.DIMENSIONDATA)
+        >>> driver = cls('myusername','mypassword', region='dd-au')
+        >>>
+        >>> # Get location
+        >>> location = driver.ex_get_location_by_id(id='AU9')
+        >>>
+        >>> # Get network domain by location
+        >>> networkDomainName = "Baas QA"
+        >>> network_domains = driver.ex_list_network_domains(location=location)
+        >>> my_network_domain = [d for d in network_domains if d.name ==
+        >>>                                               networkDomainName][0]
+        >>>
+        >>> # List portlist
+        >>> portLists = driver.ex_list_portlist(
+        >>>     ex_network_domain=my_network_domain)
+        >>> pprint(portLists)
+        >>>
 
         :param  ex_network_domain: The network domain or network domain ID
         :type   ex_network_domain: :class:`DimensionDataNetworkDomain` or 'str'
@@ -2737,28 +2934,77 @@ class DimensionDataNodeDriver(NodeDriver):
             'network/portList', params=params).object
         return self._to_port_lists(response)
 
-    def ex_get_port_list(self, ex_port_list):
+    def ex_get_portlist(self, ex_portlist_id):
         """
         Get Port List
 
-        :param  ex_port_list: The ex_port_list or ex_port_list ID
-        :type   ex_port_list: :class:`DimensionDataNetworkDomain` or 'str'
+        >>> from pprint import pprint
+        >>> from libcloud.compute.types import Provider
+        >>> from libcloud.compute.providers import get_driver
+        >>> import libcloud.security
+        >>>
+        >>> # Get dimension data driver
+        >>> libcloud.security.VERIFY_SSL_CERT = True
+        >>> cls = get_driver(Provider.DIMENSIONDATA)
+        >>> driver = cls('myusername','mypassword', region='dd-au')
+        >>>
+        >>> # Get specific portlist by ID
+        >>> portlist_id = '27dd8c66-80ff-496b-9f54-2a3da2fe679e'
+        >>> portlist = driver.ex_get_portlist(portlist_id)
+        >>> pprint(portlist)
+
+        :param  ex_portlist_id: The ex_port_list or ex_port_list ID
+        :type   ex_portlist_id: :class:`DimensionDataNetworkDomain` or 'str'
 
         :return:  DimensionDataPortList object
         :rtype:  :class:`DimensionDataPort`
         """
 
-        url_path = ('network/portList/%s' % self._port_list_to_port_list_id(
-            ex_port_list))
+        url_path = ('network/portList/%s' % ex_portlist_id)
         response = self.connection.request_with_orgId_api_2(
             url_path).object
         return self._to_port_list(response)
 
-    def ex_create_port_list(self, ex_network_domain, name, description,
-                            port_collection, child_port_list_lists=None):
+    def ex_create_portlist(self, ex_network_domain, name, description,
+                           port_collection, child_portlist_list=None):
         """
         Create Port List.
 
+        >>> from pprint import pprint
+        >>> from libcloud.compute.types import Provider
+        >>> from libcloud.compute.providers import get_driver
+        >>> from libcloud.common.dimensiondata import DimensionDataPort
+        >>> import libcloud.security
+        >>>
+        >>> # Get dimension data driver
+        >>> libcloud.security.VERIFY_SSL_CERT = True
+        >>> cls = get_driver(Provider.DIMENSIONDATA)
+        >>> driver = cls('myusername','mypassword', region='dd-au')
+        >>>
+        >>> # Get location
+        >>> location = driver.ex_get_location_by_id(id='AU9')
+        >>>
+        >>> # Get network domain by location
+        >>> networkDomainName = "Baas QA"
+        >>> network_domains = driver.ex_list_network_domains(location=location)
+        >>> my_network_domain = [d for d in network_domains if d.name ==
+                              networkDomainName][0]
+        >>>
+        >>> # Port Collection
+        >>> port_1 = DimensionDataPort(begin='1000')
+        >>> port_2 = DimensionDataPort(begin='1001', end='1003')
+        >>> port_collection = {port_1, port_2}
+        >>>
+        >>> # Create Port List
+        >>> new_portlist = driver.ex_create_portlist(
+        >>>     ex_network_domain=my_network_domain,
+        >>>     name='MyPortListX',
+        >>>     description="Test only",
+        >>>     port_collection=port_collection,
+        >>>     child_portlist_list={'a9cd4984-6ff5-4f93-89ff-8618ab642bb9'}
+        >>>     )
+        >>> pprint(new_portlist)
+
         :param    ex_network_domain:  (required) The network domain in
                                        which to create PortList. Provide
                                        networkdomain object or its id.
@@ -2773,9 +3019,9 @@ class DimensionDataNodeDriver(NodeDriver):
         :param    port_collection:  List of Port Address
         :type     port_collection: :``str``
 
-        :param    child_port_list_lists:  Child Port List to be included in
-                                          this Port List
-        :type     child_port_list_lists: :``str`` or ''list of
+        :param    child_portlist_list:  List of Child Portlist to be
+                                        included in this Port List
+        :type     child_portlist_list: :``str`` or ''list of
                                          :class:'DimensionDataChildPortList'
 
         :return: result of operation
@@ -2807,8 +3053,8 @@ class DimensionDataNodeDriver(NodeDriver):
             if port.end:
                 p.set('end', port.end)
 
-        if child_port_list_lists is not None:
-            for child in child_port_list_lists:
+        if child_portlist_list is not None:
+            for child in child_portlist_list:
                 ET.SubElement(
                     new_port_list,
                     'childPortListId'
@@ -2822,24 +3068,52 @@ class DimensionDataNodeDriver(NodeDriver):
         response_code = findtext(response, 'responseCode', TYPES_URN)
         return response_code in ['IN_PROGRESS', 'OK']
 
-    def ex_edit_port_list(self, ex_port_list, description,
-                          port_collection, child_port_list_lists=None):
+    def ex_edit_portlist(self, ex_portlist, description,
+                         port_collection, child_portlist_list=None):
         """
         Edit Port List.
 
-        :param    ex_port_list:  Port List to be edited
+        >>> from pprint import pprint
+        >>> from libcloud.compute.types import Provider
+        >>> from libcloud.compute.providers import get_driver
+        >>> from libcloud.common.dimensiondata import DimensionDataPort
+        >>> import libcloud.security
+        >>>
+        >>> # Get dimension data driver
+        >>> libcloud.security.VERIFY_SSL_CERT = True
+        >>> cls = get_driver(Provider.DIMENSIONDATA)
+        >>> driver = cls('myusername','mypassword', region='dd-au')
+        >>>
+        >>> # Port Collection
+        >>> port_1 = DimensionDataPort(begin='4200')
+        >>> port_2 = DimensionDataPort(begin='4201', end='4210')
+        >>> port_collection = {port_1, port_2}
+        >>>
+        >>> # Edit Port List
+        >>> editPortlist = driver.ex_get_portlist(
+            '27dd8c66-80ff-496b-9f54-2a3da2fe679e')
+        >>>
+        >>> result = driver.ex_edit_portlist(
+        >>>     ex_portlist=editPortlist.id,
+        >>>     description="Make Changes in portlist",
+        >>>     port_collection=port_collection,
+        >>>     child_portlist_list={'a9cd4984-6ff5-4f93-89ff-8618ab642bb9'}
+        >>> )
+        >>> pprint(result)
+
+        :param    ex_portlist:  Port List to be edited
                                         (required)
-        :type      ex_port_list: :``str`` or :class:'DimensionDataPortList'
+        :type      ex_portlist: :``str`` or :class:'DimensionDataPortList'
 
         :param    description:  Port List Description
         :type      description: :``str``
 
-        :param    port_collection:  List of Port Address
+        :param    port_collection:  List of Ports
         :type      port_collection: :``str``
 
-        :param    child_port_list_lists:  Child Port List to be included in
+        :param    child_portlist_list:  Child PortList to be included in
                                           this IP Address List
-        :type      child_port_list_lists: :``list`` of
+        :type      child_portlist_list: :``list`` of
                                           :class'DimensionDataChildPortList'
                                           or ''str''
 
@@ -2850,7 +3124,7 @@ class DimensionDataNodeDriver(NodeDriver):
         existing_port_address_list = ET.Element(
             'editPortList',
             {
-                "id": self._port_list_to_port_list_id(ex_port_list),
+                "id": self._port_list_to_port_list_id(ex_portlist),
                 'xmlns': TYPES_URN,
                 'xmlns:xsi': "http://www.w3.org/2001/XMLSchema-instance"
             })
@@ -2870,8 +3144,8 @@ class DimensionDataNodeDriver(NodeDriver):
             if port.end:
                 p.set('end', port.end)
 
-        if child_port_list_lists is not None:
-            for child in child_port_list_lists:
+        if child_portlist_list is not None:
+            for child in child_portlist_list:
                 ET.SubElement(
                     existing_port_address_list,
                     'childPortListId'
@@ -2891,11 +3165,27 @@ class DimensionDataNodeDriver(NodeDriver):
         response_code = findtext(response, 'responseCode', TYPES_URN)
         return response_code in ['IN_PROGRESS', 'OK']
 
-    def ex_delete_port_list(self, ex_port_list):
+    def ex_delete_portlist(self, ex_portlist):
         """
         Delete Port List
-        :param    ex_port_list:  Port List to be deleted
-        :type     ex_port_list: :``str`` or :class:'DimensionDataPortList'
+
+        >>> from pprint import pprint
+        >>> from libcloud.compute.types import Provider
+        >>> from libcloud.compute.providers import get_driver
+        >>> import libcloud.security
+        >>>
+        >>> # Get dimension data driver
+        >>> libcloud.security.VERIFY_SSL_CERT = True
+        >>> cls = get_driver(Provider.DIMENSIONDATA)
+        >>> driver = cls('myusername','mypassword', region='dd-au')
+        >>>
+        >>> # Delete Port List
+        >>> portlist_id = '157531ce-77d4-493c-866b-d3d3fc4a912a'
+        >>> response = driver.ex_delete_portlist(portlist_id)
+        >>> pprint(response)
+
+        :param    ex_portlist:  Port List to be deleted
+        :type     ex_portlist: :``str`` or :class:'DimensionDataPortList'
 
         :rtype: ``bool``
         """
@@ -2903,7 +3193,7 @@ class DimensionDataNodeDriver(NodeDriver):
         delete_port_list = ET.Element(
             'deletePortList',
             {'xmlns': TYPES_URN,
-             'id': self._port_list_to_port_list_id(ex_port_list)})
+             'id': self._port_list_to_port_list_id(ex_portlist)})
 
         response = self.connection.request_with_orgId_api_2(
             'network/deletePortList',

http://git-wip-us.apache.org/repos/asf/libcloud/blob/9e3c7da2/libcloud/test/compute/test_dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_dimensiondata.py b/libcloud/test/compute/test_dimensiondata.py
index a7bfa92..941784e 100644
--- a/libcloud/test/compute/test_dimensiondata.py
+++ b/libcloud/test/compute/test_dimensiondata.py
@@ -1541,56 +1541,56 @@ class DimensionDataTests(unittest.TestCase, TestCaseMixin):
             ex_ip_address_list='111ef78-4059-4bc1-b433-3f6ad698d111')
         self.assertTrue(success)
 
-    def test_ex_list_port_lists(self):
+    def test_ex_list_portlist(self):
         net_domain = self.driver.ex_list_network_domains()[0]
-        port_list = self.driver.ex_list_port_list(
+        portlist = self.driver.ex_list_portlist(
             ex_network_domain=net_domain)
-        self.assertTrue(isinstance(port_list, list))
-        self.assertEqual(len(port_list), 3)
-        self.assertTrue(isinstance(port_list[0].name, str))
-        self.assertTrue(isinstance(port_list[0].description, str))
-        self.assertTrue(isinstance(port_list[0].state, str))
-        self.assertTrue(isinstance(port_list[0].port_collection, list))
-        self.assertTrue(isinstance(port_list[0].port_collection[0].begin, str))
-        self.assertTrue(isinstance(port_list[0].port_collection[0].end, str))
-        self.assertTrue(isinstance(port_list[0].child_port_list_lists, list))
-        self.assertTrue(isinstance(port_list[0].child_port_list_lists[0].id,
+        self.assertTrue(isinstance(portlist, list))
+        self.assertEqual(len(portlist), 3)
+        self.assertTrue(isinstance(portlist[0].name, str))
+        self.assertTrue(isinstance(portlist[0].description, str))
+        self.assertTrue(isinstance(portlist[0].state, str))
+        self.assertTrue(isinstance(portlist[0].port_collection, list))
+        self.assertTrue(isinstance(portlist[0].port_collection[0].begin, str))
+        self.assertTrue(isinstance(portlist[0].port_collection[0].end, str))
+        self.assertTrue(isinstance(portlist[0].child_portlist_list, list))
+        self.assertTrue(isinstance(portlist[0].child_portlist_list[0].id,
                                    str))
-        self.assertTrue(isinstance(port_list[0].child_port_list_lists[0].name,
+        self.assertTrue(isinstance(portlist[0].child_portlist_list[0].name,
                                    str))
-        self.assertTrue(isinstance(port_list[0].create_time, str))
+        self.assertTrue(isinstance(portlist[0].create_time, str))
 
     def test_ex_get_port_list(self):
         net_domain = self.driver.ex_list_network_domains()[0]
 
-        port_list = self.driver.ex_list_port_list(
-            ex_network_domain=net_domain)[0]
-
-        port_list = self.driver.ex_get_port_list(
-            ex_port_list=port_list)
-        self.assertTrue(isinstance(port_list, DimensionDataPortList))
-
-        self.assertTrue(isinstance(port_list.name, str))
-        self.assertTrue(isinstance(port_list.description, str))
-        self.assertTrue(isinstance(port_list.state, str))
-        self.assertTrue(isinstance(port_list.port_collection, list))
-        self.assertTrue(isinstance(port_list.port_collection[0].begin, str))
-        self.assertTrue(isinstance(port_list.port_collection[0].end, str))
-        self.assertTrue(isinstance(port_list.child_port_list_lists, list))
-        self.assertTrue(isinstance(port_list.child_port_list_lists[0].id,
+        portlist_id = self.driver.ex_list_portlist(
+            ex_network_domain=net_domain)[0].id
+
+        portlist = self.driver.ex_get_portlist(
+            ex_portlist_id=portlist_id)
+        self.assertTrue(isinstance(portlist, DimensionDataPortList))
+
+        self.assertTrue(isinstance(portlist.name, str))
+        self.assertTrue(isinstance(portlist.description, str))
+        self.assertTrue(isinstance(portlist.state, str))
+        self.assertTrue(isinstance(portlist.port_collection, list))
+        self.assertTrue(isinstance(portlist.port_collection[0].begin, str))
+        self.assertTrue(isinstance(portlist.port_collection[0].end, str))
+        self.assertTrue(isinstance(portlist.child_portlist_list, list))
+        self.assertTrue(isinstance(portlist.child_portlist_list[0].id,
                                    str))
-        self.assertTrue(isinstance(port_list.child_port_list_lists[0].name,
+        self.assertTrue(isinstance(portlist.child_portlist_list[0].name,
                                    str))
-        self.assertTrue(isinstance(port_list.create_time, str))
+        self.assertTrue(isinstance(portlist.create_time, str))
 
-    def test_ex_get_port_list_STR(self):
+    def test_ex_get_portlist_STR(self):
         net_domain = self.driver.ex_list_network_domains()[0]
 
-        port_list = self.driver.ex_list_port_list(
+        portlist = self.driver.ex_list_portlist(
             ex_network_domain=net_domain)[0]
 
-        port_list = self.driver.ex_get_port_list(
-            ex_port_list=port_list.id)
+        port_list = self.driver.ex_get_portlist(
+            ex_portlist_id=portlist.id)
         self.assertTrue(isinstance(port_list, DimensionDataPortList))
 
         self.assertTrue(isinstance(port_list.name, str))
@@ -1599,14 +1599,14 @@ class DimensionDataTests(unittest.TestCase, TestCaseMixin):
         self.assertTrue(isinstance(port_list.port_collection, list))
         self.assertTrue(isinstance(port_list.port_collection[0].begin, str))
         self.assertTrue(isinstance(port_list.port_collection[0].end, str))
-        self.assertTrue(isinstance(port_list.child_port_list_lists, list))
-        self.assertTrue(isinstance(port_list.child_port_list_lists[0].id,
+        self.assertTrue(isinstance(port_list.child_portlist_list, list))
+        self.assertTrue(isinstance(port_list.child_portlist_list[0].id,
                                    str))
-        self.assertTrue(isinstance(port_list.child_port_list_lists[0].name,
+        self.assertTrue(isinstance(port_list.child_portlist_list[0].name,
                                    str))
         self.assertTrue(isinstance(port_list.create_time, str))
 
-    def test_ex_create_port_list_NOCHILDPORTLIST(self):
+    def test_ex_create_portlist_NOCHILDPORTLIST(self):
         name = "Test_Port_List"
         description = "Test Description"
 
@@ -1618,7 +1618,7 @@ class DimensionDataTests(unittest.TestCase, TestCaseMixin):
         port_collection = {port_1, port_2}
 
         # Create IP Address List
-        success = self.driver.ex_create_port_list(
+        success = self.driver.ex_create_portlist(
             ex_network_domain=net_domain, name=name,
             description=description,
             port_collection=port_collection
@@ -1626,7 +1626,7 @@ class DimensionDataTests(unittest.TestCase, TestCaseMixin):
 
         self.assertTrue(success)
 
-    def test_ex_create_port_list(self):
+    def test_ex_create_portlist(self):
         name = "Test_Port_List"
         description = "Test Description"
 
@@ -1644,16 +1644,16 @@ class DimensionDataTests(unittest.TestCase, TestCaseMixin):
         child_ports = {child_port_1, child_port_2}
 
         # Create IP Address List
-        success = self.driver.ex_create_port_list(
+        success = self.driver.ex_create_portlist(
             ex_network_domain=net_domain, name=name,
             description=description,
             port_collection=port_collection,
-            child_port_list_lists=child_ports
+            child_portlist_list=child_ports
         )
 
         self.assertTrue(success)
 
-    def test_ex_create_port_list_STR(self):
+    def test_ex_create_portlist_STR(self):
         name = "Test_Port_List"
         description = "Test Description"
 
@@ -1671,18 +1671,18 @@ class DimensionDataTests(unittest.TestCase, TestCaseMixin):
         child_ports_ids = {child_port_1.id, child_port_2.id}
 
         # Create IP Address List
-        success = self.driver.ex_create_port_list(
+        success = self.driver.ex_create_portlist(
             ex_network_domain=net_domain.id, name=name,
             description=description,
             port_collection=port_collection,
-            child_port_list_lists=child_ports_ids
+            child_portlist_list=child_ports_ids
         )
 
         self.assertTrue(success)
 
-    def test_ex_edit_port_list(self):
+    def test_ex_edit_portlist(self):
         net_domain = self.driver.ex_list_network_domains()[0]
-        port_list = self.driver.ex_list_port_list(net_domain)[0]
+        portlist = self.driver.ex_list_portlist(net_domain)[0]
 
         description = "Test Description"
 
@@ -1698,16 +1698,16 @@ class DimensionDataTests(unittest.TestCase, TestCaseMixin):
         child_ports = {child_port_1.id, child_port_2.id}
 
         # Create IP Address List
-        success = self.driver.ex_edit_port_list(
-            ex_port_list=port_list,
+        success = self.driver.ex_edit_portlist(
+            ex_portlist=portlist,
             description=description,
             port_collection=port_collection,
-            child_port_list_lists=child_ports
+            child_portlist_list=child_ports
         )
         self.assertTrue(success)
 
-    def test_ex_edit_port_list_STR(self):
-        port_list_id = "484174a2-ae74-4658-9e56-50fc90e086cf"
+    def test_ex_edit_portlist_STR(self):
+        portlist_id = "484174a2-ae74-4658-9e56-50fc90e086cf"
         description = "Test Description"
 
         port_1 = DimensionDataPort(begin='8080')
@@ -1722,28 +1722,28 @@ class DimensionDataTests(unittest.TestCase, TestCaseMixin):
         child_ports_ids = {child_port_1.id, child_port_2.id}
 
         # Create IP Address List
-        success = self.driver.ex_edit_port_list(
-            ex_port_list=port_list_id,
+        success = self.driver.ex_edit_portlist(
+            ex_portlist=portlist_id,
             description=description,
             port_collection=port_collection,
-            child_port_list_lists=child_ports_ids
+            child_portlist_list=child_ports_ids
         )
         self.assertTrue(success)
 
-    def test_ex_delete_port_list(self):
+    def test_ex_delete_portlist(self):
         net_domain = self.driver.ex_list_network_domains()[0]
-        port_list = self.driver.ex_list_port_list(net_domain)[0]
+        portlist = self.driver.ex_list_portlist(net_domain)[0]
 
-        success = self.driver.ex_delete_port_list(
-            ex_port_list=port_list)
+        success = self.driver.ex_delete_portlist(
+            ex_portlist=portlist)
         self.assertTrue(success)
 
-    def test_ex_delete_port_list_STR(self):
+    def test_ex_delete_portlist_STR(self):
         net_domain = self.driver.ex_list_network_domains()[0]
-        port_list = self.driver.ex_list_port_list(net_domain)[0]
+        portlist = self.driver.ex_list_portlist(net_domain)[0]
 
-        success = self.driver.ex_delete_port_list(
-            ex_port_list=port_list.id)
+        success = self.driver.ex_delete_portlist(
+            ex_portlist=portlist.id)
         self.assertTrue(success)
 
 


Mime
View raw message