You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by an...@apache.org on 2018/12/19 05:34:03 UTC
[01/21] libcloud git commit: removed indent from docstring of
NttCisDRSDriver
Repository: libcloud
Updated Branches:
refs/heads/trunk 776c36448 -> 6ae3a29ba
removed indent from docstring of NttCisDRSDriver
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/2c5b5cfc
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/2c5b5cfc
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/2c5b5cfc
Branch: refs/heads/trunk
Commit: 2c5b5cfc16e14a29eff8f3aab37aae4e1763c716
Parents: 99b7bda
Author: mitch <mi...@itaas.dimensiondata.com>
Authored: Tue Nov 13 13:32:42 2018 -0500
Committer: mitch <mi...@itaas.dimensiondata.com>
Committed: Tue Nov 13 13:32:42 2018 -0500
----------------------------------------------------------------------
libcloud/drs/drivers/nttcis.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/2c5b5cfc/libcloud/drs/drivers/nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/drs/drivers/nttcis.py b/libcloud/drs/drivers/nttcis.py
index c5695d1..cc1add8 100644
--- a/libcloud/drs/drivers/nttcis.py
+++ b/libcloud/drs/drivers/nttcis.py
@@ -116,7 +116,7 @@ class NttCisDRSDriver(DRSDriver):
"""
Functions takes a named parameter that must be one of the following
:param params: A dictionary composed of one of the following keys
- and a value
+ and a value
* target_data_center_id=
* source_network_domain_id=
* target_network_domain_id=
[07/21] libcloud git commit: added tests for fail create and fail
failover with invalid status
Posted by an...@apache.org.
added tests for fail create and fail failover with invalid status
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/4cdc28d0
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/4cdc28d0
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/4cdc28d0
Branch: refs/heads/trunk
Commit: 4cdc28d0c55c64cde3c5e9acbb71781bc593b025
Parents: facbea2
Author: mitch <mi...@itaas.dimensiondata.com>
Authored: Sun Dec 2 18:44:59 2018 -0500
Committer: mitch <mi...@itaas.dimensiondata.com>
Committed: Sun Dec 2 18:44:59 2018 -0500
----------------------------------------------------------------------
.../drs_fail_create_consistency_group.xml | 6 ++++
.../fixtures/nttcis/drs_initiate_failover.xml | 6 ++++
.../fixtures/nttcis/drs_invalid_status.xml | 6 ++++
libcloud/test/compute/test_nttcis.py | 32 ++++++++++++++++++++
4 files changed, 50 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/4cdc28d0/libcloud/test/compute/fixtures/nttcis/drs_fail_create_consistency_group.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/nttcis/drs_fail_create_consistency_group.xml b/libcloud/test/compute/fixtures/nttcis/drs_fail_create_consistency_group.xml
new file mode 100644
index 0000000..6ab6fa6
--- /dev/null
+++ b/libcloud/test/compute/fixtures/nttcis/drs_fail_create_consistency_group.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response xmlns="urn:didata.com:api:cloud:types" requestId="na_20181202T181715908-0500_f5fe1a96-ba61-449a-a33f-36b7d92375c1">
+ <operation>CREATE_CONSISTENCY_GROUP</operation>
+ <responseCode>NAME_NOT_UNIQUE</responseCode>
+ <message>Another Consistency Group named 'sdk_test2_cg' already exists.</message>
+</response>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/4cdc28d0/libcloud/test/compute/fixtures/nttcis/drs_initiate_failover.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/nttcis/drs_initiate_failover.xml b/libcloud/test/compute/fixtures/nttcis/drs_initiate_failover.xml
new file mode 100644
index 0000000..28f52e8
--- /dev/null
+++ b/libcloud/test/compute/fixtures/nttcis/drs_initiate_failover.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response xmlns="urn:didata.com:api:cloud:types" requestId="na_20181202T123146961-0500_c16e0e02-1ba2-4baf-9adb-55e850cfa2d8">
+ <operation>INITIATE_FAILOVER</operation>
+ <responseCode>IN_PROGRESS</responseCode>
+ <message>Request to Initiate Failover has been accepted. Please use appropriate Get or List API for status.</message>
+</response>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/4cdc28d0/libcloud/test/compute/fixtures/nttcis/drs_invalid_status.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/nttcis/drs_invalid_status.xml b/libcloud/test/compute/fixtures/nttcis/drs_invalid_status.xml
new file mode 100644
index 0000000..e707d85
--- /dev/null
+++ b/libcloud/test/compute/fixtures/nttcis/drs_invalid_status.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response xmlns="urn:didata.com:api:cloud:types" requestId="na_20181202T120424113-0500_b4d3b67b-08f4-432b-8e88-48625180ff32">
+ <operation>INITIATE_FAILOVER</operation>
+ <responseCode>INVALID_STATUS</responseCode>
+ <message>You cannot Initiate Failover because Consistency Group with id 195a426b-4559-4c79-849e-f22cdf2bfb6e is not in PREVIEWING_SNAPSHOT Operation Status.</message>
+</response>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/4cdc28d0/libcloud/test/compute/test_nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_nttcis.py b/libcloud/test/compute/test_nttcis.py
index cbc4fdb..2187b97 100644
--- a/libcloud/test/compute/test_nttcis.py
+++ b/libcloud/test/compute/test_nttcis.py
@@ -1920,6 +1920,20 @@ def test_stop_drs_snapshot_preivew(driver):
assert result is True
+def test_start_drs_failover_invalid_status(driver):
+ NttCisMockHttp.type = "INVALID_STATUS"
+ cg_id = "195a426b-4559-4c79-849e-f22cdf2bfb6e"
+ with pytest.raises(NttCisAPIException) as excinfo:
+ result = driver.initiate_drs_failover(cg_id)
+ assert "INVALID_STATUS" in excinfo.value.code
+
+
+def test_initiate_drs_failover(driver):
+ cg_id = "195a426b-4559-4c79-849e-f22cdf2bfb6e"
+ result = driver.initiate_drs_failover(cg_id)
+ assert result is True
+
+
class InvalidRequestError(Exception):
def __init__(self, tag):
super(InvalidRequestError, self).__init__("Invalid Request - %s" % tag)
@@ -1964,6 +1978,10 @@ class NttCisMockHttp(MockHttp):
body = self.fixtures.load('oec_0_9_myaccount.xml')
return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+ def _oec_0_9_myaccount_INVALID_STATUS(self, method, url, body, headers):
+ body = self.fixtures.load('oec_0_9_myaccount.xml')
+ return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation(self, method, url, body, headers):
body = self.fixtures.load(
'networkWithLocation.xml')
@@ -3270,3 +3288,17 @@ class NttCisMockHttp(MockHttp):
"drs_stop_failover_preview.xml"
)
return httplib.OK, body, {}, httplib.responses[httplib.OK]
+
+ def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_initiateFailover_INVALID_STATUS(
+ self, method, url, body, headers):
+ body = self.fixtures.load(
+ "drs_invalid_status.xml"
+ )
+ return httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]
+
+ def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_initiateFailover(
+ self, method, url, body, headers):
+ body = self.fixtures.load(
+ "drs_initiate_failover.xml"
+ )
+ return httplib.OK, body, {}, httplib.responses[httplib.OK]
[16/21] libcloud git commit: Fixed lint issues
Posted by an...@apache.org.
Fixed lint issues
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/d20f40bd
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/d20f40bd
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/d20f40bd
Branch: refs/heads/trunk
Commit: d20f40bdf5d243a2fd1a5a097635c8f84905c317
Parents: cf27a09
Author: mitch <mi...@itaas.dimensiondata.com>
Authored: Tue Dec 18 17:47:57 2018 -0500
Committer: mitch <mi...@itaas.dimensiondata.com>
Committed: Tue Dec 18 17:47:57 2018 -0500
----------------------------------------------------------------------
libcloud/compute/drivers/nttcis.py | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/d20f40bd/libcloud/compute/drivers/nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/nttcis.py b/libcloud/compute/drivers/nttcis.py
index 2b86fda..bf17c84 100644
--- a/libcloud/compute/drivers/nttcis.py
+++ b/libcloud/compute/drivers/nttcis.py
@@ -4651,8 +4651,8 @@ class NttCisNodeDriver(NodeDriver):
# DRS methods
def ex_create_consistency_group(self, name, journal_size_gb,
- source_server_id, target_server_id,
- description=None):
+ source_server_id, target_server_id,
+ description=None):
"""
Create a consistency group
@@ -4727,8 +4727,8 @@ class NttCisNodeDriver(NodeDriver):
return cg
def ex_list_consistency_group_snapshots(self, consistency_group_id,
- create_time_min=None,
- create_time_max=None):
+ create_time_min=None,
+ create_time_max=None):
"""
Optional parameters identify the date of creation of Consistency Group
snapshots in *XML Schema (XSD) date time format. Best used as a
@@ -4798,7 +4798,8 @@ class NttCisNodeDriver(NodeDriver):
response_code = findtext(response, 'responseCode', TYPES_URN)
return response_code in ['IN_PROGRESS', 'OK']
- def ex_start_drs_failover_preview(self, consistency_group_id, snapshot_id):
+ def ex_start_drs_failover_preview(self, consistency_group_id,
+ snapshot_id):
"""
Brings a Consistency Group into PREVIEWING_SNAPSHOT mode
[10/21] libcloud git commit: Changed typo. Added pythoh-dateutil to
tox.
Posted by an...@apache.org.
Changed typo. Added pythoh-dateutil to tox.
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/46096c4e
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/46096c4e
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/46096c4e
Branch: refs/heads/trunk
Commit: 46096c4ef4a75d55f86c801faa07a0e613d5a4fc
Parents: d2f933c
Author: mitch <mi...@itaas.dimensiondata.com>
Authored: Tue Dec 4 22:40:35 2018 -0500
Committer: mitch <mi...@itaas.dimensiondata.com>
Committed: Tue Dec 4 22:40:35 2018 -0500
----------------------------------------------------------------------
libcloud/common/nttcis.py | 3 +--
libcloud/test/compute/test_nttcis.py | 9 +--------
tox.ini | 2 ++
3 files changed, 4 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/46096c4e/libcloud/common/nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/common/nttcis.py b/libcloud/common/nttcis.py
index 3232abf..9b648ac 100644
--- a/libcloud/common/nttcis.py
+++ b/libcloud/common/nttcis.py
@@ -17,7 +17,7 @@ NTTCIS Common Components
"""
import xml.etree.ElementTree as etree
import re
-from functools import wraps, total_ordering
+from functools import wraps
from copy import deepcopy
from base64 import b64encode
from time import sleep
@@ -2095,7 +2095,6 @@ def processor(mapping, name=None):
return process(mapping)
-@total_ordering
def class_factory(cls_name, attrs):
"""
This class takes a name and a dictionary to create a class.
http://git-wip-us.apache.org/repos/asf/libcloud/blob/46096c4e/libcloud/test/compute/test_nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_nttcis.py b/libcloud/test/compute/test_nttcis.py
index b88b4e1..dac4226 100644
--- a/libcloud/test/compute/test_nttcis.py
+++ b/libcloud/test/compute/test_nttcis.py
@@ -1,7 +1,5 @@
import pytest
from dateutil.parser import parse
-
-import sys
from types import GeneratorType
from libcloud.utils.py3 import httplib
from libcloud.utils.py3 import ET
@@ -11,10 +9,6 @@ from libcloud.common.nttcis import NttCisServerCpuSpecification, NttCisServerDis
from libcloud.common.nttcis import NttCisTag, NttCisTagKey
from libcloud.common.nttcis import NttCisServerCpuSpecification
from libcloud.common.nttcis import NttCisServerDisk
-from libcloud.common.nttcis import NttCisIpAddress, \
- NttCisIpAddressList, NttCisChildIpAddressList, \
- NttCisPortList, NttCisPort, NttCisChildPortList
-from libcloud.common.nttcis import ClassFactory
from libcloud.common.nttcis import TYPES_URN
from libcloud.compute.drivers.nttcis import NttCisNodeDriver as NttCis
from libcloud.compute.drivers.nttcis import NttCisNic
@@ -2261,7 +2255,7 @@ class NttCisMockHttp(MockHttp):
'server_startServer_INPROGRESS.xml')
return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK])
- def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_sna_compute_hutdownServer(self, method, url, body, headers):
+ def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_shutdownServer(self, method, url, body, headers):
request = ET.fromstring(body)
if request.tag != "{urn:didata.com:api:cloud:types}shutdownServer":
raise InvalidRequestError(request.tag)
@@ -3374,4 +3368,3 @@ class NttCisMockHttp(MockHttp):
"drs_delete_consistency_group.xml"
)
return httplib.OK, body, {}, httplib.responses[httplib.OK]
-
http://git-wip-us.apache.org/repos/asf/libcloud/blob/46096c4e/tox.ini
----------------------------------------------------------------------
diff --git a/tox.ini b/tox.ini
index 293ccf9..7485e61 100644
--- a/tox.ini
+++ b/tox.ini
@@ -7,6 +7,7 @@ deps =
-r{toxinidir}/requirements-tests.txt
lockfile
pyopenssl
+ python-dateutil
libvirt-python==4.0.0
py2.7: paramiko
commands = cp libcloud/test/secrets.py-dist libcloud/test/secrets.py
@@ -105,6 +106,7 @@ commands = python -m integration
deps =
-r{toxinidir}/requirements-tests.txt
pyopenssl
+ python-dateutil
libvirt-python==4.0.0
lockfile
set-env =
[21/21] libcloud git commit: Update docstrings for NTTC
Posted by an...@apache.org.
Update docstrings for NTTC
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/6ae3a29b
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/6ae3a29b
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/6ae3a29b
Branch: refs/heads/trunk
Commit: 6ae3a29ba5522c566b893f6994cc1748c1c7b149
Parents: d914d13
Author: Anthony Shaw <an...@gmail.com>
Authored: Wed Dec 19 16:33:50 2018 +1100
Committer: Anthony Shaw <an...@gmail.com>
Committed: Wed Dec 19 16:33:50 2018 +1100
----------------------------------------------------------------------
libcloud/compute/drivers/nttcis.py | 50 ++++++++++++++++++++++-----------
1 file changed, 34 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/6ae3a29b/libcloud/compute/drivers/nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/nttcis.py b/libcloud/compute/drivers/nttcis.py
index d850304..6876a4e 100644
--- a/libcloud/compute/drivers/nttcis.py
+++ b/libcloud/compute/drivers/nttcis.py
@@ -4658,15 +4658,20 @@ class NttCisNodeDriver(NodeDriver):
:param name: Name of consistency group
:type name: ``str``
+
:param journal_size_gb: Journal size in GB
:type journal_size_gb: ``str``
+
:param source_server_id: Id of the server to copy
:type source_server_id: ``str``
+
:param target_server_id: Id of the server to receive the copy
:type: target_server_id: ``str``
+
:param description: (Optional) Description of consistency group
:type: description: ``str``
- :return: :class: `NttCisConsistenccyGroup`
+
+ :rtype: :class:`NttCisConsistencyGroup`
"""
consistency_group_elm = ET.Element('createConsistencyGroup',
@@ -4704,7 +4709,7 @@ class NttCisNodeDriver(NodeDriver):
* state=
* operation_status=
* drs_infrastructure_status=
- :return: `list` of :class: `NttCisConsistencyGroup`
+ :rtype: `list` of :class: `NttCisConsistencyGroup`
"""
response = self.connection.request_with_orgId_api_2(
@@ -4716,9 +4721,11 @@ class NttCisNodeDriver(NodeDriver):
"""
Retrieves a Consistency by it's id and is more efficient thatn listing
all consistency groups and filtering that result.
+
:param consistency_group_id: An id of a consistency group
:type consistency_group_id: ``str``
- :return: :class: `NttCisConsistencygroup`
+
+ :rtype: :class:`NttCisConsistencygroup`
"""
response = self.connection.request_with_orgId_api_2(
"consistencyGroup/consistencyGroup/%s" % consistency_group_id
@@ -4743,15 +4750,18 @@ class NttCisNodeDriver(NodeDriver):
:param consistency_group_id: The id of consistency group
:type consistency_group_id: ``str``
+
:param create_time_min: (Optional) in form YYYY-MM-DDT00:00.00.00Z or
substitute time offset for Z, i.e,
-05:00
:type create_time_min: ``str``
+
:param create_time_max: (Optional) in form YYYY-MM-DDT00:00:00.000Z or
substitute time offset for Z, i.e,
-05:00
:type create_time_max: ``str``
- :return: `list` of :class" `NttCisSnapshots`
+
+ :rtype: `list` of :class:`NttCisSnapshots`
"""
if create_time_min is None and create_time_max is None:
@@ -4780,12 +4790,16 @@ class NttCisNodeDriver(NodeDriver):
def ex_expand_journal(self, consistency_group_id, size_gb):
"""
- Expand the consistency group's journhal size in 100Gb increments
+ Expand the consistency group's journhal size in 100Gb increments.
+
:param consistency_group_id: The consistency group's UUID
- :type consistency_group_id: ``str``
+ :type consistency_group_id: ``str``
+
:param size_gb: Gb in 100 Gb increments
- :type size_gb: ``str``
- :return: True/False
+ :type size_gb: ``str``
+
+ :return: True if response_code contains either 'IN_PROGRESS' or 'OK'
+ otherwise False
:rtype: ``bool``
"""
@@ -4802,14 +4816,16 @@ class NttCisNodeDriver(NodeDriver):
def ex_start_drs_failover_preview(self, consistency_group_id,
snapshot_id):
"""
- Brings a Consistency Group into PREVIEWING_SNAPSHOT mode
+ Brings a Consistency Group into PREVIEWING_SNAPSHOT mode.
:param consistency_group_id: Id of the Consistency Group to put into
PRIEVEW_MODE
:type consistency_group_id: ``str``
+
:param snapshot_id: Id of the Snapshot to preview
:type snapshot_id: ``str``
- :return: True if response_code contains eiether 'IN_PROGRESS' or 'OK'
+
+ :return: True if response_code contains either 'IN_PROGRESS' or 'OK'
otherwise False
:rtype: ``bool``
"""
@@ -4831,8 +4847,9 @@ class NttCisNodeDriver(NodeDriver):
:param consistency_group_id: Consistency Group's Id
:type ``str``
- :return: True if response_code contains eiether 'IN_PROGRESS' or 'OK'
- otherwise False
+
+ :return: True if response_code contains either 'IN_PROGRESS' or 'OK'
+ otherwise False
:rtype: ``bool``
"""
preview_elm = ET.Element("stopPreviewSnapshot",
@@ -4852,8 +4869,9 @@ class NttCisNodeDriver(NodeDriver):
:param consistency_group_id: Consistency Group's Id to failover
:type consistency_group_id: ``str``
- :return: :return: True if response_code contains eiether
- IN_PROGRESS' or 'OK' otherwise False
+
+ :return: True if response_code contains either
+ IN_PROGRESS' or 'OK' otherwise False
:rtype: ``bool``
"""
failover_elm = ET.Element("initiateFailover",
@@ -4872,8 +4890,8 @@ class NttCisNodeDriver(NodeDriver):
:param consistency_group_id: Id of Consistency Group to delete
:type ``str``
- :return: True if response_code contains eiether
- IN_PROGRESS' or 'OK' otherwise False
+ :return: True if response_code contains either
+ IN_PROGRESS' or 'OK' otherwise False
:rtype: ``bool``
"""
delete_elm = ET.Element("deleteConsistencyGroup",
[12/21] libcloud git commit: merged latest trunk
Posted by an...@apache.org.
merged latest trunk
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/3906dd3a
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/3906dd3a
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/3906dd3a
Branch: refs/heads/trunk
Commit: 3906dd3ae92b14a47f3af587e4a805e651a05158
Parents: 484855d de159ec
Author: mitch <mi...@itaas.dimensiondata.com>
Authored: Thu Dec 13 14:32:36 2018 -0500
Committer: mitch <mi...@itaas.dimensiondata.com>
Committed: Thu Dec 13 14:32:36 2018 -0500
----------------------------------------------------------------------
libcloud/loadbalancer/drivers/nttcis.py | 14 ++++++++++----
tox.ini | 6 ++++--
2 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/3906dd3a/tox.ini
----------------------------------------------------------------------
[09/21] libcloud git commit: Merge branch 'trunk' of
https://git-wip-us.apache.org/repos/asf/libcloud into
feature_drs_without_driver
Posted by an...@apache.org.
Merge branch 'trunk' of https://git-wip-us.apache.org/repos/asf/libcloud into feature_drs_without_driver
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/d2f933cd
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/d2f933cd
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/d2f933cd
Branch: refs/heads/trunk
Commit: d2f933cda1a078f561a74e4a2704b0e2ac387898
Parents: af20d39 1a3ebe5
Author: mitch <mi...@itaas.dimensiondata.com>
Authored: Tue Dec 4 20:53:14 2018 -0500
Committer: mitch <mi...@itaas.dimensiondata.com>
Committed: Tue Dec 4 20:53:14 2018 -0500
----------------------------------------------------------------------
CHANGES.rst | 72 ++-
docs/compute/drivers/openstack.rst | 4 +
libcloud/common/openstack.py | 3 +-
libcloud/common/openstack_identity.py | 2 +-
libcloud/compute/drivers/openstack.py | 590 ++++++++++++++++++-
libcloud/test/common/test_base_driver.py | 6 +-
libcloud/test/common/test_openstack_identity.py | 34 +-
libcloud/test/common/test_upcloud.py | 4 +-
.../compute/fixtures/openstack/_v2_0__auth.json | 22 +
.../openstack_identity/v3/v3_users_c.json | 14 +
.../openstack_v1.1/_v2_0__floatingip.json | 23 +
.../openstack_v1.1/_v2_0__floatingips.json | 52 ++
.../openstack_v1.1/_v2_0__networks_public.json | 64 ++
.../openstack_v1.1/_v2_0__security_group.json | 10 +
.../_v2_0__security_group_rule.json | 13 +
.../openstack_v1.1/_v2_0__security_groups.json | 29 +
.../openstack_v1.1/_v2_0__snapshot.json | 14 +
.../openstack_v1.1/_v2_0__snapshots.json | 46 ++
.../_v2_0__snapshots_paginate_start.json | 52 ++
.../fixtures/openstack_v1.1/_v2_0__subnet.json | 32 +
.../fixtures/openstack_v1.1/_v2_0__volume.json | 18 +
.../fixtures/openstack_v1.1/_v2_0__volumes.json | 44 ++
libcloud/test/compute/test_azure.py | 2 +-
libcloud/test/compute/test_cloudsigma_v2_0.py | 6 +-
libcloud/test/compute/test_gce.py | 4 +-
libcloud/test/compute/test_oneandone.py | 10 +-
libcloud/test/compute/test_opennebula.py | 142 ++---
libcloud/test/compute/test_openstack.py | 302 +++++++++-
libcloud/test/compute/test_vcloud.py | 2 +-
libcloud/test/dns/test_buddyns.py | 16 +-
libcloud/test/dns/test_cloudflare.py | 2 +-
libcloud/test/dns/test_dnspod.py | 10 +-
libcloud/test/dns/test_google.py | 2 +-
libcloud/test/dns/test_linode.py | 4 +-
libcloud/test/dns/test_liquidweb.py | 10 +-
libcloud/test/dns/test_luadns.py | 18 +-
libcloud/test/dns/test_nsone.py | 6 +-
libcloud/test/dns/test_pointdns.py | 8 +-
libcloud/test/dns/test_powerdns.py | 20 +-
libcloud/test/dns/test_vultr.py | 12 +-
libcloud/test/dns/test_zerigo.py | 8 +-
libcloud/test/dns/test_zonomi.py | 10 +-
.../loadbalancer/test_dimensiondata_v2_3.py | 4 +-
.../loadbalancer/test_dimensiondata_v2_4.py | 4 +-
libcloud/test/test_connection.py | 16 +-
libcloud/test/test_http.py | 2 +-
libcloud/test/test_init.py | 2 +-
47 files changed, 1548 insertions(+), 222 deletions(-)
----------------------------------------------------------------------
[05/21] libcloud git commit: removed drs directories
Posted by an...@apache.org.
removed drs directories
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/e330274c
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/e330274c
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/e330274c
Branch: refs/heads/trunk
Commit: e330274cd27df9f5f21bd71c117be3a4b6eb8c1c
Parents: b9dfbf7 9dcb4c9
Author: mitch <mi...@itaas.dimensiondata.com>
Authored: Thu Nov 29 10:15:14 2018 -0500
Committer: mitch <mi...@itaas.dimensiondata.com>
Committed: Thu Nov 29 10:15:14 2018 -0500
----------------------------------------------------------------------
CHANGES.rst | 15 +
.../generate_provider_feature_matrix_table.py | 26 --
docs/_static/images/provider_logos/upcloud.png | Bin 20107 -> 10801 bytes
docs/compute/drivers/upcloud.rst | 14 +-
docs/container/utilities.rst | 3 +
docs/drs/_supported_methods.rst | 9 -
docs/drs/_supported_providers.rst | 9 -
docs/drs/drivers/index.rst | 12 -
docs/drs/drivers/nttcis.rst | 18 -
docs/drs/index.rst | 15 -
docs/drs/supported_providers.rst | 14 -
docs/examples/drs/__init__.py | 0
docs/examples/drs/nttcis/__init__.py | 0
.../drs/nttcis/add_consistency_group.py | 27 --
.../drs/nttcis/list_snapshots_by_create_time.py | 23 --
.../nttcis/create_ssl_offload_profile.py | 26 ++
.../nttcis/edit_ssl_offload_profile.py | 32 ++
.../loadbalancer/nttcis/import_ssl_cert.py | 33 ++
docs/index.rst | 2 -
docs/loadbalancer/drivers/nttcis.rst | 3 +-
integration/requirements.txt | 1 +
libcloud/base.py | 7 -
libcloud/common/base.py | 1 -
libcloud/common/nttcis.py | 76 +++-
libcloud/compute/drivers/nttcis.py | 60 ++-
libcloud/compute/drivers/openstack.py | 4 +
libcloud/container/utils/docker.py | 9 +-
libcloud/drs/__init__.py | 19 -
libcloud/drs/base.py | 201 ----------
libcloud/drs/drivers/__init__.py | 18 -
libcloud/drs/drivers/nttcis.py | 316 ----------------
libcloud/drs/providers.py | 39 --
libcloud/drs/types.py | 43 ---
libcloud/loadbalancer/drivers/nttcis.py | 363 ++++++++++++++++++-
.../fixtures/nttcis/create_preview_server.xml | 7 +
.../nttcis/disable_server_snapshot_service.xml | 6 +
.../fixtures/nttcis/enable_snapshot_service.xml | 7 +
.../fixtures/nttcis/geographic_regions.xml | 75 ++++
.../nttcis/initiate_manual_snapshot.xml | 7 +
.../fixtures/nttcis/list_server_snapshots.xml | 27 ++
.../fixtures/nttcis/manual_snapshot_server.xml | 26 ++
.../fixtures/nttcis/networkWithLocation.xml | 19 +
.../fixtures/openstack_v1.1/_os_snapshot.json | 11 +
.../openstack_v1.1/_os_snapshot_rackspace.json | 11 +
libcloud/test/compute/test_nttcis.py | 217 ++++++++++-
libcloud/test/compute/test_openstack.py | 41 ++-
libcloud/test/drs/__init__.py | 0
.../nttcis/delete_consistency_group.xml | 6 -
.../test/drs/fixtures/nttcis/drs_ineligible.xml | 6 -
.../fixtures/nttcis/drs_initiate_failover.xml | 6 -
.../test/drs/fixtures/nttcis/drs_snapshots.xml | 14 -
.../fixtures/nttcis/drs_snapshots_by_min.xml | 90 -----
libcloud/test/drs/fixtures/nttcis/expand_cg.xml | 6 -
.../fixtures/nttcis/get_consistency_group.xml | 27 --
.../drs/fixtures/nttcis/list_cg_by_params.xml | 25 --
.../fixtures/nttcis/list_consistency_groups.xml | 25 --
.../drs/fixtures/nttcis/oec_0_9_myaccount.xml | 26 --
.../fixtures/nttcis/start_snapshot_preview.xml | 6 -
.../fixtures/nttcis/stop_snapshot_preview.xml | 6 -
libcloud/test/drs/test_nttcis.py | 206 -----------
.../test/loadbalancer/fixtures/nttcis/alice.crt | 23 ++
.../test/loadbalancer/fixtures/nttcis/alice.key | 32 ++
.../test/loadbalancer/fixtures/nttcis/chain.crt | 47 +++
.../nttcis/create_ssl_offload_profile.xml | 7 +
.../nttcis/delete_ssl_certificate_chain.xml | 6 +
.../nttcis/delete_ssl_domain_certificate.xml | 6 +
.../nttcis/delete_ssl_offload_profile.xml | 6 +
.../test/loadbalancer/fixtures/nttcis/denis.crt | 124 +++++++
.../test/loadbalancer/fixtures/nttcis/denis.key | 51 +++
.../nttcis/edit_ssl_offload_profile.xml | 6 +
.../loadbalancer/fixtures/nttcis/get_cert.xml | 9 +
.../fixtures/nttcis/get_ssl_offload_profile.xml | 11 +
.../nttcis/list_ssl_offload_profiles.xml | 13 +
.../fixtures/nttcis/ssl_cert_by_name.xml | 11 +
.../fixtures/nttcis/ssl_cert_list.xml | 19 +
.../fixtures/nttcis/ssl_get_cert_chain.xml | 9 +
.../fixtures/nttcis/ssl_import_cert_chain.xml | 7 +
.../fixtures/nttcis/ssl_import_fail.xml | 6 +
.../fixtures/nttcis/ssl_import_success.xml | 7 +
.../nttcis/ssl_list_cert_chain_by_name.xml | 11 +
libcloud/test/loadbalancer/test_nttcis.py | 296 ++++++++++++++-
tox.ini | 3 +
82 files changed, 1711 insertions(+), 1340 deletions(-)
----------------------------------------------------------------------
[02/21] libcloud git commit: removed more indents on
libcloud/drs/drivers/nttcis.py
Posted by an...@apache.org.
removed more indents on libcloud/drs/drivers/nttcis.py
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/30d2af87
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/30d2af87
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/30d2af87
Branch: refs/heads/trunk
Commit: 30d2af87e6732face882c63d13353e1716631be0
Parents: 2c5b5cf
Author: mitch <mi...@itaas.dimensiondata.com>
Authored: Tue Nov 13 15:03:01 2018 -0500
Committer: mitch <mi...@itaas.dimensiondata.com>
Committed: Tue Nov 13 15:03:01 2018 -0500
----------------------------------------------------------------------
libcloud/drs/drivers/nttcis.py | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/30d2af87/libcloud/drs/drivers/nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/drs/drivers/nttcis.py b/libcloud/drs/drivers/nttcis.py
index cc1add8..bb2bdae 100644
--- a/libcloud/drs/drivers/nttcis.py
+++ b/libcloud/drs/drivers/nttcis.py
@@ -117,15 +117,15 @@ class NttCisDRSDriver(DRSDriver):
Functions takes a named parameter that must be one of the following
:param params: A dictionary composed of one of the following keys
and a value
- * target_data_center_id=
- * source_network_domain_id=
- * target_network_domain_id=
- * source_server_id=
- * target_server_id=
- * name=
- * state=
- * operation_status=
- * drs_infrastructure_status=
+ * target_data_center_id=
+ * source_network_domain_id=
+ * target_network_domain_id=
+ * source_server_id=
+ * target_server_id=
+ * name=
+ * state=
+ * operation_status=
+ * drs_infrastructure_status=
:return: `list` of :class: `NttCisConsistencyGroup`
"""
[06/21] libcloud git commit: moved much of drs functionality into the
compute driver, last test coded far was stopping drs_preview_failover
Posted by an...@apache.org.
moved much of drs functionality into the compute driver, last test coded far was stopping drs_preview_failover
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/facbea21
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/facbea21
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/facbea21
Branch: refs/heads/trunk
Commit: facbea218b89487fdff08104532f0c372f4b61d6
Parents: e330274
Author: mitch <mi...@itaas.dimensiondata.com>
Authored: Fri Nov 30 17:47:20 2018 -0500
Committer: mitch <mi...@itaas.dimensiondata.com>
Committed: Fri Nov 30 17:47:20 2018 -0500
----------------------------------------------------------------------
libcloud/common/nttcis.py | 9 +-
libcloud/compute/drivers/nttcis.py | 245 +++++++++++++++++++
.../nttcis/cg_by_src_network_domain.xml | 51 ++++
.../fixtures/nttcis/drs_expand_journal.xml | 6 +
.../nttcis/drs_snap_shots_by_min_max_time.xml | 61 +++++
.../fixtures/nttcis/drs_snapshots_by_min.xml | 44 ++++
.../nttcis/drs_start_failover_preview.xml | 6 +
.../nttcis/drs_stop_failover_preview.xml | 6 +
.../fixtures/nttcis/get_cg_by_name_or_id.xml | 27 ++
.../fixtures/nttcis/list_consistency_groups.xml | 51 ++++
.../fixtures/nttcis/list_drs_snapshots.xml | 81 ++++++
libcloud/test/compute/test_nttcis.py | 166 ++++++++++++-
12 files changed, 748 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/facbea21/libcloud/common/nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/common/nttcis.py b/libcloud/common/nttcis.py
index faf6650..3232abf 100644
--- a/libcloud/common/nttcis.py
+++ b/libcloud/common/nttcis.py
@@ -17,7 +17,7 @@ NTTCIS Common Components
"""
import xml.etree.ElementTree as etree
import re
-import functools
+from functools import wraps, total_ordering
from copy import deepcopy
from base64 import b64encode
from time import sleep
@@ -294,7 +294,7 @@ BAD_MESSAGE_XML_ELEMENTS = (
def get_params(func):
- @functools.wraps(func)
+ @wraps(func)
def paramed(*args, **kwargs):
if kwargs:
for k, v in kwargs.items():
@@ -2054,7 +2054,9 @@ def processor(mapping, name=None):
def process(mapping):
"""
- This function is recursive, creating attributes for the class factory.
+ This function is recursive, creating attributes for the class factory
+ by taking apart the elements in the dictionary. Thus, the calls to
+ handle_seq or handle_map
:param mapping: the dictionary converted from XML
:return: itself (recursive)
"""
@@ -2093,6 +2095,7 @@ def processor(mapping, name=None):
return process(mapping)
+@total_ordering
def class_factory(cls_name, attrs):
"""
This class takes a name and a dictionary to create a class.
http://git-wip-us.apache.org/repos/asf/libcloud/blob/facbea21/libcloud/compute/drivers/nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/nttcis.py b/libcloud/compute/drivers/nttcis.py
index 8980051..5dca8cd 100644
--- a/libcloud/compute/drivers/nttcis.py
+++ b/libcloud/compute/drivers/nttcis.py
@@ -23,6 +23,7 @@ from libcloud.common.nttcis import LooseVersion
from libcloud.common.exceptions import BaseHTTPError
from libcloud.compute.base import NodeDriver, Node, NodeAuthPassword
from libcloud.compute.base import NodeSize, NodeImage, NodeLocation
+from libcloud.common.nttcis import process_xml, get_params
from libcloud.common.nttcis import dd_object_to_id
from libcloud.common.nttcis import NttCisAPIException
from libcloud.common.nttcis import (NttCisConnection,
@@ -4649,6 +4650,250 @@ class NttCisNodeDriver(NodeDriver):
return new_node
+ # DRS methods
+ def create_consistency_group(self, name, journal_size_gb,
+ source_server_id, target_server_id,
+ description=None):
+ """
+ Create a consistency group
+
+ :param name: Name of consistency group
+ :type name: ``str``
+ :param journal_size_gb: Journal size in GB
+ :type journal_size_gb: ``str``
+ :param source_server_id: Id of the server to copy
+ :type source_server_id: ``str``
+ :param target_server_id: Id of the server to receive the copy
+ :type: ``str``
+ :param description: (Optional) Description of consistency group
+ :type: ``str``
+ :return: :class: `NttCisConsistenccyGroup`
+ """
+
+ consistency_group_elm = ET.Element('createConsistencyGroup',
+ {'xmlns': TYPES_URN})
+ ET.SubElement(consistency_group_elm, "name").text = name
+ if description is not None:
+ ET.SubElement(
+ consistency_group_elm, "description").text = description
+ ET.SubElement(
+ consistency_group_elm, "journalSizeGb").text = journal_size_gb
+ server_pair = ET.SubElement(consistency_group_elm, "serverPair")
+ ET.SubElement(
+ server_pair, "sourceServerId").text = source_server_id
+ ET.SubElement(
+ server_pair, "targetServerId").text = target_server_id
+ response = self.connection.request_with_orgId_api_2(
+ "consistencyGroup/createConsistencyGroup",
+ method="POST",
+ data=ET.tostring(consistency_group_elm)).object
+ response_code = findtext(response, 'responseCode', TYPES_URN)
+ return response_code in ['IN_PROGRESS', 'OK']
+
+ @get_params
+ def list_consistency_groups(self, params={}):
+ """
+ Functions takes a named parameter that must be one of the following
+ :param params: A dictionary composed of one of the following keys
+ and a value
+ * target_data_center_id=
+ * source_network_domain_id=
+ * target_network_domain_id=
+ * source_server_id=
+ * target_server_id=
+ * name=
+ * state=
+ * operation_status=
+ * drs_infrastructure_status=
+ :return: `list` of :class: `NttCisConsistencyGroup`
+ """
+
+ response = self.connection.request_with_orgId_api_2(
+ 'consistencyGroup/consistencyGroup', params=params).object
+ cgs = self._to_consistency_groups(response)
+ return cgs
+
+ def get_consistency_group(self, consistency_group_id):
+ """
+ Retrieves a Consistency by it's id and is more efficient thatn listing
+ all consistency groups and filtering that result.
+ :param consistency_group_id: An id of a consistency group
+ :type consistency_group_id: ``str``
+ :return: :class: `NttCisConsistencygroup`
+ """
+ response = self.connection.request_with_orgId_api_2(
+ "consistencyGroup/consistencyGroup/%s" % consistency_group_id
+ ).object
+ cg = self._to_process(response)
+ return cg
+
+ def list_consistency_group_snapshots(self, consistency_group_id,
+ create_time_min=None,
+ create_time_max=None):
+ """
+ Optional parameters identify the date of creation of Consistency Group
+ snapshots in *XML Schema (XSD) date time format. Best used as a
+ combination of createTime.MIN and createTime.MAX. If neither is
+ provided then all snapshots up to the possible maximum of 1014
+ will be returned. If MIN is provided by itself, all snapshots
+ between the time specified by MIN and the point in time of
+ execution will be returned. If MAX is provided by itself,
+ then all snapshots up to that point in time (up to the
+ maximum number of 1014) will be returned. MIN and MAX are
+ inclusive for this API function
+
+ :param consistency_group_id: The id of consistency group
+ :type consistency_group_id: ``str``
+ :param create_time_min: (Optional) in form YYYY-MM-DDT00:00.00.00Z or
+ substitute time offset for Z, i.e,
+ -05:00
+ :type create_time_min: ``str``
+ :param create_time_max: (Optional) in form YYYY-MM-DDT00:00:00.000Z or
+ substitute time offset for Z, i.e,
+ -05:00
+ :type create_time_max: ``str``
+ :return: `list` of :class" `NttCisSnapshots`
+ """
+
+ if create_time_min is None and create_time_max is None:
+ params = {"consistencyGroupId": consistency_group_id}
+ elif create_time_min and create_time_max:
+ params = {"consistencyGroupId": consistency_group_id,
+ "createTime.MIN": create_time_min,
+ "createTime.MAX": create_time_max
+ }
+ elif create_time_min or create_time_max:
+ if create_time_max is not None:
+ params = {"consistencyGroupId": consistency_group_id,
+ "createTime.MAX": create_time_max
+ }
+ elif create_time_min is not None:
+ params = {"consistencyGroupId": consistency_group_id,
+ "createTime.MIN": create_time_min
+ }
+ paged_result = self.connection.request_with_orgId_api_2(
+ 'consistencyGroup/snapshot',
+ method='GET',
+ params=params
+ ).object
+ snapshots = self._to_process(paged_result)
+ return snapshots
+
+ def expand_journal(self, consistency_group_id, size_gb):
+ """
+ Expand the consistency group's journhal size in 100Gb increments
+ :param consistency_group_id: The consistency group's UUID
+ :type consistency_group_id: ``str``
+ :param size_gb: Gb in 100 Gb increments
+ :type size_gb: ``str``
+ :return: ``bool``
+ """
+
+ expand_elm = ET.Element("expandJournal", {"id": consistency_group_id,
+ "xmlns": TYPES_URN})
+ ET.SubElement(expand_elm, "sizeGb").text = size_gb
+ response = self.connection.request_with_orgId_api_2(
+ "consistencyGroup/expandJournal",
+ method="POST",
+ data=ET.tostring(expand_elm)).object
+ response_code = findtext(response, 'responseCode', TYPES_URN)
+ return response_code in ['IN_PROGRESS', 'OK']
+
+ def start_drs_failover_preview(self, consistency_group_id, snapshot_id):
+ """
+ Brings a Consistency Group into PREVIEWING_SNAPSHOT mode
+
+ :param consistency_group_id: Id of the Consistency Group to put into
+ PRIEVEW_MODE
+ :type consistency_group_id: ``str``
+ :param snapshot_id: Id of the Snapshot to preview
+ :type snapshot_id: ``str``
+ :return: True/False
+ :rtype: ``bool``
+ """
+ preview_elm = ET.Element("startPreviewSnapshot",
+ {"consistencyGroupId": consistency_group_id,
+ "xmlns": TYPES_URN
+ })
+ ET.SubElement(preview_elm, "snapshotId").text = snapshot_id
+ response = self.connection.request_with_orgId_api_2(
+ "consistencyGroup/startPreviewSnapshot",
+ method="POST",
+ data=ET.tostring(preview_elm)).object
+ response_code = findtext(response, 'responseCode', TYPES_URN)
+ return response_code in ['IN_PROGRESS', 'OK']
+
+ def stop_drs_failover_preview(self, consistency_group_id):
+ """
+ Takes a Consistency Group out of PREVIEW_MODE and back to DRS_MODE
+
+ :param consistency_group_id: Consistency Group's Id
+ :type ``str``
+ :return: True/False
+ :rtype: ``bool``
+ """
+ preview_elm = ET.Element("stopPreviewSnapshot",
+ {"consistencyGroupId": consistency_group_id,
+ "xmlns": TYPES_URN})
+ response = self.connection.request_with_orgId_api_2(
+ "consistencyGroup/stopPreviewSnapshot",
+ method="POST",
+ data=ET.tostring(preview_elm)).object
+ response_code = findtext(response, 'responseCode', TYPES_URN)
+ return response_code in ['IN_PROGRESS', 'OK']
+
+ def initiate_drs_failover(self, consistency_group_id):
+ """
+ This method is irreversible.
+ It will failover the Consistency Group while removing it as well.
+
+ :param consistency_group_id: Consistency Group's Id to failover
+ :type consistency_group_id: ``str``
+ :return: True/False
+ :rtype: ``bool``
+ """
+ failover_elm = ET.Element("initiateFailover",
+ {"consistencyGroupId": consistency_group_id,
+ "xmlns": TYPES_URN})
+ response = self.connection.request_with_orgId_api_2(
+ "consistencyGroup/initiateFailover",
+ method="POST",
+ data=ET.tostring(failover_elm)).object
+ response_code = findtext(response, "responseCode", TYPES_URN)
+ return response_code in ["IN_PROGRESS", "OK"]
+
+ def delete_consistency_group(self, consistency_group_id):
+ """
+ Delete's a Consistency Group
+
+ :param consistency_group_id: Id of Consistency Group to delete
+ :type ``str``
+ :return: True/False
+ :rtype: ``bool``
+ """
+ delete_elm = ET.Element("deleteConsistencyGroup",
+ {"id": consistency_group_id,
+ "xmlns": TYPES_URN})
+ response = self.connection.request_with_orgId_api_2(
+ "consistencyGroup/deleteConsistencyGroup",
+ method="POST",
+ data=ET.tostring(delete_elm)).object
+ response_code = findtext(response, "responseCode", TYPES_URN)
+ return response_code in ["IN_PROGRESS", "OK"]
+
+ def _to_consistency_groups(self, object):
+ cgs = findall(object, 'consistencyGroup', TYPES_URN)
+ return [self._to_process(el) for el in cgs]
+
+ def _to_drs_snapshots(self, object):
+ snapshots = []
+ for element in object.findall(fixxpath("snapshot", TYPES_URN)):
+ snapshots.append(self._to_process(element))
+ return snapshots
+
+ def _to_process(self, element):
+ return process_xml(ET.tostring(element))
+
def _format_csv(self, http_response):
text = http_response.read()
lines = str.splitlines(ensure_string(text))
http://git-wip-us.apache.org/repos/asf/libcloud/blob/facbea21/libcloud/test/compute/fixtures/nttcis/cg_by_src_network_domain.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/nttcis/cg_by_src_network_domain.xml b/libcloud/test/compute/fixtures/nttcis/cg_by_src_network_domain.xml
new file mode 100644
index 0000000..3594cbb
--- /dev/null
+++ b/libcloud/test/compute/fixtures/nttcis/cg_by_src_network_domain.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<consistencyGroups xmlns="urn:didata.com:api:cloud:types" pageNumber="1" pageCount="2" totalCount="2" pageSize="250">
+ <consistencyGroup id="195a426b-4559-4c79-849e-f22cdf2bfb6e">
+ <name>sdk_test2_cg</name>
+ <description>A test consistency group</description>
+ <journal sizeGb="100" extentCount="1"/>
+ <source datacenterId="NADRAASLAB01" networkDomainId="f9d6a249-c922-4fa1-9f0f-de5b452c4026">
+ <networkDomainName>DRS-ProdEng-East-ND1</networkDomainName>
+ </source>
+ <target datacenterId="NADRAASLAB02" networkDomainId="e46c8815-193f-402d-b8a5-682eaa646fb2">
+ <networkDomainName>DRS-ProdEng-West-ND1</networkDomainName>
+ </target>
+ <serverPair id="55416e8c-d198-4d33-a7f9-df7f30b8813b" state="NORMAL">
+ <sourceServer id="032f3967-00e4-4780-b4ef-8587460f9dd4" primaryNicIpv4="192.168.12.8" primaryNicIpv6="2607:f480:111:1426:3dc9:25dc:4985:81b2">
+ <name>src-sdk-test</name>
+ </sourceServer>
+ <targetServer id="aee58575-38e2-495f-89d3-854e6a886411" primaryNicIpv4="192.168.22.7" primaryNicIpv6="2607:f480:211:1159:2dff:40ed:ee7c:4738">
+ <name>tgt-sdk-test</name>
+ </targetServer>
+ </serverPair>
+ <createTime>2018-11-12T20:53:10.000Z</createTime>
+ <operationStatus>DRS_MODE</operationStatus>
+ <drsInfrastructure enabled="true" status="ACTIVE" updateTime="2018-11-29T17:40:02.000Z"/>
+ <drsStatusCheckFailureCount>0</drsStatusCheckFailureCount>
+ <state>NORMAL</state>
+ </consistencyGroup>
+ <consistencyGroup id="90fc8db6-0207-443d-9c2c-04b19eb9fd6b">
+ <name>CG-Re-IP-Scenario-2</name>
+ <description>CG-Re-IP-Scenario-2</description>
+ <journal sizeGb="100" extentCount="1"/>
+ <source datacenterId="NADRAASLAB01" networkDomainId="f9d6a249-c922-4fa1-9f0f-de5b452c4026">
+ <networkDomainName>DRS-ProdEng-East-ND1</networkDomainName>
+ </source>
+ <target datacenterId="NADRAASLAB02" networkDomainId="e46c8815-193f-402d-b8a5-682eaa646fb2">
+ <networkDomainName>DRS-ProdEng-West-ND1</networkDomainName>
+ </target>
+ <serverPair id="a041f587-982e-49dc-9db8-1b987a0ee7b6" state="NORMAL">
+ <sourceServer id="6a15da8a-ea2c-4938-bca4-2c5e66355c8c" primaryNicIpv4="192.168.12.6" primaryNicIpv6="2607:f480:111:1426:87:6706:e811:f182">
+ <name>Src-Re-IP-RHEL7</name>
+ </sourceServer>
+ <targetServer id="f55aef9f-ed6f-40bd-a00d-33fb184d5838" primaryNicIpv4="192.168.22.6" primaryNicIpv6="2607:f480:211:1159:76b:dce4:a3f6:ad8b">
+ <name>Tgt-Re-IP-RHEL7</name>
+ </targetServer>
+ </serverPair>
+ <createTime>2018-11-16T15:41:48.000Z</createTime>
+ <operationStatus>DRS_MODE</operationStatus>
+ <drsInfrastructure enabled="true" status="ACTIVE" updateTime="2018-11-29T17:40:02.000Z"/>
+ <drsStatusCheckFailureCount>0</drsStatusCheckFailureCount>
+ <state>NORMAL</state>
+ </consistencyGroup>
+</consistencyGroups>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/facbea21/libcloud/test/compute/fixtures/nttcis/drs_expand_journal.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/nttcis/drs_expand_journal.xml b/libcloud/test/compute/fixtures/nttcis/drs_expand_journal.xml
new file mode 100644
index 0000000..032f2ff
--- /dev/null
+++ b/libcloud/test/compute/fixtures/nttcis/drs_expand_journal.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response xmlns="urn:didata.com:api:cloud:types" requestId="na_20181130T161652068-0500_fff53b78-2dc0-4728-b695-6ad4bb4a8b70">
+ <operation>EXPAND_JOURNAL</operation>
+ <responseCode>IN_PROGRESS</responseCode>
+ <message>Request to Expand DRS Journal Space has been accepted. Please use appropriate Get or List API for status.</message>
+</response>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/facbea21/libcloud/test/compute/fixtures/nttcis/drs_snap_shots_by_min_max_time.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/nttcis/drs_snap_shots_by_min_max_time.xml b/libcloud/test/compute/fixtures/nttcis/drs_snap_shots_by_min_max_time.xml
new file mode 100644
index 0000000..a05202d
--- /dev/null
+++ b/libcloud/test/compute/fixtures/nttcis/drs_snap_shots_by_min_max_time.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<consistencyGroupSnapshots xmlns="urn:didata.com:api:cloud:types" totalCount="58" journalUsageGb="0.34" protectionWindow="P0Y0M16DT23H4M34.604S" predictedProtectionWindow="P26Y2M0DT19H47M12.223S">
+ <snapshot id="2304625" createTime="2018-11-28T18:52:59.396-05:00" sizeKb="108"/>
+ <snapshot id="2302065" createTime="2018-11-28T18:27:00.846-05:00" sizeKb="230"/>
+ <snapshot id="2299476" createTime="2018-11-28T18:01:00.974-05:00" sizeKb="108"/>
+ <snapshot id="2296916" createTime="2018-11-28T17:35:01.362-05:00" sizeKb="343"/>
+ <snapshot id="2294318" createTime="2018-11-28T17:09:01.650-05:00" sizeKb="235"/>
+ <snapshot id="2291728" createTime="2018-11-28T16:43:02.315-05:00" sizeKb="108"/>
+ <snapshot id="2289168" createTime="2018-11-28T16:17:02.322-05:00" sizeKb="214"/>
+ <snapshot id="2286587" createTime="2018-11-28T15:51:02.819-05:00" sizeKb="108"/>
+ <snapshot id="2284027" createTime="2018-11-28T15:25:02.998-05:00" sizeKb="167"/>
+ <snapshot id="2281452" createTime="2018-11-28T14:59:02.734-05:00" sizeKb="111"/>
+ <snapshot id="2278888" createTime="2018-11-28T14:33:03.398-05:00" sizeKb="105"/>
+ <snapshot id="2277599" createTime="2018-11-28T14:20:03.124-05:00" sizeKb="1142"/>
+ <snapshot id="2276214" createTime="2018-11-28T14:07:02.998-05:00" sizeKb="211"/>
+ <snapshot id="2273629" createTime="2018-11-28T13:41:03.464-05:00" sizeKb="108"/>
+ <snapshot id="2271069" createTime="2018-11-28T13:15:03.119-05:00" sizeKb="200"/>
+ <snapshot id="2268490" createTime="2018-11-28T12:49:05.695-05:00" sizeKb="108"/>
+ <snapshot id="2265930" createTime="2018-11-28T12:23:06.184-05:00" sizeKb="264"/>
+ <snapshot id="2263333" createTime="2018-11-28T11:57:06.200-05:00" sizeKb="108"/>
+ <snapshot id="2260773" createTime="2018-11-28T11:31:07.442-05:00" sizeKb="108"/>
+ <snapshot id="2258213" createTime="2018-11-28T11:05:07.440-05:00" sizeKb="641"/>
+ <snapshot id="2255583" createTime="2018-11-28T10:39:09.091-05:00" sizeKb="168"/>
+ <snapshot id="2253005" createTime="2018-11-28T10:13:08.800-05:00" sizeKb="263"/>
+ <snapshot id="2250405" createTime="2018-11-28T09:47:08.754-05:00" sizeKb="108"/>
+ <snapshot id="2247845" createTime="2018-11-28T09:21:09.153-05:00" sizeKb="205"/>
+ <snapshot id="2245264" createTime="2018-11-28T08:55:09.099-05:00" sizeKb="108"/>
+ <snapshot id="2242704" createTime="2018-11-28T08:29:08.941-05:00" sizeKb="134"/>
+ <snapshot id="2240132" createTime="2018-11-28T08:03:09.231-05:00" sizeKb="200"/>
+ <snapshot id="2237556" createTime="2018-11-28T07:37:09.816-05:00" sizeKb="108"/>
+ <snapshot id="2234996" createTime="2018-11-28T07:11:09.962-05:00" sizeKb="200"/>
+ <snapshot id="2232417" createTime="2018-11-28T06:45:10.052-05:00" sizeKb="108"/>
+ <snapshot id="2229857" createTime="2018-11-28T06:19:09.896-05:00" sizeKb="209"/>
+ <snapshot id="2227273" createTime="2018-11-28T05:53:11.393-05:00" sizeKb="108"/>
+ <snapshot id="2224713" createTime="2018-11-28T05:27:11.856-05:00" sizeKb="229"/>
+ <snapshot id="2222126" createTime="2018-11-28T05:01:11.882-05:00" sizeKb="108"/>
+ <snapshot id="2219566" createTime="2018-11-28T04:35:13.909-05:00" sizeKb="108"/>
+ <snapshot id="2217006" createTime="2018-11-28T04:09:14.609-05:00" sizeKb="278"/>
+ <snapshot id="2214414" createTime="2018-11-28T03:43:15.124-05:00" sizeKb="54"/>
+ <snapshot id="2213134" createTime="2018-11-28T03:30:15.088-05:00" sizeKb="1565"/>
+ <snapshot id="2211652" createTime="2018-11-28T03:17:16.051-05:00" sizeKb="235"/>
+ <snapshot id="2209063" createTime="2018-11-28T02:51:16.629-05:00" sizeKb="108"/>
+ <snapshot id="2206503" createTime="2018-11-28T02:25:17.032-05:00" sizeKb="269"/>
+ <snapshot id="2203908" createTime="2018-11-28T01:59:18.396-05:00" sizeKb="108"/>
+ <snapshot id="2201348" createTime="2018-11-28T01:33:18.414-05:00" sizeKb="108"/>
+ <snapshot id="2198788" createTime="2018-11-28T01:07:18.547-05:00" sizeKb="235"/>
+ <snapshot id="2196199" createTime="2018-11-28T00:41:19.622-05:00" sizeKb="108"/>
+ <snapshot id="2193639" createTime="2018-11-28T00:15:20.066-05:00" sizeKb="223"/>
+ <snapshot id="2191056" createTime="2018-11-27T23:49:20.018-05:00" sizeKb="108"/>
+ <snapshot id="2188496" createTime="2018-11-27T23:23:20.103-05:00" sizeKb="200"/>
+ <snapshot id="2185917" createTime="2018-11-27T22:57:20.219-05:00" sizeKb="108"/>
+ <snapshot id="2183357" createTime="2018-11-27T22:31:20.558-05:00" sizeKb="132"/>
+ <snapshot id="2180786" createTime="2018-11-27T22:05:20.347-05:00" sizeKb="185"/>
+ <snapshot id="2178205" createTime="2018-11-27T21:39:20.101-05:00" sizeKb="108"/>
+ <snapshot id="2175645" createTime="2018-11-27T21:13:20.264-05:00" sizeKb="200"/>
+ <snapshot id="2173066" createTime="2018-11-27T20:47:21.296-05:00" sizeKb="108"/>
+ <snapshot id="2170506" createTime="2018-11-27T20:21:21.810-05:00" sizeKb="245"/>
+ <snapshot id="2167911" createTime="2018-11-27T19:55:21.447-05:00" sizeKb="117"/>
+ <snapshot id="2165349" createTime="2018-11-27T19:29:21.402-05:00" sizeKb="132"/>
+ <snapshot id="2162778" createTime="2018-11-27T19:03:22.026-05:00" sizeKb="203"/>
+</consistencyGroupSnapshots>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/facbea21/libcloud/test/compute/fixtures/nttcis/drs_snapshots_by_min.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/nttcis/drs_snapshots_by_min.xml b/libcloud/test/compute/fixtures/nttcis/drs_snapshots_by_min.xml
new file mode 100644
index 0000000..c5ecc1a
--- /dev/null
+++ b/libcloud/test/compute/fixtures/nttcis/drs_snapshots_by_min.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<consistencyGroupSnapshots xmlns="urn:didata.com:api:cloud:types" totalCount="41" journalUsageGb="0.34" protectionWindow="P0Y0M16DT23H38M14.357S" predictedProtectionWindow="P12Y5M5DT12H44M26.435S">
+ <snapshot id="2428274" createTime="2018-11-29T15:37:55.224-05:00" sizeKb="0"/>
+ <snapshot id="2428269" createTime="2018-11-29T15:37:52.175-05:00" sizeKb="96"/>
+ <snapshot id="2425994" createTime="2018-11-29T15:14:45.974-05:00" sizeKb="143"/>
+ <snapshot id="2423403" createTime="2018-11-29T14:48:46.206-05:00" sizeKb="108"/>
+ <snapshot id="2420843" createTime="2018-11-29T14:22:46.196-05:00" sizeKb="55"/>
+ <snapshot id="2419559" createTime="2018-11-29T14:09:46.517-05:00" sizeKb="295"/>
+ <snapshot id="2418156" createTime="2018-11-29T13:56:46.893-05:00" sizeKb="88"/>
+ <snapshot id="2416076" createTime="2018-11-29T13:35:39.890-05:00" sizeKb="20"/>
+ <snapshot id="2415596" createTime="2018-11-29T13:30:47.327-05:00" sizeKb="146"/>
+ <snapshot id="2413027" createTime="2018-11-29T13:04:47.542-05:00" sizeKb="214"/>
+ <snapshot id="2410444" createTime="2018-11-29T12:38:47.674-05:00" sizeKb="108"/>
+ <snapshot id="2407884" createTime="2018-11-29T12:12:47.920-05:00" sizeKb="200"/>
+ <snapshot id="2405305" createTime="2018-11-29T11:46:47.660-05:00" sizeKb="108"/>
+ <snapshot id="2402745" createTime="2018-11-29T11:20:48.156-05:00" sizeKb="655"/>
+ <snapshot id="2400112" createTime="2018-11-29T10:54:48.439-05:00" sizeKb="143"/>
+ <snapshot id="2397537" createTime="2018-11-29T10:28:49.248-05:00" sizeKb="171"/>
+ <snapshot id="2394955" createTime="2018-11-29T10:02:49.803-05:00" sizeKb="196"/>
+ <snapshot id="2392380" createTime="2018-11-29T09:36:49.330-05:00" sizeKb="108"/>
+ <snapshot id="2389820" createTime="2018-11-29T09:10:48.981-05:00" sizeKb="219"/>
+ <snapshot id="2387237" createTime="2018-11-29T08:44:48.757-05:00" sizeKb="108"/>
+ <snapshot id="2384677" createTime="2018-11-29T08:18:48.842-05:00" sizeKb="226"/>
+ <snapshot id="2382089" createTime="2018-11-29T07:52:49.407-05:00" sizeKb="108"/>
+ <snapshot id="2379529" createTime="2018-11-29T07:26:49.154-05:00" sizeKb="200"/>
+ <snapshot id="2376950" createTime="2018-11-29T07:00:49.669-05:00" sizeKb="108"/>
+ <snapshot id="2374390" createTime="2018-11-29T06:34:50.271-05:00" sizeKb="130"/>
+ <snapshot id="2371821" createTime="2018-11-29T06:08:50.573-05:00" sizeKb="240"/>
+ <snapshot id="2369231" createTime="2018-11-29T05:42:50.281-05:00" sizeKb="108"/>
+ <snapshot id="2366671" createTime="2018-11-29T05:16:51.055-05:00" sizeKb="151"/>
+ <snapshot id="2364099" createTime="2018-11-29T04:50:52.032-05:00" sizeKb="108"/>
+ <snapshot id="2361539" createTime="2018-11-29T04:24:52.037-05:00" sizeKb="235"/>
+ <snapshot id="2358950" createTime="2018-11-29T03:58:51.637-05:00" sizeKb="54"/>
+ <snapshot id="2357670" createTime="2018-11-29T03:45:51.760-05:00" sizeKb="2808"/>
+ <snapshot id="2356056" createTime="2018-11-29T03:32:51.657-05:00" sizeKb="108"/>
+ <snapshot id="2353496" createTime="2018-11-29T03:06:51.467-05:00" sizeKb="195"/>
+ <snapshot id="2350920" createTime="2018-11-29T02:40:51.090-05:00" sizeKb="108"/>
+ <snapshot id="2348360" createTime="2018-11-29T02:14:51.780-05:00" sizeKb="264"/>
+ <snapshot id="2345769" createTime="2018-11-29T01:48:52.282-05:00" sizeKb="108"/>
+ <snapshot id="2343209" createTime="2018-11-29T01:22:52.766-05:00" sizeKb="222"/>
+ <snapshot id="2340624" createTime="2018-11-29T00:56:53.151-05:00" sizeKb="108"/>
+ <snapshot id="2338064" createTime="2018-11-29T00:30:53.068-05:00" sizeKb="108"/>
+ <snapshot id="2335504" createTime="2018-11-29T00:04:53.181-05:00" sizeKb="213"/>
+</consistencyGroupSnapshots>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/facbea21/libcloud/test/compute/fixtures/nttcis/drs_start_failover_preview.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/nttcis/drs_start_failover_preview.xml b/libcloud/test/compute/fixtures/nttcis/drs_start_failover_preview.xml
new file mode 100644
index 0000000..353c223
--- /dev/null
+++ b/libcloud/test/compute/fixtures/nttcis/drs_start_failover_preview.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response xmlns="urn:didata.com:api:cloud:types" requestId="na_20181130T170150308-0500_cff36582-f930-4cd5-8909-17f447060707">
+ <operation>START_PREVIEW_SNAPSHOT</operation>
+ <responseCode>IN_PROGRESS</responseCode>
+ <message>Request to Start Preview Snapshot has been accepted. Please use appropriate Get or List API for status.</message>
+</response>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/facbea21/libcloud/test/compute/fixtures/nttcis/drs_stop_failover_preview.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/nttcis/drs_stop_failover_preview.xml b/libcloud/test/compute/fixtures/nttcis/drs_stop_failover_preview.xml
new file mode 100644
index 0000000..386b601
--- /dev/null
+++ b/libcloud/test/compute/fixtures/nttcis/drs_stop_failover_preview.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response xmlns="urn:didata.com:api:cloud:types" requestId="na_20181130T174221630-0500_91b9b2e4-5a9b-43be-aad2-4df7f58045ab">
+ <operation>STOP_PREVIEW_SNAPSHOT</operation>
+ <responseCode>IN_PROGRESS</responseCode>
+ <message>Request to Stop Preview Snapshot has been accepted. Please use appropriate Get or List API for status.</message>
+</response>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/facbea21/libcloud/test/compute/fixtures/nttcis/get_cg_by_name_or_id.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/nttcis/get_cg_by_name_or_id.xml b/libcloud/test/compute/fixtures/nttcis/get_cg_by_name_or_id.xml
new file mode 100644
index 0000000..9b594d5
--- /dev/null
+++ b/libcloud/test/compute/fixtures/nttcis/get_cg_by_name_or_id.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<consistencyGroups xmlns="urn:didata.com:api:cloud:types" pageNumber="1" pageCount="1" totalCount="1" pageSize="250">
+ <consistencyGroup id="195a426b-4559-4c79-849e-f22cdf2bfb6e">
+ <name>sdk_test2_cg</name>
+ <description>A test consistency group</description>
+ <journal sizeGb="100" extentCount="1"/>
+ <source datacenterId="NADRAASLAB01" networkDomainId="f9d6a249-c922-4fa1-9f0f-de5b452c4026">
+ <networkDomainName>DRS-ProdEng-East-ND1</networkDomainName>
+ </source>
+ <target datacenterId="NADRAASLAB02" networkDomainId="e46c8815-193f-402d-b8a5-682eaa646fb2">
+ <networkDomainName>DRS-ProdEng-West-ND1</networkDomainName>
+ </target>
+ <serverPair id="55416e8c-d198-4d33-a7f9-df7f30b8813b" state="NORMAL">
+ <sourceServer id="032f3967-00e4-4780-b4ef-8587460f9dd4" primaryNicIpv4="192.168.12.8" primaryNicIpv6="2607:f480:111:1426:3dc9:25dc:4985:81b2">
+ <name>src-sdk-test</name>
+ </sourceServer>
+ <targetServer id="aee58575-38e2-495f-89d3-854e6a886411" primaryNicIpv4="192.168.22.7" primaryNicIpv6="2607:f480:211:1159:2dff:40ed:ee7c:4738">
+ <name>tgt-sdk-test</name>
+ </targetServer>
+ </serverPair>
+ <createTime>2018-11-12T20:53:10.000Z</createTime>
+ <operationStatus>DRS_MODE</operationStatus>
+ <drsInfrastructure enabled="true" status="ACTIVE" updateTime="2018-11-29T17:55:02.000Z"/>
+ <drsStatusCheckFailureCount>0</drsStatusCheckFailureCount>
+ <state>NORMAL</state>
+ </consistencyGroup>
+</consistencyGroups>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/facbea21/libcloud/test/compute/fixtures/nttcis/list_consistency_groups.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/nttcis/list_consistency_groups.xml b/libcloud/test/compute/fixtures/nttcis/list_consistency_groups.xml
new file mode 100644
index 0000000..1ebc5b1
--- /dev/null
+++ b/libcloud/test/compute/fixtures/nttcis/list_consistency_groups.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<consistencyGroups xmlns="urn:didata.com:api:cloud:types" pageNumber="1" pageCount="2" totalCount="2" pageSize="250">
+ <consistencyGroup id="195a426b-4559-4c79-849e-f22cdf2bfb6e">
+ <name>sdk_test2_cg</name>
+ <description>A test consistency group</description>
+ <journal sizeGb="100" extentCount="1"/>
+ <source datacenterId="NADRAASLAB01" networkDomainId="f9d6a249-c922-4fa1-9f0f-de5b452c4026">
+ <networkDomainName>DRS-ProdEng-East-ND1</networkDomainName>
+ </source>
+ <target datacenterId="NADRAASLAB02" networkDomainId="e46c8815-193f-402d-b8a5-682eaa646fb2">
+ <networkDomainName>DRS-ProdEng-West-ND1</networkDomainName>
+ </target>
+ <serverPair id="55416e8c-d198-4d33-a7f9-df7f30b8813b" state="NORMAL">
+ <sourceServer id="032f3967-00e4-4780-b4ef-8587460f9dd4" primaryNicIpv4="192.168.12.8" primaryNicIpv6="2607:f480:111:1426:3dc9:25dc:4985:81b2">
+ <name>src-sdk-test</name>
+ </sourceServer>
+ <targetServer id="aee58575-38e2-495f-89d3-854e6a886411" primaryNicIpv4="192.168.22.7" primaryNicIpv6="2607:f480:211:1159:2dff:40ed:ee7c:4738">
+ <name>tgt-sdk-test</name>
+ </targetServer>
+ </serverPair>
+ <createTime>2018-11-12T20:53:10.000Z</createTime>
+ <operationStatus>DRS_MODE</operationStatus>
+ <drsInfrastructure enabled="true" status="ACTIVE" updateTime="2018-11-29T17:25:02.000Z"/>
+ <drsStatusCheckFailureCount>0</drsStatusCheckFailureCount>
+ <state>NORMAL</state>
+ </consistencyGroup>
+ <consistencyGroup id="90fc8db6-0207-443d-9c2c-04b19eb9fd6b">
+ <name>CG-Re-IP-Scenario-2</name>
+ <description>CG-Re-IP-Scenario-2</description>
+ <journal sizeGb="100" extentCount="1"/>
+ <source datacenterId="NADRAASLAB01" networkDomainId="f9d6a249-c922-4fa1-9f0f-de5b452c4026">
+ <networkDomainName>DRS-ProdEng-East-ND1</networkDomainName>
+ </source>
+ <target datacenterId="NADRAASLAB02" networkDomainId="e46c8815-193f-402d-b8a5-682eaa646fb2">
+ <networkDomainName>DRS-ProdEng-West-ND1</networkDomainName>
+ </target>
+ <serverPair id="a041f587-982e-49dc-9db8-1b987a0ee7b6" state="NORMAL">
+ <sourceServer id="6a15da8a-ea2c-4938-bca4-2c5e66355c8c" primaryNicIpv4="192.168.12.6" primaryNicIpv6="2607:f480:111:1426:87:6706:e811:f182">
+ <name>Src-Re-IP-RHEL7</name>
+ </sourceServer>
+ <targetServer id="f55aef9f-ed6f-40bd-a00d-33fb184d5838" primaryNicIpv4="192.168.22.6" primaryNicIpv6="2607:f480:211:1159:76b:dce4:a3f6:ad8b">
+ <name>Tgt-Re-IP-RHEL7</name>
+ </targetServer>
+ </serverPair>
+ <createTime>2018-11-16T15:41:48.000Z</createTime>
+ <operationStatus>DRS_MODE</operationStatus>
+ <drsInfrastructure enabled="true" status="ACTIVE" updateTime="2018-11-29T17:25:02.000Z"/>
+ <drsStatusCheckFailureCount>0</drsStatusCheckFailureCount>
+ <state>NORMAL</state>
+ </consistencyGroup>
+</consistencyGroups>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/facbea21/libcloud/test/compute/fixtures/nttcis/list_drs_snapshots.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/nttcis/list_drs_snapshots.xml b/libcloud/test/compute/fixtures/nttcis/list_drs_snapshots.xml
new file mode 100644
index 0000000..d149b98
--- /dev/null
+++ b/libcloud/test/compute/fixtures/nttcis/list_drs_snapshots.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<consistencyGroupSnapshots xmlns="urn:didata.com:api:cloud:types" totalCount="1014" journalUsageGb="0.34" protectionWindow="P0Y0M16DT21H40M23.820S" predictedProtectionWindow="P13Y4M12DT8H43M55.927S">
+ <snapshot id="2416511" createTime="2018-11-29T13:40:04.687-05:00" sizeKb="0"/>
+ <snapshot id="2416506" createTime="2018-11-29T13:40:01.645-05:00" sizeKb="18"/>
+ <snapshot id="2416076" createTime="2018-11-29T13:35:39.890-05:00" sizeKb="20"/>
+ <snapshot id="2415596" createTime="2018-11-29T13:30:47.327-05:00" sizeKb="146"/>
+ <snapshot id="2413027" createTime="2018-11-29T13:04:47.542-05:00" sizeKb="214"/>
+ <snapshot id="2410444" createTime="2018-11-29T12:38:47.674-05:00" sizeKb="108"/>
+ <snapshot id="2407884" createTime="2018-11-29T12:12:47.920-05:00" sizeKb="200"/>
+ <snapshot id="2405305" createTime="2018-11-29T11:46:47.660-05:00" sizeKb="108"/>
+ <snapshot id="2402745" createTime="2018-11-29T11:20:48.156-05:00" sizeKb="57"/>
+ <snapshot id="2401461" createTime="2018-11-29T11:07:48.186-05:00" sizeKb="597"/>
+ <snapshot id="2400112" createTime="2018-11-29T10:54:48.439-05:00" sizeKb="143"/>
+ <snapshot id="2397537" createTime="2018-11-29T10:28:49.248-05:00" sizeKb="171"/>
+ <snapshot id="2394955" createTime="2018-11-29T10:02:49.803-05:00" sizeKb="196"/>
+ <snapshot id="2392380" createTime="2018-11-29T09:36:49.330-05:00" sizeKb="108"/>
+ <snapshot id="2389820" createTime="2018-11-29T09:10:48.981-05:00" sizeKb="219"/>
+ <snapshot id="2387237" createTime="2018-11-29T08:44:48.757-05:00" sizeKb="108"/>
+ <snapshot id="2384677" createTime="2018-11-29T08:18:48.842-05:00" sizeKb="226"/>
+ <snapshot id="2382089" createTime="2018-11-29T07:52:49.407-05:00" sizeKb="108"/>
+ <snapshot id="2379529" createTime="2018-11-29T07:26:49.154-05:00" sizeKb="200"/>
+ <snapshot id="2376950" createTime="2018-11-29T07:00:49.669-05:00" sizeKb="108"/>
+ <snapshot id="2374390" createTime="2018-11-29T06:34:50.271-05:00" sizeKb="130"/>
+ <snapshot id="2371821" createTime="2018-11-29T06:08:50.573-05:00" sizeKb="240"/>
+ <snapshot id="2369231" createTime="2018-11-29T05:42:50.281-05:00" sizeKb="108"/>
+ <snapshot id="2366671" createTime="2018-11-29T05:16:51.055-05:00" sizeKb="151"/>
+ <snapshot id="2364099" createTime="2018-11-29T04:50:52.032-05:00" sizeKb="108"/>
+ <snapshot id="2361539" createTime="2018-11-29T04:24:52.037-05:00" sizeKb="235"/>
+ <snapshot id="2358950" createTime="2018-11-29T03:58:51.637-05:00" sizeKb="54"/>
+ <snapshot id="2357670" createTime="2018-11-29T03:45:51.760-05:00" sizeKb="2808"/>
+ <snapshot id="2356056" createTime="2018-11-29T03:32:51.657-05:00" sizeKb="108"/>
+ <snapshot id="2353496" createTime="2018-11-29T03:06:51.467-05:00" sizeKb="195"/>
+ <snapshot id="2350920" createTime="2018-11-29T02:40:51.090-05:00" sizeKb="108"/>
+ <snapshot id="2348360" createTime="2018-11-29T02:14:51.780-05:00" sizeKb="264"/>
+ <snapshot id="2345769" createTime="2018-11-29T01:48:52.282-05:00" sizeKb="108"/>
+ <snapshot id="2343209" createTime="2018-11-29T01:22:52.766-05:00" sizeKb="222"/>
+ <snapshot id="2340624" createTime="2018-11-29T00:56:53.151-05:00" sizeKb="108"/>
+ <snapshot id="2338064" createTime="2018-11-29T00:30:53.068-05:00" sizeKb="108"/>
+ <snapshot id="2335504" createTime="2018-11-29T00:04:53.181-05:00" sizeKb="213"/>
+ <snapshot id="2332925" createTime="2018-11-28T23:38:53.648-05:00" sizeKb="108"/>
+ <snapshot id="2330365" createTime="2018-11-28T23:12:54.848-05:00" sizeKb="219"/>
+ <snapshot id="2327779" createTime="2018-11-28T22:46:55.800-05:00" sizeKb="121"/>
+ <snapshot id="2325213" createTime="2018-11-28T22:20:55.562-05:00" sizeKb="208"/>
+ <snapshot id="2322630" createTime="2018-11-28T21:54:56.854-05:00" sizeKb="108"/>
+ <snapshot id="2320070" createTime="2018-11-28T21:28:57.084-05:00" sizeKb="134"/>
+ <snapshot id="2317498" createTime="2018-11-28T21:02:57.166-05:00" sizeKb="200"/>
+ <snapshot id="2314922" createTime="2018-11-28T20:36:57.524-05:00" sizeKb="108"/>
+ <snapshot id="2312362" createTime="2018-11-28T20:10:59.006-05:00" sizeKb="200"/>
+ <snapshot id="2309783" createTime="2018-11-28T19:44:59.463-05:00" sizeKb="108"/>
+ <snapshot id="2307223" createTime="2018-11-28T19:18:59.395-05:00" sizeKb="261"/>
+ <snapshot id="2304625" createTime="2018-11-28T18:52:59.396-05:00" sizeKb="108"/>
+ <snapshot id="2302065" createTime="2018-11-28T18:27:00.846-05:00" sizeKb="230"/>
+ <snapshot id="2299476" createTime="2018-11-28T18:01:00.974-05:00" sizeKb="108"/>
+ <snapshot id="2296916" createTime="2018-11-28T17:35:01.362-05:00" sizeKb="343"/>
+ <snapshot id="2294318" createTime="2018-11-28T17:09:01.650-05:00" sizeKb="235"/>
+ <snapshot id="2291728" createTime="2018-11-28T16:43:02.315-05:00" sizeKb="108"/>
+ <snapshot id="2289168" createTime="2018-11-28T16:17:02.322-05:00" sizeKb="214"/>
+ <snapshot id="2286587" createTime="2018-11-28T15:51:02.819-05:00" sizeKb="108"/>
+ <snapshot id="2284027" createTime="2018-11-28T15:25:02.998-05:00" sizeKb="167"/>
+ <snapshot id="2281452" createTime="2018-11-28T14:59:02.734-05:00" sizeKb="111"/>
+ <snapshot id="2278888" createTime="2018-11-28T14:33:03.398-05:00" sizeKb="105"/>
+ <snapshot id="2277599" createTime="2018-11-28T14:20:03.124-05:00" sizeKb="1142"/>
+ <snapshot id="2276214" createTime="2018-11-28T14:07:02.998-05:00" sizeKb="211"/>
+ <snapshot id="2273629" createTime="2018-11-28T13:41:03.464-05:00" sizeKb="108"/>
+ <snapshot id="2271069" createTime="2018-11-28T13:15:03.119-05:00" sizeKb="200"/>
+ <snapshot id="2268490" createTime="2018-11-28T12:49:05.695-05:00" sizeKb="108"/>
+ <snapshot id="2265930" createTime="2018-11-28T12:23:06.184-05:00" sizeKb="264"/>
+ <snapshot id="2263333" createTime="2018-11-28T11:57:06.200-05:00" sizeKb="108"/>
+ <snapshot id="2260773" createTime="2018-11-28T11:31:07.442-05:00" sizeKb="108"/>
+ <snapshot id="2258213" createTime="2018-11-28T11:05:07.440-05:00" sizeKb="641"/>
+ <snapshot id="2255583" createTime="2018-11-28T10:39:09.091-05:00" sizeKb="168"/>
+ <snapshot id="2253005" createTime="2018-11-28T10:13:08.800-05:00" sizeKb="263"/>
+ <snapshot id="2250405" createTime="2018-11-28T09:47:08.754-05:00" sizeKb="108"/>
+ <snapshot id="2247845" createTime="2018-11-28T09:21:09.153-05:00" sizeKb="205"/>
+ <snapshot id="2245264" createTime="2018-11-28T08:55:09.099-05:00" sizeKb="108"/>
+ <snapshot id="2242704" createTime="2018-11-28T08:29:08.941-05:00" sizeKb="134"/>
+ <snapshot id="2240132" createTime="2018-11-28T08:03:09.231-05:00" sizeKb="200"/>
+ <snapshot id="2237556" createTime="2018-11-28T07:37:09.816-05:00" sizeKb="108"/>
+ <snapshot id="2234996" createTime="2018-11-28T07:11:09.962-05:00" sizeKb="200"/>
+ <snapshot id="2232417" createTime="2018-11-28T06:45:10.052-05:00" sizeKb="108"/>
+</consistencyGroupSnapshots>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/facbea21/libcloud/test/compute/test_nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_nttcis.py b/libcloud/test/compute/test_nttcis.py
index 7f73473..cbc4fdb 100644
--- a/libcloud/test/compute/test_nttcis.py
+++ b/libcloud/test/compute/test_nttcis.py
@@ -1,5 +1,5 @@
import pytest
-
+from dateutil.parser import parse
import sys
from types import GeneratorType
@@ -1844,6 +1844,82 @@ def test_ex_list_tags_ALLPARAMS(driver):
assert len(tags) == 3
+def test_list_consistency_groups(driver):
+ cgs = driver.list_consistency_groups()
+ assert isinstance(cgs, list)
+
+
+def test_list_cg_by_src_net_domain(driver):
+ nd = "f9d6a249-c922-4fa1-9f0f-de5b452c4026"
+ cgs = driver.list_consistency_groups(source_network_domain_id=nd)
+ assert cgs[0].name == "sdk_test2_cg"
+
+
+def test_list_cg_by_name(driver):
+ NttCisMockHttp.type = "CG_BY_NAME"
+ name = "sdk_test2_cg"
+ cg = driver.list_consistency_groups(name=name)
+ assert cg[0].id == "195a426b-4559-4c79-849e-f22cdf2bfb6e"
+
+
+def test_get_consistency_group_by_id(driver):
+ NttCisMockHttp.type = None
+ cgs = driver.list_consistency_groups()
+ cg_id = [i for i in cgs if i.name == "sdk_test2_cg"][0].id
+ cg = driver.get_consistency_group(cg_id)
+ assert hasattr(cg, 'description')
+
+
+def test_get_drs_snapshots(driver):
+ NttCisMockHttp.type = None
+ cgs = driver.list_consistency_groups()
+ cg_id = [i for i in cgs if i.name == "sdk_test2_cg"][0].id
+ snaps = driver.list_consistency_group_snapshots(cg_id)
+ assert hasattr(snaps, 'journalUsageGb')
+
+
+def test_get_drs_snapshots_by_min_max(driver):
+ cgs = driver.list_consistency_groups()
+ cg_id = [i for i in cgs if i.name == "sdk_test2_cg"][0].id
+ snaps = driver.list_consistency_group_snapshots(
+ cg_id,
+ create_time_min="2018-11-28T00:00:00.000Z",
+ create_time_max="2018-11-29T00:00:00.000Z")
+ for snap in snaps.snapshot:
+ assert (parse(snaps.snapshot[0].createTime) < parse(snap.createTime)) is False
+
+
+def test_get_drs_snapshots_by_min(driver):
+ cgs = driver.list_consistency_groups()
+ cg_id = [i for i in cgs if i.name == "sdk_test2_cg"][0].id
+ snaps = driver.list_consistency_group_snapshots(
+ cg_id,
+ create_time_min="2018-11-29T00:00:00.000-05:00")
+ for snap in snaps.snapshot:
+ assert (parse(snaps.snapshot[0].createTime) < parse(snap.createTime)) is False
+
+
+def test_expand_drs_journal(driver):
+ cgs = driver.list_consistency_groups(name="sdk_test2_cg")
+ cg_id = cgs[0].id
+ expand_by = "100"
+ result = driver.expand_journal(cg_id, expand_by)
+ assert result is True
+
+
+def test_start_drs_snapshot_preview(driver):
+ cg_id = "195a426b-4559-4c79-849e-f22cdf2bfb6e"
+ snapshot_id = "3893"
+ result = driver.start_drs_failover_preview(cg_id, snapshot_id)
+ assert result is True
+
+
+def test_stop_drs_snapshot_preivew(driver):
+ cg_id = "195a426b-4559-4c79-849e-f22cdf2bfb6e"
+ result = driver.stop_drs_failover_preview(cg_id)
+ assert result is True
+
+
class InvalidRequestError(Exception):
def __init__(self, tag):
super(InvalidRequestError, self).__init__("Invalid Request - %s" % tag)
@@ -1872,6 +1948,22 @@ class NttCisMockHttp(MockHttp):
body = self.fixtures.load('oec_0_9_myaccount.xml')
return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+ def _oec_0_9_myaccount_NET_DOMAIN(self, method, url, body, headers):
+ body = self.fixtures.load('oec_0_9_myaccount.xml')
+ return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+ def _oec_0_9_myaccount_CG_BY_NAME(self, method, url, body, headers):
+ body = self.fixtures.load('oec_0_9_myaccount.xml')
+ return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+ def _oec_0_9_myaccount_MIN_MAX(self, method, url, body, headers):
+ body = self.fixtures.load('oec_0_9_myaccount.xml')
+ return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+ def _oec_0_9_myaccount_MIN(self, method, url, body, headers):
+ body = self.fixtures.load('oec_0_9_myaccount.xml')
+ return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation(self, method, url, body, headers):
body = self.fixtures.load(
'networkWithLocation.xml')
@@ -2107,7 +2199,7 @@ class NttCisMockHttp(MockHttp):
'server_startServer_INPROGRESS.xml')
return (httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK])
- def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_shutdownServer(self, method, url, body, headers):
+ def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_sna_compute_hutdownServer(self, method, url, body, headers):
request = ET.fromstring(body)
if request.tag != "{urn:didata.com:api:cloud:types}shutdownServer":
raise InvalidRequestError(request.tag)
@@ -3108,3 +3200,73 @@ class NttCisMockHttp(MockHttp):
"disable_server_snapshot_service.xml"
)
return httplib.OK, body, {}, httplib.responses[httplib.OK]
+
+ def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_consistencyGroup(
+ self, method, url, body, headers):
+ body = self.fixtures.load(
+ "list_consistency_groups.xml"
+ )
+ return httplib.OK, body, {}, httplib.responses[httplib.OK]
+
+ def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_consistencyGroup_NET_DOMAIN(
+ self, method, url, body, headers):
+ body = self.fixtures.load(
+ "cg_by_src_network_domain.xml"
+ )
+ return httplib.OK, body, {}, httplib.responses[httplib.OK]
+
+ def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_consistencyGroup_CG_BY_NAME(
+ self, method, url, body, headers):
+ body = self.fixtures.load(
+ "get_cg_by_name_or_id.xml"
+ )
+ return httplib.OK, body, {}, httplib.responses[httplib.OK]
+
+ def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_consistencyGroup_195a426b_4559_4c79_849e_f22cdf2bfb6e(
+ self, method, url, body, headers):
+ body = self.fixtures.load(
+ "get_cg_by_name_or_id.xml"
+ )
+ return httplib.OK, body, {}, httplib.responses[httplib.OK]
+
+ def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_snapshot(
+ self, method, url, body, headers):
+ body = self.fixtures.load(
+ "list_drs_snapshots.xml"
+ )
+ return httplib.OK, body, {}, httplib.responses[httplib.OK]
+
+ def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_snapshot_MIN_MAX(
+ self, method, url, body, headers):
+ body = self.fixtures.load(
+ "drs_snap_shots_by_min_max_time.xml"
+ )
+ return httplib.OK, body, {}, httplib.responses[httplib.OK]
+
+ def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_snapshot_MIN(
+ self, method, url, body, headers):
+ body = self.fixtures.load(
+ "drs_snap_shots_by_min.xml"
+ )
+ return httplib.OK, body, {}, httplib.responses[httplib.OK]
+
+ def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_expandJournal(
+ self, method, url, body, headers):
+ body = self.fixtures.load(
+ "drs_expand_journal.xml"
+ )
+ return httplib.OK, body, {}, httplib.responses[httplib.OK]
+
+ def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_startPreviewSnapshot(
+ self, method, url, body, headers):
+ body = self.fixtures.load(
+ "drs_start_failover_preview.xml"
+ )
+ return httplib.OK, body, {}, httplib.responses[httplib.OK]
+
+ def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_stopPreviewSnapshot(
+ self, method, url, body, headers):
+ body = self.fixtures.load(
+ "drs_stop_failover_preview.xml"
+ )
+ return httplib.OK, body, {}, httplib.responses[httplib.OK]
[15/21] libcloud git commit: Added 'ex' prefix to all DRS related
methods
Posted by an...@apache.org.
Added 'ex' prefix to all DRS related methods
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/cf27a09f
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/cf27a09f
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/cf27a09f
Branch: refs/heads/trunk
Commit: cf27a09f4c76a320e9baf19fda7ea81b044ca1a1
Parents: da71f40
Author: mitch <mi...@itaas.dimensiondata.com>
Authored: Tue Dec 18 17:32:50 2018 -0500
Committer: mitch <mi...@itaas.dimensiondata.com>
Committed: Tue Dec 18 17:32:50 2018 -0500
----------------------------------------------------------------------
libcloud/compute/drivers/nttcis.py | 18 +++++++--------
libcloud/test/compute/test_nttcis.py | 38 +++++++++++++++----------------
2 files changed, 28 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/cf27a09f/libcloud/compute/drivers/nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/nttcis.py b/libcloud/compute/drivers/nttcis.py
index 9ac0f36..2b86fda 100644
--- a/libcloud/compute/drivers/nttcis.py
+++ b/libcloud/compute/drivers/nttcis.py
@@ -4650,7 +4650,7 @@ class NttCisNodeDriver(NodeDriver):
return new_node
# DRS methods
- def create_consistency_group(self, name, journal_size_gb,
+ def ex_create_consistency_group(self, name, journal_size_gb,
source_server_id, target_server_id,
description=None):
"""
@@ -4690,7 +4690,7 @@ class NttCisNodeDriver(NodeDriver):
return response_code in ['IN_PROGRESS', 'OK']
@get_params
- def list_consistency_groups(self, params={}):
+ def ex_list_consistency_groups(self, params={}):
"""
Functions takes a named parameter that must be one of the following
:param params: A dictionary composed of one of the following keys
@@ -4712,7 +4712,7 @@ class NttCisNodeDriver(NodeDriver):
cgs = self._to_consistency_groups(response)
return cgs
- def get_consistency_group(self, consistency_group_id):
+ def ex_get_consistency_group(self, consistency_group_id):
"""
Retrieves a Consistency by it's id and is more efficient thatn listing
all consistency groups and filtering that result.
@@ -4726,7 +4726,7 @@ class NttCisNodeDriver(NodeDriver):
cg = self._to_process(response)
return cg
- def list_consistency_group_snapshots(self, consistency_group_id,
+ def ex_list_consistency_group_snapshots(self, consistency_group_id,
create_time_min=None,
create_time_max=None):
"""
@@ -4778,7 +4778,7 @@ class NttCisNodeDriver(NodeDriver):
snapshots = self._to_process(paged_result)
return snapshots
- def expand_journal(self, consistency_group_id, size_gb):
+ def ex_expand_journal(self, consistency_group_id, size_gb):
"""
Expand the consistency group's journhal size in 100Gb increments
:param consistency_group_id: The consistency group's UUID
@@ -4798,7 +4798,7 @@ class NttCisNodeDriver(NodeDriver):
response_code = findtext(response, 'responseCode', TYPES_URN)
return response_code in ['IN_PROGRESS', 'OK']
- def start_drs_failover_preview(self, consistency_group_id, snapshot_id):
+ def ex_start_drs_failover_preview(self, consistency_group_id, snapshot_id):
"""
Brings a Consistency Group into PREVIEWING_SNAPSHOT mode
@@ -4822,7 +4822,7 @@ class NttCisNodeDriver(NodeDriver):
response_code = findtext(response, 'responseCode', TYPES_URN)
return response_code in ['IN_PROGRESS', 'OK']
- def stop_drs_failover_preview(self, consistency_group_id):
+ def ex_stop_drs_failover_preview(self, consistency_group_id):
"""
Takes a Consistency Group out of PREVIEW_MODE and back to DRS_MODE
@@ -4841,7 +4841,7 @@ class NttCisNodeDriver(NodeDriver):
response_code = findtext(response, 'responseCode', TYPES_URN)
return response_code in ['IN_PROGRESS', 'OK']
- def initiate_drs_failover(self, consistency_group_id):
+ def ex_initiate_drs_failover(self, consistency_group_id):
"""
This method is irreversible.
It will failover the Consistency Group while removing it as well.
@@ -4861,7 +4861,7 @@ class NttCisNodeDriver(NodeDriver):
response_code = findtext(response, "responseCode", TYPES_URN)
return response_code in ["IN_PROGRESS", "OK"]
- def delete_consistency_group(self, consistency_group_id):
+ def ex_delete_consistency_group(self, consistency_group_id):
"""
Delete's a Consistency Group
http://git-wip-us.apache.org/repos/asf/libcloud/blob/cf27a09f/libcloud/test/compute/test_nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_nttcis.py b/libcloud/test/compute/test_nttcis.py
index 35c7eac..5e54131 100644
--- a/libcloud/test/compute/test_nttcis.py
+++ b/libcloud/test/compute/test_nttcis.py
@@ -1839,44 +1839,44 @@ def test_ex_list_tags_ALLPARAMS(driver):
def test_list_consistency_groups(driver):
- cgs = driver.list_consistency_groups()
+ cgs = driver.ex_list_consistency_groups()
assert isinstance(cgs, list)
def test_list_cg_by_src_net_domain(driver):
nd = "f9d6a249-c922-4fa1-9f0f-de5b452c4026"
- cgs = driver.list_consistency_groups(source_network_domain_id=nd)
+ cgs = driver.ex_list_consistency_groups(source_network_domain_id=nd)
assert cgs[0].name == "sdk_test2_cg"
def test_list_cg_by_name(driver):
NttCisMockHttp.type = "CG_BY_NAME"
name = "sdk_test2_cg"
- cg = driver.list_consistency_groups(name=name)
+ cg = driver.ex_list_consistency_groups(name=name)
assert cg[0].id == "195a426b-4559-4c79-849e-f22cdf2bfb6e"
def test_get_consistency_group_by_id(driver):
NttCisMockHttp.type = None
- cgs = driver.list_consistency_groups()
+ cgs = driver.ex_list_consistency_groups()
cg_id = [i for i in cgs if i.name == "sdk_test2_cg"][0].id
- cg = driver.get_consistency_group(cg_id)
+ cg = driver.ex_get_consistency_group(cg_id)
assert hasattr(cg, 'description')
def test_get_drs_snapshots(driver):
NttCisMockHttp.type = None
- cgs = driver.list_consistency_groups()
+ cgs = driver.ex_list_consistency_groups()
cg_id = [i for i in cgs if i.name == "sdk_test2_cg"][0].id
- snaps = driver.list_consistency_group_snapshots(cg_id)
+ snaps = driver.ex_list_consistency_group_snapshots(cg_id)
assert hasattr(snaps, 'journalUsageGb')
assert isinstance(snaps, ClassFactory)
def test_get_drs_snapshots_by_min_max(driver):
- cgs = driver.list_consistency_groups()
+ cgs = driver.ex_list_consistency_groups()
cg_id = [i for i in cgs if i.name == "sdk_test2_cg"][0].id
- snaps = driver.list_consistency_group_snapshots(
+ snaps = driver.ex_list_consistency_group_snapshots(
cg_id,
create_time_min="2018-11-28T00:00:00.000Z",
create_time_max="2018-11-29T00:00:00.000Z")
@@ -1885,23 +1885,23 @@ def test_get_drs_snapshots_by_min_max(driver):
def test_expand_drs_journal(driver):
- cgs = driver.list_consistency_groups(name="sdk_test2_cg")
+ cgs = driver.ex_list_consistency_groups(name="sdk_test2_cg")
cg_id = cgs[0].id
expand_by = "100"
- result = driver.expand_journal(cg_id, expand_by)
+ result = driver.ex_expand_journal(cg_id, expand_by)
assert result is True
def test_start_drs_snapshot_preview(driver):
cg_id = "195a426b-4559-4c79-849e-f22cdf2bfb6e"
snapshot_id = "3893"
- result = driver.start_drs_failover_preview(cg_id, snapshot_id)
+ result = driver.ex_start_drs_failover_preview(cg_id, snapshot_id)
assert result is True
def test_stop_drs_snapshot_preivew(driver):
cg_id = "195a426b-4559-4c79-849e-f22cdf2bfb6e"
- result = driver.stop_drs_failover_preview(cg_id)
+ result = driver.ex_stop_drs_failover_preview(cg_id)
assert result is True
@@ -1909,13 +1909,13 @@ def test_start_drs_failover_invalid_status(driver):
NttCisMockHttp.type = "INVALID_STATUS"
cg_id = "195a426b-4559-4c79-849e-f22cdf2bfb6e"
with pytest.raises(NttCisAPIException) as excinfo:
- result = driver.initiate_drs_failover(cg_id)
+ result = driver.ex_initiate_drs_failover(cg_id)
assert "INVALID_STATUS" in excinfo.value.code
def test_initiate_drs_failover(driver):
cg_id = "195a426b-4559-4c79-849e-f22cdf2bfb6e"
- result = driver.initiate_drs_failover(cg_id)
+ result = driver.ex_initiate_drs_failover(cg_id)
assert result is True
@@ -1924,7 +1924,7 @@ def test_create_drs_fail_not_supported(driver):
src_id = "032f3967-00e4-4780-b4ef-8587460f9dd4"
target_id = "aee58575-38e2-495f-89d3-854e6a886411"
with pytest.raises(NttCisAPIException) as excinfo:
- result = driver.create_consistency_group(
+ result = driver.ex_create_consistency_group(
"sdk_cg", "100", src_id, target_id, description="A test consistency group")
exception_msg = excinfo.value.msg
assert exception_msg == 'DRS is not supported between source Data Center NA9 and target Data Center NA12.'
@@ -1935,7 +1935,7 @@ def test_create_drs_cg_fail_ineligble(driver):
src_id = "032f3967-00e4-4780-b4ef-8587460f9dd4"
target_id = "aee58575-38e2-495f-89d3-854e6a886411"
with pytest.raises(NttCisAPIException) as excinfo:
- driver.create_consistency_group(
+ driver.ex_create_consistency_group(
"sdk_test2_cg", "100", src_id, target_id, description="A test consistency group")
exception_msg = excinfo.value.msg
assert exception_msg == 'The drsEligible flag for target Server aee58575-38e2-495f-89d3-854e6a886411 must be set.'
@@ -1944,14 +1944,14 @@ def test_create_drs_cg_fail_ineligble(driver):
def test_create_drs_cg(driver):
src_id = "032f3967-00e4-4780-b4ef-8587460f9dd4"
target_id = "aee58575-38e2-495f-89d3-854e6a886411"
- result = driver.create_consistency_group(
+ result = driver.ex_create_consistency_group(
"sdk_test2_cg2", "100", src_id, target_id, description="A test consistency group")
assert result is True
def test_delete_consistency_group(driver):
cg_id = "fad067be-6ca7-495d-99dc-7921c5f2ca5"
- result = driver.delete_consistency_group(cg_id)
+ result = driver.ex_delete_consistency_group(cg_id)
assert result is True
[08/21] libcloud git commit: completed tests for drs without a drs
driver
Posted by an...@apache.org.
completed tests for drs without a drs driver
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/af20d390
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/af20d390
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/af20d390
Branch: refs/heads/trunk
Commit: af20d3901cac5b57e9c9e004430d755efd35517f
Parents: 4cdc28d
Author: mitch <mi...@itaas.dimensiondata.com>
Authored: Tue Dec 4 17:33:49 2018 -0500
Committer: mitch <mi...@itaas.dimensiondata.com>
Committed: Tue Dec 4 17:33:49 2018 -0500
----------------------------------------------------------------------
libcloud/compute/drivers/nttcis.py | 1 -
.../compute/fixtures/nttcis/drs_create_cg.xml | 7 ++
.../nttcis/drs_delete_consistency_group.xml | 6 ++
.../nttcis/drs_fail_create_cg_ineligible.xml | 6 ++
.../nttcis/drs_fail_create_cg_not_supported.xml | 6 ++
libcloud/test/compute/test_nttcis.py | 73 ++++++++++++++++++++
6 files changed, 98 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/af20d390/libcloud/compute/drivers/nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/nttcis.py b/libcloud/compute/drivers/nttcis.py
index 5dca8cd..9ac0f36 100644
--- a/libcloud/compute/drivers/nttcis.py
+++ b/libcloud/compute/drivers/nttcis.py
@@ -1017,7 +1017,6 @@ class NttCisNodeDriver(NodeDriver):
'urn:tag')
ET.SubElement(tag_elem,
'urn:tagKeyName').text = k
-
if v is not None:
ET.SubElement(tag_elem,
'urn:value').text = v
http://git-wip-us.apache.org/repos/asf/libcloud/blob/af20d390/libcloud/test/compute/fixtures/nttcis/drs_create_cg.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/nttcis/drs_create_cg.xml b/libcloud/test/compute/fixtures/nttcis/drs_create_cg.xml
new file mode 100644
index 0000000..425fba0
--- /dev/null
+++ b/libcloud/test/compute/fixtures/nttcis/drs_create_cg.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response xmlns="urn:didata.com:api:cloud:types" requestId="na_20181204T165435521-0500_b730567e-d306-40c5-a9a3-27b018f60fc7">
+ <operation>CREATE_CONSISTENCY_GROUP</operation>
+ <responseCode>IN_PROGRESS</responseCode>
+ <message>Request to Create Consistency Group has been accepted. Please use appropriate Get or List API for status.</message>
+ <info name="consistencyGroupId" value="fad067be-6ca7-495d-99dc-7921c5f2ca5d"/>
+</response>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/af20d390/libcloud/test/compute/fixtures/nttcis/drs_delete_consistency_group.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/nttcis/drs_delete_consistency_group.xml b/libcloud/test/compute/fixtures/nttcis/drs_delete_consistency_group.xml
new file mode 100644
index 0000000..c5fcffa
--- /dev/null
+++ b/libcloud/test/compute/fixtures/nttcis/drs_delete_consistency_group.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response xmlns="urn:didata.com:api:cloud:types" requestId="na_20181204T172637824-0500_811c25d4-69f6-4a33-a0fc-1594eb014d9f">
+ <operation>DELETE_CONSISTENCY_GROUP</operation>
+ <responseCode>IN_PROGRESS</responseCode>
+ <message>Request to Delete Consistency Group has been accepted. Please use appropriate Get or List API for status.</message>
+</response>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/af20d390/libcloud/test/compute/fixtures/nttcis/drs_fail_create_cg_ineligible.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/nttcis/drs_fail_create_cg_ineligible.xml b/libcloud/test/compute/fixtures/nttcis/drs_fail_create_cg_ineligible.xml
new file mode 100644
index 0000000..75f51ac
--- /dev/null
+++ b/libcloud/test/compute/fixtures/nttcis/drs_fail_create_cg_ineligible.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response xmlns="urn:didata.com:api:cloud:types" requestId="na_20181204T161623175-0500_9fd3e8ab-a3b2-4c7d-a00b-bba07141d22f">
+ <operation>CREATE_CONSISTENCY_GROUP</operation>
+ <responseCode>INCOMPATIBLE_OPERATION</responseCode>
+ <message>The drsEligible flag for target Server aee58575-38e2-495f-89d3-854e6a886411 must be set.</message>
+</response>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/af20d390/libcloud/test/compute/fixtures/nttcis/drs_fail_create_cg_not_supported.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/nttcis/drs_fail_create_cg_not_supported.xml b/libcloud/test/compute/fixtures/nttcis/drs_fail_create_cg_not_supported.xml
new file mode 100644
index 0000000..b78b5c8
--- /dev/null
+++ b/libcloud/test/compute/fixtures/nttcis/drs_fail_create_cg_not_supported.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response xmlns="urn:didata.com:api:cloud:types" requestId="na_20181204T160840695-0500_fef252f1-a72b-4674-85a6-076057f93e16">
+ <operation>CREATE_CONSISTENCY_GROUP</operation>
+ <responseCode>OPERATION_NOT_SUPPORTED</responseCode>
+ <message>DRS is not supported between source Data Center NA9 and target Data Center NA12.</message>
+</response>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/af20d390/libcloud/test/compute/test_nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_nttcis.py b/libcloud/test/compute/test_nttcis.py
index 2187b97..b88b4e1 100644
--- a/libcloud/test/compute/test_nttcis.py
+++ b/libcloud/test/compute/test_nttcis.py
@@ -1934,6 +1934,42 @@ def test_initiate_drs_failover(driver):
assert result is True
+def test_create_drs_fail_not_supported(driver):
+ NttCisMockHttp.type = "FAIL_NOT_SUPPORTED"
+ src_id = "032f3967-00e4-4780-b4ef-8587460f9dd4"
+ target_id = "aee58575-38e2-495f-89d3-854e6a886411"
+ with pytest.raises(NttCisAPIException) as excinfo:
+ result = driver.create_consistency_group(
+ "sdk_cg", "100", src_id, target_id, description="A test consistency group")
+ exception_msg = excinfo.value.msg
+ assert exception_msg == 'DRS is not supported between source Data Center NA9 and target Data Center NA12.'
+
+
+def test_create_drs_cg_fail_ineligble(driver):
+ NttCisMockHttp.type = "FAIL_INELIGIBLE"
+ src_id = "032f3967-00e4-4780-b4ef-8587460f9dd4"
+ target_id = "aee58575-38e2-495f-89d3-854e6a886411"
+ with pytest.raises(NttCisAPIException) as excinfo:
+ driver.create_consistency_group(
+ "sdk_test2_cg", "100", src_id, target_id, description="A test consistency group")
+ exception_msg = excinfo.value.msg
+ assert exception_msg == 'The drsEligible flag for target Server aee58575-38e2-495f-89d3-854e6a886411 must be set.'
+
+
+def test_create_drs_cg(driver):
+ src_id = "032f3967-00e4-4780-b4ef-8587460f9dd4"
+ target_id = "aee58575-38e2-495f-89d3-854e6a886411"
+ result = driver.create_consistency_group(
+ "sdk_test2_cg2", "100", src_id, target_id, description="A test consistency group")
+ assert result is True
+
+
+def test_delete_consistency_group(driver):
+ cg_id = "fad067be-6ca7-495d-99dc-7921c5f2ca5"
+ result = driver.delete_consistency_group(cg_id)
+ assert result is True
+
+
class InvalidRequestError(Exception):
def __init__(self, tag):
super(InvalidRequestError, self).__init__("Invalid Request - %s" % tag)
@@ -1982,6 +2018,14 @@ class NttCisMockHttp(MockHttp):
body = self.fixtures.load('oec_0_9_myaccount.xml')
return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+ def _oec_0_9_myaccount_FAIL_INELIGIBLE(self, method, url, body, headers):
+ body = self.fixtures.load('oec_0_9_myaccount.xml')
+ return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+ def _oec_0_9_myaccount_FAIL_NOT_SUPPORTED(self, method, url, body, headers):
+ body = self.fixtures.load('oec_0_9_myaccount.xml')
+ return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation(self, method, url, body, headers):
body = self.fixtures.load(
'networkWithLocation.xml')
@@ -3302,3 +3346,32 @@ class NttCisMockHttp(MockHttp):
"drs_initiate_failover.xml"
)
return httplib.OK, body, {}, httplib.responses[httplib.OK]
+
+ def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_createConsistencyGroup_FAIL_INELIGIBLE(
+ self, method, url, body, headers):
+ body = self.fixtures.load(
+ "drs_fail_create_cg_ineligible.xml"
+ )
+ return httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]
+
+ def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_createConsistencyGroup_FAIL_NOT_SUPPORTED(
+ self, method, url, body, headers):
+ body = self.fixtures.load(
+ "drs_fail_create_cg_not_supported.xml"
+ )
+ return httplib.BAD_REQUEST, body, {}, httplib.responses[httplib.OK]
+
+ def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_createConsistencyGroup(
+ self, method, url, body, headers):
+ body = self.fixtures.load(
+ "drs_create_cg.xml"
+ )
+ return httplib.OK, body, {}, httplib.responses[httplib.OK]
+
+ def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_consistencyGroup_deleteConsistencyGroup(
+ self, method, url, body, headers):
+ body = self.fixtures.load(
+ "drs_delete_consistency_group.xml"
+ )
+ return httplib.OK, body, {}, httplib.responses[httplib.OK]
+
[14/21] libcloud git commit: added an extra assertion to DRS tests
Posted by an...@apache.org.
added an extra assertion to DRS tests
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/da71f405
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/da71f405
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/da71f405
Branch: refs/heads/trunk
Commit: da71f4055ddeffbb60b7187e93618d99c7c541ba
Parents: a14a2d9
Author: mitch <mi...@itaas.dimensiondata.com>
Authored: Thu Dec 13 17:58:37 2018 -0500
Committer: mitch <mi...@itaas.dimensiondata.com>
Committed: Thu Dec 13 17:58:37 2018 -0500
----------------------------------------------------------------------
libcloud/test/compute/test_nttcis.py | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/da71f405/libcloud/test/compute/test_nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_nttcis.py b/libcloud/test/compute/test_nttcis.py
index 8fa8a53..35c7eac 100644
--- a/libcloud/test/compute/test_nttcis.py
+++ b/libcloud/test/compute/test_nttcis.py
@@ -8,6 +8,7 @@ from libcloud.common.nttcis import NttCisServerCpuSpecification, NttCisServerDis
from libcloud.common.nttcis import NttCisTag, NttCisTagKey
from libcloud.common.nttcis import NttCisServerCpuSpecification
from libcloud.common.nttcis import NttCisServerDisk
+from libcloud.common.nttcis import ClassFactory
from libcloud.common.nttcis import TYPES_URN
from libcloud.compute.drivers.nttcis import NttCisNodeDriver as NttCis
from libcloud.compute.drivers.nttcis import NttCisNic
@@ -1869,6 +1870,7 @@ def test_get_drs_snapshots(driver):
cg_id = [i for i in cgs if i.name == "sdk_test2_cg"][0].id
snaps = driver.list_consistency_group_snapshots(cg_id)
assert hasattr(snaps, 'journalUsageGb')
+ assert isinstance(snaps, ClassFactory)
def test_get_drs_snapshots_by_min_max(driver):
@@ -1882,16 +1884,6 @@ def test_get_drs_snapshots_by_min_max(driver):
assert "2018-12" not in snap
-def test_get_drs_snapshots_by_min(driver):
- cgs = driver.list_consistency_groups()
- cg_id = [i for i in cgs if i.name == "sdk_test2_cg"][0].id
- snaps = driver.list_consistency_group_snapshots(
- cg_id,
- create_time_min="2018-11-29T00:00:00.000-05:00")
- for snap in snaps.snapshot:
- assert (parse(snaps.snapshot[0].createTime) < parse(snap.createTime)) is False
-
-
def test_expand_drs_journal(driver):
cgs = driver.list_consistency_groups(name="sdk_test2_cg")
cg_id = cgs[0].id
@@ -2019,6 +2011,10 @@ class NttCisMockHttp(MockHttp):
body = self.fixtures.load('oec_0_9_myaccount.xml')
return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+ def _oec_0_9_myaccount_DYNAMIC(self, method, url, body, headers):
+ body = self.fixtures.load('oec_0_9_myaccount.xml')
+ return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
def _caas_2_7_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_networkWithLocation(self, method, url, body, headers):
body = self.fixtures.load(
'networkWithLocation.xml')
[20/21] libcloud git commit: Merge branch 'libcloud_1268' into trunk
Closes #1268
Posted by an...@apache.org.
Merge branch 'libcloud_1268' into trunk
Closes #1268
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/d914d139
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/d914d139
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/d914d139
Branch: refs/heads/trunk
Commit: d914d1398925a9f6cbfcb92a9e239d58eb9860c6
Parents: 776c364 9dfd035
Author: Anthony Shaw <an...@gmail.com>
Authored: Wed Dec 19 16:29:03 2018 +1100
Committer: Anthony Shaw <an...@gmail.com>
Committed: Wed Dec 19 16:29:03 2018 +1100
----------------------------------------------------------------------
libcloud/common/nttcis.py | 8 +-
libcloud/compute/drivers/nttcis.py | 252 ++++++++++++++++-
libcloud/loadbalancer/drivers/nttcis.py | 6 +-
.../nttcis/cg_by_src_network_domain.xml | 51 ++++
.../compute/fixtures/nttcis/drs_create_cg.xml | 7 +
.../nttcis/drs_delete_consistency_group.xml | 6 +
.../fixtures/nttcis/drs_expand_journal.xml | 6 +
.../nttcis/drs_fail_create_cg_ineligible.xml | 6 +
.../nttcis/drs_fail_create_cg_not_supported.xml | 6 +
.../drs_fail_create_consistency_group.xml | 6 +
.../fixtures/nttcis/drs_initiate_failover.xml | 6 +
.../fixtures/nttcis/drs_invalid_status.xml | 6 +
.../nttcis/drs_snap_shots_by_min_max_time.xml | 61 +++++
.../fixtures/nttcis/drs_snapshots_by_min.xml | 44 +++
.../nttcis/drs_start_failover_preview.xml | 6 +
.../nttcis/drs_stop_failover_preview.xml | 6 +
.../fixtures/nttcis/get_cg_by_name_or_id.xml | 27 ++
.../fixtures/nttcis/list_consistency_groups.xml | 51 ++++
.../fixtures/nttcis/list_drs_snapshots.xml | 81 ++++++
libcloud/test/compute/test_nttcis.py | 267 ++++++++++++++++++-
tox.ini | 1 +
21 files changed, 897 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
[04/21] libcloud git commit: deleted uneeded files
Posted by an...@apache.org.
deleted uneeded files
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/b9dfbf71
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/b9dfbf71
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/b9dfbf71
Branch: refs/heads/trunk
Commit: b9dfbf71c146a682b108f5562aafaba860d90753
Parents: bee85e7
Author: mitch <mi...@itaas.dimensiondata.com>
Authored: Wed Nov 14 16:49:48 2018 -0500
Committer: mitch <mi...@itaas.dimensiondata.com>
Committed: Wed Nov 14 16:49:48 2018 -0500
----------------------------------------------------------------------
tests/conftest.py | 40 ----
tests/lib_create_test.py | 293 --------------------------
tests/lib_edit_test.py | 468 ------------------------------------------
tests/lib_list_test.py | 427 --------------------------------------
tests/lib_misc_test.py | 10 -
5 files changed, 1238 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/b9dfbf71/tests/conftest.py
----------------------------------------------------------------------
diff --git a/tests/conftest.py b/tests/conftest.py
deleted file mode 100644
index 077e463..0000000
--- a/tests/conftest.py
+++ /dev/null
@@ -1,40 +0,0 @@
-import pytest
-import libcloud
-
-
-@pytest.fixture(scope="module")
-def compute_driver():
- cls = libcloud.get_driver(libcloud.DriverType.COMPUTE,
- libcloud.DriverType.COMPUTE.NTTCIS)
- compute_driver = cls('mitchgeo-test', 'Snmpv2c!', region='eu')
- return compute_driver
-
-
-@pytest.fixture(scope="module")
-def lbdriver():
- cd = libcloud.get_driver(libcloud.DriverType.COMPUTE,
- libcloud.DriverType.COMPUTE.NTTCIS)
- compute_driver = cd('mitchgeo-test', 'Snmpv2c!', region='eu')
- net_domain_name = 'sdk_test_1'
- net_domains = compute_driver.ex_list_network_domains(location='EU6')
- net_domain_id = [d for d in net_domains if d.name == net_domain_name][0].id
- cls = libcloud.get_driver(libcloud.DriverType.LOADBALANCER,
- libcloud.DriverType.LOADBALANCER.NTTCIS)
- lbdriver = cls('mitchgeo-test', net_domain_id, 'Snmpv2c!', region='eu')
- return lbdriver
-
-
-@pytest.fixture(scope="module")
-def na_compute_driver():
- cls = libcloud.get_driver(libcloud.DriverType.COMPUTE,
- libcloud.DriverType.COMPUTE.NTTCIS)
- na_compute_driver = cls('mitchgeo-test', 'Snmpv2c!', region='na')
- return na_compute_driver
-
-
-@pytest.fixture(scope="module")
-def drsdriver():
- cls = libcloud.get_driver(libcloud.DriverType.DRS,
- libcloud.DriverType.DRS.NTTCIS)
- drsdriver = cls('mitchgeo-test', 'Snmpv2c!', region='na')
- return drsdriver
http://git-wip-us.apache.org/repos/asf/libcloud/blob/b9dfbf71/tests/lib_create_test.py
----------------------------------------------------------------------
diff --git a/tests/lib_create_test.py b/tests/lib_create_test.py
deleted file mode 100644
index f2c8eeb..0000000
--- a/tests/lib_create_test.py
+++ /dev/null
@@ -1,293 +0,0 @@
-from pprint import pprint
-import pytest
-import libcloud
-
-from libcloud.compute.drivers.nttcis import NttCisPort, NttCisIpAddress, NttCisPublicIpBlock, NttCisNatRule
-from libcloud.common.nttcis import NttCisFirewallRule, NttCisVlan, NttCisFirewallAddress, NttCisAPIException
-
-
-def test_deploy_vlan(compute_driver, vlan_name='sdk_test2', network_domain_name='sdk_test_1', base_ipv4_addr='10.1.2.0'):
- # Default network size is 24 bits. Interval and polling times default to 2 and 60.
- interval = 3
- timeout = 60
- network_domains = compute_driver.ex_list_network_domains(location='EU6')
- network_domain = [nd for nd in network_domains if nd.name == network_domain_name][0]
- result = compute_driver.ex_create_vlan(network_domain, vlan_name, base_ipv4_addr)
- assert isinstance(result, NttCisVlan)
- compute_driver.ex_wait_for_state('normal', compute_driver.ex_get_vlan, interval, timeout, result.id)
- return result
-
-
-def test_deploy_vlan_2(compute_driver, vlan_name='sdk_test_3', network_domain_name='sdk_test_1',
- base_ipv4_addr='10.2.0.0', private_ipv4_prefix_size=24):
- # Default network size is 24 bits. Interval and polling times default to 2 and 60.
- interval = 3
- timeout = 60
- network_domains = compute_driver.ex_list_network_domains(location='EU6')
- network_domain = [nd for nd in network_domains if nd.name == network_domain_name][0]
- result = compute_driver.ex_create_vlan(network_domain, vlan_name, base_ipv4_addr,
- private_ipv4_prefix_size=private_ipv4_prefix_size)
- assert isinstance(result, NttCisVlan)
- compute_driver.ex_wait_for_state('normal', compute_driver.ex_get_vlan, interval, timeout, result.id)
- return result
-
-
-def test_create_nat_rule(compute_driver):
- network_domain_name = "sdk_test_1"
- network_domains = compute_driver.ex_list_network_domains(location='EU6')
- network_domain = [nd for nd in network_domains if nd.name == network_domain_name][0]
- result = compute_driver.ex_create_nat_rule(network_domain, '10.1.1.7', '168.128.13.126')
- assert isinstance(result, NttCisNatRule)
-
-
-def test_deploy_server(compute_driver):
- image_id = "81a36aa0-555c-4735-b965-4b64fcf0ac8f"
- images = compute_driver.list_images(location='EU6')
- image = [i for i in images if i.id == image_id]
- domain_name = 'sdk_test_1'
- domains = compute_driver.ex_list_network_domains(location='EU6')
- net_domain = [d for d in domains if d.name == domain_name]
- psswd = 'Snmpv2c!'
- vlan_name = "sdk_vlan1"
- vlans = compute_driver.ex_list_vlans()
- vlan = [v for v in vlans if v.name == vlan_name]
- new_node = compute_driver.create_node("ubuntu", image[0], psswd, ex_description="auto_created_server",
- ex_network_domain=net_domain[0], ex_primary_nic_vlan=vlan[0])
- compute_driver.ex_wait_for_state('running', compute_driver.ex_get_node_by_id, 2, 300, new_node.id)
- assert new_node.state == 'running'
-
-
-def test_delete_server(compute_driver):
- server = compute_driver.list_nodes(ex_name="ubuntu")[0]
- shut_result = compute_driver.ex_shutdown_graceful(server)
- assert shut_result is True
- compute_driver.ex_wait_for_state('stopped', compute_driver.ex_get_node_by_id, 2, 45, server.id)
- result = compute_driver.destroy_node(server)
- assert result is True
- compute_driver.ex_wait_for_state('terminated', compute_driver.ex_get_node_by_id, 2, 240, server.id)
-
-
-def test_deploy_firewall_rule_1(compute_driver):
- domain_name = 'sdk_test_1'
- domains = compute_driver.ex_list_network_domains(location='EU6')
- net_domain = [d for d in domains if d.name == domain_name]
- address_list_name = 'sdk_test_address_list'
- address_lists = compute_driver.ex_list_ip_address_list('6aafcf08-cb0b-432c-9c64-7371265db086')
- # using lambda with filter
-
- # address_list = list(filter(lambda x: address_list_name, address_lists))
- # address_list_id = address_list[0].id
-
- # using list comprehension to filter
-
- address_list = [a for a in address_lists if a.name == address_list_name]
- address_list_id = address_list[0].id
-
- port_list_name = 'sdk_test_port_list'
- port_lists = compute_driver.ex_list_portlist('6aafcf08-cb0b-432c-9c64-7371265db086')
- port_list = [p for p in port_lists if p.name == port_list_name]
- port_list_id = port_list[0].id
- dest_firewall_address = NttCisFirewallAddress(address_list_id=address_list_id, port_list_id=port_list_id)
- source_firewall_address = NttCisFirewallAddress(any_ip='ANY')
- rule = compute_driver.ex_create_firewall_rule(net_domain[0], 'sdk_test_firewall_rule_1', 'ACCEPT_DECISIVELY',
- 'IPV4', 'TCP', source_firewall_address, dest_firewall_address, 'LAST')
- print(rule)
- assert isinstance(rule, NttCisFirewallRule)
-
-
-def test_deploy_firewall_rule_2(compute_driver):
- domain_name = 'sdk_test_1'
- domains = compute_driver.ex_list_network_domains(location='EU6')
- net_domain = [d for d in domains if d.name == domain_name]
- source_firewall_address = NttCisFirewallAddress(any_ip='ANY')
- dest_firewall_address = NttCisFirewallAddress(ip_address='10.2.0.0', ip_prefix_size='16',
- port_begin='8000', port_end='8080')
-
- rule = compute_driver.ex_create_firewall_rule(net_domain[0], 'sdk_test_firewall_rule_2', 'ACCEPT_DECISIVELY',
- 'IPV4', 'TCP', source_firewall_address, dest_firewall_address, 'LAST')
- print(rule)
- assert isinstance(rule, NttCisFirewallRule)
-
-
-def test_deploy_firewall_rule_3(compute_driver):
- domain_name = 'sdk_test_1'
- domains = compute_driver.ex_list_network_domains(location='EU6')
- net_domain = [d for d in domains if d.name == domain_name]
- source_firewall_address = NttCisFirewallAddress(any_ip='ANY')
- dest_firewall_address = NttCisFirewallAddress(ip_address='10.2.0.0', ip_prefix_size='16',
- port_begin='25')
- rule_name = 'sdk_test_firewall_rule_2'
- rules = compute_driver.ex_list_firewall_rules(net_domain[0])
- rule = [rule for rule in rules if rule.name == rule_name]
- relative_to = compute_driver.ex_get_firewall_rule(net_domain[0], rule[0].id)
- rule = compute_driver.ex_create_firewall_rule(net_domain[0], 'sdk_test_firewall_rule_3', 'ACCEPT_DECISIVELY',
- 'IPV4', 'TCP', source_firewall_address, dest_firewall_address,
- 'BEFORE', position_relative_to_rule=relative_to)
- print(rule)
- assert isinstance(rule, NttCisFirewallRule)
-
-
-def test_create_port_list(compute_driver):
- """
- An optional named argument, child_portlist_list, which takes the id of an existing
- port list to include in this port list.
- """
- domain_name = 'sdk_test_1'
- domains = compute_driver.ex_list_network_domains(location='EU6')
- net_domain = [d for d in domains if d.name == domain_name]
- port_list_name = 'sdk_test_port_list'
- description = 'A test port list'
- port_list = [NttCisPort(begin='8000', end='8080')]
- result = compute_driver.ex_create_portlist(net_domain[0], port_list_name, description, port_list)
- assert result is True
-
-
-def test_create_address_list(compute_driver):
- """
- An optional named argument, child_ip_address_list, which takes the id of an existing
- port list to include in this port list.
- """
- domain_name = 'sdk_test_1'
- domains = compute_driver.ex_list_network_domains(location='EU6')
- net_domain = [d for d in domains if d.name == domain_name]
- address_list_name = 'sdk_test_address_list'
- description = 'A test address list'
- ip_version = 'IPV4'
- # An optional prefix list can be specified as a named argument, prefix_size=
- address_list = [NttCisIpAddress('10.2.0.1', end='10.2.0.11')]
-
- result = compute_driver.ex_create_ip_address_list(net_domain[0], address_list_name,
- description,
- ip_version, address_list)
- assert result is True
-
-
-def test_create_public_ip_block(compute_driver):
- domain_name = 'sdk_test_1'
- domains = compute_driver.ex_list_network_domains(location='EU6')
- net_domain = [d for d in domains if d.name == domain_name][0]
- ip_block = compute_driver.ex_add_public_ip_block_to_network_domain(net_domain)
- assert isinstance(ip_block, NttCisPublicIpBlock)
- print(ip_block)
-
-
-def test_create_private_ipv4_address(compute_driver):
- vlan_name = 'sdk_vlan1'
- vlan = compute_driver.ex_list_vlans(name=vlan_name)[0]
- ip = '10.1.1.20'
- description = 'A test reserved ipv4 address'
- result = compute_driver.ex_reserve_ip(vlan, ip, description)
- assert result is True
-
-
-def test_create_ipv6_addresss(compute_driver):
- vlan_name = 'sdk_vlan1'
- vlan = compute_driver.ex_list_vlans(name=vlan_name)[0]
- ipv6 = '2a00:47c0:111:1331:7df0:9beb:43c9:5c'
- result = compute_driver.ex_reserve_ip(vlan, ipv6)
- assert result is True
-
-
-def test_import_customer_image(compute_driver):
- package_name = "bitnami-couchdb-2.1.2-1-r35-linux-centos-7-x86_64.mf"
- name = "bitnami-couchdb-2.1.2-1-r35-linux-centos-7-x86_64"
- datacenter_id = 'EU6'
- is_guest_os_customization = 'false'
- result = compute_driver.import_image(package_name, name, datacenter_id=datacenter_id,
- is_guest_os_customization=is_guest_os_customization)
- assert result is True
-
-
-def test_create_load_balancer(lbdriver, compute_driver):
- member1 = compute_driver.list_nodes(ex_name='web1')[0]
- member2 = compute_driver.list_nodes(ex_name='web2')[0]
- members = [member1, member2]
- name = 'sdk_test_balancer'
- port = '80'
- listener_port = '8000'
- protocol = 'TCP'
- algorithm = 'LEAST_CONNECTIONS_MEMBER'
- members = [m for m in members]
- ex_listener_ip_address = "168.128.13.127"
- lb = lbdriver.create_balancer(name, listener_port=listener_port, port=port, protocol=protocol,
- algorithm=algorithm, members=members, optimization_profile='TCP',
- ex_listener_ip_address=ex_listener_ip_address)
-
-
-def test_create_vip_node(compute_driver, lbdriver):
- node_address = '10.1.1.7'
- node_name = "web1"
- domain_name = 'sdk_test_1'
- domains = compute_driver.ex_list_network_domains(location='EU6')
- net_domain = [d for d in domains if d.name == domain_name][0]
- node = lbdriver.ex_create_node(net_domain.id, node_name, node_address)
- print(node)
-
-
-def test_add_pool_member(compute_driver, lbdriver):
- pool_name = 'sdk_test_balancer'
- network_domain_name = "sdk_test_1"
- network_domains = compute_driver.ex_list_network_domains(location='EU6')
- network_domain = [nd for nd in network_domains if nd.name == network_domain_name][0]
- pools = lbdriver.ex_get_pools(ex_network_domain_id=network_domain.id)
- pool = [p for p in pools if p.name == pool_name][0]
- node = lbdriver.ex_get_node("eca8dac3-1417-4fdf-83c3-2b7b848ab171")
- result = lbdriver.ex_create_pool_member(pool, node, port=80)
- print(result)
-
-
-def test_create_server_monitor(compute_driver):
- pass
-
-
-def test_fail_create_drs(na_compute_driver, drsdriver):
- nodes = na_compute_driver.list_nodes(ex_name='drs_test_1')
- src_id = nodes[0].id
- nodes = na_compute_driver.list_nodes(ex_name="drs_test_2")
- target_id = nodes[0].id
- with pytest.raises(NttCisAPIException) as excinfo:
- result = drsdriver.create_consistency_group(
- "sdk_cg", "100", src_id, target_id, description="A test consistency group")
- exception_msg = excinfo.value.msg
- assert exception_msg == 'DRS is not supported between source Data Center NA9 and target Data Center NA12.'
-
-
-def test_ineligble_drs(na_compute_driver, drsdriver):
- nodes = na_compute_driver.list_nodes(ex_name='src-sdk-test')
- src_id = nodes[0].id
- nodes = na_compute_driver.list_nodes(ex_name="tgt-sdk-test")
- target_id = nodes[0].id
- with pytest.raises(NttCisAPIException) as excinfo:
- drsdriver.create_consistency_group(
- "sdk_test2_cg", "100", src_id, target_id, description="A test consistency group")
- exception_msg = excinfo.value.msg
- assert exception_msg == 'The drsEligible flag for target Server aee58575-38e2-495f-89d3-854e6a886411 must be set.'
-
-
-def test_create_drs(na_compute_driver, drsdriver):
- nodes = na_compute_driver.list_nodes(ex_name='src-sdk-test')
- src_id = nodes[0].id
- nodes = na_compute_driver.list_nodes(ex_name="tgt-sdk-test")
- target_id = nodes[0].id
- result = drsdriver.create_consistency_group(
- "sdk_test2_cg", "100", src_id, target_id, description="A test consistency group")
- assert result is True
-
-
-def test_start_snapshot_preview(drsdriver):
- cg_id = "3710c093-7dcc-4a21-bd07-af9f4d93b6b5"
- snapshot_id = "87703"
- result = drsdriver.start_failover_preview(cg_id, snapshot_id)
- assert result is True
-
-
-def test_stop_snapshot_preivew(drsdriver):
- cg_id = "3710c093-7dcc-4a21-bd07-af9f4d93b6b5"
- result = drsdriver.stop_failover_preview(cg_id)
- assert result is True
-
-
-def test_initiate_failover(drsdriver):
- cg_id = "3710c093-7dcc-4a21-bd07-af9f4d93b6b5"
- result = drsdriver.initiate_failover(cg_id)
- assert result is True
http://git-wip-us.apache.org/repos/asf/libcloud/blob/b9dfbf71/tests/lib_edit_test.py
----------------------------------------------------------------------
diff --git a/tests/lib_edit_test.py b/tests/lib_edit_test.py
deleted file mode 100644
index 9a2904c..0000000
--- a/tests/lib_edit_test.py
+++ /dev/null
@@ -1,468 +0,0 @@
-import pytest
-import libcloud
-from libcloud import loadbalancer
-from libcloud.compute.drivers.nttcis import NttCisPort
-from libcloud.common.nttcis import NttCisIpAddress, NttCisVlan, NttCisVIPNode
-from tests.lib_create_test import test_deploy_vlan
-
-
-def test_disable_node_snapshot(compute_driver):
- node = '040fefdb-78be-4b17-8ef9-86820bad67d9'
- assert compute_driver.ex_disable_snapshots(node) is True
-
-
-def test_list_windows(compute_driver):
- loc = 'EU6'
- service_plan = 'ADVANCED'
- windows = compute_driver.list_snapshot_windows(loc, service_plan)
- for window in windows:
- print(window)
- assert 'day_of_week' in window
-
-
-def test_enable_snapshot(compute_driver):
- """
- This will enable a snapshot window and create an initial
- snapshot when it has done so. A node object and a window id are required
- :param compute_driver: The driver object for compute nodes.
- :return: True or False
- :rtype: ``bool``
- """
- window_id = 'ea646520-4272-11e8-838c-180373fb68df'
- node = '040fefdb-78be-4b17-8ef9-86820bad67d9'
- result = compute_driver.ex_enable_snapshots(node, window_id)
- assert result is True
-
-
-def test_initiate_manual_snapshot_warn(compute_driver):
- with pytest.raises(RuntimeError, match=r'Found more than one server Id .*'):
- compute_driver.ex_initiate_manual_snapshot('sdk_server_1', 'dc637783-2bb2-4b92-838a-99a899b5e29b')
-
-
-def test_initiate_manual_snapshot(compute_driver):
- compute_driver.ex_initiate_manual_snapshot('sdk_server_1', 'dc637783-2bb2-4b92-838a-99a899b5e29b')
-
-
-def test_shutdown_server_1(compute_driver):
- node = compute_driver.ex_get_node_by_id('040fefdb-78be-4b17-8ef9-86820bad67d9 ')
- result = compute_driver.ex_shutdown_graceful(node)
- assert result is True
-
-
-def test_start_server_1(compute_driver):
- node = compute_driver.ex_get_node_by_id('040fefdb-78be-4b17-8ef9-86820bad67d9 ')
- result = compute_driver.ex_start_node(node)
- assert result is True
-
-
-def test_shutdown_server_2(compute_driver):
- nodes = compute_driver.list_nodes(ex_name='sdk_server_1')
- for node in nodes:
- result = compute_driver.ex_shutdown_graceful(node)
- assert result is True
-
-
-def test_start_server_2(compute_driver):
- nodes = compute_driver.list_nodes(ex_name='sdk_server_1')
- for node in nodes:
- result = compute_driver.ex_start_node(node)
- assert result is True
-
-
-def test_edit_metadata(compute_driver):
- node = compute_driver.ex_get_node_by_id('040fefdb-78be-4b17-8ef9-86820bad67d9 ')
- description = 'SDK Test server'
- name = 'sdk_server_1'
- result = compute_driver.ex_edit_metadata(node, name=name, description=description)
- assert result is True
-
-
-def test_edit_metadata_fails(compute_driver):
- node = compute_driver.ex_get_node_by_id('040fefdb-78be-4b17-8ef9-86820bad67d9 ')
- description = 'Test server'
- ip_address = 'EU6 Ubuntu'
- with pytest.raises(TypeError):
- result = compute_driver.ex_edit_metadata(node, ip_address=ip_address, description=description)
-
-
-def test_reconfigure_node(compute_driver):
- node = compute_driver.ex_get_node_by_id('040fefdb-78be-4b17-8ef9-86820bad67d9')
- cpu_performance = 'HIGHPERFORMANCE'
- result = compute_driver.ex_reconfigure_node(node, cpu_performance=cpu_performance)
- assert result is True
-
-
-def test_edit_vlan(compute_driver):
- vlan = compute_driver.ex_list_vlans(name='sdk_test2')[0]
- vlan.name = 'sdk_test_2'
- vlan.description = "Second test Vlan"
- result = compute_driver.ex_update_vlan(vlan)
- assert isinstance(result, NttCisVlan)
-
-
-def test_expand_vlan(compute_driver):
- vlan = compute_driver.ex_list_vlans(name='sdk_test_3')[0]
- vlan.private_ipv4_range_size = '23'
- result = compute_driver.ex_expand_vlan(vlan)
- assert isinstance(result, NttCisVlan)
-
-
-def test_delete_vlan(compute_driver):
- vlan = compute_driver.ex_list_vlans(name='sdk_test_3')[0]
- result = compute_driver.ex_delete_vlan(vlan)
- assert result is True
-
-
-def test_add_disk_by_node(compute_driver):
- """
- Speeds can be specified based on DataCenter
- :param compute_driver: libcloud.DriverType.COMPUTE.NTTCIS
- :return: NA
- """
- node = compute_driver.ex_get_node_by_id('803e5e00-b22a-450a-8827-066ff15ec977')
- shut_result = compute_driver.ex_shutdown_graceful(node)
- assert shut_result is True
- compute_driver.ex_wait_for_state('stopped', compute_driver.ex_get_node_by_id, 2, 45, node.id)
- result = compute_driver.ex_add_storage_to_node(20, node)
- assert result is True
- compute_driver.ex_wait_for_state('stopped', compute_driver.ex_get_node_by_id, 2, 180, node.id)
- result = compute_driver.ex_start_node(node)
- assert result is True
-
-
-def test_add_disk_by_controller_id(compute_driver):
- node = compute_driver.ex_get_node_by_id('803e5e00-b22a-450a-8827-066ff15ec977')
- shut_result = compute_driver.ex_shutdown_graceful(node)
- assert shut_result is True
- compute_driver.ex_wait_for_state('stopped', compute_driver.ex_get_node_by_id, 2, 45, node.id)
- result = compute_driver.ex_add_storage_to_node(20, controller_id=node.extra['scsi_controller'][0].id)
- assert result is True
- compute_driver.ex_wait_for_state('stopped', compute_driver.ex_get_node_by_id, 2, 180, node.id)
- result = compute_driver.ex_start_node(node)
- assert result is True
-
-
-def test_changing_diskspeed(compute_driver):
- node = compute_driver.ex_get_node_by_id('803e5e00-b22a-450a-8827-066ff15ec977')
- shut_result = compute_driver.ex_shutdown_graceful(node)
- assert shut_result is True
- compute_driver.ex_wait_for_state('stopped', compute_driver.ex_get_node_by_id, 2, 45, node.id)
- disk_id = 'f8a01c24-4768-46be-af75-9fe877f8c588'
- result = compute_driver.ex_change_storage_speed(disk_id, 'HIGHPERFORMANCE')
- assert result is True
- compute_driver.ex_wait_for_state('stopped', compute_driver.ex_get_node_by_id, 2, 240, node.id)
- result = compute_driver.ex_start_node(node)
- assert result is True
-
-
-def test_changing_diskspeed_iops(compute_driver):
- node = compute_driver.ex_get_node_by_id('803e5e00-b22a-450a-8827-066ff15ec977')
- shut_result = compute_driver.ex_shutdown_graceful(node)
- assert shut_result is True
- compute_driver.ex_wait_for_state('stopped', compute_driver.ex_get_node_by_id, 2, 45, node.id)
- disk_id = 'f8a01c24-4768-46be-af75-9fe877f8c588'
- result = compute_driver.ex_change_storage_speed(disk_id, 'PROVISIONEDIOPS', iops=60)
- assert result is True
- compute_driver.ex_wait_for_state('stopped', compute_driver.ex_get_node_by_id, 2, 240, node.id)
- result = compute_driver.ex_start_node(node)
- assert result is True
-
-
-def test_add_scsi_controller(compute_driver):
- node = compute_driver.ex_get_node_by_id('803e5e00-b22a-450a-8827-066ff15ec977')
- shut_result = compute_driver.ex_shutdown_graceful(node)
- assert shut_result is True
- compute_driver.ex_wait_for_state('stopped', compute_driver.ex_get_node_by_id, 2, 45, node.id)
- adapter_type = 'VMWARE_PARAVIRTUAL'
- result = compute_driver.ex_add_scsi_controller_to_node(node.id, adapter_type)
- assert result is True
- compute_driver.ex_wait_for_state('stopped', compute_driver.ex_get_node_by_id, 2, 240, node.id)
- result = compute_driver.ex_start_node(node)
- assert result is True
-
-
-def test_remove_scsi_controller(compute_driver):
- node = compute_driver.ex_get_node_by_id('803e5e00-b22a-450a-8827-066ff15ec977')
- shut_result = compute_driver.ex_shutdown_graceful(node)
- assert shut_result is True
- compute_driver.ex_wait_for_state('stopped', compute_driver.ex_get_node_by_id, 2, 45, node.id)
- result = compute_driver.ex_remove_scsi_controller('f1126751-c6d5-4d64-893c-8902b8481f90')
- assert result is True
- compute_driver.ex_wait_for_state('stopped', compute_driver.ex_get_node_by_id, 2, 240, node.id)
- result = compute_driver.ex_start_node(node)
- assert result is True
-
-
-def test_update_vmware_tools(compute_driver):
- node = compute_driver.ex_get_node_by_id('803e5e00-b22a-450a-8827-066ff15ec977')
- result = compute_driver.ex_update_vm_tools(node)
- assert result is True
- compute_driver.ex_wait_for_state('running', compute_driver.ex_get_node_by_id, 2, 240, node.id)
-
-
-def test_add_node_to_vlan(compute_driver):
- vlan = test_deploy_vlan(compute_driver, "test_vlan_create", "6aafcf08-cb0b-432c-9c64-7371265db086", "10.0.2.0")
- assert isinstance(vlan, NttCisVlan)
- node = compute_driver.ex_get_node_by_id('803e5e00-b22a-450a-8827-066ff15ec977')
- shut_result = compute_driver.ex_shutdown_graceful(node)
- assert shut_result is True
- compute_driver.ex_wait_for_state('stopped', compute_driver.ex_get_node_by_id, 2, 45, node.id)
- result = compute_driver.ex_attach_node_to_vlan(node, vlan=vlan)
- assert result is True
- compute_driver.ex_wait_for_state('stopped', compute_driver.ex_get_node_by_id, 2, 240, node.id)
- result = compute_driver.ex_start_node(node)
- assert result is True
-
-
-def test_remove_nic(compute_driver):
- node = compute_driver.ex_get_node_by_id('803e5e00-b22a-450a-8827-066ff15ec977')
- shut_result = compute_driver.ex_shutdown_graceful(node)
- assert shut_result is True
- compute_driver.ex_wait_for_state('stopped', compute_driver.ex_get_node_by_id, 2, 45, node.id)
- result = compute_driver.ex_disable_snapshots(node.id)
- assert result is True
- result = compute_driver.ex_destroy_nic("e9cdea1b-c4f2-4769-93a8-57e24248abdd")
- assert result is True
- compute_driver.ex_wait_for_state('stopped', compute_driver.ex_get_node_by_id, 2, 240, node.id)
- result = compute_driver.ex_start_node(node)
- assert result is True
-
-""""
-No wayt to get nic id's via libcloud
-def test_exchange_nic_vlans(compute_driver):
- node = compute_driver.ex_get_node_by_id('803e5e00-b22a-450a-8827-066ff15ec977')
- print(node.extra)
-"""
-
-
-def test_change_nic_type(compute_driver):
- nic_id = "7a27b2b1-7b20-404f-be53-4695023c2734"
- nic_type = 'VMXNET3'
- node = compute_driver.ex_get_node_by_id('803e5e00-b22a-450a-8827-066ff15ec977')
- shut_result = compute_driver.ex_shutdown_graceful(node)
- assert shut_result is True
- compute_driver.ex_wait_for_state('stopped', compute_driver.ex_get_node_by_id, 2, 45, node.id)
- result = compute_driver.ex_change_nic_network_adapter(nic_id, nic_type)
- assert result is True
- compute_driver.ex_wait_for_state('stopped', compute_driver.ex_get_node_by_id, 2, 240, node.id)
- result = compute_driver.ex_start_node(node)
- assert result is True
-
-
-def test_edit_firewall_rule(compute_driver):
- domain_name = 'sdk_test_1'
- domains = compute_driver.ex_list_network_domains(location='EU6')
- net_domain = [d for d in domains if d.name == domain_name]
- rule_name = 'sdk_test_firewall_rule_2'
- rules = compute_driver.ex_list_firewall_rules(net_domain[0])
- rule = [rule for rule in rules if rule.name == rule_name]
- rule[0].destination.port_end = None
- result = compute_driver.ex_edit_firewall_rule(rule[0])
- print(compute_driver.ex_get_firewall_rule(net_domain[0].id, rule[0].id))
- assert result is True
-
-
-def test_delete_firewall_rule(compute_driver):
- domain_name = 'sdk_test_1'
- domains = compute_driver.ex_list_network_domains(location='EU6')
- net_domain = [d for d in domains if d.name == domain_name]
- rule_name = 'sdk_test_firewall_rule_2'
- rules = compute_driver.ex_list_firewall_rules(net_domain[0])
- rule = [rule for rule in rules if rule.name == rule_name]
- result = compute_driver.ex_delete_firewall_rule(rule[0])
- assert result is True
-
-
-def test_create_anti_affinity_rule(compute_driver):
- server1 = compute_driver.ex_get_node_by_id("d0425097-202f-4bba-b268-c7a73b8da129")
- server2 = compute_driver.ex_get_node_by_id("803e5e00-b22a-450a-8827-066ff15ec977")
- servers = [server1, server2]
- result = compute_driver.ex_create_anti_affinity_rule(servers)
- assert isinstance(result, )
-
-
-def test_delete_anti_affinity_rule(compute_driver):
- anti_affinity_rule = "40d83160-0fa2-418d-a73e-5f15fe1354fc"
- result = compute_driver.ex_delete_anti_affinity_rule(anti_affinity_rule)
- assert result is True
-
-
-def test_delete_port_list(compute_driver):
- portlists = compute_driver.ex_list_portlist('6aafcf08-cb0b-432c-9c64-7371265db086')
- port_list_to_delete = [plist for plist in portlists if plist.name == 'sdk_test_port_list']
- result = compute_driver.ex_delete_portlist(port_list_to_delete[0])
- assert result is True
-
-
-def test_edit_address_list(compute_driver):
- domain_name = 'sdk_test_1'
- domains = compute_driver.ex_list_network_domains(location='EU6')
- net_domain = [d for d in domains if d.name == domain_name][0]
- addr_list = compute_driver.ex_get_ip_address_list(net_domain, 'sdk_test_address_list')
- assert addr_list[0].ip_version == 'IPV4'
- ip_address_1 = NttCisIpAddress(begin='190.2.2.100')
- ip_address_2 = NttCisIpAddress(begin='190.2.2.106', end='190.2.2.108')
- ip_address_3 = NttCisIpAddress(begin='190.2.2.0', prefix_size='24')
- ip_address_4 = NttCisIpAddress(begin='10.2.0.0', prefix_size='24')
- ip_address_collection = [ip_address_1, ip_address_2, ip_address_3, ip_address_4]
-
- result = compute_driver.ex_edit_ip_address_list("d32aa8d4-831b-4fd6-95da-c639768834f0",
- ip_address_collection=ip_address_collection)
- assert result is True
-
-
-def test_delete_public_ip_block(compute_driver):
- block = compute_driver.ex_get_public_ip_block("813b87a8-18e1-11e5-8d4f-180373fb68df")
- result = compute_driver.ex_delete_public_ip_block(block)
- assert result is True
-
-
-def test_edit_address_list_2(compute_driver):
- domain_name = 'sdk_test_1'
- domains = compute_driver.ex_list_network_domains(location='EU6')
- net_domain = [d for d in domains if d.name == domain_name][0]
- # An ip address list object can be used as an argument or the id of the address list
- addr_list = compute_driver.ex_get_ip_address_list(net_domain, 'sdk_test_address_list')
-
- result = compute_driver.ex_edit_ip_address_list("d32aa8d4-831b-4fd6-95da-c639768834f0",
- description='nil')
- assert result is True
-
-
-def test_delete_address_list(compute_driver):
- domain_name = 'sdk_test_1'
- domains = compute_driver.ex_list_network_domains(location='EU6')
- net_domain = [d for d in domains if d.name == domain_name][0]
- addresslist_to_delete = compute_driver.ex_get_ip_address_list(net_domain, 'sdk_test_address_list')
- print(addresslist_to_delete)
-
-
-def test_edit_port_list_1(compute_driver):
- domain_name = 'sdk_test_1'
- domains = compute_driver.ex_list_network_domains(location='EU6')
- net_domain = [d for d in domains if d.name == domain_name]
- port_list_name = 'sdk_test_port_list'
- port_lists = compute_driver.ex_list_portlist(net_domain[0])
- port_list = [port for port in port_lists if port.name == port_list_name][0]
- port_collection = [NttCisPort(begin='8000', end='8080'), NttCisPort(begin='9000')]
- result = compute_driver.ex_edit_portlist(port_list.id, port_collection=port_collection)
- assert result is True
-
-
-def test_unreserve_ip_address(compute_driver):
- vlan_name = 'sdk_vlan1'
- vlan = compute_driver.ex_list_vlans(name=vlan_name)[0]
- ip = '2a00:47c0:111:1331:7df0:9beb:43c9:5c'
- result = compute_driver.ex_unreserve_ip_addresses(vlan, ip)
- assert result is True
-
-
-def test_list_locations(compute_driver):
- locations = compute_driver.list_locations()
- for location in locations:
- print(location)
-
-
-def test_delete_nat_rule(compute_driver):
- network_domain_name = "sdk_test_1"
- network_domains = compute_driver.ex_list_network_domains(location='EU6')
- network_domain = [nd for nd in network_domains if nd.name == network_domain_name][0]
- rule = compute_driver.ex_get_nat_rule(network_domain, '74f0897f-5536-4c17-84b0-d52b1fb3aea6')
- result = compute_driver.ex_delete_nat_rule(rule)
- assert result is True
-
-
-def test_update_health_monitor(compute_driver, lbdriver):
- pool_name = 'sdk_test_balancer'
- network_domain_name = "sdk_test_1"
- network_domains = compute_driver.ex_list_network_domains(location='EU6')
- network_domain = [nd for nd in network_domains if nd.name == network_domain_name][0]
- pools = lbdriver.ex_get_pools(ex_network_domain_id=network_domain.id)
- pool = [p for p in pools if p.name == pool_name][0]
- pool.health_monitor_id = '9f79487a-1b6d-11e5-8d4f-180373fb68df'
- result = lbdriver.ex_update_pool(pool)
- assert result is True
-
-
-def test_update_node_monitor(compute_driver, lbdriver):
- network_domain_name = "sdk_test_1"
- network_domains = compute_driver.ex_list_network_domains(location='EU6')
- network_domain = [nd for nd in network_domains if nd.name == network_domain_name][0]
- nodes = lbdriver.ex_get_nodes(ex_network_domain_id=network_domain.id)
- #pool = [p for p in pools if p.name == pool_name][0]
- health_monitor_id = '9f79a126-1b6d-11e5-8d4f-180373fb68df'
- for node in nodes:
- node.health_monitor_id = health_monitor_id
- result = lbdriver.ex_update_node(node)
- assert isinstance(result, NttCisVIPNode)
-
-
-def test_remove_node(compute_driver, lbdriver):
- node_name = 'web1'
- network_domain_name = "sdk_test_1"
- network_domains = compute_driver.ex_list_network_domains(location='EU6')
- network_domain = [nd for nd in network_domains if nd.name == network_domain_name][0]
- nodes = lbdriver.ex_get_nodes(ex_network_domain_id=network_domain.id)
- node = [n for n in nodes if n.name == node_name][0]
- pool_name = "sdk_test_balancer"
- pools = lbdriver.ex_get_pools(ex_network_domain_id=network_domain.id)
- pool = [p for p in pools if p.name == pool_name][0]
- pool_members = lbdriver.ex_get_pool_members(pool.id)
- pool_member = [pm for pm in pool_members if pm.node_id == node.id][0]
- result = lbdriver.ex_destroy_pool_member(pool_member)
- assert result is True
-
-
-def test_delete_node(compute_driver, lbdriver):
- node_name = 'web1'
- network_domain_name = "sdk_test_1"
- network_domains = compute_driver.ex_list_network_domains(location='EU6')
- network_domain = [nd for nd in network_domains if nd.name == network_domain_name][0]
- nodes = lbdriver.ex_get_nodes(ex_network_domain_id=network_domain.id)
- node = [n for n in nodes if n.name == node_name][0]
- result = lbdriver.ex_destroy_node(node.id)
- assert result is True
-
-
-def test_remove_pool(compute_driver, lbdriver):
- listener_name = "sdk_test_balancer"
- listeners = lbdriver.list_balancers(ex_network_domain_id=lbdriver.network_domain_id)
- listener = [l for l in listeners if l.name == listener_name][0]
- pool_id = None
- result = lbdriver.ex_update_listener(listener, poolId=pool_id)
- assert result is True
-
-
-def test_delete_pool(compute_driver, lbdriver):
- network_domain_name = "sdk_test_1"
- network_domains = compute_driver.ex_list_network_domains(location='EU6')
- network_domain = [nd for nd in network_domains if nd.name == network_domain_name][0]
- pool_name = "sdk_test_balancer"
- pools = lbdriver.ex_get_pools(ex_network_domain_id=network_domain.id)
- pool = [p for p in pools if p.name == pool_name][0]
- result = lbdriver.ex_destroy_pool(pool)
- assert result is True
-
-
-def test_delete_listener(compute_driver, lbdriver):
- listener_name = "sdk_test_balancer"
- listeners = lbdriver.list_balancers(ex_network_domain_id=lbdriver.network_domain_id)
- listener = [l for l in listeners if l.name == listener_name][0]
- result = lbdriver.destroy_balancer(listener)
- assert result is True
-
-
-def test_expand_journal(drsdriver):
- cgs = drsdriver.list_consistency_groups(name="sdk_test2_cg")
- cg_id = cgs[0].id
- expand_by = "100"
- result = drsdriver.expand_journal(cg_id, expand_by)
- assert result is True
-
-
-def test_delete_consistency_group(drsdriver):
- cg_name = "sdk_test2_cg"
- cg = drsdriver.list_consistency_groups(name=cg_name)
- cg_id = cg[0].id
- result = drsdriver.delete_consistency_group(cg_id)
- assert result is True
http://git-wip-us.apache.org/repos/asf/libcloud/blob/b9dfbf71/tests/lib_list_test.py
----------------------------------------------------------------------
diff --git a/tests/lib_list_test.py b/tests/lib_list_test.py
deleted file mode 100644
index c6395c4..0000000
--- a/tests/lib_list_test.py
+++ /dev/null
@@ -1,427 +0,0 @@
-import pytest
-import libcloud
-from libcloud import loadbalancer
-
-
-def test_list_node_all(compute_driver):
- nodes = compute_driver.list_nodes()
- for node in nodes:
- print(node)
- #print(node.extra['networkDomainId'], node.extra['datacenterId'], node.uuid, node.state, node.name, node.extra['cpu'],
- # node.extra['scsi_controller'], node.extra['disks'], node.extra['memoryMb'],
- # node.extra['OS_displayName'], node.private_ips, node.extra['ipv6'], node.extra['window'])
-
- assert isinstance(nodes, list) and len(nodes) > 0
-
-
-def test_list_node_location(compute_driver):
- nodes = compute_driver.list_nodes(ex_location='EU6')
- print()
- for node in nodes:
- print(node)
- #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_name(compute_driver):
- nodes = compute_driver.list_nodes(ex_name='sdk_server_1')
- print()
- for node in nodes:
- print(node)
- #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_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
-
-
-def test_list_images(compute_driver):
- images = compute_driver.list_images(location='EU6')
- print()
- for image in images:
- print(image.id, image.name)
- assert isinstance(images, list) and len(images) > 0
-
-
-def test_list_os(compute_driver):
- oss = compute_driver.ex_list_os(location='EU6')
-
-
-def test_list_node_by_image(compute_driver):
- nodes = compute_driver.list_nodes(ex_image='81a36aa0-555c-4735-b965-4b64fcf0ac8f')
- 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_network_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_datacenter_object_creation(compute_driver):
- datacenter = compute_driver.ex_get_datacenter('EU6')
-
-
-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(rule)
-
-
-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_list_snapshots(compute_driver):
- snapshots = compute_driver.list_snapshots('web1')
- for snapshot in snapshots:
- print(snapshot)
- assert 'expiry_time' in snapshot
-
-
-def test_list_nics(compute_driver):
- result = compute_driver.ex_list_
-
-
-def test_list_vlans(compute_driver):
- vlans = compute_driver.ex_list_vlans()
- print(vlans)
- assert isinstance(vlans, list)
-
-
-def test_list_anti_affinity_rules(compute_driver):
- # Could use network domain or node but not both
- # net_domain = compute_driver.ex_get_network_domain('6aafcf08-cb0b-432c-9c64-7371265db086')
- node = compute_driver.ex_get_node_by_id("803e5e00-b22a-450a-8827-066ff15ec977")
- anti_affinity_rules = compute_driver.ex_list_anti_affinity_rules(node=node)
- assert len(anti_affinity_rules) > 1
-
-
-def test_list_no_anti_affinity_rules(compute_driver):
- # Could use network domain or node but not both
- # net_domain = compute_driver.ex_get_network_domain('6aafcf08-cb0b-432c-9c64-7371265db086')
- node = compute_driver.ex_get_node_by_id("803e5e00-b22a-450a-8827-066ff15ec977")
- anti_affinity_rules = compute_driver.ex_list_anti_affinity_rules(node=node)
- assert len(anti_affinity_rules) == 0
-
-
-def test_list_locations(compute_driver):
- locations = compute_driver.list_locations()
- for location in locations:
- print(location)
-
-
-"""
-def test_list_sizes(compute_driver):
- properties = compute_driver.list_locations()
- for property in properties:
- print(property)
-"""
-
-
-def test_images(compute_driver):
- images = compute_driver.list_images()
- print()
- print(images)
- assert isinstance(images, list) and len(images) > 0
-
-
-def test_list_public_ip_blocks(compute_driver):
- domain_name = 'sdk_test_1'
- domains = compute_driver.ex_list_network_domains(location='EU6')
- net_domain = [d for d in domains if d.name == domain_name][0]
- blocks = compute_driver.ex_list_public_ip_blocks(net_domain)
- print(blocks)
-
-
-def test_list_private_ipv4_addresses_vlan(compute_driver):
- vlan_name = 'sdk_vlan1'
- vlan = compute_driver.ex_list_vlans(name=vlan_name)[0]
- ip_addresses = compute_driver.ex_list_reserved_ipv4(vlan=vlan)
- for ip_address in ip_addresses:
- print(ip_address)
-
-
-def test_list_private_ipv4_addresses_datacenter(compute_driver):
- datacenter_id = 'EU8'
- ip_addresses = compute_driver.ex_list_reserved_ipv4(datacenter_id=datacenter_id)
- for ip_address in ip_addresses:
- print(ip_address)
-
-
-def test_list_private_ipv4_addresses_all(compute_driver):
- ip_addresses = compute_driver.ex_list_reserved_ipv4()
- for ip_address in ip_addresses:
- print(ip_address)
-
-
-def test_list_reserved_ipv6_address_vlan(compute_driver):
- vlan_name = 'sdk_vlan1'
- vlan = compute_driver.ex_list_vlans(name=vlan_name)[0]
- ip_addresses = compute_driver.ex_list_reserved_ipv6(vlan=vlan)
- for ip_address in ip_addresses:
- print(ip_address)
-
-
-def test_list_nat_rules(compute_driver):
- network_domain_name = "sdk_test_1"
- network_domains = compute_driver.ex_list_network_domains(location='EU6')
- network_domain = [nd for nd in network_domains if nd.name == network_domain_name][0]
- rules = compute_driver.ex_list_nat_rules(network_domain)
- for rule in rules:
- print(rule)
-
-
-def test_list_customer_images(compute_driver):
- location = 'EU6'
- images = compute_driver.ex_list_customer_images(location)
- for image in images:
- print(image, image.extra)
-
-
-def test_get_customer_image(compute_driver):
- imagee_id = '84da095f-c8c7-4ace-9fb6-eceb1047027c'
- image = compute_driver.ex_get_image_by_id(imagee_id)
- print(image, image.extra)
-
-
-def test_list_health_monitors(compute_driver, lbdriver):
- network_domain_name = "sdk_test_1"
- network_domains = compute_driver.ex_list_network_domains(location='EU6')
- network_domain = [nd for nd in network_domains if nd.name == network_domain_name][0]
- monitors = lbdriver.ex_get_default_health_monitors(network_domain)
- for monitor in monitors:
- print(monitor)
-
-
-def test_list_consistency_groups(drsdriver):
- cgs = drsdriver.list_consistency_groups()
- for cg in cgs:
- print(cg.name)
-
-
-def test_list_cg_by_src_net_domain(drsdriver):
- nd = "f9d6a249-c922-4fa1-9f0f-de5b452c4026"
- cgs = drsdriver.list_consistency_groups(source_network_domain_id=nd)
- assert cgs[0].name == "sdk_test2_cg"
-
-
-def test_list_cg_by_name(drsdriver):
- name = "sdk_test2_cg"
- cg = drsdriver.list_consistency_groups(name=name)
- assert cg[0].id == "3710c093-7dcc-4a21-bd07-af9f4d93b6b5"
-
-
-def test_get_consistency_group_by_id(drsdriver):
- cgs = drsdriver.list_consistency_groups()
- cg_id = [i for i in cgs if i.name == "sdk_test2_cg"][0].id
- cg = drsdriver.get_consistency_group(cg_id)
- assert hasattr(cg, 'description')
-
-
-def test_get_snapshots(drsdriver):
- cgs = drsdriver.list_consistency_groups()
- cg_id = [i for i in cgs if i.name == "sdk_test2_cg"][0].id
- snaps = drsdriver.list_consistency_group_snapshots(cg_id)
- assert hasattr(snaps, 'journalUsageGb')
-
-
-def test_get_snapshots_by_min_max(drsdriver):
- cgs = drsdriver.list_consistency_groups()
- cg_id = [i for i in cgs if i.name == "sdk_test2_cg"][0].id
- snaps = drsdriver.list_consistency_group_snapshots(
- cg_id,
- create_time_min="2018-11-06T00:00:00.000Z",
- create_time_max="2018-11-07T00:00:00.000Z")
- for snap in snaps.snapshot:
- print(snap)
-
-
-def test_get_snapshots_by_min(drsdriver):
- cgs = drsdriver.list_consistency_groups()
- cg_id = [i for i in cgs if i.name == "sdk_test2_cg"][0].id
- snaps = drsdriver.list_consistency_group_snapshots(
- cg_id,
- create_time_min="2018-11-07T00:00:00.000-05:00")
- for snap in snaps.snapshot:
- print(snap)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/b9dfbf71/tests/lib_misc_test.py
----------------------------------------------------------------------
diff --git a/tests/lib_misc_test.py b/tests/lib_misc_test.py
deleted file mode 100644
index d8be518..0000000
--- a/tests/lib_misc_test.py
+++ /dev/null
@@ -1,10 +0,0 @@
-import pytest
-import libcloud
-from libcloud import loadbalancer
-from libcloud.common.nttcis import NttCisAPIException
-
-
-def test_server_clone_to_image(compute_driver):
- node = compute_driver.ex_get_node_by_id('040fefdb-78be-4b17-8ef9-86820bad67d9 ')
- result = compute_driver.ex_clone_node_to_image(node, 'sdk_test_image', image_description='A test image for libcloud')
- assert result is True
[19/21] libcloud git commit: removeed doc string indentations
Posted by an...@apache.org.
removeed doc string indentations
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/9dfd0352
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/9dfd0352
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/9dfd0352
Branch: refs/heads/trunk
Commit: 9dfd0352cbeafdcbe6f4e87a5650507d5b35f62b
Parents: 6cb6353
Author: mitch <mi...@itaas.dimensiondata.com>
Authored: Tue Dec 18 22:49:25 2018 -0500
Committer: mitch <mi...@itaas.dimensiondata.com>
Committed: Tue Dec 18 22:49:25 2018 -0500
----------------------------------------------------------------------
libcloud/compute/drivers/nttcis.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/9dfd0352/libcloud/compute/drivers/nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/nttcis.py b/libcloud/compute/drivers/nttcis.py
index 5fbf482..d850304 100644
--- a/libcloud/compute/drivers/nttcis.py
+++ b/libcloud/compute/drivers/nttcis.py
@@ -4832,7 +4832,7 @@ class NttCisNodeDriver(NodeDriver):
:param consistency_group_id: Consistency Group's Id
:type ``str``
:return: True if response_code contains eiether 'IN_PROGRESS' or 'OK'
- otherwise False
+ otherwise False
:rtype: ``bool``
"""
preview_elm = ET.Element("stopPreviewSnapshot",
@@ -4853,7 +4853,7 @@ class NttCisNodeDriver(NodeDriver):
:param consistency_group_id: Consistency Group's Id to failover
:type consistency_group_id: ``str``
:return: :return: True if response_code contains eiether
- 'IN_PROGRESS' or 'OK' otherwise False
+ IN_PROGRESS' or 'OK' otherwise False
:rtype: ``bool``
"""
failover_elm = ET.Element("initiateFailover",
@@ -4873,7 +4873,7 @@ class NttCisNodeDriver(NodeDriver):
:param consistency_group_id: Id of Consistency Group to delete
:type ``str``
:return: True if response_code contains eiether
- 'IN_PROGRESS' or 'OK' otherwise False
+ IN_PROGRESS' or 'OK' otherwise False
:rtype: ``bool``
"""
delete_elm = ET.Element("deleteConsistencyGroup",
[17/21] libcloud git commit: fixed PEP 8 line too long 4855 & 4875
Posted by an...@apache.org.
fixed PEP 8 line too long 4855 & 4875
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/db3fe925
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/db3fe925
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/db3fe925
Branch: refs/heads/trunk
Commit: db3fe925787df889aece79f400d177a50e704d06
Parents: d20f40b
Author: mitch <mi...@itaas.dimensiondata.com>
Authored: Tue Dec 18 22:01:12 2018 -0500
Committer: mitch <mi...@itaas.dimensiondata.com>
Committed: Tue Dec 18 22:01:12 2018 -0500
----------------------------------------------------------------------
libcloud/compute/drivers/nttcis.py | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/db3fe925/libcloud/compute/drivers/nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/nttcis.py b/libcloud/compute/drivers/nttcis.py
index bf17c84..c9084d8 100644
--- a/libcloud/compute/drivers/nttcis.py
+++ b/libcloud/compute/drivers/nttcis.py
@@ -4663,9 +4663,9 @@ class NttCisNodeDriver(NodeDriver):
:param source_server_id: Id of the server to copy
:type source_server_id: ``str``
:param target_server_id: Id of the server to receive the copy
- :type: ``str``
+ :type: target_server_id: ``str``
:param description: (Optional) Description of consistency group
- :type: ``str``
+ :type: description: ``str``
:return: :class: `NttCisConsistenccyGroup`
"""
@@ -4785,7 +4785,8 @@ class NttCisNodeDriver(NodeDriver):
:type consistency_group_id: ``str``
:param size_gb: Gb in 100 Gb increments
:type size_gb: ``str``
- :return: ``bool``
+ :return: True/False
+ :rtype: ``bool``
"""
expand_elm = ET.Element("expandJournal", {"id": consistency_group_id,
@@ -4808,7 +4809,8 @@ class NttCisNodeDriver(NodeDriver):
:type consistency_group_id: ``str``
:param snapshot_id: Id of the Snapshot to preview
:type snapshot_id: ``str``
- :return: True/False
+ :return: True if response_code contains eiether 'IN_PROGRESS' or 'OK'
+ otherwise False
:rtype: ``bool``
"""
preview_elm = ET.Element("startPreviewSnapshot",
@@ -4829,7 +4831,8 @@ class NttCisNodeDriver(NodeDriver):
:param consistency_group_id: Consistency Group's Id
:type ``str``
- :return: True/False
+ :return: True if response_code contains eiether 'IN_PROGRESS' or 'OK'
+ otherwise False
:rtype: ``bool``
"""
preview_elm = ET.Element("stopPreviewSnapshot",
@@ -4849,7 +4852,8 @@ class NttCisNodeDriver(NodeDriver):
:param consistency_group_id: Consistency Group's Id to failover
:type consistency_group_id: ``str``
- :return: True/False
+ :return: :return: True if response_code contains eiether
+ 'IN_PROGRESS' or 'OK' otherwise False
:rtype: ``bool``
"""
failover_elm = ET.Element("initiateFailover",
@@ -4868,7 +4872,8 @@ class NttCisNodeDriver(NodeDriver):
:param consistency_group_id: Id of Consistency Group to delete
:type ``str``
- :return: True/False
+ :return: :return: True if response_code contains eiether
+ 'IN_PROGRESS' or 'OK' otherwise False
:rtype: ``bool``
"""
delete_elm = ET.Element("deleteConsistencyGroup",
[18/21] libcloud git commit: fixed doc strings
Posted by an...@apache.org.
fixed doc strings
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/6cb63531
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/6cb63531
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/6cb63531
Branch: refs/heads/trunk
Commit: 6cb635317786b25ff784a582e2368636180c2958
Parents: db3fe92
Author: mitch <mi...@itaas.dimensiondata.com>
Authored: Tue Dec 18 22:25:19 2018 -0500
Committer: mitch <mi...@itaas.dimensiondata.com>
Committed: Tue Dec 18 22:25:19 2018 -0500
----------------------------------------------------------------------
libcloud/compute/drivers/nttcis.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/6cb63531/libcloud/compute/drivers/nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/nttcis.py b/libcloud/compute/drivers/nttcis.py
index c9084d8..5fbf482 100644
--- a/libcloud/compute/drivers/nttcis.py
+++ b/libcloud/compute/drivers/nttcis.py
@@ -4872,7 +4872,7 @@ class NttCisNodeDriver(NodeDriver):
:param consistency_group_id: Id of Consistency Group to delete
:type ``str``
- :return: :return: True if response_code contains eiether
+ :return: True if response_code contains eiether
'IN_PROGRESS' or 'OK' otherwise False
:rtype: ``bool``
"""
[11/21] libcloud git commit: Removed requirements for python-dateutil
for test/compute/test-nttcis.py
Posted by an...@apache.org.
Removed requirements for python-dateutil for test/compute/test-nttcis.py
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/484855d4
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/484855d4
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/484855d4
Branch: refs/heads/trunk
Commit: 484855d41a5f967b1d86327448fce93751881f52
Parents: 46096c4
Author: mitch <mi...@itaas.dimensiondata.com>
Authored: Thu Dec 6 12:07:54 2018 -0500
Committer: mitch <mi...@itaas.dimensiondata.com>
Committed: Thu Dec 6 12:07:54 2018 -0500
----------------------------------------------------------------------
libcloud/test/compute/test_nttcis.py | 2 +-
tox.ini | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/484855d4/libcloud/test/compute/test_nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_nttcis.py b/libcloud/test/compute/test_nttcis.py
index dac4226..8122317 100644
--- a/libcloud/test/compute/test_nttcis.py
+++ b/libcloud/test/compute/test_nttcis.py
@@ -1880,7 +1880,7 @@ def test_get_drs_snapshots_by_min_max(driver):
create_time_min="2018-11-28T00:00:00.000Z",
create_time_max="2018-11-29T00:00:00.000Z")
for snap in snaps.snapshot:
- assert (parse(snaps.snapshot[0].createTime) < parse(snap.createTime)) is False
+ assert "2018-12" not in snap
def test_get_drs_snapshots_by_min(driver):
http://git-wip-us.apache.org/repos/asf/libcloud/blob/484855d4/tox.ini
----------------------------------------------------------------------
diff --git a/tox.ini b/tox.ini
index 7485e61..1f89719 100644
--- a/tox.ini
+++ b/tox.ini
@@ -7,7 +7,6 @@ deps =
-r{toxinidir}/requirements-tests.txt
lockfile
pyopenssl
- python-dateutil
libvirt-python==4.0.0
py2.7: paramiko
commands = cp libcloud/test/secrets.py-dist libcloud/test/secrets.py
@@ -30,7 +29,7 @@ commands = cp libcloud/test/secrets.py-dist libcloud/test/secrets.py
python -m unittest discover libcloud/test
[testenv:docs]
-deps = pysphere
+deps = pyspher
backports.ssl_match_hostname
lockfile
rstcheck
[03/21] libcloud git commit: edited index.rst under drs/drivers in
docs
Posted by an...@apache.org.
edited index.rst under drs/drivers in docs
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/bee85e76
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/bee85e76
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/bee85e76
Branch: refs/heads/trunk
Commit: bee85e7651f1dbfe3f0db95138c60431c02ada1e
Parents: 30d2af8
Author: mitch <mi...@itaas.dimensiondata.com>
Authored: Tue Nov 13 15:56:43 2018 -0500
Committer: mitch <mi...@itaas.dimensiondata.com>
Committed: Tue Nov 13 15:56:43 2018 -0500
----------------------------------------------------------------------
docs/drs/_supported_methods.rst | 12 ++++++------
docs/drs/_supported_providers.rst | 12 ++++++------
docs/drs/drivers/index.rst | 2 +-
docs/drs/drivers/nttcis.rst | 2 +-
docs/drs/index.rst | 2 +-
libcloud/drs/drivers/nttcis.py | 2 +-
6 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/bee85e76/docs/drs/_supported_methods.rst
----------------------------------------------------------------------
diff --git a/docs/drs/_supported_methods.rst b/docs/drs/_supported_methods.rst
index ac74337..f6cb8cf 100644
--- a/docs/drs/_supported_methods.rst
+++ b/docs/drs/_supported_methods.rst
@@ -1,9 +1,9 @@
.. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it
-=================================== ======================== ======================= ===================== ======================== ================================ ============== ====================== ===================== =================
-Provider create_consistency_group list_consistency_groups get_consistency_group delete_consistency_group list_consistency_group_snapshots expand_journal start_failover_preview stop_failover_preview initiate_failover
-=================================== ======================== ======================= ===================== ======================== ================================ ============== ====================== ===================== =================
-`NTTC-CIS DRS Consistencty Groups`_ yes yes yes no yes no no no no
-=================================== ======================== ======================= ===================== ======================== ================================ ============== ====================== ===================== =================
+================================== ======================== ======================= ===================== ======================== ================================ ============== ====================== ===================== =================
+Provider create_consistency_group list_consistency_groups get_consistency_group delete_consistency_group list_consistency_group_snapshots expand_journal start_failover_preview stop_failover_preview initiate_failover
+================================== ======================== ======================= ===================== ======================== ================================ ============== ====================== ===================== =================
+`NTTC-CIS DRS Consistency Groups`_ yes yes yes yes yes yes yes yes yes
+================================== ======================== ======================= ===================== ======================== ================================ ============== ====================== ===================== =================
-.. _`NTTC-CIS DRS Consistencty Groups`: https://cloud.nttcis.com/
+.. _`NTTC-CIS DRS Consistency Groups`: https://www.us.ntt.com/en/services/cloud/enterprise-cloud.html
http://git-wip-us.apache.org/repos/asf/libcloud/blob/bee85e76/docs/drs/_supported_providers.rst
----------------------------------------------------------------------
diff --git a/docs/drs/_supported_providers.rst b/docs/drs/_supported_providers.rst
index d282e4a..d94ee32 100644
--- a/docs/drs/_supported_providers.rst
+++ b/docs/drs/_supported_providers.rst
@@ -1,9 +1,9 @@
.. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it
-=================================== ================================== ================= ==================== ================================== ========================
-Provider Documentation Provider Constant Supported Regions Module Class Name
-=================================== ================================== ================= ==================== ================================== ========================
-`NTTC-CIS DRS Consistencty Groups`_ :doc:`Click </drs/drivers/nttcis>` NTTCIS single region driver :mod:`libcloud.drs.drivers.nttcis` :class:`NttCisDRSDriver`
-=================================== ================================== ================= ==================== ================================== ========================
+================================== ================================== ================= ==================== ================================== ========================
+Provider Documentation Provider Constant Supported Regions Module Class Name
+================================== ================================== ================= ==================== ================================== ========================
+`NTTC-CIS DRS Consistency Groups`_ :doc:`Click </drs/drivers/nttcis>` NTTCIS single region driver :mod:`libcloud.drs.drivers.nttcis` :class:`NttCisDRSDriver`
+================================== ================================== ================= ==================== ================================== ========================
-.. _`NTTC-CIS DRS Consistencty Groups`: https://cloud.nttcis.com/
+.. _`NTTC-CIS DRS Consistency Groups`: https://www.us.ntt.com/en/services/cloud/enterprise-cloud.html
http://git-wip-us.apache.org/repos/asf/libcloud/blob/bee85e76/docs/drs/drivers/index.rst
----------------------------------------------------------------------
diff --git a/docs/drs/drivers/index.rst b/docs/drs/drivers/index.rst
index 5599158..8d244b8 100644
--- a/docs/drs/drivers/index.rst
+++ b/docs/drs/drivers/index.rst
@@ -1,6 +1,6 @@
:orphan:
-DNS Drivers Documentation
+DRS Drivers Documentation
=========================
This chapter includes links to driver (provider) specific documentation pages.
http://git-wip-us.apache.org/repos/asf/libcloud/blob/bee85e76/docs/drs/drivers/nttcis.rst
----------------------------------------------------------------------
diff --git a/docs/drs/drivers/nttcis.rst b/docs/drs/drivers/nttcis.rst
index 6987929..b2d9b98 100644
--- a/docs/drs/drivers/nttcis.rst
+++ b/docs/drs/drivers/nttcis.rst
@@ -1,7 +1,7 @@
NttCis DRS Driver Documentation
===============================
-`NttC-Cis`_ offers disaster recovery services for Compute Services.
+NTT Communications CIS offers disaster recovery services for Compute Services.
Instantiating the driver
http://git-wip-us.apache.org/repos/asf/libcloud/blob/bee85e76/docs/drs/index.rst
----------------------------------------------------------------------
diff --git a/docs/drs/index.rst b/docs/drs/index.rst
index 909b8ae..2dd4c70 100644
--- a/docs/drs/index.rst
+++ b/docs/drs/index.rst
@@ -3,7 +3,7 @@ DRS
.. note::
- DRS API is available in Libcloud 2.4.0 and higher.
+ DRS API is available in Libcloud 2.4,x and higher.
DRS API allows you to manage disaster recovery as a separate service.
http://git-wip-us.apache.org/repos/asf/libcloud/blob/bee85e76/libcloud/drs/drivers/nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/drs/drivers/nttcis.py b/libcloud/drs/drivers/nttcis.py
index bb2bdae..148d11a 100644
--- a/libcloud/drs/drivers/nttcis.py
+++ b/libcloud/drs/drivers/nttcis.py
@@ -38,7 +38,7 @@ class NttCisDRSDriver(DRSDriver):
selected_region = None
connectionCls = NttCisConnection
- name = 'NTTC-CIS DRS Consistencty Groups'
+ name = 'NTTC-CIS DRS Consistency Groups'
website = 'https://www.us.ntt.com/en/services/cloud/enterprise-cloud.html'
type = Provider.NTTCIS
api_version = 1.0
[13/21] libcloud git commit: replaced Dimension Data with NTTC-CIS in
some doc strings in loadbalancers/drivers/nttcis.py
Posted by an...@apache.org.
replaced Dimension Data with NTTC-CIS in some doc strings in loadbalancers/drivers/nttcis.py
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/a14a2d99
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/a14a2d99
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/a14a2d99
Branch: refs/heads/trunk
Commit: a14a2d995f22a9fb6f4a17004d41a8c8e08aa365
Parents: 3906dd3
Author: mitch <mi...@itaas.dimensiondata.com>
Authored: Thu Dec 13 15:29:24 2018 -0500
Committer: mitch <mi...@itaas.dimensiondata.com>
Committed: Thu Dec 13 15:29:24 2018 -0500
----------------------------------------------------------------------
libcloud/loadbalancer/drivers/nttcis.py | 6 +++---
libcloud/test/compute/test_nttcis.py | 1 -
2 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/a14a2d99/libcloud/loadbalancer/drivers/nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/loadbalancer/drivers/nttcis.py b/libcloud/loadbalancer/drivers/nttcis.py
index 5d56e0c..1e15110 100644
--- a/libcloud/loadbalancer/drivers/nttcis.py
+++ b/libcloud/loadbalancer/drivers/nttcis.py
@@ -229,7 +229,7 @@ class NttCisLBDriver(Driver):
"""
List all loadbalancers inside a geography or in given network.
- In Dimension Data terminology these are known as virtual listeners
+ In NTTC-CIS terminology these are known as virtual listeners
:param ex_network_domain_id: UUID of Network Domain
if not None returns only balancers in the given network
@@ -266,7 +266,7 @@ class NttCisLBDriver(Driver):
"""
Return a list of supported protocols.
- Since all protocols are support by Dimension Data, this is a list
+ Since all protocols are support by NTTC-CIS, this is a list
of common protocols.
:rtype: ``list`` of ``str``
@@ -277,7 +277,7 @@ class NttCisLBDriver(Driver):
"""
Return list of members attached to balancer.
- In Dimension Data terminology these are the members of the pools
+ In NTTC-CIS terminology these are the members of the pools
within a virtual listener.
:param balancer: LoadBalancer which should be used
http://git-wip-us.apache.org/repos/asf/libcloud/blob/a14a2d99/libcloud/test/compute/test_nttcis.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_nttcis.py b/libcloud/test/compute/test_nttcis.py
index 8122317..8fa8a53 100644
--- a/libcloud/test/compute/test_nttcis.py
+++ b/libcloud/test/compute/test_nttcis.py
@@ -1,5 +1,4 @@
import pytest
-from dateutil.parser import parse
from types import GeneratorType
from libcloud.utils.py3 import httplib
from libcloud.utils.py3 import ET