Permalink
Browse files

Merge branch 'release-2.4.0'

  • Loading branch information...
2 parents 911f42b + 6588ea2 commit 1aa1133e8502ea6c95e49ac34681569df5ace46b @garnaat garnaat committed May 16, 2012
Showing with 7,715 additions and 1,322 deletions.
  1. +1 −1 MANIFEST.in
  2. +0 −73 README.markdown
  3. +100 −0 README.rst
  4. +2 −2 bin/s3multiput
  5. +22 −3 boto/__init__.py
  6. +27 −0 boto/auth.py
  7. +4 −3 boto/cloudformation/connection.py
  8. +18 −0 boto/cloudformation/stack.py
  9. +1 −1 boto/cloudfront/invalidation.py
  10. +45 −0 boto/cloudsearch/__init__.py
  11. +150 −0 boto/cloudsearch/document.py
  12. +397 −0 boto/cloudsearch/domain.py
  13. +732 −0 boto/cloudsearch/layer1.py
  14. +52 −0 boto/cloudsearch/layer2.py
  15. +249 −0 boto/cloudsearch/optionstatus.py
  16. +298 −0 boto/cloudsearch/search.py
  17. +75 −0 boto/cloudsearch/sourceattribute.py
  18. +18 −9 boto/connection.py
  19. +13 −3 boto/dynamodb/__init__.py
  20. +134 −8 boto/dynamodb/batch.py
  21. +51 −38 boto/dynamodb/condition.py
  22. +19 −0 boto/dynamodb/exceptions.py
  23. +27 −28 boto/dynamodb/item.py
  24. +57 −32 boto/dynamodb/layer1.py
  25. +132 −102 boto/dynamodb/layer2.py
  26. +6 −6 boto/dynamodb/schema.py
  27. +27 −29 boto/dynamodb/table.py
  28. +15 −9 boto/dynamodb/types.py
  29. +4 −1 boto/ec2/autoscale/launchconfig.py
  30. +12 −9 boto/ec2/cloudwatch/__init__.py
  31. +48 −33 boto/ec2/connection.py
  32. +15 −15 boto/ec2/elb/__init__.py
  33. +11 −4 boto/ec2/image.py
  34. +3 −0 boto/ec2/networkinterface.py
  35. +61 −26 boto/ec2/securitygroup.py
  36. +3 −0 boto/ec2/snapshot.py
  37. +11 −9 boto/ec2/spotinstancerequest.py
  38. +3 −2 boto/emr/connection.py
  39. +39 −0 boto/emr/step.py
  40. +33 −3 boto/exception.py
  41. +1 −3 boto/fps/__init__.py
  42. +316 −354 boto/fps/connection.py
  43. +344 −0 boto/fps/exception.py
  44. +169 −4 boto/fps/response.py
  45. +34 −28 boto/gs/acl.py
  46. +36 −6 boto/gs/bucket.py
  47. +169 −0 boto/gs/cors.py
  48. +44 −10 boto/gs/key.py
  49. +35 −6 boto/gs/resumable_upload_handler.py
  50. +21 −0 boto/mws/__init__.py
  51. +725 −0 boto/mws/connection.py
  52. +75 −0 boto/mws/exception.py
  53. +633 −0 boto/mws/response.py
  54. +1 −1 boto/rds/parametergroup.py
  55. +9 −0 boto/resultset.py
  56. +19 −2 boto/route53/connection.py
  57. +26 −6 boto/route53/record.py
  58. +42 −5 boto/s3/bucket.py
  59. +23 −19 boto/s3/connection.py
  60. +95 −10 boto/s3/key.py
  61. +4 −0 boto/s3/multipart.py
  62. +2 −2 boto/sqs/batchresults.py
  63. +102 −53 boto/sqs/connection.py
  64. +3 −1 boto/sqs/message.py
  65. +65 −25 boto/sqs/queue.py
  66. +16 −0 boto/storage_uri.py
  67. +37 −0 boto/swf/exceptions.py
  68. +101 −34 boto/swf/layer1.py
  69. +316 −0 boto/swf/layer1_decisions.py
  70. +1 −1 boto/utils.py
  71. +23 −45 boto/vpc/__init__.py
  72. +264 −0 docs/source/cloudsearch_tut.rst
  73. +7 −0 docs/source/ref/cloudformation.rst
  74. +59 −0 docs/source/ref/cloudsearch.rst
  75. +1 −0 docs/source/ref/index.rst
  76. +7 −0 docs/source/ref/s3.rst
  77. +2 −2 setup.py
  78. +16 −4 tests/dynamodb/test_layer1.py
  79. +43 −13 tests/dynamodb/test_layer2.py
  80. +37 −19 tests/ec2/cloudwatch/test_connection.py
  81. +101 −0 tests/fps/test.py
  82. +0 −4 tests/fps/test_install_caller_instruction.py
  83. 0 tests/mws/__init__.py
  84. +98 −0 tests/mws/test.py
  85. +17 −0 tests/s3/test_connection.py
  86. +64 −0 tests/s3/test_gsconnection.py
  87. +30 −0 tests/s3/test_key.py
  88. +13 −0 tests/s3/test_multipart.py
  89. +43 −104 tests/s3/test_resumable_downloads.py
  90. +69 −112 tests/s3/test_resumable_uploads.py
  91. +14 −0 tests/sqs/test_connection.py
  92. 0 tests/swf/__init__.py
  93. +245 −0 tests/swf/test_layer1.py
  94. +171 −0 tests/swf/test_layer1_workflow_execution.py
  95. +12 −0 tests/test.py
