%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pyo

�
���^c@@s$dZddlmZmZmZddlZddlZddlmZm	Z	ddl
ZddlZej
e�Zy;ddlZddlZej
d�jej�eZWnek
r�eZnXd�Zd�Zdd	�Zdddddddddd
�	Zdddddddd�Zdddddd
ddddd�
Zdddddd
ddddd�
Zddddddd�Z dddddd�Z!ddddddd�Z"ddddddd�Z#dddddd�Z$ddddddd�Z%ddddd�Z&ddddddd�Z'ddddddd�Z(dddddd�Z)ddddddd�Z*ddddd�Z+ddddd�Z,dddddd�Z-dddddd�Z.ddddd �Z/ddddddd!�Z0ddddd"�Z1ddddd#�Z2ddddd$�Z3ddddd%�Z4ddddd&�Z5ddddd'�Z6ddddd(�Z7ddddd)�Z8ddddd*�Z9ddddddd+�Z:ddddd,�Z;ddddd-�Z<dS(.u@
Execution module for Amazon Elasticache using boto3
===================================================

.. versionadded:: 2017.7.0

:configuration: This module accepts explicit elasticache credentials but can
    also utilize IAM roles assigned to the instance through Instance Profiles.
    Dynamic credentials are then automatically obtained from AWS API and no
    further configuration is necessary. More Information available at:

    .. code-block:: text

        http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html

    If IAM roles are not used you need to specify them either in a pillar or
    in the minion's config file:

    .. code-block:: yaml

        elasticache.keyid: GKTADJGHEIQSXMKKRBJ08H
        elasticache.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs

    A region may also be specified in the configuration:

    .. code-block:: yaml

        elasticache.region: us-east-1

    If a region is not specified, the default is us-east-1.

    It's also possible to specify key, keyid and region via a profile, either
    as a passed in dict, or as a string to pull from pillars or minion config:

    .. code-block:: yaml

        myprofile:
            keyid: GKTADJGHEIQSXMKKRBJ08H
            key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
            region: us-east-1

