Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'release-2.24.0'

  • Loading branch information...
commit 4d4746e665071f8247902bb7c7cd1585e6213c3f 2 parents 5b3d205 + 4b31729
@danielgtaylor danielgtaylor authored
Showing with 1,454 additions and 696 deletions.
  1. +1 −0  MANIFEST.in
  2. +2 −2 README.rst
  3. +5 −4 bin/elbadmin
  4. +2 −1  boto/__init__.py
  5. +7 −0 boto/auth.py
  6. +5 −26 boto/beanstalk/__init__.py
  7. +2 −2 boto/beanstalk/layer1.py
  8. +6 −19 boto/cloudformation/__init__.py
  9. +4 −2 boto/cloudformation/connection.py
  10. +3 −2 boto/cloudfront/__init__.py
  11. +5 −18 boto/cloudsearch/__init__.py
  12. +3 −2 boto/cloudsearch/layer1.py
  13. +2 −9 boto/cloudtrail/__init__.py
  14. +16 −6 boto/connection.py
  15. +2 −27 boto/directconnect/__init__.py
  16. +2 −32 boto/dynamodb/__init__.py
  17. +3 −2 boto/dynamodb/layer1.py
  18. +4 −2 boto/dynamodb/layer2.py
  19. +2 −32 boto/dynamodb2/__init__.py
  20. +9 −0 boto/dynamodb2/results.py
  21. +1 −1  boto/dynamodb2/table.py
  22. +3 −20 boto/ec2/__init__.py
  23. +6 −22 boto/ec2/autoscale/__init__.py
  24. +6 −22 boto/ec2/cloudwatch/__init__.py
  25. +9 −4 boto/ec2/connection.py
  26. +6 −22 boto/ec2/elb/__init__.py
  27. +2 −0  boto/ec2/image.py
  28. +2 −1  boto/ec2/regioninfo.py
  29. +5 −2 boto/ecs/__init__.py
  30. +2 −29 boto/elasticache/__init__.py
  31. +5 −22 boto/elastictranscoder/__init__.py
  32. +2 −29 boto/emr/__init__.py
  33. +4 −3 boto/emr/connection.py
  34. +300 −0 boto/endpoints.json
  35. +23 −0 boto/fps/response.py
  36. +2 −23 boto/glacier/__init__.py
  37. +3 −2 boto/glacier/layer1.py
  38. +1 −1  boto/gs/bucketlistresultset.py
  39. +1 −1  boto/gs/connection.py
  40. +1 −1  boto/gs/user.py
  41. +18 −12 boto/iam/__init__.py
  42. +4 −3 boto/iam/connection.py
  43. +2 −6 boto/kinesis/__init__.py
  44. +5 −2 boto/mturk/connection.py
  45. +41 −0 boto/opsworks/__init__.py
  46. +14 −3 boto/provider.py
  47. +6 −6 boto/pyami/config.py
  48. +10 −23 boto/rds/__init__.py
  49. +2 −1  boto/rds/regioninfo.py
  50. +2 −22 boto/redshift/__init__.py
  51. +125 −0 boto/regioninfo.py
  52. +18 −6 boto/route53/__init__.py
  53. +4 −2 boto/route53/connection.py
  54. +6 −32 boto/s3/__init__.py
  55. +45 −5 boto/s3/bucket.py
  56. +24 −3 boto/s3/connection.py
  57. +35 −1 boto/s3/key.py
  58. +14 −9 boto/s3/lifecycle.py
  59. +5 −17 boto/sdb/__init__.py
  60. +4 −2 boto/sdb/connection.py
  61. +2 −1  boto/sdb/regioninfo.py
  62. +2 −4 boto/ses/__init__.py
  63. +3 −2 boto/ses/connection.py
  64. +2 −32 boto/sns/__init__.py
  65. +14 −7 boto/sns/connection.py
  66. +5 −21 boto/sqs/__init__.py
  67. +19 −3 boto/sqs/connection.py
  68. +2 −1  boto/sqs/regioninfo.py
  69. +2 −11 boto/sts/__init__.py
  70. +3 −2 boto/sts/connection.py
  71. +2 −8 boto/support/__init__.py
  72. +3 −15 boto/swf/__init__.py
  73. +2 −2 boto/swf/layer1.py
  74. +3 −12 boto/vpc/__init__.py
  75. +1 −1  docs/source/autoscale_tut.rst
  76. +22 −5 docs/source/boto_config_tut.rst
  77. +1 −1  docs/source/elb_tut.rst
  78. +36 −0 docs/source/releasenotes/v2.24.0.rst
  79. +18 −0 docs/source/s3_tut.rst
  80. +7 −6 docs/source/sqs_tut.rst
  81. +54 −0 scripts/rebuild_endpoints.py
  82. +4 −1 setup.py
  83. +20 −1 tests/integration/s3/test_bucket.py
  84. +3 −2 tests/integration/s3/test_connection.py
  85. +11 −0 tests/integration/s3/test_multipart.py
  86. +34 −0 tests/unit/__init__.py
  87. +46 −1 tests/unit/auth/test_sigv4.py
  88. +29 −1 tests/unit/dynamodb2/test_table.py
  89. +1 −1  tests/unit/ec2/test_blockdevicemapping.py
  90. +6 −3 tests/unit/emr/test_connection.py
  91. +24 −1 tests/unit/provider/test_provider.py
  92. +19 −0 tests/unit/s3/test_bucket.py
  93. +47 −1 tests/unit/s3/test_connection.py
  94. +3 −2 tests/unit/test_connection.py
  95. +5 −0 tests/unit/test_endpoints.json
  96. +146 −0 tests/unit/test_regioninfo.py
