libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [05/51] [abbrv] libcloud git commit: adding snapshot class to common/nttcis.py
Date Wed, 31 Oct 2018 03:11:16 GMT
adding snapshot class to common/nttcis.py


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

Branch: refs/heads/trunk
Commit: e49ef2bdd8c8f461fd3f80be6a95b7f48a706556
Parents: cdc27a6
Author: mitch <mitch.raful@itaas.dimensiondata.com>
Authored: Fri Aug 3 11:51:25 2018 -0400
Committer: mitch <mitch.raful@itaas.dimensiondata.com>
Committed: Fri Aug 3 11:51:25 2018 -0400

----------------------------------------------------------------------
 libcloud/common/nttcis.py                 |  41 ++++-
 libcloud/compute/drivers/dimensiondata.py |   2 +-
 libcloud/compute/drivers/nttcis.py        |   5 +-
 libcloud/drs/__init__.py                  |   0
 libcloud/drs/base.py                      |  38 ++++
 libcloud/drs/drivers/__init__.py          |   0
 libcloud/drs/drivers/nttcis.py            |  51 ++++++
 libcloud/drs/providers.py                 |  41 +++++
 libcloud/loadbalancer/drivers/nttcis.py   |   4 +-
 libcloud/loadbalancer/providers.py        |   2 +-
 tests/conftest.py                         |  12 +-
 tests/libtest.py                          | 235 +++++++++++++++++++++++--
 12 files changed, 403 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/e49ef2bd/libcloud/common/nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/common/nttcis.py b/libcloud/common/nttcis.py
index 7215139..4506dad 100644
--- a/libcloud/common/nttcis.py
+++ b/libcloud/common/nttcis.py
@@ -386,10 +386,10 @@ class NttCisConnection(ConnectionUserAndKey):
     oldest_api_version = '2.2'
 
     # Latest version supported
-    latest_api_version = '2.4'
+    latest_api_version = '2.7'
 
     # Default api version
-    active_api_version = '2.4'
+    active_api_version = '2.7'
 
     _orgId = None
     responseCls = NttCisResponse
@@ -837,6 +837,31 @@ class NttCisServerVMWareTools(object):
                 % (self.status, self.version_status, self.api_version))
 
 
+class NttCisSnapshot(object):
+    """
+    NTTCIS Class representing server snapshots
+    """
+    def __init__(self, server_id, service_plan, id=None, window_id=None, start_time=None,
+                 state=None, end_time=None, type=None, expiry_time=None, action=None):
+        self.server_id = server_id
+        self.service_plan = service_plan
+        self.id = id
+        self.window_id = window_id
+        self.start_time = start_time
+        self.end_time = end_time
+        self.state = state
+        self.end_time = end_time
+        self.type = type
+        self.expiry_time = expiry_time
+        self.action = action
+
+    def create_snapshot(self):
+        pass
+
+
+
+
+
 class NttCisFirewallRule(object):
     """
     NTTCIS Firewall Rule for a network domain
@@ -1170,7 +1195,7 @@ class NttCisVirtualListener(object):
                    self.status, self.ip))
 
 
-class NttCisaDefaultHealthMonitor(object):
+class NttCisDefaultHealthMonitor(object):
     """
     A default health monitor for a VIP (node, pool or listener)
     """
@@ -1200,7 +1225,7 @@ class NttCisaDefaultHealthMonitor(object):
                 % (self.id, self.name))
 
 
-class NttCisaPersistenceProfile(object):
+class NttCisPersistenceProfile(object):
     """
     Each Persistence Profile declares the combination of Virtual Listener
     type and protocol with which it is
@@ -1261,7 +1286,7 @@ class NttCisDefaultiRule(object):
                 % (self.id, self.name))
 
 
