Add CLI Examples to boto_vpc module

This commit is contained in:
rallytime 2014-10-06 20:34:40 -06:00
parent d98bf9fa3d
commit 1ab0d7e6fa

View File

@ -317,6 +317,13 @@ def subnet_exists(subnet_id=None, name=None, tags=None, region=None, key=None, k
Check if a subnet exists.
Returns True if the subnet exists, otherwise returns False.
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.subnet_exists subnet_id='subnet-6a1fe403'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -426,6 +433,13 @@ def customer_gateway_exists(customer_gateway_id, region=None, key=None, keyid=No
Given a customer gateway ID, check if the customer gateway ID exists.
Returns True if the customer gateway ID exists; Returns False otherwise.
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.customer_gateway_exists 'cgw-b6a247df'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -546,7 +560,14 @@ def dhcp_options_exists(dhcp_options_id=None, name=None, tags=None, region=None,
'''
Check if a dhcp option exists.
Returns True if the dhcp otpion exists; Returns False otherwise.
Returns True if the dhcp option exists; Returns False otherwise.
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.dhcp_options_exists dhcp_options_id='dhcp-a0bl34pp'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -588,6 +609,13 @@ def create_network_acl(vpc_id, network_acl_name=None, tags=None, region=None, ke
Given a vpc_id, creates a network acl.
Returns the network acl id if successful, otherwise returns False.
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.create_network_acl 'vpc-6b1fe402'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -612,7 +640,14 @@ def delete_network_acl(network_acl_id, region=None, key=None, keyid=None, profil
'''
Deletes a network acl based on the network_acl_id provided.
Returns True if the network acl was deleted successfully, otherwise returns False
Returns True if the network acl was deleted successfully, otherwise returns False.
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.delete_network_acl 'acl-5fb85d36'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -635,6 +670,12 @@ def network_acl_exists(network_acl_id=None, name=None, tags=None, region=None, k
Checks if a network acl exists.
Returns True if the network acl exists or returns False if it doesn't exist.
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.network_acl_exists network_acl_id='acl-5fb85d36'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -673,7 +714,14 @@ def associate_network_acl_to_subnet(network_acl_id, subnet_id, region=None, key=
'''
Given a network acl ID and a subnet ID, associates a network acl to a subnet.
Returns the association ID if successful, otherwise returns False,
Returns the association ID if successful, otherwise returns False.
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.associate_network_acl_to_subnet 'acl-5fb85d36' 'subnet-6a1fe403'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -699,6 +747,12 @@ def associate_new_network_acl_to_subnet(vpc_id, subnet_id, network_acl_name=None
Returns a dictionary containing the network acl id and the new association id if successful. If unsuccessful,
returns False.
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.associate_new_network_acl_to_subnet 'vpc-6b1fe402' 'subnet-6a1fe403'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -729,6 +783,13 @@ def associate_new_network_acl_to_subnet(vpc_id, subnet_id, network_acl_name=None
def disassociate_network_acl(subnet_id, vpc_id=None, region=None, key=None, keyid=None, profile=None):
'''
Given a subnet ID, disassociates a network acl.
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.disassociate_network_acl 'subnet-6a1fe403'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -746,6 +807,13 @@ def create_network_acl_entry(network_acl_id, rule_number, protocol, rule_action,
region=None, key=None, keyid=None, profile=None):
'''
Creates a network acl entry.
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.create_network_acl_entry 'acl-5fb85d36' '32767' '-1' 'deny' '0.0.0.0/0'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -772,6 +840,13 @@ def replace_network_acl_entry(network_acl_id, rule_number, protocol, rule_action
region=None, key=None, keyid=None, profile=None):
'''
Replaces a network acl entry.
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.replace_network_acl_entry 'acl-5fb85d36' '32767' '-1' 'deny' '0.0.0.0/0'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -797,6 +872,13 @@ def replace_network_acl_entry(network_acl_id, rule_number, protocol, rule_action
def delete_network_acl_entry(network_acl_id, rule_number, egress=None, region=None, key=None, keyid=None, profile=None):
'''
Deletes a network acl entry.
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.delete_network_acl_entry 'acl-5fb85d36' '32767'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -817,7 +899,14 @@ def delete_network_acl_entry(network_acl_id, rule_number, egress=None, region=No
def create_route_table(vpc_id, route_table_name=None, tags=None, region=None, key=None, keyid=None, profile=None):
'''
Creates a route table
Creates a route table.
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.create_route_table 'vpc-6b1fe402'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -841,6 +930,13 @@ def create_route_table(vpc_id, route_table_name=None, tags=None, region=None, ke
def delete_route_table(route_table_id, region=None, key=None, keyid=None, profile=None):
'''
Deletes a route table.
CLI Example::
.. code-example:: bash
salt myminion boto_vpc.delete_route_table 'rtb-1f382e7d'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -861,6 +957,13 @@ def delete_route_table(route_table_id, region=None, key=None, keyid=None, profil
def route_table_exists(route_table_id=None, name=None, tags=None, region=None, key=None, keyid=None, profile=None):
'''
Checks if a route table exists.
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.route_table_exists route_table_id='rtb-1f382e7d'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -899,6 +1002,13 @@ def route_table_exists(route_table_id=None, name=None, tags=None, region=None, k
def associate_route_table(route_table_id, subnet_id, region=None, key=None, keyid=None, profile=None):
'''
Given a route table ID and a subnet ID, associates the route table with the subnet.
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.associate_route_table 'rtb-1f382e7d' 'subnet-6a1fe403'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -917,6 +1027,16 @@ def associate_route_table(route_table_id, subnet_id, region=None, key=None, keyi
def disassociate_route_table(association_id, region=None, key=None, keyid=None, profile=None):
'''
Dissassociates a route table.
association_id
The Route Table Association ID to disassociate
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.disassociate_route_table 'rtbassoc-d8ccddba'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -939,6 +1059,13 @@ def disassociate_route_table(association_id, region=None, key=None, keyid=None,
def replace_route_table_association(association_id, route_table_id, region=None, key=None, keyid=None, profile=None):
'''
Replaces a route table association.
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.replace_route_table_association 'rtbassoc-d8ccddba' 'rtb-1f382e7d'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -958,6 +1085,13 @@ def create_route(route_table_id, destination_cidr_block, gateway_id=None, instan
region=None, key=None, keyid=None, profile=None):
'''
Creates a route.
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.create_route 'rtb-1f382e7d' '10.0.0.0/16'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -981,7 +1115,14 @@ def create_route(route_table_id, destination_cidr_block, gateway_id=None, instan
def delete_route(route_table_id, destination_cidr_block, region=None, key=None, keyid=None, profile=None):
'''
Deletes a route
Deletes a route.
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.delete_route 'rtb-1f382e7d' '10.0.0.0/16'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn:
@ -1006,6 +1147,13 @@ def replace_route(route_table_id, destination_cidr_block, gateway_id=None, insta
region=None, key=None, keyid=None, profile=None):
'''
Replaces a route.
CLI Example::
.. code-block:: bash
salt myminion boto_vpc.replace_route 'rtb-1f382e7d' '10.0.0.0/16'
'''
conn = _get_conn(region, key, keyid, profile)
if not conn: