partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
get_attribute
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...
salt/modules/boto_ec2.py
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_insta...
[ "Get", "an", "EC2", "instance", "attribute", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1213-L1268
[ "def", "get_attribute", "(", "attribute", ",", "instance_name", "=", "None", ",", "instance_id", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "filters", "=", "None", ")",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_attribute
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...
salt/modules/boto_ec2.py
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, filters=None): ''' Set an EC2 instance attribute. Returns whether the operation succeeded or not. CLI Example: .. code-block:: bash salt m...
[ "Set", "an", "EC2", "instance", "attribute", ".", "Returns", "whether", "the", "operation", "succeeded", "or", "not", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1271-L1322
[ "def", "set_attribute", "(", "attribute", ",", "attribute_value", ",", "instance_name", "=", "None", ",", "instance_id", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "filte...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_network_interface_id
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
salt/modules/boto_ec2.py
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): ''' 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...
[ "Get", "an", "Elastic", "Network", "Interface", "id", "from", "its", "name", "tag", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1325-L1351
[ "def", "get_network_interface_id", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ","...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_network_interface
Get an Elastic Network Interface. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt myminion boto_ec2.get_network_interface name=my_eni
salt/modules/boto_ec2.py
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): ''' Get an Elastic Network Interface. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt myminion boto_ec2.get_network_interface name...
[ "Get", "an", "Elastic", "Network", "Interface", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1354-L1377
[ "def", "get_network_interface", "(", "name", "=", "None", ",", "network_interface_id", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "r...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_network_interface
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']
salt/modules/boto_ec2.py
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=None, keyid=None, profile=None): ''' Create an Elastic Network Interface. .. v...
[ "Create", "an", "Elastic", "Network", "Interface", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1432-L1491
[ "def", "create_network_interface", "(", "name", ",", "subnet_id", "=", "None", ",", "subnet_name", "=", "None", ",", "private_ip_address", "=", "None", ",", "description", "=", "None", ",", "groups", "=", "None", ",", "region", "=", "None", ",", "key", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_network_interface
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']
salt/modules/boto_ec2.py
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): ''' Create an Elastic Network Interface. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash salt myminion boto_ec2.create_network_interface my_e...
[ "Create", "an", "Elastic", "Network", "Interface", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1494-L1528
[ "def", "delete_network_interface", "(", "name", "=", "None", ",", "network_interface_id", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "if", "not", "(", "name", "or"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
attach_network_interface
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
salt/modules/boto_ec2.py
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=None, profile=None): ''' Attach an Elastic Network Interface. .. versionadded:: 2016.3.0 CLI Exa...
[ "Attach", "an", "Elastic", "Network", "Interface", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1531-L1584
[ "def", "attach_network_interface", "(", "device_index", ",", "name", "=", "None", ",", "network_interface_id", "=", "None", ",", "instance_name", "=", "None", ",", "instance_id", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
modify_network_interface_attribute
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'
salt/modules/boto_ec2.py
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, profile=None): ''' Modify an attribute of an Elastic Network Interface. .. versionadded:: 2016.3.0 CLI Example: .. code-block:: bash sal...
[ "Modify", "an", "attribute", "of", "an", "Elastic", "Network", "Interface", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1626-L1694
[ "def", "modify_network_interface_attribute", "(", "name", "=", "None", ",", "network_interface_id", "=", "None", ",", "attr", "=", "None", ",", "value", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "pr...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_all_volumes
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 ...
salt/modules/boto_ec2.py
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): ''' Get a list of all EBS volumes, optionally filtered by provided 'filters' param .. versionadded:: 2016.11.0 volume_ids (list) - Optional list of volume...
[ "Get", "a", "list", "of", "all", "EBS", "volumes", "optionally", "filtered", "by", "provided", "filters", "param" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1697-L1749
[ "def", "get_all_volumes", "(", "volume_ids", "=", "None", ",", "filters", "=", "None", ",", "return_objs", "=", "False", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_volumes_tags
.. 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...
salt/modules/boto_ec2.py
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): ''' .. 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...
[ "..", "versionadded", "::", "2016", ".", "11", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1752-L1876
[ "def", "set_volumes_tags", "(", "tag_maps", ",", "authoritative", "=", "False", ",", "dry_run", "=", "False", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'su...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_all_tags
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 ...
salt/modules/boto_ec2.py
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): ''' 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...
[ "Describe", "all", "tags", "matching", "the", "filter", "criteria", "or", "all", "tags", "in", "the", "account", "otherwise", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1879-L1909
[ "def", "get_all_tags", "(", "filters", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_tags
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...
salt/modules/boto_ec2.py
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): ''' 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. ...
[ "Create", "new", "metadata", "tags", "for", "the", "specified", "resource", "ids", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1912-L1942
[ "def", "create_tags", "(", "resource_ids", ",", "tags", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "if", "not", "isinstance", "(", "resource_ids", ",", "list", ")", ":", "res...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
detach_volume
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 ...
salt/modules/boto_ec2.py
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, 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...
[ "Detach", "an", "EBS", "volume", "from", "an", "EC2", "instance", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L1982-L2024
[ "def", "detach_volume", "(", "volume_id", ",", "instance_id", "=", "None", ",", "device", "=", "None", ",", "force", "=", "False", ",", "wait_for_detachement", "=", "False", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_volume
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...
salt/modules/boto_ec2.py
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 ...
[ "Detach", "an", "EBS", "volume", "from", "an", "EC2", "instance", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L2027-L2061
[ "def", "delete_volume", "(", "volume_id", ",", "instance_id", "=", "None", ",", "device", "=", "None", ",", "force", "=", "False", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
attach_volume
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) ...
salt/modules/boto_ec2.py
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): ''' 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...
[ "Attach", "an", "EBS", "volume", "to", "an", "EC2", "instance", ".", ".." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L2079-L2107
[ "def", "attach_volume", "(", "volume_id", ",", "instance_id", ",", "device", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_volume
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 ...
salt/modules/boto_ec2.py
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=False, region=None, key=None, keyid=None, profile=None): ''' Create an EBS volume to an availability zone. .. zone_name ...
[ "Create", "an", "EBS", "volume", "to", "an", "availability", "zone", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ec2.py#L2110-L2169
[ "def", "create_volume", "(", "zone_name", ",", "size", "=", "None", ",", "snapshot_id", "=", "None", ",", "volume_type", "=", "None", ",", "iops", "=", "None", ",", "encrypted", "=", "False", ",", "kms_key_id", "=", "None", ",", "wait_for_creation", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
revision
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: ...
salt/modules/hg.py
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): ''' 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...
[ "Returns", "the", "long", "hash", "of", "a", "given", "identifier", "(", "hash", "branch", "tag", "HEAD", "etc", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/hg.py#L33-L72
[ "def", "revision", "(", "cwd", ",", "rev", "=", "'tip'", ",", "short", "=", "False", ",", "user", "=", "None", ")", ":", "cmd", "=", "[", "'hg'", ",", "'id'", ",", "'-i'", ",", "'--debug'", "if", "not", "short", "else", "''", ",", "'-r'", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
describe
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...
salt/modules/hg.py
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): ''' 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...
[ "Mimic", "git", "describe", "and", "return", "an", "identifier", "for", "the", "given", "revision" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/hg.py#L75-L108
[ "def", "describe", "(", "cwd", ",", "rev", "=", "'tip'", ",", "user", "=", "None", ")", ":", "cmd", "=", "[", "'hg'", ",", "'log'", ",", "'-r'", ",", "'{0}'", ".", "format", "(", "rev", ")", ",", "'--template'", ",", "\"'{{latesttag}}-{{latesttagdistan...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
archive
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...
salt/modules/hg.py
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): ''' 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 ...
[ "Export", "a", "tarball", "from", "the", "repository" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/hg.py#L111-L156
[ "def", "archive", "(", "cwd", ",", "output", ",", "rev", "=", "'tip'", ",", "fmt", "=", "None", ",", "prefix", "=", "None", ",", "user", "=", "None", ")", ":", "cmd", "=", "[", "'hg'", ",", "'archive'", ",", "'{0}'", ".", "format", "(", "output",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
pull
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 ...
salt/modules/hg.py
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): ''' 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...
[ "Perform", "a", "pull", "on", "the", "given", "repository" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/hg.py#L159-L201
[ "def", "pull", "(", "cwd", ",", "opts", "=", "None", ",", "user", "=", "None", ",", "identity", "=", "None", ",", "repository", "=", "None", ")", ":", "cmd", "=", "[", "'hg'", ",", "'pull'", "]", "if", "identity", ":", "cmd", ".", "extend", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update
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...
salt/modules/hg.py
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): ''' 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: ...
[ "Update", "to", "a", "given", "revision" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/hg.py#L204-L236
[ "def", "update", "(", "cwd", ",", "rev", ",", "force", "=", "False", ",", "user", "=", "None", ")", ":", "cmd", "=", "[", "'hg'", ",", "'update'", ",", "'{0}'", ".", "format", "(", "rev", ")", "]", "if", "force", ":", "cmd", ".", "append", "(",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
status
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...
salt/modules/hg.py
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): ''' 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: ...
[ "Show", "changed", "files", "of", "the", "given", "repository" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/hg.py#L282-L329
[ "def", "status", "(", "cwd", ",", "opts", "=", "None", ",", "user", "=", "None", ")", ":", "def", "_status", "(", "cwd", ")", ":", "cmd", "=", "[", "'hg'", ",", "'status'", "]", "if", "opts", ":", "for", "opt", "in", "opts", ".", "split", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
validate
Validate the beacon configuration
salt/beacons/network_settings.py
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): ''' 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...
[ "Validate", "the", "beacon", "configuration" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/network_settings.py#L50-L73
[ "def", "validate", "(", "config", ")", ":", "if", "not", "isinstance", "(", "config", ",", "list", ")", ":", "return", "False", ",", "(", "'Configuration for network_settings '", "'beacon must be a list.'", ")", "else", ":", "_config", "=", "{", "}", "list", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_copy_interfaces_info
Return a dictionary with a copy of each interface attributes in ATTRS
salt/beacons/network_settings.py
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): ''' 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...
[ "Return", "a", "dictionary", "with", "a", "copy", "of", "each", "interface", "attributes", "in", "ATTRS" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/network_settings.py#L76-L91
[ "def", "_copy_interfaces_info", "(", "interfaces", ")", ":", "ret", "=", "{", "}", "for", "interface", "in", "interfaces", ":", "_interface_attrs_cpy", "=", "set", "(", ")", "for", "attr", "in", "ATTRS", ":", "if", "attr", "in", "interfaces", "[", "interfa...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
beacon
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 ...
salt/beacons/network_settings.py
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): ''' 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...
[ "Watch", "for", "changes", "on", "network", "settings" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/network_settings.py#L94-L213
[ "def", "beacon", "(", "config", ")", ":", "_config", "=", "{", "}", "list", "(", "map", "(", "_config", ".", "update", ",", "config", ")", ")", "ret", "=", "[", "]", "interfaces", "=", "[", "]", "expanded_config", "=", "{", "}", "global", "LAST_STA...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_
Set a key/value pair in memcached
salt/sdb/memcached.py
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): ''' 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)
[ "Set", "a", "key", "/", "value", "pair", "in", "memcached" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/sdb/memcached.py#L62-L68
[ "def", "set_", "(", "key", ",", "value", ",", "profile", "=", "None", ")", ":", "conn", "=", "salt", ".", "utils", ".", "memcached", ".", "get_conn", "(", "profile", ")", "time", "=", "profile", ".", "get", "(", "'expire'", ",", "DEFAULT_EXPIRATION", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get
Get a value from memcached
salt/sdb/memcached.py
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): ''' Get a value from memcached ''' conn = salt.utils.memcached.get_conn(profile) return salt.utils.memcached.get(conn, key)
[ "Get", "a", "value", "from", "memcached" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/sdb/memcached.py#L71-L76
[ "def", "get", "(", "key", ",", "profile", "=", "None", ")", ":", "conn", "=", "salt", ".", "utils", ".", "memcached", ".", "get_conn", "(", "profile", ")", "return", "salt", ".", "utils", ".", "memcached", ".", "get", "(", "conn", ",", "key", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
managed
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...
salt/states/proxy.py
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'): ''' 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...
[ "Manages", "proxy", "settings", "for", "this", "mininon" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/proxy.py#L40-L144
[ "def", "managed", "(", "name", ",", "port", ",", "services", "=", "None", ",", "user", "=", "None", ",", "password", "=", "None", ",", "bypass_domains", "=", "None", ",", "network_service", "=", "'Ethernet'", ")", ":", "ret", "=", "{", "'name'", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltSupportModule._get_archive_name
Create default archive name. :return:
salt/modules/saltsupport.py
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): ''' 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) ...
[ "Create", "default", "archive", "name", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltsupport.py#L109-L127
[ "def", "_get_archive_name", "(", "self", ",", "archname", "=", "None", ")", ":", "archname", "=", "re", ".", "sub", "(", "'[^a-z0-9]'", ",", "''", ",", "(", "archname", "or", "''", ")", ".", "lower", "(", ")", ")", "or", "'support'", "for", "grain", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltSupportModule.archives
Get list of existing archives. :return:
salt/modules/saltsupport.py
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): ''' 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()[-...
[ "Get", "list", "of", "existing", "archives", ".", ":", "return", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltsupport.py#L142-L154
[ "def", "archives", "(", "self", ")", ":", "arc_files", "=", "[", "]", "tmpdir", "=", "tempfile", ".", "gettempdir", "(", ")", "for", "filename", "in", "os", ".", "listdir", "(", "tmpdir", ")", ":", "mtc", "=", "re", ".", "match", "(", "r'\\w+-\\w+-\\...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltSupportModule.last_archive
Get the last available archive :return:
salt/modules/saltsupport.py
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): ''' 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
[ "Get", "the", "last", "available", "archive", ":", "return", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltsupport.py#L157-L166
[ "def", "last_archive", "(", "self", ")", ":", "archives", "=", "{", "}", "for", "archive", "in", "self", ".", "archives", "(", ")", ":", "archives", "[", "int", "(", "archive", ".", "split", "(", "'.'", ")", "[", "0", "]", ".", "split", "(", "'-'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltSupportModule.delete_archives
Delete archives :return:
salt/modules/saltsupport.py
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): ''' Delete archives :return: ''' # Remove paths _archives = [] for archive in archives: _archives.append(os.path.basename(archive)) archives = _archives[:] ret = {'files': {}, 'errors': {}} ...
[ "Delete", "archives", ":", "return", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltsupport.py#L169-L193
[ "def", "delete_archives", "(", "self", ",", "*", "archives", ")", ":", "# Remove paths", "_archives", "=", "[", "]", "for", "archive", "in", "archives", ":", "_archives", ".", "append", "(", "os", ".", "path", ".", "basename", "(", "archive", ")", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltSupportModule.format_sync_stats
Format stats of the sync output. :param cnt: :return:
salt/modules/saltsupport.py
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): ''' 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): ...
[ "Format", "stats", "of", "the", "sync", "output", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltsupport.py#L195-L219
[ "def", "format_sync_stats", "(", "self", ",", "cnt", ")", ":", "stats", "=", "salt", ".", "utils", ".", "odict", ".", "OrderedDict", "(", ")", "if", "cnt", ".", "get", "(", "'retcode'", ")", "==", "salt", ".", "defaults", ".", "exitcodes", ".", "EX_O...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltSupportModule.sync
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=...
salt/modules/saltsupport.py
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): ''' 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...
[ "Sync", "the", "latest", "archive", "to", "the", "host", "on", "given", "location", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltsupport.py#L223-L298
[ "def", "sync", "(", "self", ",", "group", ",", "name", "=", "None", ",", "host", "=", "None", ",", "location", "=", "None", ",", "move", "=", "False", ",", "all", "=", "False", ")", ":", "tfh", ",", "tfn", "=", "tempfile", ".", "mkstemp", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltSupportModule.run
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...
salt/modules/saltsupport.py
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'): ''' Run Salt Support on the minion. profile Set available profile name. Default is "default". pillar Set available profile from the pillars. archive Override archi...
[ "Run", "Salt", "Support", "on", "the", "minion", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/saltsupport.py#L301-L350
[ "def", "run", "(", "self", ",", "profile", "=", "'default'", ",", "pillar", "=", "None", ",", "archive", "=", "None", ",", "output", "=", "'nested'", ")", ":", "class", "outputswitch", "(", "object", ")", ":", "'''\n Output switcher on context\n ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
BufferedReader.next
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.
salt/utils/filebuffer.py
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): ''' 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 ...
[ "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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/filebuffer.py#L74-L99
[ "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", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ext_pillar
Check vmware/vcenter for all data
salt/pillar/vmware_pillar.py
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): ''' Check vmware/vcenter for all data ''' vmware_pillar = {} host = None username = None password = None property_types = [] property_name = 'name' protocol = None port = None ...
[ "Check", "vmware", "/", "vcenter", "for", "all", "data" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/vmware_pillar.py#L177-L470
[ "def", "ext_pillar", "(", "minion_id", ",", "pillar", ",", "# pylint: disable=W0613", "*", "*", "kwargs", ")", ":", "vmware_pillar", "=", "{", "}", "host", "=", "None", "username", "=", "None", "password", "=", "None", "property_types", "=", "[", "]", "pro...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_recurse_config_to_dict
helper function to recurse through a vim object and attempt to return all child objects
salt/pillar/vmware_pillar.py
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): ''' 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...
[ "helper", "function", "to", "recurse", "through", "a", "vim", "object", "and", "attempt", "to", "return", "all", "child", "objects" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/vmware_pillar.py#L473-L492
[ "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...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_crawl_attribute
helper function to crawl an attribute specified for retrieval
salt/pillar/vmware_pillar.py
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): ''' 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...
[ "helper", "function", "to", "crawl", "an", "attribute", "specified", "for", "retrieval" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/vmware_pillar.py#L495-L517
[ "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",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_serializer
helper function to serialize some objects for prettier return
salt/pillar/vmware_pillar.py
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): ''' 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
[ "helper", "function", "to", "serialize", "some", "objects", "for", "prettier", "return" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/vmware_pillar.py#L520-L529
[ "def", "_serializer", "(", "obj", ")", ":", "import", "datetime", "if", "isinstance", "(", "obj", ",", "datetime", ".", "datetime", ")", ":", "if", "obj", ".", "utcoffset", "(", ")", "is", "not", "None", ":", "obj", "=", "obj", "-", "obj", ".", "ut...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
modify
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);'
salt/modules/sqlite3.py
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): ''' 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", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sqlite3.py#L57-L74
[ "def", "modify", "(", "db", "=", "None", ",", "sql", "=", "None", ")", ":", "cur", "=", "_connect", "(", "db", ")", "if", "not", "cur", ":", "return", "False", "cur", ".", "execute", "(", "sql", ")", "return", "True" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
fetch
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;'
salt/modules/sqlite3.py
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): ''' 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 =...
[ "Retrieve", "data", "from", "an", "sqlite3", "db", "(", "returns", "all", "rows", "be", "careful!", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sqlite3.py#L77-L94
[ "def", "fetch", "(", "db", "=", "None", ",", "sql", "=", "None", ")", ":", "cur", "=", "_connect", "(", "db", ")", "if", "not", "cur", ":", "return", "False", "cur", ".", "execute", "(", "sql", ")", "rows", "=", "cur", ".", "fetchall", "(", ")"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
tables
Show all tables in the database CLI Example: .. code-block:: bash salt '*' sqlite3.tables /root/test.db
salt/modules/sqlite3.py
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): ''' 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;" ...
[ "Show", "all", "tables", "in", "the", "database" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sqlite3.py#L97-L116
[ "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", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
indices
Show all indices in the database CLI Example: .. code-block:: bash salt '*' sqlite3.indices /root/test.db
salt/modules/sqlite3.py
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): ''' 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;"...
[ "Show", "all", "indices", "in", "the", "database" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sqlite3.py#L119-L138
[ "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",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
targets
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``.
salt/roster/cache.py
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 ''' 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...
[ "Return", "the", "targets", "from", "the", "Salt", "Masters", "minion", "cache", ".", "All", "targets", "and", "matchers", "are", "supported", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/roster/cache.py#L113-L159
[ "def", "targets", "(", "tgt", ",", "tgt_type", "=", "'glob'", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=W0613", "minions", "=", "salt", ".", "utils", ".", "minions", ".", "CkMinions", "(", "__opts__", ")", "_res", "=", "minions", ".", "check_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_key_dir
return the location of the GPG key directory
salt/renderers/gpg.py
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(): ''' 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( ...
[ "return", "the", "location", "of", "the", "GPG", "key", "directory" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/gpg.py#L307-L326
[ "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__", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_decrypt_ciphertext
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.
salt/renderers/gpg.py
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): ''' 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...
[ "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...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/gpg.py#L329-L363
[ "def", "_decrypt_ciphertext", "(", "cipher", ")", ":", "try", ":", "cipher", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_unicode", "(", "cipher", ")", ".", "replace", "(", "r'\\n'", ",", "'\\n'", ")", "except", "UnicodeDecodeError", ":", "# cip...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_decrypt_object
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.
salt/renderers/gpg.py
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): ''' 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): ...
[ "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", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/gpg.py#L378-L399
[ "def", "_decrypt_object", "(", "obj", ",", "translate_newlines", "=", "False", ")", ":", "if", "salt", ".", "utils", ".", "stringio", ".", "is_readable", "(", "obj", ")", ":", "return", "_decrypt_object", "(", "obj", ".", "getvalue", "(", ")", ",", "tran...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
render
Create a gpg object given a gpg_keydir, and then use it to try to decrypt the data to be rendered.
salt/renderers/gpg.py
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): ''' 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_...
[ "Create", "a", "gpg", "object", "given", "a", "gpg_keydir", "and", "then", "use", "it", "to", "try", "to", "decrypt", "the", "data", "to", "be", "rendered", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/gpg.py#L402-L412
[ "def", "render", "(", "gpg_data", ",", "saltenv", "=", "'base'", ",", "sls", "=", "''", ",", "argline", "=", "''", ",", "*", "*", "kwargs", ")", ":", "if", "not", "_get_gpg_exec", "(", ")", ":", "raise", "SaltRenderError", "(", "'GPG unavailable'", ")"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
validate
Validate the beacon configuration
salt/beacons/telegram_bot_msg.py
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): ''' 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...
[ "Validate", "the", "beacon", "configuration" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/telegram_bot_msg.py#L35-L55
[ "def", "validate", "(", "config", ")", ":", "if", "not", "isinstance", "(", "config", ",", "list", ")", ":", "return", "False", ",", "(", "'Configuration for telegram_bot_msg '", "'beacon must be a list.'", ")", "_config", "=", "{", "}", "list", "(", "map", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
beacon
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...
salt/beacons/telegram_bot_msg.py
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): ''' 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...
[ "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", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/telegram_bot_msg.py#L58-L110
[ "def", "beacon", "(", "config", ")", ":", "_config", "=", "{", "}", "list", "(", "map", "(", "_config", ".", "update", ",", "config", ")", ")", "log", ".", "debug", "(", "'telegram_bot_msg beacon starting'", ")", "ret", "=", "[", "]", "output", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
top
Look up top data in Cobbler for a minion.
salt/tops/cobbler.py
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): ''' 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...
[ "Look", "up", "top", "data", "in", "Cobbler", "for", "a", "minion", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/tops/cobbler.py#L39-L61
[ "def", "top", "(", "*", "*", "kwargs", ")", ":", "url", "=", "__opts__", "[", "'cobbler.url'", "]", "user", "=", "__opts__", "[", "'cobbler.user'", "]", "password", "=", "__opts__", "[", "'cobbler.password'", "]", "minion_id", "=", "kwargs", "[", "'opts'",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
stats
Returns statistics about the locate database CLI Example: .. code-block:: bash salt '*' locate.stats
salt/modules/locate.py
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(): ''' 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...
[ "Returns", "statistics", "about", "the", "locate", "database" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/locate.py#L44-L63
[ "def", "stats", "(", ")", ":", "ret", "=", "{", "}", "cmd", "=", "'locate -S'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", ".", "splitlines", "(", ")", "for", "line", "in", "out", ":", "comps", "=", "line", ".", "strip", "(",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
locate
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...
salt/modules/locate.py
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): ''' 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...
[ "Performs", "a", "file", "lookup", ".", "Valid", "options", "(", "and", "their", "defaults", ")", "are", "::" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/locate.py#L81-L127
[ "def", "locate", "(", "pattern", ",", "database", "=", "''", ",", "limit", "=", "0", ",", "*", "*", "kwargs", ")", ":", "options", "=", "''", "toggles", "=", "{", "'basename'", ":", "'b'", ",", "'count'", ":", "'c'", ",", "'existing'", ":", "'e'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
init
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...
salt/states/lxd.py
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, storage_pool=None, done_file='%SALT_CONFIG_DIR%/lxd_initialized'): ''' Initalizes the LXD Daemon, as LXD doesn't tell if its initia...
[ "Initalizes", "the", "LXD", "Daemon", "as", "LXD", "doesn", "t", "tell", "if", "its", "initialized", "we", "touch", "the", "the", "done_file", "and", "check", "if", "it", "exist", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lxd.py#L54-L132
[ "def", "init", "(", "name", ",", "storage_backend", "=", "'dir'", ",", "trust_password", "=", "None", ",", "network_address", "=", "None", ",", "network_port", "=", "None", ",", "storage_create_device", "=", "None", ",", "storage_create_loop", "=", "None", ","...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
config_managed
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...
salt/states/lxd.py
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): ''' 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...
[ "Manage", "a", "LXD", "Server", "config", "setting", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lxd.py#L135-L201
[ "def", "config_managed", "(", "name", ",", "value", ",", "force_password", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'value'", ":", "value", "if", "name", "!=", "'core.trust_password'", "else", "True", ",", "'force_password'", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
authenticate
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: ...
salt/states/lxd.py
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): ''' 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...
[ "Authenticate", "with", "a", "remote", "peer", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lxd.py#L204-L282
[ "def", "authenticate", "(", "name", ",", "remote_addr", ",", "password", ",", "cert", ",", "key", ",", "verify_cert", "=", "True", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'remote_addr'", ":", "remote_addr", ",", "'cert'", ":", "cert", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
boot_device
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 ...
salt/states/ipmi.py
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): ''' 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...
[ "Request", "power", "state", "change" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ipmi.py#L54-L93
[ "def", "boot_device", "(", "name", "=", "'default'", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "org", "=", "__salt__"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
power
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 ...
salt/states/ipmi.py
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): ''' 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...
[ "Request", "power", "state", "change" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ipmi.py#L96-L147
[ "def", "power", "(", "name", "=", "'power_on'", ",", "wait", "=", "300", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
user_present
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 ...
salt/states/ipmi.py
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 us...
[ "Ensure", "IPMI", "user", "and", "user", "privileges", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ipmi.py#L150-L257
[ "def", "user_present", "(", "name", ",", "uid", ",", "password", ",", "channel", "=", "14", ",", "callback", "=", "False", ",", "link_auth", "=", "True", ",", "ipmi_msg", "=", "True", ",", "privilege_level", "=", "'administrator'", ",", "*", "*", "kwargs...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
user_absent
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 - ...
salt/states/ipmi.py
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): ''' 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...
[ "Remove", "user", "Delete", "all", "user", "(", "uid", ")", "records", "having", "the", "matching", "name", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ipmi.py#L260-L297
[ "def", "user_absent", "(", "name", ",", "channel", "=", "14", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "user_id_list...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
mmatch
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.
salt/matchers/cache_match.py
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): ''' Helper function to search for minions in master caches If 'greedy' return accepted minions that matched by the condition or absent in the c...
[ "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",...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/matchers/cache_match.py#L15-L34
[ "def", "mmatch", "(", "expr", ",", "delimiter", ",", "greedy", ",", "search_type", ",", "regex_match", "=", "False", ",", "exact_match", "=", "False", ",", "opts", "=", "None", ")", ":", "if", "not", "opts", ":", "opts", "=", "__opts__", "ckminions", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
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...
salt/states/boto_lc.py
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_type='m1.small', kernel_id=None, ramdisk_id=None, block_device_mappings=None, de...
[ "Ensure", "the", "launch", "configuration", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_lc.py#L112-L293
[ "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...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_spacewalk_configuration
Return the configuration read from the master configuration file or directory
salt/runners/spacewalk.py
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=''): ''' 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...
[ "Return", "the", "configuration", "read", "from", "the", "master", "configuration", "file", "or", "directory" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L56-L96
[ "def", "_get_spacewalk_configuration", "(", "spacewalk_url", "=", "''", ")", ":", "spacewalk_config", "=", "__opts__", "[", "'spacewalk'", "]", "if", "'spacewalk'", "in", "__opts__", "else", "None", "if", "spacewalk_config", ":", "try", ":", "for", "spacewalk_serv...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_client_and_key
Return the client object and session key for the client
salt/runners/spacewalk.py
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): ''' 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...
[ "Return", "the", "client", "object", "and", "session", "key", "for", "the", "client" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L99-L107
[ "def", "_get_client_and_key", "(", "url", ",", "user", ",", "password", ",", "verbose", "=", "0", ")", ":", "session", "=", "{", "}", "session", "[", "'client'", "]", "=", "six", ".", "moves", ".", "xmlrpc_client", ".", "Server", "(", "url", ",", "ve...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_session
Get session and key
salt/runners/spacewalk.py
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): ''' 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['...
[ "Get", "session", "and", "key" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L117-L135
[ "def", "_get_session", "(", "server", ")", ":", "if", "server", "in", "_sessions", ":", "return", "_sessions", "[", "server", "]", "config", "=", "_get_spacewalk_configuration", "(", "server", ")", "if", "not", "config", ":", "raise", "Exception", "(", "'No ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
api
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:...
salt/runners/spacewalk.py
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): ''' 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", ...
[ "Call", "the", "Spacewalk", "xmlrpc", "api", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L138-L183
[ "def", "api", "(", "server", ",", "command", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "'arguments'", "in", "kwargs", ":", "arguments", "=", "kwargs", "[", "'arguments'", "]", "else", ":", "arguments", "=", "args", "call", "=", "'{0}...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
addGroupsToKey
Add server groups to a activation key CLI Example: .. code-block:: bash salt-run spacewalk.addGroupsToKey spacewalk01.domain.com 1-my-key '[group1, group2]'
salt/runners/spacewalk.py
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): ''' 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...
[ "Add", "server", "groups", "to", "a", "activation", "key" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L186-L213
[ "def", "addGroupsToKey", "(", "server", ",", "activation_key", ",", "groups", ")", ":", "try", ":", "client", ",", "key", "=", "_get_session", "(", "server", ")", "except", "Exception", "as", "exc", ":", "err_msg", "=", "'Exception raised when connecting to spac...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
deleteAllGroups
Delete all server groups from Spacewalk
salt/runners/spacewalk.py
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): ''' 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...
[ "Delete", "all", "server", "groups", "from", "Spacewalk" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L216-L242
[ "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",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
deleteAllSystems
Delete all systems from Spacewalk CLI Example: .. code-block:: bash salt-run spacewalk.deleteAllSystems spacewalk01.domain.com
salt/runners/spacewalk.py
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): ''' 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...
[ "Delete", "all", "systems", "from", "Spacewalk" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L245-L274
[ "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"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
deleteAllActivationKeys
Delete all activation keys from Spacewalk CLI Example: .. code-block:: bash salt-run spacewalk.deleteAllActivationKeys spacewalk01.domain.com
salt/runners/spacewalk.py
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): ''' 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...
[ "Delete", "all", "activation", "keys", "from", "Spacewalk" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L277-L309
[ "def", "deleteAllActivationKeys", "(", "server", ")", ":", "try", ":", "client", ",", "key", "=", "_get_session", "(", "server", ")", "except", "Exception", "as", "exc", ":", "err_msg", "=", "'Exception raised when connecting to spacewalk server ({0}): {1}'", ".", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
unregister
Unregister specified server from Spacewalk CLI Example: .. code-block:: bash salt-run spacewalk.unregister my-test-vm spacewalk01.domain.com
salt/runners/spacewalk.py
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): ''' 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...
[ "Unregister", "specified", "server", "from", "Spacewalk" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/spacewalk.py#L312-L340
[ "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}'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_diff_cache_cluster
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...
salt/states/boto3_elasticache.py
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): ''' 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...
[ "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...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto3_elasticache.py#L106-L161
[ "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'", ")",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cache_cluster_present
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. ...
salt/states/boto3_elasticache.py
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, ...
[ "Ensure", "a", "given", "cache", "cluster", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto3_elasticache.py#L164-L484
[ "def", "cache_cluster_present", "(", "name", ",", "wait", "=", "900", ",", "security_groups", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "args", ")", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_diff_replication_group
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 ...
salt/states/boto3_elasticache.py
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 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()...
[ "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...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto3_elasticache.py#L548-L598
[ "def", "_diff_replication_group", "(", "current", ",", "desired", ")", ":", "if", "current", ".", "get", "(", "'AutomaticFailover'", ")", "is", "not", "None", ":", "current", "[", "'AutomaticFailoverEnabled'", "]", "=", "True", "if", "current", "[", "'Automati...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_diff_cache_subnet_group
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...
salt/states/boto3_elasticache.py
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): ''' 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...
[ "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...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto3_elasticache.py#L981-L1011
[ "def", "_diff_cache_subnet_group", "(", "current", ",", "desired", ")", ":", "modifiable", "=", "{", "'CacheSubnetGroupDescription'", ":", "'CacheSubnetGroupDescription'", ",", "'SubnetIds'", ":", "'SubnetIds'", "}", "need_update", "=", "{", "}", "for", "m", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cache_subnet_group_present
Ensure cache subnet group exists. name A name for the cache subnet group. This value is stored as a lowercase string. Constraints: Must contain no more than 255 alphanumeric characters or hyphens. subnets A list of VPC subnets (IDs, Names, or a mix) for the cache subnet group. Ca...
salt/states/boto3_elasticache.py
def cache_subnet_group_present(name, subnets=None, region=None, key=None, keyid=None, profile=None, **args): ''' Ensure cache subnet group exists. name A name for the cache subnet group. This value is stored as a lowercase string. Constraints: Must contain no...
def cache_subnet_group_present(name, subnets=None, region=None, key=None, keyid=None, profile=None, **args): ''' Ensure cache subnet group exists. name A name for the cache subnet group. This value is stored as a lowercase string. Constraints: Must contain no...
[ "Ensure", "cache", "subnet", "group", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto3_elasticache.py#L1014-L1101
[ "def", "cache_subnet_group_present", "(", "name", ",", "subnets", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "args", ")", ":", "ret", "=", "{", "'name'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cache_subnet_group_absent
Ensure a given cache subnet group is deleted. name Name of the cache subnet group. CacheSubnetGroupName A name for the cache subnet group. Note: In general this parameter is not needed, as 'name' is used if it's not provided. region Region to connect to. key ...
salt/states/boto3_elasticache.py
def cache_subnet_group_absent(name, region=None, key=None, keyid=None, profile=None, **args): ''' Ensure a given cache subnet group is deleted. name Name of the cache subnet group. CacheSubnetGroupName A name for the cache subnet group. Note: In general this parameter is not n...
def cache_subnet_group_absent(name, region=None, key=None, keyid=None, profile=None, **args): ''' Ensure a given cache subnet group is deleted. name Name of the cache subnet group. CacheSubnetGroupName A name for the cache subnet group. Note: In general this parameter is not n...
[ "Ensure", "a", "given", "cache", "subnet", "group", "is", "deleted", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto3_elasticache.py#L1104-L1149
[ "def", "cache_subnet_group_absent", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cache_parameter_group_present
Ensure cache parameter group exists. name A name for the cache parameter group. CacheParameterGroupName A name for the cache parameter group. Note: In general this parameter is not needed, as 'name' is used if it's not provided. CacheParameterGroupFamily The name of the ...
salt/states/boto3_elasticache.py
def cache_parameter_group_present(name, region=None, key=None, keyid=None, profile=None, **args): ''' Ensure cache parameter group exists. name A name for the cache parameter group. CacheParameterGroupName A name for the cache parameter group. Note: In general this parameter i...
def cache_parameter_group_present(name, region=None, key=None, keyid=None, profile=None, **args): ''' Ensure cache parameter group exists. name A name for the cache parameter group. CacheParameterGroupName A name for the cache parameter group. Note: In general this parameter i...
[ "Ensure", "cache", "parameter", "group", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto3_elasticache.py#L1152-L1277
[ "def", "cache_parameter_group_present", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_find_identity_pool_ids
Given identity pool name (or optionally a pool_id and name will be ignored), find and return list of matching identity pool id's.
salt/modules/boto_cognitoidentity.py
def _find_identity_pool_ids(name, pool_id, conn): ''' Given identity pool name (or optionally a pool_id and name will be ignored), find and return list of matching identity pool id's. ''' ids = [] if pool_id is None: for pools in __utils__['boto3.paged_call'](conn.list_identity_pools, ...
def _find_identity_pool_ids(name, pool_id, conn): ''' Given identity pool name (or optionally a pool_id and name will be ignored), find and return list of matching identity pool id's. ''' ids = [] if pool_id is None: for pools in __utils__['boto3.paged_call'](conn.list_identity_pools, ...
[ "Given", "identity", "pool", "name", "(", "or", "optionally", "a", "pool_id", "and", "name", "will", "be", "ignored", ")", "find", "and", "return", "list", "of", "matching", "identity", "pool", "id", "s", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cognitoidentity.py#L126-L141
[ "def", "_find_identity_pool_ids", "(", "name", ",", "pool_id", ",", "conn", ")", ":", "ids", "=", "[", "]", "if", "pool_id", "is", "None", ":", "for", "pools", "in", "__utils__", "[", "'boto3.paged_call'", "]", "(", "conn", ".", "list_identity_pools", ",",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
describe_identity_pools
Given an identity pool name, (optionally if an identity pool id is given, the given name will be ignored) Returns a list of matched identity pool name's pool properties CLI Example: .. code-block:: bash salt myminion boto_cognitoidentity.describe_identity_pools my_id_pool_name salt m...
salt/modules/boto_cognitoidentity.py
def describe_identity_pools(IdentityPoolName, IdentityPoolId=None, region=None, key=None, keyid=None, profile=None): ''' Given an identity pool name, (optionally if an identity pool id is given, the given name will be ignored) Returns a list of matched identity pool name's pool properti...
def describe_identity_pools(IdentityPoolName, IdentityPoolId=None, region=None, key=None, keyid=None, profile=None): ''' Given an identity pool name, (optionally if an identity pool id is given, the given name will be ignored) Returns a list of matched identity pool name's pool properti...
[ "Given", "an", "identity", "pool", "name", "(", "optionally", "if", "an", "identity", "pool", "id", "is", "given", "the", "given", "name", "will", "be", "ignored", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cognitoidentity.py#L144-L176
[ "def", "describe_identity_pools", "(", "IdentityPoolName", ",", "IdentityPoolId", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_identity_pool
Creates a new identity pool. All parameters except for IdentityPoolName is optional. SupportedLoginProviders should be a dictionary mapping provider names to provider app IDs. OpenIdConnectProviderARNs should be a list of OpenID Connect provider ARNs. Returns the created identity pool if successful ...
salt/modules/boto_cognitoidentity.py
def create_identity_pool(IdentityPoolName, AllowUnauthenticatedIdentities=False, SupportedLoginProviders=None, DeveloperProviderName=None, OpenIdConnectProviderARNs=None, region=None, key=None, k...
def create_identity_pool(IdentityPoolName, AllowUnauthenticatedIdentities=False, SupportedLoginProviders=None, DeveloperProviderName=None, OpenIdConnectProviderARNs=None, region=None, key=None, k...
[ "Creates", "a", "new", "identity", "pool", ".", "All", "parameters", "except", "for", "IdentityPoolName", "is", "optional", ".", "SupportedLoginProviders", "should", "be", "a", "dictionary", "mapping", "provider", "names", "to", "provider", "app", "IDs", ".", "O...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cognitoidentity.py#L179-L218
[ "def", "create_identity_pool", "(", "IdentityPoolName", ",", "AllowUnauthenticatedIdentities", "=", "False", ",", "SupportedLoginProviders", "=", "None", ",", "DeveloperProviderName", "=", "None", ",", "OpenIdConnectProviderARNs", "=", "None", ",", "region", "=", "None"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_identity_pools
Given an identity pool name, (optionally if an identity pool id is given, the given name will be ignored) Deletes all identity pools matching the given name, or the specific identity pool with the given identity pool id. CLI Example: .. code-block:: bash salt myminion boto_cognitoidentit...
salt/modules/boto_cognitoidentity.py
def delete_identity_pools(IdentityPoolName, IdentityPoolId=None, region=None, key=None, keyid=None, profile=None): ''' Given an identity pool name, (optionally if an identity pool id is given, the given name will be ignored) Deletes all identity pools matching the given name, or the spec...
def delete_identity_pools(IdentityPoolName, IdentityPoolId=None, region=None, key=None, keyid=None, profile=None): ''' Given an identity pool name, (optionally if an identity pool id is given, the given name will be ignored) Deletes all identity pools matching the given name, or the spec...
[ "Given", "an", "identity", "pool", "name", "(", "optionally", "if", "an", "identity", "pool", "id", "is", "given", "the", "given", "name", "will", "be", "ignored", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cognitoidentity.py#L221-L252
[ "def", "delete_identity_pools", "(", "IdentityPoolName", ",", "IdentityPoolId", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_role_arn
Helper function to turn a name into an arn string, returns None if not able to resolve
salt/modules/boto_cognitoidentity.py
def _get_role_arn(name, **conn_params): ''' Helper function to turn a name into an arn string, returns None if not able to resolve ''' if name.startswith('arn:aws:iam'): return name role = __salt__['boto_iam.describe_role'](name, **conn_params) rolearn = role.get('arn') if role else ...
def _get_role_arn(name, **conn_params): ''' Helper function to turn a name into an arn string, returns None if not able to resolve ''' if name.startswith('arn:aws:iam'): return name role = __salt__['boto_iam.describe_role'](name, **conn_params) rolearn = role.get('arn') if role else ...
[ "Helper", "function", "to", "turn", "a", "name", "into", "an", "arn", "string", "returns", "None", "if", "not", "able", "to", "resolve" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cognitoidentity.py#L289-L299
[ "def", "_get_role_arn", "(", "name", ",", "*", "*", "conn_params", ")", ":", "if", "name", ".", "startswith", "(", "'arn:aws:iam'", ")", ":", "return", "name", "role", "=", "__salt__", "[", "'boto_iam.describe_role'", "]", "(", "name", ",", "*", "*", "co...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_identity_pool_roles
Given an identity pool id, set the given AuthenticatedRole and UnauthenticatedRole (the Role can be an iam arn, or a role name) If AuthenticatedRole or UnauthenticatedRole is not given, the authenticated and/or the unauthenticated role associated previously with the pool will be cleared. Returns set T...
salt/modules/boto_cognitoidentity.py
def set_identity_pool_roles(IdentityPoolId, AuthenticatedRole=None, UnauthenticatedRole=None, region=None, key=None, keyid=None, profile=None): ''' Given an identity pool id, set the given AuthenticatedRole and UnauthenticatedRole (the Role can be an iam arn, or a role name) If AuthenticatedRole or...
def set_identity_pool_roles(IdentityPoolId, AuthenticatedRole=None, UnauthenticatedRole=None, region=None, key=None, keyid=None, profile=None): ''' Given an identity pool id, set the given AuthenticatedRole and UnauthenticatedRole (the Role can be an iam arn, or a role name) If AuthenticatedRole or...
[ "Given", "an", "identity", "pool", "id", "set", "the", "given", "AuthenticatedRole", "and", "UnauthenticatedRole", "(", "the", "Role", "can", "be", "an", "iam", "arn", "or", "a", "role", "name", ")", "If", "AuthenticatedRole", "or", "UnauthenticatedRole", "is"...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cognitoidentity.py#L302-L351
[ "def", "set_identity_pool_roles", "(", "IdentityPoolId", ",", "AuthenticatedRole", "=", "None", ",", "UnauthenticatedRole", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update_identity_pool
Updates the given IdentityPoolId's properties. All parameters except for IdentityPoolId, is optional. SupportedLoginProviders should be a dictionary mapping provider names to provider app IDs. OpenIdConnectProviderARNs should be a list of OpenID Connect provider ARNs. To clear SupportedLoginProvider...
salt/modules/boto_cognitoidentity.py
def update_identity_pool(IdentityPoolId, IdentityPoolName=None, AllowUnauthenticatedIdentities=False, SupportedLoginProviders=None, DeveloperProviderName=None, OpenIdConnectProviderARNs=None, ...
def update_identity_pool(IdentityPoolId, IdentityPoolName=None, AllowUnauthenticatedIdentities=False, SupportedLoginProviders=None, DeveloperProviderName=None, OpenIdConnectProviderARNs=None, ...
[ "Updates", "the", "given", "IdentityPoolId", "s", "properties", ".", "All", "parameters", "except", "for", "IdentityPoolId", "is", "optional", ".", "SupportedLoginProviders", "should", "be", "a", "dictionary", "mapping", "provider", "names", "to", "provider", "app",...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_cognitoidentity.py#L354-L422
[ "def", "update_identity_pool", "(", "IdentityPoolId", ",", "IdentityPoolName", "=", "None", ",", "AllowUnauthenticatedIdentities", "=", "False", ",", "SupportedLoginProviders", "=", "None", ",", "DeveloperProviderName", "=", "None", ",", "OpenIdConnectProviderARNs", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_filter_running
Filter out the result: True + no changes data
salt/modules/state.py
def _filter_running(runnings): ''' Filter out the result: True + no changes data ''' ret = dict((tag, value) for tag, value in six.iteritems(runnings) if not value['result'] or value['changes']) return ret
def _filter_running(runnings): ''' Filter out the result: True + no changes data ''' ret = dict((tag, value) for tag, value in six.iteritems(runnings) if not value['result'] or value['changes']) return ret
[ "Filter", "out", "the", "result", ":", "True", "+", "no", "changes", "data" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L87-L93
[ "def", "_filter_running", "(", "runnings", ")", ":", "ret", "=", "dict", "(", "(", "tag", ",", "value", ")", "for", "tag", ",", "value", "in", "six", ".", "iteritems", "(", "runnings", ")", "if", "not", "value", "[", "'result'", "]", "or", "value", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_set_retcode
Set the return code based on the data back from the state system
salt/modules/state.py
def _set_retcode(ret, highstate=None): ''' Set the return code based on the data back from the state system ''' # Set default retcode to 0 __context__['retcode'] = salt.defaults.exitcodes.EX_OK if isinstance(ret, list): __context__['retcode'] = salt.defaults.exitcodes.EX_STATE_COMPILER...
def _set_retcode(ret, highstate=None): ''' Set the return code based on the data back from the state system ''' # Set default retcode to 0 __context__['retcode'] = salt.defaults.exitcodes.EX_OK if isinstance(ret, list): __context__['retcode'] = salt.defaults.exitcodes.EX_STATE_COMPILER...
[ "Set", "the", "return", "code", "based", "on", "the", "data", "back", "from", "the", "state", "system" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L96-L108
[ "def", "_set_retcode", "(", "ret", ",", "highstate", "=", "None", ")", ":", "# Set default retcode to 0", "__context__", "[", "'retcode'", "]", "=", "salt", ".", "defaults", ".", "exitcodes", ".", "EX_OK", "if", "isinstance", "(", "ret", ",", "list", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_snapper_pre
Create a snapper pre snapshot
salt/modules/state.py
def _snapper_pre(opts, jid): ''' Create a snapper pre snapshot ''' snapper_pre = None try: if not opts['test'] and __opts__.get('snapper_states'): # Run the snapper pre snapshot snapper_pre = __salt__['snapper.create_snapshot']( config=__opts__.get...
def _snapper_pre(opts, jid): ''' Create a snapper pre snapshot ''' snapper_pre = None try: if not opts['test'] and __opts__.get('snapper_states'): # Run the snapper pre snapshot snapper_pre = __salt__['snapper.create_snapshot']( config=__opts__.get...
[ "Create", "a", "snapper", "pre", "snapshot" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L135-L150
[ "def", "_snapper_pre", "(", "opts", ",", "jid", ")", ":", "snapper_pre", "=", "None", "try", ":", "if", "not", "opts", "[", "'test'", "]", "and", "__opts__", ".", "get", "(", "'snapper_states'", ")", ":", "# Run the snapper pre snapshot", "snapper_pre", "=",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_snapper_post
Create the post states snapshot
salt/modules/state.py
def _snapper_post(opts, jid, pre_num): ''' Create the post states snapshot ''' try: if not opts['test'] and __opts__.get('snapper_states') and pre_num: # Run the snapper pre snapshot __salt__['snapper.create_snapshot']( config=__opts__.get('snapper_sta...
def _snapper_post(opts, jid, pre_num): ''' Create the post states snapshot ''' try: if not opts['test'] and __opts__.get('snapper_states') and pre_num: # Run the snapper pre snapshot __salt__['snapper.create_snapshot']( config=__opts__.get('snapper_sta...
[ "Create", "the", "post", "states", "snapshot" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L153-L167
[ "def", "_snapper_post", "(", "opts", ",", "jid", ",", "pre_num", ")", ":", "try", ":", "if", "not", "opts", "[", "'test'", "]", "and", "__opts__", ".", "get", "(", "'snapper_states'", ")", "and", "pre_num", ":", "# Run the snapper pre snapshot", "__salt__", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_pause
Return the pause information for a given jid
salt/modules/state.py
def _get_pause(jid, state_id=None): ''' Return the pause information for a given jid ''' pause_dir = os.path.join(__opts__['cachedir'], 'state_pause') pause_path = os.path.join(pause_dir, jid) if not os.path.exists(pause_dir): try: os.makedirs(pause_dir) except OSErro...
def _get_pause(jid, state_id=None): ''' Return the pause information for a given jid ''' pause_dir = os.path.join(__opts__['cachedir'], 'state_pause') pause_path = os.path.join(pause_dir, jid) if not os.path.exists(pause_dir): try: os.makedirs(pause_dir) except OSErro...
[ "Return", "the", "pause", "information", "for", "a", "given", "jid" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L170-L189
[ "def", "_get_pause", "(", "jid", ",", "state_id", "=", "None", ")", ":", "pause_dir", "=", "os", ".", "path", ".", "join", "(", "__opts__", "[", "'cachedir'", "]", ",", "'state_pause'", ")", "pause_path", "=", "os", ".", "path", ".", "join", "(", "pa...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_pauses
Get a report on all of the currently paused state runs and pause run settings. Optionally send in a jid if you only desire to see a single pause data set.
salt/modules/state.py
def get_pauses(jid=None): ''' Get a report on all of the currently paused state runs and pause run settings. Optionally send in a jid if you only desire to see a single pause data set. ''' ret = {} active = __salt__['saltutil.is_running']('state.*') pause_dir = os.path.join(__opts__[...
def get_pauses(jid=None): ''' Get a report on all of the currently paused state runs and pause run settings. Optionally send in a jid if you only desire to see a single pause data set. ''' ret = {} active = __salt__['saltutil.is_running']('state.*') pause_dir = os.path.join(__opts__[...
[ "Get", "a", "report", "on", "all", "of", "the", "currently", "paused", "state", "runs", "and", "pause", "run", "settings", ".", "Optionally", "send", "in", "a", "jid", "if", "you", "only", "desire", "to", "see", "a", "single", "pause", "data", "set", "...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L192-L225
[ "def", "get_pauses", "(", "jid", "=", "None", ")", ":", "ret", "=", "{", "}", "active", "=", "__salt__", "[", "'saltutil.is_running'", "]", "(", "'state.*'", ")", "pause_dir", "=", "os", ".", "path", ".", "join", "(", "__opts__", "[", "'cachedir'", "]"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
soft_kill
Set up a state run to die before executing the given state id, this instructs a running state to safely exit at a given state id. This needs to pass in the jid of the running state. If a state_id is not passed then the jid referenced will be safely exited at the beginning of the next state run. The...
salt/modules/state.py
def soft_kill(jid, state_id=None): ''' Set up a state run to die before executing the given state id, this instructs a running state to safely exit at a given state id. This needs to pass in the jid of the running state. If a state_id is not passed then the jid referenced will be safely exited a...
def soft_kill(jid, state_id=None): ''' Set up a state run to die before executing the given state id, this instructs a running state to safely exit at a given state id. This needs to pass in the jid of the running state. If a state_id is not passed then the jid referenced will be safely exited a...
[ "Set", "up", "a", "state", "run", "to", "die", "before", "executing", "the", "given", "state", "id", "this", "instructs", "a", "running", "state", "to", "safely", "exit", "at", "a", "given", "state", "id", ".", "This", "needs", "to", "pass", "in", "the...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L228-L259
[ "def", "soft_kill", "(", "jid", ",", "state_id", "=", "None", ")", ":", "jid", "=", "six", ".", "text_type", "(", "jid", ")", "if", "state_id", "is", "None", ":", "state_id", "=", "'__all__'", "data", ",", "pause_path", "=", "_get_pause", "(", "jid", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
pause
Set up a state id pause, this instructs a running state to pause at a given state id. This needs to pass in the jid of the running state and can optionally pass in a duration in seconds. If a state_id is not passed then the jid referenced will be paused at the beginning of the next state run. The given...
salt/modules/state.py
def pause(jid, state_id=None, duration=None): ''' Set up a state id pause, this instructs a running state to pause at a given state id. This needs to pass in the jid of the running state and can optionally pass in a duration in seconds. If a state_id is not passed then the jid referenced will be pau...
def pause(jid, state_id=None, duration=None): ''' Set up a state id pause, this instructs a running state to pause at a given state id. This needs to pass in the jid of the running state and can optionally pass in a duration in seconds. If a state_id is not passed then the jid referenced will be pau...
[ "Set", "up", "a", "state", "id", "pause", "this", "instructs", "a", "running", "state", "to", "pause", "at", "a", "given", "state", "id", ".", "This", "needs", "to", "pass", "in", "the", "jid", "of", "the", "running", "state", "and", "can", "optionally...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L262-L294
[ "def", "pause", "(", "jid", ",", "state_id", "=", "None", ",", "duration", "=", "None", ")", ":", "jid", "=", "six", ".", "text_type", "(", "jid", ")", "if", "state_id", "is", "None", ":", "state_id", "=", "'__all__'", "data", ",", "pause_path", "=",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
resume
Remove a pause from a jid, allowing it to continue. If the state_id is not specified then the a general pause will be resumed. The given state_id is the id got a given state execution, so given a state that looks like this: .. code-block:: yaml vim: pkg.installed: [] The state_...
salt/modules/state.py
def resume(jid, state_id=None): ''' Remove a pause from a jid, allowing it to continue. If the state_id is not specified then the a general pause will be resumed. The given state_id is the id got a given state execution, so given a state that looks like this: .. code-block:: yaml vim:...
def resume(jid, state_id=None): ''' Remove a pause from a jid, allowing it to continue. If the state_id is not specified then the a general pause will be resumed. The given state_id is the id got a given state execution, so given a state that looks like this: .. code-block:: yaml vim:...
[ "Remove", "a", "pause", "from", "a", "jid", "allowing", "it", "to", "continue", ".", "If", "the", "state_id", "is", "not", "specified", "then", "the", "a", "general", "pause", "will", "be", "resumed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L297-L328
[ "def", "resume", "(", "jid", ",", "state_id", "=", "None", ")", ":", "jid", "=", "six", ".", "text_type", "(", "jid", ")", "if", "state_id", "is", "None", ":", "state_id", "=", "'__all__'", "data", ",", "pause_path", "=", "_get_pause", "(", "jid", ",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
orchestrate
.. versionadded:: 2016.11.0 Execute the orchestrate runner from a masterless minion. .. seealso:: More Orchestrate documentation * :ref:`Full Orchestrate Tutorial <orchestrate-runner>` * :py:mod:`Docs for the ``salt`` state module <salt.states.saltmod>` CLI Examples: .. code-block::...
salt/modules/state.py
def orchestrate(mods, saltenv='base', test=None, exclude=None, pillar=None, pillarenv=None): ''' .. versionadded:: 2016.11.0 Execute the orchestrate runner from a masterless minion. .. seealso:: More Orchestrate documentat...
def orchestrate(mods, saltenv='base', test=None, exclude=None, pillar=None, pillarenv=None): ''' .. versionadded:: 2016.11.0 Execute the orchestrate runner from a masterless minion. .. seealso:: More Orchestrate documentat...
[ "..", "versionadded", "::", "2016", ".", "11", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L331-L360
[ "def", "orchestrate", "(", "mods", ",", "saltenv", "=", "'base'", ",", "test", "=", "None", ",", "exclude", "=", "None", ",", "pillar", "=", "None", ",", "pillarenv", "=", "None", ")", ":", "return", "_orchestrate", "(", "mods", "=", "mods", ",", "sa...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_check_queue
Utility function to queue the state run if requested and to check for conflicts in currently running states
salt/modules/state.py
def _check_queue(queue, kwargs): ''' Utility function to queue the state run if requested and to check for conflicts in currently running states ''' if queue: _wait(kwargs.get('__pub_jid')) else: conflict = running(concurrent=kwargs.get('concurrent', False)) if conflict: ...
def _check_queue(queue, kwargs): ''' Utility function to queue the state run if requested and to check for conflicts in currently running states ''' if queue: _wait(kwargs.get('__pub_jid')) else: conflict = running(concurrent=kwargs.get('concurrent', False)) if conflict: ...
[ "Utility", "function", "to", "queue", "the", "state", "run", "if", "requested", "and", "to", "check", "for", "conflicts", "in", "currently", "running", "states" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L411-L422
[ "def", "_check_queue", "(", "queue", ",", "kwargs", ")", ":", "if", "queue", ":", "_wait", "(", "kwargs", ".", "get", "(", "'__pub_jid'", ")", ")", "else", ":", "conflict", "=", "running", "(", "concurrent", "=", "kwargs", ".", "get", "(", "'concurrent...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
low
Execute a single low data call This function is mostly intended for testing the state system and is not likely to be needed in everyday usage. CLI Example: .. code-block:: bash salt '*' state.low '{"state": "pkg", "fun": "installed", "name": "vi"}'
salt/modules/state.py
def low(data, queue=False, **kwargs): ''' Execute a single low data call This function is mostly intended for testing the state system and is not likely to be needed in everyday usage. CLI Example: .. code-block:: bash salt '*' state.low '{"state": "pkg", "fun": "installed", "name": ...
def low(data, queue=False, **kwargs): ''' Execute a single low data call This function is mostly intended for testing the state system and is not likely to be needed in everyday usage. CLI Example: .. code-block:: bash salt '*' state.low '{"state": "pkg", "fun": "installed", "name": ...
[ "Execute", "a", "single", "low", "data", "call" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L431-L460
[ "def", "low", "(", "data", ",", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "conflict", "=", "_check_queue", "(", "queue", ",", "kwargs", ")", "if", "conflict", "is", "not", "None", ":", "return", "conflict", "try", ":", "st_", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
high
Execute the compound calls stored in a single set of high data This function is mostly intended for testing the state system and is not likely to be needed in everyday usage. CLI Example: .. code-block:: bash salt '*' state.high '{"vim": {"pkg": ["installed"]}}'
salt/modules/state.py
def high(data, test=None, queue=False, **kwargs): ''' Execute the compound calls stored in a single set of high data This function is mostly intended for testing the state system and is not likely to be needed in everyday usage. CLI Example: .. code-block:: bash salt '*' state.high '...
def high(data, test=None, queue=False, **kwargs): ''' Execute the compound calls stored in a single set of high data This function is mostly intended for testing the state system and is not likely to be needed in everyday usage. CLI Example: .. code-block:: bash salt '*' state.high '...
[ "Execute", "the", "compound", "calls", "stored", "in", "a", "single", "set", "of", "high", "data" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L480-L524
[ "def", "high", "(", "data", ",", "test", "=", "None", ",", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "conflict", "=", "_check_queue", "(", "queue", ",", "kwargs", ")", "if", "conflict", "is", "not", "None", ":", "return", "conflict", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
template
Execute the information stored in a template file on the minion. This function does not ask a master for a SLS file to render but instead directly processes the file at the provided path on the minion. CLI Example: .. code-block:: bash salt '*' state.template '<Path to template on the minion...
salt/modules/state.py
def template(tem, queue=False, **kwargs): ''' Execute the information stored in a template file on the minion. This function does not ask a master for a SLS file to render but instead directly processes the file at the provided path on the minion. CLI Example: .. code-block:: bash sa...
def template(tem, queue=False, **kwargs): ''' Execute the information stored in a template file on the minion. This function does not ask a master for a SLS file to render but instead directly processes the file at the provided path on the minion. CLI Example: .. code-block:: bash sa...
[ "Execute", "the", "information", "stored", "in", "a", "template", "file", "on", "the", "minion", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/state.py#L527-L576
[ "def", "template", "(", "tem", ",", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "if", "'env'", "in", "kwargs", ":", "# \"env\" is not supported; Use \"saltenv\".", "kwargs", ".", "pop", "(", "'env'", ")", "conflict", "=", "_check_queue", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46