added ex_describe_volume_modifications() method
@@ -5646,6 +5646,57 @@ class BaseEC2NodeDriver(NodeDriver):
params=parameters.copy()).object
return self._to_volume_modification(response)
+ def ex_describe_volumes_modifications(self, dry_run=False, volume_ids=None,
+ filters=None, next_token=None,
+ max_results=None):
+ """
+ Describes one or more of your volume modifications.
+
+ :param dry_run: dry_run
+ :type dry_run: ``bool``
+
+ :param volume_ids: The volume_ids so that the response includes
+ information for only said volumes
+ :type volume_ids: ``dict``
+
+ :param filters: The filters so that the response includes
+ information for only certain volumes
+ :type filters: ``dict``
+
+ :param max_results: The maximum number of items that can be
+ returned in a single page
+ :type max_results: ``int``
+
+ :param next_token: The nextToken value returned by a previous paginated request.
+ :type next_token: ``string``
+
+ :return: List of volume modification status objects
+ :rtype: ``list`` of :class:`VolumeModification
+ """
+
+ if next_token:
+ raise NotImplementedError(
+ 'volume_modifications next_token is not implemented')
+
+ params = {'Action': 'DescribeVolumesModifications'}
+
+ if dry_run:
+ params.update({'DryRun': dry_run})
+
+ if volume_ids:
+ params.update({'VolumeIds': volume_ids})
+
+ if filters:
+ params.update(self._build_filters(filters))
+
+ if max_results:
+ params.update({'MaxResults': max_results})
+
+ response = self.connection.request(self.path, params=params,
+ method='GET').object
+
+ return self._to_volume_modifications(response)
+
def _ex_connection_class_kwargs(self):
kwargs = super(BaseEC2NodeDriver, self)._ex_connection_class_kwargs()
if hasattr(self, 'token') and self.token is not None:
@@ -5774,6 +5825,11 @@ class BaseEC2NodeDriver(NodeDriver):
state=state,
extra=extra)
+ def _to_volume_modifications(self, object):
+ return [self._to_volume_modification(el) for el in object.findall(
+ fixxpath(xpath='volumeModificationSet/item', namespace=NAMESPACE))
+ ]
+
def _to_volume_modification(self, element):
"""
Parse the XML element and return a StorageVolume object.
