[GitHub] libcloud pull request: Addressing https://issues.apache.org/jira/b...
Github user crunk1 closed the pull request at: https://github.com/apache/libcloud/pull/689 --- 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-800) GoogleStorageDriver marking everything as application/json MIME-type.
[ https://issues.apache.org/jira/browse/LIBCLOUD-800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15139446#comment-15139446 ] ASF GitHub Bot commented on LIBCLOUD-800: - Github user crunk1 closed the pull request at: https://github.com/apache/libcloud/pull/689 > GoogleStorageDriver marking everything as application/json MIME-type. > - > > Key: LIBCLOUD-800 > URL: https://issues.apache.org/jira/browse/LIBCLOUD-800 > Project: Libcloud > Issue Type: Bug > Components: Storage >Reporter: Scott Crunkleton >Priority: Minor > > This started when I changed the GoogleStorageConnection to inherit from > GoogleBaseConnection, which always uses application/json. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
libcloud git commit: Improvements to Google Auth for Storage and Compute and MIME bug fix
Repository: libcloud Updated Branches: refs/heads/trunk 17c2217b5 -> 022d01edd Improvements to Google Auth for Storage and Compute and MIME bug fix Signed-off-by: Eric JohnsonProject: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/022d01ed Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/022d01ed Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/022d01ed Branch: refs/heads/trunk Commit: 022d01edd63bb018dd3054bea3daaff23570f37f Parents: 17c2217 Author: Scott Crunkleton Authored: Mon Feb 1 16:03:44 2016 -0800 Committer: Eric Johnson Committed: Tue Feb 9 17:12:37 2016 + -- CHANGES.rst | 8 + libcloud/common/google.py| 183 +++--- libcloud/compute/drivers/gce.py | 3 +- libcloud/storage/drivers/google_storage.py | 39 +++-- libcloud/test/common/test_google.py | 135 +--- libcloud/test/storage/test_google_storage.py | 130 --- 6 files changed, 229 insertions(+), 269 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/022d01ed/CHANGES.rst -- diff --git a/CHANGES.rst b/CHANGES.rst index 369d810..0e99f0f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -29,6 +29,14 @@ Compute (GITHUB-691) [Jeff Dunham] +Storage +~~~ + +- Improvements to Google Auth for Storage and Compute and MIME bug fix + (LIBCLOUD-800, GITHUB-689) + [Scott Crunkleton] + + Changes with Apache Libcloud 1.0.0-pre1 --- http://git-wip-us.apache.org/repos/asf/libcloud/blob/022d01ed/libcloud/common/google.py -- diff --git a/libcloud/common/google.py b/libcloud/common/google.py index 07cf553..7378d8e 100644 --- a/libcloud/common/google.py +++ b/libcloud/common/google.py @@ -609,6 +609,94 @@ class GoogleAuthType(object): return user_id.endswith('.gserviceaccount.com') +class GoogleOAuth2Credential(object): +default_credential_file = '~/.google_libcloud_auth' + +def __init__(self, user_id, key, auth_type=None, credential_file=None, + scopes=None, **kwargs): +self.auth_type = auth_type or GoogleAuthType.guess_type(user_id) +if self.auth_type not in GoogleAuthType.ALL_TYPES: +raise GoogleAuthError('Invalid auth type: %s' % self.auth_type) +if not GoogleAuthType.is_oauth2(self.auth_type): +raise GoogleAuthError(('Auth type %s cannot be used with OAuth2' % + self.auth_type)) +self.user_id = user_id +self.key = key + +default_credential_file = '.'.join([self.default_credential_file, +user_id]) +self.credential_file = credential_file or default_credential_file +# Default scopes to read/write for compute, storage, and dns. +self.scopes = scopes or [ +'https://www.googleapis.com/auth/compute', +'https://www.googleapis.com/auth/devstorage.full_control', +'https://www.googleapis.com/auth/ndev.clouddns.readwrite', +] + +self.token = self._get_token_from_file() + +if self.auth_type == GoogleAuthType.GCE: +self.oauth2_conn = GoogleGCEServiceAcctAuthConnection( +self.user_id, self.scopes, **kwargs) +elif self.auth_type == GoogleAuthType.SA: +self.oauth2_conn = GoogleServiceAcctAuthConnection( +self.user_id, self.key, self.scopes, **kwargs) +elif self.auth_type == GoogleAuthType.IA: +self.oauth2_conn = GoogleInstalledAppAuthConnection( +self.user_id, self.key, self.scopes, **kwargs) +else: +raise GoogleAuthError('Invalid auth_type: %s' % + str(self.auth_type)) + +if self.token is None: +self.token = self.oauth2_conn.get_new_token() +self._write_token_to_file() + +@property +def access_token(self): +if self.token_expire_utc_datetime < _utcnow(): +self._refresh_token() +return self.token['access_token'] + +@property +def token_expire_utc_datetime(self): +return _from_utc_timestamp(self.token['expire_time']) + +def _refresh_token(self): +self.token = self.oauth2_conn.refresh_token(self.token) +self._write_token_to_file() + +def _get_token_from_file(self): +""" +Read credential file and return token information. +Mocked in libcloud.test.common.google.GoogleTestCase. + +:return: Token
[GitHub] libcloud pull request: ex_creation_time method for ec2 and digital...
GitHub user vdloo opened a pull request: https://github.com/apache/libcloud/pull/697 ex_creation_time method for ec2 and digitalocean ec2 nodes keep the created time string in 'launch_time' and digital ocean nodes keep it in 'created_at'. ex_get_creation_time is a method that takes a node as the argument returns the created time string You can merge this pull request into a Git repository by running: $ git pull https://github.com/vdloo/libcloud add-ex-method-for-creation-date Alternatively you can review and apply these changes as the patch at: https://github.com/apache/libcloud/pull/697.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 #697 commit 12da19f1a9153b557cfd191a02f385c5534fcfd4 Author: Rick van de LooDate: 2016-02-09T21:40:24Z ex_creation_time method for ec2 and digitalocean ec2 keeps the created time string in 'launch_time' and digital ocean keeps it in 'created_at' --- 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] [Resolved] (LIBCLOUD-800) GoogleStorageDriver marking everything as application/json MIME-type.
[ https://issues.apache.org/jira/browse/LIBCLOUD-800?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Scott Crunkleton resolved LIBCLOUD-800. --- Resolution: Fixed Fixed in https://github.com/apache/libcloud/pull/689 > GoogleStorageDriver marking everything as application/json MIME-type. > - > > Key: LIBCLOUD-800 > URL: https://issues.apache.org/jira/browse/LIBCLOUD-800 > Project: Libcloud > Issue Type: Bug > Components: Storage >Reporter: Scott Crunkleton >Priority: Minor > > This started when I changed the GoogleStorageConnection to inherit from > GoogleBaseConnection, which always uses application/json. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[GitHub] libcloud pull request: Backblaze Storage Driver : Include get_cont...
GitHub user jshridha opened a pull request: https://github.com/apache/libcloud/pull/696 Backblaze Storage Driver : Include get_container and get_object methods Include get_container and get_object methods in the BackblazeB2StorageDriver This is required for compatibility with libraries that reference these methods. You can merge this pull request into a Git repository by running: $ git pull https://github.com/jshridha/libcloud backblaze_b2 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/libcloud/pull/696.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 #696 commit d4512dcbc7e6782650d612068febbbc5907efb5e Author: Jay ShridharaniDate: 2016-02-09T19:46:45Z Include get_container and get_object methods --- 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. ---
[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/e14dbf2c Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/e14dbf2c Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/e14dbf2c Branch: refs/heads/trunk Commit: e14dbf2ce9d9dc7cce4b6fc9e54cbfa6fca0a194 Parents: e513687 022d01e Author: anthony-shawAuthored: Wed Feb 10 12:00:20 2016 +1100 Committer: anthony-shaw Committed: Wed Feb 10 12:00:20 2016 +1100 -- CHANGES.rst | 8 + libcloud/common/google.py| 183 +++--- libcloud/compute/drivers/gce.py | 3 +- libcloud/storage/drivers/google_storage.py | 39 +++-- libcloud/test/common/test_google.py | 135 +--- libcloud/test/storage/test_google_storage.py | 130 --- 6 files changed, 229 insertions(+), 269 deletions(-) --
[2/5] libcloud git commit: DimensionData: Backups adding more tests, moving classes to common
DimensionData: Backups adding more tests, moving classes to common Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/67f7e06f Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/67f7e06f Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/67f7e06f Branch: refs/heads/trunk Commit: 67f7e06fad55660be8d67c377f18167cce516803 Parents: bb8ab66 Author: Jeffrey DunhamAuthored: Tue Feb 9 18:05:34 2016 -0500 Committer: anthony-shaw Committed: Wed Feb 10 12:08:06 2016 +1100 -- libcloud/backup/drivers/dimensiondata.py| 118 --- libcloud/common/dimensiondata.py| 209 +++ ..._692f_4314_8725_c8a4f4d13a87_backup_INFO.xml | 27 ++- ...4_8725_c8a4f4d13a87_backup_INFO_DISABLED.xml | 7 + ...4_8725_c8a4f4d13a87_backup_INFO_NOCLIENT.xml | 2 + ...4314_8725_c8a4f4d13a87_backup_INFO_NOJOB.xml | 11 + libcloud/test/backup/test_dimensiondata.py | 75 ++- 7 files changed, 361 insertions(+), 88 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/67f7e06f/libcloud/backup/drivers/dimensiondata.py -- diff --git a/libcloud/backup/drivers/dimensiondata.py b/libcloud/backup/drivers/dimensiondata.py index 45fb1d7..41cc9f7 100644 --- a/libcloud/backup/drivers/dimensiondata.py +++ b/libcloud/backup/drivers/dimensiondata.py @@ -22,69 +22,18 @@ 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 DimensionDataBackupClientType +from libcloud.common.dimensiondata import DimensionDataBackupDetails +from libcloud.common.dimensiondata import DimensionDataBackupClient +from libcloud.common.dimensiondata import DimensionDataBackupClientAlert +from libcloud.common.dimensiondata import DimensionDataBackupClientRunningJob +from libcloud.common.dimensiondata import DimensionDataBackupStoragePolicy +from libcloud.common.dimensiondata import DimensionDataBackupSchedulePolicy +from libcloud.common.dimensiondata import API_ENDPOINTS, DEFAULT_REGION from libcloud.common.dimensiondata import TYPES_URN -from libcloud.common.dimensiondata import GENERAL_NS +from libcloud.common.dimensiondata import GENERAL_NS, BACKUP_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 DimensionDataBackupDetails(object): -def __init__(self, asset_id, service_plan, state, clients=[]): -self.asset_id = asset_id -self.service_plan = service_plan -self.state = state -self.clients = clients - - -class DimensionDataBackupClient(object): -def __init__(self, type, is_file_system, status, description, - schedule_pol, storage_pol, trigger=None, email=None, - last_backup_time=None, next_backup=None, download_url=None, - total_backup_size=None, running_job=None): -self.type = type -self.is_file_system = is_file_system -self.status = status -self.description = description -self.schedule_policy = schedule_pol -self.storage_policy = storage_pol -self.trigger = trigger -self.email = email -self.last_backup_time = last_backup_time -self.next_backup = next_backup -self.total_backup_size = total_backup_size -self.download_url = download_url -self.running_job = running_job - - -class DimensionDataBackupRunningJob(object): -def __init__(self, id, status, percentage=0): -self.id = id -self.percentage = percentage -self.status = status - - -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): """ @@ -579,9 +528,12 @@ class DimensionDataBackupDriver(BackupDriver): return [self._to_client_type(el) for el in elements]
[3/5] libcloud git commit: DimensionData: Adding in new methods/tests for backups
DimensionData: Adding in new methods/tests for backups Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/fe86be74 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/fe86be74 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/fe86be74 Branch: refs/heads/trunk Commit: fe86be74e06a0da6af9400173270e48554567cc4 Parents: 513bc17 Author: Jeffrey DunhamAuthored: Mon Feb 8 13:48:12 2016 -0500 Committer: anthony-shaw Committed: Wed Feb 10 12:08:06 2016 +1100 -- libcloud/backup/drivers/dimensiondata.py| 138 +++ ...ead52_692f_4314_8725_c8a4f4d13a87_backup.xml | 18 --- ...2f_4314_8725_c8a4f4d13a87_backup_DISABLE.xml | 7 + ...92f_4314_8725_c8a4f4d13a87_backup_ENABLE.xml | 18 +++ ..._692f_4314_8725_c8a4f4d13a87_backup_INFO.xml | 11 ++ ...5_c8a4f4d13a87_backup_client_SUCCESS_PUT.xml | 13 ++ libcloud/test/backup/test_dimensiondata.py | 42 +- 7 files changed, 226 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/fe86be74/libcloud/backup/drivers/dimensiondata.py -- diff --git a/libcloud/backup/drivers/dimensiondata.py b/libcloud/backup/drivers/dimensiondata.py index 15e8251..e35fd76 100644 --- a/libcloud/backup/drivers/dimensiondata.py +++ b/libcloud/backup/drivers/dimensiondata.py @@ -38,6 +38,41 @@ class DimensionDataBackupClientType(object): self.description = description +class DimensionDataBackupDetails(object): +def __init__(self, asset_id, service_plan, state, clients=[]): +self.asset_id = asset_id +self.service_plan = service_plan +self.state = state +self.clients = clients + + +class DimensionDataBackupClient(object): +def __init__(self, type, is_file_system, status, description, + schedule_pol, storage_pol, trigger=None, email=None, + last_backup_time=None, next_backup=None, download_url=None, + total_backup_size=None, running_job=None): +self.type = type +self.is_file_system = is_file_system +self.status = status +self.description = description +self.schedule_policy = schedule_pol +self.storage_policy = storage_pol +self.trigger = trigger +self.email = email +self.last_backup_time = last_backup_time +self.next_backup = next_backup +self.total_backup_size = total_backup_size +self.download_url = download_url +self.running_job = running_job + + +class DimensionDataBackupRunningJob(object): +def __init__(self, id, status, percentage=0): +self.id = id +self.percentage = percentage +self.status = status + + class DimensionDataBackupStoragePolicy(object): def __init__(self, name, retention_period, secondary_location): self.name = name @@ -232,6 +267,8 @@ class DimensionDataBackupDriver(BackupDriver): :param target: Backup target to delete :type target: Instance of :class:`BackupTarget` + +:rtype: ``bool`` """ response = self.connection.request_with_orgId_api_1( 'server/%s/backup?disable' % (target.address), @@ -384,6 +421,73 @@ class DimensionDataBackupDriver(BackupDriver): raise NotImplementedError( 'cancel_target_job not implemented for this driver') +def ex_add_client_to_target(self, target, client, storage_policy, +schedule_policy, trigger, email): +""" +Add a client to a target + +:param target: Backup target with the backup data +:type target: Instance of :class:`BackupTarget` or ``str`` + +:param client: Client to add to the target +:type client: ``str`` + +:param storage_policy: The storage policy for the client +:type storage_policy: ``str`` + +:param schedule_policy: The storage policy for the client +:type schedule_policy: ``str`` + +:param trigger: The notify trigger for the client +:type trigger: ``str`` + +:param email: The notify email for the client +:type email: ``str`` + +:rtype: ``bool`` +""" + +if isinstance(target, BackupTarget): +server_id = target.address +else: +server_id = target + +backup_elm = ET.Element('NewBackupClient', +{'xmlns': BACKUP_NS}) +ET.SubElement(backup_elm, "type").text = client +ET.SubElement(backup_elm, "storagePolicyName").text = storage_policy +ET.SubElement(backup_elm, "schedulePolicyName").text = schedule_policy +alerting_elm =
[5/5] libcloud git commit: Fixing some names/docs Closes #695
Fixing some names/docs Closes #695 Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/2b6024e1 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/2b6024e1 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/2b6024e1 Branch: refs/heads/trunk Commit: 2b6024e1f5d0818a38e1f1a1d3cbacfcb8a96516 Parents: be64f44 Author: Jeffrey DunhamAuthored: Tue Feb 9 18:45:15 2016 -0500 Committer: anthony-shaw Committed: Wed Feb 10 12:08:11 2016 +1100 -- libcloud/common/dimensiondata.py | 58 +-- 1 file changed, 29 insertions(+), 29 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/2b6024e1/libcloud/common/dimensiondata.py -- diff --git a/libcloud/common/dimensiondata.py b/libcloud/common/dimensiondata.py index 5ecd89e..fb0607b 100644 --- a/libcloud/common/dimensiondata.py +++ b/libcloud/common/dimensiondata.py @@ -815,32 +815,6 @@ class DimensionDataVirtualListenerCompatibility(object): % (self.type, self.protocol)) -class DimensionDataBackupClientType(object): -""" -A client type object for backups -""" -def __init__(self, type, is_file_system, description): -""" -Initialize an instance of :class:`DimensionDataBackupClientType` - -:param type: The type of client i.e. (FA.Linux, MySQL, ect.) -:type type: ``str`` - -:param is_file_system: The name of the iRule -:type is_file_system: ``bool`` - -:param description: Description of the client -:type description: ``str`` -""" -self.type = type -self.is_file_system = is_file_system -self.description = description - -def __repr__(self): -return (('') -% (self.type)) - - class DimensionDataBackupDetails(object): """ Dimension Data Backup Details represents information about @@ -945,7 +919,7 @@ class DimensionDataBackupClientAlert(object): self.notify_list = notify_list def __repr__(self): -return (('') +return (('') % (self.asset_id)) @@ -975,6 +949,32 @@ class DimensionDataBackupClientRunningJob(object): % (self.id)) +class DimensionDataBackupClientType(object): +""" +A client type object for backups +""" +def __init__(self, type, is_file_system, description): +""" +Initialize an instance of :class:`DimensionDataBackupClientType` + +:param type: The type of client i.e. (FA.Linux, MySQL, ect.) +:type type: ``str`` + +:param is_file_system: The name of the iRule +:type is_file_system: ``bool`` + +:param description: Description of the client +:type description: ``str`` +""" +self.type = type +self.is_file_system = is_file_system +self.description = description + +def __repr__(self): +return (('') +% (self.type)) + + class DimensionDataBackupStoragePolicy(object): """ A representation of a storage policy @@ -997,7 +997,7 @@ class DimensionDataBackupStoragePolicy(object): self.secondary_location = secondary_location def __repr__(self): -return (('') +return (('') % (self.name)) @@ -1019,5 +1019,5 @@ class DimensionDataBackupSchedulePolicy(object): self.description = description def __repr__(self): -return (('') +return (('') % (self.name))
[1/5] libcloud git commit: API Doc bug, trigger is an attribute not element
Repository: libcloud Updated Branches: refs/heads/trunk 513bc178f -> 2b6024e1f API Doc bug, trigger is an attribute not element Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/be64f44f Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/be64f44f Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/be64f44f Branch: refs/heads/trunk Commit: be64f44fe2a58d7743597d29500f62ae18ce8d73 Parents: 67f7e06 Author: Jeffrey DunhamAuthored: Tue Feb 9 18:38:55 2016 -0500 Committer: anthony-shaw Committed: Wed Feb 10 12:08:06 2016 +1100 -- libcloud/backup/drivers/dimensiondata.py | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/be64f44f/libcloud/backup/drivers/dimensiondata.py -- diff --git a/libcloud/backup/drivers/dimensiondata.py b/libcloud/backup/drivers/dimensiondata.py index 41cc9f7..c634a70 100644 --- a/libcloud/backup/drivers/dimensiondata.py +++ b/libcloud/backup/drivers/dimensiondata.py @@ -22,13 +22,13 @@ 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 DimensionDataBackupClientType -from libcloud.common.dimensiondata import DimensionDataBackupDetails from libcloud.common.dimensiondata import DimensionDataBackupClient from libcloud.common.dimensiondata import DimensionDataBackupClientAlert from libcloud.common.dimensiondata import DimensionDataBackupClientRunningJob -from libcloud.common.dimensiondata import DimensionDataBackupStoragePolicy +from libcloud.common.dimensiondata import DimensionDataBackupClientType +from libcloud.common.dimensiondata import DimensionDataBackupDetails from libcloud.common.dimensiondata import DimensionDataBackupSchedulePolicy +from libcloud.common.dimensiondata import DimensionDataBackupStoragePolicy from libcloud.common.dimensiondata import API_ENDPOINTS, DEFAULT_REGION from libcloud.common.dimensiondata import TYPES_URN from libcloud.common.dimensiondata import GENERAL_NS, BACKUP_NS @@ -428,7 +428,7 @@ class DimensionDataBackupDriver(BackupDriver): "schedulePolicyName").text = schedule_policy alerting_elm = ET.SubElement(backup_elm, "alerting") -ET.SubElement(alerting_elm, "trigger").text = trigger +alerting_elm.set('trigger', trigger) ET.SubElement(alerting_elm, "emailAddress").text = email response = self.connection.request_with_orgId_api_1(
[GitHub] libcloud pull request: DimensionData: Adding in new methods/tests ...
Github user asfgit closed the pull request at: https://github.com/apache/libcloud/pull/695 --- 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. ---
[1/3] libcloud git commit: Updating comments to better reflect the filtering
Repository: libcloud Updated Branches: refs/heads/trunk e14dbf2ce -> 513bc178f Updating comments to better reflect the filtering Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/497cc011 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/497cc011 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/497cc011 Branch: refs/heads/trunk Commit: 497cc0118801460a833c61d21ec17e5a430f1b28 Parents: 47e214f Author: Jeffrey DunhamAuthored: Tue Feb 9 00:00:59 2016 -0500 Committer: anthony-shaw Committed: Wed Feb 10 12:01:54 2016 +1100 -- libcloud/compute/drivers/dimensiondata.py | 67 -- 1 file changed, 41 insertions(+), 26 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/497cc011/libcloud/compute/drivers/dimensiondata.py -- diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py index 3da09b2..4ddc178 100644 --- a/libcloud/compute/drivers/dimensiondata.py +++ b/libcloud/compute/drivers/dimensiondata.py @@ -255,38 +255,45 @@ class DimensionDataNodeDriver(NodeDriver): """ List nodes deployed for your organization. -:keyword ex_location: The location filter +:keyword ex_location: Filters the node list to nodes that are + located in this location :typeex_location: :class:`NodeLocation` or ``str`` -:keyword ex_name: The name filter +:keyword ex_name: Filters the node list to nodes that have this name :typeex_name ``str`` -:keyword ex_ipv6: The ipv6 filter +:keyword ex_ipv6: Filters the node list to nodes that have this + ipv6 address :typeex_ipv6: ``str`` -:keyword ex_ipv4: The ipv4 filter +:keyword ex_ipv4: Filters the node list to nodes that have this + ipv4 address :typeex_ipv4: ``str`` -:keyword ex_vlan: The vlan filter +:keyword ex_vlan: Filters the node list to nodes that are in this VLAN :typeex_vlan: :class:`DimensionDataVlan` or ``str`` -:keyword ex_image: The image filter +:keyword ex_image: Filters the node list to nodes that have this image :typeex_image: :class:`NodeImage` or ``str`` -:keyword ex_deployed: The deployed filter +:keyword ex_deployed: Filters the node list to nodes that are + deployed or not :typeex_deployed: ``bool`` -:keyword ex_started: The started filter +:keyword ex_started: Filters the node list to nodes that are + started or not :typeex_started: ``bool`` -:keyword ex_state: The state filter +:keyword ex_state: Filters the node list by nodes that are in + this state :typeex_state: ``str`` -:keyword ex_network: The network filter -:typeex_notwork: :class:`DimensionDataNetwork` or ``str`` +:keyword ex_network: Filters the node list to nodes in this network +:typeex_network: :class:`DimensionDataNetwork` or ``str`` -:keyword ex_network_domain: The network domain filter -:typeex_notwork_domain: :class:`DimensionDataNetworkDomain` +:keyword ex_network_domain: Filters the node list to nodes in this +network domain +:typeex_network_domain: :class:`DimensionDataNetworkDomain` or ``str`` :return: a list of `Node` objects @@ -381,38 +388,46 @@ class DimensionDataNodeDriver(NodeDriver): """ Return a generator which yields node lists in pages -:keyword location: The location filter +:keyword location: Filters the node list to nodes that are + located in this location :typelocation: :class:`NodeLocation` or ``str`` -:keyword name: The name filter +:keyword name: Filters the node list to nodes that have this name :typename ``str`` -:keyword ipv6: The ipv6 filter +:keyword ipv6: Filters the node list to nodes that have this + ipv6 address :typeipv6: ``str`` -:keyword ipv4: The ipv4 filter +:keyword ipv4: Filters the node list to nodes that have this + ipv4 address :typeipv4: ``str`` -:keyword vlan: The vlan filter +:keyword vlan: Filters the node list to nodes that are in this VLAN :typevlan:
[3/3] libcloud git commit: Fixing small spacing issue in comment Closes #694
Fixing small spacing issue in comment Closes #694 Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/513bc178 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/513bc178 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/513bc178 Branch: refs/heads/trunk Commit: 513bc178fbbe4c68e1eb062d3ecdb1b31f6fdeff Parents: 497cc01 Author: Jeffrey DunhamAuthored: Tue Feb 9 00:04:05 2016 -0500 Committer: anthony-shaw Committed: Wed Feb 10 12:02:00 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/513bc178/libcloud/compute/drivers/dimensiondata.py -- diff --git a/libcloud/compute/drivers/dimensiondata.py b/libcloud/compute/drivers/dimensiondata.py index 4ddc178..11bad58 100644 --- a/libcloud/compute/drivers/dimensiondata.py +++ b/libcloud/compute/drivers/dimensiondata.py @@ -427,7 +427,7 @@ class DimensionDataNodeDriver(NodeDriver): :keyword network_domain: Filters the node list to nodes in this network domain :typenetwork_domain: :class:`DimensionDataNetworkDomain` -or ``str`` + or ``str`` :return: a list of `Node` objects :rtype: ``generator`` of `list` of :class:`Node`
[GitHub] libcloud pull request: DimensionData: Adding in server filters to ...
Github user asfgit closed the pull request at: https://github.com/apache/libcloud/pull/694 --- 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. ---
[1/2] libcloud git commit: ex_creation_time method for ec2 and digitalocean Closes #697 ec2 keeps the created time string in 'launch_time' and digital ocean keeps it in 'created_at'
Repository: libcloud Updated Branches: refs/heads/trunk 022d01edd -> e14dbf2ce ex_creation_time method for ec2 and digitalocean Closes #697 ec2 keeps the created time string in 'launch_time' and digital ocean keeps it in 'created_at' Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/e513687e Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/e513687e Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/e513687e Branch: refs/heads/trunk Commit: e513687ea8e335b4a71d9f6e569f61bfcb65b0e9 Parents: 17c2217 Author: Rick van de LooAuthored: Tue Feb 9 22:40:24 2016 +0100 Committer: anthony-shaw Committed: Wed Feb 10 11:59:48 2016 +1100 -- libcloud/compute/drivers/digitalocean.py | 12 libcloud/compute/drivers/ec2.py | 12 libcloud/test/compute/test_digitalocean_v2.py | 5 + libcloud/test/compute/test_ec2.py | 13 + 4 files changed, 42 insertions(+) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/e513687e/libcloud/compute/drivers/digitalocean.py -- diff --git a/libcloud/compute/drivers/digitalocean.py b/libcloud/compute/drivers/digitalocean.py index a5c3bb9..d0b3d7b 100644 --- a/libcloud/compute/drivers/digitalocean.py +++ b/libcloud/compute/drivers/digitalocean.py @@ -453,6 +453,18 @@ class DigitalOcean_v2_NodeDriver(DigitalOcean_v2_BaseDriver, method='DELETE') return res.status == httplib.NO_CONTENT +def ex_get_creation_time(self, node): +""" +Return the date and time that represent when the Instance was created. +:param node: Node instance +:type node: :class:`Node` + +:return: ISO8601 combined date and time format string for when the + Droplet was created. +:rtype: ``str`` +""" +return node.extra['created_at'] + def get_image(self, image_id): """ Get an image based on an image_id http://git-wip-us.apache.org/repos/asf/libcloud/blob/e513687e/libcloud/compute/drivers/ec2.py -- diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py index b57a1eb..1df3efd 100644 --- a/libcloud/compute/drivers/ec2.py +++ b/libcloud/compute/drivers/ec2.py @@ -4256,6 +4256,18 @@ class BaseEC2NodeDriver(NodeDriver): """ return node.extra['tags'] +def ex_get_creation_time(self, node): +""" +Return the date and time that represent when the Instance was created. +:param node: Node instance +:type node: :class:`Node + +:return: ISO8601 combined date and time format string for when the + Instance was created. +:rtype: ``str`` +""" +return node.extra['launch_time'] + def ex_allocate_address(self, domain='standard'): """ Allocate a new Elastic IP address for EC2 classic or VPC http://git-wip-us.apache.org/repos/asf/libcloud/blob/e513687e/libcloud/test/compute/test_digitalocean_v2.py -- diff --git a/libcloud/test/compute/test_digitalocean_v2.py b/libcloud/test/compute/test_digitalocean_v2.py index e666ce5..a4a1b01 100644 --- a/libcloud/test/compute/test_digitalocean_v2.py +++ b/libcloud/test/compute/test_digitalocean_v2.py @@ -142,6 +142,11 @@ class DigitalOcean_v2_Tests(LibcloudTestCase): result = self.driver.destroy_node(node) self.assertTrue(result) +def test_ex_get_creation_time(self): +node = self.driver.list_nodes()[0] +creation_time = self.driver.ex_get_creation_time(node) +self.assertEqual(creation_time, "2014-11-14T16:29:21Z") + def test_ex_rename_node_success(self): node = self.driver.list_nodes()[0] DigitalOceanMockHttp.type = 'RENAME' http://git-wip-us.apache.org/repos/asf/libcloud/blob/e513687e/libcloud/test/compute/test_ec2.py -- diff --git a/libcloud/test/compute/test_ec2.py b/libcloud/test/compute/test_ec2.py index b800066..243425c 100644 --- a/libcloud/test/compute/test_ec2.py +++ b/libcloud/test/compute/test_ec2.py @@ -971,6 +971,19 @@ class EC2Tests(LibcloudTestCase, TestCaseMixin): self.assertEqual(metadata['Num'], '42') self.assertEqual(len(metadata), 3) +def test_ex_get_creation_time(self): +image = NodeImage(id='ami-be3adfd8', + name=self.image_name, + driver=self.driver) +size = NodeSize('m1.small', 'Small
[GitHub] libcloud pull request: ex_creation_time method for ec2 and digital...
Github user asfgit closed the pull request at: https://github.com/apache/libcloud/pull/697 --- 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. ---
libcloud git commit: Updated CHANGES with last 5 merged PRs
Repository: libcloud Updated Branches: refs/heads/trunk 2b6024e1f -> d819d4edb Updated CHANGES with last 5 merged PRs Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/d819d4ed Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/d819d4ed Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/d819d4ed Branch: refs/heads/trunk Commit: d819d4edbf0b0f0fe3e1f43119fc3bb68b4d1978 Parents: 2b6024e Author: anthony-shawAuthored: Wed Feb 10 12:14:06 2016 +1100 Committer: anthony-shaw Committed: Wed Feb 10 12:14:06 2016 +1100 -- CHANGES.rst | 16 1 file changed, 16 insertions(+) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/d819d4ed/CHANGES.rst -- diff --git a/CHANGES.rst b/CHANGES.rst index 0e99f0f..c46a43a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -29,6 +29,15 @@ Compute (GITHUB-691) [Jeff Dunham] +- Support for filtering by IPv4, IPv6, network, network domain, VLAN in Dimension + data driver. + (GITHUB-694) + [Jeff Dunham] + +- Support for creation time (`ex_created_time`) in EC2 and digitalocean drivers + (GITHUB-697) + [Rick van de Loo] + Storage ~~~ @@ -36,6 +45,13 @@ Storage (LIBCLOUD-800, GITHUB-689) [Scott Crunkleton] +Backup +~~ + +- Dimension Data - added additional testing, fixed bug on client response naming, + added support for adding backup clients to a backup enabled node. + (GITHUB-692, GITHUB-693, GITHUB-695) + [Jeff Dunham] Changes with Apache Libcloud 1.0.0-pre1 ---
libcloud git commit: Fixed type in Container __repr__
Repository: libcloud Updated Branches: refs/heads/trunk d819d4edb -> 4d926bd3f Fixed type in Container __repr__ Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/4d926bd3 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/4d926bd3 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/4d926bd3 Branch: refs/heads/trunk Commit: 4d926bd3f60154dc4e253d7dda096241ca8094c4 Parents: d819d4e Author: anthony-shawAuthored: Wed Feb 10 17:34:32 2016 +1100 Committer: anthony-shaw Committed: Wed Feb 10 17:34:32 2016 +1100 -- libcloud/container/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/libcloud/blob/4d926bd3/libcloud/container/base.py -- diff --git a/libcloud/container/base.py b/libcloud/container/base.py index ea41e50..0980041 100644 --- a/libcloud/container/base.py +++ b/libcloud/container/base.py @@ -77,8 +77,8 @@ class Container(object): return self.driver.destroy_container(container=self) def __repr__(self): -return ('' % +return ('' % (self.id, self.name, self.state, self.driver.name))