[1/4] libcloud git commit: fix behaviour when pool does not exist
Repository: libcloud Updated Branches: refs/heads/trunk db1f603a4 -> f742c9091 fix behaviour when pool does not exist Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/7ce64e92 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/7ce64e92 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/7ce64e92 Branch: refs/heads/trunk Commit: 7ce64e925b25c5b8ef42a38763c91951a53f4cf3 Parents: 47ac74b Author: Bernard PaquesAuthored: Sat Dec 26 19:24:22 2015 +0100 Committer: anthony-shaw Committed: Tue Jan 5 19:26:59 2016 +1100 -- libcloud/loadbalancer/drivers/dimensiondata.py | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/7ce64e92/libcloud/loadbalancer/drivers/dimensiondata.py -- diff --git a/libcloud/loadbalancer/drivers/dimensiondata.py b/libcloud/loadbalancer/drivers/dimensiondata.py index 337997d..9d0dfd2 100644 --- a/libcloud/loadbalancer/drivers/dimensiondata.py +++ b/libcloud/loadbalancer/drivers/dimensiondata.py @@ -1041,9 +1041,15 @@ class DimensionDataLBDriver(Driver): port = findtext(element, 'port', TYPES_URN) extra = {} -extra['pool_id'] = element.find(fixxpath( +pool_element = element.find(fixxpath( 'pool', -TYPES_URN)).get('id') +TYPES_URN)) +if pool_element is None: +extra['pool_id'] = None + +else: +extra['pool_id'] = pool_element.get('id') + extra['network_domain_id'] = findtext(element, 'networkDomainId', TYPES_URN)
[3/4] libcloud git commit: add ipv6 to node, from primary nic
add ipv6 to node, from primary nic Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/08937bef Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/08937bef Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/08937bef Branch: refs/heads/trunk Commit: 08937befa7d7877b2b5bb50df6c8c89b0ae65d87 Parents: db1f603 Author: Bernard PaquesAuthored: Sat Dec 26 18:53:48 2015 +0100 Committer: anthony-shaw Committed: Tue Jan 5 19:26:59 2016 +1100 -- libcloud/compute/drivers/dimensiondata.py | 6 ++ 1 file changed, 6 insertions(+) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/08937bef/libcloud/compute/drivers/dimensiondata.py -- diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py index cab39f5..d5bce7b 100644 --- a/libcloud/compute/drivers/dimensiondata.py +++ b/libcloud/compute/drivers/dimensiondata.py @@ -1694,6 +1694,12 @@ class DimensionDataNodeDriver(NodeDriver): if has_network_info else \ element.find(fixxpath('nic', TYPES_URN)).get('privateIpv4') +node.extra['ipv6'] = element.find( +fixxpath('networkInfo/primaryNic', TYPES_URN)) \ +.get('ipv6') \ +if has_network_info else \ +element.find(fixxpath('nic', TYPES_URN)).get('ipv6') + n = Node(id=element.get('id'), name=findtext(element, 'name', TYPES_URN), state=state,
[2/4] libcloud git commit: allow for a firewell to target a single host address
allow for a firewell to target a single host address Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/47ac74b0 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/47ac74b0 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/47ac74b0 Branch: refs/heads/trunk Commit: 47ac74b0b9433bff413fe7b1ab903ba7133f9470 Parents: 08937be Author: Bernard PaquesAuthored: Sat Dec 26 19:00:54 2015 +0100 Committer: anthony-shaw Committed: Tue Jan 5 19:26:59 2016 +1100 -- libcloud/compute/drivers/dimensiondata.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/47ac74b0/libcloud/compute/drivers/dimensiondata.py -- diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py index d5bce7b..6e812b8 100644 --- a/libcloud/compute/drivers/dimensiondata.py +++ b/libcloud/compute/drivers/dimensiondata.py @@ -956,7 +956,7 @@ class DimensionDataNodeDriver(NodeDriver): source_ip.set('address', 'ANY') else: source_ip.set('address', rule.source.ip_address) -source_ip.set('prefixSize', rule.source.ip_prefix_size) +source_ip.set('prefixSize', str(rule.source.ip_prefix_size)) if rule.source.port_begin is not None: source_port = ET.SubElement(source, 'port') source_port.set('begin', rule.source.port_begin) @@ -969,7 +969,8 @@ class DimensionDataNodeDriver(NodeDriver): dest_ip.set('address', 'ANY') else: dest_ip.set('address', rule.destination.ip_address) -dest_ip.set('prefixSize', rule.destination.ip_prefix_size) +if rule.destination.ip_prefix_size is not None: +dest_ip.set('prefixSize', rule.destination.ip_prefix_size) if rule.destination.port_begin is not None: dest_port = ET.SubElement(dest, 'port') dest_port.set('begin', rule.destination.port_begin)
[GitHub] libcloud pull request: small network and security improvement in D...
Github user asfgit closed the pull request at: https://github.com/apache/libcloud/pull/667 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[05/26] libcloud git commit: structure for docs and API specification.
structure for docs and API specification. Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/c6f95d61 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/c6f95d61 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/c6f95d61 Branch: refs/heads/trunk Commit: c6f95d6159e663e777618eeb32734f786d7bfd78 Parents: 754ae4a Author: Anthony ShawAuthored: Mon Nov 9 14:17:07 2015 +1100 Committer: Anthony Shaw Committed: Mon Nov 9 14:17:07 2015 +1100 -- .../generate_provider_feature_matrix_table.py | 33 ++- docs/backup/_supported_methods.rst | 10 + docs/backup/_supported_providers.rst| 43 docs/backup/api.rst | 22 ++ docs/backup/drivers/index.rst | 12 ++ docs/backup/examples.rst| 5 +++ docs/backup/index.rst | 36 docs/backup/supported_providers.rst | 14 +++ docs/supported_providers.rst| 13 ++ libcloud/backup/base.py | 2 +- libcloud/backup/types.py| 4 +- 11 files changed, 190 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/c6f95d61/contrib/generate_provider_feature_matrix_table.py -- diff --git a/contrib/generate_provider_feature_matrix_table.py b/contrib/generate_provider_feature_matrix_table.py index cfea318..2a5d638 100755 --- a/contrib/generate_provider_feature_matrix_table.py +++ b/contrib/generate_provider_feature_matrix_table.py @@ -45,6 +45,11 @@ from libcloud.dns.providers import get_driver as get_dns_driver from libcloud.dns.providers import DRIVERS as DNS_DRIVERS from libcloud.dns.types import Provider as DNSProvider +from libcloud.backup.base import BackupDriver +from libcloud.backup.providers import get_driver as get_backup_driver +from libcloud.backup.providers import DRIVERS as BACKUP_DRIVERS +from libcloud.backup.types import Provider as BackupProvider + REQUIRED_DEPENDENCIES = [ 'pysphere' ] @@ -88,7 +93,11 @@ BASE_API_METHODS = { 'get_container_cdn_url', 'get_object_cdn_url'], 'dns': ['list_zones', 'list_records', 'iterate_zones', 'iterate_records', 'create_zone', 'update_zone', 'create_record', 'update_record', -'delete_zone', 'delete_record'] +'delete_zone', 'delete_record'], +'backup': ['get_supported_target_types', 'list_targets', 'create_target', 'create_target_from_node', + 'create_target_from_container', 'update_target', 'delete_target', 'list_recovery_points', + 'recover_target', 'recover_target_out_of_place', 'list_target_jobs', 'create_target_job', + 'resume_target_job', 'suspend_target_job', 'cancel_target_job'] } FRIENDLY_METHODS_NAMES = { @@ -160,6 +169,23 @@ FRIENDLY_METHODS_NAMES = { 'delete_zone': 'delete zone', 'delete_record': 'delete record' }, +'backup': { +'get_supported_target_types': 'get supported target types', +'list_targets': 'list targets', +'create_target': 'create target', +'create_target_from_node': 'create target from node', +'create_target_from_container': 'create target from container', +'update_target': 'update target', +'delete_target': 'delete target', +'list_recovery_points': 'list recovery points', +'recover_target': 'recover target', +'recover_target_out_of_place': 'recover target out of place', +'list_target_jobs': 'list target jobs', +'create_target_job': 'create target job', +'resume_target_job': 'resume target job', +'suspend_target_job': 'suspend target job', +'cancel_target_job': 'cancel target job' +}, } IGNORED_PROVIDERS = [ @@ -203,6 +229,11 @@ def generate_providers_table(api): drivers = DNS_DRIVERS provider = DNSProvider get_driver_method = get_dns_driver +elif api == 'backup': +driver = BackupDriver +drivers = BACKUP_DRIVERS +provider = BackupProvider +get_driver_method = get_backup_driver else: raise Exception('Invalid api: %s' % (api)) http://git-wip-us.apache.org/repos/asf/libcloud/blob/c6f95d61/docs/backup/_supported_methods.rst -- diff --git a/docs/backup/_supported_methods.rst b/docs/backup/_supported_methods.rst new file mode 100644 index 000..5076b2c --- /dev/null +++ b/docs/backup/_supported_methods.rst @@ -0,0 +1,10 @@ +.. NOTE: This file has
[20/26] libcloud git commit: Update code after code review on PR by @Kami
Update code after code review on PR by @Kami Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/f0cc015f Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/f0cc015f Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/f0cc015f Branch: refs/heads/trunk Commit: f0cc015f437d5119e223c47cd09566735c6dd362 Parents: 98899b1 Author: anthony-shawAuthored: Wed Dec 30 21:33:10 2015 +1100 Committer: anthony-shaw Committed: Wed Dec 30 21:33:10 2015 +1100 -- docs/examples/backup/create_backup_from_node.py | 12 ++-- libcloud/backup/base.py | 75 ++-- 2 files changed, 45 insertions(+), 42 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/f0cc015f/docs/examples/backup/create_backup_from_node.py -- diff --git a/docs/examples/backup/create_backup_from_node.py b/docs/examples/backup/create_backup_from_node.py index ec7c2d6..3c6bea2 100644 --- a/docs/examples/backup/create_backup_from_node.py +++ b/docs/examples/backup/create_backup_from_node.py @@ -1,13 +1,15 @@ import time from pprint import pprint -from libcloud.backup.types import Provider, BackupTargetJobStatusType +from libcloud.backup.types import BackupTargetJobStatusType +from libcloud.backup.types import Provider as BackupProvider from libcloud.backup.providers import get_driver as get_backup_driver from libcloud.compute.providers import get_driver as get_compute_driver +from libcloud.compute.types import Provider as ComputeProvider -backup_driver = get_backup_driver(Provider.AZURE)('username', 'api key') -compute_driver = get_compute_driver(Provider.AZURE)('username', 'api key') +backup_driver = get_backup_driver(BackupProvider.AZURE)('username', 'api key') +compute_driver = get_compute_driver(ComputeProvider.AZURE)('username', 'api key') nodes = compute_driver.list_nodes() @@ -27,10 +29,10 @@ while True: else: job = backup_driver.get_target_job(job.id) -print('Job is now at %s percent complete' % job.progress) +print('Job is now at %s percent complete' % (job.progress)) time.sleep(20) -print('Job is completed with status- %s' % job.status) +print('Job is completed with status- %s' % (job.status)) print('Getting a list of recovery points') recovery_points = backup_driver.list_recovery_points(new_target) http://git-wip-us.apache.org/repos/asf/libcloud/blob/f0cc015f/libcloud/backup/base.py -- diff --git a/libcloud/backup/base.py b/libcloud/backup/base.py index f57f5d8..8b91068 100644 --- a/libcloud/backup/base.py +++ b/libcloud/backup/base.py @@ -41,10 +41,10 @@ class BackupTarget(object): :type address: ``str`` :param type: Backup target type (Physical, Virtual, ...). -:type type: :class:`BackupTargetType` +:type type: :class:`.BackupTargetType` :param driver: BackupDriver instance. -:type driver: :class:`BackupDriver` +:type driver: :class:`.BackupDriver` :param extra: (optional) Extra attributes (driver specific). :type extra: ``dict`` @@ -97,10 +97,10 @@ class BackupTargetJob(object): :type progress: ``int`` :param target: BackupTarget instance. -:type target: :class:`BackupTarget` +:type target: :class:`.BackupTarget` :param driver: BackupDriver instance. -:type driver: :class:`BackupDriver` +:type driver: :class:`.BackupDriver` :param extra: (optional) Extra attributes (driver specific). :type extra: ``dict`` @@ -142,10 +142,10 @@ class BackupTargetRecoveryPoint(object): :type date: :class:`datetime.datetime` :param target: BackupTarget instance. -:type target: :class:`BackupTarget` +:type target: :class:`.BackupTarget` :param driver: BackupDriver instance. -:type driver: :class:`BackupDriver` +:type driver: :class:`.BackupDriver` :param extra: (optional) Extra attributes (driver specific). :type extra: ``dict`` @@ -163,7 +163,7 @@ class BackupTargetRecoveryPoint(object): :param path: The part of the recovery point to recover (optional) :type path: ``str`` -:rtype: Instance of :class:`BackupTargetJob` +:rtype: Instance of :class:`.BackupTargetJob` """ return self.driver.recover_target(target=self.target, recovery_point=self, path=path) @@ -173,12 +173,12 @@ class BackupTargetRecoveryPoint(object): Recover this recovery point out of place :param recovery_target: Backup target
[02/26] libcloud git commit: Basic structure of the backup driver.
Basic structure of the backup driver. A backup driver can list targets, each target has a type (e.g. virtual server, database, filesystem) targets then have recovery points and jobs, jobs can be started, stopped, paused. recovery points can be listed for each target and recovered. Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/121cceb9 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/121cceb9 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/121cceb9 Branch: refs/heads/trunk Commit: 121cceb98c06d530090594be6a8b49b97befceab Parents: 99edca7 Author: Anthony ShawAuthored: Mon Nov 9 11:36:25 2015 +1100 Committer: Anthony Shaw Committed: Mon Nov 9 11:36:25 2015 +1100 -- libcloud/backup/base.py | 397 +- libcloud/backup/types.py | 32 2 files changed, 428 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/121cceb9/libcloud/backup/base.py -- diff --git a/libcloud/backup/base.py b/libcloud/backup/base.py index 0c4723a..4e51365 100644 --- a/libcloud/backup/base.py +++ b/libcloud/backup/base.py @@ -14,12 +14,185 @@ # limitations under the License. from libcloud.common.base import ConnectionUserAndKey, BaseDriver +from libcloud.backup.types import BackupTargetType __all__ = [ -'BackupDriver' +'BackupTarget', +'BackupDriver', +'BackupTargetJob', +'BackupTargetRecoveryPoint' ] +class BackupTarget(object): +""" +A backup target +""" + +def __init__(self, id, name, address, type, driver, extra=None): +""" +:param id: Record id +:type id: ``str`` + +:param name: Name of the target +:type name: ``str`` + +:param address: Hostname, FQDN, IP, file path etc. +:type address: ``str`` + +:param type: Backup target type (Physical, Virtual, ...). +:type type: :class:`BackupTargetType` + +:param driver: BackupDriver instance. +:type driver: :class:`BackupDriver` + +:param extra: (optional) Extra attributes (driver specific). +:type extra: ``dict`` +""" +self.id = str(id) if id else None +self.name = name +self.address = address +self.type = type +self.driver = driver +self.extra = extra or {} + +def update(self, name=None, address=None, extra=None): +return self.driver.update_target(target=self, + name=name, + address=address, + extra=extra) + +def delete(self): +return self.driver.delete_target(target=self) + +def _get_numeric_id(self): +target_id = self.id + +if target_id.isdigit(): +target_id = int(target_id) + +return target_id + +def __repr__(self): +return ('' % +(self.id, self.name, self.address, + self.type, self.driver.name)) + + +class BackupTargetJob(object): +""" +A backup target job +""" + +def __init__(self, id, status, progress, target, driver, extra=None): +""" +:param id: Job id +:type id: ``str`` + +:param status: Status of the job +:type status: :class:`BackupTargetJobStatus` + +:param progress: Progress of the job, as a percentage +:type progress: ``int`` + +:param target: BackupTarget instance. +:type target: :class:`BackupTarget` + +:param driver: BackupDriver instance. +:type driver: :class:`BackupDriver` + +:param extra: (optional) Extra attributes (driver specific). +:type extra: ``dict`` +""" +self.id = str(id) if id else None +self.status = status +self.progress = progress +self.target = target +self.driver = driver +self.extra = extra or {} + +def cancel(self): +return self.driver.cancel_target_job(target=self.target, job=self) + +def suspend(self): +return self.driver.suspend_target_job(target=self.target, job=self) + +def resume(self): +return self.driver.resume_target_job(target=self.target, job=self) + +def __repr__(self): +return ('' % +(self.id, self.status, self.progress, + self.target.id, self.driver.name)) + + +class BackupTargetRecoveryPoint(object): +""" +A backup target recovery point +""" + +def __init__(self, id, date, target, driver, extra=None): +""" +:param id: Job id +:type id: ``str`` + +:param date: The date taken +
[01/26] libcloud git commit: Initial structure for supporting backup driver type
Repository: libcloud Updated Branches: refs/heads/trunk 329bbc499 -> 94c6b9143 Initial structure for supporting backup driver type Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/99edca71 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/99edca71 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/99edca71 Branch: refs/heads/trunk Commit: 99edca71dbd83c64b0221e21ed2fe549e498600b Parents: ee6f984 Author: Anthony ShawAuthored: Mon Nov 9 09:38:09 2015 +1100 Committer: Anthony Shaw Committed: Mon Nov 9 09:38:09 2015 +1100 -- libcloud/backup/__init__.py | 0 libcloud/backup/base.py | 56 libcloud/backup/drivers/__init__.py | 0 libcloud/backup/drivers/dummy.py| 41 +++ libcloud/backup/providers.py| 31 ++ libcloud/backup/types.py| 22 + libcloud/test/backup/__init__.py| 0 libcloud/test/backup/test_base.py | 29 + setup.py| 5 +-- 9 files changed, 182 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/99edca71/libcloud/backup/__init__.py -- diff --git a/libcloud/backup/__init__.py b/libcloud/backup/__init__.py new file mode 100644 index 000..e69de29 http://git-wip-us.apache.org/repos/asf/libcloud/blob/99edca71/libcloud/backup/base.py -- diff --git a/libcloud/backup/base.py b/libcloud/backup/base.py new file mode 100644 index 000..0c4723a --- /dev/null +++ b/libcloud/backup/base.py @@ -0,0 +1,56 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from libcloud.common.base import ConnectionUserAndKey, BaseDriver + +__all__ = [ +'BackupDriver' +] + + +class BackupDriver(BaseDriver): +""" +A base BackupDriver class to derive from + +This class is always subclassed by a specific driver. +""" +connectionCls = ConnectionUserAndKey +name = None +website = None + +def __init__(self, key, secret=None, secure=True, host=None, port=None, + **kwargs): +""" +:paramkey: API key or username to used (required) +:type key: ``str`` + +:paramsecret: Secret password to be used (required) +:type secret: ``str`` + +:paramsecure: Whether to use HTTPS or HTTP. Note: Some providers +only support HTTPS, and it is on by default. +:type secure: ``bool`` + +:paramhost: Override hostname used for connections. +:type host: ``str`` + +:paramport: Override port used for connections. +:type port: ``int`` + +:return: ``None`` +""" +super(BackupDriver, self).__init__(key=key, secret=secret, + secure=secure, host=host, port=port, + **kwargs) http://git-wip-us.apache.org/repos/asf/libcloud/blob/99edca71/libcloud/backup/drivers/__init__.py -- diff --git a/libcloud/backup/drivers/__init__.py b/libcloud/backup/drivers/__init__.py new file mode 100644 index 000..e69de29 http://git-wip-us.apache.org/repos/asf/libcloud/blob/99edca71/libcloud/backup/drivers/dummy.py -- diff --git a/libcloud/backup/drivers/dummy.py b/libcloud/backup/drivers/dummy.py new file mode 100644 index 000..2b28d66 --- /dev/null +++ b/libcloud/backup/drivers/dummy.py @@ -0,0 +1,41 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version
[09/26] libcloud git commit: **
** Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/681879ba Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/681879ba Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/681879ba Branch: refs/heads/trunk Commit: 681879baa17597d421dad00cf208dfb4bbfac1c0 Parents: dfef8e9 Author: Anthony ShawAuthored: Mon Nov 9 15:02:26 2015 +1100 Committer: Anthony Shaw Committed: Mon Nov 9 15:02:26 2015 +1100 -- libcloud/backup/base.py | 1 - 1 file changed, 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/681879ba/libcloud/backup/base.py -- diff --git a/libcloud/backup/base.py b/libcloud/backup/base.py index 26ea2d8..b36dd6a 100644 --- a/libcloud/backup/base.py +++ b/libcloud/backup/base.py @@ -415,7 +415,6 @@ class BackupDriver(BaseDriver): jobs = self.list_target_jobs(target) return list(filter(lambda x: x.id == id, jobs))[0] - def list_target_jobs(self, target): """ List the backup jobs on a target
[13/26] libcloud git commit: Additional functions for the EBS example driver
Additional functions for the EBS example driver Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/b3ac5d36 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/b3ac5d36 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/b3ac5d36 Branch: refs/heads/trunk Commit: b3ac5d36963c81d3550a950aab1528889d1baed0 Parents: 37f8b47 Author: Anthony ShawAuthored: Tue Nov 10 14:07:50 2015 +1100 Committer: Anthony Shaw Committed: Tue Nov 10 14:07:50 2015 +1100 -- libcloud/backup/drivers/ebs.py | 63 - 1 file changed, 49 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/b3ac5d36/libcloud/backup/drivers/ebs.py -- diff --git a/libcloud/backup/drivers/ebs.py b/libcloud/backup/drivers/ebs.py index dbd2d4c..ea8f80e 100644 --- a/libcloud/backup/drivers/ebs.py +++ b/libcloud/backup/drivers/ebs.py @@ -17,10 +17,9 @@ __all__ = [ 'EBSBackupDriver' ] -from datetime import datetime from libcloud.utils.xml import findtext, findall - +from libcloud.utils.iso8601 import parse_date from libcloud.backup.base import BackupDriver, BackupTargetRecoveryPoint,\ BackupTargetJob, BackupTarget from libcloud.backup.types import BackupTargetType, BackupTargetJobStatusType @@ -114,10 +113,16 @@ class EBSBackupDriver(BackupDriver): :rtype: Instance of :class:`BackupTarget` """ -return self.create_target(name=node.name, - address=node.public_ips[0], - type=BackupTargetType.VOLUME, - extra=None) +# Get the first EBS volume. +device_mapping = node.extra['block_device_mapping'] +if device_mapping is not None: +return self.create_target( +name=node.name, +address=device_mapping['ebs'][0]['volume_id'], +type=BackupTargetType.VOLUME, +extra=None) +else: +raise RuntimeError("Node does not have any block devices") def create_target_from_container(self, container, type=BackupTargetType.OBJECT, @@ -280,11 +285,12 @@ class EBSBackupDriver(BackupDriver): :rtype: Instance of :class:`BackupTargetJob` """ params = { -'Action': 'DescribeSnapshots', +'Action': 'CreateSnapshot', 'VolumeId': target.extra['volume-id'] } data = self.connection.request(ROOT, params=params).object -return self._to_jobs(data)[0] +xpath = 'CreateSnapshotResponse' +return self._to_job(findall(element=data, xpath=xpath, namespace=NS)[0]) def resume_target_job(self, target, job): """ @@ -299,7 +305,7 @@ class EBSBackupDriver(BackupDriver): :rtype: ``bool`` """ raise NotImplementedError( -'resume_target_job not implemented for this driver') +'resume_target_job not supported for this driver') def suspend_target_job(self, target, job): """ @@ -314,7 +320,7 @@ class EBSBackupDriver(BackupDriver): :rtype: ``bool`` """ raise NotImplementedError( -'suspend_target_job not implemented for this driver') +'suspend_target_job not supported for this driver') def cancel_target_job(self, target, job): """ @@ -329,7 +335,7 @@ class EBSBackupDriver(BackupDriver): :rtype: ``bool`` """ raise NotImplementedError( -'cancel_target_job not implemented for this driver') +'cancel_target_job not supported for this driver') def _to_recovery_points(self, data, target): xpath = 'DescribeSnapshotsResponse/snapshotSet/item' @@ -338,15 +344,17 @@ class EBSBackupDriver(BackupDriver): def _to_recovery_point(self, el, target): id = findtext(element=el, xpath='snapshotId', namespace=NS) -date = datetime.strptime( -findtext(element=el, xpath='startTime', namespace=NS), -'-MM-DDTHH:MM:SS.SSSZ') +date = parse_date( +findtext(element=el, xpath='startTime', namespace=NS)) +tags = self._get_resource_tags(el) point = BackupTargetRecoveryPoint( id=id, date=date, target=target, driver=self.connection.driver, extra={ +'snapshot-id': id, +'tags': tags }, ) return point @@ -384,3 +392,30 @@ class EBSBackupDriver(BackupDriver): "volume-id": volume_id }
[07/26] libcloud git commit: Added get_target_job for tracking the progress of an individual job. Added some example code (for a fictional driver)
Added get_target_job for tracking the progress of an individual job. Added some example code (for a fictional driver) Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/c086d347 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/c086d347 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/c086d347 Branch: refs/heads/trunk Commit: c086d347c9d44df684f3b4b020188bc86a251e73 Parents: b3398da Author: Anthony ShawAuthored: Mon Nov 9 14:57:15 2015 +1100 Committer: Anthony Shaw Committed: Mon Nov 9 14:57:15 2015 +1100 -- docs/backup/examples.rst| 11 ++ docs/backup/index.rst | 2 +- docs/examples/backup/create_backup_from_node.py | 37 libcloud/backup/base.py | 16 + 4 files changed, 65 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/c086d347/docs/backup/examples.rst -- diff --git a/docs/backup/examples.rst b/docs/backup/examples.rst index 78f27e4..2e71462 100644 --- a/docs/backup/examples.rst +++ b/docs/backup/examples.rst @@ -3,3 +3,14 @@ Backup Examples +Getting a node from a compute driver and enabling backup +- + +This example shows how to get a node using a remote Azure datacenter, enable backup +and backup the node. + +.. note:: +This example works with Libcloud version 0.20.0 and above. + +.. literalinclude:: /examples/backup/create_backup_from_node.py + :language: python http://git-wip-us.apache.org/repos/asf/libcloud/blob/c086d347/docs/backup/index.rst -- diff --git a/docs/backup/index.rst b/docs/backup/index.rst index 2479746..7d1b9f7 100644 --- a/docs/backup/index.rst +++ b/docs/backup/index.rst @@ -1,4 +1,4 @@ -DNS +Backup === .. note:: http://git-wip-us.apache.org/repos/asf/libcloud/blob/c086d347/docs/examples/backup/create_backup_from_node.py -- diff --git a/docs/examples/backup/create_backup_from_node.py b/docs/examples/backup/create_backup_from_node.py new file mode 100644 index 000..ec7c2d6 --- /dev/null +++ b/docs/examples/backup/create_backup_from_node.py @@ -0,0 +1,37 @@ +import time +from pprint import pprint + +from libcloud.backup.types import Provider, BackupTargetJobStatusType +from libcloud.backup.providers import get_driver as get_backup_driver + +from libcloud.compute.providers import get_driver as get_compute_driver + +backup_driver = get_backup_driver(Provider.AZURE)('username', 'api key') +compute_driver = get_compute_driver(Provider.AZURE)('username', 'api key') + +nodes = compute_driver.list_nodes() + +# Backup the first node in the pool +selected_node = nodes[0] + +print('Enabling backup for node') +new_target = backup_driver.create_target_from_node(selected_node) + +print('Starting backup of node') +job = backup_driver.create_target_job(new_target) + +print('Waiting for job to complete') +while True: +if job.status != BackupTargetJobStatusType.RUNNING: +break +else: +job = backup_driver.get_target_job(job.id) + +print('Job is now at %s percent complete' % job.progress) +time.sleep(20) + +print('Job is completed with status- %s' % job.status) + +print('Getting a list of recovery points') +recovery_points = backup_driver.list_recovery_points(new_target) +pprint(recovery_points) http://git-wip-us.apache.org/repos/asf/libcloud/blob/c086d347/libcloud/backup/base.py -- diff --git a/libcloud/backup/base.py b/libcloud/backup/base.py index 6bca933..26ea2d8 100644 --- a/libcloud/backup/base.py +++ b/libcloud/backup/base.py @@ -400,6 +400,22 @@ class BackupDriver(BaseDriver): raise NotImplementedError( 'delete_target not implemented for this driver') +def get_target_job(self, target, id): +""" +Get a specific backup job by ID + +:param target: Backup target with the backup data +:type target: Instance of :class:`BackupTarget` + +:param id: Backup target with the backup data +:type id: Instance of :class:`BackupTarget` + +:rtype: :class:`BackupTargetJob` +""" +jobs = self.list_target_jobs(target) +return list(filter(lambda x: x.id == id, jobs))[0] + + def list_target_jobs(self, target): """ List the backup jobs on a target
[25/26] libcloud git commit: Merge branch 'LIBCLOUD-769_Backup_Driver' into trunk
Merge branch 'LIBCLOUD-769_Backup_Driver' into trunk Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/cb9b89c9 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/cb9b89c9 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/cb9b89c9 Branch: refs/heads/trunk Commit: cb9b89c9f94f4f69ca9091757c22a72a089b29aa Parents: 329bbc4 31b162b Author: anthony-shawAuthored: Tue Jan 5 21:13:42 2016 +1100 Committer: anthony-shaw Committed: Tue Jan 5 21:13:42 2016 +1100 -- .../generate_provider_feature_matrix_table.py | 33 +- docs/backup/_supported_methods.rst | 13 + docs/backup/_supported_providers.rst| 13 + docs/backup/api.rst | 22 + docs/backup/drivers/dimensiondata.rst | 66 +++ docs/backup/drivers/index.rst | 12 + docs/backup/examples.rst| 16 + docs/backup/index.rst | 36 ++ docs/backup/supported_providers.rst | 14 + docs/examples/backup/create_backup_from_node.py | 41 ++ docs/index.rst | 3 + docs/supported_providers.rst| 13 + libcloud/backup/__init__.py | 0 libcloud/backup/base.py | 489 +++ libcloud/backup/drivers/__init__.py | 0 libcloud/backup/drivers/dimensiondata.py| 487 ++ libcloud/backup/drivers/dummy.py| 41 ++ libcloud/backup/drivers/ebs.py | 422 libcloud/backup/drivers/gce.py | 478 ++ libcloud/backup/providers.py| 37 ++ libcloud/backup/types.py| 63 +++ libcloud/test/backup/__init__.py| 36 ++ ...745_4d8a_9cbc_8dabe5a7d0e4_server_server.xml | 49 ++ ...ead52_692f_4314_8725_c8a4f4d13a87_backup.xml | 18 + ...8a4f4d13a87_backup_client_schedulePolicy.xml | 5 + ...c8a4f4d13a87_backup_client_storagePolicy.xml | 6 + ...314_8725_c8a4f4d13a87_backup_client_type.xml | 6 + ...92f_4314_8725_c8a4f4d13a87_backup_modify.xml | 7 + .../dimensiondata/oec_0_9_myaccount.xml | 26 + libcloud/test/backup/test_base.py | 29 ++ libcloud/test/backup/test_dimensiondata.py | 159 ++ libcloud/test/file_fixtures.py | 12 +- setup.py| 5 +- 33 files changed, 2652 insertions(+), 5 deletions(-) --
[15/26] libcloud git commit: updated provider tables and fix pylinting error
updated provider tables and fix pylinting error Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/c1815c74 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/c1815c74 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/c1815c74 Branch: refs/heads/trunk Commit: c1815c74baa776ee5e5089b8b1a78be793185f32 Parents: e9ebc5f Author: Anthony ShawAuthored: Tue Nov 10 15:00:33 2015 +1100 Committer: Anthony Shaw Committed: Tue Nov 10 15:00:33 2015 +1100 -- docs/backup/_supported_methods.rst | 13 - docs/backup/_supported_providers.rst | 13 - libcloud/backup/drivers/gce.py | 1 + 3 files changed, 17 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/c1815c74/docs/backup/_supported_methods.rst -- diff --git a/docs/backup/_supported_methods.rst b/docs/backup/_supported_methods.rst index 2d02d03..66a2fa4 100644 --- a/docs/backup/_supported_methods.rst +++ b/docs/backup/_supported_methods.rst @@ -1,8 +1,11 @@ .. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it - == = === = = == === = = == = -Provider get supported target types list targets create target create target from node create target from container update target delete target list recovery points recover target recover target out of place list target jobs create target job resume target job suspend target job cancel target job - == = === = = == === = = == = - - == = === = = == === = = == = +== == = === = = == === = = == = +Provider get supported target types list targets create target create target from node create target from container update target delete target list recovery points recover target recover target out of place list target jobs create target job resume target job suspend target job cancel target job +== == = === = = == === = = == = +`Amazon EBS Backup Driver`_yesyes yes yes yes yes yes yes yesyes yes yes yes yesyes +`Google Compute Engine Backup Driver`_ yesyes yes yes yes yes yes yes yesyes yes yes yes yesyes +== == = === = = == === = = == = +.. _`Amazon EBS Backup Driver`: http://aws.amazon.com/ebs/ +.. _`Google Compute Engine Backup Driver`: http://cloud.google.com/ http://git-wip-us.apache.org/repos/asf/libcloud/blob/c1815c74/docs/backup/_supported_providers.rst -- diff --git
[16/26] libcloud git commit: Merge branch 'trunk' into LIBCLOUD-769_Backup_Driver
Merge branch 'trunk' into LIBCLOUD-769_Backup_Driver Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/09a258f8 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/09a258f8 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/09a258f8 Branch: refs/heads/trunk Commit: 09a258f85637a02cba97e3ff081821900ccdd3d6 Parents: c1815c7 4087f45 Author: anthony-shawAuthored: Fri Dec 11 15:03:27 2015 +1100 Committer: anthony-shaw Committed: Fri Dec 11 15:03:27 2015 +1100 -- CHANGES.rst | 100 +- contrib/scrape-ec2-prices.py| 29 +- contrib/update_google_prices.py | 87 ++ contrib/utils.py| 48 + contrib/utils_test.py | 65 + demos/gce_demo.py |2 +- demos/secrets.py-dist |1 - docs/_static/images/provider_logos/godaddy.png | Bin 0 -> 86453 bytes .../_supported_methods_block_storage.rst|2 - .../_supported_methods_image_management.rst |2 - .../_supported_methods_key_pair_management.rst |2 - docs/compute/_supported_methods_main.rst|2 - docs/compute/_supported_providers.rst |2 - docs/developer_information.rst |3 + docs/development.rst|2 +- docs/dns/_supported_methods.rst |2 + docs/dns/_supported_providers.rst |2 + docs/dns/drivers/godaddy.rst| 116 ++ docs/examples/dns/create_record_custom_ttl.py |4 +- docs/examples/dns/godaddy/adding_records.py | 10 + docs/examples/dns/godaddy/instantiate_driver.py |5 + docs/examples/dns/godaddy/listing_records.py| 12 + docs/examples/dns/godaddy/listing_zones.py | 10 + docs/examples/dns/godaddy/pricing_domain.py | 11 + docs/examples/dns/godaddy/purchasing_domain.py | 16 + docs/examples/dns/godaddy/updating_records.py | 15 + .../examples/http_proxy/constructor_argument.py |7 - docs/upgrade_notes.rst | 15 +- libcloud/__init__.py|2 +- libcloud/common/base.py |4 +- libcloud/common/dimensiondata.py| 310 +++- libcloud/common/google.py | 260 ++-- libcloud/common/openstack.py| 12 + libcloud/common/openstack_identity.py |2 + libcloud/compute/base.py|6 - libcloud/compute/drivers/cloudstack.py | 25 +- libcloud/compute/drivers/dimensiondata.py | 789 +-- libcloud/compute/drivers/dreamhost.py | 242 libcloud/compute/drivers/ec2.py | 788 +-- libcloud/compute/drivers/gce.py | 27 +- libcloud/compute/drivers/openstack.py |2 + libcloud/compute/drivers/profitbricks.py| 25 +- libcloud/compute/drivers/rackspace.py | 42 +- libcloud/compute/providers.py |2 - libcloud/compute/types.py |3 - libcloud/data/pricing.json | 959 - libcloud/dns/base.py| 18 +- libcloud/dns/drivers/auroradns.py |2 +- libcloud/dns/drivers/cloudflare.py | 429 ++ libcloud/dns/drivers/dnsimple.py|3 +- libcloud/dns/drivers/dummy.py |4 +- libcloud/dns/drivers/durabledns.py |2 +- libcloud/dns/drivers/gandi.py |1 + libcloud/dns/drivers/godaddy.py | 503 +++ libcloud/dns/drivers/google.py |3 +- libcloud/dns/drivers/hostvirtual.py |7 +- libcloud/dns/drivers/linode.py |5 +- libcloud/dns/drivers/pointdns.py|3 +- libcloud/dns/drivers/rackspace.py | 229 ++- libcloud/dns/drivers/route53.py |9 +- libcloud/dns/drivers/softlayer.py |1 + libcloud/dns/drivers/vultr.py |1 - libcloud/dns/drivers/worldwidedns.py|5 +- libcloud/dns/drivers/zerigo.py |2 +- libcloud/dns/drivers/zonomi.py |4 +- libcloud/dns/providers.py | 11 +- libcloud/dns/types.py |2 + libcloud/loadbalancer/drivers/dimensiondata.py | 184 ++- libcloud/loadbalancer/drivers/rackspace.py |3 + libcloud/storage/base.py|6 - libcloud/storage/drivers/google_storage.py | 181 +-- libcloud/storage/drivers/s3.py | 88 +- libcloud/test/common/test_google.py
[GitHub] libcloud pull request: LIBCLOUD-769 backup driver
Github user asfgit closed the pull request at: https://github.com/apache/libcloud/pull/629 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[22/26] libcloud git commit: Fix Sphinx warnings, updated provider tables
Fix Sphinx warnings, updated provider tables Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/d1c34c6e Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/d1c34c6e Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/d1c34c6e Branch: refs/heads/trunk Commit: d1c34c6e9f3f02a6b81f9f60e5d64549dcc2908e Parents: 221edba Author: anthony-shawAuthored: Sat Jan 2 07:42:18 2016 +1100 Committer: anthony-shaw Committed: Sat Jan 2 07:42:18 2016 +1100 -- docs/backup/_supported_methods.rst | 14 -- docs/backup/_supported_providers.rst| 14 -- docs/backup/api.rst | 2 +- docs/dns/_supported_methods.rst | 2 ++ docs/dns/_supported_providers.rst | 2 ++ docs/examples/backup/create_backup_from_node.py | 6 -- 6 files changed, 25 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/d1c34c6e/docs/backup/_supported_methods.rst -- diff --git a/docs/backup/_supported_methods.rst b/docs/backup/_supported_methods.rst index 66a2fa4..a4c7f64 100644 --- a/docs/backup/_supported_methods.rst +++ b/docs/backup/_supported_methods.rst @@ -1,11 +1,13 @@ .. NOTE: This file has been generated automatically using generate_provider_feature_matrix_table.py script, don't manually edit it -== == = === = = == === = = == = -Provider get supported target types list targets create target create target from node create target from container update target delete target list recovery points recover target recover target out of place list target jobs create target job resume target job suspend target job cancel target job -== == = === = = == === = = == = -`Amazon EBS Backup Driver`_yesyes yes yes yes yes yes yes yesyes yes yes yes yesyes -`Google Compute Engine Backup Driver`_ yesyes yes yes yes yes yes yes yesyes yes yes yes yesyes -== == = === = = == === = = == = +== == = === = = == === = = == = +Provider get supported target types list targets create target create target from node create target from storage container update target delete target list recovery points recover target recover target out of place list target jobs create target job resume target job suspend target job cancel target job +== == = === = = == === = = == = +`Dimension Data Backup`_ yesyes yes yes no yes yes yes yesyes yes yes yes
[1/2] libcloud git commit: fix contribution Closes #671
Repository: libcloud Updated Branches: refs/heads/trunk f742c9091 -> 329bbc499 fix contribution Closes #671 Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/31f39a47 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/31f39a47 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/31f39a47 Branch: refs/heads/trunk Commit: 31f39a47a868502afb4a91ca33bedbb96ca04ec6 Parents: 7ce64e9 Author: Bernard PaquesAuthored: Sun Dec 27 21:49:09 2015 +0100 Committer: anthony-shaw Committed: Tue Jan 5 19:53:53 2016 +1100 -- libcloud/compute/drivers/dimensiondata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/31f39a47/libcloud/compute/drivers/dimensiondata.py -- diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py index 6e812b8..3a9bd02 100644 --- a/libcloud/compute/drivers/dimensiondata.py +++ b/libcloud/compute/drivers/dimensiondata.py @@ -1695,7 +1695,7 @@ class DimensionDataNodeDriver(NodeDriver): if has_network_info else \ element.find(fixxpath('nic', TYPES_URN)).get('privateIpv4') -node.extra['ipv6'] = element.find( +extra['ipv6'] = element.find( fixxpath('networkInfo/primaryNic', TYPES_URN)) \ .get('ipv6') \ if has_network_info else \
[2/2] libcloud git commit: Merge branch 'trunk' of https://git-wip-us.apache.org/repos/asf/libcloud into trunk
Merge branch 'trunk' of https://git-wip-us.apache.org/repos/asf/libcloud into trunk Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/329bbc49 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/329bbc49 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/329bbc49 Branch: refs/heads/trunk Commit: 329bbc499d015c77a85c73f0f0b3f40fe18e69ca Parents: 31f39a4 f742c90 Author: anthony-shawAuthored: Tue Jan 5 19:54:23 2016 +1100 Committer: anthony-shaw Committed: Tue Jan 5 19:54:23 2016 +1100 -- --
[GitHub] libcloud pull request: Updated optional fields for dimension data ...
GitHub user tonybaloney opened a pull request: https://github.com/apache/libcloud/pull/671 Updated optional fields for dimension data load balancer driver You can merge this pull request into a Git repository by running: $ git pull https://github.com/DimensionDataCBUSydney/libcloud trunk Alternatively you can review and apply these changes as the patch at: https://github.com/apache/libcloud/pull/671.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #671 commit 71063f679cb438242d5bcc8db75b0cfb2ace4c4d Author: Ming ShengDate: 2015-12-30T13:13:51Z Allow ex_list_firewall_rules to accept network domain id and pageSize, pageNumber as params commit 4a0ff854629ef843c11c2758fbbf139b33c89ed0 Author: Ming Sheng Date: 2015-12-30T13:28:54Z Added line break commit 5a0f8c95e253025229f2ed1e8e80ea4c4f142d60 Author: Ming Sheng Date: 2015-12-31T11:50:23Z Modify representation for some objects commit c18afd79fa3f4a5664b0332f53e851f5ef7ec4ba Author: Anthony Shaw Date: 2016-01-01T20:33:43Z Merge pull request #7 from DimensionData-AP-COE/trunk Allow list firewall to accept network domain id and pageSize pageNumber as params commit d93b655d0de93f48a867a2b5a42e410480de6b4a Author: Munkiat Date: 2016-01-03T10:25:33Z added port and listenerIpAddress options for ex_create_pool_member and ex_create_virtual_listener commit 24017e4cded6d4450921dff571b8d840584ce74e Author: Munkiat Date: 2016-01-04T07:53:13Z fixed line wrap for listenerIpAddress commit ae76290e771f6843a307244c30d1fd2fc5a85fcc Author: Anthony Shaw Date: 2016-01-05T08:38:47Z Merge pull request #8 from DimensionData-AP-COE/dimension_data_load_balancer_update added port and listenerIpAddress options --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---
[jira] [Commented] (LIBCLOUD-769) Backup driver type
[ https://issues.apache.org/jira/browse/LIBCLOUD-769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15082783#comment-15082783 ] ASF subversion and git services commented on LIBCLOUD-769: -- Commit cb9b89c9f94f4f69ca9091757c22a72a089b29aa in libcloud's branch refs/heads/trunk from anthony-shaw [ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=cb9b89c ] Merge branch 'LIBCLOUD-769_Backup_Driver' into trunk > Backup driver type > -- > > Key: LIBCLOUD-769 > URL: https://issues.apache.org/jira/browse/LIBCLOUD-769 > Project: Libcloud > Issue Type: New Feature >Reporter: Anthony Shaw > > Introduce a driver for 'cloud backup' for service providers that support a > standalone BaaS product or service. > Targeted specifically at backing up existing nodes. Design must support min 3 > drivers. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[17/26] libcloud git commit: Formed a backup driver example for the Dimension Data Cloud APIs
Formed a backup driver example for the Dimension Data Cloud APIs Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/ab2ce8f6 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/ab2ce8f6 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/ab2ce8f6 Branch: refs/heads/trunk Commit: ab2ce8f63db2ef861d9021da2d2b86c5192577c8 Parents: 09a258f Author: anthony-shawAuthored: Fri Dec 11 17:15:19 2015 +1100 Committer: anthony-shaw Committed: Fri Dec 11 17:15:19 2015 +1100 -- libcloud/backup/drivers/dimensiondata.py| 487 +++ libcloud/backup/providers.py| 2 + libcloud/backup/types.py| 1 + libcloud/test/backup/__init__.py| 37 ++ ...745_4d8a_9cbc_8dabe5a7d0e4_server_server.xml | 49 ++ ...ead52_692f_4314_8725_c8a4f4d13a87_backup.xml | 18 + ...8a4f4d13a87_backup_client_schedulePolicy.xml | 5 + ...c8a4f4d13a87_backup_client_storagePolicy.xml | 6 + ...314_8725_c8a4f4d13a87_backup_client_type.xml | 6 + ...92f_4314_8725_c8a4f4d13a87_backup_modify.xml | 7 + .../dimensiondata/oec_0_9_myaccount.xml | 26 + libcloud/test/backup/test_dimensiondata.py | 160 ++ libcloud/test/file_fixtures.py | 7 + 13 files changed, 811 insertions(+) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/ab2ce8f6/libcloud/backup/drivers/dimensiondata.py -- diff --git a/libcloud/backup/drivers/dimensiondata.py b/libcloud/backup/drivers/dimensiondata.py new file mode 100644 index 000..15e8251 --- /dev/null +++ b/libcloud/backup/drivers/dimensiondata.py @@ -0,0 +1,487 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +try: +from lxml import etree as ET +except ImportError: +from xml.etree import ElementTree as ET + +from libcloud.backup.base import BackupDriver, BackupTarget +from libcloud.backup.types import BackupTargetType +from libcloud.backup.types import Provider +from libcloud.common.dimensiondata import DimensionDataConnection +from libcloud.common.dimensiondata import API_ENDPOINTS +from libcloud.common.dimensiondata import DEFAULT_REGION +from libcloud.common.dimensiondata import TYPES_URN +from libcloud.common.dimensiondata import GENERAL_NS +from libcloud.utils.xml import fixxpath, findtext, findall + +BACKUP_NS = 'http://oec.api.opsource.net/schemas/backup' + + +class DimensionDataBackupClientType(object): +def __init__(self, type, is_file_system, description): +self.type = type +self.is_file_system = is_file_system +self.description = description + + +class DimensionDataBackupStoragePolicy(object): +def __init__(self, name, retention_period, secondary_location): +self.name = name +self.retention_period = retention_period +self.secondary_location = secondary_location + + +class DimensionDataBackupSchedulePolicy(object): +def __init__(self, name, description): +self.name = name +self.description = description + + +class DimensionDataBackupDriver(BackupDriver): +""" +DimensionData backup driver. +""" + +selected_region = None +connectionCls = DimensionDataConnection +name = 'Dimension Data Backup' +website = 'https://cloud.dimensiondata.com/' +type = Provider.DIMENSIONDATA +api_version = 1.0 + +network_domain_id = None + +def __init__(self, key, secret=None, secure=True, host=None, port=None, + api_version=None, region=DEFAULT_REGION, **kwargs): + +if region not in API_ENDPOINTS: +raise ValueError('Invalid region: %s' % (region)) + +self.selected_region = API_ENDPOINTS[region] + +super(DimensionDataBackupDriver, self).__init__( +key=key, secret=secret, +secure=secure, host=host, +port=port, +api_version=api_version, +region=region, +**kwargs) + +def
[14/26] libcloud git commit: Basic example of a GCE snapshot driver. POC
Basic example of a GCE snapshot driver. POC Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/e9ebc5fb Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/e9ebc5fb Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/e9ebc5fb Branch: refs/heads/trunk Commit: e9ebc5fb6e115c8aa96e157b013ac5fbc5a05afe Parents: b3ac5d3 Author: Anthony ShawAuthored: Tue Nov 10 14:53:35 2015 +1100 Committer: Anthony Shaw Committed: Tue Nov 10 14:53:35 2015 +1100 -- libcloud/backup/drivers/ebs.py | 3 +- libcloud/backup/drivers/gce.py | 477 libcloud/backup/providers.py | 4 + libcloud/backup/types.py | 2 + 4 files changed, 485 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/e9ebc5fb/libcloud/backup/drivers/ebs.py -- diff --git a/libcloud/backup/drivers/ebs.py b/libcloud/backup/drivers/ebs.py index ea8f80e..4aba536 100644 --- a/libcloud/backup/drivers/ebs.py +++ b/libcloud/backup/drivers/ebs.py @@ -290,7 +290,8 @@ class EBSBackupDriver(BackupDriver): } data = self.connection.request(ROOT, params=params).object xpath = 'CreateSnapshotResponse' -return self._to_job(findall(element=data, xpath=xpath, namespace=NS)[0]) +return self._to_job(findall(element=data, +xpath=xpath, namespace=NS)[0]) def resume_target_job(self, target, job): """ http://git-wip-us.apache.org/repos/asf/libcloud/blob/e9ebc5fb/libcloud/backup/drivers/gce.py -- diff --git a/libcloud/backup/drivers/gce.py b/libcloud/backup/drivers/gce.py new file mode 100644 index 000..696b2fa --- /dev/null +++ b/libcloud/backup/drivers/gce.py @@ -0,0 +1,477 @@ + + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +__all__ = [ +'GCEBackupDriver' +] + +from libcloud.utils.iso8601 import parse_date +from libcloud.backup.base import BackupDriver, BackupTargetRecoveryPoint,\ +BackupTargetJob, BackupTarget +from libcloud.backup.types import BackupTargetType, BackupTargetJobStatusType + +from libcloud.common.google import GoogleResponse, GoogleBaseConnection + +API_VERSION = 'v1' +DEFAULT_TASK_COMPLETION_TIMEOUT = 180 + +class GCEResponse(GoogleResponse): +pass + + +class GCEConnection(GoogleBaseConnection): +""" +Connection class for the GCE driver. + +GCEConnection extends :class:`google.GoogleBaseConnection` for 2 reasons: + 1. modify request_path for GCE URI. + 2. Implement gce_params functionality described below. + +If the parameter gce_params is set to a dict prior to calling request(), +the URL parameters will be updated to include those key/values FOR A +SINGLE REQUEST. If the response contains a nextPageToken, +gce_params['pageToken'] will be set to its value. This can be used to +implement paging in list: + +>>> params, more_results = {'maxResults': 2}, True +>>> while more_results: +... driver.connection.gce_params=params +... driver.ex_list_urlmaps() +... more_results = 'pageToken' in params +... +[, ] +[] +""" +host = 'www.googleapis.com' +responseCls = GCEResponse + +def __init__(self, user_id, key, secure, auth_type=None, + credential_file=None, project=None, **kwargs): +super(GCEConnection, self).__init__(user_id, key, secure=secure, +auth_type=auth_type, +credential_file=credential_file, +**kwargs) +self.request_path = '/compute/%s/projects/%s' % (API_VERSION, + project) +self.gce_params = None + +def pre_connect_hook(self, params, headers): +""" +Update URL parameters with values
[06/26] libcloud git commit: Fix docstrings order. Add backup index to docs
Fix docstrings order. Add backup index to docs Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/b3398da1 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/b3398da1 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/b3398da1 Branch: refs/heads/trunk Commit: b3398da1dceb46edb3def4495b0ede2848106e25 Parents: c6f95d6 Author: Anthony ShawAuthored: Mon Nov 9 14:34:50 2015 +1100 Committer: Anthony Shaw Committed: Mon Nov 9 14:34:50 2015 +1100 -- docs/index.rst | 3 +++ libcloud/backup/types.py | 16 2 files changed, 11 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/b3398da1/docs/index.rst -- diff --git a/docs/index.rst b/docs/index.rst index 2f75dd6..929151c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -13,6 +13,8 @@ Resource you can manage with Libcloud are divided in the following categories: Rackspace CloudFiles * :doc:`Load Balancers as a Service ` - services such as Amazon Elastic Load Balancer and GoGrid LoadBalancers * :doc:`DNS as a Service ` - services such as Amazon Route 53 and Zerigo +* :doc:`Backup as a Service ` - services such as Amazon EBS and OpenStack Freezer + .. figure:: /_static/images/supported_providers.png :align: center @@ -36,6 +38,7 @@ Main storage/index loadbalancer/index dns/index +backup/index troubleshooting api_docs faq http://git-wip-us.apache.org/repos/asf/libcloud/blob/b3398da1/libcloud/backup/types.py -- diff --git a/libcloud/backup/types.py b/libcloud/backup/types.py index 5830de2..0c721ca 100644 --- a/libcloud/backup/types.py +++ b/libcloud/backup/types.py @@ -28,21 +28,21 @@ class BackupTargetType(object): """ Backup Target type. """ - -""" Denotes a virtual host """ + VIRTUAL = 'Virtual' - -""" Denotes a physical host """ +""" Denotes a virtual host """ + PHYSICAL = 'Physical' - -""" Denotes a file system (e.g. NAS) """ +""" Denotes a physical host """ + FILESYSTEM = 'Filesystem' +""" Denotes a file system (e.g. NAS) """ -""" Denotes a database target """ DATABASE = 'Database' +""" Denotes a database target """ -""" Denotes an object based file system """ OBJECT = 'Object' +""" Denotes an object based file system """ class BackupTargetJobStatusType(object):
[11/26] libcloud git commit: Prototype of an EBS driver for backup and doing snapshots
Prototype of an EBS driver for backup and doing snapshots Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/de6452ad Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/de6452ad Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/de6452ad Branch: refs/heads/trunk Commit: de6452ad8ef520094c69e495e7e6ae07d7d686b2 Parents: 039d524 Author: Anthony ShawAuthored: Tue Nov 10 12:19:08 2015 +1100 Committer: Anthony Shaw Committed: Tue Nov 10 12:19:08 2015 +1100 -- docs/backup/examples.rst | 2 +- libcloud/backup/base.py| 8 +- libcloud/backup/drivers/ebs.py | 386 libcloud/backup/types.py | 2 + 4 files changed, 393 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/de6452ad/docs/backup/examples.rst -- diff --git a/docs/backup/examples.rst b/docs/backup/examples.rst index 2e71462..3bc5a9b 100644 --- a/docs/backup/examples.rst +++ b/docs/backup/examples.rst @@ -1,7 +1,7 @@ :orphan: Backup Examples - +=== Getting a node from a compute driver and enabling backup - http://git-wip-us.apache.org/repos/asf/libcloud/blob/de6452ad/libcloud/backup/base.py -- diff --git a/libcloud/backup/base.py b/libcloud/backup/base.py index b36dd6a..f57f5d8 100644 --- a/libcloud/backup/base.py +++ b/libcloud/backup/base.py @@ -355,10 +355,10 @@ class BackupDriver(BaseDriver): :param end_date: The end date to show jobs between (optional) :type end_date: :class:`datetime.datetime`` -:rtype: ``list`` of :class:`BackupTargetJob` +:rtype: ``list`` of :class:`BackupTargetRecoveryPoint` """ raise NotImplementedError( -'delete_target not implemented for this driver') +'list_recovery_points not implemented for this driver') def recover_target(self, target, recovery_point, path=None): """ @@ -376,7 +376,7 @@ class BackupDriver(BaseDriver): :rtype: Instance of :class:`BackupTargetJob` """ raise NotImplementedError( -'delete_target not implemented for this driver') +'recover_target not implemented for this driver') def recover_target_out_of_place(self, target, recovery_point, recovery_target, path=None): @@ -398,7 +398,7 @@ class BackupDriver(BaseDriver): :rtype: Instance of :class:`BackupTargetJob` """ raise NotImplementedError( -'delete_target not implemented for this driver') +'recover_target_out_of_place not implemented for this driver') def get_target_job(self, target, id): """ http://git-wip-us.apache.org/repos/asf/libcloud/blob/de6452ad/libcloud/backup/drivers/ebs.py -- diff --git a/libcloud/backup/drivers/ebs.py b/libcloud/backup/drivers/ebs.py new file mode 100644 index 000..dbd2d4c --- /dev/null +++ b/libcloud/backup/drivers/ebs.py @@ -0,0 +1,386 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +__all__ = [ +'EBSBackupDriver' +] + +from datetime import datetime + +from libcloud.utils.xml import findtext, findall + +from libcloud.backup.base import BackupDriver, BackupTargetRecoveryPoint,\ +BackupTargetJob, BackupTarget +from libcloud.backup.types import BackupTargetType, BackupTargetJobStatusType +from libcloud.common.aws import AWSGenericResponse, SignedAWSConnection + + +VERSION = '2015-10-01' +HOST = 'ec2.amazonaws.com' +ROOT = '/%s/' % (VERSION) +NS = 'http://ec2.amazonaws.com/doc/%s/' % (VERSION, ) + + +class EBSResponse(AWSGenericResponse): +""" +Amazon EBS response class. +""" +namespace = NS +exceptions = {} +xpath = 'Error' + + +class
[19/26] libcloud git commit: Further Styling updates
Further Styling updates Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/98899b1a Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/98899b1a Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/98899b1a Branch: refs/heads/trunk Commit: 98899b1aae76ce8021ce68cf0b0ee038120f7060 Parents: aa02b63 Author: anthony-shawAuthored: Tue Dec 22 17:57:32 2015 +1100 Committer: anthony-shaw Committed: Tue Dec 22 17:57:32 2015 +1100 -- libcloud/test/backup/test_dimensiondata.py | 9 ++--- libcloud/test/file_fixtures.py | 7 --- 2 files changed, 10 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/98899b1a/libcloud/test/backup/test_dimensiondata.py -- diff --git a/libcloud/test/backup/test_dimensiondata.py b/libcloud/test/backup/test_dimensiondata.py index 34c3af2..0c81a7f 100644 --- a/libcloud/test/backup/test_dimensiondata.py +++ b/libcloud/test/backup/test_dimensiondata.py @@ -136,17 +136,20 @@ class DimensionDataMockHttp(MockHttp): 'oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_client_storagePolicy.xml') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) -def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_client_schedulePolicy(self, method, url, body, headers): +def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_client_schedulePolicy( +self, method, url, body, headers): body = self.fixtures.load( 'oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_client_schedulePolicy.xml') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) -def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup(self, method, url, body, headers): +def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup( +self, method, url, body, headers): body = self.fixtures.load( 'oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup.xml') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) -def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_modify(self, method, url, body, headers): +def _oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_modify( +self, method, url, body, headers): body = self.fixtures.load( 'oec_0_9_8a8f6abc_2745_4d8a_9cbc_8dabe5a7d0e4_server_e75ead52_692f_4314_8725_c8a4f4d13a87_backup_modify.xml') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) http://git-wip-us.apache.org/repos/asf/libcloud/blob/98899b1a/libcloud/test/file_fixtures.py -- diff --git a/libcloud/test/file_fixtures.py b/libcloud/test/file_fixtures.py index 5cb6509..60d4358 100644 --- a/libcloud/test/file_fixtures.py +++ b/libcloud/test/file_fixtures.py @@ -67,8 +67,9 @@ class StorageFileFixtures(FileFixtures): class LoadBalancerFileFixtures(FileFixtures): def __init__(self, sub_dir=''): -super(LoadBalancerFileFixtures, self).__init__(fixtures_type='loadbalancer', - sub_dir=sub_dir) +super(LoadBalancerFileFixtures, self).__init__( +fixtures_type='loadbalancer', +sub_dir=sub_dir) class DNSFileFixtures(FileFixtures): @@ -86,4 +87,4 @@ class OpenStackFixtures(FileFixtures): class BackupFileFixtures(FileFixtures): def __init__(self, sub_dir=''): super(BackupFileFixtures, self).__init__(fixtures_type='backup', - sub_dir=sub_dir) + sub_dir=sub_dir)
[24/26] libcloud git commit: Add docs for the dimensiondata driver
Add docs for the dimensiondata driver Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/31b162be Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/31b162be Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/31b162be Branch: refs/heads/trunk Commit: 31b162be81b0e64ad4318b8ca12a8df87942667f Parents: 66ed95c Author: anthony-shawAuthored: Sun Jan 3 14:23:21 2016 +1100 Committer: anthony-shaw Committed: Sun Jan 3 14:23:21 2016 +1100 -- docs/backup/drivers/dimensiondata.rst | 66 ++ 1 file changed, 66 insertions(+) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/31b162be/docs/backup/drivers/dimensiondata.rst -- diff --git a/docs/backup/drivers/dimensiondata.rst b/docs/backup/drivers/dimensiondata.rst new file mode 100644 index 000..a13231e --- /dev/null +++ b/docs/backup/drivers/dimensiondata.rst @@ -0,0 +1,66 @@ +Dimension Data Cloud Backup Driver Documentation + + +Dimension Data are a global IT Services company and form part of the NTT Group. +Dimension Data provide IT-as-a-Service to customers around the globe on their +cloud platform (Compute as a Service). The CaaS service is available either on +one of the public cloud instances or as a private instance on premises. + +.. figure:: /_static/images/provider_logos/dimensiondata.png +:align: center +:width: 300 +:target: http://cloud.dimensiondata.com/ + +Backup-as-a-Service includes Cloud Backup, Cloud Backup +has its own non-standard `API`_ , `libcloud` provides a Python +wrapper on top of this `API`_ with common methods with other IaaS solutions and +Public cloud providers. Therefore, you can use use the Dimension Data libcloud +driver to communicate with both the public and private clouds. + +Instantiating a driver +-- + +When you instantiate a driver you need to pass the following arguments to the +driver constructor: + +* ``user_id`` - Your Dimension Data Cloud username +* ``key`` - Your Dimension Data Cloud password +* ``region`` - The region key, one of the possible region keys + +Possible regions: + +* ``dd-na`` : Dimension Data North America (USA) +* ``dd-eu`` : Dimension Data Europe +* ``dd-af`` : Dimension Data Africa +* ``dd-au`` : Dimension Data Australia +* ``dd-latam`` : Dimension Data Latin America +* ``dd-ap`` : Dimension Data Asia Pacific +* ``dd-canada`` : Dimension Data Canada region + +The base `libcloud` API allows you to: + +* enable backups, add backup clients and configure backup clients + +Non-standard functionality and extension methods + + +The Dimension Data driver exposes some `libcloud` non-standard +functionalities through extension methods and arguments. + +These functionalities include: + +* set retention periods +* configure secondary copes + +For information on how to use these functionalities please see the method +docstrings below. You can also use an interactive shell for exploration as +shown in the examples. + +API Docs + + +.. autoclass:: libcloud.backup.drivers.dimensiondata.DimensionDataBackupDriver +:members: +:inherited-members: + +.. _`API`: http://cloud.dimensiondata.com/au/en/services/public-cloud/api
[jira] [Created] (LIBCLOUD-790) Support HTTP(S) Load Balancers on GCE
Soren Hansen created LIBCLOUD-790: - Summary: Support HTTP(S) Load Balancers on GCE Key: LIBCLOUD-790 URL: https://issues.apache.org/jira/browse/LIBCLOUD-790 Project: Libcloud Issue Type: Improvement Components: LoadBalancer Reporter: Soren Hansen GCE has excellent support for http load balancers, but it's not supported by libcloud. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[2/2] libcloud git commit: updating changes.rst file
updating changes.rst file Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/9a7556f4 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/9a7556f4 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/9a7556f4 Branch: refs/heads/trunk Commit: 9a7556f469e45baf8d404ace99927c5cddf7e829 Parents: 81a8dbc Author: Eric JohnsonAuthored: Tue Jan 5 22:36:51 2016 + Committer: Eric Johnson Committed: Tue Jan 5 22:36:51 2016 + -- CHANGES.rst | 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/9a7556f4/CHANGES.rst -- diff --git a/CHANGES.rst b/CHANGES.rst index efa3f5c..3270266 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -14,6 +14,10 @@ General Compute ~~~ +- Add LazyObject class that provides lazy-loading, see `GCELicense` for usage + (LIBCLOUD-786, GITHUB-665) + [Scott Crunkleton] + - Added t2.nano instance type to EC2 Compute driver (GITHUB-663) [Anthony Shaw]
[jira] [Commented] (LIBCLOUD-786) GCENodeDriver.ex_get_image needs some love, see description.
[ https://issues.apache.org/jira/browse/LIBCLOUD-786?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15083976#comment-15083976 ] ASF subversion and git services commented on LIBCLOUD-786: -- Commit 81a8dbc324f870444e980aee523fea48fc37cbcc in libcloud's branch refs/heads/trunk from [~crunk1] [ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=81a8dbc ] Implemented LazyObject class, which provides a .lazy class method. The lazy class method returns a Proxy object that subclasses the target object class. Upon accessing the proxy object in any way, the object is initialized. Modified Google Compute Engine License objects, GCELicense, to be such a lazy object. This addresses https://issues.apache.org/jira/browse/LIBCLOUD-786. Tests/Verification: tox -e lint python setup.py test Added test/common/test_base.py which has LazyObjectTest Signed-off-by: Eric Johnson> GCENodeDriver.ex_get_image needs some love, see description. > > > Key: LIBCLOUD-786 > URL: https://issues.apache.org/jira/browse/LIBCLOUD-786 > Project: Libcloud > Issue Type: Bug > Components: Compute >Reporter: Scott Crunkleton > > Firstly, the parameter 'ex_project_list' is a misnomer. It is being treated > as a single project, not list of projects. > Secondly, it's slow. When not providing a project parameter, ex_get_image > lists all images from all projects listed in GCENodeDriver.IMAGE_PROJECTS. > This is a separate API call for each project. After getting all the images, > any images that have licenses create another API call via ex_get_license. > Thirdly, if any of the license calls try to pull a license from an image > project that the user doesn't have access to, it raises a > ResourceNotFoundError. > My opinion: fix the ex_project_list param, and see about not populating the > image license data when fetching images. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[GitHub] libcloud pull request: auroradns: Add support for Health Checks
GitHub user wido opened a pull request: https://github.com/apache/libcloud/pull/672 auroradns: Add support for Health Checks AuroraDNS supports Health Checks and based on the state of these checks records will be served or not. This way a Round-Robin DNS balancing can be achieved pointing to only healthy servers/services. You can merge this pull request into a Git repository by running: $ git pull https://github.com/wido/libcloud auroradns-healthchecks Alternatively you can review and apply these changes as the patch at: https://github.com/apache/libcloud/pull/672.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #672 commit c4381fdb0622cc8b00e2ed8977d51388c2128f0c Author: Wido den HollanderDate: 2015-10-30T15:08:46Z auroradns: Add support for Health Checks AuroraDNS supports Health Checks and based on the state of these checks records will be served or not. This way a Round-Robin DNS balancing can be achieved pointing to only healthy servers/services. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---