-class NttCisaVirtualListenerCompatibility(object):
+class NttCisVirtualListenerCompatibility(object):
     """
     A compatibility preference for a persistence profile or iRule
     specifies which virtual listener types this profile or iRule can be
@@ -1359,11 +1384,11 @@ class NttCisBackupClient(object):
         self.running_job = running_job
 
     def __repr__(self):
-        return (('<NttCisaBackupClient: id=%s>')
+        return (('<NttCisBackupClient: id=%s>')
                 % (self.id))
 
 
-class NttCisaBackupClientAlert(object):
+class NttCisBackupClientAlert(object):
     """
     An alert for a backup client
     """
@@ -1753,7 +1778,7 @@ class NttCisPort(object):
 
     def __init__(self, begin, end=None):
         """
-        Initialize an instance of :class:`NttCisaPort`
+        Initialize an instance of :class:`NttCisPort`
 
         :param begin: Port Number Begin
         :type  begin: ``str``

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e49ef2bd/libcloud/compute/drivers/dimensiondata.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py
index cc223c5..66969fb 100644
--- a/libcloud/compute/drivers/dimensiondata.py
+++ b/libcloud/compute/drivers/dimensiondata.py
@@ -3067,7 +3067,7 @@ class DimensionDataNodeDriver(NodeDriver):
             % (datacenter_id, start_date, end_date))
         return self._format_csv(result.response)
 
-    def ex_list_ip_address_list(self, ex_network_domain):
+    def ex_list_ip_address_list(self, ex_network_domain: object) -> object:
         """
         List IP Address List by network domain ID specified
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e49ef2bd/libcloud/compute/drivers/nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/nttcis.py b/libcloud/compute/drivers/nttcis.py
index 8a2fa38..7f2ddca 100644
--- a/libcloud/compute/drivers/nttcis.py
+++ b/libcloud/compute/drivers/nttcis.py
@@ -732,7 +732,8 @@ class NttCisNodeDriver(NodeDriver):
                    ex_ipv6=None, ex_ipv4=None, ex_vlan=None,
                    ex_image=None, ex_deployed=None,
                    ex_started=None, ex_state=None,
-                   ex_network=None, ex_network_domain=None):
+                   ex_network=None, ex_network_domain=None,
+                   ex_snaphots=None):
         """
         List nodes deployed for your organization.
 
@@ -3067,7 +3068,7 @@ class NttCisNodeDriver(NodeDriver):
             % (datacenter_id, start_date, end_date))
         return self._format_csv(result.response)
 
