summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Lindsley <daniel@toastdriven.com>2013-09-04 13:33:58 -0700
committerDaniel Lindsley <daniel@toastdriven.com>2013-09-04 13:33:58 -0700
commitad40af14b6989f940deac74e0276e8e8a8bd3372 (patch)
treee79fecd59d41cf986c54f27fc5bfe748bf6171cf
parentefa5d58c82dfb837f7fb26946f076bda29eee416 (diff)
parent1aef162d2b01cc79b7418882715ae32c5e9b2ae5 (diff)
downloadboto-2.12.0.tar.gz
Merge branch 'release-2.12.0'2.12.0
* release-2.12.0: Bumping version to 2.12.0 Added notes for the release. Added docs about the included CLI tools & recommended people check out the AWS-CLI. support other ELB policies Fix glacier layer2.list_vaults and related tests. Fixed #1687 - Headers involved with signing sent with S3 keys should be case-insensitive for the user. Updated the user-agent string Boto uses. Updated Elasticache to support Redis & replication. Added a in-development release notes doc for the next release. Added the v2.11.0 release notes to the index. Add unit test for getting the etag from the uploaded part. Return the part/key so that the user can manage multipart uploads
-rw-r--r--README.rst4
-rw-r--r--boto/__init__.py9
-rw-r--r--boto/ec2/elb/__init__.py30
-rw-r--r--boto/ec2/elb/loadbalancer.py39
-rw-r--r--boto/ec2/elb/policies.py22
-rw-r--r--boto/elasticache/layer1.py1145
-rw-r--r--boto/glacier/layer2.py12
-rw-r--r--boto/s3/key.py9
-rw-r--r--boto/s3/multipart.py4
-rw-r--r--docs/source/commandline.rst85
-rw-r--r--docs/source/index.rst3
-rw-r--r--docs/source/ref/elb.rst26
-rw-r--r--docs/source/releasenotes/v2.12.0.rst32
-rw-r--r--tests/integration/ec2/elb/test_connection.py22
-rw-r--r--tests/integration/s3/test_key.py11
-rw-r--r--tests/integration/s3/test_multipart.py20
-rw-r--r--tests/unit/ec2/elb/test_loadbalancer.py78
-rw-r--r--tests/unit/glacier/test_layer2.py52
18 files changed, 1217 insertions, 386 deletions
diff --git a/README.rst b/README.rst
index 854c0b58..36ed974e 100644
--- a/README.rst
+++ b/README.rst
@@ -1,9 +1,9 @@
####
boto
####
-boto 2.11.0
+boto 2.12.0
-Released: 29-August-2013
+Released: 04-September-2013
.. image:: https://travis-ci.org/boto/boto.png?branch=develop
:target: https://travis-ci.org/boto/boto
diff --git a/boto/__init__.py b/boto/__init__.py
index 0f16009c..cff05957 100644
--- a/boto/__init__.py
+++ b/boto/__init__.py
@@ -36,10 +36,15 @@ import logging.config
import urlparse
from boto.exception import InvalidUriError
-__version__ = '2.11.0'
+__version__ = '2.12.0'
Version = __version__ # for backware compatibility
-UserAgent = 'Boto/%s (%s)' % (__version__, sys.platform)
+UserAgent = 'Boto/%s Python/%s %s/%s' % (
+ __version__,
+ platform.python_version(),
+ platform.system(),
+ platform.release()
+)
config = Config()
# Regex to disallow buckets violating charset or not [3..255] chars total.
diff --git a/boto/ec2/elb/__init__.py b/boto/ec2/elb/__init__.py
index 49100a43..be949052 100644
--- a/boto/ec2/elb/__init__.py
+++ b/boto/ec2/elb/__init__.py
@@ -536,6 +536,23 @@ class ELBConnection(AWSQueryConnection):
params['CookieExpirationPeriod'] = cookie_expiration_period
return self.get_status('CreateLBCookieStickinessPolicy', params)
+ def create_lb_policy(self, lb_name, policy_name, policy_type, policy_attributes):
+ """
+ Creates a new policy that contais the necessary attributes depending on
+ the policy type. Policies are settings that are saved for your load
+ balancer and that can be applied to the front-end listener, or
+ the back-end application server.
+ """
+ params = {'LoadBalancerName': lb_name,
+ 'PolicyName': policy_name,
+ 'PolicyTypeName': policy_type}
+ for index, (name, value) in enumerate(policy_attributes.iteritems(), 1):
+ params['PolicyAttributes.member.%d.AttributeName' % index] = name
+ params['PolicyAttributes.member.%d.AttributeValue' % index] = value
+ else:
+ params['PolicyAttributes'] = ''
+ return self.get_status('CreateLoadBalancerPolicy', params)
+
def delete_lb_policy(self, lb_name, policy_name):
"""
Deletes a policy from the LoadBalancer. The specified policy must not
@@ -556,6 +573,19 @@ class ELBConnection(AWSQueryConnection):
self.build_list_params(params, policies, 'PolicyNames.member.%d')
return self.get_status('SetLoadBalancerPoliciesOfListener', params)
+ def set_lb_policies_of_backend_server(self, lb_name, instance_port, policies):
+ """
+ Replaces the current set of policies associated with a port on which
+ the back-end server is listening with a new set of policies.
+ """
+ params = {'LoadBalancerName': lb_name,
+ 'InstancePort': instance_port}
+ if policies:
+ self.build_list_params(params, policies, 'PolicyNames.member.%d')
+ else:
+ params['PolicyNames'] = ''
+ return self.get_status('SetLoadBalancerPoliciesForBackendServer', params)
+
def apply_security_groups_to_lb(self, name, security_groups):
"""
Applies security groups to the load balancer.
diff --git a/boto/ec2/elb/loadbalancer.py b/boto/ec2/elb/loadbalancer.py
index 7b6afc7d..92bc5a2c 100644
--- a/boto/ec2/elb/loadbalancer.py
+++ b/boto/ec2/elb/loadbalancer.py
@@ -23,12 +23,34 @@
from boto.ec2.elb.healthcheck import HealthCheck
from boto.ec2.elb.listener import Listener
from boto.ec2.elb.listelement import ListElement
-from boto.ec2.elb.policies import Policies
+from boto.ec2.elb.policies import Policies, OtherPolicy
from boto.ec2.elb.securitygroup import SecurityGroup
from boto.ec2.instanceinfo import InstanceInfo
from boto.resultset import ResultSet
+class Backend(object):
+ """Backend server description"""
+
+ def __init__(self, connection=None):
+ self.connection = connection
+ self.instance_port = None
+ self.policies = None
+
+ def __repr__(self):
+ return 'Backend(%r:%r)' % (self.instance_port, self.policies)
+
+ def startElement(self, name, attrs, connection):
+ if name == 'PolicyNames':
+ self.policies = ResultSet([('member', OtherPolicy)])
+ return self.policies
+
+ def endElement(self, name, value, connection):
+ if name == 'InstancePort':
+ self.instance_port = int(value)
+ return
+
+
class LoadBalancerZones(object):
"""
Used to collect the zones for a Load Balancer when enable_zones
@@ -80,6 +102,8 @@ class LoadBalancer(object):
:ivar list security_groups: A list of additional security groups that
have been applied.
:ivar str vpc_id: The ID of the VPC that this ELB resides within.
+ :ivar list backends: A list of :py:class:`boto.ec2.elb.loadbalancer.Backend
+ back-end server descriptions.
"""
self.connection = connection
self.name = name
@@ -97,6 +121,7 @@ class LoadBalancer(object):
self.security_groups = ListElement()
self.vpc_id = None
self.scheme = None
+ self.backends = None
def __repr__(self):
return 'LoadBalancer:%s' % self.name
@@ -125,6 +150,9 @@ class LoadBalancer(object):
return self.security_groups
elif name == 'VPCId':
pass
+ elif name == "BackendServerDescriptions":
+ self.backends = ResultSet([('member', Backend)])
+ return self.backends
else:
return None
@@ -266,6 +294,12 @@ class LoadBalancer(object):
lb_port,
policies)
+ def set_policies_of_backend_server(self, instance_port, policies):
+ return self.connection.set_lb_policies_of_backend_server(self.name,
+ instance_port,
+ policies)
+
+
def create_cookie_stickiness_policy(self, cookie_expiration_period,
policy_name):
return self.connection.create_lb_cookie_stickiness_policy(cookie_expiration_period, self.name, policy_name)
@@ -280,6 +314,9 @@ class LoadBalancer(object):
lb_port,
ssl_certificate_id)
+ def create_lb_policy(self, policy_name, policy_type, policy_attribute):
+ return self.connection.create_lb_policy(self.name, policy_name, policy_type, policy_attribute)
+
def attach_subnets(self, subnets):
"""
Attaches load balancer to one or more subnets.
diff --git a/boto/ec2/elb/policies.py b/boto/ec2/elb/policies.py
index c25a51fa..faea1c78 100644
--- a/boto/ec2/elb/policies.py
+++ b/boto/ec2/elb/policies.py
@@ -60,6 +60,20 @@ class LBCookieStickinessPolicy(object):
self.policy_name = value
+class OtherPolicy(object):
+ def __init__(self, connection=None):
+ self.policy_name = None
+
+ def __repr__(self):
+ return 'OtherPolicy(%s)' % (self.policy_name)
+
+ def startElement(self, name, attrs, connection):
+ pass
+
+ def endElement(self, name, value, connection):
+ self.policy_name = value
+
+
class Policies(object):
"""
ELB Policies
@@ -68,11 +82,13 @@ class Policies(object):
self.connection = connection
self.app_cookie_stickiness_policies = None
self.lb_cookie_stickiness_policies = None
+ self.other_policies = None
def __repr__(self):
app = 'AppCookieStickiness%s' % self.app_cookie_stickiness_policies
lb = 'LBCookieStickiness%s' % self.lb_cookie_stickiness_policies
- return 'Policies(%s,%s)' % (app, lb)
+ other = 'Other%s' % self.other_policies
+ return 'Policies(%s,%s,%s)' % (app, lb, other)
def startElement(self, name, attrs, connection):
if name == 'AppCookieStickinessPolicies':
@@ -83,6 +99,10 @@ class Policies(object):
rs = ResultSet([('member', LBCookieStickinessPolicy)])
self.lb_cookie_stickiness_policies = rs
return rs
+ elif name == 'OtherPolicies':
+ rs = ResultSet([('member', OtherPolicy)])
+ self.other_policies = rs
+ return rs
def endElement(self, name, value, connection):
return
diff --git a/boto/elasticache/layer1.py b/boto/elasticache/layer1.py
index 6c50438a..f1dc3a26 100644
--- a/boto/elasticache/layer1.py
+++ b/boto/elasticache/layer1.py
@@ -20,7 +20,6 @@
# IN THE SOFTWARE.
#
-
import boto
from boto.compat import json
from boto.connection import AWSQueryConnection
@@ -33,18 +32,18 @@ class ElastiCacheConnection(AWSQueryConnection):
Amazon ElastiCache is a web service that makes it easier to set
up, operate, and scale a distributed cache in the cloud.
- With Amazon ElastiCache, customers gain all of the benefits of a
- high-performance, in-memory cache with far less of the
- administrative burden of launching and managing a distributed
- cache. The service makes set-up, scaling, and cluster failure
- handling much simpler than in a self-managed cache deployment.
+ With ElastiCache, customers gain all of the benefits of a high-
+ performance, in-memory cache with far less of the administrative
+ burden of launching and managing a distributed cache. The service
+ makes set-up, scaling, and cluster failure handling much simpler
+ than in a self-managed cache deployment.
In addition, through integration with Amazon CloudWatch, customers
get enhanced visibility into the key performance statistics
associated with their cache and can receive alarms if a part of
their cache runs hot.
"""
- APIVersion = "2012-11-15"
+ APIVersion = "2013-06-15"
DefaultRegionName = "us-east-1"
DefaultRegionEndpoint = "elasticache.us-east-1.amazonaws.com"
@@ -68,26 +67,26 @@ class ElastiCacheConnection(AWSQueryConnection):
ec2_security_group_name,
ec2_security_group_owner_id):
"""
- Authorizes ingress to a CacheSecurityGroup using EC2 Security
- Groups as authorization (therefore the application using the
- cache must be running on EC2 clusters). This API requires the
- following parameters: EC2SecurityGroupName and
- EC2SecurityGroupOwnerId.
- You cannot authorize ingress from an EC2 security group in one
- Region to an Amazon Cache Cluster in another.
+ The AuthorizeCacheSecurityGroupIngress operation allows
+ network ingress to a cache security group. Applications using
+ ElastiCache must be running on Amazon EC2, and Amazon EC2
+ security groups are used as the authorization mechanism.
+ You cannot authorize ingress from an Amazon EC2 security group
+ in one Region to an ElastiCache cluster in another Region.
:type cache_security_group_name: string
- :param cache_security_group_name: The name of the Cache Security Group
- to authorize.
+ :param cache_security_group_name: The cache security group which will
+ allow network ingress.
:type ec2_security_group_name: string
- :param ec2_security_group_name: Name of the EC2 Security Group to
- include in the authorization.
+ :param ec2_security_group_name: The Amazon EC2 security group to be
+ authorized for ingress to the cache security group.
:type ec2_security_group_owner_id: string
- :param ec2_security_group_owner_id: AWS Account Number of the owner of
- the security group specified in the EC2SecurityGroupName parameter.
- The AWS Access Key ID is not an acceptable value.
+ :param ec2_security_group_owner_id: The AWS account number of the
+ Amazon EC2 security group owner. Note that this is not the same
+ thing as an AWS access key ID - you must provide a valid AWS
+ account number for this parameter.
"""
params = {
@@ -101,86 +100,146 @@ class ElastiCacheConnection(AWSQueryConnection):
path='/', params=params)
def create_cache_cluster(self, cache_cluster_id, num_cache_nodes,
- cache_node_type, engine, engine_version=None,
+ cache_node_type, engine,
+ replication_group_id=None, engine_version=None,
cache_parameter_group_name=None,
cache_subnet_group_name=None,
cache_security_group_names=None,
- security_group_ids=None,
+ security_group_ids=None, snapshot_arns=None,
preferred_availability_zone=None,
preferred_maintenance_window=None, port=None,
notification_topic_arn=None,
auto_minor_version_upgrade=None):
"""
- Creates a new Cache Cluster.
+ The CreateCacheCluster operation creates a new cache cluster.
+ All nodes in the cache cluster run the same protocol-compliant
+ cache engine software - either Memcached or Redis.
:type cache_cluster_id: string
- :param cache_cluster_id: The Cache Cluster identifier. This parameter
- is stored as a lowercase string.
+ :param cache_cluster_id:
+ The cache cluster identifier. This parameter is stored as a lowercase
+ string.
+
+ Constraints:
+
+
+ + Must contain from 1 to 20 alphanumeric characters or hyphens.
+ + First character must be a letter.
+ + Cannot end with a hyphen or contain two consecutive hyphens.
+
+ :type replication_group_id: string
+ :param replication_group_id: The replication group to which this cache
+ cluster should belong. If this parameter is specified, the cache
+ cluster will be added to the specified replication group as a read
+ replica; otherwise, the cache cluster will be a standalone primary
+ that is not part of any replication group.
:type num_cache_nodes: integer
- :param num_cache_nodes: The number of Cache Nodes the Cache Cluster
- should have.
+ :param num_cache_nodes: The initial number of cache nodes that the
+ cache cluster will have.
+ For a Memcached cluster, valid values are between 1 and 20. If you need
+ to exceed this limit, please fill out the ElastiCache Limit
+ Increase Request form at ``_ .
+
+ For Redis, only single-node cache clusters are supported at this time,
+ so the value for this parameter must be 1.
:type cache_node_type: string
- :param cache_node_type: The compute and memory capacity of nodes in a
- Cache Cluster.
+ :param cache_node_type: The compute and memory capacity of the nodes in
+ the cache cluster.
+ Valid values for Memcached:
+
+ `cache.t1.micro` | `cache.m1.small` | `cache.m1.medium` |
+ `cache.m1.large` | `cache.m1.xlarge` | `cache.m3.xlarge` |
+ `cache.m3.2xlarge` | `cache.m2.xlarge` | `cache.m2.2xlarge` |
+ `cache.m2.4xlarge` | `cache.c1.xlarge`
+
+ Valid values for Redis:
+
+ `cache.t1.micro` | `cache.m1.small` | `cache.m1.medium` |
+ `cache.m1.large` | `cache.m1.xlarge` | `cache.m2.xlarge` |
+ `cache.m2.2xlarge` | `cache.m2.4xlarge` | `cache.c1.xlarge`
+
+ For a complete listing of cache node types and specifications, see `.
:type engine: string
- :param engine: The name of the cache engine to be used for this Cache
- Cluster. Currently, memcached is the only cache engine supported
- by the service.
+ :param engine: The name of the cache engine to be used for this cache
+ cluster.
+ Valid values for this parameter are:
+
+ `memcached` | `redis`
:type engine_version: string
- :param engine_version: The version of the cache engine to be used for
- this cluster.
+ :param engine_version: The version number of the cache engine to be
+ used for this cluster. To view the supported cache engine versions,
+ use the DescribeCacheEngineVersions operation.
:type cache_parameter_group_name: string
:param cache_parameter_group_name: The name of the cache parameter
- group to associate with this Cache cluster. If this argument is
- omitted, the default CacheParameterGroup for the specified engine
+ group to associate with this cache cluster. If this argument is
+ omitted, the default cache parameter group for the specified engine
will be used.
:type cache_subnet_group_name: string
- :param cache_subnet_group_name: The name of the Cache Subnet Group to
- be used for the Cache Cluster. Use this parameter only when you
- are creating a cluster in an Amazon Virtual Private Cloud (VPC).
+ :param cache_subnet_group_name: The name of the cache subnet group to
+ be used for the cache cluster.
+ Use this parameter only when you are creating a cluster in an Amazon
+ Virtual Private Cloud (VPC).
:type cache_security_group_names: list
- :param cache_security_group_names: A list of Cache Security Group Names
- to associate with this Cache Cluster. Use this parameter only when
- you are creating a cluster outside of an Amazon Virtual Private
- Cloud (VPC).
+ :param cache_security_group_names: A list of cache security group names
+ to associate with this cache cluster.
+ Use this parameter only when you are creating a cluster outside of an
+ Amazon Virtual Private Cloud (VPC).
:type security_group_ids: list
- :param security_group_ids: Specifies the VPC Security Groups associated
- with the Cache Cluster. Use this parameter only when you are
- creating a cluster in an Amazon Virtual Private Cloud (VPC).
+ :param security_group_ids: One or more VPC security groups associated
+ with the cache cluster.
+ Use this parameter only when you are creating a cluster in an Amazon
+ Virtual Private Cloud (VPC).
+
+ :type snapshot_arns: list
+ :param snapshot_arns: A single-element string list containing an Amazon
+ Resource Name (ARN) that uniquely identifies a Redis RDB snapshot
+ file stored in Amazon S3. The snapshot file will be used to
+ populate the Redis cache in the new cache cluster. The Amazon S3
+ object name in the ARN cannot contain any commas.
+ Here is an example of an Amazon S3 ARN:
+ `arn:aws:s3:::my_bucket/snapshot1.rdb`
+
+ **Note:** This parameter is only valid if the `Engine` parameter is
+ `redis`.
:type preferred_availability_zone: string
- :param preferred_availability_zone: The EC2 Availability Zone that the
- Cache Cluster will be created in. All cache nodes belonging to a
- cache cluster are placed in the preferred availability zone.
- Default: System chosen (random) availability zone.
+ :param preferred_availability_zone: The EC2 Availability Zone in which
+ the cache cluster will be created.
+ All cache nodes belonging to a cache cluster are placed in the
+ preferred availability zone.
+
+ Default: System chosen availability zone.
:type preferred_maintenance_window: string
:param preferred_maintenance_window: The weekly time range (in UTC)
- during which system maintenance can occur. Example:
- `sun:05:00-sun:09:00`
+ during which system maintenance can occur.
+ Example: `sun:05:00-sun:09:00`
:type port: integer
- :param port: The port number on which each of the Cache Nodes will
+ :param port: The port number on which each of the cache nodes will
accept connections.
:type notification_topic_arn: string
- :param notification_topic_arn: The Amazon Resource Name (ARN) of the
- Amazon Simple Notification Service (SNS) topic to which
- notifications will be sent. The Amazon SNS topic owner must be the
- same as the Cache Cluster owner.
+ :param notification_topic_arn:
+ The Amazon Resource Name (ARN) of the Amazon Simple Notification
+ Service (SNS) topic to which notifications will be sent.
+
+ The Amazon SNS topic owner must be the same as the cache cluster owner.
:type auto_minor_version_upgrade: boolean
- :param auto_minor_version_upgrade: Indicates that minor engine upgrades
- will be applied automatically to the Cache Cluster during the
- maintenance window. Default: `True`
+ :param auto_minor_version_upgrade: Determines whether minor engine
+ upgrades will be applied automatically to the cache cluster during
+ the maintenance window. A value of `True` allows these upgrades to
+ occur; `False` disables automatic upgrades.
+ Default: `True`
"""
params = {
@@ -189,6 +248,8 @@ class ElastiCacheConnection(AWSQueryConnection):
'CacheNodeType': cache_node_type,
'Engine': engine,
}
+ if replication_group_id is not None:
+ params['ReplicationGroupId'] = replication_group_id
if engine_version is not None:
params['EngineVersion'] = engine_version
if cache_parameter_group_name is not None:
@@ -203,6 +264,10 @@ class ElastiCacheConnection(AWSQueryConnection):
self.build_list_params(params,
security_group_ids,
'SecurityGroupIds.member')
+ if snapshot_arns is not None:
+ self.build_list_params(params,
+ snapshot_arns,
+ 'SnapshotArns.member')
if preferred_availability_zone is not None:
params['PreferredAvailabilityZone'] = preferred_availability_zone
if preferred_maintenance_window is not None:
@@ -223,21 +288,23 @@ class ElastiCacheConnection(AWSQueryConnection):
cache_parameter_group_family,
description):
"""
- Creates a new Cache Parameter Group. Cache Parameter groups
- control the parameters for a Cache Cluster.
+ The CreateCacheParameterGroup operation creates a new cache
+ parameter group. A cache parameter group is a collection of
+ parameters that you apply to all of the nodes in a cache
+ cluster.
:type cache_parameter_group_name: string
- :param cache_parameter_group_name: The name of the Cache Parameter
- Group.
+ :param cache_parameter_group_name: A user-specified name for the cache
+ parameter group.
:type cache_parameter_group_family: string
- :param cache_parameter_group_family: The name of the Cache Parameter
- Group Family the Cache Parameter Group can be used with.
- Currently, memcached1.4 is the only cache parameter group family
- supported by the service.
+ :param cache_parameter_group_family: The name of the cache parameter
+ group family the cache parameter group can be used with.
+ Valid values are: `memcached1.4` | `redis2.6`
:type description: string
- :param description: The description for the Cache Parameter Group.
+ :param description: A user-specified description for the cache
+ parameter group.
"""
params = {
@@ -253,21 +320,26 @@ class ElastiCacheConnection(AWSQueryConnection):
def create_cache_security_group(self, cache_security_group_name,
description):
"""
- Creates a new Cache Security Group. Cache Security groups
- control access to one or more Cache Clusters.
+ The CreateCacheSecurityGroup operation creates a new cache
+ security group. Use a cache security group to control access
+ to one or more cache clusters.
- Only use cache security groups when you are creating a cluster
- outside of an Amazon Virtual Private Cloud (VPC). Inside of a
- VPC, use VPC security groups.
+ Cache security groups are only used when you are creating a
+ cluster outside of an Amazon Virtual Private Cloud (VPC). If
+ you are creating a cluster inside of a VPC, use a cache subnet
+ group instead. For more information, see
+ CreateCacheSubnetGroup .
:type cache_security_group_name: string
- :param cache_security_group_name: The name for the Cache Security
- Group. This value is stored as a lowercase string. Constraints:
- Must contain no more than 255 alphanumeric characters. Must not be
- "Default". Example: `mysecuritygroup`
+ :param cache_security_group_name: A name for the cache security group.
+ This value is stored as a lowercase string.
+ Constraints: Must contain no more than 255 alphanumeric characters.
+ Must not be the word "Default".
+
+ Example: `mysecuritygroup`
:type description: string
- :param description: The description for the Cache Security Group.
+ :param description: A description for the cache security group.
"""
params = {
@@ -282,20 +354,26 @@ class ElastiCacheConnection(AWSQueryConnection):
def create_cache_subnet_group(self, cache_subnet_group_name,
cache_subnet_group_description, subnet_ids):
"""
- Creates a new Cache Subnet Group.
+ The CreateCacheSubnetGroup operation creates a new cache
+ subnet group.
+
+ Use this parameter only when you are creating a cluster in an
+ Amazon Virtual Private Cloud (VPC).
:type cache_subnet_group_name: string
- :param cache_subnet_group_name: The name for the Cache Subnet Group.
- This value is stored as a lowercase string. Constraints: Must
- contain no more than 255 alphanumeric characters or hyphens.
- Example: `mysubnetgroup`
+ :param cache_subnet_group_name: A name for the cache subnet group. This
+ value is stored as a lowercase string.
+ Constraints: Must contain no more than 255 alphanumeric characters or
+ hyphens.
+
+ Example: `mysubnetgroup`
:type cache_subnet_group_description: string
- :param cache_subnet_group_description: The description for the Cache
- Subnet Group.
+ :param cache_subnet_group_description: A description for the cache
+ subnet group.
:type subnet_ids: list
- :param subnet_ids: The EC2 Subnet IDs for the Cache Subnet Group.
+ :param subnet_ids: A list of VPC subnet IDs for the cache subnet group.
"""
params = {
@@ -310,17 +388,66 @@ class ElastiCacheConnection(AWSQueryConnection):
verb='POST',
path='/', params=params)
+ def create_replication_group(self, replication_group_id,
+ primary_cluster_id,
+ replication_group_description):
+ """
+ The CreateReplicationGroup operation creates a replication
+ group. A replication group is a collection of cache clusters,
+ where one of the clusters is a read/write primary and the
+ other clusters are read-only replicas. Writes to the primary
+ are automatically propagated to the replicas.
+
+ When you create a replication group, you must specify an
+ existing cache cluster that is in the primary role. When the
+ replication group has been successfully created, you can add
+ one or more read replica replicas to it, up to a total of five
+ read replicas.
+
+ :type replication_group_id: string
+ :param replication_group_id:
+ The replication group identifier. This parameter is stored as a
+ lowercase string.
+
+ Constraints:
+
+
+ + Must contain from 1 to 20 alphanumeric characters or hyphens.
+ + First character must be a letter.
+ + Cannot end with a hyphen or contain two consecutive hyphens.
+
+ :type primary_cluster_id: string
+ :param primary_cluster_id: The identifier of the cache cluster that
+ will serve as the primary for this replication group. This cache
+ cluster must already exist and have a status of available .
+
+ :type replication_group_description: string
+ :param replication_group_description: A user-specified description for
+ the replication group.
+
+ """
+ params = {
+ 'ReplicationGroupId': replication_group_id,
+ 'PrimaryClusterId': primary_cluster_id,
+ 'ReplicationGroupDescription': replication_group_description,
+ }
+ return self._make_request(
+ action='CreateReplicationGroup',
+ verb='POST',
+ path='/', params=params)
+
def delete_cache_cluster(self, cache_cluster_id):
"""
- Deletes a previously provisioned Cache Cluster. A successful
- response from the web service indicates the request was
- received correctly. This action cannot be canceled or
- reverted. DeleteCacheCluster deletes all associated Cache
- Nodes, node endpoints and the Cache Cluster itself.
+ The DeleteCacheCluster operation deletes a previously
+ provisioned cache cluster. DeleteCacheCluster deletes all
+ associated cache nodes, node endpoints and the cache cluster
+ itself. When you receive a successful response from this
+ operation, Amazon ElastiCache immediately begins deleting the
+ cache cluster; you cannot cancel or revert this operation.
:type cache_cluster_id: string
- :param cache_cluster_id: The Cache Cluster identifier for the Cache
- Cluster to be deleted. This parameter isn't case sensitive.
+ :param cache_cluster_id: The cache cluster identifier for the cluster
+ to be deleted. This parameter is not case sensitive.
"""
params = {'CacheClusterId': cache_cluster_id, }
@@ -331,14 +458,16 @@ class ElastiCacheConnection(AWSQueryConnection):
def delete_cache_parameter_group(self, cache_parameter_group_name):
"""
- Deletes the specified CacheParameterGroup. The
- CacheParameterGroup cannot be deleted if it is associated with
- any cache clusters.
+ The DeleteCacheParameterGroup operation deletes the specified
+ cache parameter group. You cannot delete a cache parameter
+ group if it is associated with any cache clusters.
:type cache_parameter_group_name: string
- :param cache_parameter_group_name: The name of the Cache Parameter
- Group to delete. The specified cache security group must not be
- associated with any Cache clusters.
+ :param cache_parameter_group_name:
+ The name of the cache parameter group to delete.
+
+ The specified cache security group must not be associated with any
+ cache clusters.
"""
params = {
@@ -351,13 +480,16 @@ class ElastiCacheConnection(AWSQueryConnection):
def delete_cache_security_group(self, cache_security_group_name):
"""
- Deletes a Cache Security Group.
- The specified Cache Security Group must not be associated with
- any Cache Clusters.
+ The DeleteCacheSecurityGroup operation deletes a cache
+ security group.
+ You cannot delete a cache security group if it is associated
+ with any cache clusters.
:type cache_security_group_name: string
- :param cache_security_group_name: The name of the Cache Security Group
- to delete. You cannot delete the default security group.
+ :param cache_security_group_name:
+ The name of the cache security group to delete.
+
+ You cannot delete the default security group.
"""
params = {
@@ -370,14 +502,16 @@ class ElastiCacheConnection(AWSQueryConnection):
def delete_cache_subnet_group(self, cache_subnet_group_name):
"""
- Deletes a Cache Subnet Group.
- The specified Cache Subnet Group must not be associated with
- any Cache Clusters.
+ The DeleteCacheSubnetGroup operation deletes a cache subnet
+ group.
+ You cannot delete a cache subnet group if it is associated
+ with any cache clusters.
:type cache_subnet_group_name: string
- :param cache_subnet_group_name: The name of the Cache Subnet Group to
- delete. Constraints: Must contain no more than 255 alphanumeric
- characters or hyphens.
+ :param cache_subnet_group_name: The name of the cache subnet group to
+ delete.
+ Constraints: Must contain no more than 255 alphanumeric characters or
+ hyphens.
"""
params = {'CacheSubnetGroupName': cache_subnet_group_name, }
@@ -386,19 +520,41 @@ class ElastiCacheConnection(AWSQueryConnection):
verb='POST',
path='/', params=params)
+ def delete_replication_group(self, replication_group_id):
+ """
+ The DeleteReplicationGroup operation deletes an existing
+ replication group. DeleteReplicationGroup deletes the primary
+ cache cluster and all of the read replicas in the replication
+ group. When you receive a successful response from this
+ operation, Amazon ElastiCache immediately begins deleting the
+ entire replication group; you cannot cancel or revert this
+ operation.
+
+ :type replication_group_id: string
+ :param replication_group_id: The identifier for the replication group
+ to be deleted. This parameter is not case sensitive.
+
+ """
+ params = {'ReplicationGroupId': replication_group_id, }
+ return self._make_request(
+ action='DeleteReplicationGroup',
+ verb='POST',
+ path='/', params=params)
+
def describe_cache_clusters(self, cache_cluster_id=None,
max_records=None, marker=None,
show_cache_node_info=None):
"""
- Returns information about all provisioned Cache Clusters if no
- Cache Cluster identifier is specified, or about a specific
- Cache Cluster if a Cache Cluster identifier is supplied.
+ The DescribeCacheClusters operation returns information about
+ all provisioned cache clusters if no cache cluster identifier
+ is specified, or about a specific cache cluster if a cache
+ cluster identifier is supplied.
- Cluster information will be returned by default. An optional
- ShowDetails flag can be used to retrieve detailed information
- about the Cache Nodes associated with the Cache Cluster.
- Details include the DNS address and port for the Cache Node
- endpoint.
+ By default, abbreviated information about the cache
+ clusters(s) will be returned. You can use the optional
+ ShowDetails flag to retrieve detailed information about the
+ cache nodes associated with the cache clusters. These details
+ include the DNS address and port for the cache node endpoint.
If the cluster is in the CREATING state, only cluster level
information will be displayed until all of the nodes are
@@ -407,37 +563,40 @@ class ElastiCacheConnection(AWSQueryConnection):
If the cluster is in the DELETING state, only cluster level
information will be displayed.
- While adding Cache Nodes, node endpoint information and
- creation time for the additional nodes will not be displayed
- until they are completely provisioned. The cluster lifecycle
- tells the customer when new nodes are AVAILABLE.
-
- While removing existing Cache Nodes from an cluster, endpoint
- information for the removed nodes will not be displayed.
+ If cache nodes are currently being added to the cache cluster,
+ node endpoint information and creation time for the additional
+ nodes will not be displayed until they are completely
+ provisioned. When the cache cluster state is available , the
+ cluster is ready for use.
- DescribeCacheClusters supports pagination.
+ If cache nodes are currently being removed from the cache
+ cluster, no endpoint information for the removed nodes is
+ displayed.
:type cache_cluster_id: string
:param cache_cluster_id: The user-supplied cluster identifier. If this
- parameter is specified, only information about that specific Cache
- Cluster is returned. This parameter isn't case sensitive.
+ parameter is specified, only information about that specific cache
+ cluster is returned. This parameter isn't case sensitive.
:type max_records: integer
:param max_records: The maximum number of records to include in the
- response. If more records exist than the specified MaxRecords
+ response. If more records exist than the specified `MaxRecords`
value, a marker is included in the response so that the remaining
- results may be retrieved.
+ results can be retrieved.
+ Default: 100
+
+ Constraints: minimum 20; maximum 100.
:type marker: string
- :param marker: An optional marker provided in the previous
- DescribeCacheClusters request. If this parameter is specified, the
- response includes only records beyond the marker, up to the value
- specified by MaxRecords .
+ :param marker: An optional marker returned from a prior request. Use
+ this marker for pagination of results from this operation. If this
+ parameter is specified, the response includes only records beyond
+ the marker, up to the value specified by MaxRecords .
:type show_cache_node_info: boolean
:param show_cache_node_info: An optional flag that can be included in
- the DescribeCacheCluster request to retrieve Cache Nodes
- information.
+ the DescribeCacheCluster request to retrieve information about the
+ individual cache nodes.
"""
params = {}
@@ -461,39 +620,48 @@ class ElastiCacheConnection(AWSQueryConnection):
max_records=None, marker=None,
default_only=None):
"""
- Returns a list of the available cache engines and their
- versions.
+ The DescribeCacheEngineVersions operation returns a list of
+ the available cache engines and their versions.
:type engine: string
- :param engine: The cache engine to return.
+ :param engine: The cache engine to return. Valid values: `memcached` |
+ `redis`
:type engine_version: string
- :param engine_version: The cache engine version to return. Example:
- `1.4.14`
+ :param engine_version: The cache engine version to return.
+ Example: `1.4.14`
:type cache_parameter_group_family: string
- :param cache_parameter_group_family: The name of a specific Cache
- Parameter Group family to return details for. Constraints: +
- Must be 1 to 255 alphanumeric characters + First character must be
- a letter + Cannot end with a hyphen or contain two consecutive
- hyphens
+ :param cache_parameter_group_family:
+ The name of a specific cache parameter group family to return details
+ for.
+
+ Constraints:
+
+
+ + Must be 1 to 255 alphanumeric characters
+ + First character must be a letter
+ + Cannot end with a hyphen or contain two consecutive hyphens
:type max_records: integer
:param max_records: The maximum number of records to include in the
- response. If more records exist than the specified MaxRecords
+ response. If more records exist than the specified `MaxRecords`
value, a marker is included in the response so that the remaining
- results may be retrieved.
+ results can be retrieved.
+ Default: 100
+
+ Constraints: minimum 20; maximum 100.
:type marker: string
- :param marker: An optional marker provided in the previous
- DescribeCacheParameterGroups request. If this parameter is
- specified, the response includes only records beyond the marker, up
- to the value specified by MaxRecords .
+ :param marker: An optional marker returned from a prior request. Use
+ this marker for pagination of results from this operation. If this
+ parameter is specified, the response includes only records beyond
+ the marker, up to the value specified by MaxRecords .
:type default_only: boolean
- :param default_only: Indicates that only the default version of the
- specified engine or engine and major version combination is
- returned.
+ :param default_only: If true , specifies that only the default version
+ of the specified engine or engine and major version combination is
+ to be returned.
"""
params = {}
@@ -519,9 +687,10 @@ class ElastiCacheConnection(AWSQueryConnection):
cache_parameter_group_name=None,
max_records=None, marker=None):
"""
- Returns a list of CacheParameterGroup descriptions. If a
- CacheParameterGroupName is specified, the list will contain
- only the descriptions of the specified CacheParameterGroup.
+ The DescribeCacheParameterGroups operation returns a list of
+ cache parameter group descriptions. If a cache parameter group
+ name is specified, the list will contain only the descriptions
+ for that group.
:type cache_parameter_group_name: string
:param cache_parameter_group_name: The name of a specific cache
@@ -529,15 +698,18 @@ class ElastiCacheConnection(AWSQueryConnection):
:type max_records: integer
:param max_records: The maximum number of records to include in the
- response. If more records exist than the specified MaxRecords
+ response. If more records exist than the specified `MaxRecords`
value, a marker is included in the response so that the remaining
- results may be retrieved.
+ results can be retrieved.
+ Default: 100
+
+ Constraints: minimum 20; maximum 100.
:type marker: string
- :param marker: An optional marker provided in the previous
- DescribeCacheParameterGroups request. If this parameter is
- specified, the response includes only records beyond the marker, up
- to the value specified by MaxRecords .
+ :param marker: An optional marker returned from a prior request. Use
+ this marker for pagination of results from this operation. If this
+ parameter is specified, the response includes only records beyond
+ the marker, up to the value specified by MaxRecords .
"""
params = {}
@@ -555,28 +727,31 @@ class ElastiCacheConnection(AWSQueryConnection):
def describe_cache_parameters(self, cache_parameter_group_name,
source=None, max_records=None, marker=None):
"""
- Returns the detailed parameter list for a particular
- CacheParameterGroup.
+ The DescribeCacheParameters operation returns the detailed
+ parameter list for a particular cache parameter group.
:type cache_parameter_group_name: string
:param cache_parameter_group_name: The name of a specific cache
parameter group to return details for.
:type source: string
- :param source: The parameter types to return. Valid values: `user` |
- `system` | `engine-default`
+ :param source: The parameter types to return.
+ Valid values: `user` | `system` | `engine-default`
:type max_records: integer
:param max_records: The maximum number of records to include in the
- response. If more records exist than the specified MaxRecords
+ response. If more records exist than the specified `MaxRecords`
value, a marker is included in the response so that the remaining
- results may be retrieved.
+ results can be retrieved.
+ Default: 100
+
+ Constraints: minimum 20; maximum 100.
:type marker: string
- :param marker: An optional marker provided in the previous
- DescribeCacheClusters request. If this parameter is specified, the
- response includes only records beyond the marker, up to the value
- specified by MaxRecords .
+ :param marker: An optional marker returned from a prior request. Use
+ this marker for pagination of results from this operation. If this
+ parameter is specified, the response includes only records beyond
+ the marker, up to the value specified by MaxRecords .
"""
params = {
@@ -596,25 +771,29 @@ class ElastiCacheConnection(AWSQueryConnection):
def describe_cache_security_groups(self, cache_security_group_name=None,
max_records=None, marker=None):
"""
- Returns a list of CacheSecurityGroup descriptions. If a
- CacheSecurityGroupName is specified, the list will contain
- only the description of the specified CacheSecurityGroup.
+ The DescribeCacheSecurityGroups operation returns a list of
+ cache security group descriptions. If a cache security group
+ name is specified, the list will contain only the description
+ of that group.
:type cache_security_group_name: string
- :param cache_security_group_name: The name of the Cache Security Group
+ :param cache_security_group_name: The name of the cache security group
to return details for.
:type max_records: integer
:param max_records: The maximum number of records to include in the
- response. If more records exist than the specified MaxRecords
+ response. If more records exist than the specified `MaxRecords`
value, a marker is included in the response so that the remaining
- results may be retrieved.
+ results can be retrieved.
+ Default: 100
+
+ Constraints: minimum 20; maximum 100.
:type marker: string
- :param marker: An optional marker provided in the previous
- DescribeCacheClusters request. If this parameter is specified, the
- response includes only records beyond the marker, up to the value
- specified by MaxRecords .
+ :param marker: An optional marker returned from a prior request. Use
+ this marker for pagination of results from this operation. If this
+ parameter is specified, the response includes only records beyond
+ the marker, up to the value specified by MaxRecords .
"""
params = {}
@@ -632,26 +811,29 @@ class ElastiCacheConnection(AWSQueryConnection):
def describe_cache_subnet_groups(self, cache_subnet_group_name=None,
max_records=None, marker=None):
"""
- Returns a list of CacheSubnetGroup descriptions. If a
- CacheSubnetGroupName is specified, the list will contain only
- the description of the specified Cache Subnet Group.
+ The DescribeCacheSubnetGroups operation returns a list of
+ cache subnet group descriptions. If a subnet group name is
+ specified, the list will contain only the description of that
+ group.
:type cache_subnet_group_name: string
- :param cache_subnet_group_name: The name of the Cache Subnet Group to
+ :param cache_subnet_group_name: The name of the cache subnet group to
return details for.
:type max_records: integer
:param max_records: The maximum number of records to include in the
response. If more records exist than the specified `MaxRecords`
value, a marker is included in the response so that the remaining
- results may be retrieved. Default: 100 Constraints: minimum 20,
- maximum 100
+ results can be retrieved.
+ Default: 100
+
+ Constraints: minimum 20; maximum 100.
:type marker: string
- :param marker: An optional marker provided in the previous
- DescribeCacheSubnetGroups request. If this parameter is specified,
- the response includes only records beyond the marker, up to the
- value specified by `MaxRecords`.
+ :param marker: An optional marker returned from a prior request. Use
+ this marker for pagination of results from this operation. If this
+ parameter is specified, the response includes only records beyond
+ the marker, up to the value specified by MaxRecords .
"""
params = {}
@@ -670,25 +852,28 @@ class ElastiCacheConnection(AWSQueryConnection):
cache_parameter_group_family,
max_records=None, marker=None):
"""
- Returns the default engine and system parameter information
- for the specified cache engine.
+ The DescribeEngineDefaultParameters operation returns the
+ default engine and system parameter information for the
+ specified cache engine.
:type cache_parameter_group_family: string
- :param cache_parameter_group_family: The name of the Cache Parameter
- Group Family. Currently, memcached1.4 is the only cache parameter
- group family supported by the service.
+ :param cache_parameter_group_family: The name of the cache parameter
+ group family. Valid values are: `memcached1.4` | `redis2.6`
:type max_records: integer
:param max_records: The maximum number of records to include in the
- response. If more records exist than the specified MaxRecords
+ response. If more records exist than the specified `MaxRecords`
value, a marker is included in the response so that the remaining
- results may be retrieved.
+ results can be retrieved.
+ Default: 100
+
+ Constraints: minimum 20; maximum 100.
:type marker: string
- :param marker: An optional marker provided in the previous
- DescribeCacheClusters request. If this parameter is specified, the
- response includes only records beyond the marker, up to the value
- specified by MaxRecords .
+ :param marker: An optional marker returned from a prior request. Use
+ this marker for pagination of results from this operation. If this
+ parameter is specified, the response includes only records beyond
+ the marker, up to the value specified by MaxRecords .
"""
params = {
@@ -707,12 +892,15 @@ class ElastiCacheConnection(AWSQueryConnection):
start_time=None, end_time=None, duration=None,
max_records=None, marker=None):
"""
- Returns events related to Cache Clusters, Cache Security
- Groups, and Cache Parameter Groups for the past 14 days.
- Events specific to a particular Cache Cluster, Cache Security
- Group, or Cache Parameter Group can be obtained by providing
- the name as a parameter. By default, the past hour of events
- are returned.
+ The DescribeEvents operation returns events related to cache
+ clusters, cache security groups, and cache parameter groups.
+ You can obtain events specific to a particular cache cluster,
+ cache security group, or cache parameter group by providing
+ the name as a parameter.
+
+ By default, only the events occurring within the last hour are
+ returned; however, you can retrieve up to 14 days' worth of
+ events if necessary.
:type source_identifier: string
:param source_identifier: The identifier of the event source for which
@@ -722,29 +910,34 @@ class ElastiCacheConnection(AWSQueryConnection):
:type source_type: string
:param source_type: The event source to retrieve events for. If no
value is specified, all events are returned.
+ Valid values are: `cache-cluster` | `cache-parameter-group` | `cache-
+ security-group` | `cache-subnet-group`
- :type start_time: string
+ :type start_time: timestamp
:param start_time: The beginning of the time interval to retrieve
events for, specified in ISO 8601 format.
- :type end_time: string
+ :type end_time: timestamp
:param end_time: The end of the time interval for which to retrieve
events, specified in ISO 8601 format.
:type duration: integer
- :param duration: The number of minutes to retrieve events for.
+ :param duration: The number of minutes' worth of events to retrieve.
:type max_records: integer
:param max_records: The maximum number of records to include in the
- response. If more records exist than the specified MaxRecords
+ response. If more records exist than the specified `MaxRecords`
value, a marker is included in the response so that the remaining
- results may be retrieved.
+ results can be retrieved.
+ Default: 100
+
+ Constraints: minimum 20; maximum 100.
:type marker: string
- :param marker: An optional marker provided in the previous
- DescribeCacheClusters request. If this parameter is specified, the
- response includes only records beyond the marker, up to the value
- specified by MaxRecords .
+ :param marker: An optional marker returned from a prior request. Use
+ this marker for pagination of results from this operation. If this
+ parameter is specified, the response includes only records beyond
+ the marker, up to the value specified by MaxRecords .
"""
params = {}
@@ -767,6 +960,48 @@ class ElastiCacheConnection(AWSQueryConnection):
verb='POST',
path='/', params=params)
+ def describe_replication_groups(self, replication_group_id=None,
+ max_records=None, marker=None):
+ """
+ The DescribeReplicationGroups operation returns information
+ about a particular replication group. If no identifier is
+ specified, DescribeReplicationGroups returns information about
+ all replication groups.
+
+ :type replication_group_id: string
+ :param replication_group_id: The identifier for the replication group
+ to be described. This parameter is not case sensitive.
+ If you do not specify this parameter, information about all replication
+ groups is returned.
+
+ :type max_records: integer
+ :param max_records: The maximum number of records to include in the
+ response. If more records exist than the specified `MaxRecords`
+ value, a marker is included in the response so that the remaining
+ results can be retrieved.
+ Default: 100
+
+ Constraints: minimum 20; maximum 100.
+
+ :type marker: string
+ :param marker: An optional marker returned from a prior request. Use
+ this marker for pagination of results from this operation. If this
+ parameter is specified, the response includes only records beyond
+ the marker, up to the value specified by MaxRecords .
+
+ """
+ params = {}
+ if replication_group_id is not None:
+ params['ReplicationGroupId'] = replication_group_id
+ if max_records is not None:
+ params['MaxRecords'] = max_records
+ if marker is not None:
+ params['Marker'] = marker
+ return self._make_request(
+ action='DescribeReplicationGroups',
+ verb='POST',
+ path='/', params=params)
+
def describe_reserved_cache_nodes(self, reserved_cache_node_id=None,
reserved_cache_nodes_offering_id=None,
cache_node_type=None, duration=None,
@@ -774,51 +1009,57 @@ class ElastiCacheConnection(AWSQueryConnection):
offering_type=None, max_records=None,
marker=None):
"""
- Returns information about reserved Cache Nodes for this
- account, or about a specified reserved Cache Node.
+ The DescribeReservedCacheNodes operation returns information
+ about reserved cache nodes for this account, or about a
+ specified reserved cache node.
:type reserved_cache_node_id: string
- :param reserved_cache_node_id: The reserved Cache Node identifier
- filter value. Specify this parameter to show only the reservation
- that matches the specified reservation ID.
+ :param reserved_cache_node_id: The reserved cache node identifier
+ filter value. Use this parameter to show only the reservation that
+ matches the specified reservation ID.
:type reserved_cache_nodes_offering_id: string
:param reserved_cache_nodes_offering_id: The offering identifier filter
- value. Specify this parameter to show only purchased reservations
+ value. Use this parameter to show only purchased reservations
matching the specified offering identifier.
:type cache_node_type: string
- :param cache_node_type: The Cache Node type filter value. Specify this
+ :param cache_node_type: The cache node type filter value. Use this
parameter to show only those reservations matching the specified
- Cache Nodes type.
+ cache node type.
:type duration: string
:param duration: The duration filter value, specified in years or
- seconds. Specify this parameter to show only reservations for this
- duration. Valid Values: `1 | 3 | 31536000 | 94608000`
+ seconds. Use this parameter to show only reservations for this
+ duration.
+ Valid Values: `1 | 3 | 31536000 | 94608000`
:type product_description: string
- :param product_description: The product description filter value.
- Specify this parameter to show only those reservations matching the
+ :param product_description: The product description filter value. Use
+ this parameter to show only those reservations matching the
specified product description.
:type offering_type: string
- :param offering_type: The offering type filter value. Specify this
+ :param offering_type: The offering type filter value. Use this
parameter to show only the available offerings matching the
- specified offering type. Valid Values: `"Light Utilization" |
- "Medium Utilization" | "Heavy Utilization"`
+ specified offering type.
+ Valid values: `"Light Utilization" | "Medium Utilization" | "Heavy
+ Utilization" `
:type max_records: integer
:param max_records: The maximum number of records to include in the
- response. If more than the `MaxRecords` value is available, a
- marker is included in the response so that the following results
- can be retrieved. Default: 100 Constraints: minimum 20, maximum
- 100
+ response. If more records exist than the specified `MaxRecords`
+ value, a marker is included in the response so that the remaining
+ results can be retrieved.
+ Default: 100
+
+ Constraints: minimum 20; maximum 100.
:type marker: string
- :param marker: The marker provided in the previous request. If this
- parameter is specified, the response includes records beyond the
- marker only, up to `MaxRecords`.
+ :param marker: An optional marker returned from a prior request. Use
+ this marker for pagination of results from this operation. If this
+ parameter is specified, the response includes only records beyond
+ the marker, up to the value specified by MaxRecords .
"""
params = {}
@@ -852,46 +1093,51 @@ class ElastiCacheConnection(AWSQueryConnection):
max_records=None,
marker=None):
"""
- Lists available reserved Cache Node offerings.
+ The DescribeReservedCacheNodesOfferings operation lists
+ available reserved cache node offerings.
:type reserved_cache_nodes_offering_id: string
:param reserved_cache_nodes_offering_id: The offering identifier filter
- value. Specify this parameter to show only the available offering
- that matches the specified reservation identifier. Example:
- `438012d3-4052-4cc7-b2e3-8d3372e0e706`
+ value. Use this parameter to show only the available offering that
+ matches the specified reservation identifier.
+ Example: `438012d3-4052-4cc7-b2e3-8d3372e0e706`
:type cache_node_type: string
- :param cache_node_type: The Cache Node type filter value. Specify this
+ :param cache_node_type: The cache node type filter value. Use this
parameter to show only the available offerings matching the
- specified Cache Node type.
+ specified cache node type.
:type duration: string
:param duration: Duration filter value, specified in years or seconds.
- Specify this parameter to show only reservations for this duration.
- Valid Values: `1 | 3 | 31536000 | 94608000`
+ Use this parameter to show only reservations for a given duration.
+ Valid Values: `1 | 3 | 31536000 | 94608000`
:type product_description: string
- :param product_description: Product description filter value. Specify
+ :param product_description: The product description filter value. Use
this parameter to show only the available offerings matching the
specified product description.
:type offering_type: string
- :param offering_type: The offering type filter value. Specify this
+ :param offering_type: The offering type filter value. Use this
parameter to show only the available offerings matching the
- specified offering type. Valid Values: `"Light Utilization" |
- "Medium Utilization" | "Heavy Utilization"`
+ specified offering type.
+ Valid Values: `"Light Utilization" | "Medium Utilization" | "Heavy
+ Utilization" `
:type max_records: integer
:param max_records: The maximum number of records to include in the
- response. If more than the `MaxRecords` value is available, a
- marker is included in the response so that the following results
- can be retrieved. Default: 100 Constraints: minimum 20, maximum
- 100
+ response. If more records exist than the specified `MaxRecords`
+ value, a marker is included in the response so that the remaining
+ results can be retrieved.
+ Default: 100
+
+ Constraints: minimum 20; maximum 100.
:type marker: string
- :param marker: The marker provided in the previous request. If this
- parameter is specified, the response includes records beyond the
- marker only, up to `MaxRecords`.
+ :param marker: An optional marker returned from a prior request. Use
+ this marker for pagination of results from this operation. If this
+ parameter is specified, the response includes only records beyond
+ the marker, up to the value specified by MaxRecords .
"""
params = {}
@@ -925,85 +1171,101 @@ class ElastiCacheConnection(AWSQueryConnection):
apply_immediately=None, engine_version=None,
auto_minor_version_upgrade=None):
"""
- Modifies the Cache Cluster settings. You can change one or
- more Cache Cluster configuration parameters by specifying the
- parameters and the new values in the request.
+ The ModifyCacheCluster operation modifies the settings for a
+ cache cluster. You can use this operation to change one or
+ more cluster configuration parameters by specifying the
+ parameters and the new values.
:type cache_cluster_id: string
- :param cache_cluster_id: The Cache Cluster identifier. This value is
+ :param cache_cluster_id: The cache cluster identifier. This value is
stored as a lowercase string.
:type num_cache_nodes: integer
- :param num_cache_nodes: The number of Cache Nodes the Cache Cluster
- should have. If NumCacheNodes is greater than the existing number
- of Cache Nodes, Cache Nodes will be added. If NumCacheNodes is less
- than the existing number of Cache Nodes, Cache Nodes will be
- removed. When removing Cache Nodes, the Ids of the specific Cache
- Nodes to be removed must be supplied using the CacheNodeIdsToRemove
- parameter.
+ :param num_cache_nodes: The number of cache nodes that the cache
+ cluster should have. If the value for NumCacheNodes is greater than
+ the existing number of cache nodes, then more nodes will be added.
+ If the value is less than the existing number of cache nodes, then
+ cache nodes will be removed.
+ If you are removing cache nodes, you must use the CacheNodeIdsToRemove
+ parameter to provide the IDs of the specific cache nodes to be
+ removed.
:type cache_node_ids_to_remove: list
- :param cache_node_ids_to_remove: The list of Cache Node IDs to be
- removed. This parameter is only valid when NumCacheNodes is less
- than the existing number of Cache Nodes. The number of Cache Node
- Ids supplied in this parameter must match the difference between
- the existing number of Cache Nodes in the cluster and the new
- NumCacheNodes requested.
+ :param cache_node_ids_to_remove: A list of cache node IDs to be
+ removed. A node ID is a numeric identifier (0001, 0002, etc.). This
+ parameter is only valid when NumCacheNodes is less than the
+ existing number of cache nodes. The number of cache node IDs
+ supplied in this parameter must match the difference between the
+ existing number of cache nodes in the cluster and the value of
+ NumCacheNodes in the request.
:type cache_security_group_names: list
- :param cache_security_group_names: A list of Cache Security Group Names
- to authorize on this Cache Cluster. This change is asynchronously
- applied as soon as possible. This parameter can be used only with
- clusters that are created outside of an Amazon Virtual Private
- Cloud (VPC). Constraints: Must contain no more than 255
- alphanumeric characters. Must not be "Default".
+ :param cache_security_group_names: A list of cache security group names
+ to authorize on this cache cluster. This change is asynchronously
+ applied as soon as possible.
+ This parameter can be used only with clusters that are created outside
+ of an Amazon Virtual Private Cloud (VPC).
+
+ Constraints: Must contain no more than 255 alphanumeric characters.
+ Must not be "Default".
:type security_group_ids: list
:param security_group_ids: Specifies the VPC Security Groups associated
- with the Cache Cluster. This parameter can be used only with
- clusters that are created in an Amazon Virtual Private Cloud (VPC).
+ with the cache cluster.
+ This parameter can be used only with clusters that are created in an
+ Amazon Virtual Private Cloud (VPC).
:type preferred_maintenance_window: string
:param preferred_maintenance_window: The weekly time range (in UTC)
- during which system maintenance can occur, which may result in an
- outage. This change is made immediately. If moving this window to
- the current time, there must be at least 120 minutes between the
- current time and end of the window to ensure pending changes are
- applied.
+ during which system maintenance can occur. Note that system
+ maintenance may result in an outage. This change is made
+ immediately. If you are moving this window to the current time,
+ there must be at least 120 minutes between the current time and end
+ of the window to ensure that pending changes are applied.
:type notification_topic_arn: string
- :param notification_topic_arn: The Amazon Resource Name (ARN) of the
- SNS topic to which notifications will be sent. The SNS topic owner
- must be same as the Cache Cluster owner.
+ :param notification_topic_arn:
+ The Amazon Resource Name (ARN) of the SNS topic to which notifications
+ will be sent.
+
+ The SNS topic owner must be same as the cache cluster owner.
:type cache_parameter_group_name: string
- :param cache_parameter_group_name: The name of the Cache Parameter
- Group to apply to this Cache Cluster. This change is asynchronously
+ :param cache_parameter_group_name: The name of the cache parameter
+ group to apply to this cache cluster. This change is asynchronously
applied as soon as possible for parameters when the
ApplyImmediately parameter is specified as true for this request.
:type notification_topic_status: string
:param notification_topic_status: The status of the Amazon SNS
- notification topic. The value can be active or inactive .
- Notifications are sent only if the status is active .
+ notification topic. Notifications are sent only if the status is
+ active .
+ Valid values: `active` | `inactive`
:type apply_immediately: boolean
- :param apply_immediately: Specifies whether or not the modifications in
- this request and any pending modifications are asynchronously
- applied as soon as possible, regardless of the
- PreferredMaintenanceWindow setting for the Cache Cluster. If this
- parameter is passed as `False`, changes to the Cache Cluster are
- applied on the next maintenance reboot, or the next failure reboot,
- whichever occurs first. Default: `False`
+ :param apply_immediately: If `True`, this parameter causes the
+ modifications in this request and any pending modifications to be
+ applied, asynchronously and as soon as possible, regardless of the
+ PreferredMaintenanceWindow setting for the cache cluster.
+ If `False`, then changes to the cache cluster are applied on the next
+ maintenance reboot, or the next failure reboot, whichever occurs
+ first.
+
+ Valid values: `True` | `False`
+
+ Default: `False`
:type engine_version: string
- :param engine_version: The version of the cache engine to upgrade this
- cluster to.
+ :param engine_version: The upgraded version of the cache engine to be
+ run on the cache cluster nodes.
:type auto_minor_version_upgrade: boolean
- :param auto_minor_version_upgrade: Indicates that minor engine upgrades
- will be applied automatically to the Cache Cluster during the
- maintenance window. Default: `True`
+ :param auto_minor_version_upgrade: If `True`, then minor engine
+ upgrades will be applied automatically to the cache cluster during
+ the maintenance window.
+ Valid values: `True` | `False`
+
+ Default: `True`
"""
params = {'CacheClusterId': cache_cluster_id, }
@@ -1045,10 +1307,10 @@ class ElastiCacheConnection(AWSQueryConnection):
def modify_cache_parameter_group(self, cache_parameter_group_name,
parameter_name_values):
"""
- Modifies the parameters of a CacheParameterGroup. To modify
- more than one parameter, submit a list of ParameterName and
- ParameterValue parameters. A maximum of 20 parameters can be
- modified in a single request.
+ The ModifyCacheParameterGroup operation modifies the
+ parameters of a cache parameter group. You can modify up to 20
+ parameters in a single request by submitting a list parameter
+ name and value pairs.
:type cache_parameter_group_name: string
:param cache_parameter_group_name: The name of the cache parameter
@@ -1056,9 +1318,9 @@ class ElastiCacheConnection(AWSQueryConnection):
:type parameter_name_values: list
:param parameter_name_values: An array of parameter names and values
- for the parameter update. At least one parameter name and value
- must be supplied; subsequent arguments are optional. A maximum of
- 20 parameters may be modified in a single request.
+ for the parameter update. You must supply at least one parameter
+ name and value; subsequent arguments are optional. A maximum of 20
+ parameters may be modified per request.
"""
params = {
@@ -1077,20 +1339,23 @@ class ElastiCacheConnection(AWSQueryConnection):
cache_subnet_group_description=None,
subnet_ids=None):
"""
- Modifies an existing Cache Subnet Group.
+ The ModifyCacheSubnetGroup operation modifies an existing
+ cache subnet group.
:type cache_subnet_group_name: string
- :param cache_subnet_group_name: The name for the Cache Subnet Group.
- This value is stored as a lowercase string. Constraints: Must
- contain no more than 255 alphanumeric characters or hyphens.
- Example: `mysubnetgroup`
+ :param cache_subnet_group_name: The name for the cache subnet group.
+ This value is stored as a lowercase string.
+ Constraints: Must contain no more than 255 alphanumeric characters or
+ hyphens.
+
+ Example: `mysubnetgroup`
:type cache_subnet_group_description: string
- :param cache_subnet_group_description: The description for the Cache
- Subnet Group.
+ :param cache_subnet_group_description: A description for the cache
+ subnet group.
:type subnet_ids: list
- :param subnet_ids: The EC2 Subnet IDs for the Cache Subnet Group.
+ :param subnet_ids: The EC2 subnet IDs for the cache subnet group.
"""
params = {'CacheSubnetGroupName': cache_subnet_group_name, }
@@ -1105,25 +1370,160 @@ class ElastiCacheConnection(AWSQueryConnection):
verb='POST',
path='/', params=params)
+ def modify_replication_group(self, replication_group_id,
+ replication_group_description=None,
+ cache_security_group_names=None,
+ security_group_ids=None,
+ preferred_maintenance_window=None,
+ notification_topic_arn=None,
+ cache_parameter_group_name=None,
+ notification_topic_status=None,
+ apply_immediately=None, engine_version=None,
+ auto_minor_version_upgrade=None,
+ primary_cluster_id=None):
+ """
+ The ModifyReplicationGroup operation modifies the settings for
+ a replication group.
+
+ :type replication_group_id: string
+ :param replication_group_id: The identifier of the replication group to
+ modify.
+
+ :type replication_group_description: string
+ :param replication_group_description: A description for the replication
+ group. Maximum length is 255 characters.
+
+ :type cache_security_group_names: list
+ :param cache_security_group_names: A list of cache security group names
+ to authorize for the clusters in this replication group. This
+ change is asynchronously applied as soon as possible.
+ This parameter can be used only with replication groups containing
+ cache clusters running outside of an Amazon Virtual Private Cloud
+ (VPC).
+
+ Constraints: Must contain no more than 255 alphanumeric characters.
+ Must not be "Default".
+
+ :type security_group_ids: list
+ :param security_group_ids: Specifies the VPC Security Groups associated
+ with the cache clusters in the replication group.
+ This parameter can be used only with replication groups containing
+ cache clusters running in an Amazon Virtual Private Cloud (VPC).
+
+ :type preferred_maintenance_window: string
+ :param preferred_maintenance_window: The weekly time range (in UTC)
+ during which replication group system maintenance can occur. Note
+ that system maintenance may result in an outage. This change is
+ made immediately. If you are moving this window to the current
+ time, there must be at least 120 minutes between the current time
+ and end of the window to ensure that pending changes are applied.
+
+ :type notification_topic_arn: string
+ :param notification_topic_arn:
+ The Amazon Resource Name (ARN) of the SNS topic to which notifications
+ will be sent.
+
+ The SNS topic owner must be same as the replication group owner.
+
+ :type cache_parameter_group_name: string
+ :param cache_parameter_group_name: The name of the cache parameter
+ group to apply to all of the cache nodes in this replication group.
+ This change is asynchronously applied as soon as possible for
+ parameters when the ApplyImmediately parameter is specified as true
+ for this request.
+
+ :type notification_topic_status: string
+ :param notification_topic_status: The status of the Amazon SNS
+ notification topic for the replication group. Notifications are
+ sent only if the status is active .
+ Valid values: `active` | `inactive`
+
+ :type apply_immediately: boolean
+ :param apply_immediately: If `True`, this parameter causes the
+ modifications in this request and any pending modifications to be
+ applied, asynchronously and as soon as possible, regardless of the
+ PreferredMaintenanceWindow setting for the replication group.
+ If `False`, then changes to the nodes in the replication group are
+ applied on the next maintenance reboot, or the next failure reboot,
+ whichever occurs first.
+
+ Valid values: `True` | `False`
+
+ Default: `False`
+
+ :type engine_version: string
+ :param engine_version: The upgraded version of the cache engine to be
+ run on the nodes in the replication group..
+
+ :type auto_minor_version_upgrade: boolean
+ :param auto_minor_version_upgrade: Determines whether minor engine
+ upgrades will be applied automatically to all of the cache nodes in
+ the replication group during the maintenance window. A value of
+ `True` allows these upgrades to occur; `False` disables automatic
+ upgrades.
+
+ :type primary_cluster_id: string
+ :param primary_cluster_id: If this parameter is specified, ElastiCache
+ will promote each of the nodes in the specified cache cluster to
+ the primary role. The nodes of all other clusters in the
+ replication group will be read replicas.
+
+ """
+ params = {'ReplicationGroupId': replication_group_id, }
+ if replication_group_description is not None:
+ params['ReplicationGroupDescription'] = replication_group_description
+ if cache_security_group_names is not None:
+ self.build_list_params(params,
+ cache_security_group_names,
+ 'CacheSecurityGroupNames.member')
+ if security_group_ids is not None:
+ self.build_list_params(params,
+ security_group_ids,
+ 'SecurityGroupIds.member')
+ if preferred_maintenance_window is not None:
+ params['PreferredMaintenanceWindow'] = preferred_maintenance_window
+ if notification_topic_arn is not None:
+ params['NotificationTopicArn'] = notification_topic_arn
+ if cache_parameter_group_name is not None:
+ params['CacheParameterGroupName'] = cache_parameter_group_name
+ if notification_topic_status is not None:
+ params['NotificationTopicStatus'] = notification_topic_status
+ if apply_immediately is not None:
+ params['ApplyImmediately'] = str(
+ apply_immediately).lower()
+ if engine_version is not None:
+ params['EngineVersion'] = engine_version
+ if auto_minor_version_upgrade is not None:
+ params['AutoMinorVersionUpgrade'] = str(
+ auto_minor_version_upgrade).lower()
+ if primary_cluster_id is not None:
+ params['PrimaryClusterId'] = primary_cluster_id
+ return self._make_request(
+ action='ModifyReplicationGroup',
+ verb='POST',
+ path='/', params=params)
+
def purchase_reserved_cache_nodes_offering(self,
reserved_cache_nodes_offering_id,
reserved_cache_node_id=None,
cache_node_count=None):
"""
- Purchases a reserved Cache Node offering.
+ The PurchaseReservedCacheNodesOffering operation allows you to
+ purchase a reserved cache node offering.
:type reserved_cache_nodes_offering_id: string
- :param reserved_cache_nodes_offering_id: The ID of the Reserved Cache
- Node offering to purchase. Example:
- 438012d3-4052-4cc7-b2e3-8d3372e0e706
+ :param reserved_cache_nodes_offering_id: The ID of the reserved cache
+ node offering to purchase.
+ Example: 438012d3-4052-4cc7-b2e3-8d3372e0e706
:type reserved_cache_node_id: string
- :param reserved_cache_node_id: Customer-specified identifier to track
- this reservation. Example: myreservationID
+ :param reserved_cache_node_id: A customer-specified identifier to track
+ this reservation.
+ Example: myreservationID
:type cache_node_count: integer
- :param cache_node_count: The number of instances to reserve. Default:
- `1`
+ :param cache_node_count: The number of cache node instances to reserve.
+ Default: `1`
"""
params = {
@@ -1141,24 +1541,28 @@ class ElastiCacheConnection(AWSQueryConnection):
def reboot_cache_cluster(self, cache_cluster_id,
cache_node_ids_to_reboot):
"""
- Reboots some (or all) of the cache cluster nodes within a
- previously provisioned ElastiCache cluster. This API results
- in the application of modified CacheParameterGroup parameters
- to the cache cluster. This action is taken as soon as
+ The RebootCacheCluster operation reboots some, or all, of the
+ cache cluster nodes within a provisioned cache cluster. This
+ API will apply any modified cache parameter groups to the
+ cache cluster. The reboot action takes place as soon as
possible, and results in a momentary outage to the cache
- cluster during which the cache cluster status is set to
- rebooting. During that momentary outage, the contents of the
- cache (for each cache cluster node being rebooted) are lost. A
- CacheCluster event is created when the reboot is completed.
+ cluster. During the reboot, the cache cluster status is set to
+ REBOOTING.
+
+ The reboot causes the contents of the cache (for each cache
+ cluster node being rebooted) to be lost.
+
+ When the reboot is complete, a cache cluster event is created.
:type cache_cluster_id: string
- :param cache_cluster_id: The Cache Cluster identifier. This parameter
+ :param cache_cluster_id: The cache cluster identifier. This parameter
is stored as a lowercase string.
:type cache_node_ids_to_reboot: list
- :param cache_node_ids_to_reboot: A list of Cache Cluster Node Ids to
- reboot. To reboot an entire cache cluster, specify all cache
- cluster node Ids.
+ :param cache_node_ids_to_reboot: A list of cache cluster node IDs to
+ reboot. A node ID is a numeric identifier (0001, 0002, etc.). To
+ reboot an entire cache cluster, specify all of the cache cluster
+ node IDs.
"""
params = {'CacheClusterId': cache_cluster_id, }
@@ -1174,25 +1578,27 @@ class ElastiCacheConnection(AWSQueryConnection):
parameter_name_values,
reset_all_parameters=None):
"""
- Modifies the parameters of a CacheParameterGroup to the engine
- or system default value. To reset specific parameters submit a
- list of the parameter names. To reset the entire
- CacheParameterGroup, specify the CacheParameterGroup name and
- ResetAllParameters parameters.
+ The ResetCacheParameterGroup operation modifies the parameters
+ of a cache parameter group to the engine or system default
+ value. You can reset specific parameters by submitting a list
+ of parameter names. To reset the entire cache parameter group,
+ specify the ResetAllParameters and CacheParameterGroupName
+ parameters.
:type cache_parameter_group_name: string
- :param cache_parameter_group_name: The name of the Cache Parameter
- Group.
+ :param cache_parameter_group_name: The name of the cache parameter
+ group to reset.
:type reset_all_parameters: boolean
- :param reset_all_parameters: Specifies whether ( true ) or not ( false
- ) to reset all parameters in the Cache Parameter Group to default
- values.
+ :param reset_all_parameters: If true , all parameters in the cache
+ parameter group will be reset to default values. If false , no such
+ action occurs.
+ Valid values: `True` | `False`
:type parameter_name_values: list
- :param parameter_name_values: An array of parameter names which should
- be reset. If not resetting the entire CacheParameterGroup, at least
- one parameter name must be supplied.
+ :param parameter_name_values: An array of parameter names to be reset.
+ If you are not resetting the entire cache parameter group, you must
+ specify at least one parameter name.
"""
params = {
@@ -1214,21 +1620,24 @@ class ElastiCacheConnection(AWSQueryConnection):
ec2_security_group_name,
ec2_security_group_owner_id):
"""
- Revokes ingress from a CacheSecurityGroup for previously
- authorized EC2 Security Groups.
+ The RevokeCacheSecurityGroupIngress operation revokes ingress
+ from a cache security group. Use this operation to disallow
+ access from an Amazon EC2 security group that had been
+ previously authorized.
:type cache_security_group_name: string
- :param cache_security_group_name: The name of the Cache Security Group
+ :param cache_security_group_name: The name of the cache security group
to revoke ingress from.
:type ec2_security_group_name: string
- :param ec2_security_group_name: The name of the EC2 Security Group to
- revoke access from.
+ :param ec2_security_group_name: The name of the Amazon EC2 security
+ group to revoke access from.
:type ec2_security_group_owner_id: string
- :param ec2_security_group_owner_id: The AWS Account Number of the owner
- of the security group specified in the EC2SecurityGroupName
- parameter. The AWS Access Key ID is not an acceptable value.
+ :param ec2_security_group_owner_id: The AWS account number of the
+ Amazon EC2 security group owner. Note that this is not the same
+ thing as an AWS access key ID - you must provide a valid AWS
+ account number for this parameter.
"""
params = {
diff --git a/boto/glacier/layer2.py b/boto/glacier/layer2.py
index e519ca89..d27f62d1 100644
--- a/boto/glacier/layer2.py
+++ b/boto/glacier/layer2.py
@@ -89,5 +89,13 @@ class Layer2(object):
:rtype: List of :class:`boto.glacier.vault.Vault`
:return: A list of Vault objects.
"""
- response_data = self.layer1.list_vaults()
- return [Vault(self.layer1, rd) for rd in response_data['VaultList']]
+ vaults = []
+ marker = None
+ while True:
+ response_data = self.layer1.list_vaults(marker=marker, limit=1000)
+ vaults.extend([Vault(self.layer1, rd) for rd in response_data['VaultList']])
+ marker = response_data.get('Marker')
+ if not marker:
+ break
+
+ return vaults
diff --git a/boto/s3/key.py b/boto/s3/key.py
index d16352fd..80ba3e93 100644
--- a/boto/s3/key.py
+++ b/boto/s3/key.py
@@ -522,7 +522,14 @@ class Key(object):
return self.metadata.get(name)
def set_metadata(self, name, value):
- self.metadata[name] = value
+ # Ensure that metadata that is vital to signing is in the correct
+ # case. Applies to ``Content-Type`` & ``Content-MD5``.
+ if name.lower() == 'content-type':
+ self.metadata['Content-Type'] = value
+ elif name.lower() == 'content-md5':
+ self.metadata['Content-MD5'] = value
+ else:
+ self.metadata[name] = value
def update_metadata(self, d):
self.metadata.update(d)
diff --git a/boto/s3/multipart.py b/boto/s3/multipart.py
index 12926781..fae3389e 100644
--- a/boto/s3/multipart.py
+++ b/boto/s3/multipart.py
@@ -235,6 +235,9 @@ class MultiPartUpload(object):
The other parameters are exactly as defined for the
:class:`boto.s3.key.Key` set_contents_from_file method.
+
+ :rtype: :class:`boto.s3.key.Key` or subclass
+ :returns: The uploaded part containing the etag.
"""
if part_num < 1:
raise ValueError('Part numbers must be greater than zero')
@@ -244,6 +247,7 @@ class MultiPartUpload(object):
cb=cb, num_cb=num_cb, md5=md5,
reduced_redundancy=False,
query_args=query_args, size=size)
+ return key
def copy_part_from_key(self, src_bucket_name, src_key_name, part_num,
start=None, end=None, src_version_id=None,
diff --git a/docs/source/commandline.rst b/docs/source/commandline.rst
new file mode 100644
index 00000000..6b604827
--- /dev/null
+++ b/docs/source/commandline.rst
@@ -0,0 +1,85 @@
+.. _ref-boto_commandline:
+
+==================
+Command Line Tools
+==================
+
+Introduction
+============
+
+Boto ships with a number of command line utilities, which are installed
+when the package is installed. This guide outlines which ones are available
+& what they do.
+
+.. note::
+
+ If you're not already depending on these utilities, you may wish to check
+ out the AWS-CLI (http://aws.amazon.com/cli/ - `User Guide`_ &
+ `Reference Guide`_). It provides much wider & complete access to the
+ AWS services.
+
+ .. _`User Guide`: http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html
+ .. _`Reference Guide`: http://docs.aws.amazon.com/cli/latest/reference/
+
+The included utilities available are:
+
+``asadmin``
+ Works with Autoscaling
+
+``bundle_image``
+ Creates a bundled AMI in S3 based on a EC2 instance
+
+``cfadmin``
+ Works with CloudFront & invalidations
+
+``cq``
+ Works with SQS queues
+
+``cwutil``
+ Works with CloudWatch
+
+``dynamodb_dump``
+``dynamodb_load``
+ Handle dumping/loading data from DynamoDB tables
+
+``elbadmin``
+ Manages Elastic Load Balancer instances
+
+``fetch_file``
+ Downloads an S3 key to disk
+
+``glacier``
+ Lists vaults, jobs & uploads files to Glacier
+
+``instance_events``
+ Lists all events for EC2 reservations
+
+``kill_instance``
+ Kills a list of EC2 instances
+
+``launch_instance``
+ Launches an EC2 instance
+
+``list_instances``
+ Lists all of your EC2 instances
+
+``lss3``
+ Lists what keys you have within a bucket in S3
+
+``mturk``
+ Provides a number of facilities for interacting with Mechanical Turk
+
+``pyami_sendmail``
+ Sends an email from the Pyami instance
+
+``route53``
+ Interacts with the Route53 service
+
+``s3put``
+ Uploads a directory or a specific file(s) to S3
+
+``sdbadmin``
+ Allows for working with SimpleDB domains
+
+``taskadmin``
+ A tool for working with the tasks in SimpleDB
diff --git a/docs/source/index.rst b/docs/source/index.rst
index bc0bef45..d744fc68 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -90,6 +90,7 @@ Currently Supported Services
Additional Resources
--------------------
+* :doc:`Command Line Utilities <commandline>`
* :doc:`Boto Config Tutorial <boto_config_tut>`
* :doc:`Contributing to Boto <contributing>`
* `Boto Source Repository`_
@@ -111,6 +112,8 @@ Release Notes
.. toctree::
:titlesonly:
+ releasenotes/v2.12.0
+ releasenotes/v2.11.0
releasenotes/v2.10.0
releasenotes/v2.9.9
releasenotes/v2.9.8
diff --git a/docs/source/ref/elb.rst b/docs/source/ref/elb.rst
index 74e77f33..aef0c5b4 100644
--- a/docs/source/ref/elb.rst
+++ b/docs/source/ref/elb.rst
@@ -8,40 +8,54 @@ boto.ec2.elb
------------
.. automodule:: boto.ec2.elb
- :members:
+ :members:
:undoc-members:
boto.ec2.elb.healthcheck
------------------------
.. automodule:: boto.ec2.elb.healthcheck
- :members:
+ :members:
:undoc-members:
boto.ec2.elb.instancestate
--------------------------
.. automodule:: boto.ec2.elb.instancestate
- :members:
+ :members:
:undoc-members:
boto.ec2.elb.listelement
------------------------
.. automodule:: boto.ec2.elb.listelement
- :members:
+ :members:
:undoc-members:
boto.ec2.elb.listener
---------------------
.. automodule:: boto.ec2.elb.listener
- :members:
+ :members:
:undoc-members:
boto.ec2.elb.loadbalancer
-------------------------
.. automodule:: boto.ec2.elb.loadbalancer
- :members:
+ :members:
+ :undoc-members:
+
+boto.ec2.elb.policies
+-------------------------
+
+.. automodule:: boto.ec2.elb.policies
+ :members:
+ :undoc-members:
+
+boto.ec2.elb.securitygroup
+-------------------------
+
+.. automodule:: boto.ec2.elb.securitygroup
+ :members:
:undoc-members:
diff --git a/docs/source/releasenotes/v2.12.0.rst b/docs/source/releasenotes/v2.12.0.rst
new file mode 100644
index 00000000..8b713c4b
--- /dev/null
+++ b/docs/source/releasenotes/v2.12.0.rst
@@ -0,0 +1,32 @@
+boto v2.12.0
+============
+
+:date: 2013/09/04
+
+This release adds support for Redis & replication groups to Elasticache as
+well as several bug fixes.
+
+
+Features
+--------
+
+* Added support for Redis & replication groups to Elasticache. (:sha:`f744ff6`)
+
+
+Bugfixes
+--------
+
+* Boto's User-Agent string has changed. Mostly additive to include more
+ information. (:sha:`edb038a`)
+* Headers that are part of S3's signing are now correctly coerced to the proper
+ case. (:issue:`1687`, :sha:`89eae8c`)
+* Altered S3 so that it's possible to track what portions of a multipart upload
+ succeeded. (:issue:`1305`, :issue:`1675`, :sha:`e9a2c59`)
+* Added ``create_lb_policy`` & ``set_lb_policies_of_backend_server`` to ELB.
+ (:issue:`1695`, :sha:`77a9458`)
+* Fixed pagination when listing vaults in Glacier. (:issue:`1699`,
+ :sha:`9afecca`)
+* Several documentation improvements/fixes:
+
+ * Added some docs about what command-line utilities ship with boto.
+ (:sha:`5d7d54d`)
diff --git a/tests/integration/ec2/elb/test_connection.py b/tests/integration/ec2/elb/test_connection.py
index 1661899b..5d11a399 100644
--- a/tests/integration/ec2/elb/test_connection.py
+++ b/tests/integration/ec2/elb/test_connection.py
@@ -118,6 +118,28 @@ class ELBConnectionTest(unittest.TestCase):
# Policy names should be checked here once they are supported
# in the Listener object.
+ def test_create_load_balancer_backend_with_policies(self):
+ other_policy_name = 'enable-proxy-protocol'
+ backend_port = 8081
+ self.conn.create_lb_policy(self.name, other_policy_name,
+ 'ProxyProtocolPolicyType', {'ProxyProtocol': True})
+ self.conn.set_lb_policies_of_backend_server(self.name, backend_port, [other_policy_name])
+
+ balancers = self.conn.get_all_load_balancers(load_balancer_names=[self.name])
+ self.assertEqual([lb.name for lb in balancers], [self.name])
+ self.assertEqual(len(balancers[0].policies.other_policies), 1)
+ self.assertEqual(balancers[0].policies.other_policies[0].policy_name, other_policy_name)
+ self.assertEqual(len(balancers[0].backends), 1)
+ self.assertEqual(balancers[0].backends[0].instance_port, backend_port)
+ self.assertEqual(balancers[0].backends[0].policies[0].policy_name, other_policy_name)
+
+ self.conn.set_lb_policies_of_backend_server(self.name, backend_port, [])
+
+ balancers = self.conn.get_all_load_balancers(load_balancer_names=[self.name])
+ self.assertEqual([lb.name for lb in balancers], [self.name])
+ self.assertEqual(len(balancers[0].policies.other_policies), 1)
+ self.assertEqual(len(balancers[0].backends), 0)
+
def test_create_load_balancer_complex_listeners(self):
complex_listeners = [
(8080, 80, 'HTTP', 'HTTP'),
diff --git a/tests/integration/s3/test_key.py b/tests/integration/s3/test_key.py
index f329e06b..ef5831a9 100644
--- a/tests/integration/s3/test_key.py
+++ b/tests/integration/s3/test_key.py
@@ -383,3 +383,14 @@ class S3KeyTest(unittest.TestCase):
check = self.bucket.get_key('test_date')
self.assertEqual(check.get_metadata('date'), u'20130524T155935Z')
self.assertTrue('x-amz-meta-date' in check._get_remote_metadata())
+
+ def test_header_casing(self):
+ key = self.bucket.new_key('test_header_case')
+ # Using anything but CamelCase on ``Content-Type`` or ``Content-MD5``
+ # used to cause a signature error (when using ``s3`` for signing).
+ key.set_metadata('Content-type', 'application/json')
+ key.set_metadata('Content-md5', 'XmUKnus7svY1frWsVskxXg==')
+ key.set_contents_from_string('{"abc": 123}')
+
+ check = self.bucket.get_key('test_header_case')
+ self.assertEqual(check.content_type, 'application/json')
diff --git a/tests/integration/s3/test_multipart.py b/tests/integration/s3/test_multipart.py
index 51d34a51..2ca42b5c 100644
--- a/tests/integration/s3/test_multipart.py
+++ b/tests/integration/s3/test_multipart.py
@@ -137,3 +137,23 @@ class S3MultiPartUploadTest(unittest.TestCase):
# be a min of 5MB so so we'll assume that is enough
# testing and abort the upload.
mpu.cancel_upload()
+
+ # mpu.upload_part_from_file() now returns the uploaded part
+ # which makes the etag available. Confirm the etag is
+ # available and equal to the etag returned by the parts list.
+ def test_etag_of_parts(self):
+ key_name = "etagtest"
+ mpu = self.bucket.initiate_multipart_upload(key_name)
+ fp = StringIO.StringIO("small file")
+ # upload 2 parts and save each part
+ uparts = []
+ uparts.append(mpu.upload_part_from_file(fp, part_num=1, size=5))
+ uparts.append(mpu.upload_part_from_file(fp, part_num=2))
+ fp.close()
+ # compare uploaded parts etag to listed parts
+ pn = 0
+ for lpart in mpu:
+ self.assertEqual(uparts[pn].etag, lpart.etag)
+ pn += 1
+ # Can't complete 2 small parts so just clean up.
+ mpu.cancel_upload()
diff --git a/tests/unit/ec2/elb/test_loadbalancer.py b/tests/unit/ec2/elb/test_loadbalancer.py
index d5e126c2..2fa69c29 100644
--- a/tests/unit/ec2/elb/test_loadbalancer.py
+++ b/tests/unit/ec2/elb/test_loadbalancer.py
@@ -29,5 +29,83 @@ class TestInstanceStatusResponseParsing(unittest.TestCase):
self.assertEqual(disabled, ['sample-zone'])
+DESCRIBE_RESPONSE = r"""<?xml version="1.0" encoding="UTF-8"?>
+<DescribeLoadBalancersResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/">
+ <DescribeLoadBalancersResult>
+ <LoadBalancerDescriptions>
+ <member>
+ <SecurityGroups/>
+ <CreatedTime>2013-07-09T19:18:00.520Z</CreatedTime>
+ <LoadBalancerName>elb-boto-unit-test</LoadBalancerName>
+ <HealthCheck/>
+ <ListenerDescriptions>
+ <member>
+ <PolicyNames/>
+ <Listener/>
+ </member>
+ </ListenerDescriptions>
+ <Instances/>
+ <Policies>
+ <AppCookieStickinessPolicies/>
+ <OtherPolicies>
+ <member>AWSConsole-SSLNegotiationPolicy-my-test-loadbalancer</member>
+ <member>EnableProxyProtocol</member>
+ </OtherPolicies>
+ <LBCookieStickinessPolicies/>
+ </Policies>
+ <AvailabilityZones>
+ <member>us-east-1a</member>
+ </AvailabilityZones>
+ <CanonicalHostedZoneName>elb-boto-unit-test-408121642.us-east-1.elb.amazonaws.com</CanonicalHostedZoneName>
+ <CanonicalHostedZoneNameID>Z3DZXE0Q79N41H</CanonicalHostedZoneNameID>
+ <Scheme>internet-facing</Scheme>
+ <SourceSecurityGroup>
+ <OwnerAlias>amazon-elb</OwnerAlias>
+ <GroupName>amazon-elb-sg</GroupName>
+ </SourceSecurityGroup>
+ <DNSName>elb-boto-unit-test-408121642.us-east-1.elb.amazonaws.com</DNSName>
+ <BackendServerDescriptions>
+ <member>
+ <PolicyNames>
+ <member>EnableProxyProtocol</member>
+ </PolicyNames>
+ <InstancePort>80</InstancePort>
+ </member>
+ </BackendServerDescriptions>
+ <Subnets/>
+ </member>
+ </LoadBalancerDescriptions>
+ </DescribeLoadBalancersResult>
+ <ResponseMetadata>
+ <RequestId>5763d932-e8cc-11e2-a940-11136cceffb8</RequestId>
+ </ResponseMetadata>
+</DescribeLoadBalancersResponse>
+"""
+
+class TestDescribeLoadBalancers(unittest.TestCase):
+ def test_other_policy(self):
+ elb = ELBConnection(aws_access_key_id='aws_access_key_id',
+ aws_secret_access_key='aws_secret_access_key')
+ mock_response = mock.Mock()
+ mock_response.read.return_value = DESCRIBE_RESPONSE
+ mock_response.status = 200
+ elb.make_request = mock.Mock(return_value=mock_response)
+ load_balancers = elb.get_all_load_balancers()
+ self.assertEqual(len(load_balancers), 1)
+
+ lb = load_balancers[0]
+ self.assertEqual(len(lb.policies.other_policies), 2)
+ self.assertEqual(lb.policies.other_policies[0].policy_name,
+ 'AWSConsole-SSLNegotiationPolicy-my-test-loadbalancer')
+ self.assertEqual(lb.policies.other_policies[1].policy_name,
+ 'EnableProxyProtocol')
+
+ self.assertEqual(len(lb.backends), 1)
+ self.assertEqual(len(lb.backends[0].policies), 1)
+ self.assertEqual(lb.backends[0].policies[0].policy_name,
+ 'EnableProxyProtocol')
+ self.assertEqual(lb.backends[0].instance_port, 80)
+
+
if __name__ == '__main__':
unittest.main()
diff --git a/tests/unit/glacier/test_layer2.py b/tests/unit/glacier/test_layer2.py
index 3a54924a..854904e0 100644
--- a/tests/unit/glacier/test_layer2.py
+++ b/tests/unit/glacier/test_layer2.py
@@ -43,6 +43,40 @@ FIXTURE_VAULT = {
"VaultName" : "examplevault"
}
+FIXTURE_VAULTS = {
+ 'RequestId': 'vuXO7SHTw-luynJ0Zu31AYjR3TcCn7X25r7ykpuulxY2lv8',
+ 'VaultList': [{'SizeInBytes': 0, 'LastInventoryDate': None,
+ 'VaultARN': 'arn:aws:glacier:us-east-1:686406519478:vaults/vault0',
+ 'VaultName': 'vault0', 'NumberOfArchives': 0,
+ 'CreationDate': '2013-05-17T02:38:39.049Z'},
+ {'SizeInBytes': 0, 'LastInventoryDate': None,
+ 'VaultARN': 'arn:aws:glacier:us-east-1:686406519478:vaults/vault3',
+ 'VaultName': 'vault3', 'NumberOfArchives': 0,
+ 'CreationDate': '2013-05-17T02:31:18.659Z'}]}
+
+FIXTURE_PAGINATED_VAULTS = {
+ 'Marker': 'arn:aws:glacier:us-east-1:686406519478:vaults/vault2',
+ 'RequestId': 'vuXO7SHTw-luynJ0Zu31AYjR3TcCn7X25r7ykpuulxY2lv8',
+ 'VaultList': [{'SizeInBytes': 0, 'LastInventoryDate': None,
+ 'VaultARN': 'arn:aws:glacier:us-east-1:686406519478:vaults/vault0',
+ 'VaultName': 'vault0', 'NumberOfArchives': 0,
+ 'CreationDate': '2013-05-17T02:38:39.049Z'},
+ {'SizeInBytes': 0, 'LastInventoryDate': None,
+ 'VaultARN': 'arn:aws:glacier:us-east-1:686406519478:vaults/vault1',
+ 'VaultName': 'vault1', 'NumberOfArchives': 0,
+ 'CreationDate': '2013-05-17T02:31:18.659Z'}]}
+FIXTURE_PAGINATED_VAULTS_CONT = {
+ 'Marker': None,
+ 'RequestId': 'vuXO7SHTw-luynJ0Zu31AYjR3TcCn7X25r7ykpuulxY2lv8',
+ 'VaultList': [{'SizeInBytes': 0, 'LastInventoryDate': None,
+ 'VaultARN': 'arn:aws:glacier:us-east-1:686406519478:vaults/vault2',
+ 'VaultName': 'vault2', 'NumberOfArchives': 0,
+ 'CreationDate': '2013-05-17T02:38:39.049Z'},
+ {'SizeInBytes': 0, 'LastInventoryDate': None,
+ 'VaultARN': 'arn:aws:glacier:us-east-1:686406519478:vaults/vault3',
+ 'VaultName': 'vault3', 'NumberOfArchives': 0,
+ 'CreationDate': '2013-05-17T02:31:18.659Z'}]}
+
FIXTURE_ARCHIVE_JOB = {
"Action": "ArchiveRetrieval",
"ArchiveId": ("NkbByEejwEggmBz2fTHgJrg0XBoDfjP4q6iu87-TjhqG6eGoOY9Z8i1_AUyUs"
@@ -135,10 +169,22 @@ class TestGlacierLayer2Connection(GlacierLayer2Base):
self.assertEqual(vault.size, 78088912)
self.assertEqual(vault.number_of_archives, 192)
- def list_vaults(self):
- self.mock_layer1.list_vaults.return_value = [FIXTURE_VAULT]
+ def test_list_vaults(self):
+ self.mock_layer1.list_vaults.return_value = FIXTURE_VAULTS
+ vaults = self.layer2.list_vaults()
+ self.assertEqual(vaults[0].name, "vault0")
+ self.assertEqual(len(vaults), 2)
+
+ def test_list_vaults_paginated(self):
+ resps = [FIXTURE_PAGINATED_VAULTS, FIXTURE_PAGINATED_VAULTS_CONT]
+ def return_paginated_vaults_resp(marker=None, limit=None):
+ return resps.pop(0)
+
+ self.mock_layer1.list_vaults = Mock(side_effect = return_paginated_vaults_resp)
vaults = self.layer2.list_vaults()
- self.assertEqual(vaults[0].name, "examplevault")
+ self.assertEqual(vaults[0].name, "vault0")
+ self.assertEqual(vaults[3].name, "vault3")
+ self.assertEqual(len(vaults), 4)
class TestVault(GlacierLayer2Base):