comparison env/lib/python3.7/site-packages/boto/elasticache/layer1.py @ 5:9b1c78e6ba9c draft default tip

"planemo upload commit 6c0a8142489327ece472c84e558c47da711a9142"
author shellac
date Mon, 01 Jun 2020 08:59:25 -0400
parents 79f47841a781
children
comparison
equal deleted inserted replaced
4:79f47841a781 5:9b1c78e6ba9c
1 # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the
5 # "Software"), to deal in the Software without restriction, including
6 # without limitation the rights to use, copy, modify, merge, publish, dis-
7 # tribute, sublicense, and/or sell copies of the Software, and to permit
8 # persons to whom the Software is furnished to do so, subject to the fol-
9 # lowing conditions:
10 #
11 # The above copyright notice and this permission notice shall be included
12 # in all copies or substantial portions of the Software.
13 #
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
16 # ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
17 # SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 # IN THE SOFTWARE.
21 #
22
23 import boto
24 from boto.compat import json
25 from boto.connection import AWSQueryConnection
26 from boto.regioninfo import RegionInfo
27
28
29 class ElastiCacheConnection(AWSQueryConnection):
30 """
31 Amazon ElastiCache
32 Amazon ElastiCache is a web service that makes it easier to set
33 up, operate, and scale a distributed cache in the cloud.
34
35 With ElastiCache, customers gain all of the benefits of a high-
36 performance, in-memory cache with far less of the administrative
37 burden of launching and managing a distributed cache. The service
38 makes set-up, scaling, and cluster failure handling much simpler
39 than in a self-managed cache deployment.
40
41 In addition, through integration with Amazon CloudWatch, customers
42 get enhanced visibility into the key performance statistics
43 associated with their cache and can receive alarms if a part of
44 their cache runs hot.
45 """
46 APIVersion = "2013-06-15"
47 DefaultRegionName = "us-east-1"
48 DefaultRegionEndpoint = "elasticache.us-east-1.amazonaws.com"
49
50 def __init__(self, **kwargs):
51 region = kwargs.get('region')
52 if not region:
53 region = RegionInfo(self, self.DefaultRegionName,
54 self.DefaultRegionEndpoint)
55 else:
56 del kwargs['region']
57 kwargs['host'] = region.endpoint
58 super(ElastiCacheConnection, self).__init__(**kwargs)
59 self.region = region
60
61 def _required_auth_capability(self):
62 return ['hmac-v4']
63
64 def authorize_cache_security_group_ingress(self,
65 cache_security_group_name,
66 ec2_security_group_name,
67 ec2_security_group_owner_id):
68 """
69 The AuthorizeCacheSecurityGroupIngress operation allows
70 network ingress to a cache security group. Applications using
71 ElastiCache must be running on Amazon EC2, and Amazon EC2
72 security groups are used as the authorization mechanism.
73 You cannot authorize ingress from an Amazon EC2 security group
74 in one Region to an ElastiCache cluster in another Region.
75
76 :type cache_security_group_name: string
77 :param cache_security_group_name: The cache security group which will
78 allow network ingress.
79
80 :type ec2_security_group_name: string
81 :param ec2_security_group_name: The Amazon EC2 security group to be
82 authorized for ingress to the cache security group.
83
84 :type ec2_security_group_owner_id: string
85 :param ec2_security_group_owner_id: The AWS account number of the
86 Amazon EC2 security group owner. Note that this is not the same
87 thing as an AWS access key ID - you must provide a valid AWS
88 account number for this parameter.
89
90 """
91 params = {
92 'CacheSecurityGroupName': cache_security_group_name,
93 'EC2SecurityGroupName': ec2_security_group_name,
94 'EC2SecurityGroupOwnerId': ec2_security_group_owner_id,
95 }
96 return self._make_request(
97 action='AuthorizeCacheSecurityGroupIngress',
98 verb='POST',
99 path='/', params=params)
100
101 def create_cache_cluster(self, cache_cluster_id, num_cache_nodes=None,
102 cache_node_type=None, engine=None,
103 replication_group_id=None, engine_version=None,
104 cache_parameter_group_name=None,
105 cache_subnet_group_name=None,
106 cache_security_group_names=None,
107 security_group_ids=None, snapshot_arns=None,
108 preferred_availability_zone=None,
109 preferred_maintenance_window=None, port=None,
110 notification_topic_arn=None,
111 auto_minor_version_upgrade=None):
112 """
113 The CreateCacheCluster operation creates a new cache cluster.
114 All nodes in the cache cluster run the same protocol-compliant
115 cache engine software - either Memcached or Redis.
116
117 :type cache_cluster_id: string
118 :param cache_cluster_id:
119 The cache cluster identifier. This parameter is stored as a lowercase
120 string.
121
122 Constraints:
123
124
125 + Must contain from 1 to 20 alphanumeric characters or hyphens.
126 + First character must be a letter.
127 + Cannot end with a hyphen or contain two consecutive hyphens.
128
129 :type replication_group_id: string
130 :param replication_group_id: The replication group to which this cache
131 cluster should belong. If this parameter is specified, the cache
132 cluster will be added to the specified replication group as a read
133 replica; otherwise, the cache cluster will be a standalone primary
134 that is not part of any replication group.
135
136 :type num_cache_nodes: integer
137 :param num_cache_nodes: The initial number of cache nodes that the
138 cache cluster will have.
139 For a Memcached cluster, valid values are between 1 and 20. If you need
140 to exceed this limit, please fill out the ElastiCache Limit
141 Increase Request form at ``_ .
142
143 For Redis, only single-node cache clusters are supported at this time,
144 so the value for this parameter must be 1.
145
146 :type cache_node_type: string
147 :param cache_node_type: The compute and memory capacity of the nodes in
148 the cache cluster.
149 Valid values for Memcached:
150
151 `cache.t1.micro` | `cache.m1.small` | `cache.m1.medium` |
152 `cache.m1.large` | `cache.m1.xlarge` | `cache.m3.xlarge` |
153 `cache.m3.2xlarge` | `cache.m2.xlarge` | `cache.m2.2xlarge` |
154 `cache.m2.4xlarge` | `cache.c1.xlarge`
155
156 Valid values for Redis:
157
158 `cache.t1.micro` | `cache.m1.small` | `cache.m1.medium` |
159 `cache.m1.large` | `cache.m1.xlarge` | `cache.m2.xlarge` |
160 `cache.m2.2xlarge` | `cache.m2.4xlarge` | `cache.c1.xlarge`
161
162 For a complete listing of cache node types and specifications, see `.
163
164 :type engine: string
165 :param engine: The name of the cache engine to be used for this cache
166 cluster.
167 Valid values for this parameter are:
168
169 `memcached` | `redis`
170
171 :type engine_version: string
172 :param engine_version: The version number of the cache engine to be
173 used for this cluster. To view the supported cache engine versions,
174 use the DescribeCacheEngineVersions operation.
175
176 :type cache_parameter_group_name: string
177 :param cache_parameter_group_name: The name of the cache parameter
178 group to associate with this cache cluster. If this argument is
179 omitted, the default cache parameter group for the specified engine
180 will be used.
181
182 :type cache_subnet_group_name: string
183 :param cache_subnet_group_name: The name of the cache subnet group to
184 be used for the cache cluster.
185 Use this parameter only when you are creating a cluster in an Amazon
186 Virtual Private Cloud (VPC).
187
188 :type cache_security_group_names: list
189 :param cache_security_group_names: A list of cache security group names
190 to associate with this cache cluster.
191 Use this parameter only when you are creating a cluster outside of an
192 Amazon Virtual Private Cloud (VPC).
193
194 :type security_group_ids: list
195 :param security_group_ids: One or more VPC security groups associated
196 with the cache cluster.
197 Use this parameter only when you are creating a cluster in an Amazon
198 Virtual Private Cloud (VPC).
199
200 :type snapshot_arns: list
201 :param snapshot_arns: A single-element string list containing an Amazon
202 Resource Name (ARN) that uniquely identifies a Redis RDB snapshot
203 file stored in Amazon S3. The snapshot file will be used to
204 populate the Redis cache in the new cache cluster. The Amazon S3
205 object name in the ARN cannot contain any commas.
206 Here is an example of an Amazon S3 ARN:
207 `arn:aws:s3:::my_bucket/snapshot1.rdb`
208
209 **Note:** This parameter is only valid if the `Engine` parameter is
210 `redis`.
211
212 :type preferred_availability_zone: string
213 :param preferred_availability_zone: The EC2 Availability Zone in which
214 the cache cluster will be created.
215 All cache nodes belonging to a cache cluster are placed in the
216 preferred availability zone.
217
218 Default: System chosen availability zone.
219
220 :type preferred_maintenance_window: string
221 :param preferred_maintenance_window: The weekly time range (in UTC)
222 during which system maintenance can occur.
223 Example: `sun:05:00-sun:09:00`
224
225 :type port: integer
226 :param port: The port number on which each of the cache nodes will
227 accept connections.
228
229 :type notification_topic_arn: string
230 :param notification_topic_arn:
231 The Amazon Resource Name (ARN) of the Amazon Simple Notification
232 Service (SNS) topic to which notifications will be sent.
233
234 The Amazon SNS topic owner must be the same as the cache cluster owner.
235
236 :type auto_minor_version_upgrade: boolean
237 :param auto_minor_version_upgrade: Determines whether minor engine
238 upgrades will be applied automatically to the cache cluster during
239 the maintenance window. A value of `True` allows these upgrades to
240 occur; `False` disables automatic upgrades.
241 Default: `True`
242
243 """
244 params = {
245 'CacheClusterId': cache_cluster_id,
246 }
247 if num_cache_nodes is not None:
248 params['NumCacheNodes'] = num_cache_nodes
249 if cache_node_type is not None:
250 params['CacheNodeType'] = cache_node_type
251 if engine is not None:
252 params['Engine'] = engine
253 if replication_group_id is not None:
254 params['ReplicationGroupId'] = replication_group_id
255 if engine_version is not None:
256 params['EngineVersion'] = engine_version
257 if cache_parameter_group_name is not None:
258 params['CacheParameterGroupName'] = cache_parameter_group_name
259 if cache_subnet_group_name is not None:
260 params['CacheSubnetGroupName'] = cache_subnet_group_name
261 if cache_security_group_names is not None:
262 self.build_list_params(params,
263 cache_security_group_names,
264 'CacheSecurityGroupNames.member')
265 if security_group_ids is not None:
266 self.build_list_params(params,
267 security_group_ids,
268 'SecurityGroupIds.member')
269 if snapshot_arns is not None:
270 self.build_list_params(params,
271 snapshot_arns,
272 'SnapshotArns.member')
273 if preferred_availability_zone is not None:
274 params['PreferredAvailabilityZone'] = preferred_availability_zone
275 if preferred_maintenance_window is not None:
276 params['PreferredMaintenanceWindow'] = preferred_maintenance_window
277 if port is not None:
278 params['Port'] = port
279 if notification_topic_arn is not None:
280 params['NotificationTopicArn'] = notification_topic_arn
281 if auto_minor_version_upgrade is not None:
282 params['AutoMinorVersionUpgrade'] = str(
283 auto_minor_version_upgrade).lower()
284 return self._make_request(
285 action='CreateCacheCluster',
286 verb='POST',
287 path='/', params=params)
288
289 def create_cache_parameter_group(self, cache_parameter_group_name,
290 cache_parameter_group_family,
291 description):
292 """
293 The CreateCacheParameterGroup operation creates a new cache
294 parameter group. A cache parameter group is a collection of
295 parameters that you apply to all of the nodes in a cache
296 cluster.
297
298 :type cache_parameter_group_name: string
299 :param cache_parameter_group_name: A user-specified name for the cache
300 parameter group.
301
302 :type cache_parameter_group_family: string
303 :param cache_parameter_group_family: The name of the cache parameter
304 group family the cache parameter group can be used with.
305 Valid values are: `memcached1.4` | `redis2.6`
306
307 :type description: string
308 :param description: A user-specified description for the cache
309 parameter group.
310
311 """
312 params = {
313 'CacheParameterGroupName': cache_parameter_group_name,
314 'CacheParameterGroupFamily': cache_parameter_group_family,
315 'Description': description,
316 }
317 return self._make_request(
318 action='CreateCacheParameterGroup',
319 verb='POST',
320 path='/', params=params)
321
322 def create_cache_security_group(self, cache_security_group_name,
323 description):
324 """
325 The CreateCacheSecurityGroup operation creates a new cache
326 security group. Use a cache security group to control access
327 to one or more cache clusters.
328
329 Cache security groups are only used when you are creating a
330 cluster outside of an Amazon Virtual Private Cloud (VPC). If
331 you are creating a cluster inside of a VPC, use a cache subnet
332 group instead. For more information, see
333 CreateCacheSubnetGroup .
334
335 :type cache_security_group_name: string
336 :param cache_security_group_name: A name for the cache security group.
337 This value is stored as a lowercase string.
338 Constraints: Must contain no more than 255 alphanumeric characters.
339 Must not be the word "Default".
340
341 Example: `mysecuritygroup`
342
343 :type description: string
344 :param description: A description for the cache security group.
345
346 """
347 params = {
348 'CacheSecurityGroupName': cache_security_group_name,
349 'Description': description,
350 }
351 return self._make_request(
352 action='CreateCacheSecurityGroup',
353 verb='POST',
354 path='/', params=params)
355
356 def create_cache_subnet_group(self, cache_subnet_group_name,
357 cache_subnet_group_description, subnet_ids):
358 """
359 The CreateCacheSubnetGroup operation creates a new cache
360 subnet group.
361
362 Use this parameter only when you are creating a cluster in an
363 Amazon Virtual Private Cloud (VPC).
364
365 :type cache_subnet_group_name: string
366 :param cache_subnet_group_name: A name for the cache subnet group. This
367 value is stored as a lowercase string.
368 Constraints: Must contain no more than 255 alphanumeric characters or
369 hyphens.
370
371 Example: `mysubnetgroup`
372
373 :type cache_subnet_group_description: string
374 :param cache_subnet_group_description: A description for the cache
375 subnet group.
376
377 :type subnet_ids: list
378 :param subnet_ids: A list of VPC subnet IDs for the cache subnet group.
379
380 """
381 params = {
382 'CacheSubnetGroupName': cache_subnet_group_name,
383 'CacheSubnetGroupDescription': cache_subnet_group_description,
384 }
385 self.build_list_params(params,
386 subnet_ids,
387 'SubnetIds.member')
388 return self._make_request(
389 action='CreateCacheSubnetGroup',
390 verb='POST',
391 path='/', params=params)
392
393 def create_replication_group(self, replication_group_id,
394 primary_cluster_id,
395 replication_group_description):
396 """
397 The CreateReplicationGroup operation creates a replication
398 group. A replication group is a collection of cache clusters,
399 where one of the clusters is a read/write primary and the
400 other clusters are read-only replicas. Writes to the primary
401 are automatically propagated to the replicas.
402
403 When you create a replication group, you must specify an
404 existing cache cluster that is in the primary role. When the
405 replication group has been successfully created, you can add
406 one or more read replica replicas to it, up to a total of five
407 read replicas.
408
409 :type replication_group_id: string
410 :param replication_group_id:
411 The replication group identifier. This parameter is stored as a
412 lowercase string.
413
414 Constraints:
415
416
417 + Must contain from 1 to 20 alphanumeric characters or hyphens.
418 + First character must be a letter.
419 + Cannot end with a hyphen or contain two consecutive hyphens.
420
421 :type primary_cluster_id: string
422 :param primary_cluster_id: The identifier of the cache cluster that
423 will serve as the primary for this replication group. This cache
424 cluster must already exist and have a status of available .
425
426 :type replication_group_description: string
427 :param replication_group_description: A user-specified description for
428 the replication group.
429
430 """
431 params = {
432 'ReplicationGroupId': replication_group_id,
433 'PrimaryClusterId': primary_cluster_id,
434 'ReplicationGroupDescription': replication_group_description,
435 }
436 return self._make_request(
437 action='CreateReplicationGroup',
438 verb='POST',
439 path='/', params=params)
440
441 def delete_cache_cluster(self, cache_cluster_id):
442 """
443 The DeleteCacheCluster operation deletes a previously
444 provisioned cache cluster. DeleteCacheCluster deletes all
445 associated cache nodes, node endpoints and the cache cluster
446 itself. When you receive a successful response from this
447 operation, Amazon ElastiCache immediately begins deleting the
448 cache cluster; you cannot cancel or revert this operation.
449
450 :type cache_cluster_id: string
451 :param cache_cluster_id: The cache cluster identifier for the cluster
452 to be deleted. This parameter is not case sensitive.
453
454 """
455 params = {'CacheClusterId': cache_cluster_id, }
456 return self._make_request(
457 action='DeleteCacheCluster',
458 verb='POST',
459 path='/', params=params)
460
461 def delete_cache_parameter_group(self, cache_parameter_group_name):
462 """
463 The DeleteCacheParameterGroup operation deletes the specified
464 cache parameter group. You cannot delete a cache parameter
465 group if it is associated with any cache clusters.
466
467 :type cache_parameter_group_name: string
468 :param cache_parameter_group_name:
469 The name of the cache parameter group to delete.
470
471 The specified cache security group must not be associated with any
472 cache clusters.
473
474 """
475 params = {
476 'CacheParameterGroupName': cache_parameter_group_name,
477 }
478 return self._make_request(
479 action='DeleteCacheParameterGroup',
480 verb='POST',
481 path='/', params=params)
482
483 def delete_cache_security_group(self, cache_security_group_name):
484 """
485 The DeleteCacheSecurityGroup operation deletes a cache
486 security group.
487 You cannot delete a cache security group if it is associated
488 with any cache clusters.
489
490 :type cache_security_group_name: string
491 :param cache_security_group_name:
492 The name of the cache security group to delete.
493
494 You cannot delete the default security group.
495
496 """
497 params = {
498 'CacheSecurityGroupName': cache_security_group_name,
499 }
500 return self._make_request(
501 action='DeleteCacheSecurityGroup',
502 verb='POST',
503 path='/', params=params)
504
505 def delete_cache_subnet_group(self, cache_subnet_group_name):
506 """
507 The DeleteCacheSubnetGroup operation deletes a cache subnet
508 group.
509 You cannot delete a cache subnet group if it is associated
510 with any cache clusters.
511
512 :type cache_subnet_group_name: string
513 :param cache_subnet_group_name: The name of the cache subnet group to
514 delete.
515 Constraints: Must contain no more than 255 alphanumeric characters or
516 hyphens.
517
518 """
519 params = {'CacheSubnetGroupName': cache_subnet_group_name, }
520 return self._make_request(
521 action='DeleteCacheSubnetGroup',
522 verb='POST',
523 path='/', params=params)
524
525 def delete_replication_group(self, replication_group_id):
526 """
527 The DeleteReplicationGroup operation deletes an existing
528 replication group. DeleteReplicationGroup deletes the primary
529 cache cluster and all of the read replicas in the replication
530 group. When you receive a successful response from this
531 operation, Amazon ElastiCache immediately begins deleting the
532 entire replication group; you cannot cancel or revert this
533 operation.
534
535 :type replication_group_id: string
536 :param replication_group_id: The identifier for the replication group
537 to be deleted. This parameter is not case sensitive.
538
539 """
540 params = {'ReplicationGroupId': replication_group_id, }
541 return self._make_request(
542 action='DeleteReplicationGroup',
543 verb='POST',
544 path='/', params=params)
545
546 def describe_cache_clusters(self, cache_cluster_id=None,
547 max_records=None, marker=None,
548 show_cache_node_info=None):
549 """
550 The DescribeCacheClusters operation returns information about
551 all provisioned cache clusters if no cache cluster identifier
552 is specified, or about a specific cache cluster if a cache
553 cluster identifier is supplied.
554
555 By default, abbreviated information about the cache
556 clusters(s) will be returned. You can use the optional
557 ShowDetails flag to retrieve detailed information about the
558 cache nodes associated with the cache clusters. These details
559 include the DNS address and port for the cache node endpoint.
560
561 If the cluster is in the CREATING state, only cluster level
562 information will be displayed until all of the nodes are
563 successfully provisioned.
564
565 If the cluster is in the DELETING state, only cluster level
566 information will be displayed.
567
568 If cache nodes are currently being added to the cache cluster,
569 node endpoint information and creation time for the additional
570 nodes will not be displayed until they are completely
571 provisioned. When the cache cluster state is available , the
572 cluster is ready for use.
573
574 If cache nodes are currently being removed from the cache
575 cluster, no endpoint information for the removed nodes is
576 displayed.
577
578 :type cache_cluster_id: string
579 :param cache_cluster_id: The user-supplied cluster identifier. If this
580 parameter is specified, only information about that specific cache
581 cluster is returned. This parameter isn't case sensitive.
582
583 :type max_records: integer
584 :param max_records: The maximum number of records to include in the
585 response. If more records exist than the specified `MaxRecords`
586 value, a marker is included in the response so that the remaining
587 results can be retrieved.
588 Default: 100
589
590 Constraints: minimum 20; maximum 100.
591
592 :type marker: string
593 :param marker: An optional marker returned from a prior request. Use
594 this marker for pagination of results from this operation. If this
595 parameter is specified, the response includes only records beyond
596 the marker, up to the value specified by MaxRecords .
597
598 :type show_cache_node_info: boolean
599 :param show_cache_node_info: An optional flag that can be included in
600 the DescribeCacheCluster request to retrieve information about the
601 individual cache nodes.
602
603 """
604 params = {}
605 if cache_cluster_id is not None:
606 params['CacheClusterId'] = cache_cluster_id
607 if max_records is not None:
608 params['MaxRecords'] = max_records
609 if marker is not None:
610 params['Marker'] = marker
611 if show_cache_node_info is not None:
612 params['ShowCacheNodeInfo'] = str(
613 show_cache_node_info).lower()
614 return self._make_request(
615 action='DescribeCacheClusters',
616 verb='POST',
617 path='/', params=params)
618
619 def describe_cache_engine_versions(self, engine=None,
620 engine_version=None,
621 cache_parameter_group_family=None,
622 max_records=None, marker=None,
623 default_only=None):
624 """
625 The DescribeCacheEngineVersions operation returns a list of
626 the available cache engines and their versions.
627
628 :type engine: string
629 :param engine: The cache engine to return. Valid values: `memcached` |
630 `redis`
631
632 :type engine_version: string
633 :param engine_version: The cache engine version to return.
634 Example: `1.4.14`
635
636 :type cache_parameter_group_family: string
637 :param cache_parameter_group_family:
638 The name of a specific cache parameter group family to return details
639 for.
640
641 Constraints:
642
643
644 + Must be 1 to 255 alphanumeric characters
645 + First character must be a letter
646 + Cannot end with a hyphen or contain two consecutive hyphens
647
648 :type max_records: integer
649 :param max_records: The maximum number of records to include in the
650 response. If more records exist than the specified `MaxRecords`
651 value, a marker is included in the response so that the remaining
652 results can be retrieved.
653 Default: 100
654
655 Constraints: minimum 20; maximum 100.
656
657 :type marker: string
658 :param marker: An optional marker returned from a prior request. Use
659 this marker for pagination of results from this operation. If this
660 parameter is specified, the response includes only records beyond
661 the marker, up to the value specified by MaxRecords .
662
663 :type default_only: boolean
664 :param default_only: If true , specifies that only the default version
665 of the specified engine or engine and major version combination is
666 to be returned.
667
668 """
669 params = {}
670 if engine is not None:
671 params['Engine'] = engine
672 if engine_version is not None:
673 params['EngineVersion'] = engine_version
674 if cache_parameter_group_family is not None:
675 params['CacheParameterGroupFamily'] = cache_parameter_group_family
676 if max_records is not None:
677 params['MaxRecords'] = max_records
678 if marker is not None:
679 params['Marker'] = marker
680 if default_only is not None:
681 params['DefaultOnly'] = str(
682 default_only).lower()
683 return self._make_request(
684 action='DescribeCacheEngineVersions',
685 verb='POST',
686 path='/', params=params)
687
688 def describe_cache_parameter_groups(self,
689 cache_parameter_group_name=None,
690 max_records=None, marker=None):
691 """
692 The DescribeCacheParameterGroups operation returns a list of
693 cache parameter group descriptions. If a cache parameter group
694 name is specified, the list will contain only the descriptions
695 for that group.
696
697 :type cache_parameter_group_name: string
698 :param cache_parameter_group_name: The name of a specific cache
699 parameter group to return details for.
700
701 :type max_records: integer
702 :param max_records: The maximum number of records to include in the
703 response. If more records exist than the specified `MaxRecords`
704 value, a marker is included in the response so that the remaining
705 results can be retrieved.
706 Default: 100
707
708 Constraints: minimum 20; maximum 100.
709
710 :type marker: string
711 :param marker: An optional marker returned from a prior request. Use
712 this marker for pagination of results from this operation. If this
713 parameter is specified, the response includes only records beyond
714 the marker, up to the value specified by MaxRecords .
715
716 """
717 params = {}
718 if cache_parameter_group_name is not None:
719 params['CacheParameterGroupName'] = cache_parameter_group_name
720 if max_records is not None:
721 params['MaxRecords'] = max_records
722 if marker is not None:
723 params['Marker'] = marker
724 return self._make_request(
725 action='DescribeCacheParameterGroups',
726 verb='POST',
727 path='/', params=params)
728
729 def describe_cache_parameters(self, cache_parameter_group_name,
730 source=None, max_records=None, marker=None):
731 """
732 The DescribeCacheParameters operation returns the detailed
733 parameter list for a particular cache parameter group.
734
735 :type cache_parameter_group_name: string
736 :param cache_parameter_group_name: The name of a specific cache
737 parameter group to return details for.
738
739 :type source: string
740 :param source: The parameter types to return.
741 Valid values: `user` | `system` | `engine-default`
742
743 :type max_records: integer
744 :param max_records: The maximum number of records to include in the
745 response. If more records exist than the specified `MaxRecords`
746 value, a marker is included in the response so that the remaining
747 results can be retrieved.
748 Default: 100
749
750 Constraints: minimum 20; maximum 100.
751
752 :type marker: string
753 :param marker: An optional marker returned from a prior request. Use
754 this marker for pagination of results from this operation. If this
755 parameter is specified, the response includes only records beyond
756 the marker, up to the value specified by MaxRecords .
757
758 """
759 params = {
760 'CacheParameterGroupName': cache_parameter_group_name,
761 }
762 if source is not None:
763 params['Source'] = source
764 if max_records is not None:
765 params['MaxRecords'] = max_records
766 if marker is not None:
767 params['Marker'] = marker
768 return self._make_request(
769 action='DescribeCacheParameters',
770 verb='POST',
771 path='/', params=params)
772
773 def describe_cache_security_groups(self, cache_security_group_name=None,
774 max_records=None, marker=None):
775 """
776 The DescribeCacheSecurityGroups operation returns a list of
777 cache security group descriptions. If a cache security group
778 name is specified, the list will contain only the description
779 of that group.
780
781 :type cache_security_group_name: string
782 :param cache_security_group_name: The name of the cache security group
783 to return details for.
784
785 :type max_records: integer
786 :param max_records: The maximum number of records to include in the
787 response. If more records exist than the specified `MaxRecords`
788 value, a marker is included in the response so that the remaining
789 results can be retrieved.
790 Default: 100
791
792 Constraints: minimum 20; maximum 100.
793
794 :type marker: string
795 :param marker: An optional marker returned from a prior request. Use
796 this marker for pagination of results from this operation. If this
797 parameter is specified, the response includes only records beyond
798 the marker, up to the value specified by MaxRecords .
799
800 """
801 params = {}
802 if cache_security_group_name is not None:
803 params['CacheSecurityGroupName'] = cache_security_group_name
804 if max_records is not None:
805 params['MaxRecords'] = max_records
806 if marker is not None:
807 params['Marker'] = marker
808 return self._make_request(
809 action='DescribeCacheSecurityGroups',
810 verb='POST',
811 path='/', params=params)
812
813 def describe_cache_subnet_groups(self, cache_subnet_group_name=None,
814 max_records=None, marker=None):
815 """
816 The DescribeCacheSubnetGroups operation returns a list of
817 cache subnet group descriptions. If a subnet group name is
818 specified, the list will contain only the description of that
819 group.
820
821 :type cache_subnet_group_name: string
822 :param cache_subnet_group_name: The name of the cache subnet group to
823 return details for.
824
825 :type max_records: integer
826 :param max_records: The maximum number of records to include in the
827 response. If more records exist than the specified `MaxRecords`
828 value, a marker is included in the response so that the remaining
829 results can be retrieved.
830 Default: 100
831
832 Constraints: minimum 20; maximum 100.
833
834 :type marker: string
835 :param marker: An optional marker returned from a prior request. Use
836 this marker for pagination of results from this operation. If this
837 parameter is specified, the response includes only records beyond
838 the marker, up to the value specified by MaxRecords .
839
840 """
841 params = {}
842 if cache_subnet_group_name is not None:
843 params['CacheSubnetGroupName'] = cache_subnet_group_name
844 if max_records is not None:
845 params['MaxRecords'] = max_records
846 if marker is not None:
847 params['Marker'] = marker
848 return self._make_request(
849 action='DescribeCacheSubnetGroups',
850 verb='POST',
851 path='/', params=params)
852
853 def describe_engine_default_parameters(self,
854 cache_parameter_group_family,
855 max_records=None, marker=None):
856 """
857 The DescribeEngineDefaultParameters operation returns the
858 default engine and system parameter information for the
859 specified cache engine.
860
861 :type cache_parameter_group_family: string
862 :param cache_parameter_group_family: The name of the cache parameter
863 group family. Valid values are: `memcached1.4` | `redis2.6`
864
865 :type max_records: integer
866 :param max_records: The maximum number of records to include in the
867 response. If more records exist than the specified `MaxRecords`
868 value, a marker is included in the response so that the remaining
869 results can be retrieved.
870 Default: 100
871
872 Constraints: minimum 20; maximum 100.
873
874 :type marker: string
875 :param marker: An optional marker returned from a prior request. Use
876 this marker for pagination of results from this operation. If this
877 parameter is specified, the response includes only records beyond
878 the marker, up to the value specified by MaxRecords .
879
880 """
881 params = {
882 'CacheParameterGroupFamily': cache_parameter_group_family,
883 }
884 if max_records is not None:
885 params['MaxRecords'] = max_records
886 if marker is not None:
887 params['Marker'] = marker
888 return self._make_request(
889 action='DescribeEngineDefaultParameters',
890 verb='POST',
891 path='/', params=params)
892
893 def describe_events(self, source_identifier=None, source_type=None,
894 start_time=None, end_time=None, duration=None,
895 max_records=None, marker=None):
896 """
897 The DescribeEvents operation returns events related to cache
898 clusters, cache security groups, and cache parameter groups.
899 You can obtain events specific to a particular cache cluster,
900 cache security group, or cache parameter group by providing
901 the name as a parameter.
902
903 By default, only the events occurring within the last hour are
904 returned; however, you can retrieve up to 14 days' worth of
905 events if necessary.
906
907 :type source_identifier: string
908 :param source_identifier: The identifier of the event source for which
909 events will be returned. If not specified, then all sources are
910 included in the response.
911
912 :type source_type: string
913 :param source_type: The event source to retrieve events for. If no
914 value is specified, all events are returned.
915 Valid values are: `cache-cluster` | `cache-parameter-group` | `cache-
916 security-group` | `cache-subnet-group`
917
918 :type start_time: timestamp
919 :param start_time: The beginning of the time interval to retrieve
920 events for, specified in ISO 8601 format.
921
922 :type end_time: timestamp
923 :param end_time: The end of the time interval for which to retrieve
924 events, specified in ISO 8601 format.
925
926 :type duration: integer
927 :param duration: The number of minutes' worth of events to retrieve.
928
929 :type max_records: integer
930 :param max_records: The maximum number of records to include in the
931 response. If more records exist than the specified `MaxRecords`
932 value, a marker is included in the response so that the remaining
933 results can be retrieved.
934 Default: 100
935
936 Constraints: minimum 20; maximum 100.
937
938 :type marker: string
939 :param marker: An optional marker returned from a prior request. Use
940 this marker for pagination of results from this operation. If this
941 parameter is specified, the response includes only records beyond
942 the marker, up to the value specified by MaxRecords .
943
944 """
945 params = {}
946 if source_identifier is not None:
947 params['SourceIdentifier'] = source_identifier
948 if source_type is not None:
949 params['SourceType'] = source_type
950 if start_time is not None:
951 params['StartTime'] = start_time
952 if end_time is not None:
953 params['EndTime'] = end_time
954 if duration is not None:
955 params['Duration'] = duration
956 if max_records is not None:
957 params['MaxRecords'] = max_records
958 if marker is not None:
959 params['Marker'] = marker
960 return self._make_request(
961 action='DescribeEvents',
962 verb='POST',
963 path='/', params=params)
964
965 def describe_replication_groups(self, replication_group_id=None,
966 max_records=None, marker=None):
967 """
968 The DescribeReplicationGroups operation returns information
969 about a particular replication group. If no identifier is
970 specified, DescribeReplicationGroups returns information about
971 all replication groups.
972
973 :type replication_group_id: string
974 :param replication_group_id: The identifier for the replication group
975 to be described. This parameter is not case sensitive.
976 If you do not specify this parameter, information about all replication
977 groups is returned.
978
979 :type max_records: integer
980 :param max_records: The maximum number of records to include in the
981 response. If more records exist than the specified `MaxRecords`
982 value, a marker is included in the response so that the remaining
983 results can be retrieved.
984 Default: 100
985
986 Constraints: minimum 20; maximum 100.
987
988 :type marker: string
989 :param marker: An optional marker returned from a prior request. Use
990 this marker for pagination of results from this operation. If this
991 parameter is specified, the response includes only records beyond
992 the marker, up to the value specified by MaxRecords .
993
994 """
995 params = {}
996 if replication_group_id is not None:
997 params['ReplicationGroupId'] = replication_group_id
998 if max_records is not None:
999 params['MaxRecords'] = max_records
1000 if marker is not None:
1001 params['Marker'] = marker
1002 return self._make_request(
1003 action='DescribeReplicationGroups',
1004 verb='POST',
1005 path='/', params=params)
1006
1007 def describe_reserved_cache_nodes(self, reserved_cache_node_id=None,
1008 reserved_cache_nodes_offering_id=None,
1009 cache_node_type=None, duration=None,
1010 product_description=None,
1011 offering_type=None, max_records=None,
1012 marker=None):
1013 """
1014 The DescribeReservedCacheNodes operation returns information
1015 about reserved cache nodes for this account, or about a
1016 specified reserved cache node.
1017
1018 :type reserved_cache_node_id: string
1019 :param reserved_cache_node_id: The reserved cache node identifier
1020 filter value. Use this parameter to show only the reservation that
1021 matches the specified reservation ID.
1022
1023 :type reserved_cache_nodes_offering_id: string
1024 :param reserved_cache_nodes_offering_id: The offering identifier filter
1025 value. Use this parameter to show only purchased reservations
1026 matching the specified offering identifier.
1027
1028 :type cache_node_type: string
1029 :param cache_node_type: The cache node type filter value. Use this
1030 parameter to show only those reservations matching the specified
1031 cache node type.
1032
1033 :type duration: string
1034 :param duration: The duration filter value, specified in years or
1035 seconds. Use this parameter to show only reservations for this
1036 duration.
1037 Valid Values: `1 | 3 | 31536000 | 94608000`
1038
1039 :type product_description: string
1040 :param product_description: The product description filter value. Use
1041 this parameter to show only those reservations matching the
1042 specified product description.
1043
1044 :type offering_type: string
1045 :param offering_type: The offering type filter value. Use this
1046 parameter to show only the available offerings matching the
1047 specified offering type.
1048 Valid values: `"Light Utilization" | "Medium Utilization" | "Heavy
1049 Utilization" `
1050
1051 :type max_records: integer
1052 :param max_records: The maximum number of records to include in the
1053 response. If more records exist than the specified `MaxRecords`
1054 value, a marker is included in the response so that the remaining
1055 results can be retrieved.
1056 Default: 100
1057
1058 Constraints: minimum 20; maximum 100.
1059
1060 :type marker: string
1061 :param marker: An optional marker returned from a prior request. Use
1062 this marker for pagination of results from this operation. If this
1063 parameter is specified, the response includes only records beyond
1064 the marker, up to the value specified by MaxRecords .
1065
1066 """
1067 params = {}
1068 if reserved_cache_node_id is not None:
1069 params['ReservedCacheNodeId'] = reserved_cache_node_id
1070 if reserved_cache_nodes_offering_id is not None:
1071 params['ReservedCacheNodesOfferingId'] = reserved_cache_nodes_offering_id
1072 if cache_node_type is not None:
1073 params['CacheNodeType'] = cache_node_type
1074 if duration is not None:
1075 params['Duration'] = duration
1076 if product_description is not None:
1077 params['ProductDescription'] = product_description
1078 if offering_type is not None:
1079 params['OfferingType'] = offering_type
1080 if max_records is not None:
1081 params['MaxRecords'] = max_records
1082 if marker is not None:
1083 params['Marker'] = marker
1084 return self._make_request(
1085 action='DescribeReservedCacheNodes',
1086 verb='POST',
1087 path='/', params=params)
1088
1089 def describe_reserved_cache_nodes_offerings(self,
1090 reserved_cache_nodes_offering_id=None,
1091 cache_node_type=None,
1092 duration=None,
1093 product_description=None,
1094 offering_type=None,
1095 max_records=None,
1096 marker=None):
1097 """
1098 The DescribeReservedCacheNodesOfferings operation lists
1099 available reserved cache node offerings.
1100
1101 :type reserved_cache_nodes_offering_id: string
1102 :param reserved_cache_nodes_offering_id: The offering identifier filter
1103 value. Use this parameter to show only the available offering that
1104 matches the specified reservation identifier.
1105 Example: `438012d3-4052-4cc7-b2e3-8d3372e0e706`
1106
1107 :type cache_node_type: string
1108 :param cache_node_type: The cache node type filter value. Use this
1109 parameter to show only the available offerings matching the
1110 specified cache node type.
1111
1112 :type duration: string
1113 :param duration: Duration filter value, specified in years or seconds.
1114 Use this parameter to show only reservations for a given duration.
1115 Valid Values: `1 | 3 | 31536000 | 94608000`
1116
1117 :type product_description: string
1118 :param product_description: The product description filter value. Use
1119 this parameter to show only the available offerings matching the
1120 specified product description.
1121
1122 :type offering_type: string
1123 :param offering_type: The offering type filter value. Use this
1124 parameter to show only the available offerings matching the
1125 specified offering type.
1126 Valid Values: `"Light Utilization" | "Medium Utilization" | "Heavy
1127 Utilization" `
1128
1129 :type max_records: integer
1130 :param max_records: The maximum number of records to include in the
1131 response. If more records exist than the specified `MaxRecords`
1132 value, a marker is included in the response so that the remaining
1133 results can be retrieved.
1134 Default: 100
1135
1136 Constraints: minimum 20; maximum 100.
1137
1138 :type marker: string
1139 :param marker: An optional marker returned from a prior request. Use
1140 this marker for pagination of results from this operation. If this
1141 parameter is specified, the response includes only records beyond
1142 the marker, up to the value specified by MaxRecords .
1143
1144 """
1145 params = {}
1146 if reserved_cache_nodes_offering_id is not None:
1147 params['ReservedCacheNodesOfferingId'] = reserved_cache_nodes_offering_id
1148 if cache_node_type is not None:
1149 params['CacheNodeType'] = cache_node_type
1150 if duration is not None:
1151 params['Duration'] = duration
1152 if product_description is not None:
1153 params['ProductDescription'] = product_description
1154 if offering_type is not None:
1155 params['OfferingType'] = offering_type
1156 if max_records is not None:
1157 params['MaxRecords'] = max_records
1158 if marker is not None:
1159 params['Marker'] = marker
1160 return self._make_request(
1161 action='DescribeReservedCacheNodesOfferings',
1162 verb='POST',
1163 path='/', params=params)
1164
1165 def modify_cache_cluster(self, cache_cluster_id, num_cache_nodes=None,
1166 cache_node_ids_to_remove=None,
1167 cache_security_group_names=None,
1168 security_group_ids=None,
1169 preferred_maintenance_window=None,
1170 notification_topic_arn=None,
1171 cache_parameter_group_name=None,
1172 notification_topic_status=None,
1173 apply_immediately=None, engine_version=None,
1174 auto_minor_version_upgrade=None):
1175 """
1176 The ModifyCacheCluster operation modifies the settings for a
1177 cache cluster. You can use this operation to change one or
1178 more cluster configuration parameters by specifying the
1179 parameters and the new values.
1180
1181 :type cache_cluster_id: string
1182 :param cache_cluster_id: The cache cluster identifier. This value is
1183 stored as a lowercase string.
1184
1185 :type num_cache_nodes: integer
1186 :param num_cache_nodes: The number of cache nodes that the cache
1187 cluster should have. If the value for NumCacheNodes is greater than
1188 the existing number of cache nodes, then more nodes will be added.
1189 If the value is less than the existing number of cache nodes, then
1190 cache nodes will be removed.
1191 If you are removing cache nodes, you must use the CacheNodeIdsToRemove
1192 parameter to provide the IDs of the specific cache nodes to be
1193 removed.
1194
1195 :type cache_node_ids_to_remove: list
1196 :param cache_node_ids_to_remove: A list of cache node IDs to be
1197 removed. A node ID is a numeric identifier (0001, 0002, etc.). This
1198 parameter is only valid when NumCacheNodes is less than the
1199 existing number of cache nodes. The number of cache node IDs
1200 supplied in this parameter must match the difference between the
1201 existing number of cache nodes in the cluster and the value of
1202 NumCacheNodes in the request.
1203
1204 :type cache_security_group_names: list
1205 :param cache_security_group_names: A list of cache security group names
1206 to authorize on this cache cluster. This change is asynchronously
1207 applied as soon as possible.
1208 This parameter can be used only with clusters that are created outside
1209 of an Amazon Virtual Private Cloud (VPC).
1210
1211 Constraints: Must contain no more than 255 alphanumeric characters.
1212 Must not be "Default".
1213
1214 :type security_group_ids: list
1215 :param security_group_ids: Specifies the VPC Security Groups associated
1216 with the cache cluster.
1217 This parameter can be used only with clusters that are created in an
1218 Amazon Virtual Private Cloud (VPC).
1219
1220 :type preferred_maintenance_window: string
1221 :param preferred_maintenance_window: The weekly time range (in UTC)
1222 during which system maintenance can occur. Note that system
1223 maintenance may result in an outage. This change is made
1224 immediately. If you are moving this window to the current time,
1225 there must be at least 120 minutes between the current time and end
1226 of the window to ensure that pending changes are applied.
1227
1228 :type notification_topic_arn: string
1229 :param notification_topic_arn:
1230 The Amazon Resource Name (ARN) of the SNS topic to which notifications
1231 will be sent.
1232
1233 The SNS topic owner must be same as the cache cluster owner.
1234
1235 :type cache_parameter_group_name: string
1236 :param cache_parameter_group_name: The name of the cache parameter
1237 group to apply to this cache cluster. This change is asynchronously
1238 applied as soon as possible for parameters when the
1239 ApplyImmediately parameter is specified as true for this request.
1240
1241 :type notification_topic_status: string
1242 :param notification_topic_status: The status of the Amazon SNS
1243 notification topic. Notifications are sent only if the status is
1244 active .
1245 Valid values: `active` | `inactive`
1246
1247 :type apply_immediately: boolean
1248 :param apply_immediately: If `True`, this parameter causes the
1249 modifications in this request and any pending modifications to be
1250 applied, asynchronously and as soon as possible, regardless of the
1251 PreferredMaintenanceWindow setting for the cache cluster.
1252 If `False`, then changes to the cache cluster are applied on the next
1253 maintenance reboot, or the next failure reboot, whichever occurs
1254 first.
1255
1256 Valid values: `True` | `False`
1257
1258 Default: `False`
1259
1260 :type engine_version: string
1261 :param engine_version: The upgraded version of the cache engine to be
1262 run on the cache cluster nodes.
1263
1264 :type auto_minor_version_upgrade: boolean
1265 :param auto_minor_version_upgrade: If `True`, then minor engine
1266 upgrades will be applied automatically to the cache cluster during
1267 the maintenance window.
1268 Valid values: `True` | `False`
1269
1270 Default: `True`
1271
1272 """
1273 params = {'CacheClusterId': cache_cluster_id, }
1274 if num_cache_nodes is not None:
1275 params['NumCacheNodes'] = num_cache_nodes
1276 if cache_node_ids_to_remove is not None:
1277 self.build_list_params(params,
1278 cache_node_ids_to_remove,
1279 'CacheNodeIdsToRemove.member')
1280 if cache_security_group_names is not None:
1281 self.build_list_params(params,
1282 cache_security_group_names,
1283 'CacheSecurityGroupNames.member')
1284 if security_group_ids is not None:
1285 self.build_list_params(params,
1286 security_group_ids,
1287 'SecurityGroupIds.member')
1288 if preferred_maintenance_window is not None:
1289 params['PreferredMaintenanceWindow'] = preferred_maintenance_window
1290 if notification_topic_arn is not None:
1291 params['NotificationTopicArn'] = notification_topic_arn
1292 if cache_parameter_group_name is not None:
1293 params['CacheParameterGroupName'] = cache_parameter_group_name
1294 if notification_topic_status is not None:
1295 params['NotificationTopicStatus'] = notification_topic_status
1296 if apply_immediately is not None:
1297 params['ApplyImmediately'] = str(
1298 apply_immediately).lower()
1299 if engine_version is not None:
1300 params['EngineVersion'] = engine_version
1301 if auto_minor_version_upgrade is not None:
1302 params['AutoMinorVersionUpgrade'] = str(
1303 auto_minor_version_upgrade).lower()
1304 return self._make_request(
1305 action='ModifyCacheCluster',
1306 verb='POST',
1307 path='/', params=params)
1308
1309 def modify_cache_parameter_group(self, cache_parameter_group_name,
1310 parameter_name_values):
1311 """
1312 The ModifyCacheParameterGroup operation modifies the
1313 parameters of a cache parameter group. You can modify up to 20
1314 parameters in a single request by submitting a list parameter
1315 name and value pairs.
1316
1317 :type cache_parameter_group_name: string
1318 :param cache_parameter_group_name: The name of the cache parameter
1319 group to modify.
1320
1321 :type parameter_name_values: list
1322 :param parameter_name_values: An array of parameter names and values
1323 for the parameter update. You must supply at least one parameter
1324 name and value; subsequent arguments are optional. A maximum of 20
1325 parameters may be modified per request.
1326
1327 """
1328 params = {
1329 'CacheParameterGroupName': cache_parameter_group_name,
1330 }
1331 self.build_complex_list_params(
1332 params, parameter_name_values,
1333 'ParameterNameValues.member',
1334 ('ParameterName', 'ParameterValue'))
1335 return self._make_request(
1336 action='ModifyCacheParameterGroup',
1337 verb='POST',
1338 path='/', params=params)
1339
1340 def modify_cache_subnet_group(self, cache_subnet_group_name,
1341 cache_subnet_group_description=None,
1342 subnet_ids=None):
1343 """
1344 The ModifyCacheSubnetGroup operation modifies an existing
1345 cache subnet group.
1346
1347 :type cache_subnet_group_name: string
1348 :param cache_subnet_group_name: The name for the cache subnet group.
1349 This value is stored as a lowercase string.
1350 Constraints: Must contain no more than 255 alphanumeric characters or
1351 hyphens.
1352
1353 Example: `mysubnetgroup`
1354
1355 :type cache_subnet_group_description: string
1356 :param cache_subnet_group_description: A description for the cache
1357 subnet group.
1358
1359 :type subnet_ids: list
1360 :param subnet_ids: The EC2 subnet IDs for the cache subnet group.
1361
1362 """
1363 params = {'CacheSubnetGroupName': cache_subnet_group_name, }
1364 if cache_subnet_group_description is not None:
1365 params['CacheSubnetGroupDescription'] = cache_subnet_group_description
1366 if subnet_ids is not None:
1367 self.build_list_params(params,
1368 subnet_ids,
1369 'SubnetIds.member')
1370 return self._make_request(
1371 action='ModifyCacheSubnetGroup',
1372 verb='POST',
1373 path='/', params=params)
1374
1375 def modify_replication_group(self, replication_group_id,
1376 replication_group_description=None,
1377 cache_security_group_names=None,
1378 security_group_ids=None,
1379 preferred_maintenance_window=None,
1380 notification_topic_arn=None,
1381 cache_parameter_group_name=None,
1382 notification_topic_status=None,
1383 apply_immediately=None, engine_version=None,
1384 auto_minor_version_upgrade=None,
1385 primary_cluster_id=None):
1386 """
1387 The ModifyReplicationGroup operation modifies the settings for
1388 a replication group.
1389
1390 :type replication_group_id: string
1391 :param replication_group_id: The identifier of the replication group to
1392 modify.
1393
1394 :type replication_group_description: string
1395 :param replication_group_description: A description for the replication
1396 group. Maximum length is 255 characters.
1397
1398 :type cache_security_group_names: list
1399 :param cache_security_group_names: A list of cache security group names
1400 to authorize for the clusters in this replication group. This
1401 change is asynchronously applied as soon as possible.
1402 This parameter can be used only with replication groups containing
1403 cache clusters running outside of an Amazon Virtual Private Cloud
1404 (VPC).
1405
1406 Constraints: Must contain no more than 255 alphanumeric characters.
1407 Must not be "Default".
1408
1409 :type security_group_ids: list
1410 :param security_group_ids: Specifies the VPC Security Groups associated
1411 with the cache clusters in the replication group.
1412 This parameter can be used only with replication groups containing
1413 cache clusters running in an Amazon Virtual Private Cloud (VPC).
1414
1415 :type preferred_maintenance_window: string
1416 :param preferred_maintenance_window: The weekly time range (in UTC)
1417 during which replication group system maintenance can occur. Note
1418 that system maintenance may result in an outage. This change is
1419 made immediately. If you are moving this window to the current
1420 time, there must be at least 120 minutes between the current time
1421 and end of the window to ensure that pending changes are applied.
1422
1423 :type notification_topic_arn: string
1424 :param notification_topic_arn:
1425 The Amazon Resource Name (ARN) of the SNS topic to which notifications
1426 will be sent.
1427
1428 The SNS topic owner must be same as the replication group owner.
1429
1430 :type cache_parameter_group_name: string
1431 :param cache_parameter_group_name: The name of the cache parameter
1432 group to apply to all of the cache nodes in this replication group.
1433 This change is asynchronously applied as soon as possible for
1434 parameters when the ApplyImmediately parameter is specified as true
1435 for this request.
1436
1437 :type notification_topic_status: string
1438 :param notification_topic_status: The status of the Amazon SNS
1439 notification topic for the replication group. Notifications are
1440 sent only if the status is active .
1441 Valid values: `active` | `inactive`
1442
1443 :type apply_immediately: boolean
1444 :param apply_immediately: If `True`, this parameter causes the
1445 modifications in this request and any pending modifications to be
1446 applied, asynchronously and as soon as possible, regardless of the
1447 PreferredMaintenanceWindow setting for the replication group.
1448 If `False`, then changes to the nodes in the replication group are
1449 applied on the next maintenance reboot, or the next failure reboot,
1450 whichever occurs first.
1451
1452 Valid values: `True` | `False`
1453
1454 Default: `False`
1455
1456 :type engine_version: string
1457 :param engine_version: The upgraded version of the cache engine to be
1458 run on the nodes in the replication group..
1459
1460 :type auto_minor_version_upgrade: boolean
1461 :param auto_minor_version_upgrade: Determines whether minor engine
1462 upgrades will be applied automatically to all of the cache nodes in
1463 the replication group during the maintenance window. A value of
1464 `True` allows these upgrades to occur; `False` disables automatic
1465 upgrades.
1466
1467 :type primary_cluster_id: string
1468 :param primary_cluster_id: If this parameter is specified, ElastiCache
1469 will promote each of the nodes in the specified cache cluster to
1470 the primary role. The nodes of all other clusters in the
1471 replication group will be read replicas.
1472
1473 """
1474 params = {'ReplicationGroupId': replication_group_id, }
1475 if replication_group_description is not None:
1476 params['ReplicationGroupDescription'] = replication_group_description
1477 if cache_security_group_names is not None:
1478 self.build_list_params(params,
1479 cache_security_group_names,
1480 'CacheSecurityGroupNames.member')
1481 if security_group_ids is not None:
1482 self.build_list_params(params,
1483 security_group_ids,
1484 'SecurityGroupIds.member')
1485 if preferred_maintenance_window is not None:
1486 params['PreferredMaintenanceWindow'] = preferred_maintenance_window
1487 if notification_topic_arn is not None:
1488 params['NotificationTopicArn'] = notification_topic_arn
1489 if cache_parameter_group_name is not None:
1490 params['CacheParameterGroupName'] = cache_parameter_group_name
1491 if notification_topic_status is not None:
1492 params['NotificationTopicStatus'] = notification_topic_status
1493 if apply_immediately is not None:
1494 params['ApplyImmediately'] = str(
1495 apply_immediately).lower()
1496 if engine_version is not None:
1497 params['EngineVersion'] = engine_version
1498 if auto_minor_version_upgrade is not None:
1499 params['AutoMinorVersionUpgrade'] = str(
1500 auto_minor_version_upgrade).lower()
1501 if primary_cluster_id is not None:
1502 params['PrimaryClusterId'] = primary_cluster_id
1503 return self._make_request(
1504 action='ModifyReplicationGroup',
1505 verb='POST',
1506 path='/', params=params)
1507
1508 def purchase_reserved_cache_nodes_offering(self,
1509 reserved_cache_nodes_offering_id,
1510 reserved_cache_node_id=None,
1511 cache_node_count=None):
1512 """
1513 The PurchaseReservedCacheNodesOffering operation allows you to
1514 purchase a reserved cache node offering.
1515
1516 :type reserved_cache_nodes_offering_id: string
1517 :param reserved_cache_nodes_offering_id: The ID of the reserved cache
1518 node offering to purchase.
1519 Example: 438012d3-4052-4cc7-b2e3-8d3372e0e706
1520
1521 :type reserved_cache_node_id: string
1522 :param reserved_cache_node_id: A customer-specified identifier to track
1523 this reservation.
1524 Example: myreservationID
1525
1526 :type cache_node_count: integer
1527 :param cache_node_count: The number of cache node instances to reserve.
1528 Default: `1`
1529
1530 """
1531 params = {
1532 'ReservedCacheNodesOfferingId': reserved_cache_nodes_offering_id,
1533 }
1534 if reserved_cache_node_id is not None:
1535 params['ReservedCacheNodeId'] = reserved_cache_node_id
1536 if cache_node_count is not None:
1537 params['CacheNodeCount'] = cache_node_count
1538 return self._make_request(
1539 action='PurchaseReservedCacheNodesOffering',
1540 verb='POST',
1541 path='/', params=params)
1542
1543 def reboot_cache_cluster(self, cache_cluster_id,
1544 cache_node_ids_to_reboot):
1545 """
1546 The RebootCacheCluster operation reboots some, or all, of the
1547 cache cluster nodes within a provisioned cache cluster. This
1548 API will apply any modified cache parameter groups to the
1549 cache cluster. The reboot action takes place as soon as
1550 possible, and results in a momentary outage to the cache
1551 cluster. During the reboot, the cache cluster status is set to
1552 REBOOTING.
1553
1554 The reboot causes the contents of the cache (for each cache
1555 cluster node being rebooted) to be lost.
1556
1557 When the reboot is complete, a cache cluster event is created.
1558
1559 :type cache_cluster_id: string
1560 :param cache_cluster_id: The cache cluster identifier. This parameter
1561 is stored as a lowercase string.
1562
1563 :type cache_node_ids_to_reboot: list
1564 :param cache_node_ids_to_reboot: A list of cache cluster node IDs to
1565 reboot. A node ID is a numeric identifier (0001, 0002, etc.). To
1566 reboot an entire cache cluster, specify all of the cache cluster
1567 node IDs.
1568
1569 """
1570 params = {'CacheClusterId': cache_cluster_id, }
1571 self.build_list_params(params,
1572 cache_node_ids_to_reboot,
1573 'CacheNodeIdsToReboot.member')
1574 return self._make_request(
1575 action='RebootCacheCluster',
1576 verb='POST',
1577 path='/', params=params)
1578
1579 def reset_cache_parameter_group(self, cache_parameter_group_name,
1580 parameter_name_values,
1581 reset_all_parameters=None):
1582 """
1583 The ResetCacheParameterGroup operation modifies the parameters
1584 of a cache parameter group to the engine or system default
1585 value. You can reset specific parameters by submitting a list
1586 of parameter names. To reset the entire cache parameter group,
1587 specify the ResetAllParameters and CacheParameterGroupName
1588 parameters.
1589
1590 :type cache_parameter_group_name: string
1591 :param cache_parameter_group_name: The name of the cache parameter
1592 group to reset.
1593
1594 :type reset_all_parameters: boolean
1595 :param reset_all_parameters: If true , all parameters in the cache
1596 parameter group will be reset to default values. If false , no such
1597 action occurs.
1598 Valid values: `True` | `False`
1599
1600 :type parameter_name_values: list
1601 :param parameter_name_values: An array of parameter names to be reset.
1602 If you are not resetting the entire cache parameter group, you must
1603 specify at least one parameter name.
1604
1605 """
1606 params = {
1607 'CacheParameterGroupName': cache_parameter_group_name,
1608 }
1609 self.build_complex_list_params(
1610 params, parameter_name_values,
1611 'ParameterNameValues.member',
1612 ('ParameterName', 'ParameterValue'))
1613 if reset_all_parameters is not None:
1614 params['ResetAllParameters'] = str(
1615 reset_all_parameters).lower()
1616 return self._make_request(
1617 action='ResetCacheParameterGroup',
1618 verb='POST',
1619 path='/', params=params)
1620
1621 def revoke_cache_security_group_ingress(self, cache_security_group_name,
1622 ec2_security_group_name,
1623 ec2_security_group_owner_id):
1624 """
1625 The RevokeCacheSecurityGroupIngress operation revokes ingress
1626 from a cache security group. Use this operation to disallow
1627 access from an Amazon EC2 security group that had been
1628 previously authorized.
1629
1630 :type cache_security_group_name: string
1631 :param cache_security_group_name: The name of the cache security group
1632 to revoke ingress from.
1633
1634 :type ec2_security_group_name: string
1635 :param ec2_security_group_name: The name of the Amazon EC2 security
1636 group to revoke access from.
1637
1638 :type ec2_security_group_owner_id: string
1639 :param ec2_security_group_owner_id: The AWS account number of the
1640 Amazon EC2 security group owner. Note that this is not the same
1641 thing as an AWS access key ID - you must provide a valid AWS
1642 account number for this parameter.
1643
1644 """
1645 params = {
1646 'CacheSecurityGroupName': cache_security_group_name,
1647 'EC2SecurityGroupName': ec2_security_group_name,
1648 'EC2SecurityGroupOwnerId': ec2_security_group_owner_id,
1649 }
1650 return self._make_request(
1651 action='RevokeCacheSecurityGroupIngress',
1652 verb='POST',
1653 path='/', params=params)
1654
1655 def _make_request(self, action, verb, path, params):
1656 params['ContentType'] = 'JSON'
1657 response = self.make_request(action=action, verb='POST',
1658 path='/', params=params)
1659 body = response.read().decode('utf-8')
1660 boto.log.debug(body)
1661 if response.status == 200:
1662 return json.loads(body)
1663 else:
1664 raise self.ResponseError(response.status, response.reason, body)