View
@@ -1,5 +1,5 @@
include boto/cacerts/cacerts.txt
-include README.markdown
+include README.rst
include Changelog.rst
include boto/file/README
include .gitignore
View
@@ -1,73 +0,0 @@
-# boto
-boto 2.3.0
-18-Mar-2012
-
-## Introduction
-
-Boto is a Python package that provides interfaces to Amazon Web Services.
-At the moment, boto supports:
-
- * Simple Storage Service (S3)
- * SimpleQueue Service (SQS)
- * Elastic Compute Cloud (EC2)
- * Mechanical Turk
- * SimpleDB
- * CloudFront
- * CloudWatch
- * AutoScale
- * Elastic Load Balancer (ELB)
- * Virtual Private Cloud (VPC)
- * Elastic Map Reduce (EMR)
- * Relational Data Service (RDS)
- * Simple Notification Server (SNS)
- * Google Storage
- * Identity and Access Management (IAM)
- * Route53 DNS Service (route53)
- * Simple Email Service (SES)
- * Flexible Payment Service (FPS)
- * CloudFormation
- * Amazon DynamoDB
- * Amazon SimpleWorkflow
-
-The goal of boto is to support the full breadth and depth of Amazon
-Web Services. In addition, boto provides support for other public
-services such as Google Storage in addition to private cloud systems
-like Eucalyptus, OpenStack and Open Nebula.
-
-Boto is developed mainly using Python 2.6.6 and Python 2.7.1 on Mac OSX
-and Ubuntu Maverick. It is known to work on other Linux distributions
-and on Windows. Boto requires no additional libraries or packages
-other than those that are distributed with Python. Efforts are made
-to keep boto compatible with Python 2.5.x but no guarantees are made.
-
-## Finding Out More About Boto
-
-The main source code repository for boto can be found on
-[github.com](http://github.com/boto/boto)
-
-[Online documentation](http://docs.pythonboto.org/) is also
-available. The online documentation includes full API documentation
-as well as Getting Started Guides for many of the boto modules.
-
-Boto releases can be found on the [Python Cheese Shop](http://pypi.python.org/).
-
-Join our `IRC channel`_ (#boto on FreeNode).
- IRC channel: http://webchat.freenode.net/?channels=boto
-
-## Getting Started with Boto
-
-Your credentials can be passed into the methods that create
-connections. Alternatively, boto will check for the existance of the
-following environment variables to ascertain your credentials:
-
-AWS_ACCESS_KEY_ID - Your AWS Access Key ID
-AWS_SECRET_ACCESS_KEY - Your AWS Secret Access Key
-
-Credentials and other boto-related settings can also be stored in a
-boto config file. See
-[this](http://code.google.com/p/boto/wiki/BotoConfig) for details.
-
-Copyright (c) 2006-2012 Mitch Garnaat <mitch@garnaat.com>
-Copyright (c) 2010-2011, Eucalyptus Systems, Inc.
-Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
-All rights reserved.
View
@@ -0,0 +1,100 @@
+####
+boto
+####
+boto 2.4.0
+15-May-2012
+
+************
+Introduction
+************
+
+Boto is a Python package that provides interfaces to Amazon Web Services.
+At the moment, boto supports:
+
+* Simple Storage Service (S3)
+* SimpleQueue Service (SQS)
+* Elastic Compute Cloud (EC2)
+* Mechanical Turk
+* SimpleDB
+* CloudFront
+* CloudWatch
+* AutoScale
+* Elastic Load Balancer (ELB)
+* Virtual Private Cloud (VPC)
+* Elastic Map Reduce (EMR)
+* Relational Data Service (RDS)
+* Simple Notification Server (SNS)
+* Google Storage
+* Identity and Access Management (IAM)
+* Route53 DNS Service (route53)
+* Simple Email Service (SES)
+* Flexible Payment Service (FPS)
+* CloudFormation
+* Amazon DynamoDB
+* Amazon SimpleWorkflow
+* CloudSearch
+* Marketplace Web Services
+
+The goal of boto is to support the full breadth and depth of Amazon
+Web Services. In addition, boto provides support for other public
+services such as Google Storage in addition to private cloud systems
+like Eucalyptus, OpenStack and Open Nebula.
+
+Boto is developed mainly using Python 2.6.6 and Python 2.7.1 on Mac OSX
+and Ubuntu Maverick. It is known to work on other Linux distributions
+and on Windows. Boto requires no additional libraries or packages
+other than those that are distributed with Python. Efforts are made
+to keep boto compatible with Python 2.5.x but no guarantees are made.
+
+*********************************
+Special Note for Python 3.x Users
+*********************************
+
+If you are interested in trying out boto with Python 3.x, check out the
+`neo`_ branch. This is under active development and the goal is a version
+of boto that works in Python 2.6, 2.7, and 3.x. Not everything is working
+just yet but many things are and it's worth a look if you are an active
+Python 3.x user.
+
+***************************
+Finding Out More About Boto
+***************************
+
+The main source code repository for boto can be found on `github.com`_.
+The boto project uses the `gitflow`_ model for branching.
+
+`Online documentation`_ is also available. The online documentation includes
+full API documentation as well as Getting Started Guides for many of the boto
+modules.
+
+Boto releases can be found on the `Python Cheese Shop`_.
+
+Join our IRC channel `#boto` on FreeNode.
+Webchat IRC channel: http://webchat.freenode.net/?channels=boto
+
+*************************
+Getting Started with Boto
+*************************
+
+Your credentials can be passed into the methods that create
+connections. Alternatively, boto will check for the existance of the
+following environment variables to ascertain your credentials:
+
+**AWS_ACCESS_KEY_ID** - Your AWS Access Key ID
+
+**AWS_SECRET_ACCESS_KEY** - Your AWS Secret Access Key
+
+Credentials and other boto-related settings can also be stored in a
+boto config file. See `this`_ for details.
+
+Copyright (c) 2006-2012 Mitch Garnaat <mitch@garnaat.com>
+Copyright (c) 2010-2011, Eucalyptus Systems, Inc.
+Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
+All rights reserved.
+
+.. _github.com: http://github.com/boto/boto
+.. _Online documentation: http://docs.pythonboto.org
+.. _Python Cheese Shop: http://pypi.python.org/pypi/boto
+.. _this: http://code.google.com/p/boto/wiki/BotoConfig
+.. _gitflow: http://nvie.com/posts/a-successful-git-branching-model/
+.. _neo: https://github.com/boto/boto/tree/neo
View
@@ -285,7 +285,7 @@ def main():
else:
upload(bucket_name, aws_access_key_id,
aws_secret_access_key, fullpath, key_name,
- reduced, debug, cb, num_cb)
+ reduced, debug, cb, num_cb, grant or 'private')
total += 1
# upload a single file
@@ -311,7 +311,7 @@ def main():
else:
upload(bucket_name, aws_access_key_id,
aws_secret_access_key, path, key_name,
- reduced, debug, cb, num_cb)
+ reduced, debug, cb, num_cb, grant or 'private')
if __name__ == "__main__":
main()
View
@@ -32,7 +32,7 @@
import urlparse
from boto.exception import InvalidUriError
-__version__ = '2.3.0'
+__version__ = '2.4.0'
Version = __version__ # for backware compatibility
UserAgent = 'Boto/%s (%s)' % (__version__, sys.platform)
@@ -371,7 +371,7 @@ def connect_euca(host=None, aws_access_key_id=None, aws_secret_access_key=None,
region=reg, port=port, path=path,
is_secure=is_secure, **kwargs)
-def connect_ec2_endpoint(url, aws_access_key_id=None, aws_secret_access_key=None,
+def connect_ec2_endpoint(url, aws_access_key_id=None, aws_secret_access_key=None,
**kwargs):
"""
Connect to an EC2 Api endpoint. Additional arguments are passed
@@ -437,7 +437,7 @@ def connect_walrus(host=None, aws_access_key_id=None, aws_secret_access_key=None
None)
if not host:
host = config.get('Boto', 'walrus_host', None)
-
+
return S3Connection(aws_access_key_id, aws_secret_access_key,
host=host, port=port, path=path,
calling_format=OrdinaryCallingFormat(),
@@ -535,6 +535,25 @@ def connect_swf(aws_access_key_id=None,
from boto.swf.layer1 import Layer1
return Layer1(aws_access_key_id, aws_secret_access_key, **kwargs)
+
+def connect_cloudsearch(aws_access_key_id=None,
+ aws_secret_access_key=None,
+ **kwargs):
+ """
+ :type aws_access_key_id: string
+ :param aws_access_key_id: Your AWS Access Key ID
+
+ :type aws_secret_access_key: string
+ :param aws_secret_access_key: Your AWS Secret Access Key
+
+ :rtype: :class:`boto.ec2.autoscale.CloudSearchConnection`
+ :return: A connection to Amazon's CloudSearch service
+ """
+ from boto.cloudsearch.layer2 import Layer2
+ return Layer2(aws_access_key_id, aws_secret_access_key,
+ **kwargs)
+
+
def check_extensions(module_name, module_path):
"""
This function checks for extensions to boto modules. It should be called in the
View
@@ -366,6 +366,33 @@ def _calc_signature(self, params, verb, path, server_name):
boto.log.debug('base64 encoded digest: %s' % b64)
return (qs, b64)
+class POSTPathQSV2AuthHandler(QuerySignatureV2AuthHandler, AuthHandler):
+ """
+ Query Signature V2 Authentication relocating signed query
+ into the path and allowing POST requests with Content-Types.
+ """
+
+ capability = ['mws']
+
+ def add_auth(self, req, **kwargs):
+ req.params['AWSAccessKeyId'] = self._provider.access_key
+ req.params['SignatureVersion'] = self.SignatureVersion
+ req.params['Timestamp'] = boto.utils.get_ts()
+ qs, signature = self._calc_signature(req.params, req.method,
+ req.auth_path, req.host)
+ boto.log.debug('query_string: %s Signature: %s' % (qs, signature))
+ if req.method == 'POST':
+ req.headers['Content-Length'] = str(len(req.body))
+ req.headers['Content-Type'] = req.headers.get('Content-Type',
+ 'text/plain')
+ else:
+ req.body = ''
+ # if this is a retried req, the qs from the previous try will
+ # already be there, we need to get rid of that and rebuild it
+ req.path = req.path.split('?')[0]
+ req.path = (req.path + '?' + qs +
+ '&Signature=' + urllib.quote_plus(signature))
+
def get_auth_handler(host, config, provider, requested_capability=None):
"""Finds an AuthHandler that is ready to authenticate.
@@ -36,9 +36,10 @@ class CloudFormationConnection(AWSQueryConnection):
"""
A Connection to the CloudFormation Service.
"""
- DefaultRegionName = 'us-east-1'
- DefaultRegionEndpoint = 'cloudformation.us-east-1.amazonaws.com'
- APIVersion = '2010-05-15'
+ APIVersion = boto.config.get('Boto', 'cfn_version', '2010-05-15')
+ DefaultRegionName = boto.config.get('Boto', 'cfn_region_name', 'us-east-1')
+ DefaultRegionEndpoint = boto.config.get('Boto', 'cfn_region_endpoint',
+ 'cloudformation.us-east-1.amazonaws.com')
valid_states = ("CREATE_IN_PROGRESS", "CREATE_FAILED", "CREATE_COMPLETE",
"ROLLBACK_IN_PROGRESS", "ROLLBACK_FAILED", "ROLLBACK_COMPLETE",
@@ -11,6 +11,7 @@ def __init__(self, connection=None):
self.notification_arns = []
self.outputs = []
self.parameters = []
+ self.capabilities = []
self.stack_id = None
self.stack_status = None
self.stack_name = None
@@ -24,6 +25,9 @@ def startElement(self, name, attrs, connection):
elif name == "Outputs":
self.outputs = ResultSet([('member', Output)])
return self.outputs
+ elif name == "Capabilities":
+ self.capabilities = ResultSet([('member', Capability)])
+ return self.capabilities
else:
return None
@@ -165,6 +169,20 @@ def endElement(self, name, value, connection):
def __repr__(self):
return "Output:\"%s\"=\"%s\"" % (self.key, self.value)
+class Capability:
+ def __init__(self, connection=None):
+ self.connection = None
+ self.value = None
+
+ def startElement(self, name, attrs, connection):
+ return None
+
+ def endElement(self, name, value, connection):
+ self.value = value
+
+ def __repr__(self):
+ return "Capability:\"%s\"" % (self.value)
+
class StackResource:
def __init__(self, connection=None):
self.connection = connection
@@ -40,7 +40,7 @@ def __init__(self, paths=None, connection=None, distribution=None, caller_refere
# If we passed in a distribution,
# then we use that as the connection object
if distribution:
- self.connection = connection
+ self.connection = distribution
else:
self.connection = connection
@@ -0,0 +1,45 @@
+# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
+# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
+# All Rights Reserved
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish, dis-
+# tribute, sublicense, and/or sell copies of the Software, and to permit
+# persons to whom the Software is furnished to do so, subject to the fol-
+# lowing conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
+# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+#
+from boto.ec2.regioninfo import RegionInfo
+
+
+def regions():
+ """
+ Get all available regions for the Amazon CloudSearch service.
+
+ :rtype: list
+ :return: A list of :class:`boto.regioninfo.RegionInfo`
+ """
+ import boto.cloudsearch.layer1
+ return [RegionInfo(name='us-east-1',
+ endpoint='cloudsearch.us-east-1.amazonaws.com',
+ connection_cls=boto.cloudsearch.layer1.Layer1),
+ ]
+
+
+def connect_to_region(region_name, **kw_params):
+ for region in regions():
+ if region.name == region_name:
+ return region.connect(**kw_params)
+ return None
Oops, something went wrong.

0 comments on commit 1aa1133

Please sign in to comment.