View
1  MANIFEST.in
@@ -3,6 +3,7 @@ include README.rst
include boto/file/README
include .gitignore
include pylintrc
+include boto/endpoints.json
include boto/pyami/copybot.cfg
include boto/services/sonofmmm.cfg
include boto/mturk/test/*.doctest
View
4 README.rst
@@ -1,9 +1,9 @@
####
boto
####
-boto 2.23.0
+boto 2.24.0
-Released: 10-January-2014
+Released: 29-January-2014
.. image:: https://travis-ci.org/boto/boto.png?branch=develop
:target: https://travis-ci.org/boto/boto
View
9 bin/elbadmin
@@ -108,18 +108,19 @@ def get(elb, name):
print
# Make map of all instance Id's to Name tags
+ import boto
if not options.region:
ec2 = boto.connect_ec2()
else:
- import boto.ec2.elb
ec2 = boto.ec2.connect_to_region(options.region)
instance_health = b.get_instance_health()
instances = [state.instance_id for state in instance_health]
- names = {}
- for i in ec2.get_only_instances(instances):
- names[i.id] = i.tags.get('Name', '')
+ names = dict((k,'') for k in instances)
+ for i in ec2.get_only_instances():
+ if i.id in instances:
+ names[i.id] = i.tags.get('Name', '')
name_column_width = max([4] + [len(v) for k,v in names.iteritems()]) + 2
View
3  boto/__init__.py
@@ -37,7 +37,7 @@
import urlparse
from boto.exception import InvalidUriError
-__version__ = '2.23.0'
+__version__ = '2.24.0'
Version = __version__ # for backware compatibility
# http://bugs.python.org/issue7980
@@ -58,6 +58,7 @@
GENERATION_RE = re.compile(r'(?P<versionless_uri_str>.+)'
r'#(?P<generation>[0-9]+)$')
VERSION_RE = re.compile('(?P<versionless_uri_str>.+)#(?P<version_id>.+)$')
+ENDPOINTS_PATH = os.path.join(os.path.dirname(__file__), 'endpoints.json')
def init_logging():
View
7 boto/auth.py
@@ -36,6 +36,7 @@
import datetime
from email.utils import formatdate
import hmac
+import os
import sys
import time
import urllib
@@ -903,6 +904,12 @@ def _wrapper(self):
def detect_potential_s3sigv4(func):
def _wrapper(self):
+ if os.environ.get('S3_USE_SIGV4', False):
+ return ['hmac-v4-s3']
+
+ if boto.config.get('s3', 'use-sigv4', False):
+ return ['hmac-v4-s3']
+
if hasattr(self, 'host'):
if '.cn-' in self.host:
return ['hmac-v4-s3']
View
31 boto/beanstalk/__init__.py
@@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions
def regions():
@@ -31,31 +31,10 @@ def regions():
:return: A list of :class:`boto.regioninfo.RegionInfo`
"""
import boto.beanstalk.layer1
- return [RegionInfo(name='us-east-1',
- endpoint='elasticbeanstalk.us-east-1.amazonaws.com',
- connection_cls=boto.beanstalk.layer1.Layer1),
- RegionInfo(name='us-west-1',
- endpoint='elasticbeanstalk.us-west-1.amazonaws.com',
- connection_cls=boto.beanstalk.layer1.Layer1),
- RegionInfo(name='us-west-2',
- endpoint='elasticbeanstalk.us-west-2.amazonaws.com',
- connection_cls=boto.beanstalk.layer1.Layer1),
- RegionInfo(name='ap-northeast-1',
- endpoint='elasticbeanstalk.ap-northeast-1.amazonaws.com',
- connection_cls=boto.beanstalk.layer1.Layer1),
- RegionInfo(name='ap-southeast-1',
- endpoint='elasticbeanstalk.ap-southeast-1.amazonaws.com',
- connection_cls=boto.beanstalk.layer1.Layer1),
- RegionInfo(name='ap-southeast-2',
- endpoint='elasticbeanstalk.ap-southeast-2.amazonaws.com',
- connection_cls=boto.beanstalk.layer1.Layer1),
- RegionInfo(name='eu-west-1',
- endpoint='elasticbeanstalk.eu-west-1.amazonaws.com',
- connection_cls=boto.beanstalk.layer1.Layer1),
- RegionInfo(name='sa-east-1',
- endpoint='elasticbeanstalk.sa-east-1.amazonaws.com',
- connection_cls=boto.beanstalk.layer1.Layer1),
- ]
+ return get_regions(
+ 'elasticbeanstalk',
+ connection_cls=boto.beanstalk.layer1.Layer1
+ )
def connect_to_region(region_name, **kw_params):
View
4 boto/beanstalk/layer1.py
@@ -40,7 +40,7 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
proxy=None, proxy_port=None,
proxy_user=None, proxy_pass=None, debug=0,
https_connection_factory=None, region=None, path='/',
- api_version=None, security_token=None):
+ api_version=None, security_token=None, profile_name=None):
if not region:
region = RegionInfo(self, self.DefaultRegionName,
self.DefaultRegionEndpoint)
@@ -51,7 +51,7 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
proxy_user, proxy_pass,
self.region.endpoint, debug,
https_connection_factory, path,
- security_token)
+ security_token, profile_name=profile_name)
def _required_auth_capability(self):
return ['hmac-v4']
View
25 boto/cloudformation/__init__.py
@@ -21,19 +21,9 @@
# IN THE SOFTWARE.
from connection import CloudFormationConnection
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions, load_regions
-RegionData = {
- 'us-east-1': 'cloudformation.us-east-1.amazonaws.com',
- 'us-west-1': 'cloudformation.us-west-1.amazonaws.com',
- 'us-west-2': 'cloudformation.us-west-2.amazonaws.com',
- 'sa-east-1': 'cloudformation.sa-east-1.amazonaws.com',
- 'eu-west-1': 'cloudformation.eu-west-1.amazonaws.com',
- 'ap-northeast-1': 'cloudformation.ap-northeast-1.amazonaws.com',
- 'ap-southeast-1': 'cloudformation.ap-southeast-1.amazonaws.com',
- 'ap-southeast-2': 'cloudformation.ap-southeast-2.amazonaws.com',
- 'cn-north-1': 'cloudformation.cn-north-1.amazonaws.com.cn',
-}
+RegionData = load_regions().get('cloudformation')
def regions():
@@ -43,13 +33,10 @@ def regions():
:rtype: list
:return: A list of :class:`boto.RegionInfo` instances
"""
- regions = []
- for region_name in RegionData:
- region = RegionInfo(name=region_name,
- endpoint=RegionData[region_name],
- connection_cls=CloudFormationConnection)
- regions.append(region)
- return regions
+ return get_regions(
+ 'cloudformation',
+ connection_cls=CloudFormationConnection
+ )
def connect_to_region(region_name, **kw_params):
View
6 boto/cloudformation/connection.py
@@ -52,7 +52,8 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
is_secure=True, port=None, proxy=None, proxy_port=None,
proxy_user=None, proxy_pass=None, debug=0,
https_connection_factory=None, region=None, path='/',
- converter=None, security_token=None, validate_certs=True):
+ converter=None, security_token=None, validate_certs=True,
+ profile_name=None):
if not region:
region = RegionInfo(self, self.DefaultRegionName,
self.DefaultRegionEndpoint, CloudFormationConnection)
@@ -64,7 +65,8 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
self.region.endpoint, debug,
https_connection_factory, path,
security_token,
- validate_certs=validate_certs)
+ validate_certs=validate_certs,
+ profile_name=profile_name)
def _required_auth_capability(self):
return ['hmac-v4']
View
5 boto/cloudfront/__init__.py
@@ -43,12 +43,13 @@ class CloudFrontConnection(AWSAuthConnection):
def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
port=None, proxy=None, proxy_port=None,
host=DefaultHost, debug=0, security_token=None,
- validate_certs=True):
+ validate_certs=True, profile_name=None):
super(CloudFrontConnection, self).__init__(host,
aws_access_key_id, aws_secret_access_key,
True, port, proxy, proxy_port, debug=debug,
security_token=security_token,
- validate_certs=validate_certs)
+ validate_certs=validate_certs,
+ profile_name=profile_name)
def get_etag(self, response):
response_headers = response.msg
View
23 boto/cloudsearch/__init__.py
@@ -21,7 +21,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions
def regions():
@@ -32,23 +32,10 @@ def regions():
: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),
- RegionInfo(name='eu-west-1',
- endpoint='cloudsearch.eu-west-1.amazonaws.com',
- connection_cls=boto.cloudsearch.layer1.Layer1),
- RegionInfo(name='us-west-1',
- endpoint='cloudsearch.us-west-1.amazonaws.com',
- connection_cls=boto.cloudsearch.layer1.Layer1),
- RegionInfo(name='us-west-2',
- endpoint='cloudsearch.us-west-2.amazonaws.com',
- connection_cls=boto.cloudsearch.layer1.Layer1),
- RegionInfo(name='ap-southeast-1',
- endpoint='cloudsearch.ap-southeast-1.amazonaws.com',
- connection_cls=boto.cloudsearch.layer1.Layer1),
-
- ]
+ return get_regions(
+ 'cloudsearch',
+ connection_cls=boto.cloudsearch.layer1.Layer1
+ )
def connect_to_region(region_name, **kw_params):
View
5 boto/cloudsearch/layer1.py
@@ -46,7 +46,7 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
proxy_user=None, proxy_pass=None, debug=0,
https_connection_factory=None, region=None, path='/',
api_version=None, security_token=None,
- validate_certs=True):
+ validate_certs=True, profile_name=None):
if not region:
region = RegionInfo(self, self.DefaultRegionName,
self.DefaultRegionEndpoint)
@@ -66,7 +66,8 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
https_connection_factory=https_connection_factory,
path=path,
security_token=security_token,
- validate_certs=validate_certs)
+ validate_certs=validate_certs,
+ profile_name=profile_name)
def _required_auth_capability(self):
return ['hmac-v4']
View
11 boto/cloudtrail/__init__.py
@@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions
def regions():
@@ -31,14 +31,7 @@ def regions():
:return: A list of :class:`boto.regioninfo.RegionInfo`
"""
from boto.cloudtrail.layer1 import CloudTrailConnection
-
- return [RegionInfo(name='us-east-1',
- endpoint='cloudtrail.us-east-1.amazonaws.com',
- connection_cls=CloudTrailConnection),
- RegionInfo(name='us-west-2',
- endpoint='cloudtrail.us-west-2.amazonaws.com',
- connection_cls=CloudTrailConnection),
- ]
+ return get_regions('cloudtrail', connection_cls=CloudTrailConnection)
def connect_to_region(region_name, **kw_params):
View
22 boto/connection.py
@@ -423,7 +423,7 @@ def __init__(self, host, aws_access_key_id=None,
https_connection_factory=None, path='/',
provider='aws', security_token=None,
suppress_consec_slashes=True,
- validate_certs=True):
+ validate_certs=True, profile_name=None):
"""
:type host: str
:param host: The host to make the connection to
@@ -468,6 +468,10 @@ def __init__(self, host, aws_access_key_id=None,
:type validate_certs: bool
:param validate_certs: Controls whether SSL certificates
will be validated or not. Defaults to True.
+
+ :type profile_name: str
+ :param profile_name: Override usual Credentials section in config
+ file to use a named set of keys instead.
"""
self.suppress_consec_slashes = suppress_consec_slashes
self.num_retries = 6
@@ -546,7 +550,8 @@ def __init__(self, host, aws_access_key_id=None,
self.provider = Provider(self._provider_type,
aws_access_key_id,
aws_secret_access_key,
- security_token)
+ security_token,
+ profile_name)
# Allow config file to override default host, port, and host header.
if self.provider.host:
@@ -603,6 +608,10 @@ def aws_secret_access_key(self):
gs_secret_access_key = aws_secret_access_key
secret_key = aws_secret_access_key
+ def profile_name(self):
+ return self.provider.profile_name
+ profile_name = property(profile_name)
+
def get_path(self, path='/'):
# The default behavior is to suppress consecutive slashes for reasons
# discussed at
@@ -891,8 +900,8 @@ def _mexe(self, request, sender=None, override_num_retries=None,
# the port info. All others should be now be up to date and
# not include the port.
if 's3' not in self._required_auth_capability():
- self.set_host_header(request)
-
+ if not getattr(self, 'anon', False):
+ self.set_host_header(request)
if callable(sender):
response = sender(connection, request.method, request.path,
request.body, request.headers)
@@ -1037,14 +1046,15 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
is_secure=True, port=None, proxy=None, proxy_port=None,
proxy_user=None, proxy_pass=None, host=None, debug=0,
https_connection_factory=None, path='/', security_token=None,
- validate_certs=True):
+ validate_certs=True, profile_name=None):
super(AWSQueryConnection, self).__init__(host, aws_access_key_id,
aws_secret_access_key,
is_secure, port, proxy,
proxy_port, proxy_user, proxy_pass,
debug, https_connection_factory, path,
security_token=security_token,
- validate_certs=validate_certs)
+ validate_certs=validate_certs,
+ profile_name=profile_name)
def _required_auth_capability(self):
return []
View
29 boto/directconnect/__init__.py
@@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions
def regions():
@@ -31,32 +31,7 @@ def regions():
:return: A list of :class:`boto.regioninfo.RegionInfo`
"""
from boto.directconnect.layer1 import DirectConnectConnection
-
- return [RegionInfo(name='us-east-1',
- endpoint='directconnect.us-east-1.amazonaws.com',
- connection_cls=DirectConnectConnection),
- RegionInfo(name='us-west-1',
- endpoint='directconnect.us-west-1.amazonaws.com',
- connection_cls=DirectConnectConnection),
- RegionInfo(name='us-west-2',
- endpoint='directconnect.us-west-2.amazonaws.com',
- connection_cls=DirectConnectConnection),
- RegionInfo(name='eu-west-1',
- endpoint='directconnect.eu-west-1.amazonaws.com',
- connection_cls=DirectConnectConnection),
- RegionInfo(name='ap-southeast-1',
- endpoint='directconnect.ap-southeast-1.amazonaws.com',
- connection_cls=DirectConnectConnection),
- RegionInfo(name='ap-southeast-2',
- endpoint='directconnect.ap-southeast-2.amazonaws.com',
- connection_cls=DirectConnectConnection),
- RegionInfo(name='ap-southeast-3',
- endpoint='directconnect.ap-southeast-3.amazonaws.com',
- connection_cls=DirectConnectConnection),
- RegionInfo(name='sa-east-1',
- endpoint='directconnect.sa-east-1.amazonaws.com',
- connection_cls=DirectConnectConnection),
- ]
+ return get_regions('directconnect', connection_cls=DirectConnectConnection)
def connect_to_region(region_name, **kw_params):
View
34 boto/dynamodb/__init__.py
@@ -21,7 +21,7 @@
# IN THE SOFTWARE.
#
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions
def regions():
@@ -32,37 +32,7 @@ def regions():
:return: A list of :class:`boto.regioninfo.RegionInfo`
"""
import boto.dynamodb.layer2
- return [RegionInfo(name='us-east-1',
- endpoint='dynamodb.us-east-1.amazonaws.com',
- connection_cls=boto.dynamodb.layer2.Layer2),
- RegionInfo(name='us-gov-west-1',
- endpoint='dynamodb.us-gov-west-1.amazonaws.com',
- connection_cls=boto.dynamodb.layer2.Layer2),
- RegionInfo(name='us-west-1',
- endpoint='dynamodb.us-west-1.amazonaws.com',
- connection_cls=boto.dynamodb.layer2.Layer2),
- RegionInfo(name='us-west-2',
- endpoint='dynamodb.us-west-2.amazonaws.com',
- connection_cls=boto.dynamodb.layer2.Layer2),
- RegionInfo(name='ap-northeast-1',
- endpoint='dynamodb.ap-northeast-1.amazonaws.com',
- connection_cls=boto.dynamodb.layer2.Layer2),
- RegionInfo(name='ap-southeast-1',
- endpoint='dynamodb.ap-southeast-1.amazonaws.com',
- connection_cls=boto.dynamodb.layer2.Layer2),
- RegionInfo(name='ap-southeast-2',
- endpoint='dynamodb.ap-southeast-2.amazonaws.com',
- connection_cls=boto.dynamodb.layer2.Layer2),
- RegionInfo(name='eu-west-1',
- endpoint='dynamodb.eu-west-1.amazonaws.com',
- connection_cls=boto.dynamodb.layer2.Layer2),
- RegionInfo(name='sa-east-1',
- endpoint='dynamodb.sa-east-1.amazonaws.com',
- connection_cls=boto.dynamodb.layer2.Layer2),
- RegionInfo(name='cn-north-1',
- endpoint='dynamodb.cn-north-1.amazonaws.com.cn',
- connection_cls=boto.dynamodb.layer2.Layer2),
- ]
+ return get_regions('dynamodb', connection_cls=boto.dynamodb.layer2.Layer2)
def connect_to_region(region_name, **kw_params):
View
5 boto/dynamodb/layer1.py
@@ -74,7 +74,7 @@ class Layer1(AWSAuthConnection):
def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
is_secure=True, port=None, proxy=None, proxy_port=None,
debug=0, security_token=None, region=None,
- validate_certs=True, validate_checksums=True):
+ validate_certs=True, validate_checksums=True, profile_name=None):
if not region:
region_name = boto.config.get('DynamoDB', 'region',
self.DefaultRegionName)
@@ -89,7 +89,8 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
aws_secret_access_key,
is_secure, port, proxy, proxy_port,
debug=debug, security_token=security_token,
- validate_certs=validate_certs)
+ validate_certs=validate_certs,
+ profile_name=profile_name)
self.throughput_exceeded_events = 0
self._validate_checksums = boto.config.getbool(
'DynamoDB', 'validate_checksums', validate_checksums)
View
6 boto/dynamodb/layer2.py
@@ -145,11 +145,13 @@ class Layer2(object):
def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
is_secure=True, port=None, proxy=None, proxy_port=None,
debug=0, security_token=None, region=None,
- validate_certs=True, dynamizer=LossyFloatDynamizer):
+ validate_certs=True, dynamizer=LossyFloatDynamizer,
+ profile_name=None):
self.layer1 = Layer1(aws_access_key_id, aws_secret_access_key,
is_secure, port, proxy, proxy_port,
debug, security_token, region,
- validate_certs=validate_certs)
+ validate_certs=validate_certs,
+ profile_name=profile_name)
self.dynamizer = dynamizer()
def use_decimals(self):
View
34 boto/dynamodb2/__init__.py
@@ -21,7 +21,7 @@
# IN THE SOFTWARE.
#
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions
def regions():
@@ -32,37 +32,7 @@ def regions():
:return: A list of :class:`boto.regioninfo.RegionInfo`
"""
from boto.dynamodb2.layer1 import DynamoDBConnection
- return [RegionInfo(name='us-east-1',
- endpoint='dynamodb.us-east-1.amazonaws.com',
- connection_cls=DynamoDBConnection),
- RegionInfo(name='us-gov-west-1',
- endpoint='dynamodb.us-gov-west-1.amazonaws.com',
- connection_cls=DynamoDBConnection),
- RegionInfo(name='us-west-1',
- endpoint='dynamodb.us-west-1.amazonaws.com',
- connection_cls=DynamoDBConnection),
- RegionInfo(name='us-west-2',
- endpoint='dynamodb.us-west-2.amazonaws.com',
- connection_cls=DynamoDBConnection),
- RegionInfo(name='eu-west-1',
- endpoint='dynamodb.eu-west-1.amazonaws.com',
- connection_cls=DynamoDBConnection),
- RegionInfo(name='ap-northeast-1',
- endpoint='dynamodb.ap-northeast-1.amazonaws.com',
- connection_cls=DynamoDBConnection),
- RegionInfo(name='ap-southeast-1',
- endpoint='dynamodb.ap-southeast-1.amazonaws.com',
- connection_cls=DynamoDBConnection),
- RegionInfo(name='ap-southeast-2',
- endpoint='dynamodb.ap-southeast-2.amazonaws.com',
- connection_cls=DynamoDBConnection),
- RegionInfo(name='sa-east-1',
- endpoint='dynamodb.sa-east-1.amazonaws.com',
- connection_cls=DynamoDBConnection),
- RegionInfo(name='cn-north-1',
- endpoint='dynamodb.cn-north-1.amazonaws.com.cn',
- connection_cls=DynamoDBConnection),
- ]
+ return get_regions('dynamodb', connection_cls=DynamoDBConnection)
def connect_to_region(region_name, **kw_params):
View
9 boto/dynamodb2/results.py
@@ -128,9 +128,18 @@ def fetch_more(self):
if self._last_key_seen is not None:
kwargs[self.first_key] = self._last_key_seen
+ # If the page size is greater than limit set them
+ # to the same value
+ if self._limit and self._max_page_size > self._limit:
+ self._max_page_size = self._limit
+
# Put in the max page size.
if self._max_page_size is not None:
kwargs['limit'] = self._max_page_size
+ elif self._limit is not None:
+ # If max_page_size is not set and limit is available
+ # use it as the page size
+ kwargs['limit'] = self._limit
results = self.the_callable(*args, **kwargs)
self._fetches += 1
View
2  boto/dynamodb2/table.py
@@ -170,7 +170,7 @@ def create(cls, table_name, schema, throughput=None, indexes=None,
... ],
... throughput={
... 'read':10,
- ... 'write":10,
+ ... 'write':10,
... }),
... ])
View
23 boto/ec2/__init__.py
@@ -24,21 +24,10 @@
service from AWS.
"""
from boto.ec2.connection import EC2Connection
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions, load_regions
-RegionData = {
- 'us-east-1': 'ec2.us-east-1.amazonaws.com',
- 'us-gov-west-1': 'ec2.us-gov-west-1.amazonaws.com',
- 'us-west-1': 'ec2.us-west-1.amazonaws.com',
- 'us-west-2': 'ec2.us-west-2.amazonaws.com',
- 'sa-east-1': 'ec2.sa-east-1.amazonaws.com',
- 'eu-west-1': 'ec2.eu-west-1.amazonaws.com',
- 'ap-northeast-1': 'ec2.ap-northeast-1.amazonaws.com',
- 'ap-southeast-1': 'ec2.ap-southeast-1.amazonaws.com',
- 'ap-southeast-2': 'ec2.ap-southeast-2.amazonaws.com',
- 'cn-north-1': 'ec2.cn-north-1.amazonaws.com.cn',
-}
+RegionData = load_regions().get('ec2', {})
def regions(**kw_params):
@@ -51,13 +40,7 @@ def regions(**kw_params):
:rtype: list
:return: A list of :class:`boto.ec2.regioninfo.RegionInfo`
"""
- regions = []
- for region_name in RegionData:
- region = RegionInfo(name=region_name,
- endpoint=RegionData[region_name],
- connection_cls=EC2Connection)
- regions.append(region)
- return regions
+ return get_regions('ec2', connection_cls=EC2Connection)
def connect_to_region(region_name, **kw_params):
View
28 boto/ec2/autoscale/__init__.py
@@ -31,7 +31,7 @@
import boto
from boto.connection import AWSQueryConnection
-from boto.ec2.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions, load_regions
from boto.ec2.autoscale.request import Request
from boto.ec2.autoscale.launchconfig import LaunchConfiguration
from boto.ec2.autoscale.group import AutoScalingGroup
@@ -46,18 +46,7 @@
from boto.ec2.autoscale.tag import Tag
from boto.ec2.autoscale.limits import AccountLimits
-RegionData = {
- 'us-east-1': 'autoscaling.us-east-1.amazonaws.com',
- 'us-gov-west-1': 'autoscaling.us-gov-west-1.amazonaws.com',
- 'us-west-1': 'autoscaling.us-west-1.amazonaws.com',
- 'us-west-2': 'autoscaling.us-west-2.amazonaws.com',
- 'sa-east-1': 'autoscaling.sa-east-1.amazonaws.com',
- 'eu-west-1': 'autoscaling.eu-west-1.amazonaws.com',
- 'ap-northeast-1': 'autoscaling.ap-northeast-1.amazonaws.com',
- 'ap-southeast-1': 'autoscaling.ap-southeast-1.amazonaws.com',
- 'ap-southeast-2': 'autoscaling.ap-southeast-2.amazonaws.com',
- 'cn-north-1': 'autoscaling.cn-north-1.amazonaws.com.cn',
-}
+RegionData = load_regions().get('autoscaling', {})
def regions():
@@ -67,13 +56,7 @@ def regions():
:rtype: list
:return: A list of :class:`boto.RegionInfo` instances
"""
- regions = []
- for region_name in RegionData:
- region = RegionInfo(name=region_name,
- endpoint=RegionData[region_name],
- connection_cls=AutoScaleConnection)
- regions.append(region)
- return regions
+ return get_regions('autoscaling', connection_cls=AutoScaleConnection)
def connect_to_region(region_name, **kw_params):
@@ -104,7 +87,7 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
is_secure=True, port=None, proxy=None, proxy_port=None,
proxy_user=None, proxy_pass=None, debug=0,
https_connection_factory=None, region=None, path='/',
- security_token=None, validate_certs=True):
+ security_token=None, validate_certs=True, profile_name=None):
"""
Init method to create a new connection to the AutoScaling service.
@@ -123,7 +106,8 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
self.region.endpoint, debug,
https_connection_factory, path=path,
security_token=security_token,
- validate_certs=validate_certs)
+ validate_certs=validate_certs,
+ profile_name=profile_name)
def _required_auth_capability(self):
return ['hmac-v4']
View
28 boto/ec2/cloudwatch/__init__.py
@@ -28,21 +28,10 @@
from boto.ec2.cloudwatch.metric import Metric
from boto.ec2.cloudwatch.alarm import MetricAlarm, MetricAlarms, AlarmHistoryItem
from boto.ec2.cloudwatch.datapoint import Datapoint
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions, load_regions
import boto
-RegionData = {
- 'us-east-1': 'monitoring.us-east-1.amazonaws.com',
- 'us-gov-west-1': 'monitoring.us-gov-west-1.amazonaws.com',
- 'us-west-1': 'monitoring.us-west-1.amazonaws.com',
- 'us-west-2': 'monitoring.us-west-2.amazonaws.com',
- 'sa-east-1': 'monitoring.sa-east-1.amazonaws.com',
- 'eu-west-1': 'monitoring.eu-west-1.amazonaws.com',
- 'ap-northeast-1': 'monitoring.ap-northeast-1.amazonaws.com',
- 'ap-southeast-1': 'monitoring.ap-southeast-1.amazonaws.com',
- 'ap-southeast-2': 'monitoring.ap-southeast-2.amazonaws.com',
- 'cn-north-1': 'monitoring.cn-north-1.amazonaws.com.cn',
-}
+RegionData = load_regions().get('cloudwatch', {})
def regions():
@@ -52,13 +41,7 @@ def regions():
:rtype: list
:return: A list of :class:`boto.RegionInfo` instances
"""
- regions = []
- for region_name in RegionData:
- region = RegionInfo(name=region_name,
- endpoint=RegionData[region_name],
- connection_cls=CloudWatchConnection)
- regions.append(region)
- return regions
+ return get_regions('cloudwatch', connection_cls=CloudWatchConnection)
def connect_to_region(region_name, **kw_params):
@@ -91,7 +74,7 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
is_secure=True, port=None, proxy=None, proxy_port=None,
proxy_user=None, proxy_pass=None, debug=0,
https_connection_factory=None, region=None, path='/',
- security_token=None, validate_certs=True):
+ security_token=None, validate_certs=True, profile_name=None):
"""
Init method to create a new connection to EC2 Monitoring Service.
@@ -115,7 +98,8 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
self.region.endpoint, debug,
https_connection_factory, path,
security_token,
- validate_certs=validate_certs)
+ validate_certs=validate_certs,
+ profile_name=profile_name)
def _required_auth_capability(self):
return ['hmac-v4']
View
13 boto/ec2/connection.py
@@ -83,7 +83,7 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
proxy_user=None, proxy_pass=None, debug=0,
https_connection_factory=None, region=None, path='/',
api_version=None, security_token=None,
- validate_certs=True):
+ validate_certs=True, profile_name=None):
"""
Init method to create a new connection to EC2.
"""
@@ -98,7 +98,8 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
self.region.endpoint, debug,
https_connection_factory, path,
security_token,
- validate_certs=validate_certs)
+ validate_certs=validate_certs,
+ profile_name=profile_name)
if api_version:
self.APIVersion = api_version
@@ -734,8 +735,8 @@ def run_instances(self, image_id, min_count=1, max_count=1,
launch instances.
:type security_groups: list of strings
- :param security_groups: The names of the security groups with which to
- associate instances.
+ :param security_groups: The names of the EC2 classic security groups
+ with which to associate instances
:type user_data: string
:param user_data: The Base64-encoded MIME user data to be made
@@ -749,6 +750,8 @@ def run_instances(self, image_id, min_count=1, max_count=1,
* m1.medium
* m1.large
* m1.xlarge
+ * m3.medium
+ * m3.large
* m3.xlarge
* m3.2xlarge
* c1.medium
@@ -1442,6 +1445,8 @@ def request_spot_instances(self, price, image_id, count=1, type='one-time',
* m1.medium
* m1.large
* m1.xlarge
+ * m3.medium
+ * m3.large
* m3.xlarge
* m3.2xlarge
* c1.medium
View
28 boto/ec2/elb/__init__.py
@@ -31,21 +31,10 @@
from boto.ec2.elb.instancestate import InstanceState
from boto.ec2.elb.healthcheck import HealthCheck
from boto.ec2.elb.listelement import ListElement
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions, load_regions
import boto
-RegionData = {
- 'us-east-1': 'elasticloadbalancing.us-east-1.amazonaws.com',
- 'us-gov-west-1': 'elasticloadbalancing.us-gov-west-1.amazonaws.com',
- 'us-west-1': 'elasticloadbalancing.us-west-1.amazonaws.com',
- 'us-west-2': 'elasticloadbalancing.us-west-2.amazonaws.com',
- 'sa-east-1': 'elasticloadbalancing.sa-east-1.amazonaws.com',
- 'eu-west-1': 'elasticloadbalancing.eu-west-1.amazonaws.com',
- 'ap-northeast-1': 'elasticloadbalancing.ap-northeast-1.amazonaws.com',
- 'ap-southeast-1': 'elasticloadbalancing.ap-southeast-1.amazonaws.com',
- 'ap-southeast-2': 'elasticloadbalancing.ap-southeast-2.amazonaws.com',
- 'cn-north-1': 'elasticloadbalancing.cn-north-1.amazonaws.com.cn',
-}
+RegionData = load_regions().get('elasticloadbalancing', {})
def regions():
@@ -55,13 +44,7 @@ def regions():
:rtype: list
:return: A list of :class:`boto.RegionInfo` instances
"""
- regions = []
- for region_name in RegionData:
- region = RegionInfo(name=region_name,
- endpoint=RegionData[region_name],
- connection_cls=ELBConnection)
- regions.append(region)
- return regions
+ return get_regions('elasticloadbalancing', connection_cls=ELBConnection)
def connect_to_region(region_name, **kw_params):
@@ -92,7 +75,7 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
is_secure=True, port=None, proxy=None, proxy_port=None,
proxy_user=None, proxy_pass=None, debug=0,
https_connection_factory=None, region=None, path='/',
- security_token=None, validate_certs=True):
+ security_token=None, validate_certs=True, profile_name=None):
"""
Init method to create a new connection to EC2 Load Balancing Service.
@@ -110,7 +93,8 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
self.region.endpoint, debug,
https_connection_factory, path,
security_token,
- validate_certs=validate_certs)
+ validate_certs=validate_certs,
+ profile_name=profile_name)
def _required_auth_capability(self):
return ['ec2']
View
2  boto/ec2/image.py
@@ -208,6 +208,8 @@ def run(self, min_count=1, max_count=1, key_name=None,
* m1.medium
* m1.large
* m1.xlarge
+ * m3.medium
+ * m3.large
* m3.xlarge
* m3.2xlarge
* c1.medium
View
3  boto/ec2/regioninfo.py
@@ -28,7 +28,8 @@ class EC2RegionInfo(RegionInfo):
Represents an EC2 Region
"""
- def __init__(self, connection=None, name=None, endpoint=None):
+ def __init__(self, connection=None, name=None, endpoint=None,
+ connection_cls=None):
from boto.ec2.connection import EC2Connection
super(EC2RegionInfo, self).__init__(connection, name, endpoint,
EC2Connection)
View
7 boto/ecs/__init__.py
@@ -41,10 +41,13 @@ class ECSConnection(AWSQueryConnection):
def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
is_secure=True, port=None, proxy=None, proxy_port=None,
proxy_user=None, proxy_pass=None, host='ecs.amazonaws.com',
- debug=0, https_connection_factory=None, path='/'):
+ debug=0, https_connection_factory=None, path='/',
+ security_token=None, profile_name=None):
super(ECSConnection, self).__init__(aws_access_key_id, aws_secret_access_key,
is_secure, port, proxy, proxy_port, proxy_user, proxy_pass,
- host, debug, https_connection_factory, path)
+ host, debug, https_connection_factory, path,
+ security_token=security_token,
+ profile_name=profile_name)
def _required_auth_capability(self):
return ['ecs']
View
31 boto/elasticache/__init__.py
@@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions
def regions():
@@ -31,34 +31,7 @@ def regions():
:return: A list of :class:`boto.regioninfo.RegionInfo`
"""
from boto.elasticache.layer1 import ElastiCacheConnection
- return [RegionInfo(name='us-east-1',
- endpoint='elasticache.us-east-1.amazonaws.com',
- connection_cls=ElastiCacheConnection),
- RegionInfo(name='us-west-1',
- endpoint='elasticache.us-west-1.amazonaws.com',
- connection_cls=ElastiCacheConnection),
- RegionInfo(name='us-west-2',
- endpoint='elasticache.us-west-2.amazonaws.com',
- connection_cls=ElastiCacheConnection),
- RegionInfo(name='eu-west-1',
- endpoint='elasticache.eu-west-1.amazonaws.com',
- connection_cls=ElastiCacheConnection),
- RegionInfo(name='ap-northeast-1',
- endpoint='elasticache.ap-northeast-1.amazonaws.com',
- connection_cls=ElastiCacheConnection),
- RegionInfo(name='ap-southeast-1',
- endpoint='elasticache.ap-southeast-1.amazonaws.com',
- connection_cls=ElastiCacheConnection),
- RegionInfo(name='ap-southeast-2',
- endpoint='elasticache.ap-southeast-2.amazonaws.com',
- connection_cls=ElastiCacheConnection),
- RegionInfo(name='sa-east-1',
- endpoint='elasticache.sa-east-1.amazonaws.com',
- connection_cls=ElastiCacheConnection),
- RegionInfo(name='cn-north-1',
- endpoint='elasticache.cn-north-1.amazonaws.com.cn',
- connection_cls=ElastiCacheConnection),
- ]
+ return get_regions('elasticache', connection_cls=ElastiCacheConnection)
def connect_to_region(region_name, **kw_params):
View
27 boto/elastictranscoder/__init__.py
@@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions
def regions():
@@ -31,27 +31,10 @@ def regions():
:return: A list of :class:`boto.regioninfo.RegionInfo`
"""
from boto.elastictranscoder.layer1 import ElasticTranscoderConnection
- cls = ElasticTranscoderConnection
- return [
- RegionInfo(name='us-east-1',
- endpoint='elastictranscoder.us-east-1.amazonaws.com',
- connection_cls=cls),
- RegionInfo(name='us-west-1',
- endpoint='elastictranscoder.us-west-1.amazonaws.com',
- connection_cls=cls),
- RegionInfo(name='us-west-2',
- endpoint='elastictranscoder.us-west-2.amazonaws.com',
- connection_cls=cls),
- RegionInfo(name='ap-northeast-1',
- endpoint='elastictranscoder.ap-northeast-1.amazonaws.com',
- connection_cls=cls),
- RegionInfo(name='ap-southeast-1',
- endpoint='elastictranscoder.ap-southeast-1.amazonaws.com',
- connection_cls=cls),
- RegionInfo(name='eu-west-1',
- endpoint='elastictranscoder.eu-west-1.amazonaws.com',
- connection_cls=cls),
- ]
+ return get_regions(
+ 'elastictranscoder',
+ connection_cls=ElasticTranscoderConnection
+ )
def connect_to_region(region_name, **kw_params):
View
31 boto/emr/__init__.py
@@ -29,7 +29,7 @@
from connection import EmrConnection
from step import Step, StreamingStep, JarStep
from bootstrap_action import BootstrapAction
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions
def regions():
@@ -39,34 +39,7 @@ def regions():
:rtype: list
:return: A list of :class:`boto.regioninfo.RegionInfo`
"""
- return [RegionInfo(name='us-east-1',
- endpoint='elasticmapreduce.us-east-1.amazonaws.com',
- connection_cls=EmrConnection),
- RegionInfo(name='us-west-1',
- endpoint='us-west-1.elasticmapreduce.amazonaws.com',
- connection_cls=EmrConnection),
- RegionInfo(name='us-west-2',
- endpoint='us-west-2.elasticmapreduce.amazonaws.com',
- connection_cls=EmrConnection),
- RegionInfo(name='ap-northeast-1',
- endpoint='ap-northeast-1.elasticmapreduce.amazonaws.com',
- connection_cls=EmrConnection),
- RegionInfo(name='ap-southeast-1',
- endpoint='ap-southeast-1.elasticmapreduce.amazonaws.com',
- connection_cls=EmrConnection),
- RegionInfo(name='ap-southeast-2',
- endpoint='ap-southeast-2.elasticmapreduce.amazonaws.com',
- connection_cls=EmrConnection),
- RegionInfo(name='eu-west-1',
- endpoint='eu-west-1.elasticmapreduce.amazonaws.com',
- connection_cls=EmrConnection),
- RegionInfo(name='sa-east-1',
- endpoint='sa-east-1.elasticmapreduce.amazonaws.com',
- connection_cls=EmrConnection),
- RegionInfo(name='cn-north-1',
- endpoint='elasticmapreduce.cn-north-1.amazonaws.com.cn',
- connection_cls=EmrConnection),
- ]
+ return get_regions('elasticmapreduce', connection_cls=EmrConnection)
def connect_to_region(region_name, **kw_params):
View
7 boto/emr/connection.py
@@ -55,7 +55,7 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
is_secure=True, port=None, proxy=None, proxy_port=None,
proxy_user=None, proxy_pass=None, debug=0,
https_connection_factory=None, region=None, path='/',
- security_token=None, validate_certs=True):
+ security_token=None, validate_certs=True, profile_name=None):
if not region:
region = RegionInfo(self, self.DefaultRegionName,
self.DefaultRegionEndpoint)
@@ -67,7 +67,8 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
self.region.endpoint, debug,
https_connection_factory, path,
security_token,
- validate_certs=validate_certs)
+ validate_certs=validate_certs,
+ profile_name=profile_name)
# Many of the EMR hostnames are of the form:
# <region>.<service_name>.amazonaws.com
# rather than the more common:
@@ -265,7 +266,7 @@ def list_steps(self, cluster_id, step_states=None, marker=None):
if step_states:
self.build_list_params(params, step_states, 'StepStateList.member')
- self.get_object('ListSteps', params, StepSummaryList)
+ return self.get_object('ListSteps', params, StepSummaryList)
def add_tags(self, resource_id, tags):
"""
View
300 boto/endpoints.json
@@ -0,0 +1,300 @@
+{
+ "autoscaling": {
+ "ap-northeast-1": "autoscaling.ap-northeast-1.amazonaws.com",
+ "ap-southeast-1": "autoscaling.ap-southeast-1.amazonaws.com",
+ "ap-southeast-2": "autoscaling.ap-southeast-2.amazonaws.com",
+ "cn-north-1": "autoscaling.cn-north-1.amazonaws.com.cn",
+ "eu-west-1": "autoscaling.eu-west-1.amazonaws.com",
+ "sa-east-1": "autoscaling.sa-east-1.amazonaws.com",
+ "us-east-1": "autoscaling.us-east-1.amazonaws.com",
+ "us-gov-west-1": "autoscaling.us-gov-west-1.amazonaws.com",
+ "us-west-1": "autoscaling.us-west-1.amazonaws.com",
+ "us-west-2": "autoscaling.us-west-2.amazonaws.com"
+ },
+ "cloudformation": {
+ "ap-northeast-1": "cloudformation.ap-northeast-1.amazonaws.com",
+ "ap-southeast-1": "cloudformation.ap-southeast-1.amazonaws.com",
+ "ap-southeast-2": "cloudformation.ap-southeast-2.amazonaws.com",
+ "cn-north-1": "cloudformation.cn-north-1.amazonaws.com.cn",
+ "eu-west-1": "cloudformation.eu-west-1.amazonaws.com",
+ "sa-east-1": "cloudformation.sa-east-1.amazonaws.com",
+ "us-east-1": "cloudformation.us-east-1.amazonaws.com",
+ "us-west-1": "cloudformation.us-west-1.amazonaws.com",
+ "us-west-2": "cloudformation.us-west-2.amazonaws.com"
+ },
+ "cloudfront": {
+ "ap-northeast-1": "cloudfront.amazonaws.com",
+ "ap-southeast-1": "cloudfront.amazonaws.com",
+ "ap-southeast-2": "cloudfront.amazonaws.com",
+ "eu-west-1": "cloudfront.amazonaws.com",
+ "sa-east-1": "cloudfront.amazonaws.com",
+ "us-east-1": "cloudfront.amazonaws.com",
+ "us-west-1": "cloudfront.amazonaws.com",
+ "us-west-2": "cloudfront.amazonaws.com"
+ },
+ "cloudsearch": {
+ "ap-southeast-1": "cloudsearch.ap-southeast-1.amazonaws.com",
+ "eu-west-1": "cloudsearch.eu-west-1.amazonaws.com",
+ "us-east-1": "cloudsearch.us-east-1.amazonaws.com",
+ "us-west-1": "cloudsearch.us-west-1.amazonaws.com",
+ "us-west-2": "cloudsearch.us-west-2.amazonaws.com"
+ },
+ "cloudtrail": {
+ "us-east-1": "cloudtrail.us-east-1.amazonaws.com",
+ "us-west-2": "cloudtrail.us-west-2.amazonaws.com"
+ },
+ "cloudwatch": {
+ "ap-northeast-1": "monitoring.ap-northeast-1.amazonaws.com",
+ "ap-southeast-1": "monitoring.ap-southeast-1.amazonaws.com",
+ "ap-southeast-2": "monitoring.ap-southeast-2.amazonaws.com",
+ "cn-north-1": "monitoring.cn-north-1.amazonaws.com.cn",
+ "eu-west-1": "monitoring.eu-west-1.amazonaws.com",
+ "sa-east-1": "monitoring.sa-east-1.amazonaws.com",
+ "us-east-1": "monitoring.us-east-1.amazonaws.com",
+ "us-gov-west-1": "monitoring.us-gov-west-1.amazonaws.com",
+ "us-west-1": "monitoring.us-west-1.amazonaws.com",
+ "us-west-2": "monitoring.us-west-2.amazonaws.com"
+ },
+ "datapipeline": {
+ "us-east-1": "datapipeline.us-east-1.amazonaws.com"
+ },
+ "directconnect": {
+ "ap-northeast-1": "directconnect.ap-northeast-1.amazonaws.com",
+ "ap-southeast-1": "directconnect.ap-southeast-1.amazonaws.com",
+ "ap-southeast-2": "directconnect.ap-southeast-2.amazonaws.com",
+ "eu-west-1": "directconnect.eu-west-1.amazonaws.com",
+ "sa-east-1": "directconnect.sa-east-1.amazonaws.com",
+ "us-east-1": "directconnect.us-east-1.amazonaws.com",
+ "us-west-1": "directconnect.us-west-1.amazonaws.com",
+ "us-west-2": "directconnect.us-west-2.amazonaws.com"
+ },
+ "dynamodb": {
+ "ap-northeast-1": "dynamodb.ap-northeast-1.amazonaws.com",
+ "ap-southeast-1": "dynamodb.ap-southeast-1.amazonaws.com",
+ "ap-southeast-2": "dynamodb.ap-southeast-2.amazonaws.com",
+ "cn-north-1": "dynamodb.cn-north-1.amazonaws.com.cn",
+ "eu-west-1": "dynamodb.eu-west-1.amazonaws.com",
+ "sa-east-1": "dynamodb.sa-east-1.amazonaws.com",
+ "us-east-1": "dynamodb.us-east-1.amazonaws.com",
+ "us-gov-west-1": "dynamodb.us-gov-west-1.amazonaws.com",
+ "us-west-1": "dynamodb.us-west-1.amazonaws.com",
+ "us-west-2": "dynamodb.us-west-2.amazonaws.com"
+ },
+ "ec2": {
+ "ap-northeast-1": "ec2.ap-northeast-1.amazonaws.com",
+ "ap-southeast-1": "ec2.ap-southeast-1.amazonaws.com",
+ "ap-southeast-2": "ec2.ap-southeast-2.amazonaws.com",
+ "cn-north-1": "ec2.cn-north-1.amazonaws.com.cn",
+ "eu-west-1": "ec2.eu-west-1.amazonaws.com",
+ "sa-east-1": "ec2.sa-east-1.amazonaws.com",
+ "us-east-1": "ec2.us-east-1.amazonaws.com",
+ "us-gov-west-1": "ec2.us-gov-west-1.amazonaws.com",
+ "us-west-1": "ec2.us-west-1.amazonaws.com",
+ "us-west-2": "ec2.us-west-2.amazonaws.com"
+ },
+ "elasticache": {
+ "ap-northeast-1": "elasticache.ap-northeast-1.amazonaws.com",
+ "ap-southeast-1": "elasticache.ap-southeast-1.amazonaws.com",
+ "ap-southeast-2": "elasticache.ap-southeast-2.amazonaws.com",
+ "cn-north-1": "elasticache.cn-north-1.amazonaws.com.cn",
+ "eu-west-1": "elasticache.eu-west-1.amazonaws.com",
+ "sa-east-1": "elasticache.sa-east-1.amazonaws.com",
+ "us-east-1": "elasticache.us-east-1.amazonaws.com",
+ "us-west-1": "elasticache.us-west-1.amazonaws.com",
+ "us-west-2": "elasticache.us-west-2.amazonaws.com"
+ },
+ "elasticbeanstalk": {
+ "ap-northeast-1": "elasticbeanstalk.ap-northeast-1.amazonaws.com",
+ "ap-southeast-1": "elasticbeanstalk.ap-southeast-1.amazonaws.com",
+ "ap-southeast-2": "elasticbeanstalk.ap-southeast-2.amazonaws.com",
+ "eu-west-1": "elasticbeanstalk.eu-west-1.amazonaws.com",
+ "sa-east-1": "elasticbeanstalk.sa-east-1.amazonaws.com",
+ "us-east-1": "elasticbeanstalk.us-east-1.amazonaws.com",
+ "us-west-1": "elasticbeanstalk.us-west-1.amazonaws.com",
+ "us-west-2": "elasticbeanstalk.us-west-2.amazonaws.com"
+ },
+ "elasticloadbalancing": {
+ "ap-northeast-1": "elasticloadbalancing.ap-northeast-1.amazonaws.com",
+ "ap-southeast-1": "elasticloadbalancing.ap-southeast-1.amazonaws.com",
+ "ap-southeast-2": "elasticloadbalancing.ap-southeast-2.amazonaws.com",
+ "cn-north-1": "elasticloadbalancing.cn-north-1.amazonaws.com.cn",
+ "eu-west-1": "elasticloadbalancing.eu-west-1.amazonaws.com",
+ "sa-east-1": "elasticloadbalancing.sa-east-1.amazonaws.com",
+ "us-east-1": "elasticloadbalancing.us-east-1.amazonaws.com",
+ "us-gov-west-1": "elasticloadbalancing.us-gov-west-1.amazonaws.com",
+ "us-west-1": "elasticloadbalancing.us-west-1.amazonaws.com",
+ "us-west-2": "elasticloadbalancing.us-west-2.amazonaws.com"
+ },
+ "elasticmapreduce": {
+ "ap-northeast-1": "elasticmapreduce.ap-northeast-1.amazonaws.com",
+ "ap-southeast-1": "elasticmapreduce.ap-southeast-1.amazonaws.com",
+ "ap-southeast-2": "elasticmapreduce.ap-southeast-2.amazonaws.com",
+ "cn-north-1": "elasticmapreduce.cn-north-1.amazonaws.com.cn",
+ "eu-west-1": "elasticmapreduce.eu-west-1.amazonaws.com",
+ "sa-east-1": "elasticmapreduce.sa-east-1.amazonaws.com",
+ "us-east-1": "elasticmapreduce.us-east-1.amazonaws.com",
+ "us-gov-west-1": "elasticmapreduce.us-gov-west-1.amazonaws.com",
+ "us-west-1": "elasticmapreduce.us-west-1.amazonaws.com",
+ "us-west-2": "elasticmapreduce.us-west-2.amazonaws.com"
+ },
+ "elastictranscoder": {
+ "ap-northeast-1": "elastictranscoder.ap-northeast-1.amazonaws.com",
+ "ap-southeast-1": "elastictranscoder.ap-southeast-1.amazonaws.com",
+ "eu-west-1": "elastictranscoder.eu-west-1.amazonaws.com",
+ "us-east-1": "elastictranscoder.us-east-1.amazonaws.com",
+ "us-west-1": "elastictranscoder.us-west-1.amazonaws.com",
+ "us-west-2": "elastictranscoder.us-west-2.amazonaws.com"
+ },
+ "glacier": {
+ "ap-northeast-1": "glacier.ap-northeast-1.amazonaws.com",
+ "ap-southeast-2": "glacier.ap-southeast-2.amazonaws.com",
+ "cn-north-1": "glacier.cn-north-1.amazonaws.com.cn",
+ "eu-west-1": "glacier.eu-west-1.amazonaws.com",
+ "us-east-1": "glacier.us-east-1.amazonaws.com",
+ "us-west-1": "glacier.us-west-1.amazonaws.com",
+ "us-west-2": "glacier.us-west-2.amazonaws.com"
+ },
+ "iam": {
+ "ap-northeast-1": "iam.amazonaws.com",
+ "ap-southeast-1": "iam.amazonaws.com",
+ "ap-southeast-2": "iam.amazonaws.com",
+ "cn-north-1": "iam.cn-north-1.amazonaws.com.cn",
+ "eu-west-1": "iam.amazonaws.com",
+ "sa-east-1": "iam.amazonaws.com",
+ "us-east-1": "iam.amazonaws.com",
+ "us-gov-west-1": "iam.us-gov.amazonaws.com",
+ "us-west-1": "iam.amazonaws.com",
+ "us-west-2": "iam.amazonaws.com"
+ },
+ "importexport": {
+ "ap-northeast-1": "importexport.amazonaws.com",
+ "ap-southeast-1": "importexport.amazonaws.com",
+ "ap-southeast-2": "importexport.amazonaws.com",
+ "eu-west-1": "importexport.amazonaws.com",
+ "sa-east-1": "importexport.amazonaws.com",
+ "us-east-1": "importexport.amazonaws.com",
+ "us-west-1": "importexport.amazonaws.com",
+ "us-west-2": "importexport.amazonaws.com"
+ },
+ "opsworks": {
+ "us-east-1": "opsworks.us-east-1.amazonaws.com"
+ },
+ "rds": {
+ "ap-northeast-1": "rds.ap-northeast-1.amazonaws.com",
+ "ap-southeast-1": "rds.ap-southeast-1.amazonaws.com",
+ "ap-southeast-2": "rds.ap-southeast-2.amazonaws.com",
+ "cn-north-1": "rds.cn-north-1.amazonaws.com.cn",
+ "eu-west-1": "rds.eu-west-1.amazonaws.com",
+ "sa-east-1": "rds.sa-east-1.amazonaws.com",
+ "us-east-1": "rds.us-east-1.amazonaws.com",
+ "us-gov-west-1": "rds.us-gov-west-1.amazonaws.com",
+ "us-west-1": "rds.us-west-1.amazonaws.com",
+ "us-west-2": "rds.us-west-2.amazonaws.com"
+ },
+ "redshift": {
+ "ap-northeast-1": "redshift.ap-northeast-1.amazonaws.com",
+ "ap-southeast-1": "redshift.ap-southeast-1.amazonaws.com",
+ "ap-southeast-2": "redshift.ap-southeast-2.amazonaws.com",
+ "eu-west-1": "redshift.eu-west-1.amazonaws.com",
+ "us-east-1": "redshift.us-east-1.amazonaws.com",
+ "us-west-2": "redshift.us-west-2.amazonaws.com"
+ },
+ "route53": {
+ "ap-northeast-1": "route53.amazonaws.com",
+ "ap-southeast-1": "route53.amazonaws.com",
+ "ap-southeast-2": "route53.amazonaws.com",
+ "eu-west-1": "route53.amazonaws.com",
+ "sa-east-1": "route53.amazonaws.com",
+ "us-east-1": "route53.amazonaws.com",
+ "us-west-1": "route53.amazonaws.com",
+ "us-west-2": "route53.amazonaws.com"
+ },
+ "s3": {
+ "ap-northeast-1": "s3-ap-northeast-1.amazonaws.com",
+ "ap-southeast-1": "s3-ap-southeast-1.amazonaws.com",
+ "ap-southeast-2": "s3-ap-southeast-2.amazonaws.com",
+ "cn-north-1": "s3.cn-north-1.amazonaws.com.cn",
+ "eu-west-1": "s3-eu-west-1.amazonaws.com",
+ "sa-east-1": "s3-sa-east-1.amazonaws.com",
+ "us-east-1": "s3.amazonaws.com",
+ "us-gov-west-1": "s3-us-gov-west-1.amazonaws.com",
+ "us-west-1": "s3-us-west-1.amazonaws.com",
+ "us-west-2": "s3-us-west-2.amazonaws.com"
+ },
+ "sdb": {
+ "ap-northeast-1": "sdb.ap-northeast-1.amazonaws.com",
+ "ap-southeast-1": "sdb.ap-southeast-1.amazonaws.com",
+ "ap-southeast-2": "sdb.ap-southeast-2.amazonaws.com",
+ "eu-west-1": "sdb.eu-west-1.amazonaws.com",
+ "sa-east-1": "sdb.sa-east-1.amazonaws.com",
+ "us-east-1": "sdb.amazonaws.com",
+ "us-west-1": "sdb.us-west-1.amazonaws.com",
+ "us-west-2": "sdb.us-west-2.amazonaws.com"
+ },
+ "ses": {
+ "eu-west-1": "email.eu-west-1.amazonaws.com",
+ "us-east-1": "email.us-east-1.amazonaws.com",
+ "us-west-2": "email.us-west-2.amazonaws.com"
+ },
+ "sns": {
+ "ap-northeast-1": "sns.ap-northeast-1.amazonaws.com",
+ "ap-southeast-1": "sns.ap-southeast-1.amazonaws.com",
+ "ap-southeast-2": "sns.ap-southeast-2.amazonaws.com",
+ "cn-north-1": "sns.cn-north-1.amazonaws.com.cn",
+ "eu-west-1": "sns.eu-west-1.amazonaws.com",
+ "sa-east-1": "sns.sa-east-1.amazonaws.com",
+ "us-east-1": "sns.us-east-1.amazonaws.com",
+ "us-gov-west-1": "sns.us-gov-west-1.amazonaws.com",
+ "us-west-1": "sns.us-west-1.amazonaws.com",
+ "us-west-2": "sns.us-west-2.amazonaws.com"
+ },
+ "sqs": {
+ "ap-northeast-1": "sqs.ap-northeast-1.amazonaws.com",
+ "ap-southeast-1": "sqs.ap-southeast-1.amazonaws.com",
+ "ap-southeast-2": "sqs.ap-southeast-2.amazonaws.com",
+ "cn-north-1": "sqs.cn-north-1.amazonaws.com.cn",
+ "eu-west-1": "sqs.eu-west-1.amazonaws.com",
+ "sa-east-1": "sqs.sa-east-1.amazonaws.com",
+ "us-east-1": "sqs.us-east-1.amazonaws.com",
+ "us-gov-west-1": "sqs.us-gov-west-1.amazonaws.com",
+ "us-west-1": "sqs.us-west-1.amazonaws.com",
+ "us-west-2": "sqs.us-west-2.amazonaws.com"
+ },
+ "storagegateway": {
+ "ap-northeast-1": "storagegateway.ap-northeast-1.amazonaws.com",
+ "ap-southeast-1": "storagegateway.ap-southeast-1.amazonaws.com",
+ "ap-southeast-2": "storagegateway.ap-southeast-2.amazonaws.com",
+ "eu-west-1": "storagegateway.eu-west-1.amazonaws.com",
+ "sa-east-1": "storagegateway.sa-east-1.amazonaws.com",
+ "us-east-1": "storagegateway.us-east-1.amazonaws.com",
+ "us-west-1": "storagegateway.us-west-1.amazonaws.com",
+ "us-west-2": "storagegateway.us-west-2.amazonaws.com"
+ },
+ "sts": {
+ "ap-northeast-1": "sts.amazonaws.com",
+ "ap-southeast-1": "sts.amazonaws.com",
+ "ap-southeast-2": "sts.amazonaws.com",
+ "cn-north-1": "sts.cn-north-1.amazonaws.com.cn",
+ "eu-west-1": "sts.amazonaws.com",
+ "sa-east-1": "sts.amazonaws.com",
+ "us-east-1": "sts.amazonaws.com",
+ "us-gov-west-1": "sts.us-gov-west-1.amazonaws.com",
+ "us-west-1": "sts.amazonaws.com",
+ "us-west-2": "sts.amazonaws.com"
+ },
+ "support": {
+ "us-east-1": "support.us-east-1.amazonaws.com"
+ },
+ "swf": {
+ "ap-northeast-1": "swf.ap-northeast-1.amazonaws.com",
+ "ap-southeast-1": "swf.ap-southeast-1.amazonaws.com",
+ "ap-southeast-2": "swf.ap-southeast-2.amazonaws.com",
+ "cn-north-1": "swf.cn-north-1.amazonaws.com.cn",
+ "eu-west-1": "swf.eu-west-1.amazonaws.com",
+ "sa-east-1": "swf.sa-east-1.amazonaws.com",
+ "us-east-1": "swf.us-east-1.amazonaws.com",
+ "us-gov-west-1": "swf.us-gov-west-1.amazonaws.com",
+ "us-west-1": "swf.us-west-1.amazonaws.com",
+ "us-west-2": "swf.us-west-2.amazonaws.com"
+ }
+}
View
23 boto/fps/response.py
@@ -1,3 +1,26 @@
+# Copyright (c) 2012 Andy Davidoff http://www.disruptek.com/
+# Copyright (c) 2010 Jason R. Coombs http://www.jaraco.com/
+# Copyright (c) 2008 Chris Moyer http://coredumped.org/
+# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
+#
+# 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 decimal import Decimal
View
25 boto/glacier/__init__.py
@@ -21,7 +21,7 @@
# IN THE SOFTWARE.
#
-from boto.ec2.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions
def regions():
@@ -32,28 +32,7 @@ def regions():
:return: A list of :class:`boto.regioninfo.RegionInfo`
"""
from boto.glacier.layer2 import Layer2
- return [RegionInfo(name='us-east-1',
- endpoint='glacier.us-east-1.amazonaws.com',
- connection_cls=Layer2),
- RegionInfo(name='us-west-1',
- endpoint='glacier.us-west-1.amazonaws.com',
- connection_cls=Layer2),
- RegionInfo(name='us-west-2',
- endpoint='glacier.us-west-2.amazonaws.com',
- connection_cls=Layer2),
- RegionInfo(name='ap-northeast-1',
- endpoint='glacier.ap-northeast-1.amazonaws.com',
- connection_cls=Layer2),
- RegionInfo(name='eu-west-1',
- endpoint='glacier.eu-west-1.amazonaws.com',
- connection_cls=Layer2),
- RegionInfo(name='ap-southeast-2',
- endpoint='glacier.ap-southeast-2.amazonaws.com',
- connection_cls=Layer2),
- RegionInfo(name='cn-north-1',
- endpoint='glacier.cn-north-1.amazonaws.com.cn',
- connection_cls=Layer2),
- ]
+ return get_regions('glacier', connection_cls=Layer2)
def connect_to_region(region_name, **kw_params):
View
5 boto/glacier/layer1.py
@@ -77,7 +77,8 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
https_connection_factory=None, path='/',
provider='aws', security_token=None,
suppress_consec_slashes=True,
- region=None, region_name='us-east-1'):
+ region=None, region_name='us-east-1',
+ profile_name=None):
if not region:
for reg in boto.glacier.regions():
@@ -93,7 +94,7 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
proxy_user, proxy_pass, debug,
https_connection_factory,
path, provider, security_token,
- suppress_consec_slashes)
+ suppress_consec_slashes, profile_name=profile_name)
def _required_auth_capability(self):
return ['hmac-v4']
View
2  boto/gs/bucketlistresultset.py
@@ -38,7 +38,7 @@ def versioned_bucket_lister(bucket, prefix='', delimiter='',
generation_marker = rs.next_generation_marker
more_results= rs.is_truncated
-class VersionedBucketListResultSet:
+class VersionedBucketListResultSet(object):
"""
A resultset for listing versions within a bucket. Uses the bucket_lister
generator function and implements the iterator interface. This
View
2  boto/gs/connection.py
@@ -25,7 +25,7 @@
from boto.s3.connection import check_lowercase_bucketname
from boto.utils import get_utf8_value
-class Location:
+class Location(object):
DEFAULT = 'US'
EU = 'EU'
View
2  boto/gs/user.py
@@ -20,7 +20,7 @@
# IN THE SOFTWARE.
-class User:
+class User(object):
def __init__(self, parent=None, id='', name=''):
if parent:
parent.owner = self
View
30 boto/iam/__init__.py
@@ -22,8 +22,8 @@
# this is here for backward compatibility
# originally, the IAMConnection class was defined here
-from connection import IAMConnection
-from boto.regioninfo import RegionInfo
+from boto.iam.connection import IAMConnection
+from boto.regioninfo import RegionInfo, get_regions
class IAMRegionInfo(RegionInfo):
@@ -50,16 +50,22 @@ def regions():
:rtype: list
:return: A list of :class:`boto.regioninfo.RegionInfo` instances
"""
- return [IAMRegionInfo(name='universal',
- endpoint='iam.amazonaws.com',
- connection_cls=IAMConnection),
- IAMRegionInfo(name='us-gov-west-1',
- endpoint='iam.us-gov.amazonaws.com',
- connection_cls=IAMConnection),
- IAMRegionInfo(name='cn-north-1',
- endpoint='iam.cn-north-1.amazonaws.com.cn',
- connection_cls=IAMConnection)
- ]
+ regions = get_regions(
+ 'iam',
+ region_cls=IAMRegionInfo,
+ connection_cls=IAMConnection
+ )
+
+ # For historical reasons, we had a "universal" endpoint as well.
+ regions.append(
+ IAMRegionInfo(
+ name='universal',
+ endpoint='iam.amazonaws.com',
+ connection_cls=IAMConnection
+ )
+ )
+
+ return regions
def connect_to_region(region_name, **kw_params):
View
7 boto/iam/connection.py
@@ -40,15 +40,16 @@ class IAMConnection(AWSQueryConnection):
def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
is_secure=True, port=None, proxy=None, proxy_port=None,
proxy_user=None, proxy_pass=None, host='iam.amazonaws.com',
- debug=0, https_connection_factory=None,
- path='/', security_token=None, validate_certs=True):
+ debug=0, https_connection_factory=None, path='/',
+ security_token=None, validate_certs=True, profile_name=None):
super(IAMConnection, self).__init__(aws_access_key_id,
aws_secret_access_key,
is_secure, port, proxy,
proxy_port, proxy_user, proxy_pass,
host, debug, https_connection_factory,
path, security_token,
- validate_certs=validate_certs)
+ validate_certs=validate_certs,
+ profile_name=profile_name)
def _required_auth_capability(self):
return ['hmac-v4']
View
8 boto/kinesis/__init__.py
@@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
-from boto.regioninfo import RegionInfo
+from boto.regioninfo import RegionInfo, get_regions
def regions():
@@ -31,11 +31,7 @@ def regions():
:return: A list of :class:`boto.regioninfo.RegionInfo`
"""
from boto.kinesis.layer1 import KinesisConnection
-
- return [RegionInfo(name='us-east-1',
- endpoint='kinesis.us-east-1.amazonaws.com',
- connection_cls=KinesisConnection),
- ]
+ return get_regions('kinesis', connection_cls=KinesisConnection)
def connect_to_region(region_name, **kw_params):
View
7 boto/mturk/connection.py
@@ -46,7 +46,8 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
is_secure=True, port=None, proxy=None, proxy_port=None,
proxy_user=None, proxy_pass=None,
host=None, debug=0,
- https_connection_factory=None):
+ https_connection_factory=None, security_token=None,
+ profile_name=None):
if not host:
if config.has_option('MTurk', 'sandbox') and config.get('MTurk', 'sandbox') == 'True':
host = 'mechanicalturk.sandbox.amazonaws.com'
@@ -58,7 +59,9 @@ def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
aws_secret_access_key,
is_secure, port, proxy, proxy_port,
proxy_user, proxy_pass, host, debug,
- https_connection_factory)
+ https_connection_factory,
+ security_token=security_token,
+ profile_name=profile_name)
def _required_auth_capability(self):
return ['mturk']
View
41 boto/opsworks/__init__.py
@@ -0,0 +1,41 @@
+# Copyright (c) 2014 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.regioninfo import RegionInfo, get_regions
+
+
+def regions():
+ """
+ Get all available regions for the Amazon Kinesis service.
+
+ :rtype: list
+ :return: A list of :class:`boto.regioninfo.RegionInfo`
+ """
+ from boto.opsworks.layer1 import OpsWorksConnection
+ return get_regions('opsworks', connection_cls=OpsWorksConnection)
+
+
+def connect_to_region(region_name, **kw_params):
+ for region in regions():
+ if region.name == region_name:
+ return region.connect(**kw_params)
+ return None
View
17 boto/provider.py
@@ -57,6 +57,7 @@
MFA_HEADER_KEY = 'mfa-header'
SERVER_SIDE_ENCRYPTION_KEY = 'server-side-encryption-header'
VERSION_ID_HEADER_KEY = 'version-id-header'
+RESTORE_HEADER_KEY = 'restore-header'
STORAGE_COPY_ERROR = 'StorageCopyError'
STORAGE_CREATE_ERROR = 'StorageCreateError'
@@ -124,6 +125,7 @@ class Provider(object):
VERSION_ID_HEADER_KEY: AWS_HEADER_PREFIX + 'version-id',
STORAGE_CLASS_HEADER_KEY: AWS_HEADER_PREFIX + 'storage-class',
MFA_HEADER_KEY: AWS_HEADER_PREFIX + 'mfa',
+ RESTORE_HEADER_KEY: AWS_HEADER_PREFIX + 'restore',
},
'google': {
HEADER_PREFIX_KEY: GOOG_HEADER_PREFIX,
@@ -146,6 +148,7 @@ class Provider(object):
VERSION_ID_HEADER_KEY: GOOG_HEADER_PREFIX + 'version-id',
STORAGE_CLASS_HEADER_KEY: None,
MFA_HEADER_KEY: None,
+ RESTORE_HEADER_KEY: None,
}
}
@@ -167,18 +170,19 @@ class Provider(object):
}
def __init__(self, name, access_key=None, secret_key=None,
- security_token=None):
+ security_token=None, profile_name=None):
self.host = None
self.port = None
self.host_header = None
self.access_key = access_key
self.secret_key = secret_key
self.security_token = security_token
+ self.profile_name = profile_name
self.name = name
self.acl_class = self.AclClassMap[self.name]
self.canned_acls = self.CannedAclsMap[self.name]
self._credential_expiry_time = None
- self.get_credentials(access_key, secret_key, security_token)
+ self.get_credentials(access_key, secret_key, security_token, profile_name)
self.configure_headers()
self.configure_errors()
# Allow config file to override default host and port.
@@ -242,7 +246,7 @@ def _credentials_need_refresh(self):
return False
def get_credentials(self, access_key=None, secret_key=None,
- security_token=None):
+ security_token=None, profile_name=None):
access_key_name, secret_key_name, security_token_name = self.CredentialMap[self.name]
if access_key is not None:
self.access_key = access_key
@@ -250,6 +254,9 @@ def get_credentials(self, access_key=None, secret_key=None,
elif access_key_name.upper() in os.environ:
self.access_key = os.environ[access_key_name.upper()]
boto.log.debug("Using access key found in environment variable.")
+ elif config.has_option("profile %s" % profile_name, access_key_name):
+ self.access_key = config.get("profile %s" % profile_name, access_key_name)
+ boto.log.debug("Using access key found in config file: profile %s." % profile_name)
elif config.has_option('Credentials', access_key_name):
self.access_key = config.get('Credentials', access_key_name)
boto.log.debug("Using access key found in config file.")