Permalink
Browse files

Merge branch 'release-2.19.0'

  • Loading branch information...
2 parents bc48be4 + 31a7e7e commit 2fcb85372e333d013790822086583ecf17fda35d @danielgtaylor danielgtaylor committed Nov 27, 2013
View
@@ -1,35 +0,0 @@
-==============
-Change history
-==============
-
-.. contents::
- :local:
-
-.. _version-2.0:
-
-2.0
-===
-:release-date: 2011-07-14
-
-.. _v20-important:
-
-Important Notes
----------------
-
-* Backwards-incompatible filter changes in the latest 2011 EC2 APIs
-
- In the latest 2011 EC2 APIs all security groups are assigned a unique
- identifier (sg-\*). As a consequence, some existing filters which used to take
- the group name now require the group *id* instead:
-
- 1. *group-id* filter in DescribeInstances (ie get_all_instances())
-
- To filter by group name you must instead use the *group-name* filter
-
- 2. *launch.group-id* filter in DescribeSpotInstanceRequests (ie get_all_spot_instance_requests())
-
- Unfortunately for now, it is *not* possible to filter spot instance
- requests by group name; the security group id *must* be used instead.
-
- This new security group id can be found in the *id* attribute of a boto
- SecurityGroup instance.
View
@@ -1,6 +1,5 @@
include boto/cacerts/cacerts.txt
include README.rst
-include Changelog.rst
include boto/file/README
include .gitignore
include pylintrc
View
@@ -1,9 +1,9 @@
####
boto
####
-boto 2.18.0
+boto 2.19.0
-Released: 22-November-2013
+Released: 27-November-2013
.. image:: https://travis-ci.org/boto/boto.png?branch=develop
:target: https://travis-ci.org/boto/boto
@@ -121,7 +121,7 @@ ChangeLogs
**********
To see what has changed over time in boto, you can check out the
-`release notes`_ in the wiki.
+release notes at `http://docs.pythonboto.org/en/latest/#release-notes`
***************************
Finding Out More About Boto
View
@@ -36,7 +36,7 @@
import urlparse
from boto.exception import InvalidUriError
-__version__ = '2.18.0'
+__version__ = '2.19.0'
Version = __version__ # for backware compatibility
UserAgent = 'Boto/%s Python/%s %s/%s' % (
View
@@ -70,7 +70,7 @@
class EC2Connection(AWSQueryConnection):
- APIVersion = boto.config.get('Boto', 'ec2_version', '2013-10-01')
+ APIVersion = boto.config.get('Boto', 'ec2_version', '2013-10-15')
DefaultRegionName = boto.config.get('Boto', 'ec2_region_name', 'us-east-1')
DefaultRegionEndpoint = boto.config.get('Boto', 'ec2_region_endpoint',
'ec2.us-east-1.amazonaws.com')
@@ -522,7 +522,8 @@ def reset_image_attribute(self, image_id, attribute='launchPermission',
# Instance methods
- def get_all_instances(self, instance_ids=None, filters=None, dry_run=False):
+ def get_all_instances(self, instance_ids=None, filters=None, dry_run=False,
+ max_results=None):
"""
Retrieve all the instance reservations associated with your account.
@@ -547,6 +548,10 @@ def get_all_instances(self, instance_ids=None, filters=None, dry_run=False):
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.
+ :type max_results: int
+ :param max_results: The maximum number of paginated instance
+ items per response.
+
:rtype: list
:return: A list of :class:`boto.ec2.instance.Reservation`
@@ -555,10 +560,11 @@ def get_all_instances(self, instance_ids=None, filters=None, dry_run=False):
'replaced with get_all_reservations.'),
PendingDeprecationWarning)
return self.get_all_reservations(instance_ids=instance_ids,
- filters=filters, dry_run=dry_run)
+ filters=filters, dry_run=dry_run,
+ max_results=max_results)
def get_only_instances(self, instance_ids=None, filters=None,
- dry_run=False):
+ dry_run=False, max_results=None):
# A future release should rename this method to get_all_instances
# and make get_only_instances an alias for that.
"""
@@ -578,17 +584,22 @@ def get_only_instances(self, instance_ids=None, filters=None,
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.
+ :type max_results: int
+ :param max_results: The maximum number of paginated instance
+ items per response.
+
:rtype: list
:return: A list of :class:`boto.ec2.instance.Instance`
"""
reservations = self.get_all_reservations(instance_ids=instance_ids,
filters=filters,
- dry_run=dry_run)
+ dry_run=dry_run,
+ max_results=max_results)
return [instance for reservation in reservations
for instance in reservation.instances]
def get_all_reservations(self, instance_ids=None, filters=None,
- dry_run=False):
+ dry_run=False, max_results=None):
"""
Retrieve all the instance reservations associated with your account.
@@ -606,6 +617,10 @@ def get_all_reservations(self, instance_ids=None, filters=None,
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.
+ :type max_results: int
+ :param max_results: The maximum number of paginated instance
+ items per response.
+
:rtype: list
:return: A list of :class:`boto.ec2.instance.Reservation`
"""
@@ -624,6 +639,8 @@ def get_all_reservations(self, instance_ids=None, filters=None,
self.build_filter_params(params, filters)
if dry_run:
params['DryRun'] = 'true'
+ if max_results is not None:
+ params['MaxResults'] = max_results
return self.get_list('DescribeInstances', params,
[('item', Reservation)], verb='POST')
@@ -1261,7 +1278,8 @@ def get_all_spot_instance_requests(self, request_ids=None,
def get_spot_price_history(self, start_time=None, end_time=None,
instance_type=None, product_description=None,
- availability_zone=None, dry_run=False):
+ availability_zone=None, dry_run=False,
+ max_results=None):
"""
Retrieve the recent history of spot instances pricing.
@@ -1295,6 +1313,10 @@ def get_spot_price_history(self, start_time=None, end_time=None,
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.
+ :type max_results: int
+ :param max_results: The maximum number of paginated items
+ per response.
+
:rtype: list
:return: A list tuples containing price and timestamp.
"""
@@ -1311,6 +1333,8 @@ def get_spot_price_history(self, start_time=None, end_time=None,
params['AvailabilityZone'] = availability_zone
if dry_run:
params['DryRun'] = 'true'
+ if max_results is not None:
+ params['MaxResults'] = max_results
return self.get_list('DescribeSpotPriceHistory', params,
[('item', SpotPriceHistory)], verb='POST')
@@ -3943,7 +3967,7 @@ def build_tag_param_list(self, params, tags):
params['Tag.%d.Value'%i] = value
i += 1
- def get_all_tags(self, filters=None, dry_run=False):
+ def get_all_tags(self, filters=None, dry_run=False, max_results=None):
"""
Retrieve all the metadata tags associated with your account.
@@ -3960,6 +3984,10 @@ def get_all_tags(self, filters=None, dry_run=False):
:type dry_run: bool
:param dry_run: Set to True if the operation should not actually run.
+ :type max_results: int
+ :param max_results: The maximum number of paginated instance
+ items per response.
+
:rtype: list
:return: A list of :class:`boto.ec2.tag.Tag` objects
"""
@@ -3968,6 +3996,8 @@ def get_all_tags(self, filters=None, dry_run=False):
self.build_filter_params(params, filters)
if dry_run:
params['DryRun'] = 'true'
+ if max_results is not None:
+ params['MaxResults'] = max_results
return self.get_list('DescribeTags', params,
[('item', Tag)], verb='POST')
View
@@ -1084,6 +1084,23 @@ def create_dbsnapshot(self, snapshot_id, dbinstance_id):
params = {'DBSnapshotIdentifier': snapshot_id,
'DBInstanceIdentifier': dbinstance_id}
return self.get_object('CreateDBSnapshot', params, DBSnapshot)
+
+ def copy_dbsnapshot(self, source_snapshot_id, target_snapshot_id):
+ """
+ Copies the specified DBSnapshot.
+
+ :type source_snapshot_id: string
+ :param source_snapshot_id: The identifier for the source DB snapshot.
+
+ :type target_snapshot_id: string
+ :param target_snapshot_id: The identifier for the copied snapshot.
+
+ :rtype: :class:`boto.rds.dbsnapshot.DBSnapshot`
+ :return: The newly created DBSnapshot.
+ """
+ params = {'SourceDBSnapshotIdentifier': source_snapshot_id,
+ 'TargetDBSnapshotIdentifier': target_snapshot_id}
+ return self.get_object('CopyDBSnapshot', params, DBSnapshot)
def delete_dbsnapshot(self, identifier):
"""
View
@@ -115,6 +115,7 @@ Release Notes
.. toctree::
:titlesonly:
+ releasenotes/v2.19.0
releasenotes/v2.18.0
releasenotes/v2.17.0
releasenotes/v2.16.0
@@ -0,0 +1,24 @@
+boto v2.19.0
+============
+
+:date: 2013/11/27
+
+This release adds support for max result limits for Amazon EC2 calls, adds
+support for Amazon RDS database snapshot copies and fixes links to the
+changelog.
+
+
+Features
+--------
+* Add max results parameters to EC2 describe instances and describe tags.
+ (:issue:`1873`, :issue:`1873`, :sha:`ad8a64a`)
+* Add support for RDS CopyDBSnapshot. (:issue:`1872`, :issue:`1872`,
+ :issue:`1865`, :sha:`bffb758`)
+
+
+Bugfixes
+--------
+* Update README.rst to link to ReadTheDocs changelogs. (:issue:`1869`,
+ :sha:`26f3dbe`)
+* Delete the old changelog in favor of the README link to ReadTheDocs
+ changelogs. (:issue:`1870`, :issue:`1870`, :sha:`32bc333`)
@@ -1256,5 +1256,62 @@ def test_terminate_bad_response(self):
self.ec2.terminate_instances('foo')
+class TestDescribeInstances(TestEC2ConnectionBase):
+
+ def default_body(self):
+ return """
+ <DescribeInstancesResponse>
+ </DescribeInstancesResponse>
+ """
+
+ def test_default_behavior(self):
+ self.set_http_response(status_code=200)
+ self.ec2.get_all_instances()
+ self.assert_request_parameters({
+ 'Action': 'DescribeInstances'},
+ ignore_params_values=['AWSAccessKeyId', 'SignatureMethod',
+ 'SignatureVersion', 'Timestamp', 'Version'])
+
+ def test_max_results(self):
+ self.set_http_response(status_code=200)
+ self.ec2.get_all_instances(
+ max_results=10
+ )
+ self.assert_request_parameters({
+ 'Action': 'DescribeInstances',
+ 'MaxResults': 10},
+ ignore_params_values=['AWSAccessKeyId', 'SignatureMethod',
+ 'SignatureVersion', 'Timestamp', 'Version'])
+
+
+class TestDescribeTags(TestEC2ConnectionBase):
+
+ def default_body(self):
+ return """
+ <DescribeTagsResponse>
+ </DescribeTagsResponse>
+ """
+
+ def test_default_behavior(self):
+ self.set_http_response(status_code=200)
+ self.ec2.get_all_tags()
+ self.assert_request_parameters({
+ 'Action': 'DescribeTags'},
+ ignore_params_values=['AWSAccessKeyId', 'SignatureMethod',
+ 'SignatureVersion', 'Timestamp', 'Version'])
+
+ def test_max_results(self):
+ self.set_http_response(status_code=200)
+ self.ec2.get_all_tags(
+ max_results=10
+ )
+ self.assert_request_parameters({
+ 'Action': 'DescribeTags',
+ 'MaxResults': 10},
+ ignore_params_values=['AWSAccessKeyId', 'SignatureMethod',
+ 'SignatureVersion', 'Timestamp', 'Version'])
+
+
+
if __name__ == '__main__':
unittest.main()
Oops, something went wrong.

0 comments on commit 2fcb853

Please sign in to comment.