:depends: boto3
i(tabsolute_importtprint_functiontunicode_literalsN(tSaltInvocationErrortCommandExecutionErroruboto3cC@stjjj�S(ug
    Only load if boto libraries exist and if boto libraries are greater than
    a given version.
    (tsalttutilstversionstcheck_boto_reqs(((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pyt__virtual__Jsc	C@sCtjjjt�tr?tdtddddddd�ndS(Nuboto3.assign_funcsuelasticachetget_conn_funcnameu	_get_conntcache_id_funcnameu	_cache_idtexactly_one_funcname(RRtcompattpack_dundert__name__t	HAS_BOTO3t	__utils__tNone(topts((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pyt__init__RsuMarkercC@s{g}||kr||nd}xR|dk	rv||�}||j|�7}|j|�}|ji||6�q%W|S(Nu(Rtgettupdate(tfunctitemtargstmarkertrettMarkertr((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pyt_collect_results[sc		K@s1|dkr0td|d|d|d|�}ny!d|d}
t||
�}Wn4ttfk
r�}tdj|
|j���nX|	j|r�i||6n
idd	6�t	g|	j
�D]'\}
}|
jd
�s�|
|f^q��}	yt|||	�SWn't
jjk
r,}tj|�dSXdS(Ntregiontkeytkeyidtprofileu	describe_usuNo function '{0}()' found: {1}uuMarkeru_(Rt	_get_conntgetattrtAttributeErrortKeyErrorRtformattmessageRtdicttitemst
startswithRtbotocoret
exceptionstClientErrortlogtdebug(tnamet
name_paramtres_typet	info_nodetconnRR R!R"RRtftetktv((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pyt_describe_resourcefs$'@
udeletedc	K@s�yt|�}Wn&tk
r8tdj|���nXtd|d|d|	d|
�}||kr�tjd||||�||}n
|||<tg|j�D]'\}
}|
j	d�s�|
|f^q��}yAd|}t
||�}|rd	|d
}t�|}nWn4tt
fk
rN}tdj||j���nXy(||�|stjd|j�|�tStjd
|||�|}x�|dkrU|d|d|�}|s�t|�s�|dj|�|kr	tjd|j�|�tS|d|kr|nd}tjd|||�tj|�||8}q�Wtjd|j�||�tSWn0tjjk
r�}tjd|||�tSXdS(u0
    Delete a generic Elasticache resource.
    uFBad value ('{0}') passed for 'wait' param - must be an int or boolean.RR R!R"uA'name: %s' param being overridden by explicitly provided '%s: %s'u_udelete_u	describe_usuNo function '{0}()' found: {1}u%s %s deletion requested.u1Waiting up to %s seconds for %s %s to be deleted.iR1R5u%s %s deleted.i<u,Sleeping %s seconds for %s %s to be deleted.u#%s %s not deleted after %s seconds!uFailed to delete %s %s: %sN(tintt	ExceptionRR'R#R/tinfoR)R*R+R$tglobalsR%R&R(ttitletTruetlenRttimetsleepterrortFalseR,R-R.(R1R2tdescR3twaittstatus_paramtstatus_goneRR R!R"RR5R8R9RR6tsR7t	orig_waitRRC((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pyt_delete_resourceysV
	!

@

-	

u	availablec	K@s�yt|�}Wn&tk
r8tdj|���nXtd|d|d|	d|
�}||kr�tjd||||�||}n
|||<tg|j�D]'\}
}|
j	d�s�|
|f^q��}yAd|}t
||�}|rd	|d
}t�|}nWn4tt
fk
rN}tdj||j���nXy||�|stjd|j�|�tStjd
|||�|}x�|dkrG|d|d|�}|r�|dj|�|kr�tjd|j�|�tS|d|kr|nd}tjd|||�tj|�||8}q�Wtjd|j�||�tSWn<tjjk
r�}dj|||�}tj|�tSXdS(NuFBad value ('{0}') passed for 'wait' param - must be an int or boolean.RR R!R"uA'name: %s' param being overridden by explicitly provided '%s: %s'u_ucreate_u	describe_usuNo function '{0}()' found: {1}u%s %s created.u:Waiting up to %s seconds for %s %s to be become available.iR1R5u%s %s created and available.i<u2Sleeping %s seconds for %s %s to become available.u%%s %s not available after %s seconds!uFailed to create {0} {1}: {2}(R;R<RR'R#R/R=R)R*R+R$R>R%R&R(R?R@RRBRCRDRER,R-R.(R1R2RFR3RGRHtstatus_goodRR R!R"RR5R8R9RR6RJR7RKRRCtmsg((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pyt_create_resource�s\
	!

@

	
	

	
c	K@s�yt|�}Wn&tk
r8tdj|���nXtd|d|d|	d|
�}||kr�tjd||||�||}n
|||<tg|j�D]'\}
}|
j	d�s�|
|f^q��}yAd|}t
||�}|rd	|d
}t�|}nWn4tt
fk
rN}tdj||j���nXy||�|stjd|j�|�tStjd
|||�|}x�|dkrG|d|d|�}|r�|dj|�|kr�tjd|j�|�tS|d|kr|nd}tjd|||�tj|�||8}q�Wtjd|j�||�tSWn<tjjk
r�}dj|||�}tj|�tSXdS(NuFBad value ('{0}') passed for 'wait' param - must be an int or boolean.RR R!R"uA'name: %s' param being overridden by explicitly provided '%s: %s'u_umodify_u	describe_usuNo function '{0}()' found: {1}u%s %s modification requested.u:Waiting up to %s seconds for %s %s to be become available.iR1R5u%s %s modified and available.i<u2Sleeping %s seconds for %s %s to become available.u%%s %s not available after %s seconds!uFailed to modify {0} {1}: {2}(R;R<RR'R#R/R=R)R*R+R$R>R%R&R(R?R@RRBRCRDRER,R-R.(R1R2RFR3RGRHRMRR R!R"RR5R8R9RR6RJR7RKRRCRN((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pyt_modify_resource�s\
	!

@

	
	

	
cK@s@td|ddddddd|d	|d
|d|d||�	S(
u
    Return details about all (or just one) Elasticache cache clusters.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.describe_cache_clusters
        salt myminion boto3_elasticache.describe_cache_clusters myelasticache
    R1R2uCacheClusterIdR3u
cache_clusterR4u
CacheClustersR5RR R!R"(R:(R1R5RR R!R"R((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytdescribe_cache_clustersscC@s1ttd|d|d|d|d|d|��S(u�
    Check to see if a cache cluster exists.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.cache_cluster_exists myelasticache
    R1R5RR R!R"(tboolRQ(R1R5RR R!R"((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytcache_cluster_exists+s
iXcK@s�|rxt|t�s!|g}ntdd|d|d|d|d|�}d|kreg|d<n|dc|7<ntg|j�D]'\}	}
|	jd�s�|	|
f^q��}t|d	d
ddd
dd|ddd|d|d|d||�	S(uO
    Create a cache cluster.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.create_cache_cluster name=myCacheCluster                                                              Engine=redis                                                              CacheNodeType=cache.t2.micro                                                              NumCacheNodes=1                                                              SecurityGroupIds='[sg-11223344]'                                                              CacheSubnetGroupName=myCacheSubnetGroup
    u"boto_secgroup.convert_to_group_idstgroupsRR R!R"uSecurityGroupIdsu_R2uCacheClusterIdRFu
cache clusterR3u
cache_clusterRGRHuCacheClusterStatus(t
isinstancetlistt__salt__R)R*R+RO(R1RGtsecurity_groupsRR R!R"RtsgsR8R9((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytcreate_cache_cluster8s
@cK@s�|rxt|t�s!|g}ntdd|d|d|d|d|�}d|kreg|d<n|dc|7<ntg|j�D]'\}	}
|	jd�s�|	|
f^q��}t|d	d
ddd
dd|ddd|d|d|d||�	S(u�
    Update a cache cluster in place.

    Notes:  {ApplyImmediately: False} is pretty danged silly in the context of salt.
            You can pass it, but for fairly obvious reasons the results over multiple
            runs will be undefined and probably contrary to your desired state.
            Reducing the number of nodes requires an EXPLICIT CacheNodeIdsToRemove be
            passed, which until a reasonable heuristic for programmatically deciding
            which nodes to remove has been established, MUST be decided and populated
            intentionally before a state call, and removed again before the next.  In
            practice this is not particularly useful and should probably be avoided.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.create_cache_cluster name=myCacheCluster                                                              NotificationTopicStatus=inactive
    u"boto_secgroup.convert_to_group_idsRTRR R!R"uSecurityGroupIdsu_R2uCacheClusterIdRFu
cache clusterR3u
cache_clusterRGRHuCacheClusterStatus(RURVRWR)R*R+RP(R1RGRXRR R!R"RRYR8R9((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytmodify_cache_clusterVs
@cK@sCt|ddddddd|dd	d
|d|d|d
||�	S(u�
    Delete a cache cluster.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.delete myelasticache
    R2uCacheClusterIdRFu
cache clusterR3u
cache_clusterRGRHuCacheClusterStatusRR R!R"(RL(R1RGRR R!R"R((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytdelete_cache_clusterys
cC@s=td|ddddddd|d	|d
|d|d|�	S(
u
    Return details about all (or just one) Elasticache replication groups.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.describe_replication_groups
        salt myminion boto3_elasticache.describe_replication_groups myelasticache
    R1R2uReplicationGroupIdR3ureplication_groupR4uReplicationGroupsR5RR R!R"(R:(R1R5RR R!R"((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytdescribe_replication_groups�scC@s+ttd|d|d|d|d|��S(u�
    Check to see if a replication group exists.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.replication_group_exists myelasticache
    R1RR R!R"(RRR](R1RR R!R"((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytreplication_group_exists�s
!cK@s�|rxt|t�s!|g}ntdd|d|d|d|d|�}d|kreg|d<n|dc|7<ntg|j�D]'\}	}
|	jd�s�|	|
f^q��}t|d	d
ddd
dd|ddd|d|d|d||�	S(u�
    Create a replication group.
    Params are extensive and variable - see
    http://boto3.readthedocs.io/en/latest/reference/services/elasticache.html?#ElastiCache.Client.create_replication_group
    for in-depth usage documentation.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.create_replication_group                                                   name=myelasticache                                                   ReplicationGroupDescription=description
    u"boto_secgroup.convert_to_group_idsRTRR R!R"uSecurityGroupIdsu_R2uReplicationGroupIdRFureplication groupR3ureplication_groupRGRHuStatus(RURVRWR)R*R+RO(R1RGRXRR R!R"RRYR8R9((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytcreate_replication_group�s
@cK@s�|rxt|t�s!|g}ntdd|d|d|d|d|�}d|kreg|d<n|dc|7<ntg|j�D]'\}	}
|	jd�s�|	|
f^q��}t|d	d
ddd
dd|ddd|d|d|d||�	S(u1
    Modify a replication group.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.modify_replication_group                                                   name=myelasticache                                                   ReplicationGroupDescription=newDescription
    u"boto_secgroup.convert_to_group_idsRTRR R!R"uSecurityGroupIdsu_R2uReplicationGroupIdRFureplication groupR3ureplication_groupRGRHuStatus(RURVRWR)R*R+RP(R1RGRXRR R!R"RRYR8R9((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytmodify_replication_group�s

@cK@sCt|ddddddd|dd	d
|d|d|d
||�	S(u�
    Delete an ElastiCache replication group, optionally taking a snapshot first.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.delete_replication_group my-replication-group
    R2uReplicationGroupIdRFureplication groupR3ureplication_groupRGRHuStatusRR R!R"(RL(R1RGRR R!R"R((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytdelete_replication_group�s
cC@s=td|ddddddd|d	|d
|d|d|�	S(
u�
    Return details about all (or just one) Elasticache replication groups.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.describe_cache_subnet_groups region=us-east-1
    R1R2uCacheSubnetGroupNameR3ucache_subnet_groupR4uCacheSubnetGroupsR5RR R!R"(R:(R1R5RR R!R"((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytdescribe_cache_subnet_groups�s
cC@s+ttd|d|d|d|d|��S(u�
    Check to see if an ElastiCache subnet group exists.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.cache_subnet_group_exists my-subnet-group
    R1RR R!R"(RRRb(R1RR R!R"((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytcache_subnet_group_exists�s
cC@s-gtd||||�D]}|d^qS(u�
    Return a list of all cache subnet group names

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.list_cache_subnet_groups region=us-east-1
    uCacheSubnetGroupNameN(RbR(RR R!R"tg((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytlist_cache_subnet_groupss
cK@s�|r"d|krg|d<nt|t�s:|g}nx�|D]�}|jd�ro|dc|g7<qAntdd|d|d|d|d|�jd	�}|s�td
j|���nt|�dkr�|dc|dd
g7<qAt|�dkrAtdj|���qAqAWnt	g|j
�D]'\}	}
|	jd�s2|	|
f^q2�}t|ddddddd|d|d|d||�S(uX
    Create an ElastiCache subnet group

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.create_cache_subnet_group name=my-subnet-group                                               CacheSubnetGroupDescription="description"                                               subnets='[myVPCSubnet1,myVPCSubnet2]'
    u	SubnetIdsusubnet-uboto_vpc.describe_subnetstsubnet_namesRR R!R"usubnetsu+Could not resolve Subnet Name {0} to an ID.iiuidu*Subnet Name {0} returned more than one ID.u_R2uCacheSubnetGroupNameRFucache subnet groupR3ucache_subnet_group(RURVR+RWRRR'RARR)R*RO(R1tsubnetsRR R!R"RtsubnettsnR8R9((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytcreate_cache_subnet_groups.

@cK@s�|rd|krg|d<nt|t�s:|g}nx�|D]�}tdd|d|d|d|d|�jd�}t|�d	kr�|dc|d
dg7<qAt|�d	kr�tdj|���qA|jd
�r�|dc|g7<qAtdj|���qAWnt	g|j
�D]'\}	}
|	jd�s&|	|
f^q&�}t|ddddddd|d|d|d||�S(u!
    Modify an ElastiCache subnet group

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.modify_cache_subnet_group                                               name=my-subnet-group                                               subnets='[myVPCSubnet3]'
    u	SubnetIdsuboto_vpc.describe_subnetsRfRR R!R"usubnetsiiuidu*Subnet Name {0} returned more than one ID.usubnet-u+Could not resolve Subnet Name {0} to an ID.u_R2uCacheSubnetGroupNameRFucache subnet groupR3ucache_subnet_group(RURVRWRRARR'R+RR)R*RP(R1RgRR R!R"RRhRiR8R9((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytmodify_cache_subnet_group?s,

@cK@s7t|ddddddd|d|d	|d
||�S(u�
    Delete an ElastiCache subnet group.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.delete_subnet_group my-subnet-group region=us-east-1
    R2uCacheSubnetGroupNameRFucache subnet groupR3ucache_subnet_groupRR R!R"(RL(R1RR R!R"R((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytdelete_cache_subnet_groupes
cC@s=td|ddddddd|d	|d
|d|d|�	S(
u
    Return details about all (or just one) Elasticache cache clusters.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.describe_cache_security_groups
        salt myminion boto3_elasticache.describe_cache_security_groups mycachesecgrp
    R1R2uCacheSecurityGroupNameR3ucache_security_groupR4uCacheSecurityGroupsR5RR R!R"(R:(R1R5RR R!R"((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytdescribe_cache_security_groupstscC@s+ttd|d|d|d|d|��S(u�
    Check to see if an ElastiCache security group exists.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.cache_security_group_exists mysecuritygroup
    R1RR R!R"(RRRm(R1RR R!R"((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytcache_security_group_exists�s
cK@s7t|ddddddd|d|d	|d
||�S(u�
    Create a cache security group.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.create_cache_security_group mycachesecgrp Description='My Cache Security Group'
    R2uCacheSecurityGroupNameRFucache security groupR3ucache_security_groupRR R!R"(RO(R1RR R!R"R((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytcreate_cache_security_group�s
cK@s7t|ddddddd|d|d	|d
||�S(u�
    Delete a cache security group.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.delete_cache_security_group myelasticachesg
    R2uCacheSecurityGroupNameRFucache security groupR3ucache_security_groupRR R!R"(RL(R1RR R!R"R((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytdelete_cache_security_group�s
c
	K@s�td|d|d|d|�}d|krQtjd||d�|d}n
||d<tg|j�D]'\}}|jd�sk||f^qk�}y,|j|�tjd	|d
|�tSWn-tj	j
k
r�}	tjd||	�tSXdS(
u�
    Authorize network ingress from an ec2 security group to a cache security group.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.authorize_cache_security_group_ingress                                         mycachesecgrp                                         EC2SecurityGroupName=someEC2sg                                         EC2SecurityGroupOwnerId=SOMEOWNERID
    RR R!R"uCacheSecurityGroupNameuU'name: %s' param being overridden by explicitly provided 'CacheSecurityGroupName: %s'uCacheSubnetGroupNameu_u)Authorized %s to cache security group %s.uEC2SecurityGroupNameu&Failed to update security group %s: %sN(
R#R/R=R)R*R+t&authorize_cache_security_group_ingressR@R,R-R.RDRE(
R1RR R!R"RR5R8R9R7((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pyRq�s 
!

@
	c
	K@s�td|d|d|d|�}d|krQtjd||d�|d}n
||d<tg|j�D]'\}}|jd�sk||f^qk�}y,|j|�tjd	|d
|�tSWn-tj	j
k
r�}	tjd||	�tSXdS(
u�
    Revoke network ingress from an ec2 security group to a cache security
    group.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.revoke_cache_security_group_ingress                                         mycachesecgrp                                         EC2SecurityGroupName=someEC2sg                                         EC2SecurityGroupOwnerId=SOMEOWNERID
    RR R!R"uCacheSecurityGroupNameuU'name: %s' param being overridden by explicitly provided 'CacheSecurityGroupName: %s'uCacheSubnetGroupNameu_u(Revoked %s from cache security group %s.uEC2SecurityGroupNameu&Failed to update security group %s: %sN(
R#R/R=R)R*R+t#revoke_cache_security_group_ingressR@R,R-R.RDRE(
R1RR R!R"RR5R8R9R7((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pyRr�s !

@
	c	K@std|d|d|d|�}d|krQtjd||d�|d}n
||d<tg|j�D]'\}}|jd�sk||f^qk�}y1|j|�}	|	r�d|	kr�|	d	SgSWn-tjj	k
r�}
tj
d
||
�gSXdS(u�
    List tags on an Elasticache resource.

    Note that this function is essentially useless as it requires a full AWS ARN for the
    resource being operated on, but there is no provided API or programmatic way to find
    the ARN for a given object from its name or ID alone.  It requires specific knowledge
    about the account number, AWS partition, and other magic details to generate.

    If you happen to have those handy, feel free to utilize this however...

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.list_tags_for_resource                 name'=arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot'
    RR R!R"uResourceNameuK'name: %s' param being overridden by explicitly provided 'ResourceName: %s'u_uTaglistuTagListu'Failed to list tags for resource %s: %sN(R#R/R=R)R*R+tlist_tags_for_resourceR,R-R.RD(R1RR R!R"RR5R8R9RR7((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pyRs�s !

@c
	K@s�td|d|d|d|�}d|krQtjd||d�|d}n
||d<tg|j�D]'\}}|jd�sk||f^qk�}y,|j|�tjd|d	|�tSWn-tj	j
k
r�}	tjd
||	�tSXdS(u�
    Add tags to an Elasticache resource.

    Note that this function is essentially useless as it requires a full AWS ARN for the
    resource being operated on, but there is no provided API or programmatic way to find
    the ARN for a given object from its name or ID alone.  It requires specific knowledge
    about the account number, AWS partition, and other magic details to generate.

    If you happen to have those at hand though, feel free to utilize this function...

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.add_tags_to_resource                 name'=arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot'                 Tags="[{'Key': 'TeamOwner', 'Value': 'infrastructure'}]"
    RR R!R"uResourceNameuK'name: %s' param being overridden by explicitly provided 'ResourceName: %s'u_uAdded tags %s to %s.uTagsuFailed to add tags to %s: %sN(
R#R/R=R)R*R+tadd_tags_to_resourceR@R,R-R.RDRE(
R1RR R!R"RR5R8R9R7((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pyRts!

@
c
	K@s�td|d|d|d|�}d|krQtjd||d�|d}n
||d<tg|j�D]'\}}|jd�sk||f^qk�}y,|j|�tjd|d	|�tSWn-tj	j
k
r�}	tjd
||	�tSXdS(u�
    Remove tags from an Elasticache resource.

    Note that this function is essentially useless as it requires a full AWS ARN for the
    resource being operated on, but there is no provided API or programmatic way to find
    the ARN for a given object from its name or ID alone.  It requires specific knowledge
    about the account number, AWS partition, and other magic details to generate.

    If you happen to have those at hand though, feel free to utilize this function...

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.remove_tags_from_resource                 name'=arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot'                 TagKeys="['TeamOwner']"
    RR R!R"uResourceNameuK'name: %s' param being overridden by explicitly provided 'ResourceName: %s'u_uAdded tags %s to %s.uTagsuFailed to add tags to %s: %sN(
R#R/R=R)R*R+tremove_tags_from_resourceR@R,R-R.RDRE(
R1RR R!R"RR5R8R9R7((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pyRuAs!

@
c
	K@s�td|d|d|d|�}d|krQtjd||d�|d}n
||d<tg|j�D]'\}}|jd�sk||f^qk�}y,|j|�tjd||d	�tSWn-tj	j
k
r�}	tjd
||	�tSXdS(u�
    Make a copy of an existing snapshot.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.copy_snapshot name=mySnapshot                                                       TargetSnapshotName=copyOfMySnapshot
    RR R!R"uSourceSnapshotNameuQ'name: %s' param being overridden by explicitly provided 'SourceSnapshotName: %s'u_uSnapshot %s copied to %s.uTargetSnapshotNameuFailed to copy snapshot %s: %sN(
R#R/R=R)R*R+t
copy_snapshotR@R,R-R.RDRE(
R1RR R!R"RR5R8R9R7((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pyRvgs!

@
cC@s=td|ddddddd|d	|d
|d|d|�	S(
u
    Return details about all (or just one) Elasticache cache clusters.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.describe_cache_parameter_groups
        salt myminion boto3_elasticache.describe_cache_parameter_groups myParameterGroup
    R1R2uCacheParameterGroupNameR3ucache_parameter_groupR4uCacheParameterGroupsR5RR R!R"(R:(R1R5RR R!R"((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytdescribe_cache_parameter_groups�scK@s7t|ddddddd|d|d	|d
||�S(u
    Create a cache parameter group.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.create_cache_parameter_group                 name=myParamGroup                 CacheParameterGroupFamily=redis2.8                 Description="My Parameter Group"
    R2uCacheParameterGroupNameRFucache parameter groupR3ucache_parameter_groupRR R!R"(RO(R1RR R!R"R((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytcreate_cache_parameter_group�s
cK@s7t|ddddddd|d|d	|d
||�S(u�
    Delete a cache parameter group.

    Example:

    .. code-block:: bash

        salt myminion boto3_elasticache.delete_cache_parameter_group myParamGroup
    R2uCacheParameterGroupNameRFucache parameter groupR3ucache_parameter_groupRR R!R"(RL(R1RR R!R"R((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pytdelete_cache_parameter_group�s
(=t__doc__t
__future__RRRtloggingRBtsalt.exceptionsRRtsalt.utils.compatRtsalt.utils.versionst	getLoggerRR/R,tboto3tsetLeveltCRITICALR@RtImportErrorRER	RRRR:RLRORPRQRSRZR[R\R]R^R_R`RaRbRcReRjRkRlRmRnRoRpRqRrRsRtRuRvRwRxRy(((sB/usr/lib/python2.7/site-packages/salt/modules/boto3_elasticache.pyt<module>,sx


			644
	"
&&
"#&&&

Zerion Mini Shell 1.0