repo stringclasses 85
values | path stringlengths 8 121 | func_name stringlengths 1 82 | original_string stringlengths 112 65.5k | language stringclasses 1
value | code stringlengths 112 65.5k | code_tokens listlengths 20 4.09k | docstring stringlengths 3 46.3k | docstring_tokens listlengths 1 564 | sha stringclasses 85
values | url stringlengths 93 218 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
saltstack/salt | salt/modules/boto_ec2.py | _get_all_eip_addresses | def _get_all_eip_addresses(addresses=None, allocation_ids=None, region=None,
key=None, keyid=None, profile=None):
'''
Get all EIP's associated with the current credentials.
addresses
(list) - Optional list of addresses. If provided, only those those in the
list w... | python | def _get_all_eip_addresses(addresses=None, allocation_ids=None, region=None,
key=None, keyid=None, profile=None):
'''
Get all EIP's associated with the current credentials.
addresses
(list) - Optional list of addresses. If provided, only those those in the
list w... | [
"def",
"_get_all_eip_addresses",
"(",
"addresses",
"=",
"None",
",",
"allocation_ids",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"r... | Get all EIP's associated with the current credentials.
addresses
(list) - Optional list of addresses. If provided, only those those in the
list will be returned.
allocation_ids
(list) - Optional list of allocation IDs. If provided, only the
addresses associated with the given ... | [
"Get",
"all",
"EIP",
"s",
"associated",
"with",
"the",
"current",
"credentials",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L99-L120 | train |
saltstack/salt | salt/modules/boto_ec2.py | get_all_eip_addresses | def get_all_eip_addresses(addresses=None, allocation_ids=None, region=None,
key=None, keyid=None, profile=None):
'''
Get public addresses of some, or all EIPs associated with the current account.
addresses
(list) - Optional list of addresses. If provided, only the addres... | python | def get_all_eip_addresses(addresses=None, allocation_ids=None, region=None,
key=None, keyid=None, profile=None):
'''
Get public addresses of some, or all EIPs associated with the current account.
addresses
(list) - Optional list of addresses. If provided, only the addres... | [
"def",
"get_all_eip_addresses",
"(",
"addresses",
"=",
"None",
",",
"allocation_ids",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"return",
"[",
"x",
".",
"public_i... | Get public addresses of some, or all EIPs associated with the current account.
addresses
(list) - Optional list of addresses. If provided, only the addresses
associated with those in the list will be returned.
allocation_ids
(list) - Optional list of allocation IDs. If provided, only ... | [
"Get",
"public",
"addresses",
"of",
"some",
"or",
"all",
"EIPs",
"associated",
"with",
"the",
"current",
"account",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L123-L147 | train |
saltstack/salt | salt/modules/boto_ec2.py | get_unassociated_eip_address | def get_unassociated_eip_address(domain='standard', region=None, key=None,
keyid=None, profile=None):
'''
Return the first unassociated EIP
domain
Indicates whether the address is an EC2 address or a VPC address
(standard|vpc).
CLI Example:
.. code... | python | def get_unassociated_eip_address(domain='standard', region=None, key=None,
keyid=None, profile=None):
'''
Return the first unassociated EIP
domain
Indicates whether the address is an EC2 address or a VPC address
(standard|vpc).
CLI Example:
.. code... | [
"def",
"get_unassociated_eip_address",
"(",
"domain",
"=",
"'standard'",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"eip",
"=",
"None",
"for",
"address",
"in",
"get_all_eip_address... | Return the first unassociated EIP
domain
Indicates whether the address is an EC2 address or a VPC address
(standard|vpc).
CLI Example:
.. code-block:: bash
salt-call boto_ec2.get_unassociated_eip_address
.. versionadded:: 2016.3.0 | [
"Return",
"the",
"first",
"unassociated",
"EIP"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L150-L194 | train |
saltstack/salt | salt/modules/boto_ec2.py | get_eip_address_info | def get_eip_address_info(addresses=None, allocation_ids=None, region=None, key=None,
keyid=None, profile=None):
'''
Get 'interesting' info about some, or all EIPs associated with the current account.
addresses
(list) - Optional list of addresses. If provided, only the addr... | python | def get_eip_address_info(addresses=None, allocation_ids=None, region=None, key=None,
keyid=None, profile=None):
'''
Get 'interesting' info about some, or all EIPs associated with the current account.
addresses
(list) - Optional list of addresses. If provided, only the addr... | [
"def",
"get_eip_address_info",
"(",
"addresses",
"=",
"None",
",",
"allocation_ids",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"if",
"type",
"(",
"addresses",
")"... | Get 'interesting' info about some, or all EIPs associated with the current account.
addresses
(list) - Optional list of addresses. If provided, only the addresses
associated with those in the list will be returned.
allocation_ids
(list) - Optional list of allocation IDs. If provided, ... | [
"Get",
"interesting",
"info",
"about",
"some",
"or",
"all",
"EIPs",
"associated",
"with",
"the",
"current",
"account",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L197-L232 | train |
saltstack/salt | salt/modules/boto_ec2.py | allocate_eip_address | def allocate_eip_address(domain=None, region=None, key=None, keyid=None, profile=None):
'''
Allocate a new Elastic IP address and associate it with your account.
domain
(string) Optional param - if set to exactly 'vpc', the address will be
allocated to the VPC. The default simply maps the ... | python | def allocate_eip_address(domain=None, region=None, key=None, keyid=None, profile=None):
'''
Allocate a new Elastic IP address and associate it with your account.
domain
(string) Optional param - if set to exactly 'vpc', the address will be
allocated to the VPC. The default simply maps the ... | [
"def",
"allocate_eip_address",
"(",
"domain",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"if",
"domain",
"and",
"domain",
"!=",
"'vpc'",
":",
"raise",
"SaltInvocat... | Allocate a new Elastic IP address and associate it with your account.
domain
(string) Optional param - if set to exactly 'vpc', the address will be
allocated to the VPC. The default simply maps the EIP to your
account container.
returns
(dict) dict of 'interesting' information... | [
"Allocate",
"a",
"new",
"Elastic",
"IP",
"address",
"and",
"associate",
"it",
"with",
"your",
"account",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L235-L272 | train |
saltstack/salt | salt/modules/boto_ec2.py | release_eip_address | def release_eip_address(public_ip=None, allocation_id=None, region=None, key=None,
keyid=None, profile=None):
'''
Free an Elastic IP address. Pass either a public IP address to release an
EC2 Classic EIP, or an AllocationId to release a VPC EIP.
public_ip
(string) - The... | python | def release_eip_address(public_ip=None, allocation_id=None, region=None, key=None,
keyid=None, profile=None):
'''
Free an Elastic IP address. Pass either a public IP address to release an
EC2 Classic EIP, or an AllocationId to release a VPC EIP.
public_ip
(string) - The... | [
"def",
"release_eip_address",
"(",
"public_ip",
"=",
"None",
",",
"allocation_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"if",
"not",
"salt",
".",
"utils",
... | Free an Elastic IP address. Pass either a public IP address to release an
EC2 Classic EIP, or an AllocationId to release a VPC EIP.
public_ip
(string) - The public IP address - for EC2 elastic IPs.
allocation_id
(string) - The Allocation ID - for VPC elastic IPs.
returns
(bool... | [
"Free",
"an",
"Elastic",
"IP",
"address",
".",
"Pass",
"either",
"a",
"public",
"IP",
"address",
"to",
"release",
"an",
"EC2",
"Classic",
"EIP",
"or",
"an",
"AllocationId",
"to",
"release",
"a",
"VPC",
"EIP",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L275-L307 | train |
saltstack/salt | salt/modules/boto_ec2.py | associate_eip_address | def associate_eip_address(instance_id=None, instance_name=None, public_ip=None,
allocation_id=None, network_interface_id=None,
network_interface_name=None, private_ip_address=None,
allow_reassociation=False, region=None, key=None,
... | python | def associate_eip_address(instance_id=None, instance_name=None, public_ip=None,
allocation_id=None, network_interface_id=None,
network_interface_name=None, private_ip_address=None,
allow_reassociation=False, region=None, key=None,
... | [
"def",
"associate_eip_address",
"(",
"instance_id",
"=",
"None",
",",
"instance_name",
"=",
"None",
",",
"public_ip",
"=",
"None",
",",
"allocation_id",
"=",
"None",
",",
"network_interface_id",
"=",
"None",
",",
"network_interface_name",
"=",
"None",
",",
"priv... | Associate an Elastic IP address with a currently running instance or a network interface.
This requires exactly one of either 'public_ip' or 'allocation_id', depending
on whether you’re associating a VPC address or a plain EC2 address.
instance_id
(string) – ID of the instance to associate with (ex... | [
"Associate",
"an",
"Elastic",
"IP",
"address",
"with",
"a",
"currently",
"running",
"instance",
"or",
"a",
"network",
"interface",
".",
"This",
"requires",
"exactly",
"one",
"of",
"either",
"public_ip",
"or",
"allocation_id",
"depending",
"on",
"whether",
"you’r... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L310-L393 | train |
saltstack/salt | salt/modules/boto_ec2.py | disassociate_eip_address | def disassociate_eip_address(public_ip=None, association_id=None, region=None,
key=None, keyid=None, profile=None):
'''
Disassociate an Elastic IP address from a currently running instance. This
requires exactly one of either 'association_id' or 'public_ip', depending
on whe... | python | def disassociate_eip_address(public_ip=None, association_id=None, region=None,
key=None, keyid=None, profile=None):
'''
Disassociate an Elastic IP address from a currently running instance. This
requires exactly one of either 'association_id' or 'public_ip', depending
on whe... | [
"def",
"disassociate_eip_address",
"(",
"public_ip",
"=",
"None",
",",
"association_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
... | Disassociate an Elastic IP address from a currently running instance. This
requires exactly one of either 'association_id' or 'public_ip', depending
on whether you’re dealing with a VPC or EC2 Classic address.
public_ip
(string) – Public IP address, for EC2 Classic allocations.
association_id
... | [
"Disassociate",
"an",
"Elastic",
"IP",
"address",
"from",
"a",
"currently",
"running",
"instance",
".",
"This",
"requires",
"exactly",
"one",
"of",
"either",
"association_id",
"or",
"public_ip",
"depending",
"on",
"whether",
"you’re",
"dealing",
"with",
"a",
"VP... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L396-L425 | train |
saltstack/salt | salt/modules/boto_ec2.py | assign_private_ip_addresses | def assign_private_ip_addresses(network_interface_name=None, network_interface_id=None,
private_ip_addresses=None, secondary_private_ip_address_count=None,
allow_reassignment=False, region=None, key=None,
keyid=None, profile... | python | def assign_private_ip_addresses(network_interface_name=None, network_interface_id=None,
private_ip_addresses=None, secondary_private_ip_address_count=None,
allow_reassignment=False, region=None, key=None,
keyid=None, profile... | [
"def",
"assign_private_ip_addresses",
"(",
"network_interface_name",
"=",
"None",
",",
"network_interface_id",
"=",
"None",
",",
"private_ip_addresses",
"=",
"None",
",",
"secondary_private_ip_address_count",
"=",
"None",
",",
"allow_reassignment",
"=",
"False",
",",
"r... | Assigns one or more secondary private IP addresses to a network interface.
network_interface_id
(string) - ID of the network interface to associate the IP with (exclusive with 'network_interface_name')
network_interface_name
(string) - Name of the network interface to associate the IP with (exc... | [
"Assigns",
"one",
"or",
"more",
"secondary",
"private",
"IP",
"addresses",
"to",
"a",
"network",
"interface",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L428-L485 | train |
saltstack/salt | salt/modules/boto_ec2.py | get_zones | def get_zones(region=None, key=None, keyid=None, profile=None):
'''
Get a list of AZs for the configured region.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_zones
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
return [z.name for z in c... | python | def get_zones(region=None, key=None, keyid=None, profile=None):
'''
Get a list of AZs for the configured region.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_zones
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
return [z.name for z in c... | [
"def",
"get_zones",
"(",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",
"=",
"keyid",
... | Get a list of AZs for the configured region.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_zones | [
"Get",
"a",
"list",
"of",
"AZs",
"for",
"the",
"configured",
"region",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L540-L552 | train |
saltstack/salt | salt/modules/boto_ec2.py | find_instances | def find_instances(instance_id=None, name=None, tags=None, region=None,
key=None, keyid=None, profile=None, return_objs=False,
in_states=None, filters=None):
'''
Given instance properties, find and return matching instance ids
CLI Examples:
.. code-block:: bash
... | python | def find_instances(instance_id=None, name=None, tags=None, region=None,
key=None, keyid=None, profile=None, return_objs=False,
in_states=None, filters=None):
'''
Given instance properties, find and return matching instance ids
CLI Examples:
.. code-block:: bash
... | [
"def",
"find_instances",
"(",
"instance_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"return_objs",
"=",
"False... | Given instance properties, find and return matching instance ids
CLI Examples:
.. code-block:: bash
salt myminion boto_ec2.find_instances # Lists all instances
salt myminion boto_ec2.find_instances name=myinstance
salt myminion boto_ec2.find_instances tags='{"mytag": "value"}'
... | [
"Given",
"instance",
"properties",
"find",
"and",
"return",
"matching",
"instance",
"ids"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L555-L609 | train |
saltstack/salt | salt/modules/boto_ec2.py | create_image | def create_image(ami_name, instance_id=None, instance_name=None, tags=None, region=None,
key=None, keyid=None, profile=None, description=None, no_reboot=False,
dry_run=False, filters=None):
'''
Given instance properties that define exactly one instance, create AMI and return AM... | python | def create_image(ami_name, instance_id=None, instance_name=None, tags=None, region=None,
key=None, keyid=None, profile=None, description=None, no_reboot=False,
dry_run=False, filters=None):
'''
Given instance properties that define exactly one instance, create AMI and return AM... | [
"def",
"create_image",
"(",
"ami_name",
",",
"instance_id",
"=",
"None",
",",
"instance_name",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"d... | Given instance properties that define exactly one instance, create AMI and return AMI-id.
CLI Examples:
.. code-block:: bash
salt myminion boto_ec2.create_image ami_name instance_name=myinstance
salt myminion boto_ec2.create_image another_ami_name tags='{"mytag": "value"}' description='this i... | [
"Given",
"instance",
"properties",
"that",
"define",
"exactly",
"one",
"instance",
"create",
"AMI",
"and",
"return",
"AMI",
"-",
"id",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L612-L644 | train |
saltstack/salt | salt/modules/boto_ec2.py | find_images | def find_images(ami_name=None, executable_by=None, owners=None, image_ids=None, tags=None,
region=None, key=None, keyid=None, profile=None, return_objs=False):
'''
Given image properties, find and return matching AMI ids
CLI Examples:
.. code-block:: bash
salt myminion boto_e... | python | def find_images(ami_name=None, executable_by=None, owners=None, image_ids=None, tags=None,
region=None, key=None, keyid=None, profile=None, return_objs=False):
'''
Given image properties, find and return matching AMI ids
CLI Examples:
.. code-block:: bash
salt myminion boto_e... | [
"def",
"find_images",
"(",
"ami_name",
"=",
"None",
",",
"executable_by",
"=",
"None",
",",
"owners",
"=",
"None",
",",
"image_ids",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None"... | Given image properties, find and return matching AMI ids
CLI Examples:
.. code-block:: bash
salt myminion boto_ec2.find_images tags='{"mytag": "value"}' | [
"Given",
"image",
"properties",
"find",
"and",
"return",
"matching",
"AMI",
"ids"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L647-L693 | train |
saltstack/salt | salt/modules/boto_ec2.py | terminate | def terminate(instance_id=None, name=None, region=None,
key=None, keyid=None, profile=None, filters=None):
'''
Terminate the instance described by instance_id or name.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.terminate name=myinstance
salt myminion boto_e... | python | def terminate(instance_id=None, name=None, region=None,
key=None, keyid=None, profile=None, filters=None):
'''
Terminate the instance described by instance_id or name.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.terminate name=myinstance
salt myminion boto_e... | [
"def",
"terminate",
"(",
"instance_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"filters",
"=",
"None",
")",
":",
"instances",
"=",
"fi... | Terminate the instance described by instance_id or name.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.terminate name=myinstance
salt myminion boto_ec2.terminate instance_id=i-a46b9f | [
"Terminate",
"the",
"instance",
"described",
"by",
"instance_id",
"or",
"name",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L696-L720 | train |
saltstack/salt | salt/modules/boto_ec2.py | get_id | def get_id(name=None, tags=None, region=None, key=None,
keyid=None, profile=None, in_states=None, filters=None):
'''
Given instance properties, return the instance id if it exists.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_id myinstance
'''
instance_ids... | python | def get_id(name=None, tags=None, region=None, key=None,
keyid=None, profile=None, in_states=None, filters=None):
'''
Given instance properties, return the instance id if it exists.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_id myinstance
'''
instance_ids... | [
"def",
"get_id",
"(",
"name",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"in_states",
"=",
"None",
",",
"filters",
"=",
"None",
")",
":"... | Given instance properties, return the instance id if it exists.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_id myinstance | [
"Given",
"instance",
"properties",
"return",
"the",
"instance",
"id",
"if",
"it",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L723-L748 | train |
saltstack/salt | salt/modules/boto_ec2.py | get_tags | def get_tags(instance_id=None, keyid=None, key=None, profile=None,
region=None):
'''
Given an instance_id, return a list of tags associated with that instance.
returns
(list) - list of tags as key/value pairs
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.g... | python | def get_tags(instance_id=None, keyid=None, key=None, profile=None,
region=None):
'''
Given an instance_id, return a list of tags associated with that instance.
returns
(list) - list of tags as key/value pairs
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.g... | [
"def",
"get_tags",
"(",
"instance_id",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"key",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"region",
"=",
"None",
")",
":",
"tags",
"=",
"[",
"]",
"client",
"=",
"_get_conn",
"(",
"key",
"=",
"key",
... | Given an instance_id, return a list of tags associated with that instance.
returns
(list) - list of tags as key/value pairs
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_tags instance_id | [
"Given",
"an",
"instance_id",
"return",
"a",
"list",
"of",
"tags",
"associated",
"with",
"that",
"instance",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L751-L773 | train |
saltstack/salt | salt/modules/boto_ec2.py | exists | def exists(instance_id=None, name=None, tags=None, region=None, key=None,
keyid=None, profile=None, in_states=None, filters=None):
'''
Given an instance id, check to see if the given instance id exists.
Returns True if the given instance with the given id, name, or tags
exists; otherwise, Fa... | python | def exists(instance_id=None, name=None, tags=None, region=None, key=None,
keyid=None, profile=None, in_states=None, filters=None):
'''
Given an instance id, check to see if the given instance id exists.
Returns True if the given instance with the given id, name, or tags
exists; otherwise, Fa... | [
"def",
"exists",
"(",
"instance_id",
"=",
"None",
",",
"name",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"in_states",
"=",
"None",
",",
... | Given an instance id, check to see if the given instance id exists.
Returns True if the given instance with the given id, name, or tags
exists; otherwise, False is returned.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.exists myinstance | [
"Given",
"an",
"instance",
"id",
"check",
"to",
"see",
"if",
"the",
"given",
"instance",
"id",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L776-L798 | train |
saltstack/salt | salt/modules/boto_ec2.py | _to_blockdev_map | def _to_blockdev_map(thing):
'''
Convert a string, or a json payload, or a dict in the right
format, into a boto.ec2.blockdevicemapping.BlockDeviceMapping as
needed by instance_present(). The following YAML is a direct
representation of what is expected by the underlying boto EC2 code.
YAML ex... | python | def _to_blockdev_map(thing):
'''
Convert a string, or a json payload, or a dict in the right
format, into a boto.ec2.blockdevicemapping.BlockDeviceMapping as
needed by instance_present(). The following YAML is a direct
representation of what is expected by the underlying boto EC2 code.
YAML ex... | [
"def",
"_to_blockdev_map",
"(",
"thing",
")",
":",
"if",
"not",
"thing",
":",
"return",
"None",
"if",
"isinstance",
"(",
"thing",
",",
"BlockDeviceMapping",
")",
":",
"return",
"thing",
"if",
"isinstance",
"(",
"thing",
",",
"six",
".",
"string_types",
")"... | Convert a string, or a json payload, or a dict in the right
format, into a boto.ec2.blockdevicemapping.BlockDeviceMapping as
needed by instance_present(). The following YAML is a direct
representation of what is expected by the underlying boto EC2 code.
YAML example:
.. code-block:: yaml
... | [
"Convert",
"a",
"string",
"or",
"a",
"json",
"payload",
"or",
"a",
"dict",
"in",
"the",
"right",
"format",
"into",
"a",
"boto",
".",
"ec2",
".",
"blockdevicemapping",
".",
"BlockDeviceMapping",
"as",
"needed",
"by",
"instance_present",
"()",
".",
"The",
"f... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L801-L851 | train |
saltstack/salt | salt/modules/boto_ec2.py | run | def run(image_id, name=None, tags=None, key_name=None, security_groups=None,
user_data=None, instance_type='m1.small', placement=None,
kernel_id=None, ramdisk_id=None, monitoring_enabled=None, vpc_id=None,
vpc_name=None, subnet_id=None, subnet_name=None, private_ip_address=None,
block_de... | python | def run(image_id, name=None, tags=None, key_name=None, security_groups=None,
user_data=None, instance_type='m1.small', placement=None,
kernel_id=None, ramdisk_id=None, monitoring_enabled=None, vpc_id=None,
vpc_name=None, subnet_id=None, subnet_name=None, private_ip_address=None,
block_de... | [
"def",
"run",
"(",
"image_id",
",",
"name",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"key_name",
"=",
"None",
",",
"security_groups",
"=",
"None",
",",
"user_data",
"=",
"None",
",",
"instance_type",
"=",
"'m1.small'",
",",
"placement",
"=",
"None",
... | Create and start an EC2 instance.
Returns True if the instance was created; otherwise False.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.run ami-b80c2b87 name=myinstance
image_id
(string) – The ID of the image to run.
name
(string) - The name of the instance... | [
"Create",
"and",
"start",
"an",
"EC2",
"instance",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L854-L1081 | train |
saltstack/salt | salt/modules/boto_ec2.py | get_key | def get_key(key_name, region=None, key=None, keyid=None, profile=None):
'''
Check to see if a key exists. Returns fingerprint and name if
it does and False if it doesn't
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_key mykey
'''
conn = _get_conn(region=region, key=k... | python | def get_key(key_name, region=None, key=None, keyid=None, profile=None):
'''
Check to see if a key exists. Returns fingerprint and name if
it does and False if it doesn't
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_key mykey
'''
conn = _get_conn(region=region, key=k... | [
"def",
"get_key",
"(",
"key_name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",
... | Check to see if a key exists. Returns fingerprint and name if
it does and False if it doesn't
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_key mykey | [
"Check",
"to",
"see",
"if",
"a",
"key",
"exists",
".",
"Returns",
"fingerprint",
"and",
"name",
"if",
"it",
"does",
"and",
"False",
"if",
"it",
"doesn",
"t",
"CLI",
"Example",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1084-L1104 | train |
saltstack/salt | salt/modules/boto_ec2.py | create_key | def create_key(key_name, save_path, region=None, key=None, keyid=None,
profile=None):
'''
Creates a key and saves it to a given path.
Returns the private key.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.create_key mykey /root/
'''
conn = _get_conn(regio... | python | def create_key(key_name, save_path, region=None, key=None, keyid=None,
profile=None):
'''
Creates a key and saves it to a given path.
Returns the private key.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.create_key mykey /root/
'''
conn = _get_conn(regio... | [
"def",
"create_key",
"(",
"key_name",
",",
"save_path",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
... | Creates a key and saves it to a given path.
Returns the private key.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.create_key mykey /root/ | [
"Creates",
"a",
"key",
"and",
"saves",
"it",
"to",
"a",
"given",
"path",
".",
"Returns",
"the",
"private",
"key",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1107-L1128 | train |
saltstack/salt | salt/modules/boto_ec2.py | import_key | def import_key(key_name, public_key_material, region=None, key=None,
keyid=None, profile=None):
'''
Imports the public key from an RSA key pair that you created with a third-party tool.
Supported formats:
- OpenSSH public key format (e.g., the format in ~/.ssh/authorized_keys)
- Base6... | python | def import_key(key_name, public_key_material, region=None, key=None,
keyid=None, profile=None):
'''
Imports the public key from an RSA key pair that you created with a third-party tool.
Supported formats:
- OpenSSH public key format (e.g., the format in ~/.ssh/authorized_keys)
- Base6... | [
"def",
"import_key",
"(",
"key_name",
",",
"public_key_material",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",... | Imports the public key from an RSA key pair that you created with a third-party tool.
Supported formats:
- OpenSSH public key format (e.g., the format in ~/.ssh/authorized_keys)
- Base64 encoded DER format
- SSH public key file format as specified in RFC4716
- DSA keys are not supported. Make sure y... | [
"Imports",
"the",
"public",
"key",
"from",
"an",
"RSA",
"key",
"pair",
"that",
"you",
"created",
"with",
"a",
"third",
"-",
"party",
"tool",
".",
"Supported",
"formats",
":",
"-",
"OpenSSH",
"public",
"key",
"format",
"(",
"e",
".",
"g",
".",
"the",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1131-L1156 | train |
saltstack/salt | salt/modules/boto_ec2.py | delete_key | def delete_key(key_name, region=None, key=None, keyid=None, profile=None):
'''
Deletes a key. Always returns True
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.delete_key mykey
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
try:
key ... | python | def delete_key(key_name, region=None, key=None, keyid=None, profile=None):
'''
Deletes a key. Always returns True
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.delete_key mykey
'''
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
try:
key ... | [
"def",
"delete_key",
"(",
"key_name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid... | Deletes a key. Always returns True
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.delete_key mykey | [
"Deletes",
"a",
"key",
".",
"Always",
"returns",
"True"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1159-L1177 | train |
saltstack/salt | salt/modules/boto_ec2.py | get_keys | def get_keys(keynames=None, filters=None, region=None, key=None,
keyid=None, profile=None):
'''
Gets all keys or filters them by name and returns a list.
keynames (list):: A list of the names of keypairs to retrieve.
If not provided, all key pairs will be returned.
filters (dict) :: Opt... | python | def get_keys(keynames=None, filters=None, region=None, key=None,
keyid=None, profile=None):
'''
Gets all keys or filters them by name and returns a list.
keynames (list):: A list of the names of keypairs to retrieve.
If not provided, all key pairs will be returned.
filters (dict) :: Opt... | [
"def",
"get_keys",
"(",
"keynames",
"=",
"None",
",",
"filters",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"regi... | Gets all keys or filters them by name and returns a list.
keynames (list):: A list of the names of keypairs to retrieve.
If not provided, all key pairs will be returned.
filters (dict) :: Optional filters that can be used to limit the
results returned. Filters are provided in the form of a dictionary
... | [
"Gets",
"all",
"keys",
"or",
"filters",
"them",
"by",
"name",
"and",
"returns",
"a",
"list",
".",
"keynames",
"(",
"list",
")",
"::",
"A",
"list",
"of",
"the",
"names",
"of",
"keypairs",
"to",
"retrieve",
".",
"If",
"not",
"provided",
"all",
"key",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1180-L1210 | train |
saltstack/salt | salt/modules/boto_ec2.py | get_attribute | def get_attribute(attribute, instance_name=None, instance_id=None, region=None, key=None,
keyid=None, profile=None, filters=None):
'''
Get an EC2 instance attribute.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_attribute sourceDestCheck instance_name=my_insta... | python | def get_attribute(attribute, instance_name=None, instance_id=None, region=None, key=None,
keyid=None, profile=None, filters=None):
'''
Get an EC2 instance attribute.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_attribute sourceDestCheck instance_name=my_insta... | [
"def",
"get_attribute",
"(",
"attribute",
",",
"instance_name",
"=",
"None",
",",
"instance_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"filters",
"=",
"None",
")",... | Get an EC2 instance attribute.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_attribute sourceDestCheck instance_name=my_instance
Available attributes:
* instanceType
* kernel
* ramdisk
* userData
* disableApiTermination
* instanceIni... | [
"Get",
"an",
"EC2",
"instance",
"attribute",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1213-L1268 | train |
saltstack/salt | salt/modules/boto_ec2.py | set_attribute | def set_attribute(attribute, attribute_value, instance_name=None, instance_id=None, region=None, key=None, keyid=None,
profile=None, filters=None):
'''
Set an EC2 instance attribute.
Returns whether the operation succeeded or not.
CLI Example:
.. code-block:: bash
salt m... | python | def set_attribute(attribute, attribute_value, instance_name=None, instance_id=None, region=None, key=None, keyid=None,
profile=None, filters=None):
'''
Set an EC2 instance attribute.
Returns whether the operation succeeded or not.
CLI Example:
.. code-block:: bash
salt m... | [
"def",
"set_attribute",
"(",
"attribute",
",",
"attribute_value",
",",
"instance_name",
"=",
"None",
",",
"instance_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"filte... | Set an EC2 instance attribute.
Returns whether the operation succeeded or not.
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.set_attribute sourceDestCheck False instance_name=my_instance
Available attributes:
* instanceType
* kernel
* ramdisk
* user... | [
"Set",
"an",
"EC2",
"instance",
"attribute",
".",
"Returns",
"whether",
"the",
"operation",
"succeeded",
"or",
"not",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1271-L1322 | train |
saltstack/salt | salt/modules/boto_ec2.py | get_network_interface_id | def get_network_interface_id(name, region=None, key=None, keyid=None,
profile=None):
'''
Get an Elastic Network Interface id from its name tag.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_network_interface_id name=m... | python | def get_network_interface_id(name, region=None, key=None, keyid=None,
profile=None):
'''
Get an Elastic Network Interface id from its name tag.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_network_interface_id name=m... | [
"def",
"get_network_interface_id",
"(",
"name",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
","... | Get an Elastic Network Interface id from its name tag.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_network_interface_id name=my_eni | [
"Get",
"an",
"Elastic",
"Network",
"Interface",
"id",
"from",
"its",
"name",
"tag",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1325-L1351 | train |
saltstack/salt | salt/modules/boto_ec2.py | get_network_interface | def get_network_interface(name=None, network_interface_id=None, region=None,
key=None, keyid=None, profile=None):
'''
Get an Elastic Network Interface.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_network_interface name... | python | def get_network_interface(name=None, network_interface_id=None, region=None,
key=None, keyid=None, profile=None):
'''
Get an Elastic Network Interface.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_network_interface name... | [
"def",
"get_network_interface",
"(",
"name",
"=",
"None",
",",
"network_interface_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"r... | Get an Elastic Network Interface.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.get_network_interface name=my_eni | [
"Get",
"an",
"Elastic",
"Network",
"Interface",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1354-L1377 | train |
saltstack/salt | salt/modules/boto_ec2.py | create_network_interface | def create_network_interface(name, subnet_id=None, subnet_name=None,
private_ip_address=None, description=None,
groups=None, region=None, key=None, keyid=None,
profile=None):
'''
Create an Elastic Network Interface.
.. v... | python | def create_network_interface(name, subnet_id=None, subnet_name=None,
private_ip_address=None, description=None,
groups=None, region=None, key=None, keyid=None,
profile=None):
'''
Create an Elastic Network Interface.
.. v... | [
"def",
"create_network_interface",
"(",
"name",
",",
"subnet_id",
"=",
"None",
",",
"subnet_name",
"=",
"None",
",",
"private_ip_address",
"=",
"None",
",",
"description",
"=",
"None",
",",
"groups",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"="... | Create an Elastic Network Interface.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.create_network_interface my_eni subnet-12345 description=my_eni groups=['my_group'] | [
"Create",
"an",
"Elastic",
"Network",
"Interface",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1432-L1491 | train |
saltstack/salt | salt/modules/boto_ec2.py | delete_network_interface | def delete_network_interface(
name=None, network_interface_id=None, region=None, key=None,
keyid=None, profile=None):
'''
Create an Elastic Network Interface.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.create_network_interface my_e... | python | def delete_network_interface(
name=None, network_interface_id=None, region=None, key=None,
keyid=None, profile=None):
'''
Create an Elastic Network Interface.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.create_network_interface my_e... | [
"def",
"delete_network_interface",
"(",
"name",
"=",
"None",
",",
"network_interface_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"if",
"not",
"(",
"name",
"or"... | Create an Elastic Network Interface.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.create_network_interface my_eni subnet-12345 description=my_eni groups=['my_group'] | [
"Create",
"an",
"Elastic",
"Network",
"Interface",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1494-L1528 | train |
saltstack/salt | salt/modules/boto_ec2.py | attach_network_interface | def attach_network_interface(device_index, name=None, network_interface_id=None,
instance_name=None, instance_id=None,
region=None, key=None, keyid=None, profile=None):
'''
Attach an Elastic Network Interface.
.. versionadded:: 2016.3.0
CLI Exa... | python | def attach_network_interface(device_index, name=None, network_interface_id=None,
instance_name=None, instance_id=None,
region=None, key=None, keyid=None, profile=None):
'''
Attach an Elastic Network Interface.
.. versionadded:: 2016.3.0
CLI Exa... | [
"def",
"attach_network_interface",
"(",
"device_index",
",",
"name",
"=",
"None",
",",
"network_interface_id",
"=",
"None",
",",
"instance_name",
"=",
"None",
",",
"instance_id",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",... | Attach an Elastic Network Interface.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.attach_network_interface my_eni instance_name=salt-master device_index=0 | [
"Attach",
"an",
"Elastic",
"Network",
"Interface",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1531-L1584 | train |
saltstack/salt | salt/modules/boto_ec2.py | modify_network_interface_attribute | def modify_network_interface_attribute(
name=None, network_interface_id=None, attr=None,
value=None, region=None, key=None, keyid=None, profile=None):
'''
Modify an attribute of an Elastic Network Interface.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
sal... | python | def modify_network_interface_attribute(
name=None, network_interface_id=None, attr=None,
value=None, region=None, key=None, keyid=None, profile=None):
'''
Modify an attribute of an Elastic Network Interface.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
sal... | [
"def",
"modify_network_interface_attribute",
"(",
"name",
"=",
"None",
",",
"network_interface_id",
"=",
"None",
",",
"attr",
"=",
"None",
",",
"value",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"pr... | Modify an attribute of an Elastic Network Interface.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt myminion boto_ec2.modify_network_interface_attribute my_eni attr=description value='example description' | [
"Modify",
"an",
"attribute",
"of",
"an",
"Elastic",
"Network",
"Interface",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1626-L1694 | train |
saltstack/salt | salt/modules/boto_ec2.py | get_all_volumes | def get_all_volumes(volume_ids=None, filters=None, return_objs=False,
region=None, key=None, keyid=None, profile=None):
'''
Get a list of all EBS volumes, optionally filtered by provided 'filters' param
.. versionadded:: 2016.11.0
volume_ids
(list) - Optional list of volume... | python | def get_all_volumes(volume_ids=None, filters=None, return_objs=False,
region=None, key=None, keyid=None, profile=None):
'''
Get a list of all EBS volumes, optionally filtered by provided 'filters' param
.. versionadded:: 2016.11.0
volume_ids
(list) - Optional list of volume... | [
"def",
"get_all_volumes",
"(",
"volume_ids",
"=",
"None",
",",
"filters",
"=",
"None",
",",
"return_objs",
"=",
"False",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=... | Get a list of all EBS volumes, optionally filtered by provided 'filters' param
.. versionadded:: 2016.11.0
volume_ids
(list) - Optional list of volume_ids. If provided, only the volumes
associated with those in the list will be returned.
filters
(dict) - Additional constraints on ... | [
"Get",
"a",
"list",
"of",
"all",
"EBS",
"volumes",
"optionally",
"filtered",
"by",
"provided",
"filters",
"param"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1697-L1749 | train |
saltstack/salt | salt/modules/boto_ec2.py | set_volumes_tags | def set_volumes_tags(tag_maps, authoritative=False, dry_run=False,
region=None, key=None, keyid=None, profile=None):
'''
.. versionadded:: 2016.11.0
tag_maps (list)
List of dicts of filters and tags, where 'filters' is a dict suitable for passing to the
'filters' argumen... | python | def set_volumes_tags(tag_maps, authoritative=False, dry_run=False,
region=None, key=None, keyid=None, profile=None):
'''
.. versionadded:: 2016.11.0
tag_maps (list)
List of dicts of filters and tags, where 'filters' is a dict suitable for passing to the
'filters' argumen... | [
"def",
"set_volumes_tags",
"(",
"tag_maps",
",",
"authoritative",
"=",
"False",
",",
"dry_run",
"=",
"False",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'su... | .. versionadded:: 2016.11.0
tag_maps (list)
List of dicts of filters and tags, where 'filters' is a dict suitable for passing to the
'filters' argument of get_all_volumes() above, and 'tags' is a dict of tags to be set on
volumes (via create_tags/delete_tags) as matched by the given filters... | [
"..",
"versionadded",
"::",
"2016",
".",
"11",
".",
"0"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1752-L1876 | train |
saltstack/salt | salt/modules/boto_ec2.py | get_all_tags | def get_all_tags(filters=None, region=None, key=None, keyid=None, profile=None):
'''
Describe all tags matching the filter criteria, or all tags in the account otherwise.
.. versionadded:: 2018.3.0
filters
(dict) - Additional constraints on which volumes to return. Note that valid filters var... | python | def get_all_tags(filters=None, region=None, key=None, keyid=None, profile=None):
'''
Describe all tags matching the filter criteria, or all tags in the account otherwise.
.. versionadded:: 2018.3.0
filters
(dict) - Additional constraints on which volumes to return. Note that valid filters var... | [
"def",
"get_all_tags",
"(",
"filters",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key... | Describe all tags matching the filter criteria, or all tags in the account otherwise.
.. versionadded:: 2018.3.0
filters
(dict) - Additional constraints on which volumes to return. Note that valid filters vary
extensively depending on the resource type. When in doubt, search first without a ... | [
"Describe",
"all",
"tags",
"matching",
"the",
"filter",
"criteria",
"or",
"all",
"tags",
"in",
"the",
"account",
"otherwise",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1879-L1909 | train |
saltstack/salt | salt/modules/boto_ec2.py | create_tags | def create_tags(resource_ids, tags, region=None, key=None, keyid=None, profile=None):
'''
Create new metadata tags for the specified resource ids.
.. versionadded:: 2016.11.0
resource_ids
(string) or (list) – List of resource IDs. A plain string will be converted to a list of one element.
... | python | def create_tags(resource_ids, tags, region=None, key=None, keyid=None, profile=None):
'''
Create new metadata tags for the specified resource ids.
.. versionadded:: 2016.11.0
resource_ids
(string) or (list) – List of resource IDs. A plain string will be converted to a list of one element.
... | [
"def",
"create_tags",
"(",
"resource_ids",
",",
"tags",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"resource_ids",
",",
"list",
")",
":",
"res... | Create new metadata tags for the specified resource ids.
.. versionadded:: 2016.11.0
resource_ids
(string) or (list) – List of resource IDs. A plain string will be converted to a list of one element.
tags
(dict) – Dictionary of name/value pairs. To create only a tag name, pass '' as the v... | [
"Create",
"new",
"metadata",
"tags",
"for",
"the",
"specified",
"resource",
"ids",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1912-L1942 | train |
saltstack/salt | salt/modules/boto_ec2.py | detach_volume | def detach_volume(volume_id, instance_id=None, device=None, force=False,
wait_for_detachement=False, region=None, key=None, keyid=None, profile=None):
'''
Detach an EBS volume from an EC2 instance.
.. versionadded:: 2016.11.0
volume_id
(string) – The ID of the EBS volume to b... | python | def detach_volume(volume_id, instance_id=None, device=None, force=False,
wait_for_detachement=False, region=None, key=None, keyid=None, profile=None):
'''
Detach an EBS volume from an EC2 instance.
.. versionadded:: 2016.11.0
volume_id
(string) – The ID of the EBS volume to b... | [
"def",
"detach_volume",
"(",
"volume_id",
",",
"instance_id",
"=",
"None",
",",
"device",
"=",
"None",
",",
"force",
"=",
"False",
",",
"wait_for_detachement",
"=",
"False",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
... | Detach an EBS volume from an EC2 instance.
.. versionadded:: 2016.11.0
volume_id
(string) – The ID of the EBS volume to be detached.
instance_id
(string) – The ID of the EC2 instance from which it will be detached.
device
(string) – The device on the instance through which the ... | [
"Detach",
"an",
"EBS",
"volume",
"from",
"an",
"EC2",
"instance",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1982-L2024 | train |
saltstack/salt | salt/modules/boto_ec2.py | delete_volume | def delete_volume(volume_id, instance_id=None, device=None, force=False,
region=None, key=None, keyid=None, profile=None):
'''
Detach an EBS volume from an EC2 instance.
.. versionadded:: 2016.11.0
volume_id
(string) – The ID of the EBS volume to be deleted.
force
... | python | def delete_volume(volume_id, instance_id=None, device=None, force=False,
region=None, key=None, keyid=None, profile=None):
'''
Detach an EBS volume from an EC2 instance.
.. versionadded:: 2016.11.0
volume_id
(string) – The ID of the EBS volume to be deleted.
force
... | [
"def",
"delete_volume",
"(",
"volume_id",
",",
"instance_id",
"=",
"None",
",",
"device",
"=",
"None",
",",
"force",
"=",
"False",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
... | Detach an EBS volume from an EC2 instance.
.. versionadded:: 2016.11.0
volume_id
(string) – The ID of the EBS volume to be deleted.
force
(bool) – Forces deletion even if the device has not yet been detached from its instance.
returns
(bool) - True on success, False on failure... | [
"Detach",
"an",
"EBS",
"volume",
"from",
"an",
"EC2",
"instance",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L2027-L2061 | train |
saltstack/salt | salt/modules/boto_ec2.py | attach_volume | def attach_volume(volume_id, instance_id, device,
region=None, key=None, keyid=None, profile=None):
'''
Attach an EBS volume to an EC2 instance.
..
volume_id
(string) – The ID of the EBS volume to be attached.
instance_id
(string) – The ID of the EC2 instance to at... | python | def attach_volume(volume_id, instance_id, device,
region=None, key=None, keyid=None, profile=None):
'''
Attach an EBS volume to an EC2 instance.
..
volume_id
(string) – The ID of the EBS volume to be attached.
instance_id
(string) – The ID of the EC2 instance to at... | [
"def",
"attach_volume",
"(",
"volume_id",
",",
"instance_id",
",",
"device",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
... | Attach an EBS volume to an EC2 instance.
..
volume_id
(string) – The ID of the EBS volume to be attached.
instance_id
(string) – The ID of the EC2 instance to attach the volume to.
device
(string) – The device on the instance through which the volume is exposed (e.g. /dev/sdh)
... | [
"Attach",
"an",
"EBS",
"volume",
"to",
"an",
"EC2",
"instance",
".",
".."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L2079-L2107 | train |
saltstack/salt | salt/modules/boto_ec2.py | create_volume | def create_volume(zone_name, size=None, snapshot_id=None, volume_type=None,
iops=None, encrypted=False, kms_key_id=None, wait_for_creation=False,
region=None, key=None, keyid=None, profile=None):
'''
Create an EBS volume to an availability zone.
..
zone_name
... | python | def create_volume(zone_name, size=None, snapshot_id=None, volume_type=None,
iops=None, encrypted=False, kms_key_id=None, wait_for_creation=False,
region=None, key=None, keyid=None, profile=None):
'''
Create an EBS volume to an availability zone.
..
zone_name
... | [
"def",
"create_volume",
"(",
"zone_name",
",",
"size",
"=",
"None",
",",
"snapshot_id",
"=",
"None",
",",
"volume_type",
"=",
"None",
",",
"iops",
"=",
"None",
",",
"encrypted",
"=",
"False",
",",
"kms_key_id",
"=",
"None",
",",
"wait_for_creation",
"=",
... | Create an EBS volume to an availability zone.
..
zone_name
(string) – The Availability zone name of the EBS volume to be created.
size
(int) – The size of the new volume, in GiB. If you're creating the
volume from a snapshot and don't specify a volume size, the
... | [
"Create",
"an",
"EBS",
"volume",
"to",
"an",
"availability",
"zone",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L2110-L2169 | train |
saltstack/salt | salt/modules/hg.py | revision | def revision(cwd, rev='tip', short=False, user=None):
'''
Returns the long hash of a given identifier (hash, branch, tag, HEAD, etc)
cwd
The path to the Mercurial repository
rev: tip
The revision
short: False
Return an abbreviated commit hash
user : None
Run h... | python | def revision(cwd, rev='tip', short=False, user=None):
'''
Returns the long hash of a given identifier (hash, branch, tag, HEAD, etc)
cwd
The path to the Mercurial repository
rev: tip
The revision
short: False
Return an abbreviated commit hash
user : None
Run h... | [
"def",
"revision",
"(",
"cwd",
",",
"rev",
"=",
"'tip'",
",",
"short",
"=",
"False",
",",
"user",
"=",
"None",
")",
":",
"cmd",
"=",
"[",
"'hg'",
",",
"'id'",
",",
"'-i'",
",",
"'--debug'",
"if",
"not",
"short",
"else",
"''",
",",
"'-r'",
",",
... | Returns the long hash of a given identifier (hash, branch, tag, HEAD, etc)
cwd
The path to the Mercurial repository
rev: tip
The revision
short: False
Return an abbreviated commit hash
user : None
Run hg as a user other than what the minion runs as
CLI Example:
... | [
"Returns",
"the",
"long",
"hash",
"of",
"a",
"given",
"identifier",
"(",
"hash",
"branch",
"tag",
"HEAD",
"etc",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/hg.py#L33-L72 | train |
saltstack/salt | salt/modules/hg.py | describe | def describe(cwd, rev='tip', user=None):
'''
Mimic git describe and return an identifier for the given revision
cwd
The path to the Mercurial repository
rev: tip
The path to the archive tarball
user : None
Run hg as a user other than what the minion runs as
CLI Exampl... | python | def describe(cwd, rev='tip', user=None):
'''
Mimic git describe and return an identifier for the given revision
cwd
The path to the Mercurial repository
rev: tip
The path to the archive tarball
user : None
Run hg as a user other than what the minion runs as
CLI Exampl... | [
"def",
"describe",
"(",
"cwd",
",",
"rev",
"=",
"'tip'",
",",
"user",
"=",
"None",
")",
":",
"cmd",
"=",
"[",
"'hg'",
",",
"'log'",
",",
"'-r'",
",",
"'{0}'",
".",
"format",
"(",
"rev",
")",
",",
"'--template'",
",",
"\"'{{latesttag}}-{{latesttagdistan... | Mimic git describe and return an identifier for the given revision
cwd
The path to the Mercurial repository
rev: tip
The path to the archive tarball
user : None
Run hg as a user other than what the minion runs as
CLI Example:
.. code-block:: bash
salt '*' hg.des... | [
"Mimic",
"git",
"describe",
"and",
"return",
"an",
"identifier",
"for",
"the",
"given",
"revision"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/hg.py#L75-L108 | train |
saltstack/salt | salt/modules/hg.py | archive | def archive(cwd, output, rev='tip', fmt=None, prefix=None, user=None):
'''
Export a tarball from the repository
cwd
The path to the Mercurial repository
output
The path to the archive tarball
rev: tip
The revision to create an archive from
fmt: None
Format of ... | python | def archive(cwd, output, rev='tip', fmt=None, prefix=None, user=None):
'''
Export a tarball from the repository
cwd
The path to the Mercurial repository
output
The path to the archive tarball
rev: tip
The revision to create an archive from
fmt: None
Format of ... | [
"def",
"archive",
"(",
"cwd",
",",
"output",
",",
"rev",
"=",
"'tip'",
",",
"fmt",
"=",
"None",
",",
"prefix",
"=",
"None",
",",
"user",
"=",
"None",
")",
":",
"cmd",
"=",
"[",
"'hg'",
",",
"'archive'",
",",
"'{0}'",
".",
"format",
"(",
"output",... | Export a tarball from the repository
cwd
The path to the Mercurial repository
output
The path to the archive tarball
rev: tip
The revision to create an archive from
fmt: None
Format of the resulting archive. Mercurial supports: tar,
tbz2, tgz, zip, uzip, and f... | [
"Export",
"a",
"tarball",
"from",
"the",
"repository"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/hg.py#L111-L156 | train |
saltstack/salt | salt/modules/hg.py | pull | def pull(cwd, opts=None, user=None, identity=None, repository=None):
'''
Perform a pull on the given repository
cwd
The path to the Mercurial repository
repository : None
Perform pull from the repository different from .hg/hgrc:[paths]:default
opts : None
Any additional op... | python | def pull(cwd, opts=None, user=None, identity=None, repository=None):
'''
Perform a pull on the given repository
cwd
The path to the Mercurial repository
repository : None
Perform pull from the repository different from .hg/hgrc:[paths]:default
opts : None
Any additional op... | [
"def",
"pull",
"(",
"cwd",
",",
"opts",
"=",
"None",
",",
"user",
"=",
"None",
",",
"identity",
"=",
"None",
",",
"repository",
"=",
"None",
")",
":",
"cmd",
"=",
"[",
"'hg'",
",",
"'pull'",
"]",
"if",
"identity",
":",
"cmd",
".",
"extend",
"(",
... | Perform a pull on the given repository
cwd
The path to the Mercurial repository
repository : None
Perform pull from the repository different from .hg/hgrc:[paths]:default
opts : None
Any additional options to add to the command line
user : None
Run hg as a user other ... | [
"Perform",
"a",
"pull",
"on",
"the",
"given",
"repository"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/hg.py#L159-L201 | train |
saltstack/salt | salt/modules/hg.py | update | def update(cwd, rev, force=False, user=None):
'''
Update to a given revision
cwd
The path to the Mercurial repository
rev
The revision to update to
force : False
Force an update
user : None
Run hg as a user other than what the minion runs as
CLI Example:
... | python | def update(cwd, rev, force=False, user=None):
'''
Update to a given revision
cwd
The path to the Mercurial repository
rev
The revision to update to
force : False
Force an update
user : None
Run hg as a user other than what the minion runs as
CLI Example:
... | [
"def",
"update",
"(",
"cwd",
",",
"rev",
",",
"force",
"=",
"False",
",",
"user",
"=",
"None",
")",
":",
"cmd",
"=",
"[",
"'hg'",
",",
"'update'",
",",
"'{0}'",
".",
"format",
"(",
"rev",
")",
"]",
"if",
"force",
":",
"cmd",
".",
"append",
"(",... | Update to a given revision
cwd
The path to the Mercurial repository
rev
The revision to update to
force : False
Force an update
user : None
Run hg as a user other than what the minion runs as
CLI Example:
.. code-block:: bash
salt devserver1 hg.upda... | [
"Update",
"to",
"a",
"given",
"revision"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/hg.py#L204-L236 | train |
saltstack/salt | salt/modules/hg.py | status | def status(cwd, opts=None, user=None):
'''
Show changed files of the given repository
cwd
The path to the Mercurial repository
opts : None
Any additional options to add to the command line
user : None
Run hg as a user other than what the minion runs as
CLI Example:
... | python | def status(cwd, opts=None, user=None):
'''
Show changed files of the given repository
cwd
The path to the Mercurial repository
opts : None
Any additional options to add to the command line
user : None
Run hg as a user other than what the minion runs as
CLI Example:
... | [
"def",
"status",
"(",
"cwd",
",",
"opts",
"=",
"None",
",",
"user",
"=",
"None",
")",
":",
"def",
"_status",
"(",
"cwd",
")",
":",
"cmd",
"=",
"[",
"'hg'",
",",
"'status'",
"]",
"if",
"opts",
":",
"for",
"opt",
"in",
"opts",
".",
"split",
"(",
... | Show changed files of the given repository
cwd
The path to the Mercurial repository
opts : None
Any additional options to add to the command line
user : None
Run hg as a user other than what the minion runs as
CLI Example:
.. code-block:: bash
salt '*' hg.status... | [
"Show",
"changed",
"files",
"of",
"the",
"given",
"repository"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/hg.py#L282-L329 | train |
saltstack/salt | salt/beacons/network_settings.py | validate | def validate(config):
'''
Validate the beacon configuration
'''
if not isinstance(config, list):
return False, ('Configuration for network_settings '
'beacon must be a list.')
else:
_config = {}
list(map(_config.update, config))
interfaces = _c... | python | def validate(config):
'''
Validate the beacon configuration
'''
if not isinstance(config, list):
return False, ('Configuration for network_settings '
'beacon must be a list.')
else:
_config = {}
list(map(_config.update, config))
interfaces = _c... | [
"def",
"validate",
"(",
"config",
")",
":",
"if",
"not",
"isinstance",
"(",
"config",
",",
"list",
")",
":",
"return",
"False",
",",
"(",
"'Configuration for network_settings '",
"'beacon must be a list.'",
")",
"else",
":",
"_config",
"=",
"{",
"}",
"list",
... | Validate the beacon configuration | [
"Validate",
"the",
"beacon",
"configuration"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/network_settings.py#L50-L73 | train |
saltstack/salt | salt/beacons/network_settings.py | _copy_interfaces_info | def _copy_interfaces_info(interfaces):
'''
Return a dictionary with a copy of each interface attributes in ATTRS
'''
ret = {}
for interface in interfaces:
_interface_attrs_cpy = set()
for attr in ATTRS:
if attr in interfaces[interface]:
attr_dict = Hashab... | python | def _copy_interfaces_info(interfaces):
'''
Return a dictionary with a copy of each interface attributes in ATTRS
'''
ret = {}
for interface in interfaces:
_interface_attrs_cpy = set()
for attr in ATTRS:
if attr in interfaces[interface]:
attr_dict = Hashab... | [
"def",
"_copy_interfaces_info",
"(",
"interfaces",
")",
":",
"ret",
"=",
"{",
"}",
"for",
"interface",
"in",
"interfaces",
":",
"_interface_attrs_cpy",
"=",
"set",
"(",
")",
"for",
"attr",
"in",
"ATTRS",
":",
"if",
"attr",
"in",
"interfaces",
"[",
"interfa... | Return a dictionary with a copy of each interface attributes in ATTRS | [
"Return",
"a",
"dictionary",
"with",
"a",
"copy",
"of",
"each",
"interface",
"attributes",
"in",
"ATTRS"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/network_settings.py#L76-L91 | train |
saltstack/salt | salt/beacons/network_settings.py | beacon | def beacon(config):
'''
Watch for changes on network settings
By default, the beacon will emit when there is a value change on one of the
settings on watch. The config also support the onvalue parameter for each
setting, which instruct the beacon to only emit if the setting changed to
the value... | python | def beacon(config):
'''
Watch for changes on network settings
By default, the beacon will emit when there is a value change on one of the
settings on watch. The config also support the onvalue parameter for each
setting, which instruct the beacon to only emit if the setting changed to
the value... | [
"def",
"beacon",
"(",
"config",
")",
":",
"_config",
"=",
"{",
"}",
"list",
"(",
"map",
"(",
"_config",
".",
"update",
",",
"config",
")",
")",
"ret",
"=",
"[",
"]",
"interfaces",
"=",
"[",
"]",
"expanded_config",
"=",
"{",
"}",
"global",
"LAST_STA... | Watch for changes on network settings
By default, the beacon will emit when there is a value change on one of the
settings on watch. The config also support the onvalue parameter for each
setting, which instruct the beacon to only emit if the setting changed to
the value defined.
Example Config
... | [
"Watch",
"for",
"changes",
"on",
"network",
"settings"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/network_settings.py#L94-L213 | train |
saltstack/salt | salt/sdb/memcached.py | set_ | def set_(key, value, profile=None):
'''
Set a key/value pair in memcached
'''
conn = salt.utils.memcached.get_conn(profile)
time = profile.get('expire', DEFAULT_EXPIRATION)
return salt.utils.memcached.set_(conn, key, value, time=time) | python | def set_(key, value, profile=None):
'''
Set a key/value pair in memcached
'''
conn = salt.utils.memcached.get_conn(profile)
time = profile.get('expire', DEFAULT_EXPIRATION)
return salt.utils.memcached.set_(conn, key, value, time=time) | [
"def",
"set_",
"(",
"key",
",",
"value",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"salt",
".",
"utils",
".",
"memcached",
".",
"get_conn",
"(",
"profile",
")",
"time",
"=",
"profile",
".",
"get",
"(",
"'expire'",
",",
"DEFAULT_EXPIRATION",
... | Set a key/value pair in memcached | [
"Set",
"a",
"key",
"/",
"value",
"pair",
"in",
"memcached"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/sdb/memcached.py#L62-L68 | train |
saltstack/salt | salt/sdb/memcached.py | get | def get(key, profile=None):
'''
Get a value from memcached
'''
conn = salt.utils.memcached.get_conn(profile)
return salt.utils.memcached.get(conn, key) | python | def get(key, profile=None):
'''
Get a value from memcached
'''
conn = salt.utils.memcached.get_conn(profile)
return salt.utils.memcached.get(conn, key) | [
"def",
"get",
"(",
"key",
",",
"profile",
"=",
"None",
")",
":",
"conn",
"=",
"salt",
".",
"utils",
".",
"memcached",
".",
"get_conn",
"(",
"profile",
")",
"return",
"salt",
".",
"utils",
".",
"memcached",
".",
"get",
"(",
"conn",
",",
"key",
")"
] | Get a value from memcached | [
"Get",
"a",
"value",
"from",
"memcached"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/sdb/memcached.py#L71-L76 | train |
saltstack/salt | salt/states/proxy.py | managed | def managed(name, port, services=None, user=None, password=None, bypass_domains=None, network_service='Ethernet'):
'''
Manages proxy settings for this mininon
name
The proxy server to use
port
The port used by the proxy server
services
A list of the services that should us... | python | def managed(name, port, services=None, user=None, password=None, bypass_domains=None, network_service='Ethernet'):
'''
Manages proxy settings for this mininon
name
The proxy server to use
port
The port used by the proxy server
services
A list of the services that should us... | [
"def",
"managed",
"(",
"name",
",",
"port",
",",
"services",
"=",
"None",
",",
"user",
"=",
"None",
",",
"password",
"=",
"None",
",",
"bypass_domains",
"=",
"None",
",",
"network_service",
"=",
"'Ethernet'",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
... | Manages proxy settings for this mininon
name
The proxy server to use
port
The port used by the proxy server
services
A list of the services that should use the given proxy settings, valid services include http, https and ftp.
If no service is given all of the valid service... | [
"Manages",
"proxy",
"settings",
"for",
"this",
"mininon"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/proxy.py#L40-L144 | train |
saltstack/salt | salt/modules/saltsupport.py | SaltSupportModule._get_archive_name | def _get_archive_name(self, archname=None):
'''
Create default archive name.
:return:
'''
archname = re.sub('[^a-z0-9]', '', (archname or '').lower()) or 'support'
for grain in ['fqdn', 'host', 'localhost', 'nodename']:
host = __grains__.get(grain)
... | python | def _get_archive_name(self, archname=None):
'''
Create default archive name.
:return:
'''
archname = re.sub('[^a-z0-9]', '', (archname or '').lower()) or 'support'
for grain in ['fqdn', 'host', 'localhost', 'nodename']:
host = __grains__.get(grain)
... | [
"def",
"_get_archive_name",
"(",
"self",
",",
"archname",
"=",
"None",
")",
":",
"archname",
"=",
"re",
".",
"sub",
"(",
"'[^a-z0-9]'",
",",
"''",
",",
"(",
"archname",
"or",
"''",
")",
".",
"lower",
"(",
")",
")",
"or",
"'support'",
"for",
"grain",
... | Create default archive name.
:return: | [
"Create",
"default",
"archive",
"name",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltsupport.py#L109-L127 | train |
saltstack/salt | salt/modules/saltsupport.py | SaltSupportModule.archives | def archives(self):
'''
Get list of existing archives.
:return:
'''
arc_files = []
tmpdir = tempfile.gettempdir()
for filename in os.listdir(tmpdir):
mtc = re.match(r'\w+-\w+-\d+-\d+\.bz2', filename)
if mtc and len(filename) == mtc.span()[-... | python | def archives(self):
'''
Get list of existing archives.
:return:
'''
arc_files = []
tmpdir = tempfile.gettempdir()
for filename in os.listdir(tmpdir):
mtc = re.match(r'\w+-\w+-\d+-\d+\.bz2', filename)
if mtc and len(filename) == mtc.span()[-... | [
"def",
"archives",
"(",
"self",
")",
":",
"arc_files",
"=",
"[",
"]",
"tmpdir",
"=",
"tempfile",
".",
"gettempdir",
"(",
")",
"for",
"filename",
"in",
"os",
".",
"listdir",
"(",
"tmpdir",
")",
":",
"mtc",
"=",
"re",
".",
"match",
"(",
"r'\\w+-\\w+-\\... | Get list of existing archives.
:return: | [
"Get",
"list",
"of",
"existing",
"archives",
".",
":",
"return",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltsupport.py#L142-L154 | train |
saltstack/salt | salt/modules/saltsupport.py | SaltSupportModule.last_archive | def last_archive(self):
'''
Get the last available archive
:return:
'''
archives = {}
for archive in self.archives():
archives[int(archive.split('.')[0].split('-')[-1])] = archive
return archives and archives[max(archives)] or None | python | def last_archive(self):
'''
Get the last available archive
:return:
'''
archives = {}
for archive in self.archives():
archives[int(archive.split('.')[0].split('-')[-1])] = archive
return archives and archives[max(archives)] or None | [
"def",
"last_archive",
"(",
"self",
")",
":",
"archives",
"=",
"{",
"}",
"for",
"archive",
"in",
"self",
".",
"archives",
"(",
")",
":",
"archives",
"[",
"int",
"(",
"archive",
".",
"split",
"(",
"'.'",
")",
"[",
"0",
"]",
".",
"split",
"(",
"'-'... | Get the last available archive
:return: | [
"Get",
"the",
"last",
"available",
"archive",
":",
"return",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltsupport.py#L157-L166 | train |
saltstack/salt | salt/modules/saltsupport.py | SaltSupportModule.delete_archives | def delete_archives(self, *archives):
'''
Delete archives
:return:
'''
# Remove paths
_archives = []
for archive in archives:
_archives.append(os.path.basename(archive))
archives = _archives[:]
ret = {'files': {}, 'errors': {}}
... | python | def delete_archives(self, *archives):
'''
Delete archives
:return:
'''
# Remove paths
_archives = []
for archive in archives:
_archives.append(os.path.basename(archive))
archives = _archives[:]
ret = {'files': {}, 'errors': {}}
... | [
"def",
"delete_archives",
"(",
"self",
",",
"*",
"archives",
")",
":",
"# Remove paths",
"_archives",
"=",
"[",
"]",
"for",
"archive",
"in",
"archives",
":",
"_archives",
".",
"append",
"(",
"os",
".",
"path",
".",
"basename",
"(",
"archive",
")",
")",
... | Delete archives
:return: | [
"Delete",
"archives",
":",
"return",
":"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltsupport.py#L169-L193 | train |
saltstack/salt | salt/modules/saltsupport.py | SaltSupportModule.format_sync_stats | def format_sync_stats(self, cnt):
'''
Format stats of the sync output.
:param cnt:
:return:
'''
stats = salt.utils.odict.OrderedDict()
if cnt.get('retcode') == salt.defaults.exitcodes.EX_OK:
for line in cnt.get('stdout', '').split(os.linesep):
... | python | def format_sync_stats(self, cnt):
'''
Format stats of the sync output.
:param cnt:
:return:
'''
stats = salt.utils.odict.OrderedDict()
if cnt.get('retcode') == salt.defaults.exitcodes.EX_OK:
for line in cnt.get('stdout', '').split(os.linesep):
... | [
"def",
"format_sync_stats",
"(",
"self",
",",
"cnt",
")",
":",
"stats",
"=",
"salt",
".",
"utils",
".",
"odict",
".",
"OrderedDict",
"(",
")",
"if",
"cnt",
".",
"get",
"(",
"'retcode'",
")",
"==",
"salt",
".",
"defaults",
".",
"exitcodes",
".",
"EX_O... | Format stats of the sync output.
:param cnt:
:return: | [
"Format",
"stats",
"of",
"the",
"sync",
"output",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltsupport.py#L195-L219 | train |
saltstack/salt | salt/modules/saltsupport.py | SaltSupportModule.sync | def sync(self, group, name=None, host=None, location=None, move=False, all=False):
'''
Sync the latest archive to the host on given location.
CLI Example:
.. code-block:: bash
salt '*' support.sync group=test
salt '*' support.sync group=test name=/tmp/myspecial... | python | def sync(self, group, name=None, host=None, location=None, move=False, all=False):
'''
Sync the latest archive to the host on given location.
CLI Example:
.. code-block:: bash
salt '*' support.sync group=test
salt '*' support.sync group=test name=/tmp/myspecial... | [
"def",
"sync",
"(",
"self",
",",
"group",
",",
"name",
"=",
"None",
",",
"host",
"=",
"None",
",",
"location",
"=",
"None",
",",
"move",
"=",
"False",
",",
"all",
"=",
"False",
")",
":",
"tfh",
",",
"tfn",
"=",
"tempfile",
".",
"mkstemp",
"(",
... | Sync the latest archive to the host on given location.
CLI Example:
.. code-block:: bash
salt '*' support.sync group=test
salt '*' support.sync group=test name=/tmp/myspecial-12345-67890.bz2
salt '*' support.sync group=test name=/tmp/myspecial-12345-67890.bz2 host=... | [
"Sync",
"the",
"latest",
"archive",
"to",
"the",
"host",
"on",
"given",
"location",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltsupport.py#L223-L298 | train |
saltstack/salt | salt/modules/saltsupport.py | SaltSupportModule.run | def run(self, profile='default', pillar=None, archive=None, output='nested'):
'''
Run Salt Support on the minion.
profile
Set available profile name. Default is "default".
pillar
Set available profile from the pillars.
archive
Override archi... | python | def run(self, profile='default', pillar=None, archive=None, output='nested'):
'''
Run Salt Support on the minion.
profile
Set available profile name. Default is "default".
pillar
Set available profile from the pillars.
archive
Override archi... | [
"def",
"run",
"(",
"self",
",",
"profile",
"=",
"'default'",
",",
"pillar",
"=",
"None",
",",
"archive",
"=",
"None",
",",
"output",
"=",
"'nested'",
")",
":",
"class",
"outputswitch",
"(",
"object",
")",
":",
"'''\n Output switcher on context\n ... | Run Salt Support on the minion.
profile
Set available profile name. Default is "default".
pillar
Set available profile from the pillars.
archive
Override archive name. Default is "support". This results to "hostname-support-YYYYMMDD-hhmmss.bz2".
ou... | [
"Run",
"Salt",
"Support",
"on",
"the",
"minion",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltsupport.py#L301-L350 | train |
saltstack/salt | salt/utils/filebuffer.py | BufferedReader.next | def next(self):
'''
Return the next iteration by popping `chunk_size` from the left and
appending `chunk_size` to the right if there's info on the file left
to be read.
'''
if self.__buffered is None:
# Use floor division to force multiplier to an integer
... | python | def next(self):
'''
Return the next iteration by popping `chunk_size` from the left and
appending `chunk_size` to the right if there's info on the file left
to be read.
'''
if self.__buffered is None:
# Use floor division to force multiplier to an integer
... | [
"def",
"next",
"(",
"self",
")",
":",
"if",
"self",
".",
"__buffered",
"is",
"None",
":",
"# Use floor division to force multiplier to an integer",
"multiplier",
"=",
"self",
".",
"__max_in_mem",
"//",
"self",
".",
"__chunk_size",
"self",
".",
"__buffered",
"=",
... | Return the next iteration by popping `chunk_size` from the left and
appending `chunk_size` to the right if there's info on the file left
to be read. | [
"Return",
"the",
"next",
"iteration",
"by",
"popping",
"chunk_size",
"from",
"the",
"left",
"and",
"appending",
"chunk_size",
"to",
"the",
"right",
"if",
"there",
"s",
"info",
"on",
"the",
"file",
"left",
"to",
"be",
"read",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/filebuffer.py#L74-L99 | train |
saltstack/salt | salt/pillar/vmware_pillar.py | ext_pillar | def ext_pillar(minion_id,
pillar, # pylint: disable=W0613
**kwargs):
'''
Check vmware/vcenter for all data
'''
vmware_pillar = {}
host = None
username = None
password = None
property_types = []
property_name = 'name'
protocol = None
port = None
... | python | def ext_pillar(minion_id,
pillar, # pylint: disable=W0613
**kwargs):
'''
Check vmware/vcenter for all data
'''
vmware_pillar = {}
host = None
username = None
password = None
property_types = []
property_name = 'name'
protocol = None
port = None
... | [
"def",
"ext_pillar",
"(",
"minion_id",
",",
"pillar",
",",
"# pylint: disable=W0613",
"*",
"*",
"kwargs",
")",
":",
"vmware_pillar",
"=",
"{",
"}",
"host",
"=",
"None",
"username",
"=",
"None",
"password",
"=",
"None",
"property_types",
"=",
"[",
"]",
"pro... | Check vmware/vcenter for all data | [
"Check",
"vmware",
"/",
"vcenter",
"for",
"all",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/vmware_pillar.py#L177-L470 | train |
saltstack/salt | salt/pillar/vmware_pillar.py | _recurse_config_to_dict | def _recurse_config_to_dict(t_data):
'''
helper function to recurse through a vim object and attempt to return all child objects
'''
if not isinstance(t_data, type(None)):
if isinstance(t_data, list):
t_list = []
for i in t_data:
t_list.append(_recurse_con... | python | def _recurse_config_to_dict(t_data):
'''
helper function to recurse through a vim object and attempt to return all child objects
'''
if not isinstance(t_data, type(None)):
if isinstance(t_data, list):
t_list = []
for i in t_data:
t_list.append(_recurse_con... | [
"def",
"_recurse_config_to_dict",
"(",
"t_data",
")",
":",
"if",
"not",
"isinstance",
"(",
"t_data",
",",
"type",
"(",
"None",
")",
")",
":",
"if",
"isinstance",
"(",
"t_data",
",",
"list",
")",
":",
"t_list",
"=",
"[",
"]",
"for",
"i",
"in",
"t_data... | helper function to recurse through a vim object and attempt to return all child objects | [
"helper",
"function",
"to",
"recurse",
"through",
"a",
"vim",
"object",
"and",
"attempt",
"to",
"return",
"all",
"child",
"objects"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/vmware_pillar.py#L473-L492 | train |
saltstack/salt | salt/pillar/vmware_pillar.py | _crawl_attribute | def _crawl_attribute(this_data, this_attr):
'''
helper function to crawl an attribute specified for retrieval
'''
if isinstance(this_data, list):
t_list = []
for d in this_data:
t_list.append(_crawl_attribute(d, this_attr))
return t_list
else:
if isinstanc... | python | def _crawl_attribute(this_data, this_attr):
'''
helper function to crawl an attribute specified for retrieval
'''
if isinstance(this_data, list):
t_list = []
for d in this_data:
t_list.append(_crawl_attribute(d, this_attr))
return t_list
else:
if isinstanc... | [
"def",
"_crawl_attribute",
"(",
"this_data",
",",
"this_attr",
")",
":",
"if",
"isinstance",
"(",
"this_data",
",",
"list",
")",
":",
"t_list",
"=",
"[",
"]",
"for",
"d",
"in",
"this_data",
":",
"t_list",
".",
"append",
"(",
"_crawl_attribute",
"(",
"d",... | helper function to crawl an attribute specified for retrieval | [
"helper",
"function",
"to",
"crawl",
"an",
"attribute",
"specified",
"for",
"retrieval"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/vmware_pillar.py#L495-L517 | train |
saltstack/salt | salt/pillar/vmware_pillar.py | _serializer | def _serializer(obj):
'''
helper function to serialize some objects for prettier return
'''
import datetime
if isinstance(obj, datetime.datetime):
if obj.utcoffset() is not None:
obj = obj - obj.utcoffset()
return obj.__str__()
return obj | python | def _serializer(obj):
'''
helper function to serialize some objects for prettier return
'''
import datetime
if isinstance(obj, datetime.datetime):
if obj.utcoffset() is not None:
obj = obj - obj.utcoffset()
return obj.__str__()
return obj | [
"def",
"_serializer",
"(",
"obj",
")",
":",
"import",
"datetime",
"if",
"isinstance",
"(",
"obj",
",",
"datetime",
".",
"datetime",
")",
":",
"if",
"obj",
".",
"utcoffset",
"(",
")",
"is",
"not",
"None",
":",
"obj",
"=",
"obj",
"-",
"obj",
".",
"ut... | helper function to serialize some objects for prettier return | [
"helper",
"function",
"to",
"serialize",
"some",
"objects",
"for",
"prettier",
"return"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/vmware_pillar.py#L520-L529 | train |
saltstack/salt | salt/modules/sqlite3.py | modify | def modify(db=None, sql=None):
'''
Issue an SQL query to sqlite3 (with no return data), usually used
to modify the database in some way (insert, delete, create, etc)
CLI Example:
.. code-block:: bash
salt '*' sqlite3.modify /root/test.db 'CREATE TABLE test(id INT, testdata TEXT);'
'''... | python | def modify(db=None, sql=None):
'''
Issue an SQL query to sqlite3 (with no return data), usually used
to modify the database in some way (insert, delete, create, etc)
CLI Example:
.. code-block:: bash
salt '*' sqlite3.modify /root/test.db 'CREATE TABLE test(id INT, testdata TEXT);'
'''... | [
"def",
"modify",
"(",
"db",
"=",
"None",
",",
"sql",
"=",
"None",
")",
":",
"cur",
"=",
"_connect",
"(",
"db",
")",
"if",
"not",
"cur",
":",
"return",
"False",
"cur",
".",
"execute",
"(",
"sql",
")",
"return",
"True"
] | Issue an SQL query to sqlite3 (with no return data), usually used
to modify the database in some way (insert, delete, create, etc)
CLI Example:
.. code-block:: bash
salt '*' sqlite3.modify /root/test.db 'CREATE TABLE test(id INT, testdata TEXT);' | [
"Issue",
"an",
"SQL",
"query",
"to",
"sqlite3",
"(",
"with",
"no",
"return",
"data",
")",
"usually",
"used",
"to",
"modify",
"the",
"database",
"in",
"some",
"way",
"(",
"insert",
"delete",
"create",
"etc",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sqlite3.py#L57-L74 | train |
saltstack/salt | salt/modules/sqlite3.py | fetch | def fetch(db=None, sql=None):
'''
Retrieve data from an sqlite3 db (returns all rows, be careful!)
CLI Example:
.. code-block:: bash
salt '*' sqlite3.fetch /root/test.db 'SELECT * FROM test;'
'''
cur = _connect(db)
if not cur:
return False
cur.execute(sql)
rows =... | python | def fetch(db=None, sql=None):
'''
Retrieve data from an sqlite3 db (returns all rows, be careful!)
CLI Example:
.. code-block:: bash
salt '*' sqlite3.fetch /root/test.db 'SELECT * FROM test;'
'''
cur = _connect(db)
if not cur:
return False
cur.execute(sql)
rows =... | [
"def",
"fetch",
"(",
"db",
"=",
"None",
",",
"sql",
"=",
"None",
")",
":",
"cur",
"=",
"_connect",
"(",
"db",
")",
"if",
"not",
"cur",
":",
"return",
"False",
"cur",
".",
"execute",
"(",
"sql",
")",
"rows",
"=",
"cur",
".",
"fetchall",
"(",
")"... | Retrieve data from an sqlite3 db (returns all rows, be careful!)
CLI Example:
.. code-block:: bash
salt '*' sqlite3.fetch /root/test.db 'SELECT * FROM test;' | [
"Retrieve",
"data",
"from",
"an",
"sqlite3",
"db",
"(",
"returns",
"all",
"rows",
"be",
"careful!",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sqlite3.py#L77-L94 | train |
saltstack/salt | salt/modules/sqlite3.py | tables | def tables(db=None):
'''
Show all tables in the database
CLI Example:
.. code-block:: bash
salt '*' sqlite3.tables /root/test.db
'''
cur = _connect(db)
if not cur:
return False
cur.execute(
"SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;"
... | python | def tables(db=None):
'''
Show all tables in the database
CLI Example:
.. code-block:: bash
salt '*' sqlite3.tables /root/test.db
'''
cur = _connect(db)
if not cur:
return False
cur.execute(
"SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;"
... | [
"def",
"tables",
"(",
"db",
"=",
"None",
")",
":",
"cur",
"=",
"_connect",
"(",
"db",
")",
"if",
"not",
"cur",
":",
"return",
"False",
"cur",
".",
"execute",
"(",
"\"SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;\"",
")",
"rows",
"=",
"cur",
... | Show all tables in the database
CLI Example:
.. code-block:: bash
salt '*' sqlite3.tables /root/test.db | [
"Show",
"all",
"tables",
"in",
"the",
"database"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sqlite3.py#L97-L116 | train |
saltstack/salt | salt/modules/sqlite3.py | indices | def indices(db=None):
'''
Show all indices in the database
CLI Example:
.. code-block:: bash
salt '*' sqlite3.indices /root/test.db
'''
cur = _connect(db)
if not cur:
return False
cur.execute(
"SELECT name FROM sqlite_master WHERE type='index' ORDER BY name;"... | python | def indices(db=None):
'''
Show all indices in the database
CLI Example:
.. code-block:: bash
salt '*' sqlite3.indices /root/test.db
'''
cur = _connect(db)
if not cur:
return False
cur.execute(
"SELECT name FROM sqlite_master WHERE type='index' ORDER BY name;"... | [
"def",
"indices",
"(",
"db",
"=",
"None",
")",
":",
"cur",
"=",
"_connect",
"(",
"db",
")",
"if",
"not",
"cur",
":",
"return",
"False",
"cur",
".",
"execute",
"(",
"\"SELECT name FROM sqlite_master WHERE type='index' ORDER BY name;\"",
")",
"rows",
"=",
"cur",... | Show all indices in the database
CLI Example:
.. code-block:: bash
salt '*' sqlite3.indices /root/test.db | [
"Show",
"all",
"indices",
"in",
"the",
"database"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sqlite3.py#L119-L138 | train |
saltstack/salt | salt/roster/cache.py | targets | def targets(tgt, tgt_type='glob', **kwargs): # pylint: disable=W0613
'''
Return the targets from the Salt Masters' minion cache.
All targets and matchers are supported.
The resulting roster can be configured using ``roster_order`` and ``roster_default``.
'''
minions = salt.utils.minions.CkMini... | python | def targets(tgt, tgt_type='glob', **kwargs): # pylint: disable=W0613
'''
Return the targets from the Salt Masters' minion cache.
All targets and matchers are supported.
The resulting roster can be configured using ``roster_order`` and ``roster_default``.
'''
minions = salt.utils.minions.CkMini... | [
"def",
"targets",
"(",
"tgt",
",",
"tgt_type",
"=",
"'glob'",
",",
"*",
"*",
"kwargs",
")",
":",
"# pylint: disable=W0613",
"minions",
"=",
"salt",
".",
"utils",
".",
"minions",
".",
"CkMinions",
"(",
"__opts__",
")",
"_res",
"=",
"minions",
".",
"check_... | Return the targets from the Salt Masters' minion cache.
All targets and matchers are supported.
The resulting roster can be configured using ``roster_order`` and ``roster_default``. | [
"Return",
"the",
"targets",
"from",
"the",
"Salt",
"Masters",
"minion",
"cache",
".",
"All",
"targets",
"and",
"matchers",
"are",
"supported",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/cache.py#L113-L159 | train |
saltstack/salt | salt/renderers/gpg.py | _get_key_dir | def _get_key_dir():
'''
return the location of the GPG key directory
'''
gpg_keydir = None
if 'config.get' in __salt__:
gpg_keydir = __salt__['config.get']('gpg_keydir')
if not gpg_keydir:
gpg_keydir = __opts__.get(
'gpg_keydir',
os.path.join(
... | python | def _get_key_dir():
'''
return the location of the GPG key directory
'''
gpg_keydir = None
if 'config.get' in __salt__:
gpg_keydir = __salt__['config.get']('gpg_keydir')
if not gpg_keydir:
gpg_keydir = __opts__.get(
'gpg_keydir',
os.path.join(
... | [
"def",
"_get_key_dir",
"(",
")",
":",
"gpg_keydir",
"=",
"None",
"if",
"'config.get'",
"in",
"__salt__",
":",
"gpg_keydir",
"=",
"__salt__",
"[",
"'config.get'",
"]",
"(",
"'gpg_keydir'",
")",
"if",
"not",
"gpg_keydir",
":",
"gpg_keydir",
"=",
"__opts__",
".... | return the location of the GPG key directory | [
"return",
"the",
"location",
"of",
"the",
"GPG",
"key",
"directory"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/gpg.py#L307-L326 | train |
saltstack/salt | salt/renderers/gpg.py | _decrypt_ciphertext | def _decrypt_ciphertext(cipher):
'''
Given a block of ciphertext as a string, and a gpg object, try to decrypt
the cipher and return the decrypted string. If the cipher cannot be
decrypted, log the error, and return the ciphertext back out.
'''
try:
cipher = salt.utils.stringutils.to_uni... | python | def _decrypt_ciphertext(cipher):
'''
Given a block of ciphertext as a string, and a gpg object, try to decrypt
the cipher and return the decrypted string. If the cipher cannot be
decrypted, log the error, and return the ciphertext back out.
'''
try:
cipher = salt.utils.stringutils.to_uni... | [
"def",
"_decrypt_ciphertext",
"(",
"cipher",
")",
":",
"try",
":",
"cipher",
"=",
"salt",
".",
"utils",
".",
"stringutils",
".",
"to_unicode",
"(",
"cipher",
")",
".",
"replace",
"(",
"r'\\n'",
",",
"'\\n'",
")",
"except",
"UnicodeDecodeError",
":",
"# cip... | Given a block of ciphertext as a string, and a gpg object, try to decrypt
the cipher and return the decrypted string. If the cipher cannot be
decrypted, log the error, and return the ciphertext back out. | [
"Given",
"a",
"block",
"of",
"ciphertext",
"as",
"a",
"string",
"and",
"a",
"gpg",
"object",
"try",
"to",
"decrypt",
"the",
"cipher",
"and",
"return",
"the",
"decrypted",
"string",
".",
"If",
"the",
"cipher",
"cannot",
"be",
"decrypted",
"log",
"the",
"e... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/gpg.py#L329-L363 | train |
saltstack/salt | salt/renderers/gpg.py | _decrypt_object | def _decrypt_object(obj, translate_newlines=False):
'''
Recursively try to decrypt any object. If the object is a six.string_types
(string or unicode), and it contains a valid GPG header, decrypt it,
otherwise keep going until a string is found.
'''
if salt.utils.stringio.is_readable(obj):
... | python | def _decrypt_object(obj, translate_newlines=False):
'''
Recursively try to decrypt any object. If the object is a six.string_types
(string or unicode), and it contains a valid GPG header, decrypt it,
otherwise keep going until a string is found.
'''
if salt.utils.stringio.is_readable(obj):
... | [
"def",
"_decrypt_object",
"(",
"obj",
",",
"translate_newlines",
"=",
"False",
")",
":",
"if",
"salt",
".",
"utils",
".",
"stringio",
".",
"is_readable",
"(",
"obj",
")",
":",
"return",
"_decrypt_object",
"(",
"obj",
".",
"getvalue",
"(",
")",
",",
"tran... | Recursively try to decrypt any object. If the object is a six.string_types
(string or unicode), and it contains a valid GPG header, decrypt it,
otherwise keep going until a string is found. | [
"Recursively",
"try",
"to",
"decrypt",
"any",
"object",
".",
"If",
"the",
"object",
"is",
"a",
"six",
".",
"string_types",
"(",
"string",
"or",
"unicode",
")",
"and",
"it",
"contains",
"a",
"valid",
"GPG",
"header",
"decrypt",
"it",
"otherwise",
"keep",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/gpg.py#L378-L399 | train |
saltstack/salt | salt/renderers/gpg.py | render | def render(gpg_data, saltenv='base', sls='', argline='', **kwargs):
'''
Create a gpg object given a gpg_keydir, and then use it to try to decrypt
the data to be rendered.
'''
if not _get_gpg_exec():
raise SaltRenderError('GPG unavailable')
log.debug('Reading GPG keys from: %s', _get_key_... | python | def render(gpg_data, saltenv='base', sls='', argline='', **kwargs):
'''
Create a gpg object given a gpg_keydir, and then use it to try to decrypt
the data to be rendered.
'''
if not _get_gpg_exec():
raise SaltRenderError('GPG unavailable')
log.debug('Reading GPG keys from: %s', _get_key_... | [
"def",
"render",
"(",
"gpg_data",
",",
"saltenv",
"=",
"'base'",
",",
"sls",
"=",
"''",
",",
"argline",
"=",
"''",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"_get_gpg_exec",
"(",
")",
":",
"raise",
"SaltRenderError",
"(",
"'GPG unavailable'",
")"... | Create a gpg object given a gpg_keydir, and then use it to try to decrypt
the data to be rendered. | [
"Create",
"a",
"gpg",
"object",
"given",
"a",
"gpg_keydir",
"and",
"then",
"use",
"it",
"to",
"try",
"to",
"decrypt",
"the",
"data",
"to",
"be",
"rendered",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/gpg.py#L402-L412 | train |
saltstack/salt | salt/beacons/telegram_bot_msg.py | validate | def validate(config):
'''
Validate the beacon configuration
'''
if not isinstance(config, list):
return False, ('Configuration for telegram_bot_msg '
'beacon must be a list.')
_config = {}
list(map(_config.update, config))
if not all(_config.get(required_conf... | python | def validate(config):
'''
Validate the beacon configuration
'''
if not isinstance(config, list):
return False, ('Configuration for telegram_bot_msg '
'beacon must be a list.')
_config = {}
list(map(_config.update, config))
if not all(_config.get(required_conf... | [
"def",
"validate",
"(",
"config",
")",
":",
"if",
"not",
"isinstance",
"(",
"config",
",",
"list",
")",
":",
"return",
"False",
",",
"(",
"'Configuration for telegram_bot_msg '",
"'beacon must be a list.'",
")",
"_config",
"=",
"{",
"}",
"list",
"(",
"map",
... | Validate the beacon configuration | [
"Validate",
"the",
"beacon",
"configuration"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/telegram_bot_msg.py#L35-L55 | train |
saltstack/salt | salt/beacons/telegram_bot_msg.py | beacon | def beacon(config):
'''
Emit a dict with a key "msgs" whose value is a list of messages
sent to the configured bot by one of the allowed usernames.
.. code-block:: yaml
beacons:
telegram_bot_msg:
- token: "<bot access token>"
- accept_from:
- "<v... | python | def beacon(config):
'''
Emit a dict with a key "msgs" whose value is a list of messages
sent to the configured bot by one of the allowed usernames.
.. code-block:: yaml
beacons:
telegram_bot_msg:
- token: "<bot access token>"
- accept_from:
- "<v... | [
"def",
"beacon",
"(",
"config",
")",
":",
"_config",
"=",
"{",
"}",
"list",
"(",
"map",
"(",
"_config",
".",
"update",
",",
"config",
")",
")",
"log",
".",
"debug",
"(",
"'telegram_bot_msg beacon starting'",
")",
"ret",
"=",
"[",
"]",
"output",
"=",
... | Emit a dict with a key "msgs" whose value is a list of messages
sent to the configured bot by one of the allowed usernames.
.. code-block:: yaml
beacons:
telegram_bot_msg:
- token: "<bot access token>"
- accept_from:
- "<valid username>"
- in... | [
"Emit",
"a",
"dict",
"with",
"a",
"key",
"msgs",
"whose",
"value",
"is",
"a",
"list",
"of",
"messages",
"sent",
"to",
"the",
"configured",
"bot",
"by",
"one",
"of",
"the",
"allowed",
"usernames",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/telegram_bot_msg.py#L58-L110 | train |
saltstack/salt | salt/tops/cobbler.py | top | def top(**kwargs):
'''
Look up top data in Cobbler for a minion.
'''
url = __opts__['cobbler.url']
user = __opts__['cobbler.user']
password = __opts__['cobbler.password']
minion_id = kwargs['opts']['id']
log.info("Querying cobbler for information for %r", minion_id)
try:
se... | python | def top(**kwargs):
'''
Look up top data in Cobbler for a minion.
'''
url = __opts__['cobbler.url']
user = __opts__['cobbler.user']
password = __opts__['cobbler.password']
minion_id = kwargs['opts']['id']
log.info("Querying cobbler for information for %r", minion_id)
try:
se... | [
"def",
"top",
"(",
"*",
"*",
"kwargs",
")",
":",
"url",
"=",
"__opts__",
"[",
"'cobbler.url'",
"]",
"user",
"=",
"__opts__",
"[",
"'cobbler.user'",
"]",
"password",
"=",
"__opts__",
"[",
"'cobbler.password'",
"]",
"minion_id",
"=",
"kwargs",
"[",
"'opts'",... | Look up top data in Cobbler for a minion. | [
"Look",
"up",
"top",
"data",
"in",
"Cobbler",
"for",
"a",
"minion",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/tops/cobbler.py#L39-L61 | train |
saltstack/salt | salt/modules/locate.py | stats | def stats():
'''
Returns statistics about the locate database
CLI Example:
.. code-block:: bash
salt '*' locate.stats
'''
ret = {}
cmd = 'locate -S'
out = __salt__['cmd.run'](cmd).splitlines()
for line in out:
comps = line.strip().split()
if line.startswith... | python | def stats():
'''
Returns statistics about the locate database
CLI Example:
.. code-block:: bash
salt '*' locate.stats
'''
ret = {}
cmd = 'locate -S'
out = __salt__['cmd.run'](cmd).splitlines()
for line in out:
comps = line.strip().split()
if line.startswith... | [
"def",
"stats",
"(",
")",
":",
"ret",
"=",
"{",
"}",
"cmd",
"=",
"'locate -S'",
"out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
")",
".",
"splitlines",
"(",
")",
"for",
"line",
"in",
"out",
":",
"comps",
"=",
"line",
".",
"strip",
"(",... | Returns statistics about the locate database
CLI Example:
.. code-block:: bash
salt '*' locate.stats | [
"Returns",
"statistics",
"about",
"the",
"locate",
"database"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/locate.py#L44-L63 | train |
saltstack/salt | salt/modules/locate.py | locate | def locate(pattern, database='', limit=0, **kwargs):
'''
Performs a file lookup. Valid options (and their defaults) are::
basename=False
count=False
existing=False
follow=True
ignore=False
nofollow=False
wholename=True
regex=False
database... | python | def locate(pattern, database='', limit=0, **kwargs):
'''
Performs a file lookup. Valid options (and their defaults) are::
basename=False
count=False
existing=False
follow=True
ignore=False
nofollow=False
wholename=True
regex=False
database... | [
"def",
"locate",
"(",
"pattern",
",",
"database",
"=",
"''",
",",
"limit",
"=",
"0",
",",
"*",
"*",
"kwargs",
")",
":",
"options",
"=",
"''",
"toggles",
"=",
"{",
"'basename'",
":",
"'b'",
",",
"'count'",
":",
"'c'",
",",
"'existing'",
":",
"'e'",
... | Performs a file lookup. Valid options (and their defaults) are::
basename=False
count=False
existing=False
follow=True
ignore=False
nofollow=False
wholename=True
regex=False
database=<locate's default database>
limit=<integer, not set by d... | [
"Performs",
"a",
"file",
"lookup",
".",
"Valid",
"options",
"(",
"and",
"their",
"defaults",
")",
"are",
"::"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/locate.py#L81-L127 | train |
saltstack/salt | salt/states/lxd.py | init | def init(name, storage_backend='dir', trust_password=None,
network_address=None, network_port=None, storage_create_device=None,
storage_create_loop=None, storage_pool=None,
done_file='%SALT_CONFIG_DIR%/lxd_initialized'):
'''
Initalizes the LXD Daemon, as LXD doesn't tell if its initia... | python | def init(name, storage_backend='dir', trust_password=None,
network_address=None, network_port=None, storage_create_device=None,
storage_create_loop=None, storage_pool=None,
done_file='%SALT_CONFIG_DIR%/lxd_initialized'):
'''
Initalizes the LXD Daemon, as LXD doesn't tell if its initia... | [
"def",
"init",
"(",
"name",
",",
"storage_backend",
"=",
"'dir'",
",",
"trust_password",
"=",
"None",
",",
"network_address",
"=",
"None",
",",
"network_port",
"=",
"None",
",",
"storage_create_device",
"=",
"None",
",",
"storage_create_loop",
"=",
"None",
","... | Initalizes the LXD Daemon, as LXD doesn't tell if its initialized
we touch the the done_file and check if it exist.
This can only be called once per host unless you remove the done_file.
name :
Ignore this. This is just here for salt.
storage_backend :
Storage backend to use (zfs or d... | [
"Initalizes",
"the",
"LXD",
"Daemon",
"as",
"LXD",
"doesn",
"t",
"tell",
"if",
"its",
"initialized",
"we",
"touch",
"the",
"the",
"done_file",
"and",
"check",
"if",
"it",
"exist",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lxd.py#L54-L132 | train |
saltstack/salt | salt/states/lxd.py | config_managed | def config_managed(name, value, force_password=False):
'''
Manage a LXD Server config setting.
name :
The name of the config key.
value :
Its value.
force_password : False
Set this to True if you want to set the password on every run.
As we can't retrieve the pass... | python | def config_managed(name, value, force_password=False):
'''
Manage a LXD Server config setting.
name :
The name of the config key.
value :
Its value.
force_password : False
Set this to True if you want to set the password on every run.
As we can't retrieve the pass... | [
"def",
"config_managed",
"(",
"name",
",",
"value",
",",
"force_password",
"=",
"False",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'value'",
":",
"value",
"if",
"name",
"!=",
"'core.trust_password'",
"else",
"True",
",",
"'force_password'",
"... | Manage a LXD Server config setting.
name :
The name of the config key.
value :
Its value.
force_password : False
Set this to True if you want to set the password on every run.
As we can't retrieve the password from LXD we can't check
if the current one is the same... | [
"Manage",
"a",
"LXD",
"Server",
"config",
"setting",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lxd.py#L135-L201 | train |
saltstack/salt | salt/states/lxd.py | authenticate | def authenticate(name, remote_addr, password, cert, key, verify_cert=True):
'''
Authenticate with a remote peer.
.. notes:
This function makes every time you run this a connection
to remote_addr, you better call this only once.
remote_addr :
An URL to a remote Server, you also... | python | def authenticate(name, remote_addr, password, cert, key, verify_cert=True):
'''
Authenticate with a remote peer.
.. notes:
This function makes every time you run this a connection
to remote_addr, you better call this only once.
remote_addr :
An URL to a remote Server, you also... | [
"def",
"authenticate",
"(",
"name",
",",
"remote_addr",
",",
"password",
",",
"cert",
",",
"key",
",",
"verify_cert",
"=",
"True",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'remote_addr'",
":",
"remote_addr",
",",
"'cert'",
":",
"cert",
"... | Authenticate with a remote peer.
.. notes:
This function makes every time you run this a connection
to remote_addr, you better call this only once.
remote_addr :
An URL to a remote Server, you also have to give cert and key if you
provide remote_addr!
Examples:
... | [
"Authenticate",
"with",
"a",
"remote",
"peer",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lxd.py#L204-L282 | train |
saltstack/salt | salt/states/ipmi.py | boot_device | def boot_device(name='default', **kwargs):
'''
Request power state change
name = ``default``
* network -- Request network boot
* hd -- Boot from hard drive
* safe -- Boot from hard drive, requesting 'safe mode'
* optical -- boot from CD/DVD/BD drive
* setup -- Boot i... | python | def boot_device(name='default', **kwargs):
'''
Request power state change
name = ``default``
* network -- Request network boot
* hd -- Boot from hard drive
* safe -- Boot from hard drive, requesting 'safe mode'
* optical -- boot from CD/DVD/BD drive
* setup -- Boot i... | [
"def",
"boot_device",
"(",
"name",
"=",
"'default'",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"org",
"=",
"__salt__"... | Request power state change
name = ``default``
* network -- Request network boot
* hd -- Boot from hard drive
* safe -- Boot from hard drive, requesting 'safe mode'
* optical -- boot from CD/DVD/BD drive
* setup -- Boot into setup utility
* default -- remove any IPMI ... | [
"Request",
"power",
"state",
"change"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ipmi.py#L54-L93 | train |
saltstack/salt | salt/states/ipmi.py | power | def power(name='power_on', wait=300, **kwargs):
'''
Request power state change
name
Ensure power state one of:
* power_on -- system turn on
* power_off -- system turn off (without waiting for OS)
* shutdown -- request OS proper shutdown
* reset -- res... | python | def power(name='power_on', wait=300, **kwargs):
'''
Request power state change
name
Ensure power state one of:
* power_on -- system turn on
* power_off -- system turn off (without waiting for OS)
* shutdown -- request OS proper shutdown
* reset -- res... | [
"def",
"power",
"(",
"name",
"=",
"'power_on'",
",",
"wait",
"=",
"300",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
... | Request power state change
name
Ensure power state one of:
* power_on -- system turn on
* power_off -- system turn off (without waiting for OS)
* shutdown -- request OS proper shutdown
* reset -- reset (without waiting for OS)
* boot -- If system ... | [
"Request",
"power",
"state",
"change"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ipmi.py#L96-L147 | train |
saltstack/salt | salt/states/ipmi.py | user_present | def user_present(name, uid, password, channel=14, callback=False,
link_auth=True, ipmi_msg=True, privilege_level='administrator', **kwargs):
'''
Ensure IPMI user and user privileges.
name
name of user (limit 16 bytes)
uid
user id number (1 to 7)
password
us... | python | def user_present(name, uid, password, channel=14, callback=False,
link_auth=True, ipmi_msg=True, privilege_level='administrator', **kwargs):
'''
Ensure IPMI user and user privileges.
name
name of user (limit 16 bytes)
uid
user id number (1 to 7)
password
us... | [
"def",
"user_present",
"(",
"name",
",",
"uid",
",",
"password",
",",
"channel",
"=",
"14",
",",
"callback",
"=",
"False",
",",
"link_auth",
"=",
"True",
",",
"ipmi_msg",
"=",
"True",
",",
"privilege_level",
"=",
"'administrator'",
",",
"*",
"*",
"kwargs... | Ensure IPMI user and user privileges.
name
name of user (limit 16 bytes)
uid
user id number (1 to 7)
password
user password (limit 16 bytes)
channel
ipmi channel defaults to 14 for auto
callback
User Restricted to Callback
False = User Privilege ... | [
"Ensure",
"IPMI",
"user",
"and",
"user",
"privileges",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ipmi.py#L150-L257 | train |
saltstack/salt | salt/states/ipmi.py | user_absent | def user_absent(name, channel=14, **kwargs):
'''
Remove user
Delete all user (uid) records having the matching name.
name
string name of user to delete
channel
channel to remove user access from defaults to 14 for auto.
kwargs
- api_host=localhost
- api_user=ad... | python | def user_absent(name, channel=14, **kwargs):
'''
Remove user
Delete all user (uid) records having the matching name.
name
string name of user to delete
channel
channel to remove user access from defaults to 14 for auto.
kwargs
- api_host=localhost
- api_user=ad... | [
"def",
"user_absent",
"(",
"name",
",",
"channel",
"=",
"14",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"user_id_list... | Remove user
Delete all user (uid) records having the matching name.
name
string name of user to delete
channel
channel to remove user access from defaults to 14 for auto.
kwargs
- api_host=localhost
- api_user=admin
- api_pass=
- api_port=623
- ... | [
"Remove",
"user",
"Delete",
"all",
"user",
"(",
"uid",
")",
"records",
"having",
"the",
"matching",
"name",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ipmi.py#L260-L297 | train |
saltstack/salt | salt/matchers/cache_match.py | mmatch | def mmatch(expr,
delimiter,
greedy,
search_type,
regex_match=False,
exact_match=False,
opts=None):
'''
Helper function to search for minions in master caches
If 'greedy' return accepted minions that matched by the condition or absent in the c... | python | def mmatch(expr,
delimiter,
greedy,
search_type,
regex_match=False,
exact_match=False,
opts=None):
'''
Helper function to search for minions in master caches
If 'greedy' return accepted minions that matched by the condition or absent in the c... | [
"def",
"mmatch",
"(",
"expr",
",",
"delimiter",
",",
"greedy",
",",
"search_type",
",",
"regex_match",
"=",
"False",
",",
"exact_match",
"=",
"False",
",",
"opts",
"=",
"None",
")",
":",
"if",
"not",
"opts",
":",
"opts",
"=",
"__opts__",
"ckminions",
"... | Helper function to search for minions in master caches
If 'greedy' return accepted minions that matched by the condition or absent in the cache.
If not 'greedy' return the only minions have cache data and matched by the condition. | [
"Helper",
"function",
"to",
"search",
"for",
"minions",
"in",
"master",
"caches",
"If",
"greedy",
"return",
"accepted",
"minions",
"that",
"matched",
"by",
"the",
"condition",
"or",
"absent",
"in",
"the",
"cache",
".",
"If",
"not",
"greedy",
"return",
"the",... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/matchers/cache_match.py#L15-L34 | train |
saltstack/salt | salt/states/boto_lc.py | present | def present(
name,
image_id,
key_name=None,
vpc_id=None,
vpc_name=None,
security_groups=None,
user_data=None,
cloud_init=None,
instance_type='m1.small',
kernel_id=None,
ramdisk_id=None,
block_device_mappings=None,
de... | python | def present(
name,
image_id,
key_name=None,
vpc_id=None,
vpc_name=None,
security_groups=None,
user_data=None,
cloud_init=None,
instance_type='m1.small',
kernel_id=None,
ramdisk_id=None,
block_device_mappings=None,
de... | [
"def",
"present",
"(",
"name",
",",
"image_id",
",",
"key_name",
"=",
"None",
",",
"vpc_id",
"=",
"None",
",",
"vpc_name",
"=",
"None",
",",
"security_groups",
"=",
"None",
",",
"user_data",
"=",
"None",
",",
"cloud_init",
"=",
"None",
",",
"instance_typ... | Ensure the launch configuration exists.
name
Name of the launch configuration.
image_id
AMI to use for instances. AMI must exist or creation of the launch
configuration will fail.
key_name
Name of the EC2 key pair to use for instances. Key must exist or
creation of... | [
"Ensure",
"the",
"launch",
"configuration",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_lc.py#L112-L293 | train |
saltstack/salt | salt/runners/spacewalk.py | _get_spacewalk_configuration | def _get_spacewalk_configuration(spacewalk_url=''):
'''
Return the configuration read from the master configuration
file or directory
'''
spacewalk_config = __opts__['spacewalk'] if 'spacewalk' in __opts__ else None
if spacewalk_config:
try:
for spacewalk_server, service_con... | python | def _get_spacewalk_configuration(spacewalk_url=''):
'''
Return the configuration read from the master configuration
file or directory
'''
spacewalk_config = __opts__['spacewalk'] if 'spacewalk' in __opts__ else None
if spacewalk_config:
try:
for spacewalk_server, service_con... | [
"def",
"_get_spacewalk_configuration",
"(",
"spacewalk_url",
"=",
"''",
")",
":",
"spacewalk_config",
"=",
"__opts__",
"[",
"'spacewalk'",
"]",
"if",
"'spacewalk'",
"in",
"__opts__",
"else",
"None",
"if",
"spacewalk_config",
":",
"try",
":",
"for",
"spacewalk_serv... | Return the configuration read from the master configuration
file or directory | [
"Return",
"the",
"configuration",
"read",
"from",
"the",
"master",
"configuration",
"file",
"or",
"directory"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L56-L96 | train |
saltstack/salt | salt/runners/spacewalk.py | _get_client_and_key | def _get_client_and_key(url, user, password, verbose=0):
'''
Return the client object and session key for the client
'''
session = {}
session['client'] = six.moves.xmlrpc_client.Server(url, verbose=verbose, use_datetime=True)
session['key'] = session['client'].auth.login(user, password)
ret... | python | def _get_client_and_key(url, user, password, verbose=0):
'''
Return the client object and session key for the client
'''
session = {}
session['client'] = six.moves.xmlrpc_client.Server(url, verbose=verbose, use_datetime=True)
session['key'] = session['client'].auth.login(user, password)
ret... | [
"def",
"_get_client_and_key",
"(",
"url",
",",
"user",
",",
"password",
",",
"verbose",
"=",
"0",
")",
":",
"session",
"=",
"{",
"}",
"session",
"[",
"'client'",
"]",
"=",
"six",
".",
"moves",
".",
"xmlrpc_client",
".",
"Server",
"(",
"url",
",",
"ve... | Return the client object and session key for the client | [
"Return",
"the",
"client",
"object",
"and",
"session",
"key",
"for",
"the",
"client"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L99-L107 | train |
saltstack/salt | salt/runners/spacewalk.py | _get_session | def _get_session(server):
'''
Get session and key
'''
if server in _sessions:
return _sessions[server]
config = _get_spacewalk_configuration(server)
if not config:
raise Exception('No config for \'{0}\' found on master'.format(server))
session = _get_client_and_key(config['... | python | def _get_session(server):
'''
Get session and key
'''
if server in _sessions:
return _sessions[server]
config = _get_spacewalk_configuration(server)
if not config:
raise Exception('No config for \'{0}\' found on master'.format(server))
session = _get_client_and_key(config['... | [
"def",
"_get_session",
"(",
"server",
")",
":",
"if",
"server",
"in",
"_sessions",
":",
"return",
"_sessions",
"[",
"server",
"]",
"config",
"=",
"_get_spacewalk_configuration",
"(",
"server",
")",
"if",
"not",
"config",
":",
"raise",
"Exception",
"(",
"'No ... | Get session and key | [
"Get",
"session",
"and",
"key"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L117-L135 | train |
saltstack/salt | salt/runners/spacewalk.py | api | def api(server, command, *args, **kwargs):
'''
Call the Spacewalk xmlrpc api.
CLI Example:
.. code-block:: bash
salt-run spacewalk.api spacewalk01.domain.com systemgroup.create MyGroup Description
salt-run spacewalk.api spacewalk01.domain.com systemgroup.create arguments='["MyGroup", ... | python | def api(server, command, *args, **kwargs):
'''
Call the Spacewalk xmlrpc api.
CLI Example:
.. code-block:: bash
salt-run spacewalk.api spacewalk01.domain.com systemgroup.create MyGroup Description
salt-run spacewalk.api spacewalk01.domain.com systemgroup.create arguments='["MyGroup", ... | [
"def",
"api",
"(",
"server",
",",
"command",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'arguments'",
"in",
"kwargs",
":",
"arguments",
"=",
"kwargs",
"[",
"'arguments'",
"]",
"else",
":",
"arguments",
"=",
"args",
"call",
"=",
"'{0}... | Call the Spacewalk xmlrpc api.
CLI Example:
.. code-block:: bash
salt-run spacewalk.api spacewalk01.domain.com systemgroup.create MyGroup Description
salt-run spacewalk.api spacewalk01.domain.com systemgroup.create arguments='["MyGroup", "Description"]'
State Example:
.. code-block:... | [
"Call",
"the",
"Spacewalk",
"xmlrpc",
"api",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L138-L183 | train |
saltstack/salt | salt/runners/spacewalk.py | addGroupsToKey | def addGroupsToKey(server, activation_key, groups):
'''
Add server groups to a activation key
CLI Example:
.. code-block:: bash
salt-run spacewalk.addGroupsToKey spacewalk01.domain.com 1-my-key '[group1, group2]'
'''
try:
client, key = _get_session(server)
except Exceptio... | python | def addGroupsToKey(server, activation_key, groups):
'''
Add server groups to a activation key
CLI Example:
.. code-block:: bash
salt-run spacewalk.addGroupsToKey spacewalk01.domain.com 1-my-key '[group1, group2]'
'''
try:
client, key = _get_session(server)
except Exceptio... | [
"def",
"addGroupsToKey",
"(",
"server",
",",
"activation_key",
",",
"groups",
")",
":",
"try",
":",
"client",
",",
"key",
"=",
"_get_session",
"(",
"server",
")",
"except",
"Exception",
"as",
"exc",
":",
"err_msg",
"=",
"'Exception raised when connecting to spac... | Add server groups to a activation key
CLI Example:
.. code-block:: bash
salt-run spacewalk.addGroupsToKey spacewalk01.domain.com 1-my-key '[group1, group2]' | [
"Add",
"server",
"groups",
"to",
"a",
"activation",
"key"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L186-L213 | train |
saltstack/salt | salt/runners/spacewalk.py | deleteAllGroups | def deleteAllGroups(server):
'''
Delete all server groups from Spacewalk
'''
try:
client, key = _get_session(server)
except Exception as exc:
err_msg = 'Exception raised when connecting to spacewalk server ({0}): {1}'.format(server, exc)
log.error(err_msg)
return {'E... | python | def deleteAllGroups(server):
'''
Delete all server groups from Spacewalk
'''
try:
client, key = _get_session(server)
except Exception as exc:
err_msg = 'Exception raised when connecting to spacewalk server ({0}): {1}'.format(server, exc)
log.error(err_msg)
return {'E... | [
"def",
"deleteAllGroups",
"(",
"server",
")",
":",
"try",
":",
"client",
",",
"key",
"=",
"_get_session",
"(",
"server",
")",
"except",
"Exception",
"as",
"exc",
":",
"err_msg",
"=",
"'Exception raised when connecting to spacewalk server ({0}): {1}'",
".",
"format",... | Delete all server groups from Spacewalk | [
"Delete",
"all",
"server",
"groups",
"from",
"Spacewalk"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L216-L242 | train |
saltstack/salt | salt/runners/spacewalk.py | deleteAllSystems | def deleteAllSystems(server):
'''
Delete all systems from Spacewalk
CLI Example:
.. code-block:: bash
salt-run spacewalk.deleteAllSystems spacewalk01.domain.com
'''
try:
client, key = _get_session(server)
except Exception as exc:
err_msg = 'Exception raised when c... | python | def deleteAllSystems(server):
'''
Delete all systems from Spacewalk
CLI Example:
.. code-block:: bash
salt-run spacewalk.deleteAllSystems spacewalk01.domain.com
'''
try:
client, key = _get_session(server)
except Exception as exc:
err_msg = 'Exception raised when c... | [
"def",
"deleteAllSystems",
"(",
"server",
")",
":",
"try",
":",
"client",
",",
"key",
"=",
"_get_session",
"(",
"server",
")",
"except",
"Exception",
"as",
"exc",
":",
"err_msg",
"=",
"'Exception raised when connecting to spacewalk server ({0}): {1}'",
".",
"format"... | Delete all systems from Spacewalk
CLI Example:
.. code-block:: bash
salt-run spacewalk.deleteAllSystems spacewalk01.domain.com | [
"Delete",
"all",
"systems",
"from",
"Spacewalk"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L245-L274 | train |
saltstack/salt | salt/runners/spacewalk.py | deleteAllActivationKeys | def deleteAllActivationKeys(server):
'''
Delete all activation keys from Spacewalk
CLI Example:
.. code-block:: bash
salt-run spacewalk.deleteAllActivationKeys spacewalk01.domain.com
'''
try:
client, key = _get_session(server)
except Exception as exc:
err_msg = 'E... | python | def deleteAllActivationKeys(server):
'''
Delete all activation keys from Spacewalk
CLI Example:
.. code-block:: bash
salt-run spacewalk.deleteAllActivationKeys spacewalk01.domain.com
'''
try:
client, key = _get_session(server)
except Exception as exc:
err_msg = 'E... | [
"def",
"deleteAllActivationKeys",
"(",
"server",
")",
":",
"try",
":",
"client",
",",
"key",
"=",
"_get_session",
"(",
"server",
")",
"except",
"Exception",
"as",
"exc",
":",
"err_msg",
"=",
"'Exception raised when connecting to spacewalk server ({0}): {1}'",
".",
"... | Delete all activation keys from Spacewalk
CLI Example:
.. code-block:: bash
salt-run spacewalk.deleteAllActivationKeys spacewalk01.domain.com | [
"Delete",
"all",
"activation",
"keys",
"from",
"Spacewalk"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L277-L309 | train |
saltstack/salt | salt/runners/spacewalk.py | unregister | def unregister(name, server_url):
'''
Unregister specified server from Spacewalk
CLI Example:
.. code-block:: bash
salt-run spacewalk.unregister my-test-vm spacewalk01.domain.com
'''
try:
client, key = _get_session(server_url)
except Exception as exc:
err_msg = 'E... | python | def unregister(name, server_url):
'''
Unregister specified server from Spacewalk
CLI Example:
.. code-block:: bash
salt-run spacewalk.unregister my-test-vm spacewalk01.domain.com
'''
try:
client, key = _get_session(server_url)
except Exception as exc:
err_msg = 'E... | [
"def",
"unregister",
"(",
"name",
",",
"server_url",
")",
":",
"try",
":",
"client",
",",
"key",
"=",
"_get_session",
"(",
"server_url",
")",
"except",
"Exception",
"as",
"exc",
":",
"err_msg",
"=",
"'Exception raised when connecting to spacewalk server ({0}): {1}'"... | Unregister specified server from Spacewalk
CLI Example:
.. code-block:: bash
salt-run spacewalk.unregister my-test-vm spacewalk01.domain.com | [
"Unregister",
"specified",
"server",
"from",
"Spacewalk"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L312-L340 | train |
saltstack/salt | salt/states/boto3_elasticache.py | _diff_cache_cluster | def _diff_cache_cluster(current, desired):
'''
If you need to enhance what modify_cache_cluster() considers when deciding what is to be
(or can be) updated, add it to 'modifiable' below. It's a dict mapping the param as used
in modify_cache_cluster() to that in describe_cache_clusters(). Any data fidd... | python | def _diff_cache_cluster(current, desired):
'''
If you need to enhance what modify_cache_cluster() considers when deciding what is to be
(or can be) updated, add it to 'modifiable' below. It's a dict mapping the param as used
in modify_cache_cluster() to that in describe_cache_clusters(). Any data fidd... | [
"def",
"_diff_cache_cluster",
"(",
"current",
",",
"desired",
")",
":",
"### The data formats are annoyingly (and as far as I can can tell, unnecessarily)",
"### different - we have to munge to a common format to compare...",
"if",
"current",
".",
"get",
"(",
"'SecurityGroups'",
")",... | If you need to enhance what modify_cache_cluster() considers when deciding what is to be
(or can be) updated, add it to 'modifiable' below. It's a dict mapping the param as used
in modify_cache_cluster() to that in describe_cache_clusters(). Any data fiddlery that
needs to be done to make the mappings mea... | [
"If",
"you",
"need",
"to",
"enhance",
"what",
"modify_cache_cluster",
"()",
"considers",
"when",
"deciding",
"what",
"is",
"to",
"be",
"(",
"or",
"can",
"be",
")",
"updated",
"add",
"it",
"to",
"modifiable",
"below",
".",
"It",
"s",
"a",
"dict",
"mapping... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto3_elasticache.py#L106-L161 | train |
saltstack/salt | salt/states/boto3_elasticache.py | cache_cluster_present | def cache_cluster_present(name, wait=900, security_groups=None, region=None, key=None,
keyid=None, profile=None, **args):
'''
Ensure a given cache cluster exists.
name
Name of the cache cluster (cache cluster id).
wait
Integer describing how long, in seconds, ... | python | def cache_cluster_present(name, wait=900, security_groups=None, region=None, key=None,
keyid=None, profile=None, **args):
'''
Ensure a given cache cluster exists.
name
Name of the cache cluster (cache cluster id).
wait
Integer describing how long, in seconds, ... | [
"def",
"cache_cluster_present",
"(",
"name",
",",
"wait",
"=",
"900",
",",
"security_groups",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"args",
")",
":",
... | Ensure a given cache cluster exists.
name
Name of the cache cluster (cache cluster id).
wait
Integer describing how long, in seconds, to wait for confirmation from AWS that the
resource is in the desired state. Zero meaning to return success or failure immediately
of course. ... | [
"Ensure",
"a",
"given",
"cache",
"cluster",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto3_elasticache.py#L164-L484 | train |
saltstack/salt | salt/states/boto3_elasticache.py | _diff_replication_group | def _diff_replication_group(current, desired):
'''
If you need to enhance what modify_replication_group() considers when deciding what is to be
(or can be) updated, add it to 'modifiable' below. It's a dict mapping the param as used
in modify_replication_group() to that in describe_replication_groups()... | python | def _diff_replication_group(current, desired):
'''
If you need to enhance what modify_replication_group() considers when deciding what is to be
(or can be) updated, add it to 'modifiable' below. It's a dict mapping the param as used
in modify_replication_group() to that in describe_replication_groups()... | [
"def",
"_diff_replication_group",
"(",
"current",
",",
"desired",
")",
":",
"if",
"current",
".",
"get",
"(",
"'AutomaticFailover'",
")",
"is",
"not",
"None",
":",
"current",
"[",
"'AutomaticFailoverEnabled'",
"]",
"=",
"True",
"if",
"current",
"[",
"'Automati... | If you need to enhance what modify_replication_group() considers when deciding what is to be
(or can be) updated, add it to 'modifiable' below. It's a dict mapping the param as used
in modify_replication_group() to that in describe_replication_groups(). Any data fiddlery
that needs to be done to make the ... | [
"If",
"you",
"need",
"to",
"enhance",
"what",
"modify_replication_group",
"()",
"considers",
"when",
"deciding",
"what",
"is",
"to",
"be",
"(",
"or",
"can",
"be",
")",
"updated",
"add",
"it",
"to",
"modifiable",
"below",
".",
"It",
"s",
"a",
"dict",
"map... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto3_elasticache.py#L548-L598 | train |
saltstack/salt | salt/states/boto3_elasticache.py | _diff_cache_subnet_group | def _diff_cache_subnet_group(current, desired):
'''
If you need to enhance what modify_cache_subnet_group() considers when deciding what is to be
(or can be) updated, add it to 'modifiable' below. It's a dict mapping the param as used
in modify_cache_subnet_group() to that in describe_cache_subnet_grou... | python | def _diff_cache_subnet_group(current, desired):
'''
If you need to enhance what modify_cache_subnet_group() considers when deciding what is to be
(or can be) updated, add it to 'modifiable' below. It's a dict mapping the param as used
in modify_cache_subnet_group() to that in describe_cache_subnet_grou... | [
"def",
"_diff_cache_subnet_group",
"(",
"current",
",",
"desired",
")",
":",
"modifiable",
"=",
"{",
"'CacheSubnetGroupDescription'",
":",
"'CacheSubnetGroupDescription'",
",",
"'SubnetIds'",
":",
"'SubnetIds'",
"}",
"need_update",
"=",
"{",
"}",
"for",
"m",
",",
... | If you need to enhance what modify_cache_subnet_group() considers when deciding what is to be
(or can be) updated, add it to 'modifiable' below. It's a dict mapping the param as used
in modify_cache_subnet_group() to that in describe_cache_subnet_group(). Any data fiddlery that
needs to be done to make th... | [
"If",
"you",
"need",
"to",
"enhance",
"what",
"modify_cache_subnet_group",
"()",
"considers",
"when",
"deciding",
"what",
"is",
"to",
"be",
"(",
"or",
"can",
"be",
")",
"updated",
"add",
"it",
"to",
"modifiable",
"below",
".",
"It",
"s",
"a",
"dict",
"ma... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto3_elasticache.py#L981-L1011 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.