o ckF[B@s@ddlZddlmZddlmZddlmZGdddeZdS)N)json)AWSQueryConnection) RegionInfocseZdZdZdZdZdZfddZddZd d Z dHd d Z ddZ ddZ ddZ ddZddZddZddZddZddZ dId d!Z dJd"d#Z dKd$d%Z dKd&d'Z dKd(d)Z dKd*d+Z dLd,d-Z dMd.d/Z dKd0d1Z dNd2d3Z dMd4d5Z dOd6d7Zd8d9Z dLd:d;Z! dOdd?Z#d@dAZ$ dPdBdCZ%dDdEZ&dFdGZ'Z(S)QElastiCacheConnectiona Amazon ElastiCache Amazon ElastiCache is a web service that makes it easier to set up, operate, and scale a distributed cache in the cloud. 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. z 2013-06-15z us-east-1z#elasticache.us-east-1.amazonaws.comc sP|d}|st||j|j}n|d=|j|d<tt|jdi|||_dS)Nregionhost) getrDefaultRegionNameDefaultRegionEndpointendpointsuperr__init__r)selfkwargsr __class__r9/usr/lib/python3/dist-packages/boto/elasticache/layer1.pyr2s   zElastiCacheConnection.__init__cCsdgS)Nzhmac-v4r)rrrr_required_auth_capability=sz/ElastiCacheConnection._required_auth_capabilitycC|||d}|jddd|dS)a; 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 cache security group which will allow network ingress. :type ec2_security_group_name: string :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: 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. CacheSecurityGroupNameEC2SecurityGroupNameEC2SecurityGroupOwnerId"AuthorizeCacheSecurityGroupIngressPOST/actionverbpathparams _make_requestrcache_security_group_nameec2_security_group_nameec2_security_group_owner_idr!rrr&authorize_cache_security_group_ingress@szcache_node_ids_to_removerErFrIrKrCnotification_topic_statusapply_immediatelyrBrLr!rrrmodify_cache_clustersZlz*ElastiCacheConnection.modify_cache_clustercCs*d|i}|||dd|jddd|dS)a 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 group to modify. :type parameter_name_values: list :param parameter_name_values: An array of parameter names and values 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. r/ParameterNameValues.member ParameterNameParameterValueModifyCacheParameterGrouprrr)build_complex_list_paramsr#)rrCparameter_name_valuesr!rrrmodify_cache_parameter_groupsz2ElastiCacheConnection.modify_cache_parameter_groupcCs@d|i}|dur ||d<|dur|||d|jddd|dS) a 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` :type cache_subnet_group_description: string :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. r0NrVrWModifyCacheSubnetGrouprrrrYrZrrrmodify_cache_subnet_group<sz/ElastiCacheConnection.modify_cache_subnet_groupc Csd|i} |dur || d<|dur|| |d|dur"|| |d|dur*|| d<|dur2|| d<|dur:|| d<|durB|| d <| durNt| | d <| durV| | d <| durbt| | d <| durj| | d <|jddd| dS)a 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. r-Nr_r1r2r4r6r/rrr.r7r^ModifyReplicationGrouprrrr9)rrArbrErFrIrKrCrrrBrLrar!rrrmodify_replication_group_sTcz.ElastiCacheConnection.modify_replication_groupcCr) a 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 :type reserved_cache_node_id: string :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 cache node instances to reserve. Default: `1` rNrCacheNodeCount"PurchaseReservedCacheNodesOfferingrrrr")rrrcache_node_countr!rrr&purchase_reserved_cache_nodes_offeringsz 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 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 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. A node ID is a numeric identifier (0001, 0002, etc.). To reboot an entire cache cluster, specify all of the cache cluster node IDs. r)zCacheNodeIdsToReboot.memberRebootCacheClusterrrrrY)rr=cache_node_ids_to_rebootr!rrrreboot_cache_clustersz*ElastiCacheConnection.reboot_cache_clustercCsBd|i}|||dd|durt||d<|jddd|d S) a 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 to reset. :type reset_all_parameters: boolean :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 to be reset. If you are not resetting the entire cache parameter group, you must specify at least one parameter name. r/rrNResetAllParametersResetCacheParameterGrouprrr)rr;r<r#)rrCrreset_all_parametersr!rrrreset_cache_parameter_group+s$z1ElastiCacheConnection.reset_cache_parameter_groupcCr)a{ 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 to revoke ingress from. :type ec2_security_group_name: string :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 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. rRevokeCacheSecurityGroupIngressrrrr"r$rrr#revoke_cache_security_group_ingressUsz9ElastiCacheConnection.revoke_cache_security_group_ingresscCsZd|d<|j|dd|d}|d}tj||jdkr$t|S| |j|j |)NJSON ContentTyperrrzutf-8) make_requestreaddecodebotologdebugstatusrloads ResponseErrorreason)rrrr r!responsebodyrrrr#ws   z#ElastiCacheConnection._make_request)NNNNNNNNNNNNNNN)NNNN)NNNNNN)NNN)NN)NNNNNNN)NNNNNNNN) NNNNNNNNNNN)N))__name__ __module__ __qualname____doc__ APIVersionr r rrr(rMrSrUr]rcrfrirlrnrpryr}rrrrrrrrrrrrrrrrrr# __classcell__rrrrrs  % =!"%0 I F * , ( * ( H * S L   $  #& *"r)r boto.compatrboto.connectionrboto.regioninforrrrrrs