INFRA-4293 - it appears that examples are examples unless they're tagged with 'Example:' :)

This commit is contained in:
Tom Williams 2016-12-28 17:14:49 -05:00
parent 6fafd3cadd
commit be7f9c0417
2 changed files with 50 additions and 29 deletions

View File

@ -273,6 +273,8 @@ def describe_cache_clusters(name=None, conn=None, region=None, key=None,
'''
Return details about all (or just one) Elasticache cache clusters.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.describe_cache_clusters
@ -287,6 +289,8 @@ def cache_cluster_exists(name, conn=None, region=None, key=None, keyid=None, pro
'''
Check to see if a cache cluster exists.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.cache_cluster_exists myelasticache
@ -299,6 +303,8 @@ def create_cache_cluster(name, wait=600, security_groups=None,
'''
Create a cache cluster.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.create_cache_cluster name=myCacheCluster \
@ -336,6 +342,8 @@ def modify_cache_cluster(name, wait=600, security_groups=None, region=None,
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 \
@ -359,6 +367,8 @@ def delete_cache_cluster(name, wait=600, region=None, key=None, keyid=None, prof
'''
Delete a cache cluster.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.delete myelasticache
@ -373,6 +383,8 @@ def describe_replication_groups(name=None, conn=None, region=None, key=None, key
'''
Return details about all (or just one) Elasticache replication groups.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.describe_replication_groups
@ -387,6 +399,8 @@ def replication_group_exists(name, region=None, key=None, keyid=None, profile=No
'''
Check to see if a replication group exists.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.replication_group_exists myelasticache
@ -403,6 +417,8 @@ def create_replication_group(name, wait=600, security_groups=None, region=None,
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 \
@ -428,6 +444,8 @@ def modify_replication_group(name, wait=600, security_groups=None, region=None,
'''
Modify a replication group.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.modify_replication_group \
@ -452,6 +470,8 @@ def delete_replication_group(name, wait=600, region=None, key=None, keyid=None,
'''
Delete an ElastiCache replication group, optionally taking a snapshot first.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.delete_replication_group my-replication-group
@ -465,6 +485,8 @@ def describe_cache_subnet_groups(name=None, conn=None, region=None, key=None, ke
'''
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
@ -478,6 +500,8 @@ def cache_subnet_group_exists(name, region=None, key=None, keyid=None, profile=N
'''
Check to see if an ElastiCache subnet group exists.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.cache_subnet_group_exists my-subnet-group
@ -489,6 +513,8 @@ def list_cache_subnet_groups(region=None, key=None, keyid=None, profile=None):
'''
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
@ -501,6 +527,8 @@ def create_cache_subnet_group(name, subnets=None, region=None, key=None, keyid=N
'''
Create an ElastiCache subnet group
Example:
.. code-block:: bash
salt myminion boto3_elasticache.create_cache_subnet_group \
@ -538,6 +566,8 @@ def modify_cache_subnet_group(name, subnets=None, region=None, key=None, keyid=N
'''
Modify an ElastiCache subnet group
Example:
.. code-block:: bash
salt myminion boto3_elasticache.modify_cache_subnet_group \
@ -574,6 +604,8 @@ def delete_cache_subnet_group(name, region=None, key=None, keyid=None, profile=N
'''
Delete an ElastiCache subnet group.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.delete_subnet_group my-subnet-group region=us-east-1
@ -587,6 +619,8 @@ def describe_cache_security_groups(name=None, conn=None, region=None, key=None,
'''
Return details about all (or just one) Elasticache cache clusters.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.describe_cache_security_groups
@ -602,6 +636,8 @@ def cache_security_group_exists(name, region=None, key=None, keyid=None, profile
'''
Check to see if an ElastiCache security group exists.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.cache_security_group_exists mysecuritygroup
@ -613,6 +649,8 @@ def create_cache_security_group(name, region=None, key=None, keyid=None, profile
'''
Create a cache security group.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.create_cache_security_group mycachesecgrp Description='My Cache Security Group'
@ -626,6 +664,8 @@ def delete_cache_security_group(name, region=None, key=None, keyid=None, profile
'''
Delete a cache security group.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.delete_cache_security_group myelasticachesg
@ -639,6 +679,8 @@ def authorize_cache_security_group_ingress(name, region=None, key=None, keyid=No
'''
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 \
@ -668,6 +710,8 @@ def revoke_cache_security_group_ingress(name, region=None, key=None, keyid=None,
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 \
@ -803,6 +847,8 @@ def describe_cache_parameter_groups(name=None, conn=None, region=None, key=None,
'''
Return details about all (or just one) Elasticache cache clusters.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.describe_cache_parameter_groups
@ -817,6 +863,8 @@ def create_cache_parameter_group(name, region=None, key=None, keyid=None, profil
'''
Create a cache parameter group.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.create_cache_parameter_group \
@ -833,6 +881,8 @@ def delete_cache_parameter_group(name, region=None, key=None, keyid=None, profil
'''
Delete a cache parameter group.
Example:
.. code-block:: bash
salt myminion boto3_elasticache.delete_cache_parameter_group myParamGroup

View File

@ -1014,35 +1014,6 @@ def cache_subnet_group_present(name, subnets=None, region=None, key=None, keyid=
return ret
def subnet_group_absent(name, tags=None, region=None, key=None, keyid=None, profile=None):
ret = {'name': name,
'result': True,
'comment': '',
'changes': {}
}
exists = __salt__['boto_elasticache.subnet_group_exists'](name=name, tags=tags, region=region, key=key,
keyid=keyid, profile=profile)
if not exists:
ret['result'] = True
ret['comment'] = '{0} ElastiCache subnet group does not exist.'.format(name)
return ret
if __opts__['test']:
ret['comment'] = 'ElastiCache subnet group {0} would be removed.'.format(name)
ret['result'] = None
return ret
deleted = __salt__['boto_elasticache.delete_subnet_group'](name, region, key, keyid, profile)
if not deleted:
ret['result'] = False
ret['comment'] = 'Failed to delete {0} ElastiCache subnet group.'.format(name)
return ret
ret['changes']['old'] = name
ret['changes']['new'] = None
ret['comment'] = 'ElastiCache subnet group {0} deleted.'.format(name)
return ret
def cache_subnet_group_absent(name, region=None, key=None, keyid=None, profile=None, **args):
'''
Ensure a given cache subnet group is deleted.