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
set_attributes
Set attributes on an ELB. name (string) Name of the ELB instance to set attributes for attributes A dict of attributes to set. Valid attributes are: access_log (dict) enabled (bool) Enable storage of access logs. s3_bucket_name (string)...
salt/modules/boto_elb.py
def set_attributes(name, attributes, region=None, key=None, keyid=None, profile=None): ''' Set attributes on an ELB. name (string) Name of the ELB instance to set attributes for attributes A dict of attributes to set. Valid attributes are: access_lo...
def set_attributes(name, attributes, region=None, key=None, keyid=None, profile=None): ''' Set attributes on an ELB. name (string) Name of the ELB instance to set attributes for attributes A dict of attributes to set. Valid attributes are: access_lo...
[ "Set", "attributes", "on", "an", "ELB", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L527-L623
[ "def", "set_attributes", "(", "name", ",", "attributes", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_health_check
Get the health check configured for this ELB. CLI example: .. code-block:: bash salt myminion boto_elb.get_health_check myelb
salt/modules/boto_elb.py
def get_health_check(name, region=None, key=None, keyid=None, profile=None): ''' Get the health check configured for this ELB. CLI example: .. code-block:: bash salt myminion boto_elb.get_health_check myelb ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) ...
def get_health_check(name, region=None, key=None, keyid=None, profile=None): ''' Get the health check configured for this ELB. CLI example: .. code-block:: bash salt myminion boto_elb.get_health_check myelb ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) ...
[ "Get", "the", "health", "check", "configured", "for", "this", "ELB", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L626-L659
[ "def", "get_health_check", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "key...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_health_check
Set attributes on an ELB. CLI example to set attributes on an ELB: .. code-block:: bash salt myminion boto_elb.set_health_check myelb '{"target": "HTTP:80/"}'
salt/modules/boto_elb.py
def set_health_check(name, health_check, region=None, key=None, keyid=None, profile=None): ''' Set attributes on an ELB. CLI example to set attributes on an ELB: .. code-block:: bash salt myminion boto_elb.set_health_check myelb '{"target": "HTTP:80/"}' ''' conn =...
def set_health_check(name, health_check, region=None, key=None, keyid=None, profile=None): ''' Set attributes on an ELB. CLI example to set attributes on an ELB: .. code-block:: bash salt myminion boto_elb.set_health_check myelb '{"target": "HTTP:80/"}' ''' conn =...
[ "Set", "attributes", "on", "an", "ELB", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L662-L689
[ "def", "set_health_check", "(", "name", ",", "health_check", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
register_instances
Register instances with an ELB. Instances is either a string instance id or a list of string instance id's. Returns: - ``True``: instance(s) registered successfully - ``False``: instance(s) failed to be registered CLI example: .. code-block:: bash salt myminion boto_elb.register_in...
salt/modules/boto_elb.py
def register_instances(name, instances, region=None, key=None, keyid=None, profile=None): ''' Register instances with an ELB. Instances is either a string instance id or a list of string instance id's. Returns: - ``True``: instance(s) registered successfully - ``False``...
def register_instances(name, instances, region=None, key=None, keyid=None, profile=None): ''' Register instances with an ELB. Instances is either a string instance id or a list of string instance id's. Returns: - ``True``: instance(s) registered successfully - ``False``...
[ "Register", "instances", "with", "an", "ELB", ".", "Instances", "is", "either", "a", "string", "instance", "id", "or", "a", "list", "of", "string", "instance", "id", "s", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L692-L732
[ "def", "register_instances", "(", "name", ",", "instances", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "# convert instances to list type, enabling consistent use of instances", "# variable t...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
deregister_instances
Deregister instances with an ELB. Instances is either a string instance id or a list of string instance id's. Returns: - ``True``: instance(s) deregistered successfully - ``False``: instance(s) failed to be deregistered - ``None``: instance(s) not valid or not registered, no action taken CLI...
salt/modules/boto_elb.py
def deregister_instances(name, instances, region=None, key=None, keyid=None, profile=None): ''' Deregister instances with an ELB. Instances is either a string instance id or a list of string instance id's. Returns: - ``True``: instance(s) deregistered successfully - `...
def deregister_instances(name, instances, region=None, key=None, keyid=None, profile=None): ''' Deregister instances with an ELB. Instances is either a string instance id or a list of string instance id's. Returns: - ``True``: instance(s) deregistered successfully - `...
[ "Deregister", "instances", "with", "an", "ELB", ".", "Instances", "is", "either", "a", "string", "instance", "id", "or", "a", "list", "of", "string", "instance", "id", "s", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L735-L789
[ "def", "deregister_instances", "(", "name", ",", "instances", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "# convert instances to list type, enabling consistent use of instances", "# variable...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_instances
Set the instances assigned to an ELB to exactly the list given CLI example: .. code-block:: bash salt myminion boto_elb.set_instances myelb region=us-east-1 instances="[instance_id,instance_id]"
salt/modules/boto_elb.py
def set_instances(name, instances, test=False, region=None, key=None, keyid=None, profile=None): ''' Set the instances assigned to an ELB to exactly the list given CLI example: .. code-block:: bash salt myminion boto_elb.set_instances myelb region=us-east-1 instances=...
def set_instances(name, instances, test=False, region=None, key=None, keyid=None, profile=None): ''' Set the instances assigned to an ELB to exactly the list given CLI example: .. code-block:: bash salt myminion boto_elb.set_instances myelb region=us-east-1 instances=...
[ "Set", "the", "instances", "assigned", "to", "an", "ELB", "to", "exactly", "the", "list", "given" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L792-L816
[ "def", "set_instances", "(", "name", ",", "instances", ",", "test", "=", "False", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "True", "current", "=", "set", "(",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_instance_health
Get a list of instances and their health state CLI example: .. code-block:: bash salt myminion boto_elb.get_instance_health myelb salt myminion boto_elb.get_instance_health myelb region=us-east-1 instances="[instance_id,instance_id]"
salt/modules/boto_elb.py
def get_instance_health(name, region=None, key=None, keyid=None, profile=None, instances=None): ''' Get a list of instances and their health state CLI example: .. code-block:: bash salt myminion boto_elb.get_instance_health myelb salt myminion boto_elb.get_instance_health myelb region...
def get_instance_health(name, region=None, key=None, keyid=None, profile=None, instances=None): ''' Get a list of instances and their health state CLI example: .. code-block:: bash salt myminion boto_elb.get_instance_health myelb salt myminion boto_elb.get_instance_health myelb region...
[ "Get", "a", "list", "of", "instances", "and", "their", "health", "state" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L819-L844
[ "def", "get_instance_health", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "instances", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_policy
Create an ELB policy. .. versionadded:: 2016.3.0 CLI example: .. code-block:: bash salt myminion boto_elb.create_policy myelb mypolicy LBCookieStickinessPolicyType '{"CookieExpirationPeriod": 3600}'
salt/modules/boto_elb.py
def create_policy(name, policy_name, policy_type, policy, region=None, key=None, keyid=None, profile=None): ''' Create an ELB policy. .. versionadded:: 2016.3.0 CLI example: .. code-block:: bash salt myminion boto_elb.create_policy myelb mypolicy LBCookieStickinessPolic...
def create_policy(name, policy_name, policy_type, policy, region=None, key=None, keyid=None, profile=None): ''' Create an ELB policy. .. versionadded:: 2016.3.0 CLI example: .. code-block:: bash salt myminion boto_elb.create_policy myelb mypolicy LBCookieStickinessPolic...
[ "Create", "an", "ELB", "policy", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L847-L876
[ "def", "create_policy", "(", "name", ",", "policy_name", ",", "policy_type", ",", "policy", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_policy
Delete an ELB policy. .. versionadded:: 2016.3.0 CLI example: .. code-block:: bash salt myminion boto_elb.delete_policy myelb mypolicy
salt/modules/boto_elb.py
def delete_policy(name, policy_name, region=None, key=None, keyid=None, profile=None): ''' Delete an ELB policy. .. versionadded:: 2016.3.0 CLI example: .. code-block:: bash salt myminion boto_elb.delete_policy myelb mypolicy ''' conn = _get_conn(region=region, ...
def delete_policy(name, policy_name, region=None, key=None, keyid=None, profile=None): ''' Delete an ELB policy. .. versionadded:: 2016.3.0 CLI example: .. code-block:: bash salt myminion boto_elb.delete_policy myelb mypolicy ''' conn = _get_conn(region=region, ...
[ "Delete", "an", "ELB", "policy", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L879-L904
[ "def", "delete_policy", "(", "name", ",", "policy_name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_listener_policy
Set the policies of an ELB listener. .. versionadded:: 2016.3.0 CLI example: .. code-block:: Bash salt myminion boto_elb.set_listener_policy myelb 443 "[policy1,policy2]"
salt/modules/boto_elb.py
def set_listener_policy(name, port, policies=None, region=None, key=None, keyid=None, profile=None): ''' Set the policies of an ELB listener. .. versionadded:: 2016.3.0 CLI example: .. code-block:: Bash salt myminion boto_elb.set_listener_policy myelb 443 "[policy...
def set_listener_policy(name, port, policies=None, region=None, key=None, keyid=None, profile=None): ''' Set the policies of an ELB listener. .. versionadded:: 2016.3.0 CLI example: .. code-block:: Bash salt myminion boto_elb.set_listener_policy myelb 443 "[policy...
[ "Set", "the", "policies", "of", "an", "ELB", "listener", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L907-L934
[ "def", "set_listener_policy", "(", "name", ",", "port", ",", "policies", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_tags
Add the tags on an ELB .. versionadded:: 2016.3.0 name name of the ELB tags dict of name/value pair tags CLI Example: .. code-block:: bash salt myminion boto_elb.set_tags my-elb-name "{'Tag1': 'Value', 'Tag2': 'Another Value'}"
salt/modules/boto_elb.py
def set_tags(name, tags, region=None, key=None, keyid=None, profile=None): ''' Add the tags on an ELB .. versionadded:: 2016.3.0 name name of the ELB tags dict of name/value pair tags CLI Example: .. code-block:: bash salt myminion boto_elb.set_tags my-elb-name ...
def set_tags(name, tags, region=None, key=None, keyid=None, profile=None): ''' Add the tags on an ELB .. versionadded:: 2016.3.0 name name of the ELB tags dict of name/value pair tags CLI Example: .. code-block:: bash salt myminion boto_elb.set_tags my-elb-name ...
[ "Add", "the", "tags", "on", "an", "ELB" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L964-L988
[ "def", "set_tags", "(", "name", ",", "tags", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "if", "exists", "(", "name", ",", "region", ",", "key", ",", "keyid", ",", "profil...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_tags
Add the tags on an ELB name name of the ELB tags list of tags to remove CLI Example: .. code-block:: bash salt myminion boto_elb.delete_tags my-elb-name ['TagToRemove1', 'TagToRemove2']
salt/modules/boto_elb.py
def delete_tags(name, tags, region=None, key=None, keyid=None, profile=None): ''' Add the tags on an ELB name name of the ELB tags list of tags to remove CLI Example: .. code-block:: bash salt myminion boto_elb.delete_tags my-elb-name ['TagToRemove1', 'TagToRemove2']...
def delete_tags(name, tags, region=None, key=None, keyid=None, profile=None): ''' Add the tags on an ELB name name of the ELB tags list of tags to remove CLI Example: .. code-block:: bash salt myminion boto_elb.delete_tags my-elb-name ['TagToRemove1', 'TagToRemove2']...
[ "Add", "the", "tags", "on", "an", "ELB" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L991-L1012
[ "def", "delete_tags", "(", "name", ",", "tags", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "if", "exists", "(", "name", ",", "region", ",", "key", ",", "keyid", ",", "pro...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_build_tag_param_list
helper function to build a tag parameter list to send
salt/modules/boto_elb.py
def _build_tag_param_list(params, tags): ''' helper function to build a tag parameter list to send ''' keys = sorted(tags.keys()) i = 1 for key in keys: value = tags[key] params['Tags.member.{0}.Key'.format(i)] = key if value is not None: params['Tags.member.{...
def _build_tag_param_list(params, tags): ''' helper function to build a tag parameter list to send ''' keys = sorted(tags.keys()) i = 1 for key in keys: value = tags[key] params['Tags.member.{0}.Key'.format(i)] = key if value is not None: params['Tags.member.{...
[ "helper", "function", "to", "build", "a", "tag", "parameter", "list", "to", "send" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L1015-L1026
[ "def", "_build_tag_param_list", "(", "params", ",", "tags", ")", ":", "keys", "=", "sorted", "(", "tags", ".", "keys", "(", ")", ")", "i", "=", "1", "for", "key", "in", "keys", ":", "value", "=", "tags", "[", "key", "]", "params", "[", "'Tags.membe...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_all_tags
Retrieve all the metadata tags associated with your ELB(s). :type load_balancer_names: list :param load_balancer_names: An optional list of load balancer names. :rtype: list :return: A list of :class:`boto.ec2.elb.tag.Tag` objects
salt/modules/boto_elb.py
def _get_all_tags(conn, load_balancer_names=None): ''' Retrieve all the metadata tags associated with your ELB(s). :type load_balancer_names: list :param load_balancer_names: An optional list of load balancer names. :rtype: list :return: A list of :class:`boto.ec2.elb.tag.Tag` objects ''' ...
def _get_all_tags(conn, load_balancer_names=None): ''' Retrieve all the metadata tags associated with your ELB(s). :type load_balancer_names: list :param load_balancer_names: An optional list of load balancer names. :rtype: list :return: A list of :class:`boto.ec2.elb.tag.Tag` objects ''' ...
[ "Retrieve", "all", "the", "metadata", "tags", "associated", "with", "your", "ELB", "(", "s", ")", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L1029-L1053
[ "def", "_get_all_tags", "(", "conn", ",", "load_balancer_names", "=", "None", ")", ":", "params", "=", "{", "}", "if", "load_balancer_names", ":", "conn", ".", "build_list_params", "(", "params", ",", "load_balancer_names", ",", "'LoadBalancerNames.member.%d'", ")...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_add_tags
Create new metadata tags for the specified resource ids. :type load_balancer_names: list :param load_balancer_names: A list of load balancer names. :type tags: dict :param tags: A dictionary containing the name/value pairs. If you want to create only a tag name, the v...
salt/modules/boto_elb.py
def _add_tags(conn, load_balancer_names, tags): ''' Create new metadata tags for the specified resource ids. :type load_balancer_names: list :param load_balancer_names: A list of load balancer names. :type tags: dict :param tags: A dictionary containing the name/value pairs. I...
def _add_tags(conn, load_balancer_names, tags): ''' Create new metadata tags for the specified resource ids. :type load_balancer_names: list :param load_balancer_names: A list of load balancer names. :type tags: dict :param tags: A dictionary containing the name/value pairs. I...
[ "Create", "new", "metadata", "tags", "for", "the", "specified", "resource", "ids", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L1056-L1073
[ "def", "_add_tags", "(", "conn", ",", "load_balancer_names", ",", "tags", ")", ":", "params", "=", "{", "}", "conn", ".", "build_list_params", "(", "params", ",", "load_balancer_names", ",", "'LoadBalancerNames.member.%d'", ")", "_build_tag_param_list", "(", "para...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_remove_tags
Delete metadata tags for the specified resource ids. :type load_balancer_names: list :param load_balancer_names: A list of load balancer names. :type tags: list :param tags: A list containing just tag names for the tags to be deleted.
salt/modules/boto_elb.py
def _remove_tags(conn, load_balancer_names, tags): ''' Delete metadata tags for the specified resource ids. :type load_balancer_names: list :param load_balancer_names: A list of load balancer names. :type tags: list :param tags: A list containing just tag names for the tags to be ...
def _remove_tags(conn, load_balancer_names, tags): ''' Delete metadata tags for the specified resource ids. :type load_balancer_names: list :param load_balancer_names: A list of load balancer names. :type tags: list :param tags: A list containing just tag names for the tags to be ...
[ "Delete", "metadata", "tags", "for", "the", "specified", "resource", "ids", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elb.py#L1076-L1092
[ "def", "_remove_tags", "(", "conn", ",", "load_balancer_names", ",", "tags", ")", ":", "params", "=", "{", "}", "conn", ".", "build_list_params", "(", "params", ",", "load_balancer_names", ",", "'LoadBalancerNames.member.%d'", ")", "conn", ".", "build_list_params"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_repack_pkgs
Repack packages specified using "pkgs" argument to pkg states into a single dictionary
salt/modules/pkg_resource.py
def _repack_pkgs(pkgs, normalize=True): ''' Repack packages specified using "pkgs" argument to pkg states into a single dictionary ''' if normalize and 'pkg.normalize_name' in __salt__: _normalize_name = __salt__['pkg.normalize_name'] else: _normalize_name = lambda pkgname: pkgna...
def _repack_pkgs(pkgs, normalize=True): ''' Repack packages specified using "pkgs" argument to pkg states into a single dictionary ''' if normalize and 'pkg.normalize_name' in __salt__: _normalize_name = __salt__['pkg.normalize_name'] else: _normalize_name = lambda pkgname: pkgna...
[ "Repack", "packages", "specified", "using", "pkgs", "argument", "to", "pkg", "states", "into", "a", "single", "dictionary" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkg_resource.py#L27-L41
[ "def", "_repack_pkgs", "(", "pkgs", ",", "normalize", "=", "True", ")", ":", "if", "normalize", "and", "'pkg.normalize_name'", "in", "__salt__", ":", "_normalize_name", "=", "__salt__", "[", "'pkg.normalize_name'", "]", "else", ":", "_normalize_name", "=", "lamb...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
pack_sources
Accepts list of dicts (or a string representing a list of dicts) and packs the key/value pairs into a single dict. ``'[{"foo": "salt://foo.rpm"}, {"bar": "salt://bar.rpm"}]'`` would become ``{"foo": "salt://foo.rpm", "bar": "salt://bar.rpm"}`` normalize : True Normalize the package name by rem...
salt/modules/pkg_resource.py
def pack_sources(sources, normalize=True): ''' Accepts list of dicts (or a string representing a list of dicts) and packs the key/value pairs into a single dict. ``'[{"foo": "salt://foo.rpm"}, {"bar": "salt://bar.rpm"}]'`` would become ``{"foo": "salt://foo.rpm", "bar": "salt://bar.rpm"}`` nor...
def pack_sources(sources, normalize=True): ''' Accepts list of dicts (or a string representing a list of dicts) and packs the key/value pairs into a single dict. ``'[{"foo": "salt://foo.rpm"}, {"bar": "salt://bar.rpm"}]'`` would become ``{"foo": "salt://foo.rpm", "bar": "salt://bar.rpm"}`` nor...
[ "Accepts", "list", "of", "dicts", "(", "or", "a", "string", "representing", "a", "list", "of", "dicts", ")", "and", "packs", "the", "key", "/", "value", "pairs", "into", "a", "single", "dict", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkg_resource.py#L44-L88
[ "def", "pack_sources", "(", "sources", ",", "normalize", "=", "True", ")", ":", "if", "normalize", "and", "'pkg.normalize_name'", "in", "__salt__", ":", "_normalize_name", "=", "__salt__", "[", "'pkg.normalize_name'", "]", "else", ":", "_normalize_name", "=", "l...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
parse_targets
Parses the input to pkg.install and returns back the package(s) to be installed. Returns a list of packages, as well as a string noting whether the packages are to come from a repository or a binary package. CLI Example: .. code-block:: bash salt '*' pkg_resource.parse_targets
salt/modules/pkg_resource.py
def parse_targets(name=None, pkgs=None, sources=None, saltenv='base', normalize=True, **kwargs): ''' Parses the input to pkg.install and returns back the package(s) to be installed. Returns a list of packages, as well ...
def parse_targets(name=None, pkgs=None, sources=None, saltenv='base', normalize=True, **kwargs): ''' Parses the input to pkg.install and returns back the package(s) to be installed. Returns a list of packages, as well ...
[ "Parses", "the", "input", "to", "pkg", ".", "install", "and", "returns", "back", "the", "package", "(", "s", ")", "to", "be", "installed", ".", "Returns", "a", "list", "of", "packages", "as", "well", "as", "a", "string", "noting", "whether", "the", "pa...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkg_resource.py#L91-L177
[ "def", "parse_targets", "(", "name", "=", "None", ",", "pkgs", "=", "None", ",", "sources", "=", "None", ",", "saltenv", "=", "'base'", ",", "normalize", "=", "True", ",", "*", "*", "kwargs", ")", ":", "if", "'__env__'", "in", "kwargs", ":", "# \"env...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
version
Common interface for obtaining the version of installed packages. CLI Example: .. code-block:: bash salt '*' pkg_resource.version vim salt '*' pkg_resource.version foo bar baz salt '*' pkg_resource.version 'python*'
salt/modules/pkg_resource.py
def version(*names, **kwargs): ''' Common interface for obtaining the version of installed packages. CLI Example: .. code-block:: bash salt '*' pkg_resource.version vim salt '*' pkg_resource.version foo bar baz salt '*' pkg_resource.version 'python*' ''' ret = {} v...
def version(*names, **kwargs): ''' Common interface for obtaining the version of installed packages. CLI Example: .. code-block:: bash salt '*' pkg_resource.version vim salt '*' pkg_resource.version foo bar baz salt '*' pkg_resource.version 'python*' ''' ret = {} v...
[ "Common", "interface", "for", "obtaining", "the", "version", "of", "installed", "packages", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkg_resource.py#L180-L214
[ "def", "version", "(", "*", "names", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "}", "versions_as_list", "=", "salt", ".", "utils", ".", "data", ".", "is_true", "(", "kwargs", ".", "pop", "(", "'versions_as_list'", ",", "False", ")", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add_pkg
Add a package to a dict of installed packages. CLI Example: .. code-block:: bash salt '*' pkg_resource.add_pkg '{}' bind 9
salt/modules/pkg_resource.py
def add_pkg(pkgs, name, pkgver): ''' Add a package to a dict of installed packages. CLI Example: .. code-block:: bash salt '*' pkg_resource.add_pkg '{}' bind 9 ''' try: pkgs.setdefault(name, []).append(pkgver) except AttributeError as exc: log.exception(exc)
def add_pkg(pkgs, name, pkgver): ''' Add a package to a dict of installed packages. CLI Example: .. code-block:: bash salt '*' pkg_resource.add_pkg '{}' bind 9 ''' try: pkgs.setdefault(name, []).append(pkgver) except AttributeError as exc: log.exception(exc)
[ "Add", "a", "package", "to", "a", "dict", "of", "installed", "packages", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkg_resource.py#L217-L230
[ "def", "add_pkg", "(", "pkgs", ",", "name", ",", "pkgver", ")", ":", "try", ":", "pkgs", ".", "setdefault", "(", "name", ",", "[", "]", ")", ".", "append", "(", "pkgver", ")", "except", "AttributeError", "as", "exc", ":", "log", ".", "exception", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sort_pkglist
Accepts a dict obtained from pkg.list_pkgs() and sorts in place the list of versions for any packages that have multiple versions installed, so that two package lists can be compared to one another. CLI Example: .. code-block:: bash salt '*' pkg_resource.sort_pkglist '["3.45", "2.13"]'
salt/modules/pkg_resource.py
def sort_pkglist(pkgs): ''' Accepts a dict obtained from pkg.list_pkgs() and sorts in place the list of versions for any packages that have multiple versions installed, so that two package lists can be compared to one another. CLI Example: .. code-block:: bash salt '*' pkg_resource.so...
def sort_pkglist(pkgs): ''' Accepts a dict obtained from pkg.list_pkgs() and sorts in place the list of versions for any packages that have multiple versions installed, so that two package lists can be compared to one another. CLI Example: .. code-block:: bash salt '*' pkg_resource.so...
[ "Accepts", "a", "dict", "obtained", "from", "pkg", ".", "list_pkgs", "()", "and", "sorts", "in", "place", "the", "list", "of", "versions", "for", "any", "packages", "that", "have", "multiple", "versions", "installed", "so", "that", "two", "package", "lists",...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkg_resource.py#L233-L253
[ "def", "sort_pkglist", "(", "pkgs", ")", ":", "# It doesn't matter that ['4.9','4.10'] would be sorted to ['4.10','4.9'],", "# so long as the sorting is consistent.", "try", ":", "for", "key", "in", "pkgs", ":", "# Passing the pkglist to set() also removes duplicate version", "# numb...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
stringify
Takes a dict of package name/version information and joins each list of installed versions into a string. CLI Example: .. code-block:: bash salt '*' pkg_resource.stringify 'vim: 7.127'
salt/modules/pkg_resource.py
def stringify(pkgs): ''' Takes a dict of package name/version information and joins each list of installed versions into a string. CLI Example: .. code-block:: bash salt '*' pkg_resource.stringify 'vim: 7.127' ''' try: for key in pkgs: pkgs[key] = ','.join(pkgs...
def stringify(pkgs): ''' Takes a dict of package name/version information and joins each list of installed versions into a string. CLI Example: .. code-block:: bash salt '*' pkg_resource.stringify 'vim: 7.127' ''' try: for key in pkgs: pkgs[key] = ','.join(pkgs...
[ "Takes", "a", "dict", "of", "package", "name", "/", "version", "information", "and", "joins", "each", "list", "of", "installed", "versions", "into", "a", "string", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkg_resource.py#L256-L271
[ "def", "stringify", "(", "pkgs", ")", ":", "try", ":", "for", "key", "in", "pkgs", ":", "pkgs", "[", "key", "]", "=", "','", ".", "join", "(", "pkgs", "[", "key", "]", ")", "except", "AttributeError", "as", "exc", ":", "log", ".", "exception", "(...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
format_pkg_list
Formats packages according to parameters for list_pkgs.
salt/modules/pkg_resource.py
def format_pkg_list(packages, versions_as_list, attr): ''' Formats packages according to parameters for list_pkgs. ''' ret = copy.deepcopy(packages) if attr: requested_attr = {'epoch', 'version', 'release', 'arch', 'install_date', 'install_date_time_t'} if attr != 'all': ...
def format_pkg_list(packages, versions_as_list, attr): ''' Formats packages according to parameters for list_pkgs. ''' ret = copy.deepcopy(packages) if attr: requested_attr = {'epoch', 'version', 'release', 'arch', 'install_date', 'install_date_time_t'} if attr != 'all': ...
[ "Formats", "packages", "according", "to", "parameters", "for", "list_pkgs", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkg_resource.py#L308-L335
[ "def", "format_pkg_list", "(", "packages", ",", "versions_as_list", ",", "attr", ")", ":", "ret", "=", "copy", ".", "deepcopy", "(", "packages", ")", "if", "attr", ":", "requested_attr", "=", "{", "'epoch'", ",", "'version'", ",", "'release'", ",", "'arch'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
format_version
Formats a version string for list_pkgs.
salt/modules/pkg_resource.py
def format_version(epoch, version, release): ''' Formats a version string for list_pkgs. ''' full_version = '{0}:{1}'.format(epoch, version) if epoch else version if release: full_version += '-{0}'.format(release) return full_version
def format_version(epoch, version, release): ''' Formats a version string for list_pkgs. ''' full_version = '{0}:{1}'.format(epoch, version) if epoch else version if release: full_version += '-{0}'.format(release) return full_version
[ "Formats", "a", "version", "string", "for", "list_pkgs", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pkg_resource.py#L338-L345
[ "def", "format_version", "(", "epoch", ",", "version", ",", "release", ")", ":", "full_version", "=", "'{0}:{1}'", ".", "format", "(", "epoch", ",", "version", ")", "if", "epoch", "else", "version", "if", "release", ":", "full_version", "+=", "'-{0}'", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_make_set
Force var to be a set
salt/states/makeconf.py
def _make_set(var): ''' Force var to be a set ''' if var is None: return set() if not isinstance(var, list): if isinstance(var, six.string_types): var = var.split() else: var = list(var) return set(var)
def _make_set(var): ''' Force var to be a set ''' if var is None: return set() if not isinstance(var, list): if isinstance(var, six.string_types): var = var.split() else: var = list(var) return set(var)
[ "Force", "var", "to", "be", "a", "set" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/makeconf.py#L27-L38
[ "def", "_make_set", "(", "var", ")", ":", "if", "var", "is", "None", ":", "return", "set", "(", ")", "if", "not", "isinstance", "(", "var", ",", "list", ")", ":", "if", "isinstance", "(", "var", ",", "six", ".", "string_types", ")", ":", "var", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Verify that the variable is in the ``make.conf`` and has the provided settings. If value is set, contains and excludes will be ignored. name The variable name. This will automatically be converted to upper case since variables in ``make.conf`` are in upper case value Enforce that t...
salt/states/makeconf.py
def present(name, value=None, contains=None, excludes=None): ''' Verify that the variable is in the ``make.conf`` and has the provided settings. If value is set, contains and excludes will be ignored. name The variable name. This will automatically be converted to upper case since varia...
def present(name, value=None, contains=None, excludes=None): ''' Verify that the variable is in the ``make.conf`` and has the provided settings. If value is set, contains and excludes will be ignored. name The variable name. This will automatically be converted to upper case since varia...
[ "Verify", "that", "the", "variable", "is", "in", "the", "make", ".", "conf", "and", "has", "the", "provided", "settings", ".", "If", "value", "is", "set", "contains", "and", "excludes", "will", "be", "ignored", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/makeconf.py#L41-L162
[ "def", "present", "(", "name", ",", "value", "=", "None", ",", "contains", "=", "None", ",", "excludes", "=", "None", ")", ":", "ret", "=", "{", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", ",", "'name'", ":", "name", ",", "'result'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
Verify that the variable is not in the ``make.conf``. name The variable name. This will automatically be converted to upper case since variables in ``make.conf`` are in upper case
salt/states/makeconf.py
def absent(name): ''' Verify that the variable is not in the ``make.conf``. name The variable name. This will automatically be converted to upper case since variables in ``make.conf`` are in upper case ''' ret = {'changes': {}, 'comment': '', 'name': name, ...
def absent(name): ''' Verify that the variable is not in the ``make.conf``. name The variable name. This will automatically be converted to upper case since variables in ``make.conf`` are in upper case ''' ret = {'changes': {}, 'comment': '', 'name': name, ...
[ "Verify", "that", "the", "variable", "is", "not", "in", "the", "make", ".", "conf", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/makeconf.py#L165-L203
[ "def", "absent", "(", "name", ")", ":", "ret", "=", "{", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", ",", "'name'", ":", "name", ",", "'result'", ":", "True", "}", "# Make name all Uppers since make.conf uses all Upper vars", "upper_name", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
info
Return information for the specified user CLI Example: .. code-block:: bash salt '*' shadow.info root
salt/modules/solaris_shadow.py
def info(name): ''' Return information for the specified user CLI Example: .. code-block:: bash salt '*' shadow.info root ''' if HAS_SPWD: try: data = spwd.getspnam(name) ret = { 'name': data.sp_nam, 'passwd': data.sp_pwd...
def info(name): ''' Return information for the specified user CLI Example: .. code-block:: bash salt '*' shadow.info root ''' if HAS_SPWD: try: data = spwd.getspnam(name) ret = { 'name': data.sp_nam, 'passwd': data.sp_pwd...
[ "Return", "information", "for", "the", "specified", "user" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_shadow.py#L62-L161
[ "def", "info", "(", "name", ")", ":", "if", "HAS_SPWD", ":", "try", ":", "data", "=", "spwd", ".", "getspnam", "(", "name", ")", "ret", "=", "{", "'name'", ":", "data", ".", "sp_nam", ",", "'passwd'", ":", "data", ".", "sp_pwd", ",", "'lstchg'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_maxdays
Set the maximum number of days during which a password is valid. See man passwd. CLI Example: .. code-block:: bash salt '*' shadow.set_maxdays username 90
salt/modules/solaris_shadow.py
def set_maxdays(name, maxdays): ''' Set the maximum number of days during which a password is valid. See man passwd. CLI Example: .. code-block:: bash salt '*' shadow.set_maxdays username 90 ''' pre_info = info(name) if maxdays == pre_info['max']: return True cmd =...
def set_maxdays(name, maxdays): ''' Set the maximum number of days during which a password is valid. See man passwd. CLI Example: .. code-block:: bash salt '*' shadow.set_maxdays username 90 ''' pre_info = info(name) if maxdays == pre_info['max']: return True cmd =...
[ "Set", "the", "maximum", "number", "of", "days", "during", "which", "a", "password", "is", "valid", ".", "See", "man", "passwd", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_shadow.py#L164-L182
[ "def", "set_maxdays", "(", "name", ",", "maxdays", ")", ":", "pre_info", "=", "info", "(", "name", ")", "if", "maxdays", "==", "pre_info", "[", "'max'", "]", ":", "return", "True", "cmd", "=", "'passwd -x {0} {1}'", ".", "format", "(", "maxdays", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_mindays
Set the minimum number of days between password changes. See man passwd. CLI Example: .. code-block:: bash salt '*' shadow.set_mindays username 7
salt/modules/solaris_shadow.py
def set_mindays(name, mindays): ''' Set the minimum number of days between password changes. See man passwd. CLI Example: .. code-block:: bash salt '*' shadow.set_mindays username 7 ''' pre_info = info(name) if mindays == pre_info['min']: return True cmd = 'passwd -n {...
def set_mindays(name, mindays): ''' Set the minimum number of days between password changes. See man passwd. CLI Example: .. code-block:: bash salt '*' shadow.set_mindays username 7 ''' pre_info = info(name) if mindays == pre_info['min']: return True cmd = 'passwd -n {...
[ "Set", "the", "minimum", "number", "of", "days", "between", "password", "changes", ".", "See", "man", "passwd", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_shadow.py#L185-L203
[ "def", "set_mindays", "(", "name", ",", "mindays", ")", ":", "pre_info", "=", "info", "(", "name", ")", "if", "mindays", "==", "pre_info", "[", "'min'", "]", ":", "return", "True", "cmd", "=", "'passwd -n {0} {1}'", ".", "format", "(", "mindays", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
del_password
.. versionadded:: 2015.8.8 Delete the password from name user CLI Example: .. code-block:: bash salt '*' shadow.del_password username
salt/modules/solaris_shadow.py
def del_password(name): ''' .. versionadded:: 2015.8.8 Delete the password from name user CLI Example: .. code-block:: bash salt '*' shadow.del_password username ''' cmd = 'passwd -d {0}'.format(name) __salt__['cmd.run'](cmd, python_shell=False, output_loglevel='quiet') u...
def del_password(name): ''' .. versionadded:: 2015.8.8 Delete the password from name user CLI Example: .. code-block:: bash salt '*' shadow.del_password username ''' cmd = 'passwd -d {0}'.format(name) __salt__['cmd.run'](cmd, python_shell=False, output_loglevel='quiet') u...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "8" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_shadow.py#L248-L263
[ "def", "del_password", "(", "name", ")", ":", "cmd", "=", "'passwd -d {0}'", ".", "format", "(", "name", ")", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "False", ",", "output_loglevel", "=", "'quiet'", ")", "uinfo", "=", "in...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_password
Set the password for a named user. The password must be a properly defined hash, the password hash can be generated with this command: ``openssl passwd -1 <plaintext password>`` CLI Example: .. code-block:: bash salt '*' shadow.set_password root $1$UYCIxa628.9qXjpQCjM4a..
salt/modules/solaris_shadow.py
def set_password(name, password): ''' Set the password for a named user. The password must be a properly defined hash, the password hash can be generated with this command: ``openssl passwd -1 <plaintext password>`` CLI Example: .. code-block:: bash salt '*' shadow.set_password root $...
def set_password(name, password): ''' Set the password for a named user. The password must be a properly defined hash, the password hash can be generated with this command: ``openssl passwd -1 <plaintext password>`` CLI Example: .. code-block:: bash salt '*' shadow.set_password root $...
[ "Set", "the", "password", "for", "a", "named", "user", ".", "The", "password", "must", "be", "a", "properly", "defined", "hash", "the", "password", "hash", "can", "be", "generated", "with", "this", "command", ":", "openssl", "passwd", "-", "1", "<plaintext...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_shadow.py#L266-L296
[ "def", "set_password", "(", "name", ",", "password", ")", ":", "s_file", "=", "'/etc/shadow'", "ret", "=", "{", "}", "if", "not", "os", ".", "path", ".", "isfile", "(", "s_file", ")", ":", "return", "ret", "lines", "=", "[", "]", "with", "salt", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_warndays
Set the number of days of warning before a password change is required. See man passwd. CLI Example: .. code-block:: bash salt '*' shadow.set_warndays username 7
salt/modules/solaris_shadow.py
def set_warndays(name, warndays): ''' Set the number of days of warning before a password change is required. See man passwd. CLI Example: .. code-block:: bash salt '*' shadow.set_warndays username 7 ''' pre_info = info(name) if warndays == pre_info['warn']: return Tru...
def set_warndays(name, warndays): ''' Set the number of days of warning before a password change is required. See man passwd. CLI Example: .. code-block:: bash salt '*' shadow.set_warndays username 7 ''' pre_info = info(name) if warndays == pre_info['warn']: return Tru...
[ "Set", "the", "number", "of", "days", "of", "warning", "before", "a", "password", "change", "is", "required", ".", "See", "man", "passwd", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/solaris_shadow.py#L299-L318
[ "def", "set_warndays", "(", "name", ",", "warndays", ")", ":", "pre_info", "=", "info", "(", "name", ")", "if", "warndays", "==", "pre_info", "[", "'warn'", "]", ":", "return", "True", "cmd", "=", "'passwd -w {0} {1}'", ".", "format", "(", "warndays", ",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ext_pillar
Checkout the ext_pillar sources and compile the resulting pillar SLS
salt/pillar/git_pillar.py
def ext_pillar(minion_id, pillar, *repos): # pylint: disable=unused-argument ''' Checkout the ext_pillar sources and compile the resulting pillar SLS ''' opts = copy.deepcopy(__opts__) opts['pillar_roots'] = {} opts['__git_pillar'] = True git_pillar = salt.utils.gitfs.GitPillar( opt...
def ext_pillar(minion_id, pillar, *repos): # pylint: disable=unused-argument ''' Checkout the ext_pillar sources and compile the resulting pillar SLS ''' opts = copy.deepcopy(__opts__) opts['pillar_roots'] = {} opts['__git_pillar'] = True git_pillar = salt.utils.gitfs.GitPillar( opt...
[ "Checkout", "the", "ext_pillar", "sources", "and", "compile", "the", "resulting", "pillar", "SLS" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/git_pillar.py#L401-L478
[ "def", "ext_pillar", "(", "minion_id", ",", "pillar", ",", "*", "repos", ")", ":", "# pylint: disable=unused-argument", "opts", "=", "copy", ".", "deepcopy", "(", "__opts__", ")", "opts", "[", "'pillar_roots'", "]", "=", "{", "}", "opts", "[", "'__git_pillar...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_execute_command
Helper function to execute the command :param str cmd: the command to run :param str at_time: If passed, the cmd will be scheduled. Returns: bool
salt/modules/mac_system.py
def _execute_command(cmd, at_time=None): ''' Helper function to execute the command :param str cmd: the command to run :param str at_time: If passed, the cmd will be scheduled. Returns: bool ''' if at_time: cmd = 'echo \'{0}\' | at {1}'.format(cmd, _cmd_quote(at_time)) return ...
def _execute_command(cmd, at_time=None): ''' Helper function to execute the command :param str cmd: the command to run :param str at_time: If passed, the cmd will be scheduled. Returns: bool ''' if at_time: cmd = 'echo \'{0}\' | at {1}'.format(cmd, _cmd_quote(at_time)) return ...
[ "Helper", "function", "to", "execute", "the", "command" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_system.py#L68-L80
[ "def", "_execute_command", "(", "cmd", ",", "at_time", "=", "None", ")", ":", "if", "at_time", ":", "cmd", "=", "'echo \\'{0}\\' | at {1}'", ".", "format", "(", "cmd", ",", "_cmd_quote", "(", "at_time", ")", ")", "return", "not", "bool", "(", "__salt__", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_remote_login
Set the remote login (SSH) to either on or off. :param bool enable: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False respectively :return: True if successful, False if not :rtype: bool CLI Exampl...
salt/modules/mac_system.py
def set_remote_login(enable): ''' Set the remote login (SSH) to either on or off. :param bool enable: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False respectively :return: True if successful, Fal...
def set_remote_login(enable): ''' Set the remote login (SSH) to either on or off. :param bool enable: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False respectively :return: True if successful, Fal...
[ "Set", "the", "remote", "login", "(", "SSH", ")", "to", "either", "on", "or", "off", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_system.py#L221-L245
[ "def", "set_remote_login", "(", "enable", ")", ":", "state", "=", "__utils__", "[", "'mac_utils.validate_enabled'", "]", "(", "enable", ")", "cmd", "=", "'systemsetup -f -setremotelogin {0}'", ".", "format", "(", "state", ")", "__utils__", "[", "'mac_utils.execute_r...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_remote_events
Set whether the server responds to events sent by other computers (such as AppleScripts) :param bool enable: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False respectively :return: True if successful, ...
salt/modules/mac_system.py
def set_remote_events(enable): ''' Set whether the server responds to events sent by other computers (such as AppleScripts) :param bool enable: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False resp...
def set_remote_events(enable): ''' Set whether the server responds to events sent by other computers (such as AppleScripts) :param bool enable: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False resp...
[ "Set", "whether", "the", "server", "responds", "to", "events", "sent", "by", "other", "computers", "(", "such", "as", "AppleScripts", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_system.py#L270-L297
[ "def", "set_remote_events", "(", "enable", ")", ":", "state", "=", "__utils__", "[", "'mac_utils.validate_enabled'", "]", "(", "enable", ")", "cmd", "=", "'systemsetup -setremoteappleevents {0}'", ".", "format", "(", "state", ")", "__utils__", "[", "'mac_utils.execu...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_computer_name
Set the computer name :param str name: The new computer name :return: True if successful, False if not :rtype: bool CLI Example: .. code-block:: bash salt '*' system.set_computer_name "Mike's Mac"
salt/modules/mac_system.py
def set_computer_name(name): ''' Set the computer name :param str name: The new computer name :return: True if successful, False if not :rtype: bool CLI Example: .. code-block:: bash salt '*' system.set_computer_name "Mike's Mac" ''' cmd = 'systemsetup -setcomputername "...
def set_computer_name(name): ''' Set the computer name :param str name: The new computer name :return: True if successful, False if not :rtype: bool CLI Example: .. code-block:: bash salt '*' system.set_computer_name "Mike's Mac" ''' cmd = 'systemsetup -setcomputername "...
[ "Set", "the", "computer", "name" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_system.py#L319-L340
[ "def", "set_computer_name", "(", "name", ")", ":", "cmd", "=", "'systemsetup -setcomputername \"{0}\"'", ".", "format", "(", "name", ")", "__utils__", "[", "'mac_utils.execute_return_success'", "]", "(", "cmd", ")", "return", "__utils__", "[", "'mac_utils.confirm_upda...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_subnet_name
Set the local subnet name :param str name: The new local subnet name .. note:: Spaces are changed to dashes. Other special characters are removed. :return: True if successful, False if not :rtype: bool CLI Example: .. code-block:: bash The following will be set as 'Mikes-Mac...
salt/modules/mac_system.py
def set_subnet_name(name): ''' Set the local subnet name :param str name: The new local subnet name .. note:: Spaces are changed to dashes. Other special characters are removed. :return: True if successful, False if not :rtype: bool CLI Example: .. code-block:: bash ...
def set_subnet_name(name): ''' Set the local subnet name :param str name: The new local subnet name .. note:: Spaces are changed to dashes. Other special characters are removed. :return: True if successful, False if not :rtype: bool CLI Example: .. code-block:: bash ...
[ "Set", "the", "local", "subnet", "name" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_system.py#L362-L387
[ "def", "set_subnet_name", "(", "name", ")", ":", "cmd", "=", "'systemsetup -setlocalsubnetname \"{0}\"'", ".", "format", "(", "name", ")", "__utils__", "[", "'mac_utils.execute_return_success'", "]", "(", "cmd", ")", "return", "__utils__", "[", "'mac_utils.confirm_upd...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_startup_disk
Set the current startup disk to the indicated path. Use ``system.list_startup_disks`` to find valid startup disks on the system. :param str path: The valid startup disk path :return: True if successful, False if not :rtype: bool CLI Example: .. code-block:: bash salt '*' system.set_...
salt/modules/mac_system.py
def set_startup_disk(path): ''' Set the current startup disk to the indicated path. Use ``system.list_startup_disks`` to find valid startup disks on the system. :param str path: The valid startup disk path :return: True if successful, False if not :rtype: bool CLI Example: .. code-bl...
def set_startup_disk(path): ''' Set the current startup disk to the indicated path. Use ``system.list_startup_disks`` to find valid startup disks on the system. :param str path: The valid startup disk path :return: True if successful, False if not :rtype: bool CLI Example: .. code-bl...
[ "Set", "the", "current", "startup", "disk", "to", "the", "indicated", "path", ".", "Use", "system", ".", "list_startup_disks", "to", "find", "valid", "startup", "disks", "on", "the", "system", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_system.py#L428-L457
[ "def", "set_startup_disk", "(", "path", ")", ":", "if", "path", "not", "in", "list_startup_disks", "(", ")", ":", "msg", "=", "'Invalid value passed for path.\\n'", "'Must be a valid startup disk as found in '", "'system.list_startup_disks.\\n'", "'Passed: {0}'", ".", "form...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_restart_delay
Set the number of seconds after which the computer will start up after a power failure. .. warning:: This command fails with the following error: ``Error, IOServiceOpen returned 0x10000003`` The setting is not updated. This is an apple bug. It seems like it may only work on c...
salt/modules/mac_system.py
def set_restart_delay(seconds): ''' Set the number of seconds after which the computer will start up after a power failure. .. warning:: This command fails with the following error: ``Error, IOServiceOpen returned 0x10000003`` The setting is not updated. This is an apple bug....
def set_restart_delay(seconds): ''' Set the number of seconds after which the computer will start up after a power failure. .. warning:: This command fails with the following error: ``Error, IOServiceOpen returned 0x10000003`` The setting is not updated. This is an apple bug....
[ "Set", "the", "number", "of", "seconds", "after", "which", "the", "computer", "will", "start", "up", "after", "a", "power", "failure", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_system.py#L481-L521
[ "def", "set_restart_delay", "(", "seconds", ")", ":", "if", "seconds", "%", "30", "!=", "0", ":", "msg", "=", "'Invalid value passed for seconds.\\n'", "'Must be a multiple of 30.\\n'", "'Passed: {0}'", ".", "format", "(", "seconds", ")", "raise", "SaltInvocationError...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_disable_keyboard_on_lock
Get whether or not the keyboard should be disabled when the X Serve enclosure lock is engaged. :param bool enable: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent True and False respectively :return: True if succes...
salt/modules/mac_system.py
def set_disable_keyboard_on_lock(enable): ''' Get whether or not the keyboard should be disabled when the X Serve enclosure lock is engaged. :param bool enable: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent Tr...
def set_disable_keyboard_on_lock(enable): ''' Get whether or not the keyboard should be disabled when the X Serve enclosure lock is engaged. :param bool enable: True to enable, False to disable. "On" and "Off" are also acceptable values. Additionally you can pass 1 and 0 to represent Tr...
[ "Get", "whether", "or", "not", "the", "keyboard", "should", "be", "disabled", "when", "the", "X", "Serve", "enclosure", "lock", "is", "engaged", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_system.py#L547-L575
[ "def", "set_disable_keyboard_on_lock", "(", "enable", ")", ":", "state", "=", "__utils__", "[", "'mac_utils.validate_enabled'", "]", "(", "enable", ")", "cmd", "=", "'systemsetup -setdisablekeyboardwhenenclosurelockisengaged '", "'{0}'", ".", "format", "(", "state", ")"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_boot_arch
Set the kernel to boot in 32 or 64 bit mode on next boot. .. note:: When this function fails with the error ``changes to kernel architecture failed to save!``, then the boot arch is not updated. This is either an Apple bug, not available on the test system, or a result of system fil...
salt/modules/mac_system.py
def set_boot_arch(arch='default'): ''' Set the kernel to boot in 32 or 64 bit mode on next boot. .. note:: When this function fails with the error ``changes to kernel architecture failed to save!``, then the boot arch is not updated. This is either an Apple bug, not available on the...
def set_boot_arch(arch='default'): ''' Set the kernel to boot in 32 or 64 bit mode on next boot. .. note:: When this function fails with the error ``changes to kernel architecture failed to save!``, then the boot arch is not updated. This is either an Apple bug, not available on the...
[ "Set", "the", "kernel", "to", "boot", "in", "32", "or", "64", "bit", "mode", "on", "next", "boot", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_system.py#L606-L644
[ "def", "set_boot_arch", "(", "arch", "=", "'default'", ")", ":", "if", "arch", "not", "in", "[", "'i386'", ",", "'x86_64'", ",", "'default'", "]", ":", "msg", "=", "'Invalid value passed for arch.\\n'", "'Must be i386, x86_64, or default.\\n'", "'Passed: {0}'", ".",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_target_group
Create target group if not present. name (string) - The name of the target group. protocol (string) - The protocol to use for routing traffic to the targets port (int) - The port on which the targets receive traffic. This port is used unless you specify a port override when ...
salt/modules/boto_elbv2.py
def create_target_group(name, protocol, port, vpc_id, region=None, key=None, keyid=None, profile=None, health_check_protocol='HT...
def create_target_group(name, protocol, port, vpc_id, region=None, key=None, keyid=None, profile=None, health_check_protocol='HT...
[ "Create", "target", "group", "if", "not", "present", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elbv2.py#L79-L163
[ "def", "create_target_group", "(", "name", ",", "protocol", ",", "port", ",", "vpc_id", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ",", "health_check_protocol", "=", "'HTTP'", ",", "health...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_target_group
Delete target group. name (string) - Target Group Name or Amazon Resource Name (ARN). returns (bool) - True on success, False on failure. CLI example: .. code-block:: bash salt myminion boto_elbv2.delete_target_group arn:aws:elasticloadbalancing:us-west-2:644138682826:target...
salt/modules/boto_elbv2.py
def delete_target_group(name, region=None, key=None, keyid=None, profile=None): ''' Delete target group. name (string) - Target Group Name or Amazon Resource Name (ARN). returns (bool) - Tru...
def delete_target_group(name, region=None, key=None, keyid=None, profile=None): ''' Delete target group. name (string) - Target Group Name or Amazon Resource Name (ARN). returns (bool) - Tru...
[ "Delete", "target", "group", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elbv2.py#L166-L206
[ "def", "delete_target_group", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
target_group_exists
Check to see if an target group exists. CLI example: .. code-block:: bash salt myminion boto_elbv2.target_group_exists arn:aws:elasticloadbalancing:us-west-2:644138682826:targetgroup/learn1give1-api/414788a16b5cf163
salt/modules/boto_elbv2.py
def target_group_exists(name, region=None, key=None, keyid=None, profile=None): ''' Check to see if an target group exists. CLI example: .. code-block:: bash salt myminion boto_elbv2.target_group_e...
def target_group_exists(name, region=None, key=None, keyid=None, profile=None): ''' Check to see if an target group exists. CLI example: .. code-block:: bash salt myminion boto_elbv2.target_group_e...
[ "Check", "to", "see", "if", "an", "target", "group", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elbv2.py#L209-L237
[ "def", "target_group_exists", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
describe_target_health
Get the curret health check status for targets in a target group. CLI example: .. code-block:: bash salt myminion boto_elbv2.describe_target_health arn:aws:elasticloadbalancing:us-west-2:644138682826:targetgroup/learn1give1-api/414788a16b5cf163 targets=["i-isdf23ifjf"]
salt/modules/boto_elbv2.py
def describe_target_health(name, targets=None, region=None, key=None, keyid=None, profile=None): ''' Get the curret health check status for targets in a target group. CLI e...
def describe_target_health(name, targets=None, region=None, key=None, keyid=None, profile=None): ''' Get the curret health check status for targets in a target group. CLI e...
[ "Get", "the", "curret", "health", "check", "status", "for", "targets", "in", "a", "target", "group", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elbv2.py#L240-L272
[ "def", "describe_target_health", "(", "name", ",", "targets", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
register_targets
Register targets to a target froup of an ALB. ``targets`` is either a instance id string or a list of instance id's. Returns: - ``True``: instance(s) registered successfully - ``False``: instance(s) failed to be registered CLI example: .. code-block:: bash salt myminion boto_elbv2.r...
salt/modules/boto_elbv2.py
def register_targets(name, targets, region=None, key=None, keyid=None, profile=None): ''' Register targets to a target froup of an ALB. ``targets`` is either a instance id string or a list of instance id...
def register_targets(name, targets, region=None, key=None, keyid=None, profile=None): ''' Register targets to a target froup of an ALB. ``targets`` is either a instance id string or a list of instance id...
[ "Register", "targets", "to", "a", "target", "froup", "of", "an", "ALB", ".", "targets", "is", "either", "a", "instance", "id", "string", "or", "a", "list", "of", "instance", "id", "s", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elbv2.py#L275-L312
[ "def", "register_targets", "(", "name", ",", "targets", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "targetsdict", "=", "[", "]", "if", "isinstance", "(", "targets", ",", "six...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
describe_load_balancers
Describes the specified load balancer or all of your load balancers. Returns: list CLI example: .. code-block:: bash salt myminion boto_elbv2.describe_load_balancers salt myminion boto_elbv2.describe_load_balancers alb_name salt myminion boto_elbv2.describe_load_balancers "[alb_n...
salt/modules/boto_elbv2.py
def describe_load_balancers(names=None, load_balancer_arns=None, region=None, key=None, keyid=None, profile=None): ''' Describes the specified load balancer or all of your ...
def describe_load_balancers(names=None, load_balancer_arns=None, region=None, key=None, keyid=None, profile=None): ''' Describes the specified load balancer or all of your ...
[ "Describes", "the", "specified", "load", "balancer", "or", "all", "of", "your", "load", "balancers", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elbv2.py#L355-L414
[ "def", "describe_load_balancers", "(", "names", "=", "None", ",", "load_balancer_arns", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "if", "names", "and", "load_balanc...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
describe_target_groups
Describes the specified target groups or all of your target groups. By default, all target groups are described. Alternatively, you can specify one of the following to filter the results: the ARN of the load balancer, the names of one or more target groups, or the ARNs of one or more target groups. Ret...
salt/modules/boto_elbv2.py
def describe_target_groups(names=None, target_group_arns=None, load_balancer_arn=None, region=None, key=None, keyid=None, profile=None): ''' Describes...
def describe_target_groups(names=None, target_group_arns=None, load_balancer_arn=None, region=None, key=None, keyid=None, profile=None): ''' Describes...
[ "Describes", "the", "specified", "target", "groups", "or", "all", "of", "your", "target", "groups", ".", "By", "default", "all", "target", "groups", "are", "described", ".", "Alternatively", "you", "can", "specify", "one", "of", "the", "following", "to", "fi...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_elbv2.py#L417-L482
[ "def", "describe_target_groups", "(", "names", "=", "None", ",", "target_group_arns", "=", "None", ",", "load_balancer_arn", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_parameter
Retrives a parameter from SSM Parameter Store .. versionadded:: Neon .. code-block:: text salt-call boto_ssm.get_parameter test-param withdescription=True
salt/modules/boto_ssm.py
def get_parameter(name, withdecryption=False, resp_json=False, region=None, key=None, keyid=None, profile=None): ''' Retrives a parameter from SSM Parameter Store .. versionadded:: Neon .. code-block:: text salt-call boto_ssm.get_parameter test-param withdescription=True ''' conn = __...
def get_parameter(name, withdecryption=False, resp_json=False, region=None, key=None, keyid=None, profile=None): ''' Retrives a parameter from SSM Parameter Store .. versionadded:: Neon .. code-block:: text salt-call boto_ssm.get_parameter test-param withdescription=True ''' conn = __...
[ "Retrives", "a", "parameter", "from", "SSM", "Parameter", "Store" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ssm.py#L37-L57
[ "def", "get_parameter", "(", "name", ",", "withdecryption", "=", "False", ",", "resp_json", "=", "False", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "__utils__", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
put_parameter
Sets a parameter in the SSM parameter store .. versionadded:: Neon .. code-block:: text salt-call boto_ssm.put_parameter test-param test_value Type=SecureString KeyId=alias/aws/ssm Description='test encrypted key'
salt/modules/boto_ssm.py
def put_parameter(Name, Value, Description=None, Type='String', KeyId=None, Overwrite=False, AllowedPattern=None, region=None, key=None, keyid=None, ...
def put_parameter(Name, Value, Description=None, Type='String', KeyId=None, Overwrite=False, AllowedPattern=None, region=None, key=None, keyid=None, ...
[ "Sets", "a", "parameter", "in", "the", "SSM", "parameter", "store" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ssm.py#L60-L100
[ "def", "put_parameter", "(", "Name", ",", "Value", ",", "Description", "=", "None", ",", "Type", "=", "'String'", ",", "KeyId", "=", "None", ",", "Overwrite", "=", "False", ",", "AllowedPattern", "=", "None", ",", "region", "=", "None", ",", "key", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_parameter
Removes a parameter from the SSM parameter store .. versionadded:: Neon .. code-block:: text salt-call boto_ssm.delete_parameter test-param
salt/modules/boto_ssm.py
def delete_parameter(Name, region=None, key=None, keyid=None, profile=None): ''' Removes a parameter from the SSM parameter store .. versionadded:: Neon .. code-block:: text salt-call boto_ssm.delete_parameter test-param ''' conn = __utils__['boto3.get_connection']('ssm', region=region...
def delete_parameter(Name, region=None, key=None, keyid=None, profile=None): ''' Removes a parameter from the SSM parameter store .. versionadded:: Neon .. code-block:: text salt-call boto_ssm.delete_parameter test-param ''' conn = __utils__['boto3.get_connection']('ssm', region=region...
[ "Removes", "a", "parameter", "from", "the", "SSM", "parameter", "store" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_ssm.py#L103-L121
[ "def", "delete_parameter", "(", "Name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "__utils__", "[", "'boto3.get_connection'", "]", "(", "'ssm'", ",", "region", "=...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
base64_b64encode
Encode a string as base64 using the "modern" Python interface. Among other possible differences, the "modern" encoder does not include newline ('\\n') characters in the encoded output.
salt/utils/hashutils.py
def base64_b64encode(instr): ''' Encode a string as base64 using the "modern" Python interface. Among other possible differences, the "modern" encoder does not include newline ('\\n') characters in the encoded output. ''' return salt.utils.stringutils.to_unicode( base64.b64encode(salt.u...
def base64_b64encode(instr): ''' Encode a string as base64 using the "modern" Python interface. Among other possible differences, the "modern" encoder does not include newline ('\\n') characters in the encoded output. ''' return salt.utils.stringutils.to_unicode( base64.b64encode(salt.u...
[ "Encode", "a", "string", "as", "base64", "using", "the", "modern", "Python", "interface", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L24-L34
[ "def", "base64_b64encode", "(", "instr", ")", ":", "return", "salt", ".", "utils", ".", "stringutils", ".", "to_unicode", "(", "base64", ".", "b64encode", "(", "salt", ".", "utils", ".", "stringutils", ".", "to_bytes", "(", "instr", ")", ")", ",", "encod...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
base64_b64decode
Decode a base64-encoded string using the "modern" Python interface.
salt/utils/hashutils.py
def base64_b64decode(instr): ''' Decode a base64-encoded string using the "modern" Python interface. ''' decoded = base64.b64decode(salt.utils.stringutils.to_bytes(instr)) try: return salt.utils.stringutils.to_unicode( decoded, encoding='utf8' if salt.utils.platform.i...
def base64_b64decode(instr): ''' Decode a base64-encoded string using the "modern" Python interface. ''' decoded = base64.b64decode(salt.utils.stringutils.to_bytes(instr)) try: return salt.utils.stringutils.to_unicode( decoded, encoding='utf8' if salt.utils.platform.i...
[ "Decode", "a", "base64", "-", "encoded", "string", "using", "the", "modern", "Python", "interface", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L38-L49
[ "def", "base64_b64decode", "(", "instr", ")", ":", "decoded", "=", "base64", ".", "b64decode", "(", "salt", ".", "utils", ".", "stringutils", ".", "to_bytes", "(", "instr", ")", ")", "try", ":", "return", "salt", ".", "utils", ".", "stringutils", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
base64_encodestring
Encode a string as base64 using the "legacy" Python interface. Among other possible differences, the "legacy" encoder includes a newline ('\\n') character after every 76 characters and always at the end of the encoded string.
salt/utils/hashutils.py
def base64_encodestring(instr): ''' Encode a string as base64 using the "legacy" Python interface. Among other possible differences, the "legacy" encoder includes a newline ('\\n') character after every 76 characters and always at the end of the encoded string. ''' return salt.utils.stringu...
def base64_encodestring(instr): ''' Encode a string as base64 using the "legacy" Python interface. Among other possible differences, the "legacy" encoder includes a newline ('\\n') character after every 76 characters and always at the end of the encoded string. ''' return salt.utils.stringu...
[ "Encode", "a", "string", "as", "base64", "using", "the", "legacy", "Python", "interface", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L52-L63
[ "def", "base64_encodestring", "(", "instr", ")", ":", "return", "salt", ".", "utils", ".", "stringutils", ".", "to_unicode", "(", "base64", ".", "encodestring", "(", "salt", ".", "utils", ".", "stringutils", ".", "to_bytes", "(", "instr", ")", ")", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
base64_decodestring
Decode a base64-encoded string using the "legacy" Python interface.
salt/utils/hashutils.py
def base64_decodestring(instr): ''' Decode a base64-encoded string using the "legacy" Python interface. ''' b = salt.utils.stringutils.to_bytes(instr) try: # PY3 decoded = base64.decodebytes(b) except AttributeError: # PY2 decoded = base64.decodestring(b) try:...
def base64_decodestring(instr): ''' Decode a base64-encoded string using the "legacy" Python interface. ''' b = salt.utils.stringutils.to_bytes(instr) try: # PY3 decoded = base64.decodebytes(b) except AttributeError: # PY2 decoded = base64.decodestring(b) try:...
[ "Decode", "a", "base64", "-", "encoded", "string", "using", "the", "legacy", "Python", "interface", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L66-L83
[ "def", "base64_decodestring", "(", "instr", ")", ":", "b", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_bytes", "(", "instr", ")", "try", ":", "# PY3", "decoded", "=", "base64", ".", "decodebytes", "(", "b", ")", "except", "AttributeError", ":...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
md5_digest
Generate an md5 hash of a given string.
salt/utils/hashutils.py
def md5_digest(instr): ''' Generate an md5 hash of a given string. ''' return salt.utils.stringutils.to_unicode( hashlib.md5(salt.utils.stringutils.to_bytes(instr)).hexdigest() )
def md5_digest(instr): ''' Generate an md5 hash of a given string. ''' return salt.utils.stringutils.to_unicode( hashlib.md5(salt.utils.stringutils.to_bytes(instr)).hexdigest() )
[ "Generate", "an", "md5", "hash", "of", "a", "given", "string", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L87-L93
[ "def", "md5_digest", "(", "instr", ")", ":", "return", "salt", ".", "utils", ".", "stringutils", ".", "to_unicode", "(", "hashlib", ".", "md5", "(", "salt", ".", "utils", ".", "stringutils", ".", "to_bytes", "(", "instr", ")", ")", ".", "hexdigest", "(...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sha1_digest
Generate an sha1 hash of a given string.
salt/utils/hashutils.py
def sha1_digest(instr): ''' Generate an sha1 hash of a given string. ''' if six.PY3: b = salt.utils.stringutils.to_bytes(instr) return hashlib.sha1(b).hexdigest() return hashlib.sha1(instr).hexdigest()
def sha1_digest(instr): ''' Generate an sha1 hash of a given string. ''' if six.PY3: b = salt.utils.stringutils.to_bytes(instr) return hashlib.sha1(b).hexdigest() return hashlib.sha1(instr).hexdigest()
[ "Generate", "an", "sha1", "hash", "of", "a", "given", "string", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L96-L103
[ "def", "sha1_digest", "(", "instr", ")", ":", "if", "six", ".", "PY3", ":", "b", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_bytes", "(", "instr", ")", "return", "hashlib", ".", "sha1", "(", "b", ")", ".", "hexdigest", "(", ")", "return...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sha256_digest
Generate a sha256 hash of a given string.
salt/utils/hashutils.py
def sha256_digest(instr): ''' Generate a sha256 hash of a given string. ''' return salt.utils.stringutils.to_unicode( hashlib.sha256(salt.utils.stringutils.to_bytes(instr)).hexdigest() )
def sha256_digest(instr): ''' Generate a sha256 hash of a given string. ''' return salt.utils.stringutils.to_unicode( hashlib.sha256(salt.utils.stringutils.to_bytes(instr)).hexdigest() )
[ "Generate", "a", "sha256", "hash", "of", "a", "given", "string", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L107-L113
[ "def", "sha256_digest", "(", "instr", ")", ":", "return", "salt", ".", "utils", ".", "stringutils", ".", "to_unicode", "(", "hashlib", ".", "sha256", "(", "salt", ".", "utils", ".", "stringutils", ".", "to_bytes", "(", "instr", ")", ")", ".", "hexdigest"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sha512_digest
Generate a sha512 hash of a given string
salt/utils/hashutils.py
def sha512_digest(instr): ''' Generate a sha512 hash of a given string ''' return salt.utils.stringutils.to_unicode( hashlib.sha512(salt.utils.stringutils.to_bytes(instr)).hexdigest() )
def sha512_digest(instr): ''' Generate a sha512 hash of a given string ''' return salt.utils.stringutils.to_unicode( hashlib.sha512(salt.utils.stringutils.to_bytes(instr)).hexdigest() )
[ "Generate", "a", "sha512", "hash", "of", "a", "given", "string" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L117-L123
[ "def", "sha512_digest", "(", "instr", ")", ":", "return", "salt", ".", "utils", ".", "stringutils", ".", "to_unicode", "(", "hashlib", ".", "sha512", "(", "salt", ".", "utils", ".", "stringutils", ".", "to_bytes", "(", "instr", ")", ")", ".", "hexdigest"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
hmac_signature
Verify a challenging hmac signature against a string / shared-secret Returns a boolean if the verification succeeded or failed.
salt/utils/hashutils.py
def hmac_signature(string, shared_secret, challenge_hmac): ''' Verify a challenging hmac signature against a string / shared-secret Returns a boolean if the verification succeeded or failed. ''' msg = salt.utils.stringutils.to_bytes(string) key = salt.utils.stringutils.to_bytes(shared_secret) ...
def hmac_signature(string, shared_secret, challenge_hmac): ''' Verify a challenging hmac signature against a string / shared-secret Returns a boolean if the verification succeeded or failed. ''' msg = salt.utils.stringutils.to_bytes(string) key = salt.utils.stringutils.to_bytes(shared_secret) ...
[ "Verify", "a", "challenging", "hmac", "signature", "against", "a", "string", "/", "shared", "-", "secret", "Returns", "a", "boolean", "if", "the", "verification", "succeeded", "or", "failed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L127-L137
[ "def", "hmac_signature", "(", "string", ",", "shared_secret", ",", "challenge_hmac", ")", ":", "msg", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_bytes", "(", "string", ")", "key", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_bytes",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
random_hash
Return a hash of a randomized data from random.SystemRandom()
salt/utils/hashutils.py
def random_hash(size=9999999999, hash_type=None): ''' Return a hash of a randomized data from random.SystemRandom() ''' if not hash_type: hash_type = 'md5' hasher = getattr(hashlib, hash_type) return hasher(salt.utils.stringutils.to_bytes(six.text_type(random.SystemRandom().randint(0, si...
def random_hash(size=9999999999, hash_type=None): ''' Return a hash of a randomized data from random.SystemRandom() ''' if not hash_type: hash_type = 'md5' hasher = getattr(hashlib, hash_type) return hasher(salt.utils.stringutils.to_bytes(six.text_type(random.SystemRandom().randint(0, si...
[ "Return", "a", "hash", "of", "a", "randomized", "data", "from", "random", ".", "SystemRandom", "()" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L141-L148
[ "def", "random_hash", "(", "size", "=", "9999999999", ",", "hash_type", "=", "None", ")", ":", "if", "not", "hash_type", ":", "hash_type", "=", "'md5'", "hasher", "=", "getattr", "(", "hashlib", ",", "hash_type", ")", "return", "hasher", "(", "salt", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_hash
Get the hash sum of a file This is better than ``get_sum`` for the following reasons: - It does not read the entire file into memory. - It does not return a string on error. The returned value of ``get_sum`` cannot really be trusted since it is vulnerable to collisions: ``ge...
salt/utils/hashutils.py
def get_hash(path, form='sha256', chunk_size=65536): ''' Get the hash sum of a file This is better than ``get_sum`` for the following reasons: - It does not read the entire file into memory. - It does not return a string on error. The returned value of ``get_sum`` cannot really ...
def get_hash(path, form='sha256', chunk_size=65536): ''' Get the hash sum of a file This is better than ``get_sum`` for the following reasons: - It does not read the entire file into memory. - It does not return a string on error. The returned value of ``get_sum`` cannot really ...
[ "Get", "the", "hash", "sum", "of", "a", "file" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L152-L171
[ "def", "get_hash", "(", "path", ",", "form", "=", "'sha256'", ",", "chunk_size", "=", "65536", ")", ":", "hash_type", "=", "hasattr", "(", "hashlib", ",", "form", ")", "and", "getattr", "(", "hashlib", ",", "form", ")", "or", "None", "if", "hash_type",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
DigestCollector.add
Update digest with the file content by path. :param path: :return:
salt/utils/hashutils.py
def add(self, path): ''' Update digest with the file content by path. :param path: :return: ''' with salt.utils.files.fopen(path, 'rb') as ifile: for chunk in iter(lambda: ifile.read(self.__buff), b''): self.__digest.update(chunk)
def add(self, path): ''' Update digest with the file content by path. :param path: :return: ''' with salt.utils.files.fopen(path, 'rb') as ifile: for chunk in iter(lambda: ifile.read(self.__buff), b''): self.__digest.update(chunk)
[ "Update", "digest", "with", "the", "file", "content", "by", "path", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L189-L198
[ "def", "add", "(", "self", ",", "path", ")", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "path", ",", "'rb'", ")", "as", "ifile", ":", "for", "chunk", "in", "iter", "(", "lambda", ":", "ifile", ".", "read", "(", "self", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
DigestCollector.digest
Get digest. :return:
salt/utils/hashutils.py
def digest(self): ''' Get digest. :return: ''' return salt.utils.stringutils.to_str(self.__digest.hexdigest() + os.linesep)
def digest(self): ''' Get digest. :return: ''' return salt.utils.stringutils.to_str(self.__digest.hexdigest() + os.linesep)
[ "Get", "digest", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/hashutils.py#L200-L207
[ "def", "digest", "(", "self", ")", ":", "return", "salt", ".", "utils", ".", "stringutils", ".", "to_str", "(", "self", ".", "__digest", ".", "hexdigest", "(", ")", "+", "os", ".", "linesep", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_load_properties
Load properties for the cassandra module from config or pillar. :param property_name: The property to load. :type property_name: str or list of str :param config_option: The name of the config option. :type config_option: str :param set_default: Should a default be set if not found in config. ...
salt/modules/cassandra_cql.py
def _load_properties(property_name, config_option, set_default=False, default=None): ''' Load properties for the cassandra module from config or pillar. :param property_name: The property to load. :type property_name: str or list of str :param config_option: The name of the config option. :typ...
def _load_properties(property_name, config_option, set_default=False, default=None): ''' Load properties for the cassandra module from config or pillar. :param property_name: The property to load. :type property_name: str or list of str :param config_option: The name of the config option. :typ...
[ "Load", "properties", "for", "the", "cassandra", "module", "from", "config", "or", "pillar", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L135-L167
[ "def", "_load_properties", "(", "property_name", ",", "config_option", ",", "set_default", "=", "False", ",", "default", "=", "None", ")", ":", "if", "not", "property_name", ":", "log", ".", "debug", "(", "\"No property specified in function, trying to load from salt ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_ssl_opts
Parse out ssl_options for Cassandra cluster connection. Make sure that the ssl_version (if any specified) is valid.
salt/modules/cassandra_cql.py
def _get_ssl_opts(): ''' Parse out ssl_options for Cassandra cluster connection. Make sure that the ssl_version (if any specified) is valid. ''' sslopts = __salt__['config.option']('cassandra').get('ssl_options', None) ssl_opts = {} if sslopts: ssl_opts['ca_certs'] = sslopts['ca_cer...
def _get_ssl_opts(): ''' Parse out ssl_options for Cassandra cluster connection. Make sure that the ssl_version (if any specified) is valid. ''' sslopts = __salt__['config.option']('cassandra').get('ssl_options', None) ssl_opts = {} if sslopts: ssl_opts['ca_certs'] = sslopts['ca_cer...
[ "Parse", "out", "ssl_options", "for", "Cassandra", "cluster", "connection", ".", "Make", "sure", "that", "the", "ssl_version", "(", "if", "any", "specified", ")", "is", "valid", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L170-L198
[ "def", "_get_ssl_opts", "(", ")", ":", "sslopts", "=", "__salt__", "[", "'config.option'", "]", "(", "'cassandra'", ")", ".", "get", "(", "'ssl_options'", ",", "None", ")", "ssl_opts", "=", "{", "}", "if", "sslopts", ":", "ssl_opts", "[", "'ca_certs'", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_connect
Connect to a Cassandra cluster. :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs. :type contact_points: str or list of str :param cql_user: The Cassandra user if authentication is turned on. :type cql_user: str :param cql_pass: The ...
salt/modules/cassandra_cql.py
def _connect(contact_points=None, port=None, cql_user=None, cql_pass=None, protocol_version=None): ''' Connect to a Cassandra cluster. :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs. :type contact_points: str or list of str :param cql_u...
def _connect(contact_points=None, port=None, cql_user=None, cql_pass=None, protocol_version=None): ''' Connect to a Cassandra cluster. :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs. :type contact_points: str or list of str :param cql_u...
[ "Connect", "to", "a", "Cassandra", "cluster", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L201-L282
[ "def", "_connect", "(", "contact_points", "=", "None", ",", "port", "=", "None", ",", "cql_user", "=", "None", ",", "cql_pass", "=", "None", ",", "protocol_version", "=", "None", ")", ":", "# Lazy load the Cassandra cluster and session for this module by creating a", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cql_query
Run a query on a Cassandra cluster and return a dictionary. :param query: The query to execute. :type query: str :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs. :type contact_points: str | list[str] :param cql_user: The Cass...
salt/modules/cassandra_cql.py
def cql_query(query, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' Run a query on a Cassandra cluster and return a dictionary. :param query: The query to execute. :type query: str :param contact_points: The Cassandra cluster addresses, can either be a string ...
def cql_query(query, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' Run a query on a Cassandra cluster and return a dictionary. :param query: The query to execute. :type query: str :param contact_points: The Cassandra cluster addresses, can either be a string ...
[ "Run", "a", "query", "on", "a", "Cassandra", "cluster", "and", "return", "a", "dictionary", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L285-L362
[ "def", "cql_query", "(", "query", ",", "contact_points", "=", "None", ",", "port", "=", "None", ",", "cql_user", "=", "None", ",", "cql_pass", "=", "None", ")", ":", "try", ":", "cluster", ",", "session", "=", "_connect", "(", "contact_points", "=", "c...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cql_query_with_prepare
Run a query on a Cassandra cluster and return a dictionary. This function should not be used asynchronously for SELECTs -- it will not return anything and we don't currently have a mechanism for handling a future that will return results. :param query: The query to execute. :type query: ...
salt/modules/cassandra_cql.py
def cql_query_with_prepare(query, statement_name, statement_arguments, callback_errors=None, contact_points=None, port=None, cql_user=None, cql_pass=None, **kwargs): ''' Run a query on a Cassandra cluster and return a dictionary. This function should not be used asynchronously fo...
def cql_query_with_prepare(query, statement_name, statement_arguments, callback_errors=None, contact_points=None, port=None, cql_user=None, cql_pass=None, **kwargs): ''' Run a query on a Cassandra cluster and return a dictionary. This function should not be used asynchronously fo...
[ "Run", "a", "query", "on", "a", "Cassandra", "cluster", "and", "return", "a", "dictionary", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L365-L462
[ "def", "cql_query_with_prepare", "(", "query", ",", "statement_name", ",", "statement_arguments", ",", "callback_errors", "=", "None", ",", "contact_points", "=", "None", ",", "port", "=", "None", ",", "cql_user", "=", "None", ",", "cql_pass", "=", "None", ","...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_column_families
List column families in a Cassandra cluster for all keyspaces or just the provided one. :param keyspace: The keyspace to provide the column families for, optional. :type keyspace: str :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs. :type co...
salt/modules/cassandra_cql.py
def list_column_families(keyspace=None, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' List column families in a Cassandra cluster for all keyspaces or just the provided one. :param keyspace: The keyspace to provide the column families for, optional. :type keyspace: str...
def list_column_families(keyspace=None, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' List column families in a Cassandra cluster for all keyspaces or just the provided one. :param keyspace: The keyspace to provide the column families for, optional. :type keyspace: str...
[ "List", "column", "families", "in", "a", "Cassandra", "cluster", "for", "all", "keyspaces", "or", "just", "the", "provided", "one", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L596-L643
[ "def", "list_column_families", "(", "keyspace", "=", "None", ",", "contact_points", "=", "None", ",", "port", "=", "None", ",", "cql_user", "=", "None", ",", "cql_pass", "=", "None", ")", ":", "where_clause", "=", "\"where keyspace_name = '{0}'\"", ".", "forma...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
keyspace_exists
Check if a keyspace exists in a Cassandra cluster. :param keyspace The keyspace name to check for. :type keyspace: str :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs. :type contact_points: str | list[str] :param cql_user: The Cas...
salt/modules/cassandra_cql.py
def keyspace_exists(keyspace, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' Check if a keyspace exists in a Cassandra cluster. :param keyspace The keyspace name to check for. :type keyspace: str :param contact_points: The Cassandra cluster addresses, can either be...
def keyspace_exists(keyspace, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' Check if a keyspace exists in a Cassandra cluster. :param keyspace The keyspace name to check for. :type keyspace: str :param contact_points: The Cassandra cluster addresses, can either be...
[ "Check", "if", "a", "keyspace", "exists", "in", "a", "Cassandra", "cluster", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L646-L685
[ "def", "keyspace_exists", "(", "keyspace", ",", "contact_points", "=", "None", ",", "port", "=", "None", ",", "cql_user", "=", "None", ",", "cql_pass", "=", "None", ")", ":", "query", "=", "{", "'2'", ":", "'''select keyspace_name from system.schema_keyspaces\n ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_keyspace
Create a new keyspace in Cassandra. :param keyspace: The keyspace name :type keyspace: str :param replication_strategy: either `SimpleStrategy` or `NetworkTopologyStrategy` :type replication_strategy: str :param replication_factor: number of replicas of da...
salt/modules/cassandra_cql.py
def create_keyspace(keyspace, replication_strategy='SimpleStrategy', replication_factor=1, replication_datacenters=None, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' Create a new keyspace in Cassandra. :param keyspace: The keyspace name :type ke...
def create_keyspace(keyspace, replication_strategy='SimpleStrategy', replication_factor=1, replication_datacenters=None, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' Create a new keyspace in Cassandra. :param keyspace: The keyspace name :type ke...
[ "Create", "a", "new", "keyspace", "in", "Cassandra", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L688-L754
[ "def", "create_keyspace", "(", "keyspace", ",", "replication_strategy", "=", "'SimpleStrategy'", ",", "replication_factor", "=", "1", ",", "replication_datacenters", "=", "None", ",", "contact_points", "=", "None", ",", "port", "=", "None", ",", "cql_user", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
drop_keyspace
Drop a keyspace if it exists in a Cassandra cluster. :param keyspace: The keyspace to drop. :type keyspace: str :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs. :type contact_points: str | list[str] :param cql_user: The Cassandra u...
salt/modules/cassandra_cql.py
def drop_keyspace(keyspace, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' Drop a keyspace if it exists in a Cassandra cluster. :param keyspace: The keyspace to drop. :type keyspace: str :param contact_points: The Cassandra cluster addresses, can either be a string ...
def drop_keyspace(keyspace, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' Drop a keyspace if it exists in a Cassandra cluster. :param keyspace: The keyspace to drop. :type keyspace: str :param contact_points: The Cassandra cluster addresses, can either be a string ...
[ "Drop", "a", "keyspace", "if", "it", "exists", "in", "a", "Cassandra", "cluster", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L757-L794
[ "def", "drop_keyspace", "(", "keyspace", ",", "contact_points", "=", "None", ",", "port", "=", "None", ",", "cql_user", "=", "None", ",", "cql_pass", "=", "None", ")", ":", "existing_keyspace", "=", "keyspace_exists", "(", "keyspace", ",", "contact_points", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_users
List existing users in this Cassandra cluster. :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs. :type contact_points: str | list[str] :param port: The Cassandra cluster port, defaults to None. :type port: int :param cql_user: ...
salt/modules/cassandra_cql.py
def list_users(contact_points=None, port=None, cql_user=None, cql_pass=None): ''' List existing users in this Cassandra cluster. :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs. :type contact_points: str | list[str] :param port: The Cassand...
def list_users(contact_points=None, port=None, cql_user=None, cql_pass=None): ''' List existing users in this Cassandra cluster. :param contact_points: The Cassandra cluster addresses, can either be a string or a list of IPs. :type contact_points: str | list[str] :param port: The Cassand...
[ "List", "existing", "users", "in", "this", "Cassandra", "cluster", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L797-L833
[ "def", "list_users", "(", "contact_points", "=", "None", ",", "port", "=", "None", ",", "cql_user", "=", "None", ",", "cql_pass", "=", "None", ")", ":", "query", "=", "\"list users;\"", "ret", "=", "{", "}", "try", ":", "ret", "=", "cql_query", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_user
Create a new cassandra user with credentials and superuser status. :param username: The name of the new user. :type username: str :param password: The password of the new user. :type password: str :param superuser: Is the new user going to be a superuser? default: Fal...
salt/modules/cassandra_cql.py
def create_user(username, password, superuser=False, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' Create a new cassandra user with credentials and superuser status. :param username: The name of the new user. :type username: str :param password: The password ...
def create_user(username, password, superuser=False, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' Create a new cassandra user with credentials and superuser status. :param username: The name of the new user. :type username: str :param password: The password ...
[ "Create", "a", "new", "cassandra", "user", "with", "credentials", "and", "superuser", "status", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L836-L882
[ "def", "create_user", "(", "username", ",", "password", ",", "superuser", "=", "False", ",", "contact_points", "=", "None", ",", "port", "=", "None", ",", "cql_user", "=", "None", ",", "cql_pass", "=", "None", ")", ":", "superuser_cql", "=", "'superuser'",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_permissions
List permissions. :param username: The name of the user to list permissions for. :type username: str :param resource: The resource (keyspace or table), if None, permissions for all resources are listed. :type resource: str :param resource_type: The resource_type (keyspace...
salt/modules/cassandra_cql.py
def list_permissions(username=None, resource=None, resource_type='keyspace', permission=None, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' List permissions. :param username: The name of the user to list permissions for. :type username: str :pa...
def list_permissions(username=None, resource=None, resource_type='keyspace', permission=None, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' List permissions. :param username: The name of the user to list permissions for. :type username: str :pa...
[ "List", "permissions", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L939-L994
[ "def", "list_permissions", "(", "username", "=", "None", ",", "resource", "=", "None", ",", "resource_type", "=", "'keyspace'", ",", "permission", "=", "None", ",", "contact_points", "=", "None", ",", "port", "=", "None", ",", "cql_user", "=", "None", ",",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
grant_permission
Grant permissions to a user. :param username: The name of the user to grant permissions to. :type username: str :param resource: The resource (keyspace or table), if None, permissions for all resources are granted. :type resource: str :param resource_type: The resource_ty...
salt/modules/cassandra_cql.py
def grant_permission(username, resource=None, resource_type='keyspace', permission=None, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' Grant permissions to a user. :param username: The name of the user to grant permissions to. :type username: str ...
def grant_permission(username, resource=None, resource_type='keyspace', permission=None, contact_points=None, port=None, cql_user=None, cql_pass=None): ''' Grant permissions to a user. :param username: The name of the user to grant permissions to. :type username: str ...
[ "Grant", "permissions", "to", "a", "user", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cassandra_cql.py#L997-L1046
[ "def", "grant_permission", "(", "username", ",", "resource", "=", "None", ",", "resource_type", "=", "'keyspace'", ",", "permission", "=", "None", ",", "contact_points", "=", "None", ",", "port", "=", "None", ",", "cql_user", "=", "None", ",", "cql_pass", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_journal
Return the active running journal object
salt/beacons/journald.py
def _get_journal(): ''' Return the active running journal object ''' if 'systemd.journald' in __context__: return __context__['systemd.journald'] __context__['systemd.journald'] = systemd.journal.Reader() # get to the end of the journal __context__['systemd.journald'].seek_tail() ...
def _get_journal(): ''' Return the active running journal object ''' if 'systemd.journald' in __context__: return __context__['systemd.journald'] __context__['systemd.journald'] = systemd.journal.Reader() # get to the end of the journal __context__['systemd.journald'].seek_tail() ...
[ "Return", "the", "active", "running", "journal", "object" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/journald.py#L33-L43
[ "def", "_get_journal", "(", ")", ":", "if", "'systemd.journald'", "in", "__context__", ":", "return", "__context__", "[", "'systemd.journald'", "]", "__context__", "[", "'systemd.journald'", "]", "=", "systemd", ".", "journal", ".", "Reader", "(", ")", "# get to...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
beacon
The journald beacon allows for the systemd journal to be parsed and linked objects to be turned into events. This beacons config will return all sshd jornal entries .. code-block:: yaml beacons: journald: - services: sshd: SYSLOG_IDENTIFIER:...
salt/beacons/journald.py
def beacon(config): ''' The journald beacon allows for the systemd journal to be parsed and linked objects to be turned into events. This beacons config will return all sshd jornal entries .. code-block:: yaml beacons: journald: - services: sshd: ...
def beacon(config): ''' The journald beacon allows for the systemd journal to be parsed and linked objects to be turned into events. This beacons config will return all sshd jornal entries .. code-block:: yaml beacons: journald: - services: sshd: ...
[ "The", "journald", "beacon", "allows", "for", "the", "systemd", "journal", "to", "be", "parsed", "and", "linked", "objects", "to", "be", "turned", "into", "events", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/journald.py#L64-L104
[ "def", "beacon", "(", "config", ")", ":", "ret", "=", "[", "]", "journal", "=", "_get_journal", "(", ")", "_config", "=", "{", "}", "list", "(", "map", "(", "_config", ".", "update", ",", "config", ")", ")", "while", "True", ":", "cur", "=", "jou...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_options
Get the couchdb options from salt.
salt/returners/couchdb_return.py
def _get_options(ret=None): ''' Get the couchdb options from salt. ''' attrs = {'url': 'url', 'db': 'db', 'user': 'user', 'passwd': 'passwd', 'redact_pws': 'redact_pws', 'minimum_return': 'minimum_return'} _options = salt.returners.ge...
def _get_options(ret=None): ''' Get the couchdb options from salt. ''' attrs = {'url': 'url', 'db': 'db', 'user': 'user', 'passwd': 'passwd', 'redact_pws': 'redact_pws', 'minimum_return': 'minimum_return'} _options = salt.returners.ge...
[ "Get", "the", "couchdb", "options", "from", "salt", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchdb_return.py#L96-L136
[ "def", "_get_options", "(", "ret", "=", "None", ")", ":", "attrs", "=", "{", "'url'", ":", "'url'", ",", "'db'", ":", "'db'", ",", "'user'", ":", "'user'", ",", "'passwd'", ":", "'passwd'", ",", "'redact_pws'", ":", "'redact_pws'", ",", "'minimum_return'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_generate_doc
Create a object that will be saved into the database based on options.
salt/returners/couchdb_return.py
def _generate_doc(ret): ''' Create a object that will be saved into the database based on options. ''' # Create a copy of the object that we will return. retc = ret.copy() # Set the ID of the document to be the JID. retc["_id"] = ret["jid"] # Add a timestamp field to the document ...
def _generate_doc(ret): ''' Create a object that will be saved into the database based on options. ''' # Create a copy of the object that we will return. retc = ret.copy() # Set the ID of the document to be the JID. retc["_id"] = ret["jid"] # Add a timestamp field to the document ...
[ "Create", "a", "object", "that", "will", "be", "saved", "into", "the", "database", "based", "on", "options", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchdb_return.py#L151-L166
[ "def", "_generate_doc", "(", "ret", ")", ":", "# Create a copy of the object that we will return.", "retc", "=", "ret", ".", "copy", "(", ")", "# Set the ID of the document to be the JID.", "retc", "[", "\"_id\"", "]", "=", "ret", "[", "\"jid\"", "]", "# Add a timesta...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_request
Makes a HTTP request. Returns the JSON parse, or an obj with an error.
salt/returners/couchdb_return.py
def _request(method, url, content_type=None, _data=None, user=None, passwd=None): ''' Makes a HTTP request. Returns the JSON parse, or an obj with an error. ''' opener = _build_opener(_HTTPHandler) request = _Request(url, data=_data) if content_type: request.add_header('Content-Type', co...
def _request(method, url, content_type=None, _data=None, user=None, passwd=None): ''' Makes a HTTP request. Returns the JSON parse, or an obj with an error. ''' opener = _build_opener(_HTTPHandler) request = _Request(url, data=_data) if content_type: request.add_header('Content-Type', co...
[ "Makes", "a", "HTTP", "request", ".", "Returns", "the", "JSON", "parse", "or", "an", "obj", "with", "an", "error", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchdb_return.py#L169-L187
[ "def", "_request", "(", "method", ",", "url", ",", "content_type", "=", "None", ",", "_data", "=", "None", ",", "user", "=", "None", ",", "passwd", "=", "None", ")", ":", "opener", "=", "_build_opener", "(", "_HTTPHandler", ")", "request", "=", "_Reque...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_generate_event_doc
Create a object that will be saved into the database based in options.
salt/returners/couchdb_return.py
def _generate_event_doc(event): ''' Create a object that will be saved into the database based in options. ''' # Create a copy of the object that we will return. eventc = event.copy() # Set the ID of the document to be the JID. eventc["_id"] = '{}-{}'.format( ...
def _generate_event_doc(event): ''' Create a object that will be saved into the database based in options. ''' # Create a copy of the object that we will return. eventc = event.copy() # Set the ID of the document to be the JID. eventc["_id"] = '{}-{}'.format( ...
[ "Create", "a", "object", "that", "will", "be", "saved", "into", "the", "database", "based", "in", "options", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchdb_return.py#L190-L212
[ "def", "_generate_event_doc", "(", "event", ")", ":", "# Create a copy of the object that we will return.", "eventc", "=", "event", ".", "copy", "(", ")", "# Set the ID of the document to be the JID.", "eventc", "[", "\"_id\"", "]", "=", "'{}-{}'", ".", "format", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
returner
Take in the return and shove it into the couchdb database.
salt/returners/couchdb_return.py
def returner(ret): ''' Take in the return and shove it into the couchdb database. ''' options = _get_options(ret) # Check to see if the database exists. _response = _request("GET", options['url'] + "_all_dbs", user=options['user'], ...
def returner(ret): ''' Take in the return and shove it into the couchdb database. ''' options = _get_options(ret) # Check to see if the database exists. _response = _request("GET", options['url'] + "_all_dbs", user=options['user'], ...
[ "Take", "in", "the", "return", "and", "shove", "it", "into", "the", "couchdb", "database", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchdb_return.py#L215-L269
[ "def", "returner", "(", "ret", ")", ":", "options", "=", "_get_options", "(", "ret", ")", "# Check to see if the database exists.", "_response", "=", "_request", "(", "\"GET\"", ",", "options", "[", "'url'", "]", "+", "\"_all_dbs\"", ",", "user", "=", "options...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
event_return
Return event to CouchDB server Requires that configuration be enabled via 'event_return' option in master config. Example: event_return: - couchdb
salt/returners/couchdb_return.py
def event_return(events): ''' Return event to CouchDB server Requires that configuration be enabled via 'event_return' option in master config. Example: event_return: - couchdb ''' log.debug('events data is: %s', events) options = _get_options() # Check to see if the d...
def event_return(events): ''' Return event to CouchDB server Requires that configuration be enabled via 'event_return' option in master config. Example: event_return: - couchdb ''' log.debug('events data is: %s', events) options = _get_options() # Check to see if the d...
[ "Return", "event", "to", "CouchDB", "server", "Requires", "that", "configuration", "be", "enabled", "via", "event_return", "option", "in", "master", "config", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchdb_return.py#L272-L318
[ "def", "event_return", "(", "events", ")", ":", "log", ".", "debug", "(", "'events data is: %s'", ",", "events", ")", "options", "=", "_get_options", "(", ")", "# Check to see if the database exists.", "_response", "=", "_request", "(", "\"GET\"", ",", "options", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_jids
List all the jobs that we have..
salt/returners/couchdb_return.py
def get_jids(): ''' List all the jobs that we have.. ''' options = _get_options(ret=None) _response = _request("GET", options['url'] + options['db'] + "/_all_docs?include_docs=true") # Make sure the 'total_rows' is returned.. if not error out. if 'total_rows' not in _response: log.e...
def get_jids(): ''' List all the jobs that we have.. ''' options = _get_options(ret=None) _response = _request("GET", options['url'] + options['db'] + "/_all_docs?include_docs=true") # Make sure the 'total_rows' is returned.. if not error out. if 'total_rows' not in _response: log.e...
[ "List", "all", "the", "jobs", "that", "we", "have", ".." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchdb_return.py#L333-L356
[ "def", "get_jids", "(", ")", ":", "options", "=", "_get_options", "(", "ret", "=", "None", ")", "_response", "=", "_request", "(", "\"GET\"", ",", "options", "[", "'url'", "]", "+", "options", "[", "'db'", "]", "+", "\"/_all_docs?include_docs=true\"", ")",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_fun
Return a dict with key being minion and value being the job details of the last run of function 'fun'.
salt/returners/couchdb_return.py
def get_fun(fun): ''' Return a dict with key being minion and value being the job details of the last run of function 'fun'. ''' # Get the options.. options = _get_options(ret=None) # Define a simple return object. _ret = {} # get_minions takes care of calling ensure_views for us....
def get_fun(fun): ''' Return a dict with key being minion and value being the job details of the last run of function 'fun'. ''' # Get the options.. options = _get_options(ret=None) # Define a simple return object. _ret = {} # get_minions takes care of calling ensure_views for us....
[ "Return", "a", "dict", "with", "key", "being", "minion", "and", "value", "being", "the", "job", "details", "of", "the", "last", "run", "of", "function", "fun", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchdb_return.py#L359-L399
[ "def", "get_fun", "(", "fun", ")", ":", "# Get the options..", "options", "=", "_get_options", "(", "ret", "=", "None", ")", "# Define a simple return object.", "_ret", "=", "{", "}", "# get_minions takes care of calling ensure_views for us. For each minion we know about", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_minions
Return a list of minion identifiers from a request of the view.
salt/returners/couchdb_return.py
def get_minions(): ''' Return a list of minion identifiers from a request of the view. ''' options = _get_options(ret=None) # Make sure the views are valid, which includes the minions.. if not ensure_views(): return [] # Make the request for the view.. _response = _request("GET...
def get_minions(): ''' Return a list of minion identifiers from a request of the view. ''' options = _get_options(ret=None) # Make sure the views are valid, which includes the minions.. if not ensure_views(): return [] # Make the request for the view.. _response = _request("GET...
[ "Return", "a", "list", "of", "minion", "identifiers", "from", "a", "request", "of", "the", "view", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchdb_return.py#L402-L427
[ "def", "get_minions", "(", ")", ":", "options", "=", "_get_options", "(", "ret", "=", "None", ")", "# Make sure the views are valid, which includes the minions..", "if", "not", "ensure_views", "(", ")", ":", "return", "[", "]", "# Make the request for the view..", "_r...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ensure_views
This function makes sure that all the views that should exist in the design document do exist.
salt/returners/couchdb_return.py
def ensure_views(): ''' This function makes sure that all the views that should exist in the design document do exist. ''' # Get the options so we have the URL and DB.. options = _get_options(ret=None) # Make a request to check if the design document exists. _response = _request("GET",...
def ensure_views(): ''' This function makes sure that all the views that should exist in the design document do exist. ''' # Get the options so we have the URL and DB.. options = _get_options(ret=None) # Make a request to check if the design document exists. _response = _request("GET",...
[ "This", "function", "makes", "sure", "that", "all", "the", "views", "that", "should", "exist", "in", "the", "design", "document", "do", "exist", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchdb_return.py#L430-L456
[ "def", "ensure_views", "(", ")", ":", "# Get the options so we have the URL and DB..", "options", "=", "_get_options", "(", "ret", "=", "None", ")", "# Make a request to check if the design document exists.", "_response", "=", "_request", "(", "\"GET\"", ",", "options", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_salt_view
Helper function that sets the salt design document. Uses get_valid_salt_views and some hardcoded values.
salt/returners/couchdb_return.py
def set_salt_view(): ''' Helper function that sets the salt design document. Uses get_valid_salt_views and some hardcoded values. ''' options = _get_options(ret=None) # Create the new object that we will shove in as the design doc. new_doc = {} new_doc['views'] = get_valid_salt_views()...
def set_salt_view(): ''' Helper function that sets the salt design document. Uses get_valid_salt_views and some hardcoded values. ''' options = _get_options(ret=None) # Create the new object that we will shove in as the design doc. new_doc = {} new_doc['views'] = get_valid_salt_views()...
[ "Helper", "function", "that", "sets", "the", "salt", "design", "document", ".", "Uses", "get_valid_salt_views", "and", "some", "hardcoded", "values", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchdb_return.py#L477-L497
[ "def", "set_salt_view", "(", ")", ":", "options", "=", "_get_options", "(", "ret", "=", "None", ")", "# Create the new object that we will shove in as the design doc.", "new_doc", "=", "{", "}", "new_doc", "[", "'views'", "]", "=", "get_valid_salt_views", "(", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_load
Included for API consistency
salt/returners/couchdb_return.py
def get_load(jid): ''' Included for API consistency ''' options = _get_options(ret=None) _response = _request("GET", options['url'] + options['db'] + '/' + jid) if 'error' in _response: log.error('Unable to get JID "%s" : "%s"', jid, _response) return {} return {_response['id...
def get_load(jid): ''' Included for API consistency ''' options = _get_options(ret=None) _response = _request("GET", options['url'] + options['db'] + '/' + jid) if 'error' in _response: log.error('Unable to get JID "%s" : "%s"', jid, _response) return {} return {_response['id...
[ "Included", "for", "API", "consistency" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchdb_return.py#L521-L530
[ "def", "get_load", "(", "jid", ")", ":", "options", "=", "_get_options", "(", "ret", "=", "None", ")", "_response", "=", "_request", "(", "\"GET\"", ",", "options", "[", "'url'", "]", "+", "options", "[", "'db'", "]", "+", "'/'", "+", "jid", ")", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_auth
Set up heat credentials, returns `heatclient.client.Client`. Optional parameter "api_version" defaults to 1. Only intended to be used within heat-enabled modules
salt/modules/heat.py
def _auth(profile=None, api_version=1, **connection_args): ''' Set up heat credentials, returns `heatclient.client.Client`. Optional parameter "api_version" defaults to 1. Only intended to be used within heat-enabled modules ''' if profile: prefix = profile + ':keystone.' else:...
def _auth(profile=None, api_version=1, **connection_args): ''' Set up heat credentials, returns `heatclient.client.Client`. Optional parameter "api_version" defaults to 1. Only intended to be used within heat-enabled modules ''' if profile: prefix = profile + ':keystone.' else:...
[ "Set", "up", "heat", "credentials", "returns", "heatclient", ".", "client", ".", "Client", ".", "Optional", "parameter", "api_version", "defaults", "to", "1", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/heat.py#L102-L171
[ "def", "_auth", "(", "profile", "=", "None", ",", "api_version", "=", "1", ",", "*", "*", "connection_args", ")", ":", "if", "profile", ":", "prefix", "=", "profile", "+", "':keystone.'", "else", ":", "prefix", "=", "'keystone.'", "def", "get", "(", "k...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_parse_environment
Parsing template
salt/modules/heat.py
def _parse_environment(env_str): ''' Parsing template ''' try: env = salt.utils.yaml.safe_load(env_str) except salt.utils.yaml.YAMLError as exc: raise ValueError(six.text_type(exc)) else: if env is None: env = {} elif not isinstance(env, dict): ...
def _parse_environment(env_str): ''' Parsing template ''' try: env = salt.utils.yaml.safe_load(env_str) except salt.utils.yaml.YAMLError as exc: raise ValueError(six.text_type(exc)) else: if env is None: env = {} elif not isinstance(env, dict): ...
[ "Parsing", "template" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/heat.py#L196-L216
[ "def", "_parse_environment", "(", "env_str", ")", ":", "try", ":", "env", "=", "salt", ".", "utils", ".", "yaml", ".", "safe_load", "(", "env_str", ")", "except", "salt", ".", "utils", ".", "yaml", ".", "YAMLError", "as", "exc", ":", "raise", "ValueErr...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_stack_events
Get event for stack
salt/modules/heat.py
def _get_stack_events(h_client, stack_id, event_args): ''' Get event for stack ''' event_args['stack_id'] = stack_id event_args['resource_name'] = None try: events = h_client.events.list(**event_args) except heatclient.exc.HTTPNotFound as exc: raise heatclient.exc.CommandErro...
def _get_stack_events(h_client, stack_id, event_args): ''' Get event for stack ''' event_args['stack_id'] = stack_id event_args['resource_name'] = None try: events = h_client.events.list(**event_args) except heatclient.exc.HTTPNotFound as exc: raise heatclient.exc.CommandErro...
[ "Get", "event", "for", "stack" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/heat.py#L219-L232
[ "def", "_get_stack_events", "(", "h_client", ",", "stack_id", ",", "event_args", ")", ":", "event_args", "[", "'stack_id'", "]", "=", "stack_id", "event_args", "[", "'resource_name'", "]", "=", "None", "try", ":", "events", "=", "h_client", ".", "events", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_poll_for_events
Polling stack events
salt/modules/heat.py
def _poll_for_events(h_client, stack_name, action=None, poll_period=5, timeout=60, marker=None): ''' Polling stack events ''' if action: stop_status = ('{0}_FAILED'.format(action), '{0}_COMPLETE'.format(action)) stop_check = lambda a: a in stop_status else: ...
def _poll_for_events(h_client, stack_name, action=None, poll_period=5, timeout=60, marker=None): ''' Polling stack events ''' if action: stop_status = ('{0}_FAILED'.format(action), '{0}_COMPLETE'.format(action)) stop_check = lambda a: a in stop_status else: ...
[ "Polling", "stack", "events" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/heat.py#L235-L283
[ "def", "_poll_for_events", "(", "h_client", ",", "stack_name", ",", "action", "=", "None", ",", "poll_period", "=", "5", ",", "timeout", "=", "60", ",", "marker", "=", "None", ")", ":", "if", "action", ":", "stop_status", "=", "(", "'{0}_FAILED'", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_stack
Return a list of available stack (heat stack-list) profile Profile to use CLI Example: .. code-block:: bash salt '*' heat.list_stack profile=openstack1
salt/modules/heat.py
def list_stack(profile=None): ''' Return a list of available stack (heat stack-list) profile Profile to use CLI Example: .. code-block:: bash salt '*' heat.list_stack profile=openstack1 ''' ret = {} h_client = _auth(profile) for stack in h_client.stacks.list(): ...
def list_stack(profile=None): ''' Return a list of available stack (heat stack-list) profile Profile to use CLI Example: .. code-block:: bash salt '*' heat.list_stack profile=openstack1 ''' ret = {} h_client = _auth(profile) for stack in h_client.stacks.list(): ...
[ "Return", "a", "list", "of", "available", "stack", "(", "heat", "stack", "-", "list", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/heat.py#L286-L314
[ "def", "list_stack", "(", "profile", "=", "None", ")", ":", "ret", "=", "{", "}", "h_client", "=", "_auth", "(", "profile", ")", "for", "stack", "in", "h_client", ".", "stacks", ".", "list", "(", ")", ":", "links", "=", "{", "}", "for", "link", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_stack
Return details about a specific stack (heat stack-show) name Name of the stack profile Profile to use CLI Example: .. code-block:: bash salt '*' heat.show_stack name=mystack profile=openstack1
salt/modules/heat.py
def show_stack(name=None, profile=None): ''' Return details about a specific stack (heat stack-show) name Name of the stack profile Profile to use CLI Example: .. code-block:: bash salt '*' heat.show_stack name=mystack profile=openstack1 ''' h_client = _auth(...
def show_stack(name=None, profile=None): ''' Return details about a specific stack (heat stack-show) name Name of the stack profile Profile to use CLI Example: .. code-block:: bash salt '*' heat.show_stack name=mystack profile=openstack1 ''' h_client = _auth(...
[ "Return", "details", "about", "a", "specific", "stack", "(", "heat", "stack", "-", "show", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/heat.py#L317-L362
[ "def", "show_stack", "(", "name", "=", "None", ",", "profile", "=", "None", ")", ":", "h_client", "=", "_auth", "(", "profile", ")", "if", "not", "name", ":", "return", "{", "'result'", ":", "False", ",", "'comment'", ":", "'Parameter name missing or None'...
e8541fd6e744ab0df786c0f76102e41631f45d46