INSTRUCTION stringlengths 1 8.43k | RESPONSE stringlengths 75 104k |
|---|---|
Return all the lines ( as text ) that match the expression in the regex argument. | def find_lines(config=None, config_path=None, regex=None, saltenv='base'):
'''
Return all the lines (as text) that match the expression in the ``regex``
argument.
config
The configuration sent as text.
.. note::
This argument is ignored when ``config_path`` is specified.
... |
r Return a list of parent lines ( as text ) matching the regular expression parent_regex that have children lines matching child_regex. | def find_lines_w_child(config=None,
config_path=None,
parent_regex=None,
child_regex=None,
ignore_ws=False,
saltenv='base'):
r'''
Return a list of parent lines (as text) matching the regular expre... |
Return a list of parent ciscoconfparse. IOSCfgLine objects which matched the parent_regex and whose children did * not * match child_regex. Only the parent ciscoconfparse. IOSCfgLine objects will be returned. For simplicity this method only finds oldest ancestors without immediate children that match. | def find_objects_wo_child(config=None,
config_path=None,
parent_regex=None,
child_regex=None,
ignore_ws=False,
saltenv='base'):
'''
Return a list of parent ``ciscoconfparse.IOSCfgLin... |
Return a list of parent ciscoconfparse. IOSCfgLine lines as text which matched the parent_regex and whose children did * not * match child_regex. Only the parent ciscoconfparse. IOSCfgLine text lines will be returned. For simplicity this method only finds oldest ancestors without immediate children that match. | def find_lines_wo_child(config=None,
config_path=None,
parent_regex=None,
child_regex=None,
ignore_ws=False,
saltenv='base'):
'''
Return a list of parent ``ciscoconfparse.IOSCfgLine`` lines as... |
Return a list of detailed matches for the configuration blocks ( parent - child relationship ) whose parent respects the regular expressions configured via the parent_regex argument and the child matches the child_regex regular expression. The result is a list of dictionaries with the following keys: | def filter_lines(config=None,
config_path=None,
parent_regex=None,
child_regex=None,
saltenv='base'):
'''
Return a list of detailed matches, for the configuration blocks (parent-child
relationship) whose parent respects the regular expressi... |
This state module allows you to modify system tuned parameters | def profile(name):
'''
This state module allows you to modify system tuned parameters
Example tuned.sls file to set profile to virtual-guest
tuned:
tuned:
- profile
- name: virtual-guest
name
tuned profile name to set the system to
To see a valid list of states ... |
Removes RPM/ SLA probes from the network device. Calls the configuration template delete_probes from the NAPALM library providing as input a rich formatted dictionary with the configuration details of the probes to be removed from the configuration of the device. | def delete_probes(probes, test=False, commit=True, **kwargs): # pylint: disable=unused-argument
'''
Removes RPM/SLA probes from the network device.
Calls the configuration template 'delete_probes' from the NAPALM library,
providing as input a rich formatted dictionary with the configuration details of... |
Global function to access the couchbase connection ( and make it if its closed ) | def _get_connection():
'''
Global function to access the couchbase connection (and make it if its closed)
'''
global COUCHBASE_CONN
if COUCHBASE_CONN is None:
opts = _get_options()
if opts['password']:
COUCHBASE_CONN = couchbase.Couchbase.connect(host=opts['host'],
... |
Verify that you have the views you need. This can be disabled by adding couchbase. skip_verify_views: True in config | def _verify_views():
'''
Verify that you have the views you need. This can be disabled by
adding couchbase.skip_verify_views: True in config
'''
global VERIFIED_VIEWS
if VERIFIED_VIEWS or __opts__.get('couchbase.skip_verify_views', False):
return
cb_ = _get_connection()
ddoc = {... |
Return a job id and prepare the job id directory This is the function responsible for making sure jids don t collide ( unless its passed a jid ) So do what you have to do to make sure that stays the case | def prep_jid(nocache=False, passed_jid=None):
'''
Return a job id and prepare the job id directory
This is the function responsible for making sure jids don't collide (unless
its passed a jid)
So do what you have to do to make sure that stays the case
'''
if passed_jid is None:
jid =... |
Return data to couchbase bucket | def returner(load):
'''
Return data to couchbase bucket
'''
cb_ = _get_connection()
hn_key = '{0}/{1}'.format(load['jid'], load['id'])
try:
ret_doc = {'return': load['return'],
'full_ret': salt.utils.json.dumps(load)}
cb_.add(hn_key,
ret_doc,
... |
Save the load to the specified jid | def save_load(jid, clear_load, minion=None):
'''
Save the load to the specified jid
'''
cb_ = _get_connection()
try:
jid_doc = cb_.get(six.text_type(jid))
except couchbase.exceptions.NotFoundError:
cb_.add(six.text_type(jid), {}, ttl=_get_ttl())
jid_doc = cb_.get(six.tex... |
Save/ update the minion list for a given jid. The syndic_id argument is included for API compatibility only. | def save_minions(jid, minions, syndic_id=None): # pylint: disable=unused-argument
'''
Save/update the minion list for a given jid. The syndic_id argument is
included for API compatibility only.
'''
cb_ = _get_connection()
try:
jid_doc = cb_.get(six.text_type(jid))
except couchbase.... |
Return the load data that marks a specified jid | def get_load(jid):
'''
Return the load data that marks a specified jid
'''
cb_ = _get_connection()
try:
jid_doc = cb_.get(six.text_type(jid))
except couchbase.exceptions.NotFoundError:
return {}
ret = {}
try:
ret = jid_doc.value['load']
ret['Minions'] = ... |
Return the information returned when the specified job id was executed | def get_jid(jid):
'''
Return the information returned when the specified job id was executed
'''
cb_ = _get_connection()
_verify_views()
ret = {}
for result in cb_.query(DESIGN_NAME, 'jid_returns', key=six.text_type(jid), include_docs=True):
ret[result.value] = result.doc.value
... |
Return a list of all job ids | def get_jids():
'''
Return a list of all job ids
'''
cb_ = _get_connection()
_verify_views()
ret = {}
for result in cb_.query(DESIGN_NAME, 'jids', include_docs=True):
ret[result.key] = _format_jid_instance(result.key, result.doc.value['load'])
return ret |
Return a properly formatted jid dict | def _format_jid_instance(jid, job):
'''
Return a properly formatted jid dict
'''
ret = _format_job_instance(job)
ret.update({'StartTime': salt.utils.jid.jid_to_time(jid)})
return ret |
Return the Redis server connection details from the __opts__. | def _get_redis_cache_opts():
'''
Return the Redis server connection details from the __opts__.
'''
return {
'host': __opts__.get('cache.redis.host', 'localhost'),
'port': __opts__.get('cache.redis.port', 6379),
'unix_socket_path': __opts__.get('cache.redis.unix_socket_path', None... |
Return the Redis server instance. Caching the object instance. | def _get_redis_server(opts=None):
'''
Return the Redis server instance.
Caching the object instance.
'''
global REDIS_SERVER
if REDIS_SERVER:
return REDIS_SERVER
if not opts:
opts = _get_redis_cache_opts()
if opts['cluster_mode']:
REDIS_SERVER = StrictRedisCluste... |
Build the key opts based on the user options. | def _get_redis_keys_opts():
'''
Build the key opts based on the user options.
'''
return {
'bank_prefix': __opts__.get('cache.redis.bank_prefix', _BANK_PREFIX),
'bank_keys_prefix': __opts__.get('cache.redis.bank_keys_prefix', _BANK_KEYS_PREFIX),
'key_prefix': __opts__.get('cache.... |
Return the Redis key for the bank given the name. | def _get_bank_redis_key(bank):
'''
Return the Redis key for the bank given the name.
'''
opts = _get_redis_keys_opts()
return '{prefix}{separator}{bank}'.format(
prefix=opts['bank_prefix'],
separator=opts['separator'],
bank=bank
) |
Return the Redis key given the bank name and the key name. | def _get_key_redis_key(bank, key):
'''
Return the Redis key given the bank name and the key name.
'''
opts = _get_redis_keys_opts()
return '{prefix}{separator}{bank}/{key}'.format(
prefix=opts['key_prefix'],
separator=opts['separator'],
bank=bank,
key=key
) |
Return the Redis key for the SET of keys under a certain bank given the bank name. | def _get_bank_keys_redis_key(bank):
'''
Return the Redis key for the SET of keys under a certain bank, given the bank name.
'''
opts = _get_redis_keys_opts()
return '{prefix}{separator}{bank}'.format(
prefix=opts['bank_keys_prefix'],
separator=opts['separator'],
bank=bank
... |
Build the bank hierarchy from the root of the tree. If already exists it won t rewrite. It s using the Redis pipeline so there will be only one interaction with the remote server. | def _build_bank_hier(bank, redis_pipe):
'''
Build the bank hierarchy from the root of the tree.
If already exists, it won't rewrite.
It's using the Redis pipeline,
so there will be only one interaction with the remote server.
'''
bank_list = bank.split('/')
parent_bank_path = bank_list[0... |
A simple tree tarversal algorithm that builds the list of banks to remove starting from an arbitrary node in the tree. | def _get_banks_to_remove(redis_server, bank, path=''):
'''
A simple tree tarversal algorithm that builds the list of banks to remove,
starting from an arbitrary node in the tree.
'''
current_path = bank if not path else '{path}/{bank}'.format(path=path, bank=bank)
bank_paths_to_remove = [current... |
Store the data in a Redis key. | def store(bank, key, data):
'''
Store the data in a Redis key.
'''
redis_server = _get_redis_server()
redis_pipe = redis_server.pipeline()
redis_key = _get_key_redis_key(bank, key)
redis_bank_keys = _get_bank_keys_redis_key(bank)
try:
_build_bank_hier(bank, redis_pipe)
va... |
Fetch data from the Redis cache. | def fetch(bank, key):
'''
Fetch data from the Redis cache.
'''
redis_server = _get_redis_server()
redis_key = _get_key_redis_key(bank, key)
redis_value = None
try:
redis_value = redis_server.get(redis_key)
except (RedisConnectionError, RedisResponseError) as rerr:
mesg = ... |
Remove the key from the cache bank with all the key content. If no key is specified remove the entire bank with all keys and sub - banks inside. This function is using the Redis pipelining for best performance. However when removing a whole bank in order to re - create the tree there are a couple of requests made. In t... | def flush(bank, key=None):
'''
Remove the key from the cache bank with all the key content. If no key is specified, remove
the entire bank with all keys and sub-banks inside.
This function is using the Redis pipelining for best performance.
However, when removing a whole bank,
in order to re-cre... |
Lists entries stored in the specified bank. | def list_(bank):
'''
Lists entries stored in the specified bank.
'''
redis_server = _get_redis_server()
bank_redis_key = _get_bank_redis_key(bank)
try:
banks = redis_server.smembers(bank_redis_key)
except (RedisConnectionError, RedisResponseError) as rerr:
mesg = 'Cannot list... |
Checks if the specified bank contains the specified key. | def contains(bank, key):
'''
Checks if the specified bank contains the specified key.
'''
redis_server = _get_redis_server()
bank_redis_key = _get_bank_redis_key(bank)
try:
return redis_server.sismember(bank_redis_key, key)
except (RedisConnectionError, RedisResponseError) as rerr:
... |
Check whether a VPC with the given name or id exists. Returns the vpc_id or None. Raises SaltInvocationError if both vpc_id and vpc_name are None. Optionally raise a CommandExecutionError if the VPC does not exist. | def check_vpc(vpc_id=None, vpc_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Check whether a VPC with the given name or id exists.
Returns the vpc_id or None. Raises SaltInvocationError if
both vpc_id and vpc_name are None. Optionally raise a
CommandExecutionError if... |
Create a VPC resource. Returns the resource id if created or False if not created. | def _create_resource(resource, name=None, tags=None, region=None, key=None,
keyid=None, profile=None, **kwargs):
'''
Create a VPC resource. Returns the resource id if created, or False
if not created.
'''
try:
try:
conn = _get_conn(region=region, key=key, ke... |
Delete a VPC resource. Returns True if successful otherwise False. | def _delete_resource(resource, name=None, resource_id=None, region=None,
key=None, keyid=None, profile=None, **kwargs):
'''
Delete a VPC resource. Returns True if successful, otherwise False.
'''
if not _exactly_one((name, resource_id)):
raise SaltInvocationError('One (but ... |
Get a VPC resource based on resource type and name or id. Cache the id if name was provided. | def _get_resource(resource, name=None, resource_id=None, region=None,
key=None, keyid=None, profile=None):
'''
Get a VPC resource based on resource type and name or id.
Cache the id if name was provided.
'''
if not _exactly_one((name, resource_id)):
raise SaltInvocationErr... |
Get VPC resources based on resource type and name id or tags. | def _find_resources(resource, name=None, resource_id=None, tags=None,
region=None, key=None, keyid=None, profile=None):
'''
Get VPC resources based on resource type and name, id, or tags.
'''
if all((resource_id, name)):
raise SaltInvocationError('Only one of name or id may ... |
Get an AWS id for a VPC resource by type and name. | def _get_resource_id(resource, name, region=None, key=None,
keyid=None, profile=None):
'''
Get an AWS id for a VPC resource by type and name.
'''
_id = _cache_id(name, sub_resource=resource,
region=region, key=key,
keyid=keyid, profile=profil... |
Get an AWS id for a VPC resource by type and name. | def get_resource_id(resource, name=None, resource_id=None, region=None,
key=None, keyid=None, profile=None):
'''
Get an AWS id for a VPC resource by type and name.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.get_resource_id inte... |
Given a resource type and name return { exists: true } if it exists { exists: false } if it does not exist or { error: { message: error text } on error. | def resource_exists(resource, name=None, resource_id=None, tags=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a resource type and name, return {exists: true} if it exists,
{exists: false} if it does not exist, or {error: {message: error text}
on error.
.. ver... |
Given VPC properties return the VPC id if a match is found. | def _get_id(vpc_name=None, cidr=None, tags=None, region=None, key=None,
keyid=None, profile=None):
'''
Given VPC properties, return the VPC id if a match is found.
'''
if vpc_name and not any((cidr, tags)):
vpc_id = _cache_id(vpc_name, region=region,
key=k... |
Given VPC properties return the VPC id if a match is found. | def get_id(name=None, cidr=None, tags=None, region=None, key=None, keyid=None,
profile=None):
'''
Given VPC properties, return the VPC id if a match is found.
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.get_id myvpc
'''
try:
return {'id': _get_id(vpc_... |
Given a VPC ID check to see if the given VPC ID exists. | def exists(vpc_id=None, name=None, cidr=None, tags=None, region=None, key=None,
keyid=None, profile=None):
'''
Given a VPC ID, check to see if the given VPC ID exists.
Returns True if the given VPC ID exists and returns False if the given
VPC ID does not exist.
CLI Example:
.. code... |
Given a valid CIDR block create a VPC. | def create(cidr_block, instance_tenancy=None, vpc_name=None,
enable_dns_support=None, enable_dns_hostnames=None, tags=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid CIDR block, create a VPC.
An optional instance_tenancy argument can be provided. If provided,... |
Given a VPC ID or VPC name delete the VPC. | def delete(vpc_id=None, name=None, vpc_name=None, tags=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a VPC ID or VPC name, delete the VPC.
Returns {deleted: true} if the VPC was deleted and returns
{deleted: false} if the VPC was not deleted.
CLI Example:
.. cod... |
Given a VPC ID describe its properties. | def describe(vpc_id=None, vpc_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Given a VPC ID describe its properties.
Returns a dictionary of interesting properties.
.. versionchanged:: 2015.8.0
Added vpc_name argument
CLI Example:
.. code-block:: bash
... |
Describe all VPCs matching the filter criteria if provided. | def describe_vpcs(vpc_id=None, name=None, cidr=None, tags=None,
region=None, key=None, keyid=None, profile=None):
'''
Describe all VPCs, matching the filter criteria if provided.
Returns a list of dictionaries with interesting properties.
.. versionadded:: 2015.8.0
CLI Example:
... |
Given subnet properties find and return matching subnet ids | def _find_subnets(subnet_name=None, vpc_id=None, cidr=None, tags=None, conn=None):
'''
Given subnet properties, find and return matching subnet ids
'''
if not any([subnet_name, tags, cidr]):
raise SaltInvocationError('At least one of the following must be '
'sp... |
Given a valid VPC ID or Name and a CIDR block create a subnet for the VPC. | def create_subnet(vpc_id=None, cidr_block=None, vpc_name=None,
availability_zone=None, subnet_name=None, tags=None,
region=None, key=None, keyid=None, profile=None, auto_assign_public_ipv4=False):
'''
Given a valid VPC ID or Name and a CIDR block, create a subnet for the VPC.... |
Given a subnet ID or name delete the subnet. | def delete_subnet(subnet_id=None, subnet_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Given a subnet ID or name, delete the subnet.
Returns True if the subnet was deleted and returns False if the subnet was not deleted.
.. versionchanged:: 2015.8.0
Added s... |
Check if a subnet exists. | def subnet_exists(subnet_id=None, name=None, subnet_name=None, cidr=None,
tags=None, zones=None, region=None, key=None, keyid=None,
profile=None):
'''
Check if a subnet exists.
Returns True if the subnet exists, otherwise returns False.
.. versionchanged:: 2015.8.0
... |
Given a subnet ( aka: a vpc zone identifier ) or list of subnets returns vpc association. | def get_subnet_association(subnets, region=None, key=None, keyid=None,
profile=None):
'''
Given a subnet (aka: a vpc zone identifier) or list of subnets, returns
vpc association.
Returns a VPC ID if the given subnets are associated with the same VPC ID.
Returns False on a... |
Given a subnet id or name describe its properties. | def describe_subnet(subnet_id=None, subnet_name=None, region=None,
key=None, keyid=None, profile=None):
'''
Given a subnet id or name, describe its properties.
Returns a dictionary of interesting properties.
.. versionadded:: 2015.8.0
CLI Examples:
.. code-block:: bash
... |
Given a VPC ID or subnet CIDR returns a list of associated subnets and their details. Return all subnets if VPC ID or CIDR are not provided. If a subnet id or CIDR is provided only its associated subnet details will be returned. | def describe_subnets(subnet_ids=None, subnet_names=None, vpc_id=None, cidr=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a VPC ID or subnet CIDR, returns a list of associated subnets and
their details. Return all subnets if VPC ID or CIDR are not provided.
If a s... |
Create an Internet Gateway optionally attaching it to an existing VPC. | def create_internet_gateway(internet_gateway_name=None, vpc_id=None,
vpc_name=None, tags=None, region=None, key=None,
keyid=None, profile=None):
'''
Create an Internet Gateway, optionally attaching it to an existing VPC.
Returns the internet gateway i... |
Delete an internet gateway ( by name or id ). | def delete_internet_gateway(internet_gateway_id=None,
internet_gateway_name=None,
detach=False, region=None,
key=None, keyid=None, profile=None):
'''
Delete an internet gateway (by name or id).
Returns True if the internet ... |
Given gateway properties find and return matching nat gateways | def _find_nat_gateways(nat_gateway_id=None, subnet_id=None, subnet_name=None, vpc_id=None, vpc_name=None,
states=('pending', 'available'),
region=None, key=None, keyid=None, profile=None):
'''
Given gateway properties, find and return matching nat gateways
'''
... |
Checks if a nat gateway exists. | def nat_gateway_exists(nat_gateway_id=None, subnet_id=None, subnet_name=None,
vpc_id=None, vpc_name=None,
states=('pending', 'available'),
region=None, key=None, keyid=None, profile=None):
'''
Checks if a nat gateway exists.
This function... |
Return a description of nat gateways matching the selection criteria | def describe_nat_gateways(nat_gateway_id=None, subnet_id=None, subnet_name=None,
vpc_id=None, vpc_name=None,
states=('pending', 'available'),
region=None, key=None, keyid=None, profile=None):
'''
Return a description of nat gateways matching t... |
Create a NAT Gateway within an existing subnet. If allocation_id is specified the elastic IP address it references is associated with the gateway. Otherwise a new allocation_id is created and used. | def create_nat_gateway(subnet_id=None,
subnet_name=None, allocation_id=None,
region=None, key=None, keyid=None, profile=None):
'''
Create a NAT Gateway within an existing subnet. If allocation_id is
specified, the elastic IP address it references is associated w... |
Delete a nat gateway ( by id ). | def delete_nat_gateway(nat_gateway_id,
release_eips=False, region=None,
key=None, keyid=None, profile=None,
wait_for_delete=False, wait_for_delete_retries=5):
'''
Delete a nat gateway (by id).
Returns True if the internet gateway was dele... |
Given a valid VPN connection type a static IP address and a customer gateway’s Border Gateway Protocol ( BGP ) Autonomous System Number create a customer gateway. | def create_customer_gateway(vpn_connection_type, ip_address, bgp_asn,
customer_gateway_name=None, tags=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid VPN connection type, a static IP address and a customer
gateway’s Border Ga... |
Given a customer gateway ID or name delete the customer gateway. | def delete_customer_gateway(customer_gateway_id=None, customer_gateway_name=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a customer gateway ID or name, delete the customer gateway.
Returns True if the customer gateway was deleted and returns False if the cus... |
Given a customer gateway ID check if the customer gateway ID exists. | def customer_gateway_exists(customer_gateway_id=None, customer_gateway_name=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a customer gateway ID, check if the customer gateway ID exists.
Returns True if the customer gateway ID exists; Returns False otherwise.
... |
Given valid DHCP options create a DHCP options record optionally associating it with an existing VPC. | def create_dhcp_options(domain_name=None, domain_name_servers=None, ntp_servers=None,
netbios_name_servers=None, netbios_node_type=None,
dhcp_options_name=None, tags=None, vpc_id=None, vpc_name=None,
region=None, key=None, keyid=None, profile=None)... |
Return a dict with the current values of the requested DHCP options set | def get_dhcp_options(dhcp_options_name=None, dhcp_options_id=None,
region=None, key=None, keyid=None, profile=None):
'''
Return a dict with the current values of the requested DHCP options set
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.get_dhcp_options 'myfu... |
Delete dhcp options by id or name. | def delete_dhcp_options(dhcp_options_id=None, dhcp_options_name=None,
region=None, key=None, keyid=None, profile=None):
'''
Delete dhcp options by id or name.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.delete_dhcp_options '... |
Given valid DHCP options id and a valid VPC id associate the DHCP options record with the VPC. | def associate_dhcp_options_to_vpc(dhcp_options_id, vpc_id=None, vpc_name=None,
region=None, key=None, keyid=None, profile=None):
'''
Given valid DHCP options id and a valid VPC id, associate the DHCP options record with the VPC.
Returns True if the DHCP options record were... |
Check if a dhcp option exists. | def dhcp_options_exists(dhcp_options_id=None, name=None, dhcp_options_name=None,
tags=None, region=None, key=None, keyid=None, profile=None):
'''
Check if a dhcp option exists.
Returns True if the dhcp option exists; Returns False otherwise.
CLI Example:
.. code-block:: ba... |
Given a vpc_id creates a network acl. | def create_network_acl(vpc_id=None, vpc_name=None, network_acl_name=None,
subnet_id=None, subnet_name=None, tags=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a vpc_id, creates a network acl.
Returns the network acl id if successful, otherwi... |
Delete a network acl based on the network_acl_id or network_acl_name provided. | def delete_network_acl(network_acl_id=None, network_acl_name=None, disassociate=False,
region=None, key=None, keyid=None, profile=None):
'''
Delete a network acl based on the network_acl_id or network_acl_name provided.
CLI Examples:
.. code-block:: bash
salt myminion b... |
Checks if a network acl exists. | def network_acl_exists(network_acl_id=None, name=None, network_acl_name=None,
tags=None, region=None, key=None, keyid=None,
profile=None):
'''
Checks if a network acl exists.
Returns True if the network acl exists or returns False if it doesn't exist.
CLI ... |
Given a network acl and subnet ids or names associate a network acl to a subnet. | def associate_network_acl_to_subnet(network_acl_id=None, subnet_id=None,
network_acl_name=None,
subnet_name=None, region=None,
key=None, keyid=None, profile=None):
'''
Given a network acl and subnet ids o... |
Given a subnet ID disassociates a network acl. | def disassociate_network_acl(subnet_id=None, vpc_id=None, subnet_name=None, vpc_name=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_n... |
Creates a network acl entry. | def create_network_acl_entry(network_acl_id=None, rule_number=None, protocol=None,
rule_action=None, cidr_block=None, egress=None,
network_acl_name=None, icmp_code=None, icmp_type=None,
port_range_from=None, port_range_to=None,
... |
Deletes a network acl entry. | def delete_network_acl_entry(network_acl_id=None, rule_number=None, egress=None,
network_acl_name=None, region=None, key=None, keyid=None,
profile=None):
'''
Deletes a network acl entry.
CLI Example:
.. code-block:: bash
salt myminion ... |
Creates a route table. | def create_route_table(vpc_id=None, vpc_name=None, route_table_name=None,
tags=None, region=None, key=None, keyid=None, profile=None):
'''
Creates a route table.
.. versionchanged:: 2015.8.0
Added vpc_name argument
CLI Examples:
.. code-block:: bash
salt my... |
Deletes a route table. | def delete_route_table(route_table_id=None, route_table_name=None,
region=None, key=None, keyid=None, profile=None):
'''
Deletes a route table.
CLI Examples:
.. code-block:: bash
salt myminion boto_vpc.delete_route_table route_table_id='rtb-1f382e7d'
salt mymini... |
Checks if a route table exists. | def route_table_exists(route_table_id=None, name=None, route_table_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... |
Checks if a route exists. | def route_exists(destination_cidr_block, route_table_name=None, route_table_id=None,
gateway_id=None, instance_id=None, interface_id=None, tags=None,
region=None, key=None, keyid=None, profile=None, vpc_peering_connection_id=None):
'''
Checks if a route exists.
.. versiona... |
Given a route table and subnet name or id associates the route table with the subnet. | def associate_route_table(route_table_id=None, subnet_id=None,
route_table_name=None, subnet_name=None,
region=None, key=None, keyid=None,
profile=None):
'''
Given a route table and subnet name or id, associates the route table with t... |
Dissassociates a route table. | 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 'rtbass... |
Replaces a route table association. | 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'
'''
... |
Creates a route. | def create_route(route_table_id=None, destination_cidr_block=None,
route_table_name=None, gateway_id=None,
internet_gateway_name=None,
instance_id=None, interface_id=None,
vpc_peering_connection_id=None, vpc_peering_connection_name=None,
... |
Deletes a route. | def delete_route(route_table_id=None, destination_cidr_block=None,
route_table_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Deletes a route.
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.delete_route 'rtb-1f382e7d' '10.0.0.0/16'... |
Replaces a route. | def replace_route(route_table_id=None, destination_cidr_block=None,
route_table_name=None, gateway_id=None,
instance_id=None, interface_id=None,
region=None, key=None, keyid=None, profile=None,
vpc_peering_connection_id=None):
'''
Replaces ... |
Given route table properties return route table details if matching table ( s ) exist. | def describe_route_table(route_table_id=None, route_table_name=None,
tags=None, region=None, key=None, keyid=None,
profile=None):
'''
Given route table properties, return route table details if matching table(s) exist.
.. versionadded:: 2015.8.0
CLI Ex... |
Given route table properties return details of all matching route tables. | def describe_route_tables(route_table_id=None, route_table_name=None,
vpc_id=None,
tags=None, region=None, key=None, keyid=None,
profile=None):
'''
Given route table properties, return details of all matching route tables.
This func... |
helper function to find subnet explicit route table associations | def _get_subnet_explicit_route_table(subnet_id, vpc_id, conn=None, region=None, key=None, keyid=None, profile=None):
'''
helper function to find subnet explicit route table associations
.. versionadded:: 2016.11.0
'''
if not conn:
conn = _get_conn(region=region, key=key, keyid=keyid, profil... |
Request a VPC peering connection between two VPCs. | def request_vpc_peering_connection(requester_vpc_id=None, requester_vpc_name=None,
peer_vpc_id=None, peer_vpc_name=None, name=None,
peer_owner_id=None, peer_region=None, region=None,
key=None, keyid=None, profile=No... |
: param name: The name of the VPC peering connection.: type name: String: param conn: The boto aws ec2 connection.: return: The id associated with this peering connection | def _get_peering_connection_ids(name, conn):
'''
:param name: The name of the VPC peering connection.
:type name: String
:param conn: The boto aws ec2 connection.
:return: The id associated with this peering connection
Returns the VPC peering connection ids
given the VPC peering connection ... |
Returns any VPC peering connection id ( s ) for the given VPC peering connection name. | def describe_vpc_peering_connection(name,
region=None,
key=None,
keyid=None,
profile=None):
'''
Returns any VPC peering connection id(s) for the given VPC
peering c... |
Request a VPC peering connection between two VPCs. | def accept_vpc_peering_connection( # pylint: disable=too-many-arguments
conn_id='',
name='',
region=None,
key=None,
keyid=None,
... |
Get the ID associated with this name | def _vpc_peering_conn_id_for_name(name, conn):
'''
Get the ID associated with this name
'''
log.debug('Retrieving VPC peering connection id')
ids = _get_peering_connection_ids(name, conn)
if not ids:
ids = [None] # Let callers handle the case where we have no id
elif len(ids) > 1:
... |
Delete a VPC peering connection. | def delete_vpc_peering_connection(conn_id=None, conn_name=None, region=None,
key=None, keyid=None, profile=None, dry_run=False):
'''
Delete a VPC peering connection.
.. versionadded:: 2016.11.0
conn_id
The connection ID to check. Exclusive with conn_name.
... |
Check if a VPC peering connection is in the pending state. | def is_peering_connection_pending(conn_id=None, conn_name=None, region=None,
key=None, keyid=None, profile=None):
'''
Check if a VPC peering connection is in the pending state.
.. versionadded:: 2016.11.0
conn_id
The connection ID to check. Exclusive with con... |
Check if a VPC peering connection is in the pending state and requested from the given VPC. | def peering_connection_pending_from_vpc(conn_id=None, conn_name=None, vpc_id=None,
vpc_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Check if a VPC peering connection is in the pending state, and requested from th... |
Cache invalidate or retrieve an AWS resource id keyed by name. | def cache_id(service, name, sub_resource=None, resource_id=None,
invalidate=False, region=None, key=None, keyid=None,
profile=None):
'''
Cache, invalidate, or retrieve an AWS resource id keyed by name.
.. code-block:: python
__utils__['boto.cache_id']('ec2', 'myinstance',... |
Return a boto connection for the service. | def get_connection(service, module=None, region=None, key=None, keyid=None,
profile=None):
'''
Return a boto connection for the service.
.. code-block:: python
conn = __utils__['boto.get_connection']('ec2', profile='custom_profile')
'''
# future lint: disable=blackliste... |
Tests that exactly N items in an iterable are truthy ( neither None False nor 0 ). | def exactly_n(l, n=1):
'''
Tests that exactly N items in an iterable are "truthy" (neither None,
False, nor 0).
'''
i = iter(l)
return all(any(i) for j in range(n)) and not any(i) |
Assign _get_conn and _cache_id functions to the named module. | def assign_funcs(modname, service, module=None, pack=None):
'''
Assign _get_conn and _cache_id functions to the named module.
.. code-block:: python
__utils__['boto.assign_partials'](__name__, 'ec2')
'''
if pack:
global __salt__ # pylint: disable=W0601
__salt__ = pack
... |
Matches based on IP address or CIDR notation | def match(tgt, opts=None):
'''
Matches based on IP address or CIDR notation
'''
if not opts:
opts = __opts__
try:
# Target is an address?
tgt = ipaddress.ip_address(tgt)
except: # pylint: disable=bare-except
try:
# Target is a network?
tg... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.