-    def ex_list_ip_address_list(self, ex_network_domain):
+    def ex_list_ip_address_list(self, ex_network_domain:NttCisIpAddressList) -> object:
         """
         List IP Address List by network domain ID specified
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e49ef2bd/libcloud/drs/__init__.py
----------------------------------------------------------------------
diff --git a/libcloud/drs/__init__.py b/libcloud/drs/__init__.py
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e49ef2bd/libcloud/drs/base.py
----------------------------------------------------------------------
diff --git a/libcloud/drs/base.py b/libcloud/drs/base.py
new file mode 100644
index 0000000..520254c
--- /dev/null
+++ b/libcloud/drs/base.py
@@ -0,0 +1,38 @@
+class DRSConsistencyGroup(object):
+    """
+    Provide a common interface for handling Load Balancers.
+    """
+
+    def __init__(self, id, name, description, journalSizeGB,  serverPairSourceServerId, serverPairtargetServerId,
+                 driver, extra=None):
+        """
+        :param id: Load balancer ID.
+        :type id: ``str``
+
+        :param name: Load balancer name.
+        :type name: ``str``
+
+        :param state: State this loadbalancer is in.
+        :type state: :class:`libcloud.loadbalancer.types.State`
+
+        :param ip: IP address of this loadbalancer.
+        :type ip: ``str``
+
+        :param port: Port of this loadbalancer.
+        :type port: ``int``
+
+        :param driver: Driver this loadbalancer belongs to.
+        :type driver: :class:`.Driver`
+
+        :param extra: Provider specific attributes. (optional)
+        :type extra: ``dict``
+        """
+        self.id = str(id) if id else None
+        self.name = name
+        self.description = description
+        self.journalSizeGB = journalSizeGB
+
+        self.serverPairSourceServerId = serverPairSourceServerId
+        self.serverPairtargetServerId = serverPairtargetServerId
+        self.driver = driver
+        self.extra = extra or {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e49ef2bd/libcloud/drs/drivers/__init__.py
----------------------------------------------------------------------
diff --git a/libcloud/drs/drivers/__init__.py b/libcloud/drs/drivers/__init__.py
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e49ef2bd/libcloud/drs/drivers/nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/drs/drivers/nttcis.py b/libcloud/drs/drivers/nttcis.py
new file mode 100644
index 0000000..e0c94a6
--- /dev/null
+++ b/libcloud/drs/drivers/nttcis.py
@@ -0,0 +1,51 @@
+from libcloud.utils.py3 import ET
+from libcloud.common.nttcis import NttCisConnection
+from libcloud.common.nttcis import NttCisPool
+from libcloud.common.nttcis import NttCisPoolMember
+from libcloud.common.nttcis import NttCisVirtualListener
+from libcloud.common.nttcis import NttCisVIPNode
+from libcloud.common.nttcis import NttCisDefaultHealthMonitor
+from libcloud.common.nttcis import NttCisPersistenceProfile
+from libcloud.common.nttcis import \
+    NttCisVirtualListenerCompatibility
+from libcloud.common.nttcis import NttCisDefaultiRule
+from libcloud.common.nttcis import API_ENDPOINTS
+from libcloud.common.nttcis import DEFAULT_REGION
+from libcloud.common.nttcis import TYPES_URN
+from libcloud.utils.misc import reverse_dict
+from libcloud.utils.xml import fixxpath, findtext, findall
+from libcloud.loadbalancer.types import State
+from libcloud.loadbalancer.base import Algorithm, Driver, LoadBalancer
+from libcloud.loadbalancer.base import Member
+from libcloud.loadbalancer.types import Provider
+
+
+class NttCisDRSDriver(Driver):
+    """
+    NttCis node driver.
+    """
+
+    selected_region = None
+    connectionCls = NttCisConnection
+    name = 'NTTC-CIS DRS Consistencty Groups'
+    website = 'https://cloud.nttcis.com/'
+    type = Provider.NTTCIS
+    api_version = 1.0
+
+    network_domain_id = None
+
+    def __init__(self, key, secret=None, secure=True, host=None, port=None,
+                 api_version=None, region=DEFAULT_REGION, **kwargs):
+
+        if region not in API_ENDPOINTS and host is None:
+            raise ValueError(
+                'Invalid region: %s, no host specified' % (region))
+        if region is not None:
+            self.selected_region = API_ENDPOINTS[region]
+
+        super(NttCisDRSDriver, self).__init__(key=key, secret=secret,
+                                                    secure=secure, host=host,
+                                                    port=port,
+                                                    api_version=api_version,
+                                                    region=region,
+                                                    **kwargs)

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e49ef2bd/libcloud/drs/providers.py
----------------------------------------------------------------------
diff --git a/libcloud/drs/providers.py b/libcloud/drs/providers.py
new file mode 100644
index 0000000..d214d17
--- /dev/null
+++ b/libcloud/drs/providers.py
@@ -0,0 +1,41 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from libcloud.loadbalancer.types import Provider
+from libcloud.loadbalancer.types import OLD_CONSTANT_TO_NEW_MAPPING
+from libcloud.common.providers import get_driver as _get_provider_driver
+from libcloud.common.providers import set_driver as _set_provider_driver
+
+__all__ = [
+    "Provider",
+    "DRIVERS",
+    "get_driver",
+]
+
+DRIVERS = {
+    Provider.NTTCIS:
+    ('libcloud.drs.drivers.nttcis', 'NttCisDRSDriver'),
+}
+
+
+def get_driver(provider):
+    deprecated_constants = OLD_CONSTANT_TO_NEW_MAPPING
+    return _get_provider_driver(drivers=DRIVERS, provider=provider,
+                                deprecated_constants=deprecated_constants)
+
+
+def set_driver(provider, module, klass):
+    return _set_provider_driver(drivers=DRIVERS, provider=provider,
+                                module=module, klass=klass)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e49ef2bd/libcloud/loadbalancer/drivers/nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/loadbalancer/drivers/nttcis.py b/libcloud/loadbalancer/drivers/nttcis.py
index 8cb723b..5584b52 100644
--- a/libcloud/loadbalancer/drivers/nttcis.py
+++ b/libcloud/loadbalancer/drivers/nttcis.py
@@ -42,9 +42,9 @@ class NttCisLBDriver(Driver):
 
     selected_region = None
     connectionCls = NttCisConnection
-    name = 'Dimension Data Load Balancer'
+    name = 'NTTC-CIS Load Balancer'
     website = 'https://cloud.nttcis.com/'
-    type = Provider.DIMENSIONDATA
+    type = Provider.NTTCIS
     api_version = 1.0
 
     network_domain_id = None

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e49ef2bd/libcloud/loadbalancer/providers.py
----------------------------------------------------------------------
diff --git a/libcloud/loadbalancer/providers.py b/libcloud/loadbalancer/providers.py
index 967cc62..fe56779 100644
--- a/libcloud/loadbalancer/providers.py
+++ b/libcloud/loadbalancer/providers.py
@@ -48,7 +48,7 @@ DRIVERS = {
     Provider.ALIYUN_SLB:
     ('libcloud.loadbalancer.drivers.slb', 'SLBDriver'),
     Provider.NTTCIS:
-    ('libcloud.loadbalancer.drivers.nttcis', 'NttCisNodeDriver'),
+    ('libcloud.loadbalancer.drivers.nttcis', 'NttCisLBDriver'),
 }
 
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e49ef2bd/tests/conftest.py
----------------------------------------------------------------------
diff --git a/tests/conftest.py b/tests/conftest.py
index e6bbeb7..f5a48f8 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -3,8 +3,14 @@ import libcloud
 
 
 @pytest.fixture(scope="module")
-def driver():
+def compute_driver():
     cls = libcloud.get_driver(libcloud.DriverType.COMPUTE, libcloud.DriverType.COMPUTE.NTTCIS)
-    driver = cls('mitchgeo-test', 'Snmpv2c!', region='dd-eu')
-    return driver
+    compute_driver = cls('mitchgeo-test', 'Snmpv2c!', region='dd-eu')
+    return compute_driver
 
+
+@pytest.fixture(scope="module")
+def lbdriver():
+    cls = libcloud.get_driver(libcloud.DriverType.LOADBALANCER, libcloud.DriverType.LOADBALANCER.NTTCIS)
+    lbdriver = cls('mitchgeo-test', 'Snmpv2c!', region='dd-eu')
+    return lbdriver
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/libcloud/blob/e49ef2bd/tests/libtest.py
----------------------------------------------------------------------
diff --git a/tests/libtest.py b/tests/libtest.py
index cba785c..e354944 100644
--- a/tests/libtest.py
+++ b/tests/libtest.py
@@ -1,35 +1,248 @@
 import pytest
 import libcloud
+from libcloud import loadbalancer
 
 
-def test_list_node_all(driver):
-    nodes = driver.list_nodes()
+def test_list_node_all(compute_driver):
+    nodes = compute_driver.list_nodes()
     for node in nodes:
         print(node.extra['networkDomainId'], node.extra['datacenterId'], node.uuid, node.state,
node.name, node.extra['cpu'],
-              [disk for disk in node.extra['disks']], node.extra['memoryMb'], node.extra['OS_displayName'],
node.extra['ipv6'])
+              [disk for disk in node.extra['disks']], node.extra['memoryMb'], node.extra['OS_displayName'],
+              node.private_ips, node.extra['ipv6'])
     assert isinstance(nodes, list) and len(nodes) > 0
 
 
-def test_list_node_location(driver):
-    nodes = driver.list_nodes(ex_location='EU7')
+def test_list_node_location(compute_driver):
+    nodes = compute_driver.list_nodes(ex_location='EU6')
     print()
     for node in nodes:
         print(node.extra['networkDomainId'], node.extra['datacenterId'], node.uuid, node.state,
node.name, node.extra['cpu'],
-              [disk for disk in node.extra['disks']], node.extra['memoryMb'], node.extra['OS_displayName'],
node.extra['ipv6'])
+              [disk for disk in node.extra['disks']], node.extra['memoryMb'], node.extra['OS_displayName'],
+              node.private_ips, node.extra['ipv6'])
     assert isinstance(nodes, list) and len(nodes) > 0
 
 
-def test_list_node_started(driver):
-    nodes = driver.list_nodes(ex_started='true')
+def test_list_node_name(compute_driver):
+    nodes = compute_driver.list_nodes(ex_name='sdk_server_1')
     print()
     for node in nodes:
         print(node.extra['networkDomainId'], node.extra['datacenterId'], node.uuid, node.state,
node.name, node.extra['cpu'],
-              [disk for disk in node.extra['disks']], node.extra['memoryMb'], node.extra['OS_displayName'],
node.extra['ipv6'])
+              [disk for disk in node.extra['disks']], node.extra['memoryMb'], node.extra['OS_displayName'],
+              node.private_ips, node.extra['ipv6'])
     assert isinstance(nodes, list) and len(nodes) > 0
 
 
-def test_images(driver):
-    images = driver.list_images()
+def test_list_node_ipv6(compute_driver):
+    nodes = compute_driver.list_nodes(ex_ipv6='2a00:47c0:111:1331:6140:e432:729b:eef6')
+    print()
+    for node in nodes:
+        print(node.extra['networkDomainId'], node.extra['datacenterId'], node.uuid, node.state,
node.name, node.extra['cpu'],
+              [disk for disk in node.extra['disks']], node.extra['memoryMb'], node.extra['OS_displayName'],
+              node.private_ips, node.extra['ipv6'])
+    assert isinstance(nodes, list) and len(nodes) > 0
+
+
+def test_list_node_ipv4(compute_driver):
+    nodes = compute_driver.list_nodes(ex_ipv4='10.1.1.6')
+    print()
+    for node in nodes:
+        print(node.extra['networkDomainId'], node.extra['datacenterId'], node.uuid, node.state,
node.name, node.extra['cpu'],
+              [disk for disk in node.extra['disks']], node.extra['memoryMb'], node.extra['OS_displayName'],
+              node.private_ips, node.extra['ipv6'])
+    assert isinstance(nodes, list) and len(nodes) > 0
+
+
+"""
+    requires retrieving vlan Id first
+"""
+def test_list_node_vlan(compute_driver):
+    nodes = compute_driver.list_nodes(ex_vlan='eb05a24e-85a6-46e3-a7c9-f1765737476d')
+    print()
+    for node in nodes:
+        print(node.extra['networkDomainId'], node.extra['datacenterId'], node.uuid, node.state,
node.name, node.extra['cpu'],
+              [disk for disk in node.extra['disks']], node.extra['memoryMb'], node.extra['OS_displayName'],
+              node.private_ips, node.extra['ipv6'])
+    assert isinstance(nodes, list) and len(nodes) > 0
+
+
+"""
+Libcloud docs say this works but it is not in our API docs
+def test_list_node_image(compute_driver):
+    nodes = compute_driver.list_nodes(ex_image='46096745-5a89-472b-9b3b-89a6a07bb60b')
+    print()
+    for node in nodes:
+        print(node.extra['networkDomainId'], node.extra['datacenterId'], node.uuid, node.state,
node.name, node.extra['cpu'],
+              [disk for disk in node.extra['disks']], node.extra['memoryMb'], node.extra['OS_displayName'],
+              node.private_ips, node.extra['ipv6'])
+    assert isinstance(nodes, list) and len(nodes) > 0
+"""
+
+
+def test_list_node_started(compute_driver):
+    nodes = compute_driver.list_nodes(ex_started='true')
+    print()
+    for node in nodes:
+        print(node.extra['networkDomainId'], node.extra['datacenterId'], node.uuid, node.state,
node.name, node.extra['cpu'],
+              [disk for disk in node.extra['disks']], node.extra['memoryMb'], node.extra['OS_displayName'],
+              node.private_ips, node.extra['ipv6'])
+    assert isinstance(nodes, list) and len(nodes) > 0
+
+
+def test_list_node_deployed(compute_driver):
+    nodes = compute_driver.list_nodes(ex_deployed='true')
+    print()
+    for node in nodes:
+        print(node.extra['networkDomainId'], node.extra['datacenterId'], node.uuid, node.state,
node.name, node.extra['cpu'],
+              [disk for disk in node.extra['disks']], node.extra['memoryMb'], node.extra['OS_displayName'],
+              node.private_ips, node.extra['ipv6'])
+    assert isinstance(nodes, list) and len(nodes) > 0
+
+
+def test_list_node_state(compute_driver):
+    nodes = compute_driver.list_nodes(ex_state='NORMAL')
+    print()
+    for node in nodes:
+        print(node.extra['networkDomainId'], node.extra['datacenterId'], node.uuid, node.state,
node.name, node.extra['cpu'],
+              [disk for disk in node.extra['disks']], node.extra['memoryMb'], node.extra['OS_displayName'],
+              node.private_ips, node.extra['ipv6'])
+    assert isinstance(nodes, list) and len(nodes) > 0
+
+
+def test_list_netwokr_domain_id(compute_driver):
+    nodes = compute_driver.list_nodes(ex_network_domain='6aafcf08-cb0b-432c-9c64-7371265db086')
+    print()
+    for node in nodes:
+        print(node.extra['networkDomainId'], node.extra['datacenterId'], node.uuid, node.state,
node.name, node.extra['cpu'],
+              [disk for disk in node.extra['disks']], node.extra['memoryMb'], node.extra['OS_displayName'],
+              node.private_ips, node.extra['ipv6'])
+    assert isinstance(nodes, list) and len(nodes) > 0
+
+
+def test_list_vlans(compute_driver):
+    vlans = compute_driver.ex_list_vlans()
+    print()
+    for vlan in vlans:
+        print(vlan.id, vlan.name, vlan.location.id, vlan.ipv4_gateway, vlan.ipv6_gateway,
vlan.ipv6_range_address, vlan.ipv6_range_size,
+              vlan.private_ipv4_range_address, vlan.private_ipv4_range_size, vlan.status)
+    assert isinstance(vlans, list) and len(vlans) > 0
+
+
+def test_list_vlan(compute_driver):
+    vlan = compute_driver.ex_get_vlan('eb05a24e-85a6-46e3-a7c9-f1765737476d')
+    print()
+    print(vlan.id, vlan.name, vlan.location.id, vlan.ipv4_gateway, vlan.ipv6_gateway, vlan.ipv6_range_address,
vlan.ipv6_range_size,
+          vlan.private_ipv4_range_address, vlan.private_ipv4_range_size, vlan.status)
+    assert vlan.name == 'sdk_vlan1'
+
+
+def test_list_firewall_rules(compute_driver):
+    rules = compute_driver.ex_list_firewall_rules('6aafcf08-cb0b-432c-9c64-7371265db086')
+    print()
+    for rule in rules:
+        print("id {}, name {}, action {}. location {}, ip ver {}, protocol {}, any ip {},
ip {}, prefix {},"
+              " port range {} {} , src address {}, src port list {}, dest. any__ip {}, dest
address {}, "
+              "dest prefix {}, dest port range {} {}, dest address list id {}"
+              ", dest port list id {}".format(
+                                              rule.id, rule.name, rule.action,
+                                              rule.location.name, rule.ip_version,
+                                              rule.protocol, rule.source.any_ip,
+                                              rule.source.ip_address,
+                                              rule.source.ip_prefix_size,
+                                              rule.source.port_begin, rule.source.port_end,
+                                              rule.source.address_list_id,
+                                              rule.source.port_list_id,
+                                              rule.destination.any_ip,
+                                              rule.destination.ip_address,
+                                              rule.destination.ip_prefix_size,
+                                              rule.destination.port_begin,
+                                              rule.destination.port_end,
+                                              rule.destination.address_list_id,
+                                              rule.destination.port_list_id,
+                                              ))
+
+
+def test_list_address_lists(compute_driver):
+    address_lists = compute_driver.ex_list_ip_address_list('6aafcf08-cb0b-432c-9c64-7371265db086')
+    print()
+    for address_list in address_lists:
+        print(address_list)
+    assert isinstance(address_lists, list) and len(address_lists) > 0
+
+
+def test_list_port_lists(compute_driver):
+    port_lists = compute_driver.ex_list_portlist('6aafcf08-cb0b-432c-9c64-7371265db086')
+    print()
+    for portlist in port_lists:
+        print(portlist)
+    assert isinstance(port_lists, list) and len(port_lists) > 0
+
+
+def test_list_nat_rules(compute_driver):
+    nat_rules = compute_driver.ex_list_nat_rules(compute_driver.ex_get_network_domain('6aafcf08-cb0b-432c-9c64-7371265db086'))
+    print()
+    for nat_rule in nat_rules:
+        print(nat_rule, nat_rule.external_ip, nat_rule.internal_ip)
+    assert isinstance(nat_rules, list) and len(nat_rules) > 0
+
+
+def test_list_balancers(lbdriver):
+    balancers = lbdriver.list_balancers(ex_network_domain_id="6aafcf08-cb0b-432c-9c64-7371265db086")
+    print()
+    for balancer in balancers:
+        print(balancer.id, balancer.ip, balancer.name, balancer.port)
+    assert isinstance(balancers, list)
+
+
+def test_get_listener(lbdriver):
+    listener = lbdriver.get_balancer("59abe126-2bba-48ac-8616-1aba51aabac5")
+    print()
+    print(listener.ip, listener.name, listener.port)
+    assert listener.ip == '168.128.13.127'
+
+
+def test_vip_nodes(lbdriver):
+    vips = lbdriver.ex_get_nodes("6aafcf08-cb0b-432c-9c64-7371265db086")
+    print()
+    for vip in vips:
+        print(vip, vip.ip, vip.name)
+    assert isinstance(vips, list) and len(vips) > 0
+
+
+def test_list_lb_pools(lbdriver):
+    pools = lbdriver.ex_get_pools(ex_network_domain_id="6aafcf08-cb0b-432c-9c64-7371265db086")
+    print()
+    for pool in pools:
+        print(pool.id, pool.name, pool.description, pool.health_monitor_id, pool.load_balance_method,
pool.slow_ramp_time, pool.status)
+    assert isinstance(pools, list)
+
+
+def test_list_lb_pool_members(lbdriver):
+    balancer = lbdriver.get_balancer("59abe126-2bba-48ac-8616-1aba51aabac5")
+    pool_members = lbdriver.balancer_list_members(balancer)
+    print()
+    for pool_member in pool_members:
+        print(pool_member)
+    assert isinstance(pool_members, list)
+
+
+def test_get_pool_member(lbdriver):
+    pool_member = lbdriver.ex_get_pool_member("9382e488-7f95-4db0-b2de-0b807aab825b")
+    print()
+    print(pool_member.ip, pool_member.port, pool_member.name)
+    assert pool_member.ip == '10.1.1.8'
+
+
+def test_get_node(lbdriver):
+    node = lbdriver.ex_get_node("5c647a74-d181-4ed8-82d3-55ae443a06dd")
+    print()
+    print(node.name, node.ip, node.connection_limit, node.connection_rate_limit)
+    assert isinstance(node, object)
+
+def test_sap_shots(compute_driver):
+    pass
+
+def test_images(compute_driver):
+    images = compute_driver.list_images()
     print()
     print(images)
     assert isinstance(images, list) and len(images) > 0


Mime
View raw message