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
_tmp_access_rule
Handles the cmd execution for tempdeny and tempallow commands.
salt/modules/csf.py
def _tmp_access_rule(method, ip=None, ttl=None, port=None, direction='in', port_origin='d', ip_origin='d', comment=''): ''' Handles the cmd execution for tempdeny and tempa...
def _tmp_access_rule(method, ip=None, ttl=None, port=None, direction='in', port_origin='d', ip_origin='d', comment=''): ''' Handles the cmd execution for tempdeny and tempa...
[ "Handles", "the", "cmd", "execution", "for", "tempdeny", "and", "tempallow", "commands", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L308-L325
[ "def", "_tmp_access_rule", "(", "method", ",", "ip", "=", "None", ",", "ttl", "=", "None", ",", "port", "=", "None", ",", "direction", "=", "'in'", ",", "port_origin", "=", "'d'", ",", "ip_origin", "=", "'d'", ",", "comment", "=", "''", ")", ":", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_build_tmp_access_args
Builds the cmd args for temporary access/deny opts.
salt/modules/csf.py
def _build_tmp_access_args(method, ip, ttl, port, direction, comment): ''' Builds the cmd args for temporary access/deny opts. ''' opt = _get_opt(method) args = '{0} {1} {2}'.format(opt, ip, ttl) if port: args += ' -p {0}'.format(port) if direction: args += ' -d {0}'.format(d...
def _build_tmp_access_args(method, ip, ttl, port, direction, comment): ''' Builds the cmd args for temporary access/deny opts. ''' opt = _get_opt(method) args = '{0} {1} {2}'.format(opt, ip, ttl) if port: args += ' -p {0}'.format(port) if direction: args += ' -d {0}'.format(d...
[ "Builds", "the", "cmd", "args", "for", "temporary", "access", "/", "deny", "opts", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L328-L340
[ "def", "_build_tmp_access_args", "(", "method", ",", "ip", ",", "ttl", ",", "port", ",", "direction", ",", "comment", ")", ":", "opt", "=", "_get_opt", "(", "method", ")", "args", "=", "'{0} {1} {2}'", ".", "format", "(", "opt", ",", "ip", ",", "ttl", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
tempallow
Add an rule to the temporary ip allow list. See :func:`_access_rule`. 1- Add an IP: CLI Example: .. code-block:: bash salt '*' csf.tempallow 127.0.0.1 3600 port=22 direction='in' comment='# Temp dev ssh access'
salt/modules/csf.py
def tempallow(ip=None, ttl=None, port=None, direction=None, comment=''): ''' Add an rule to the temporary ip allow list. See :func:`_access_rule`. 1- Add an IP: CLI Example: .. code-block:: bash salt '*' csf.tempallow 127.0.0.1 3600 port=22 direction='in' comment='# Temp dev ssh access...
def tempallow(ip=None, ttl=None, port=None, direction=None, comment=''): ''' Add an rule to the temporary ip allow list. See :func:`_access_rule`. 1- Add an IP: CLI Example: .. code-block:: bash salt '*' csf.tempallow 127.0.0.1 3600 port=22 direction='in' comment='# Temp dev ssh access...
[ "Add", "an", "rule", "to", "the", "temporary", "ip", "allow", "list", ".", "See", ":", "func", ":", "_access_rule", ".", "1", "-", "Add", "an", "IP", ":", "CLI", "Example", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L393-L404
[ "def", "tempallow", "(", "ip", "=", "None", ",", "ttl", "=", "None", ",", "port", "=", "None", ",", "direction", "=", "None", ",", "comment", "=", "''", ")", ":", "return", "_tmp_access_rule", "(", "'tempallow'", ",", "ip", ",", "ttl", ",", "port", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
tempdeny
Add a rule to the temporary ip deny list. See :func:`_access_rule`. 1- Add an IP: CLI Example: .. code-block:: bash salt '*' csf.tempdeny 127.0.0.1 300 port=22 direction='in' comment='# Brute force attempt'
salt/modules/csf.py
def tempdeny(ip=None, ttl=None, port=None, direction=None, comment=''): ''' Add a rule to the temporary ip deny list. See :func:`_access_rule`. 1- Add an IP: CLI Example: .. code-block:: bash salt '*' csf.tempdeny 127.0.0.1 300 port=22 direction='in' comment='# Brute force attempt' ...
def tempdeny(ip=None, ttl=None, port=None, direction=None, comment=''): ''' Add a rule to the temporary ip deny list. See :func:`_access_rule`. 1- Add an IP: CLI Example: .. code-block:: bash salt '*' csf.tempdeny 127.0.0.1 300 port=22 direction='in' comment='# Brute force attempt' ...
[ "Add", "a", "rule", "to", "the", "temporary", "ip", "deny", "list", ".", "See", ":", "func", ":", "_access_rule", ".", "1", "-", "Add", "an", "IP", ":", "CLI", "Example", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L407-L418
[ "def", "tempdeny", "(", "ip", "=", "None", ",", "ttl", "=", "None", ",", "port", "=", "None", ",", "direction", "=", "None", ",", "comment", "=", "''", ")", ":", "return", "_tmp_access_rule", "(", "'tempdeny'", ",", "ip", ",", "ttl", ",", "port", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
allow
Add an rule to csf allowed hosts See :func:`_access_rule`. 1- Add an IP: CLI Example: .. code-block:: bash salt '*' csf.allow 127.0.0.1 salt '*' csf.allow 127.0.0.1 comment="Allow localhost"
salt/modules/csf.py
def allow(ip, port=None, proto='tcp', direction='in', port_origin='d', ip_origin='s', ttl=None, comment=''): ''' Add an rule to csf allowed hosts See :func:`_access_rule`. 1- Add an IP: CLI Example: .. code-block:: bash salt '*' c...
def allow(ip, port=None, proto='tcp', direction='in', port_origin='d', ip_origin='s', ttl=None, comment=''): ''' Add an rule to csf allowed hosts See :func:`_access_rule`. 1- Add an IP: CLI Example: .. code-block:: bash salt '*' c...
[ "Add", "an", "rule", "to", "csf", "allowed", "hosts", "See", ":", "func", ":", "_access_rule", ".", "1", "-", "Add", "an", "IP", ":", "CLI", "Example", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L421-L447
[ "def", "allow", "(", "ip", ",", "port", "=", "None", ",", "proto", "=", "'tcp'", ",", "direction", "=", "'in'", ",", "port_origin", "=", "'d'", ",", "ip_origin", "=", "'s'", ",", "ttl", "=", "None", ",", "comment", "=", "''", ")", ":", "return", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
deny
Add an rule to csf denied hosts See :func:`_access_rule`. 1- Deny an IP: CLI Example: .. code-block:: bash salt '*' csf.deny 127.0.0.1 salt '*' csf.deny 127.0.0.1 comment="Too localhosty"
salt/modules/csf.py
def deny(ip, port=None, proto='tcp', direction='in', port_origin='d', ip_origin='d', ttl=None, comment=''): ''' Add an rule to csf denied hosts See :func:`_access_rule`. 1- Deny an IP: CLI Example: .. code-block:: bash salt '*' cs...
def deny(ip, port=None, proto='tcp', direction='in', port_origin='d', ip_origin='d', ttl=None, comment=''): ''' Add an rule to csf denied hosts See :func:`_access_rule`. 1- Deny an IP: CLI Example: .. code-block:: bash salt '*' cs...
[ "Add", "an", "rule", "to", "csf", "denied", "hosts", "See", ":", "func", ":", "_access_rule", ".", "1", "-", "Deny", "an", "IP", ":", "CLI", "Example", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L450-L469
[ "def", "deny", "(", "ip", ",", "port", "=", "None", ",", "proto", "=", "'tcp'", ",", "direction", "=", "'in'", ",", "port_origin", "=", "'d'", ",", "ip_origin", "=", "'d'", ",", "ttl", "=", "None", ",", "comment", "=", "''", ")", ":", "return", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
allow_ports
Fully replace the incoming or outgoing ports line in the csf.conf file - e.g. TCP_IN, TCP_OUT, UDP_IN, UDP_OUT, etc. CLI Example: .. code-block:: bash salt '*' csf.allow_ports ports="[22,80,443,4505,4506]" proto='tcp' direction='in'
salt/modules/csf.py
def allow_ports(ports, proto='tcp', direction='in'): ''' Fully replace the incoming or outgoing ports line in the csf.conf file - e.g. TCP_IN, TCP_OUT, UDP_IN, UDP_OUT, etc. CLI Example: .. code-block:: bash salt '*' csf.allow_ports ports="[22,80,443,4505,4506]" proto='tcp' direction=...
def allow_ports(ports, proto='tcp', direction='in'): ''' Fully replace the incoming or outgoing ports line in the csf.conf file - e.g. TCP_IN, TCP_OUT, UDP_IN, UDP_OUT, etc. CLI Example: .. code-block:: bash salt '*' csf.allow_ports ports="[22,80,443,4505,4506]" proto='tcp' direction=...
[ "Fully", "replace", "the", "incoming", "or", "outgoing", "ports", "line", "in", "the", "csf", ".", "conf", "file", "-", "e", ".", "g", ".", "TCP_IN", "TCP_OUT", "UDP_IN", "UDP_OUT", "etc", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L535-L563
[ "def", "allow_ports", "(", "ports", ",", "proto", "=", "'tcp'", ",", "direction", "=", "'in'", ")", ":", "results", "=", "[", "]", "ports", "=", "set", "(", "ports", ")", "ports", "=", "list", "(", "ports", ")", "proto", "=", "proto", ".", "upper",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_ports
Lists ports from csf.conf based on direction and protocol. e.g. - TCP_IN, TCP_OUT, UDP_IN, UDP_OUT, etc.. CLI Example: .. code-block:: bash salt '*' csf.allow_port 22 proto='tcp' direction='in'
salt/modules/csf.py
def get_ports(proto='tcp', direction='in'): ''' Lists ports from csf.conf based on direction and protocol. e.g. - TCP_IN, TCP_OUT, UDP_IN, UDP_OUT, etc.. CLI Example: .. code-block:: bash salt '*' csf.allow_port 22 proto='tcp' direction='in' ''' proto = proto.upper() directio...
def get_ports(proto='tcp', direction='in'): ''' Lists ports from csf.conf based on direction and protocol. e.g. - TCP_IN, TCP_OUT, UDP_IN, UDP_OUT, etc.. CLI Example: .. code-block:: bash salt '*' csf.allow_port 22 proto='tcp' direction='in' ''' proto = proto.upper() directio...
[ "Lists", "ports", "from", "csf", ".", "conf", "based", "on", "direction", "and", "protocol", ".", "e", ".", "g", ".", "-", "TCP_IN", "TCP_OUT", "UDP_IN", "UDP_OUT", "etc", ".." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L566-L587
[ "def", "get_ports", "(", "proto", "=", "'tcp'", ",", "direction", "=", "'in'", ")", ":", "proto", "=", "proto", ".", "upper", "(", ")", "direction", "=", "direction", ".", "upper", "(", ")", "results", "=", "{", "}", "_validate_direction_and_proto", "(",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
allow_port
Like allow_ports, but it will append to the existing entry instead of replacing it. Takes a single port instead of a list of ports. CLI Example: .. code-block:: bash salt '*' csf.allow_port 22 proto='tcp' direction='in'
salt/modules/csf.py
def allow_port(port, proto='tcp', direction='both'): ''' Like allow_ports, but it will append to the existing entry instead of replacing it. Takes a single port instead of a list of ports. CLI Example: .. code-block:: bash salt '*' csf.allow_port 22 proto='tcp' direction='in' ''' ...
def allow_port(port, proto='tcp', direction='both'): ''' Like allow_ports, but it will append to the existing entry instead of replacing it. Takes a single port instead of a list of ports. CLI Example: .. code-block:: bash salt '*' csf.allow_port 22 proto='tcp' direction='in' ''' ...
[ "Like", "allow_ports", "but", "it", "will", "append", "to", "the", "existing", "entry", "instead", "of", "replacing", "it", ".", "Takes", "a", "single", "port", "instead", "of", "a", "list", "of", "ports", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/csf.py#L611-L633
[ "def", "allow_port", "(", "port", ",", "proto", "=", "'tcp'", ",", "direction", "=", "'both'", ")", ":", "ports", "=", "get_ports", "(", "proto", "=", "proto", ",", "direction", "=", "direction", ")", "direction", "=", "direction", ".", "upper", "(", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_ssh_state
Function to run a state with the given chunk via salt-ssh
salt/client/ssh/wrapper/state.py
def _ssh_state(chunks, st_kwargs, kwargs, test=False): ''' Function to run a state with the given chunk via salt-ssh ''' file_refs = salt.client.ssh.state.lowstate_file_refs( chunks, _merge_extra_filerefs( kwargs.get('extra_filerefs', ''), ...
def _ssh_state(chunks, st_kwargs, kwargs, test=False): ''' Function to run a state with the given chunk via salt-ssh ''' file_refs = salt.client.ssh.state.lowstate_file_refs( chunks, _merge_extra_filerefs( kwargs.get('extra_filerefs', ''), ...
[ "Function", "to", "run", "a", "state", "with", "the", "given", "chunk", "via", "salt", "-", "ssh" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L39-L89
[ "def", "_ssh_state", "(", "chunks", ",", "st_kwargs", ",", "kwargs", ",", "test", "=", "False", ")", ":", "file_refs", "=", "salt", ".", "client", ".", "ssh", ".", "state", ".", "lowstate_file_refs", "(", "chunks", ",", "_merge_extra_filerefs", "(", "kwarg...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_set_retcode
Set the return code based on the data back from the state system
salt/client/ssh/wrapper/state.py
def _set_retcode(ret, highstate=None): ''' Set the return code based on the data back from the state system ''' # Set default retcode to 0 __context__['retcode'] = 0 if isinstance(ret, list): __context__['retcode'] = 1 return if not salt.utils.state.check_result(ret, highst...
def _set_retcode(ret, highstate=None): ''' Set the return code based on the data back from the state system ''' # Set default retcode to 0 __context__['retcode'] = 0 if isinstance(ret, list): __context__['retcode'] = 1 return if not salt.utils.state.check_result(ret, highst...
[ "Set", "the", "return", "code", "based", "on", "the", "data", "back", "from", "the", "state", "system" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L92-L105
[ "def", "_set_retcode", "(", "ret", ",", "highstate", "=", "None", ")", ":", "# Set default retcode to 0", "__context__", "[", "'retcode'", "]", "=", "0", "if", "isinstance", "(", "ret", ",", "list", ")", ":", "__context__", "[", "'retcode'", "]", "=", "1",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_check_pillar
Check the pillar for errors, refuse to run the state if there are errors in the pillar and return the pillar errors
salt/client/ssh/wrapper/state.py
def _check_pillar(kwargs, pillar=None): ''' Check the pillar for errors, refuse to run the state if there are errors in the pillar and return the pillar errors ''' if kwargs.get('force'): return True pillar_dict = pillar if pillar is not None else __pillar__ if '_errors' in pillar_di...
def _check_pillar(kwargs, pillar=None): ''' Check the pillar for errors, refuse to run the state if there are errors in the pillar and return the pillar errors ''' if kwargs.get('force'): return True pillar_dict = pillar if pillar is not None else __pillar__ if '_errors' in pillar_di...
[ "Check", "the", "pillar", "for", "errors", "refuse", "to", "run", "the", "state", "if", "there", "are", "errors", "in", "the", "pillar", "and", "return", "the", "pillar", "errors" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L108-L118
[ "def", "_check_pillar", "(", "kwargs", ",", "pillar", "=", "None", ")", ":", "if", "kwargs", ".", "get", "(", "'force'", ")", ":", "return", "True", "pillar_dict", "=", "pillar", "if", "pillar", "is", "not", "None", "else", "__pillar__", "if", "'_errors'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_wait
Wait for all previously started state jobs to finish running
salt/client/ssh/wrapper/state.py
def _wait(jid): ''' Wait for all previously started state jobs to finish running ''' if jid is None: jid = salt.utils.jid.gen_jid(__opts__) states = _prior_running_states(jid) while states: time.sleep(1) states = _prior_running_states(jid)
def _wait(jid): ''' Wait for all previously started state jobs to finish running ''' if jid is None: jid = salt.utils.jid.gen_jid(__opts__) states = _prior_running_states(jid) while states: time.sleep(1) states = _prior_running_states(jid)
[ "Wait", "for", "all", "previously", "started", "state", "jobs", "to", "finish", "running" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L121-L130
[ "def", "_wait", "(", "jid", ")", ":", "if", "jid", "is", "None", ":", "jid", "=", "salt", ".", "utils", ".", "jid", ".", "gen_jid", "(", "__opts__", ")", "states", "=", "_prior_running_states", "(", "jid", ")", "while", "states", ":", "time", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_merge_extra_filerefs
Takes a list of filerefs and returns a merged list
salt/client/ssh/wrapper/state.py
def _merge_extra_filerefs(*args): ''' Takes a list of filerefs and returns a merged list ''' ret = [] for arg in args: if isinstance(arg, six.string_types): if arg: ret.extend(arg.split(',')) elif isinstance(arg, list): if arg: ...
def _merge_extra_filerefs(*args): ''' Takes a list of filerefs and returns a merged list ''' ret = [] for arg in args: if isinstance(arg, six.string_types): if arg: ret.extend(arg.split(',')) elif isinstance(arg, list): if arg: ...
[ "Takes", "a", "list", "of", "filerefs", "and", "returns", "a", "merged", "list" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L133-L145
[ "def", "_merge_extra_filerefs", "(", "*", "args", ")", ":", "ret", "=", "[", "]", "for", "arg", "in", "args", ":", "if", "isinstance", "(", "arg", ",", "six", ".", "string_types", ")", ":", "if", "arg", ":", "ret", ".", "extend", "(", "arg", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_cleanup_slsmod_high_data
Set "slsmod" keys to None to make high_data JSON serializable
salt/client/ssh/wrapper/state.py
def _cleanup_slsmod_high_data(high_data): ''' Set "slsmod" keys to None to make high_data JSON serializable ''' for i in six.itervalues(high_data): if 'stateconf' in i: stateconf_data = i['stateconf'][1] if 'slsmod' in stateconf_data: stateconf_data['s...
def _cleanup_slsmod_high_data(high_data): ''' Set "slsmod" keys to None to make high_data JSON serializable ''' for i in six.itervalues(high_data): if 'stateconf' in i: stateconf_data = i['stateconf'][1] if 'slsmod' in stateconf_data: stateconf_data['s...
[ "Set", "slsmod", "keys", "to", "None", "to", "make", "high_data", "JSON", "serializable" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L158-L167
[ "def", "_cleanup_slsmod_high_data", "(", "high_data", ")", ":", "for", "i", "in", "six", ".", "itervalues", "(", "high_data", ")", ":", "if", "'stateconf'", "in", "i", ":", "stateconf_data", "=", "i", "[", "'stateconf'", "]", "[", "1", "]", "if", "'slsmo...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_parse_mods
Parse modules.
salt/client/ssh/wrapper/state.py
def _parse_mods(mods): ''' Parse modules. ''' if isinstance(mods, six.string_types): mods = [item.strip() for item in mods.split(',') if item.strip()] return mods
def _parse_mods(mods): ''' Parse modules. ''' if isinstance(mods, six.string_types): mods = [item.strip() for item in mods.split(',') if item.strip()] return mods
[ "Parse", "modules", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L170-L177
[ "def", "_parse_mods", "(", "mods", ")", ":", "if", "isinstance", "(", "mods", ",", "six", ".", "string_types", ")", ":", "mods", "=", "[", "item", ".", "strip", "(", ")", "for", "item", "in", "mods", ".", "split", "(", "','", ")", "if", "item", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sls
Create the seed file for a state.sls run
salt/client/ssh/wrapper/state.py
def sls(mods, saltenv='base', test=None, exclude=None, **kwargs): ''' Create the seed file for a state.sls run ''' st_kwargs = __salt__.kwargs __opts__['grains'] = __grains__ __pillar__.update(kwargs.get('pillar', {})) opts = salt.utils.state.get_sls_opts(__opts__, **kwargs) st_ = salt.c...
def sls(mods, saltenv='base', test=None, exclude=None, **kwargs): ''' Create the seed file for a state.sls run ''' st_kwargs = __salt__.kwargs __opts__['grains'] = __grains__ __pillar__.update(kwargs.get('pillar', {})) opts = salt.utils.state.get_sls_opts(__opts__, **kwargs) st_ = salt.c...
[ "Create", "the", "seed", "file", "for", "a", "state", ".", "sls", "run" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L180-L267
[ "def", "sls", "(", "mods", ",", "saltenv", "=", "'base'", ",", "test", "=", "None", ",", "exclude", "=", "None", ",", "*", "*", "kwargs", ")", ":", "st_kwargs", "=", "__salt__", ".", "kwargs", "__opts__", "[", "'grains'", "]", "=", "__grains__", "__p...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
running
Return a list of strings that contain state return data if a state function is already running. This function is used to prevent multiple state calls from being run at the same time. CLI Example: .. code-block:: bash salt '*' state.running
salt/client/ssh/wrapper/state.py
def running(concurrent=False): ''' Return a list of strings that contain state return data if a state function is already running. This function is used to prevent multiple state calls from being run at the same time. CLI Example: .. code-block:: bash salt '*' state.running ''' ...
def running(concurrent=False): ''' Return a list of strings that contain state return data if a state function is already running. This function is used to prevent multiple state calls from being run at the same time. CLI Example: .. code-block:: bash salt '*' state.running ''' ...
[ "Return", "a", "list", "of", "strings", "that", "contain", "state", "return", "data", "if", "a", "state", "function", "is", "already", "running", ".", "This", "function", "is", "used", "to", "prevent", "multiple", "state", "calls", "from", "being", "run", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L270-L297
[ "def", "running", "(", "concurrent", "=", "False", ")", ":", "ret", "=", "[", "]", "if", "concurrent", ":", "return", "ret", "active", "=", "__salt__", "[", "'saltutil.is_running'", "]", "(", "'state.*'", ")", "for", "data", "in", "active", ":", "err", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_prior_running_states
Return a list of dicts of prior calls to state functions. This function is used to queue state calls so only one is run at a time.
salt/client/ssh/wrapper/state.py
def _prior_running_states(jid): ''' Return a list of dicts of prior calls to state functions. This function is used to queue state calls so only one is run at a time. ''' ret = [] active = __salt__['saltutil.is_running']('state.*') for data in active: try: data_jid = in...
def _prior_running_states(jid): ''' Return a list of dicts of prior calls to state functions. This function is used to queue state calls so only one is run at a time. ''' ret = [] active = __salt__['saltutil.is_running']('state.*') for data in active: try: data_jid = in...
[ "Return", "a", "list", "of", "dicts", "of", "prior", "calls", "to", "state", "functions", ".", "This", "function", "is", "used", "to", "queue", "state", "calls", "so", "only", "one", "is", "run", "at", "a", "time", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L300-L315
[ "def", "_prior_running_states", "(", "jid", ")", ":", "ret", "=", "[", "]", "active", "=", "__salt__", "[", "'saltutil.is_running'", "]", "(", "'state.*'", ")", "for", "data", "in", "active", ":", "try", ":", "data_jid", "=", "int", "(", "data", "[", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_check_queue
Utility function to queue the state run if requested and to check for conflicts in currently running states
salt/client/ssh/wrapper/state.py
def _check_queue(queue, kwargs): ''' Utility function to queue the state run if requested and to check for conflicts in currently running states ''' if queue: _wait(kwargs.get('__pub_jid')) else: conflict = running(concurrent=kwargs.get('concurrent', False)) if conflict: ...
def _check_queue(queue, kwargs): ''' Utility function to queue the state run if requested and to check for conflicts in currently running states ''' if queue: _wait(kwargs.get('__pub_jid')) else: conflict = running(concurrent=kwargs.get('concurrent', False)) if conflict: ...
[ "Utility", "function", "to", "queue", "the", "state", "run", "if", "requested", "and", "to", "check", "for", "conflicts", "in", "currently", "running", "states" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L318-L329
[ "def", "_check_queue", "(", "queue", ",", "kwargs", ")", ":", "if", "queue", ":", "_wait", "(", "kwargs", ".", "get", "(", "'__pub_jid'", ")", ")", "else", ":", "conflict", "=", "running", "(", "concurrent", "=", "kwargs", ".", "get", "(", "'concurrent...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
low
Execute a single low data call This function is mostly intended for testing the state system CLI Example: .. code-block:: bash salt '*' state.low '{"state": "pkg", "fun": "installed", "name": "vi"}'
salt/client/ssh/wrapper/state.py
def low(data, **kwargs): ''' Execute a single low data call This function is mostly intended for testing the state system CLI Example: .. code-block:: bash salt '*' state.low '{"state": "pkg", "fun": "installed", "name": "vi"}' ''' st_kwargs = __salt__.kwargs __opts__['grains'...
def low(data, **kwargs): ''' Execute a single low data call This function is mostly intended for testing the state system CLI Example: .. code-block:: bash salt '*' state.low '{"state": "pkg", "fun": "installed", "name": "vi"}' ''' st_kwargs = __salt__.kwargs __opts__['grains'...
[ "Execute", "a", "single", "low", "data", "call", "This", "function", "is", "mostly", "intended", "for", "testing", "the", "state", "system" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L338-L410
[ "def", "low", "(", "data", ",", "*", "*", "kwargs", ")", ":", "st_kwargs", "=", "__salt__", ".", "kwargs", "__opts__", "[", "'grains'", "]", "=", "__grains__", "chunks", "=", "[", "data", "]", "st_", "=", "salt", ".", "client", ".", "ssh", ".", "st...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
request
.. versionadded:: 2017.7.3 Request that the local admin execute a state run via `salt-call state.run_request` All arguments match state.apply CLI Example: .. code-block:: bash salt '*' state.request salt '*' state.request test salt '*' state.request test,pkgs
salt/client/ssh/wrapper/state.py
def request(mods=None, **kwargs): ''' .. versionadded:: 2017.7.3 Request that the local admin execute a state run via `salt-call state.run_request` All arguments match state.apply CLI Example: .. code-block:: bash salt '*' state.request salt '*' state.request ...
def request(mods=None, **kwargs): ''' .. versionadded:: 2017.7.3 Request that the local admin execute a state run via `salt-call state.run_request` All arguments match state.apply CLI Example: .. code-block:: bash salt '*' state.request salt '*' state.request ...
[ "..", "versionadded", "::", "2017", ".", "7", ".", "3" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L525-L565
[ "def", "request", "(", "mods", "=", "None", ",", "*", "*", "kwargs", ")", ":", "kwargs", "[", "'test'", "]", "=", "True", "ret", "=", "apply_", "(", "mods", ",", "*", "*", "kwargs", ")", "notify_path", "=", "os", ".", "path", ".", "join", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
clear_request
.. versionadded:: 2017.7.3 Clear out the state execution request without executing it CLI Example: .. code-block:: bash salt '*' state.clear_request
salt/client/ssh/wrapper/state.py
def clear_request(name=None): ''' .. versionadded:: 2017.7.3 Clear out the state execution request without executing it CLI Example: .. code-block:: bash salt '*' state.clear_request ''' notify_path = os.path.join(__opts__['cachedir'], 'req_state.p') serial = salt.payload.Ser...
def clear_request(name=None): ''' .. versionadded:: 2017.7.3 Clear out the state execution request without executing it CLI Example: .. code-block:: bash salt '*' state.clear_request ''' notify_path = os.path.join(__opts__['cachedir'], 'req_state.p') serial = salt.payload.Ser...
[ "..", "versionadded", "::", "2017", ".", "7", ".", "3" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L593-L632
[ "def", "clear_request", "(", "name", "=", "None", ")", ":", "notify_path", "=", "os", ".", "path", ".", "join", "(", "__opts__", "[", "'cachedir'", "]", ",", "'req_state.p'", ")", "serial", "=", "salt", ".", "payload", ".", "Serial", "(", "__opts__", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
run_request
.. versionadded:: 2017.7.3 Execute the pending state request CLI Example: .. code-block:: bash salt '*' state.run_request
salt/client/ssh/wrapper/state.py
def run_request(name='default', **kwargs): ''' .. versionadded:: 2017.7.3 Execute the pending state request CLI Example: .. code-block:: bash salt '*' state.run_request ''' req = check_request() if name not in req: return {} n_req = req[name] if 'mods' not in ...
def run_request(name='default', **kwargs): ''' .. versionadded:: 2017.7.3 Execute the pending state request CLI Example: .. code-block:: bash salt '*' state.run_request ''' req = check_request() if name not in req: return {} n_req = req[name] if 'mods' not in ...
[ "..", "versionadded", "::", "2017", ".", "7", ".", "3" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L635-L663
[ "def", "run_request", "(", "name", "=", "'default'", ",", "*", "*", "kwargs", ")", ":", "req", "=", "check_request", "(", ")", "if", "name", "not", "in", "req", ":", "return", "{", "}", "n_req", "=", "req", "[", "name", "]", "if", "'mods'", "not", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_highstate
Retrieve the highstate data from the salt master and display it CLI Example: .. code-block:: bash salt '*' state.show_highstate
salt/client/ssh/wrapper/state.py
def show_highstate(**kwargs): ''' Retrieve the highstate data from the salt master and display it CLI Example: .. code-block:: bash salt '*' state.show_highstate ''' __opts__['grains'] = __grains__ opts = salt.utils.state.get_sls_opts(__opts__, **kwargs) st_ = salt.client.ssh....
def show_highstate(**kwargs): ''' Retrieve the highstate data from the salt master and display it CLI Example: .. code-block:: bash salt '*' state.show_highstate ''' __opts__['grains'] = __grains__ opts = salt.utils.state.get_sls_opts(__opts__, **kwargs) st_ = salt.client.ssh....
[ "Retrieve", "the", "highstate", "data", "from", "the", "salt", "master", "and", "display", "it" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L831-L851
[ "def", "show_highstate", "(", "*", "*", "kwargs", ")", ":", "__opts__", "[", "'grains'", "]", "=", "__grains__", "opts", "=", "salt", ".", "utils", ".", "state", ".", "get_sls_opts", "(", "__opts__", ",", "*", "*", "kwargs", ")", "st_", "=", "salt", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_lowstate
List out the low data that will be applied to this minion CLI Example: .. code-block:: bash salt '*' state.show_lowstate
salt/client/ssh/wrapper/state.py
def show_lowstate(**kwargs): ''' List out the low data that will be applied to this minion CLI Example: .. code-block:: bash salt '*' state.show_lowstate ''' __opts__['grains'] = __grains__ opts = salt.utils.state.get_sls_opts(__opts__, **kwargs) st_ = salt.client.ssh.state.SS...
def show_lowstate(**kwargs): ''' List out the low data that will be applied to this minion CLI Example: .. code-block:: bash salt '*' state.show_lowstate ''' __opts__['grains'] = __grains__ opts = salt.utils.state.get_sls_opts(__opts__, **kwargs) st_ = salt.client.ssh.state.SS...
[ "List", "out", "the", "low", "data", "that", "will", "be", "applied", "to", "this", "minion" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L854-L874
[ "def", "show_lowstate", "(", "*", "*", "kwargs", ")", ":", "__opts__", "[", "'grains'", "]", "=", "__grains__", "opts", "=", "salt", ".", "utils", ".", "state", ".", "get_sls_opts", "(", "__opts__", ",", "*", "*", "kwargs", ")", "st_", "=", "salt", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sls_id
Call a single ID from the named module(s) and handle all requisites The state ID comes *before* the module ID(s) on the command line. id ID to call mods Comma-delimited list of modules to search for given id and its requisites .. versionadded:: 2017.7.3 saltenv : base Sp...
salt/client/ssh/wrapper/state.py
def sls_id(id_, mods, test=None, queue=False, **kwargs): ''' Call a single ID from the named module(s) and handle all requisites The state ID comes *before* the module ID(s) on the command line. id ID to call mods Comma-delimited list of modules to search for given id and its requ...
def sls_id(id_, mods, test=None, queue=False, **kwargs): ''' Call a single ID from the named module(s) and handle all requisites The state ID comes *before* the module ID(s) on the command line. id ID to call mods Comma-delimited list of modules to search for given id and its requ...
[ "Call", "a", "single", "ID", "from", "the", "named", "module", "(", "s", ")", "and", "handle", "all", "requisites" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L877-L964
[ "def", "sls_id", "(", "id_", ",", "mods", ",", "test", "=", "None", ",", "queue", "=", "False", ",", "*", "*", "kwargs", ")", ":", "st_kwargs", "=", "__salt__", ".", "kwargs", "conflict", "=", "_check_queue", "(", "queue", ",", "kwargs", ")", "if", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_sls
Display the state data from a specific sls or list of sls files on the master CLI Example: .. code-block:: bash salt '*' state.show_sls core,edit.vim dev
salt/client/ssh/wrapper/state.py
def show_sls(mods, saltenv='base', test=None, **kwargs): ''' Display the state data from a specific sls or list of sls files on the master CLI Example: .. code-block:: bash salt '*' state.show_sls core,edit.vim dev ''' __pillar__.update(kwargs.get('pillar', {})) __opts__['grai...
def show_sls(mods, saltenv='base', test=None, **kwargs): ''' Display the state data from a specific sls or list of sls files on the master CLI Example: .. code-block:: bash salt '*' state.show_sls core,edit.vim dev ''' __pillar__.update(kwargs.get('pillar', {})) __opts__['grai...
[ "Display", "the", "state", "data", "from", "a", "specific", "sls", "or", "list", "of", "sls", "files", "on", "the", "master" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L967-L1005
[ "def", "show_sls", "(", "mods", ",", "saltenv", "=", "'base'", ",", "test", "=", "None", ",", "*", "*", "kwargs", ")", ":", "__pillar__", ".", "update", "(", "kwargs", ".", "get", "(", "'pillar'", ",", "{", "}", ")", ")", "__opts__", "[", "'grains'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_top
Return the top data that the minion will use for a highstate CLI Example: .. code-block:: bash salt '*' state.show_top
salt/client/ssh/wrapper/state.py
def show_top(**kwargs): ''' Return the top data that the minion will use for a highstate CLI Example: .. code-block:: bash salt '*' state.show_top ''' __opts__['grains'] = __grains__ opts = salt.utils.state.get_sls_opts(__opts__, **kwargs) st_ = salt.client.ssh.state.SSHHighSt...
def show_top(**kwargs): ''' Return the top data that the minion will use for a highstate CLI Example: .. code-block:: bash salt '*' state.show_top ''' __opts__['grains'] = __grains__ opts = salt.utils.state.get_sls_opts(__opts__, **kwargs) st_ = salt.client.ssh.state.SSHHighSt...
[ "Return", "the", "top", "data", "that", "the", "minion", "will", "use", "for", "a", "highstate" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L1053-L1076
[ "def", "show_top", "(", "*", "*", "kwargs", ")", ":", "__opts__", "[", "'grains'", "]", "=", "__grains__", "opts", "=", "salt", ".", "utils", ".", "state", ".", "get_sls_opts", "(", "__opts__", ",", "*", "*", "kwargs", ")", "st_", "=", "salt", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
single
.. versionadded:: 2015.5.0 Execute a single state function with the named kwargs, returns False if insufficient data is sent to the command By default, the values of the kwargs will be parsed as YAML. So, you can specify lists values, or lists of single entry key-value maps, as you would in a YAML...
salt/client/ssh/wrapper/state.py
def single(fun, name, test=None, **kwargs): ''' .. versionadded:: 2015.5.0 Execute a single state function with the named kwargs, returns False if insufficient data is sent to the command By default, the values of the kwargs will be parsed as YAML. So, you can specify lists values, or lists of...
def single(fun, name, test=None, **kwargs): ''' .. versionadded:: 2015.5.0 Execute a single state function with the named kwargs, returns False if insufficient data is sent to the command By default, the values of the kwargs will be parsed as YAML. So, you can specify lists values, or lists of...
[ "..", "versionadded", "::", "2015", ".", "5", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/state.py#L1079-L1198
[ "def", "single", "(", "fun", ",", "name", ",", "test", "=", "None", ",", "*", "*", "kwargs", ")", ":", "st_kwargs", "=", "__salt__", ".", "kwargs", "__opts__", "[", "'grains'", "]", "=", "__grains__", "# state.fun -> [state, fun]", "comps", "=", "fun", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_initialize_connection
Initialize Datadog connection
salt/modules/datadog_api.py
def _initialize_connection(api_key, app_key): ''' Initialize Datadog connection ''' if api_key is None: raise SaltInvocationError('api_key must be specified') if app_key is None: raise SaltInvocationError('app_key must be specified') options = { 'api_key': api_key, ...
def _initialize_connection(api_key, app_key): ''' Initialize Datadog connection ''' if api_key is None: raise SaltInvocationError('api_key must be specified') if app_key is None: raise SaltInvocationError('app_key must be specified') options = { 'api_key': api_key, ...
[ "Initialize", "Datadog", "connection" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/datadog_api.py#L41-L53
[ "def", "_initialize_connection", "(", "api_key", ",", "app_key", ")", ":", "if", "api_key", "is", "None", ":", "raise", "SaltInvocationError", "(", "'api_key must be specified'", ")", "if", "app_key", "is", "None", ":", "raise", "SaltInvocationError", "(", "'app_k...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
schedule_downtime
Schedule downtime for a scope of monitors. CLI Example: .. code-block:: bash salt-call datadog.schedule_downtime 'host:app2' \\ stop=$(date --date='30 minutes' +%s) \\ app_key='0123456789' \\ ...
salt/modules/datadog_api.py
def schedule_downtime(scope, api_key=None, app_key=None, monitor_id=None, start=None, end=None, message=None, recurrence=None, timezone=None, ...
def schedule_downtime(scope, api_key=None, app_key=None, monitor_id=None, start=None, end=None, message=None, recurrence=None, timezone=None, ...
[ "Schedule", "downtime", "for", "a", "scope", "of", "monitors", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/datadog_api.py#L56-L120
[ "def", "schedule_downtime", "(", "scope", ",", "api_key", "=", "None", ",", "app_key", "=", "None", ",", "monitor_id", "=", "None", ",", "start", "=", "None", ",", "end", "=", "None", ",", "message", "=", "None", ",", "recurrence", "=", "None", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cancel_downtime
Cancel a downtime by id or by scope. CLI Example: .. code-block:: bash salt-call datadog.cancel_downtime scope='host:app01' \\ api_key='0123456789' \\ app_key='9876543210'` Arguments - Either scope or id is requi...
salt/modules/datadog_api.py
def cancel_downtime(api_key=None, app_key=None, scope=None, id=None): ''' Cancel a downtime by id or by scope. CLI Example: .. code-block:: bash salt-call datadog.cancel_downtime scope='host:app01' \\ ...
def cancel_downtime(api_key=None, app_key=None, scope=None, id=None): ''' Cancel a downtime by id or by scope. CLI Example: .. code-block:: bash salt-call datadog.cancel_downtime scope='host:app01' \\ ...
[ "Cancel", "a", "downtime", "by", "id", "or", "by", "scope", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/datadog_api.py#L123-L180
[ "def", "cancel_downtime", "(", "api_key", "=", "None", ",", "app_key", "=", "None", ",", "scope", "=", "None", ",", "id", "=", "None", ")", ":", "if", "api_key", "is", "None", ":", "raise", "SaltInvocationError", "(", "'api_key must be specified'", ")", "i...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
post_event
Post an event to the Datadog stream. CLI Example .. code-block:: bash salt-call datadog.post_event api_key='0123456789' \\ app_key='9876543210' \\ title='Salt Highstate' \\ text="Salt highst...
salt/modules/datadog_api.py
def post_event(api_key=None, app_key=None, title=None, text=None, date_happened=None, priority=None, host=None, tags=None, alert_type=None, aggregation_key=None, source_t...
def post_event(api_key=None, app_key=None, title=None, text=None, date_happened=None, priority=None, host=None, tags=None, alert_type=None, aggregation_key=None, source_t...
[ "Post", "an", "event", "to", "the", "Datadog", "stream", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/datadog_api.py#L183-L264
[ "def", "post_event", "(", "api_key", "=", "None", ",", "app_key", "=", "None", ",", "title", "=", "None", ",", "text", "=", "None", ",", "date_happened", "=", "None", ",", "priority", "=", "None", ",", "host", "=", "None", ",", "tags", "=", "None", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_version
Get the xbps version
salt/modules/xbpspkg.py
def _get_version(): ''' Get the xbps version ''' version_string = __salt__['cmd.run']( [_check_xbps(), '--version'], output_loglevel='trace') if version_string is None: # Dunno why it would, but... return False VERSION_MATCH = re.compile(r'(?:XBPS:[\s]+)([\d.]+)(...
def _get_version(): ''' Get the xbps version ''' version_string = __salt__['cmd.run']( [_check_xbps(), '--version'], output_loglevel='trace') if version_string is None: # Dunno why it would, but... return False VERSION_MATCH = re.compile(r'(?:XBPS:[\s]+)([\d.]+)(...
[ "Get", "the", "xbps", "version" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L51-L67
[ "def", "_get_version", "(", ")", ":", "version_string", "=", "__salt__", "[", "'cmd.run'", "]", "(", "[", "_check_xbps", "(", ")", ",", "'--version'", "]", ",", "output_loglevel", "=", "'trace'", ")", "if", "version_string", "is", "None", ":", "# Dunno why i...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_pkgs
List the packages currently installed as a dict:: {'<package_name>': '<version>'} CLI Example: .. code-block:: bash salt '*' pkg.list_pkgs
salt/modules/xbpspkg.py
def list_pkgs(versions_as_list=False, **kwargs): ''' List the packages currently installed as a dict:: {'<package_name>': '<version>'} CLI Example: .. code-block:: bash salt '*' pkg.list_pkgs ''' versions_as_list = salt.utils.data.is_true(versions_as_list) # not yet imple...
def list_pkgs(versions_as_list=False, **kwargs): ''' List the packages currently installed as a dict:: {'<package_name>': '<version>'} CLI Example: .. code-block:: bash salt '*' pkg.list_pkgs ''' versions_as_list = salt.utils.data.is_true(versions_as_list) # not yet imple...
[ "List", "the", "packages", "currently", "installed", "as", "a", "dict", "::" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L81-L121
[ "def", "list_pkgs", "(", "versions_as_list", "=", "False", ",", "*", "*", "kwargs", ")", ":", "versions_as_list", "=", "salt", ".", "utils", ".", "data", ".", "is_true", "(", "versions_as_list", ")", "# not yet implemented or not applicable", "if", "any", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_upgrades
Check whether or not an upgrade is available for all packages CLI Example: .. code-block:: bash salt '*' pkg.list_upgrades
salt/modules/xbpspkg.py
def list_upgrades(refresh=True, **kwargs): ''' Check whether or not an upgrade is available for all packages CLI Example: .. code-block:: bash salt '*' pkg.list_upgrades ''' # sample output of 'xbps-install -un': # fuse-2.9.4_4 update i686 http://repo.voidlinux.eu/current 298...
def list_upgrades(refresh=True, **kwargs): ''' Check whether or not an upgrade is available for all packages CLI Example: .. code-block:: bash salt '*' pkg.list_upgrades ''' # sample output of 'xbps-install -un': # fuse-2.9.4_4 update i686 http://repo.voidlinux.eu/current 298...
[ "Check", "whether", "or", "not", "an", "upgrade", "is", "available", "for", "all", "packages" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L124-L167
[ "def", "list_upgrades", "(", "refresh", "=", "True", ",", "*", "*", "kwargs", ")", ":", "# sample output of 'xbps-install -un':", "# fuse-2.9.4_4 update i686 http://repo.voidlinux.eu/current 298133 91688", "# xtools-0.34_1 update noarch http://repo.voidlinux.eu/current 21424 1075...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
refresh_db
Update list of available packages from installed repos CLI Example: .. code-block:: bash salt '*' pkg.refresh_db
salt/modules/xbpspkg.py
def refresh_db(**kwargs): ''' Update list of available packages from installed repos CLI Example: .. code-block:: bash salt '*' pkg.refresh_db ''' # Remove rtag file to keep multiple refreshes from happening in pkg states salt.utils.pkg.clear_rtag(__opts__) cmd = 'xbps-install...
def refresh_db(**kwargs): ''' Update list of available packages from installed repos CLI Example: .. code-block:: bash salt '*' pkg.refresh_db ''' # Remove rtag file to keep multiple refreshes from happening in pkg states salt.utils.pkg.clear_rtag(__opts__) cmd = 'xbps-install...
[ "Update", "list", "of", "available", "packages", "from", "installed", "repos" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L263-L284
[ "def", "refresh_db", "(", "*", "*", "kwargs", ")", ":", "# Remove rtag file to keep multiple refreshes from happening in pkg states", "salt", ".", "utils", ".", "pkg", ".", "clear_rtag", "(", "__opts__", ")", "cmd", "=", "'xbps-install -Sy'", "call", "=", "__salt__", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
install
Install the passed package name The name of the package to be installed. refresh Whether or not to refresh the package database before installing. fromrepo Specify a package repository (url) to install from. Multiple Package Installation Options: pkgs A list of ...
salt/modules/xbpspkg.py
def install(name=None, refresh=False, fromrepo=None, pkgs=None, sources=None, **kwargs): ''' Install the passed package name The name of the package to be installed. refresh Whether or not to refresh the package database before installing. fromrepo Specify a pa...
def install(name=None, refresh=False, fromrepo=None, pkgs=None, sources=None, **kwargs): ''' Install the passed package name The name of the package to be installed. refresh Whether or not to refresh the package database before installing. fromrepo Specify a pa...
[ "Install", "the", "passed", "package" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L349-L430
[ "def", "install", "(", "name", "=", "None", ",", "refresh", "=", "False", ",", "fromrepo", "=", "None", ",", "pkgs", "=", "None", ",", "sources", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# XXX sources is not yet used in this code", "try", ":", "p...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
remove
name The name of the package to be deleted. recursive Also remove dependent packages (not required elsewhere). Default mode: enabled. Multiple Package Options: pkgs A list of packages to delete. Must be passed as a python list. The ``name`` parameter will be ignore...
salt/modules/xbpspkg.py
def remove(name=None, pkgs=None, recursive=True, **kwargs): ''' name The name of the package to be deleted. recursive Also remove dependent packages (not required elsewhere). Default mode: enabled. Multiple Package Options: pkgs A list of packages to delete. Must b...
def remove(name=None, pkgs=None, recursive=True, **kwargs): ''' name The name of the package to be deleted. recursive Also remove dependent packages (not required elsewhere). Default mode: enabled. Multiple Package Options: pkgs A list of packages to delete. Must b...
[ "name", "The", "name", "of", "the", "package", "to", "be", "deleted", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L433-L484
[ "def", "remove", "(", "name", "=", "None", ",", "pkgs", "=", "None", ",", "recursive", "=", "True", ",", "*", "*", "kwargs", ")", ":", "try", ":", "pkg_params", ",", "pkg_type", "=", "__salt__", "[", "'pkg_resource.parse_targets'", "]", "(", "name", ",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_repos
List all repos known by XBPS CLI Example: .. code-block:: bash salt '*' pkg.list_repos
salt/modules/xbpspkg.py
def list_repos(**kwargs): ''' List all repos known by XBPS CLI Example: .. code-block:: bash salt '*' pkg.list_repos ''' repos = {} out = __salt__['cmd.run']('xbps-query -L', output_loglevel='trace') for line in out.splitlines(): repo = {} if not line: ...
def list_repos(**kwargs): ''' List all repos known by XBPS CLI Example: .. code-block:: bash salt '*' pkg.list_repos ''' repos = {} out = __salt__['cmd.run']('xbps-query -L', output_loglevel='trace') for line in out.splitlines(): repo = {} if not line: ...
[ "List", "all", "repos", "known", "by", "XBPS" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L487-L514
[ "def", "list_repos", "(", "*", "*", "kwargs", ")", ":", "repos", "=", "{", "}", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "'xbps-query -L'", ",", "output_loglevel", "=", "'trace'", ")", "for", "line", "in", "out", ".", "splitlines", "(", ")",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_locate_repo_files
Find what file a repo is called in. Helper function for add_repo() and del_repo() repo url of the repo to locate (persistent). rewrite Whether to remove matching repository settings during this process. Returns a list of absolute paths.
salt/modules/xbpspkg.py
def _locate_repo_files(repo, rewrite=False): ''' Find what file a repo is called in. Helper function for add_repo() and del_repo() repo url of the repo to locate (persistent). rewrite Whether to remove matching repository settings during this process. Returns a list of absolu...
def _locate_repo_files(repo, rewrite=False): ''' Find what file a repo is called in. Helper function for add_repo() and del_repo() repo url of the repo to locate (persistent). rewrite Whether to remove matching repository settings during this process. Returns a list of absolu...
[ "Find", "what", "file", "a", "repo", "is", "called", "in", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L533-L575
[ "def", "_locate_repo_files", "(", "repo", ",", "rewrite", "=", "False", ")", ":", "ret_val", "=", "[", "]", "files", "=", "[", "]", "conf_dirs", "=", "[", "'/etc/xbps.d/'", ",", "'/usr/share/xbps.d/'", "]", "name_glob", "=", "'*.conf'", "# Matches a line where...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
add_repo
Add an XBPS repository to the system. repo url of repo to add (persistent). conffile path to xbps conf file to add this repo default: /usr/share/xbps.d/15-saltstack.conf CLI Examples: .. code-block:: bash salt '*' pkg.add_repo <repo url> [conffile=/path/to/xbps/repo....
salt/modules/xbpspkg.py
def add_repo(repo, conffile='/usr/share/xbps.d/15-saltstack.conf'): ''' Add an XBPS repository to the system. repo url of repo to add (persistent). conffile path to xbps conf file to add this repo default: /usr/share/xbps.d/15-saltstack.conf CLI Examples: .. code-bloc...
def add_repo(repo, conffile='/usr/share/xbps.d/15-saltstack.conf'): ''' Add an XBPS repository to the system. repo url of repo to add (persistent). conffile path to xbps conf file to add this repo default: /usr/share/xbps.d/15-saltstack.conf CLI Examples: .. code-bloc...
[ "Add", "an", "XBPS", "repository", "to", "the", "system", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L578-L607
[ "def", "add_repo", "(", "repo", ",", "conffile", "=", "'/usr/share/xbps.d/15-saltstack.conf'", ")", ":", "if", "not", "_locate_repo_files", "(", "repo", ")", ":", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "conffile", ",", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
del_repo
Remove an XBPS repository from the system. repo url of repo to remove (persistent). CLI Examples: .. code-block:: bash salt '*' pkg.del_repo <repo url>
salt/modules/xbpspkg.py
def del_repo(repo, **kwargs): ''' Remove an XBPS repository from the system. repo url of repo to remove (persistent). CLI Examples: .. code-block:: bash salt '*' pkg.del_repo <repo url> ''' try: _locate_repo_files(repo, rewrite=True) except IOError: r...
def del_repo(repo, **kwargs): ''' Remove an XBPS repository from the system. repo url of repo to remove (persistent). CLI Examples: .. code-block:: bash salt '*' pkg.del_repo <repo url> ''' try: _locate_repo_files(repo, rewrite=True) except IOError: r...
[ "Remove", "an", "XBPS", "repository", "from", "the", "system", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/xbpspkg.py#L610-L629
[ "def", "del_repo", "(", "repo", ",", "*", "*", "kwargs", ")", ":", "try", ":", "_locate_repo_files", "(", "repo", ",", "rewrite", "=", "True", ")", "except", "IOError", ":", "return", "False", "else", ":", "return", "True" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
enabled
Ensure an Apache conf is enabled. name Name of the Apache conf
salt/states/apache_conf.py
def enabled(name): ''' Ensure an Apache conf is enabled. name Name of the Apache conf ''' ret = {'name': name, 'result': True, 'comment': '', 'changes': {}} is_enabled = __salt__['apache.check_conf_enabled'](name) if not is_enabled: if __opts__['test']: msg = 'A...
def enabled(name): ''' Ensure an Apache conf is enabled. name Name of the Apache conf ''' ret = {'name': name, 'result': True, 'comment': '', 'changes': {}} is_enabled = __salt__['apache.check_conf_enabled'](name) if not is_enabled: if __opts__['test']: msg = 'A...
[ "Ensure", "an", "Apache", "conf", "is", "enabled", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/apache_conf.py#L33-L64
[ "def", "enabled", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "is_enabled", "=", "__salt__", "[", "'apache.check_conf_enabled'", "]", "(...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
peers
Returns a list the NTP peers configured on the network device. :return: configured NTP peers as list. CLI Example: .. code-block:: bash salt '*' ntp.peers Example output: .. code-block:: python [ '192.168.0.1', '172.17.17.1', '172.17.17.2', ...
salt/modules/napalm_ntp.py
def peers(**kwargs): # pylint: disable=unused-argument ''' Returns a list the NTP peers configured on the network device. :return: configured NTP peers as list. CLI Example: .. code-block:: bash salt '*' ntp.peers Example output: .. code-block:: python [ ...
def peers(**kwargs): # pylint: disable=unused-argument ''' Returns a list the NTP peers configured on the network device. :return: configured NTP peers as list. CLI Example: .. code-block:: bash salt '*' ntp.peers Example output: .. code-block:: python [ ...
[ "Returns", "a", "list", "the", "NTP", "peers", "configured", "on", "the", "network", "device", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_ntp.py#L63-L103
[ "def", "peers", "(", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "ntp_peers", "=", "salt", ".", "utils", ".", "napalm", ".", "call", "(", "napalm_device", ",", "# pylint: disable=undefined-variable", "'get_ntp_peers'", ",", "*", "*", "{", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
servers
Returns a list of the configured NTP servers on the device. CLI Example: .. code-block:: bash salt '*' ntp.servers Example output: .. code-block:: python [ '192.168.0.1', '172.17.17.1', '172.17.17.2', '2400:cb00:6:1024::c71b:840a' ...
salt/modules/napalm_ntp.py
def servers(**kwargs): # pylint: disable=unused-argument ''' Returns a list of the configured NTP servers on the device. CLI Example: .. code-block:: bash salt '*' ntp.servers Example output: .. code-block:: python [ '192.168.0.1', '172.17.17.1', ...
def servers(**kwargs): # pylint: disable=unused-argument ''' Returns a list of the configured NTP servers on the device. CLI Example: .. code-block:: bash salt '*' ntp.servers Example output: .. code-block:: python [ '192.168.0.1', '172.17.17.1', ...
[ "Returns", "a", "list", "of", "the", "configured", "NTP", "servers", "on", "the", "device", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_ntp.py#L107-L144
[ "def", "servers", "(", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "ntp_servers", "=", "salt", ".", "utils", ".", "napalm", ".", "call", "(", "napalm_device", ",", "# pylint: disable=undefined-variable", "'get_ntp_servers'", ",", "*", "*", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
stats
Returns a dictionary containing synchronization details of the NTP peers. :param peer: Returns only the details of a specific NTP peer. :return: a list of dictionaries, with the following keys: * remote * referenceid * synchronized * stratum * type * when ...
salt/modules/napalm_ntp.py
def stats(peer=None, **kwargs): # pylint: disable=unused-argument ''' Returns a dictionary containing synchronization details of the NTP peers. :param peer: Returns only the details of a specific NTP peer. :return: a list of dictionaries, with the following keys: * remote * reference...
def stats(peer=None, **kwargs): # pylint: disable=unused-argument ''' Returns a dictionary containing synchronization details of the NTP peers. :param peer: Returns only the details of a specific NTP peer. :return: a list of dictionaries, with the following keys: * remote * reference...
[ "Returns", "a", "dictionary", "containing", "synchronization", "details", "of", "the", "NTP", "peers", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_ntp.py#L148-L214
[ "def", "stats", "(", "peer", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "proxy_output", "=", "salt", ".", "utils", ".", "napalm", ".", "call", "(", "napalm_device", ",", "# pylint: disable=undefined-variable", "'get_ntp_st...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_peers
Configures a list of NTP peers on the device. :param peers: list of IP Addresses/Domain Names :param test (bool): discard loaded config. By default ``test`` is False (will not dicard the changes) :commit commit (bool): commit loaded config. By default ``commit`` is True (will commit the cha...
salt/modules/napalm_ntp.py
def set_peers(*peers, **options): ''' Configures a list of NTP peers on the device. :param peers: list of IP Addresses/Domain Names :param test (bool): discard loaded config. By default ``test`` is False (will not dicard the changes) :commit commit (bool): commit loaded config. By default ...
def set_peers(*peers, **options): ''' Configures a list of NTP peers on the device. :param peers: list of IP Addresses/Domain Names :param test (bool): discard loaded config. By default ``test`` is False (will not dicard the changes) :commit commit (bool): commit loaded config. By default ...
[ "Configures", "a", "list", "of", "NTP", "peers", "on", "the", "device", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_ntp.py#L218-L249
[ "def", "set_peers", "(", "*", "peers", ",", "*", "*", "options", ")", ":", "test", "=", "options", ".", "pop", "(", "'test'", ",", "False", ")", "commit", "=", "options", ".", "pop", "(", "'commit'", ",", "True", ")", "return", "__salt__", "[", "'n...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_servers
Removes NTP servers configured on the device. :param servers: list of IP Addresses/Domain Names to be removed as NTP servers :param test (bool): discard loaded config. By default ``test`` is False (will not dicard the changes) :param commit (bool): commit loaded config. By default ``commit`...
salt/modules/napalm_ntp.py
def delete_servers(*servers, **options): ''' Removes NTP servers configured on the device. :param servers: list of IP Addresses/Domain Names to be removed as NTP servers :param test (bool): discard loaded config. By default ``test`` is False (will not dicard the changes) :param com...
def delete_servers(*servers, **options): ''' Removes NTP servers configured on the device. :param servers: list of IP Addresses/Domain Names to be removed as NTP servers :param test (bool): discard loaded config. By default ``test`` is False (will not dicard the changes) :param com...
[ "Removes", "NTP", "servers", "configured", "on", "the", "device", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_ntp.py#L323-L356
[ "def", "delete_servers", "(", "*", "servers", ",", "*", "*", "options", ")", ":", "test", "=", "options", ".", "pop", "(", "'test'", ",", "False", ")", "commit", "=", "options", ".", "pop", "(", "'commit'", ",", "True", ")", "return", "__salt__", "["...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
returner
Process the return from Salt
salt/returners/elasticsearch_return.py
def returner(ret): ''' Process the return from Salt ''' job_fun = ret['fun'] job_fun_escaped = job_fun.replace('.', '_') job_id = ret['jid'] job_retcode = ret.get('retcode', 1) job_success = True if not job_retcode else False options = _get_options(ret) if job_fun in options['...
def returner(ret): ''' Process the return from Salt ''' job_fun = ret['fun'] job_fun_escaped = job_fun.replace('.', '_') job_id = ret['jid'] job_retcode = ret.get('retcode', 1) job_success = True if not job_retcode else False options = _get_options(ret) if job_fun in options['...
[ "Process", "the", "return", "from", "Salt" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/elasticsearch_return.py#L208-L331
[ "def", "returner", "(", "ret", ")", ":", "job_fun", "=", "ret", "[", "'fun'", "]", "job_fun_escaped", "=", "job_fun", ".", "replace", "(", "'.'", ",", "'_'", ")", "job_id", "=", "ret", "[", "'jid'", "]", "job_retcode", "=", "ret", ".", "get", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
event_return
Return events to Elasticsearch Requires that the `event_return` configuration be set in master config.
salt/returners/elasticsearch_return.py
def event_return(events): ''' Return events to Elasticsearch Requires that the `event_return` configuration be set in master config. ''' options = _get_options() index = options['master_event_index'] doc_type = options['master_event_doc_type'] if options['index_date']: index =...
def event_return(events): ''' Return events to Elasticsearch Requires that the `event_return` configuration be set in master config. ''' options = _get_options() index = options['master_event_index'] doc_type = options['master_event_doc_type'] if options['index_date']: index =...
[ "Return", "events", "to", "Elasticsearch" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/elasticsearch_return.py#L334-L360
[ "def", "event_return", "(", "events", ")", ":", "options", "=", "_get_options", "(", ")", "index", "=", "options", "[", "'master_event_index'", "]", "doc_type", "=", "options", "[", "'master_event_doc_type'", "]", "if", "options", "[", "'index_date'", "]", ":"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
save_load
Save the load to the specified jid id .. versionadded:: 2015.8.1
salt/returners/elasticsearch_return.py
def save_load(jid, load, minions=None): ''' Save the load to the specified jid id .. versionadded:: 2015.8.1 ''' options = _get_options() index = options['master_job_cache_index'] doc_type = options['master_job_cache_doc_type'] if options['index_date']: index = '{0}-{1}'.forma...
def save_load(jid, load, minions=None): ''' Save the load to the specified jid id .. versionadded:: 2015.8.1 ''' options = _get_options() index = options['master_job_cache_index'] doc_type = options['master_job_cache_doc_type'] if options['index_date']: index = '{0}-{1}'.forma...
[ "Save", "the", "load", "to", "the", "specified", "jid", "id" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/elasticsearch_return.py#L370-L404
[ "def", "save_load", "(", "jid", ",", "load", ",", "minions", "=", "None", ")", ":", "options", "=", "_get_options", "(", ")", "index", "=", "options", "[", "'master_job_cache_index'", "]", "doc_type", "=", "options", "[", "'master_job_cache_doc_type'", "]", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_load
Return the load data that marks a specified jid .. versionadded:: 2015.8.1
salt/returners/elasticsearch_return.py
def get_load(jid): ''' Return the load data that marks a specified jid .. versionadded:: 2015.8.1 ''' options = _get_options() index = options['master_job_cache_index'] doc_type = options['master_job_cache_doc_type'] if options['index_date']: index = '{0}-{1}'.format(index, ...
def get_load(jid): ''' Return the load data that marks a specified jid .. versionadded:: 2015.8.1 ''' options = _get_options() index = options['master_job_cache_index'] doc_type = options['master_job_cache_doc_type'] if options['index_date']: index = '{0}-{1}'.format(index, ...
[ "Return", "the", "load", "data", "that", "marks", "a", "specified", "jid" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/elasticsearch_return.py#L407-L428
[ "def", "get_load", "(", "jid", ")", ":", "options", "=", "_get_options", "(", ")", "index", "=", "options", "[", "'master_job_cache_index'", "]", "doc_type", "=", "options", "[", "'master_job_cache_doc_type'", "]", "if", "options", "[", "'index_date'", "]", ":...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
status
.. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Print the status of all known salt minions CLI Example: .. code-block:: bash salt-run manage.status salt-run manage.status tgt="webservers" t...
salt/runners/manage.py
def status(output=True, tgt='*', tgt_type='glob', timeout=None, gather_job_timeout=None): ''' .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Print the status of all known salt minions CLI Example: ...
def status(output=True, tgt='*', tgt_type='glob', timeout=None, gather_job_timeout=None): ''' .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Print the status of all known salt minions CLI Example: ...
[ "..", "versionchanged", "::", "2017", ".", "7", ".", "0", "The", "expr_form", "argument", "has", "been", "renamed", "to", "tgt_type", "earlier", "releases", "must", "use", "expr_form", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L71-L96
[ "def", "status", "(", "output", "=", "True", ",", "tgt", "=", "'*'", ",", "tgt_type", "=", "'glob'", ",", "timeout", "=", "None", ",", "gather_job_timeout", "=", "None", ")", ":", "ret", "=", "{", "}", "if", "not", "timeout", ":", "timeout", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
key_regen
This routine is used to regenerate all keys in an environment. This is invasive! ALL KEYS IN THE SALT ENVIRONMENT WILL BE REGENERATED!! The key_regen routine sends a command out to minions to revoke the master key and remove all minion keys, it then removes all keys from the master and prompts the user...
salt/runners/manage.py
def key_regen(): ''' This routine is used to regenerate all keys in an environment. This is invasive! ALL KEYS IN THE SALT ENVIRONMENT WILL BE REGENERATED!! The key_regen routine sends a command out to minions to revoke the master key and remove all minion keys, it then removes all keys from the ma...
def key_regen(): ''' This routine is used to regenerate all keys in an environment. This is invasive! ALL KEYS IN THE SALT ENVIRONMENT WILL BE REGENERATED!! The key_regen routine sends a command out to minions to revoke the master key and remove all minion keys, it then removes all keys from the ma...
[ "This", "routine", "is", "used", "to", "regenerate", "all", "keys", "in", "an", "environment", ".", "This", "is", "invasive!", "ALL", "KEYS", "IN", "THE", "SALT", "ENVIRONMENT", "WILL", "BE", "REGENERATED!!" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L99-L148
[ "def", "key_regen", "(", ")", ":", "client", "=", "salt", ".", "client", ".", "get_local_client", "(", "__opts__", "[", "'conf_file'", "]", ")", "try", ":", "client", ".", "cmd", "(", "'*'", ",", "'saltutil.regen_keys'", ")", "except", "SaltClientError", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
down
.. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Print a list of all the down or unresponsive salt minions Optionally remove keys of down minions CLI Example: .. code-block:: bash salt-run manag...
salt/runners/manage.py
def down(removekeys=False, tgt='*', tgt_type='glob', timeout=None, gather_job_timeout=None): ''' .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Print a list of all the down or unresponsive salt minions O...
def down(removekeys=False, tgt='*', tgt_type='glob', timeout=None, gather_job_timeout=None): ''' .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Print a list of all the down or unresponsive salt minions O...
[ "..", "versionchanged", "::", "2017", ".", "7", ".", "0", "The", "expr_form", "argument", "has", "been", "renamed", "to", "tgt_type", "earlier", "releases", "must", "use", "expr_form", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L151-L179
[ "def", "down", "(", "removekeys", "=", "False", ",", "tgt", "=", "'*'", ",", "tgt_type", "=", "'glob'", ",", "timeout", "=", "None", ",", "gather_job_timeout", "=", "None", ")", ":", "ret", "=", "status", "(", "output", "=", "False", ",", "tgt", "=",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
up
.. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Print a list of all of the minions that are up CLI Example: .. code-block:: bash salt-run manage.up salt-run manage.up tgt="webservers" tgt_t...
salt/runners/manage.py
def up(tgt='*', tgt_type='glob', timeout=None, gather_job_timeout=None): # pylint: disable=C0103 ''' .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Print a list of all of the minions that are up CLI Ex...
def up(tgt='*', tgt_type='glob', timeout=None, gather_job_timeout=None): # pylint: disable=C0103 ''' .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Print a list of all of the minions that are up CLI Ex...
[ "..", "versionchanged", "::", "2017", ".", "7", ".", "0", "The", "expr_form", "argument", "has", "been", "renamed", "to", "tgt_type", "earlier", "releases", "must", "use", "expr_form", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L182-L205
[ "def", "up", "(", "tgt", "=", "'*'", ",", "tgt_type", "=", "'glob'", ",", "timeout", "=", "None", ",", "gather_job_timeout", "=", "None", ")", ":", "# pylint: disable=C0103", "ret", "=", "status", "(", "output", "=", "False", ",", "tgt", "=", "tgt", ",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_state
.. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are up according to Salt's presence detection (no commands will be sent to minions) ...
salt/runners/manage.py
def list_state(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are up according ...
def list_state(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are up according ...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0", "..", "versionchanged", "::", "2019", ".", "2", ".", "0", "The", "show_ipv4", "argument", "has", "been", "renamed", "to", "show_ip", "as", "it", "now", "includes", "IPv6", "addresses", "for", "IPv6"...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L220-L251
[ "def", "list_state", "(", "subset", "=", "None", ",", "show_ip", "=", "False", ",", "show_ipv4", "=", "None", ")", ":", "show_ip", "=", "_show_ip_migration", "(", "show_ip", ",", "show_ipv4", ")", "# Always return 'present' for 0MQ for now", "# TODO: implement other...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_not_state
.. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are NOT up according to Salt's presence detection (no commands will be sent to minion...
salt/runners/manage.py
def list_not_state(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are NOT up ac...
def list_not_state(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are NOT up ac...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0", "..", "versionchanged", "::", "2019", ".", "2", ".", "0", "The", "show_ipv4", "argument", "has", "been", "renamed", "to", "show_ip", "as", "it", "now", "includes", "IPv6", "addresses", "for", "IPv6"...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L254-L287
[ "def", "list_not_state", "(", "subset", "=", "None", ",", "show_ip", "=", "False", ",", "show_ipv4", "=", "None", ")", ":", "show_ip", "=", "_show_ip_migration", "(", "show_ip", ",", "show_ipv4", ")", "connected", "=", "list_state", "(", "subset", "=", "No...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
.. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are up according to Salt's presence detection (no commands will be sent to minions) subset : None Pass ...
salt/runners/manage.py
def present(subset=None, show_ip=False, show_ipv4=None): ''' .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are up according to Salt's presence detection (...
def present(subset=None, show_ip=False, show_ipv4=None): ''' .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are up according to Salt's presence detection (...
[ "..", "versionchanged", "::", "2019", ".", "2", ".", "0", "The", "show_ipv4", "argument", "has", "been", "renamed", "to", "show_ip", "as", "it", "now", "includes", "IPv6", "addresses", "for", "IPv6", "-", "connected", "minions", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L290-L312
[ "def", "present", "(", "subset", "=", "None", ",", "show_ip", "=", "False", ",", "show_ipv4", "=", "None", ")", ":", "show_ip", "=", "_show_ip_migration", "(", "show_ip", ",", "show_ipv4", ")", "return", "list_state", "(", "subset", "=", "subset", ",", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
not_present
.. versionadded:: 2015.5.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are NOT up according to Salt's presence detection (no commands will be sent) sub...
salt/runners/manage.py
def not_present(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.5.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are NOT up accor...
def not_present(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.5.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are NOT up accor...
[ "..", "versionadded", "::", "2015", ".", "5", ".", "0", "..", "versionchanged", "::", "2019", ".", "2", ".", "0", "The", "show_ipv4", "argument", "has", "been", "renamed", "to", "show_ip", "as", "it", "now", "includes", "IPv6", "addresses", "for", "IPv6"...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L315-L338
[ "def", "not_present", "(", "subset", "=", "None", ",", "show_ip", "=", "False", ",", "show_ipv4", "=", "None", ")", ":", "show_ip", "=", "_show_ip_migration", "(", "show_ip", ",", "show_ipv4", ")", "return", "list_not_state", "(", "subset", "=", "subset", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
joined
.. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are up according to Salt's presence detection (no commands will be sent to minions) ...
salt/runners/manage.py
def joined(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are up according to S...
def joined(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are up according to S...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0", "..", "versionchanged", "::", "2019", ".", "2", ".", "0", "The", "show_ipv4", "argument", "has", "been", "renamed", "to", "show_ip", "as", "it", "now", "includes", "IPv6", "addresses", "for", "IPv6"...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L341-L364
[ "def", "joined", "(", "subset", "=", "None", ",", "show_ip", "=", "False", ",", "show_ipv4", "=", "None", ")", ":", "show_ip", "=", "_show_ip_migration", "(", "show_ip", ",", "show_ipv4", ")", "return", "list_state", "(", "subset", "=", "subset", ",", "s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
not_joined
.. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are NOT up according to Salt's presence detection (no commands will be sent) sub...
salt/runners/manage.py
def not_joined(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are NOT up accord...
def not_joined(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are NOT up accord...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0", "..", "versionchanged", "::", "2019", ".", "2", ".", "0", "The", "show_ipv4", "argument", "has", "been", "renamed", "to", "show_ip", "as", "it", "now", "includes", "IPv6", "addresses", "for", "IPv6"...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L367-L390
[ "def", "not_joined", "(", "subset", "=", "None", ",", "show_ip", "=", "False", ",", "show_ipv4", "=", "None", ")", ":", "show_ip", "=", "_show_ip_migration", "(", "show_ip", ",", "show_ipv4", ")", "return", "list_not_state", "(", "subset", "=", "subset", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
allowed
.. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are up according to Salt's presence detection (no commands will be sent to minions) ...
salt/runners/manage.py
def allowed(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are up according to ...
def allowed(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are up according to ...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0", "..", "versionchanged", "::", "2019", ".", "2", ".", "0", "The", "show_ipv4", "argument", "has", "been", "renamed", "to", "show_ip", "as", "it", "now", "includes", "IPv6", "addresses", "for", "IPv6"...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L393-L416
[ "def", "allowed", "(", "subset", "=", "None", ",", "show_ip", "=", "False", ",", "show_ipv4", "=", "None", ")", ":", "show_ip", "=", "_show_ip_migration", "(", "show_ip", ",", "show_ipv4", ")", "return", "list_state", "(", "subset", "=", "subset", ",", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
not_allowed
.. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are NOT up according to Salt's presence detection (no commands will be sent) sub...
salt/runners/manage.py
def not_allowed(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are NOT up accor...
def not_allowed(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are NOT up accor...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0", "..", "versionchanged", "::", "2019", ".", "2", ".", "0", "The", "show_ipv4", "argument", "has", "been", "renamed", "to", "show_ip", "as", "it", "now", "includes", "IPv6", "addresses", "for", "IPv6"...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L419-L442
[ "def", "not_allowed", "(", "subset", "=", "None", ",", "show_ip", "=", "False", ",", "show_ipv4", "=", "None", ")", ":", "show_ip", "=", "_show_ip_migration", "(", "show_ip", ",", "show_ipv4", ")", "return", "list_not_state", "(", "subset", "=", "subset", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
alived
.. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are up according to Salt's presence detection (no commands will be sent to minions) ...
salt/runners/manage.py
def alived(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are up according to S...
def alived(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are up according to S...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0", "..", "versionchanged", "::", "2019", ".", "2", ".", "0", "The", "show_ipv4", "argument", "has", "been", "renamed", "to", "show_ip", "as", "it", "now", "includes", "IPv6", "addresses", "for", "IPv6"...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L445-L468
[ "def", "alived", "(", "subset", "=", "None", ",", "show_ip", "=", "False", ",", "show_ipv4", "=", "None", ")", ":", "show_ip", "=", "_show_ip_migration", "(", "show_ip", ",", "show_ipv4", ")", "return", "list_state", "(", "subset", "=", "subset", ",", "s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
not_alived
.. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are NOT up according to Salt's presence detection (no commands will be sent) sub...
salt/runners/manage.py
def not_alived(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are NOT up accord...
def not_alived(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are NOT up accord...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0", "..", "versionchanged", "::", "2019", ".", "2", ".", "0", "The", "show_ipv4", "argument", "has", "been", "renamed", "to", "show_ip", "as", "it", "now", "includes", "IPv6", "addresses", "for", "IPv6"...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L471-L494
[ "def", "not_alived", "(", "subset", "=", "None", ",", "show_ip", "=", "False", ",", "show_ipv4", "=", "None", ")", ":", "show_ip", "=", "_show_ip_migration", "(", "show_ip", ",", "show_ipv4", ")", "return", "list_not_state", "(", "subset", "=", "subset", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
reaped
.. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are up according to Salt's presence detection (no commands will be sent to minions) ...
salt/runners/manage.py
def reaped(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are up according to S...
def reaped(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are up according to S...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0", "..", "versionchanged", "::", "2019", ".", "2", ".", "0", "The", "show_ipv4", "argument", "has", "been", "renamed", "to", "show_ip", "as", "it", "now", "includes", "IPv6", "addresses", "for", "IPv6"...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L497-L520
[ "def", "reaped", "(", "subset", "=", "None", ",", "show_ip", "=", "False", ",", "show_ipv4", "=", "None", ")", ":", "show_ip", "=", "_show_ip_migration", "(", "show_ip", ",", "show_ipv4", ")", "return", "list_state", "(", "subset", "=", "subset", ",", "s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
not_reaped
.. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are NOT up according to Salt's presence detection (no commands will be sent) sub...
salt/runners/manage.py
def not_reaped(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are NOT up accord...
def not_reaped(subset=None, show_ip=False, show_ipv4=None): ''' .. versionadded:: 2015.8.0 .. versionchanged:: 2019.2.0 The 'show_ipv4' argument has been renamed to 'show_ip' as it now includes IPv6 addresses for IPv6-connected minions. Print a list of all minions that are NOT up accord...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0", "..", "versionchanged", "::", "2019", ".", "2", ".", "0", "The", "show_ipv4", "argument", "has", "been", "renamed", "to", "show_ip", "as", "it", "now", "includes", "IPv6", "addresses", "for", "IPv6"...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L523-L546
[ "def", "not_reaped", "(", "subset", "=", "None", ",", "show_ip", "=", "False", ",", "show_ipv4", "=", "None", ")", ":", "show_ip", "=", "_show_ip_migration", "(", "show_ip", ",", "show_ipv4", ")", "return", "list_not_state", "(", "subset", "=", "subset", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
safe_accept
.. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Accept a minion's public key after checking the fingerprint over salt-ssh CLI Example: .. code-block:: bash salt-run manage.safe_accept my_minion ...
salt/runners/manage.py
def safe_accept(target, tgt_type='glob'): ''' .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Accept a minion's public key after checking the fingerprint over salt-ssh CLI Example: .. code-block:: b...
def safe_accept(target, tgt_type='glob'): ''' .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Accept a minion's public key after checking the fingerprint over salt-ssh CLI Example: .. code-block:: b...
[ "..", "versionchanged", "::", "2017", ".", "7", ".", "0", "The", "expr_form", "argument", "has", "been", "renamed", "to", "tgt_type", "earlier", "releases", "must", "use", "expr_form", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L549-L602
[ "def", "safe_accept", "(", "target", ",", "tgt_type", "=", "'glob'", ")", ":", "salt_key", "=", "salt", ".", "key", ".", "Key", "(", "__opts__", ")", "ssh_client", "=", "salt", ".", "client", ".", "ssh", ".", "client", ".", "SSHClient", "(", ")", "re...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
versions
Check the version of active minions CLI Example: .. code-block:: bash salt-run manage.versions
salt/runners/manage.py
def versions(): ''' Check the version of active minions CLI Example: .. code-block:: bash salt-run manage.versions ''' ret = {} client = salt.client.get_local_client(__opts__['conf_file']) try: minions = client.cmd('*', 'test.version', timeout=__opts__['timeout']) ...
def versions(): ''' Check the version of active minions CLI Example: .. code-block:: bash salt-run manage.versions ''' ret = {} client = salt.client.get_local_client(__opts__['conf_file']) try: minions = client.cmd('*', 'test.version', timeout=__opts__['timeout']) ...
[ "Check", "the", "version", "of", "active", "minions" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L605-L659
[ "def", "versions", "(", ")", ":", "ret", "=", "{", "}", "client", "=", "salt", ".", "client", ".", "get_local_client", "(", "__opts__", "[", "'conf_file'", "]", ")", "try", ":", "minions", "=", "client", ".", "cmd", "(", "'*'", ",", "'test.version'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
bootstrap
Bootstrap minions with salt-bootstrap version : develop Git tag of version to install script : https://bootstrap.saltstack.com URL containing the script to execute hosts Comma-separated hosts [example: hosts='host1.local,host2.local']. These hosts need to exist in the spec...
salt/runners/manage.py
def bootstrap(version='develop', script=None, hosts='', script_args='', roster='flat', ssh_user=None, ssh_password=None, ssh_priv_key=None, tmp_dir='/tmp/.bootstrap', http_backend='tornado'): ...
def bootstrap(version='develop', script=None, hosts='', script_args='', roster='flat', ssh_user=None, ssh_password=None, ssh_priv_key=None, tmp_dir='/tmp/.bootstrap', http_backend='tornado'): ...
[ "Bootstrap", "minions", "with", "salt", "-", "bootstrap" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L662-L784
[ "def", "bootstrap", "(", "version", "=", "'develop'", ",", "script", "=", "None", ",", "hosts", "=", "''", ",", "script_args", "=", "''", ",", "roster", "=", "'flat'", ",", "ssh_user", "=", "None", ",", "ssh_password", "=", "None", ",", "ssh_priv_key", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
bootstrap_psexec
Bootstrap Windows minions via PsExec. hosts Comma separated list of hosts to deploy the Windows Salt minion. master Address of the Salt master passed as an argument to the installer. version Point release of installer to download. Defaults to the most recent. arch Arc...
salt/runners/manage.py
def bootstrap_psexec(hosts='', master=None, version=None, arch='win32', installer_url=None, username=None, password=None): ''' Bootstrap Windows minions via PsExec. hosts Comma separated list of hosts to deploy the Windows Salt minion. master Address of the Salt ma...
def bootstrap_psexec(hosts='', master=None, version=None, arch='win32', installer_url=None, username=None, password=None): ''' Bootstrap Windows minions via PsExec. hosts Comma separated list of hosts to deploy the Windows Salt minion. master Address of the Salt ma...
[ "Bootstrap", "Windows", "minions", "via", "PsExec", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/manage.py#L787-L922
[ "def", "bootstrap_psexec", "(", "hosts", "=", "''", ",", "master", "=", "None", ",", "version", "=", "None", ",", "arch", "=", "'win32'", ",", "installer_url", "=", "None", ",", "username", "=", "None", ",", "password", "=", "None", ")", ":", "if", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_available_services
Return a dictionary of all available services on the system
salt/modules/launchctl_service.py
def _available_services(): ''' Return a dictionary of all available services on the system ''' available_services = dict() for launch_dir in _launchd_paths(): for root, dirs, files in salt.utils.path.os_walk(launch_dir): for filename in files: file_path = os.path....
def _available_services(): ''' Return a dictionary of all available services on the system ''' available_services = dict() for launch_dir in _launchd_paths(): for root, dirs, files in salt.utils.path.os_walk(launch_dir): for filename in files: file_path = os.path....
[ "Return", "a", "dictionary", "of", "all", "available", "services", "on", "the", "system" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/launchctl_service.py#L77-L125
[ "def", "_available_services", "(", ")", ":", "available_services", "=", "dict", "(", ")", "for", "launch_dir", "in", "_launchd_paths", "(", ")", ":", "for", "root", ",", "dirs", ",", "files", "in", "salt", ".", "utils", ".", "path", ".", "os_walk", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_service_by_name
Return the service info for a service by label, filename or path
salt/modules/launchctl_service.py
def _service_by_name(name): ''' Return the service info for a service by label, filename or path ''' services = _available_services() name = name.lower() if name in services: # Match on label return services[name] for service in six.itervalues(services): if service[...
def _service_by_name(name): ''' Return the service info for a service by label, filename or path ''' services = _available_services() name = name.lower() if name in services: # Match on label return services[name] for service in six.itervalues(services): if service[...
[ "Return", "the", "service", "info", "for", "a", "service", "by", "label", "filename", "or", "path" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/launchctl_service.py#L128-L148
[ "def", "_service_by_name", "(", "name", ")", ":", "services", "=", "_available_services", "(", ")", "name", "=", "name", ".", "lower", "(", ")", "if", "name", "in", "services", ":", "# Match on label", "return", "services", "[", "name", "]", "for", "servic...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_all
Return all installed services CLI Example: .. code-block:: bash salt '*' service.get_all
salt/modules/launchctl_service.py
def get_all(): ''' Return all installed services CLI Example: .. code-block:: bash salt '*' service.get_all ''' cmd = 'launchctl list' service_lines = [ line for line in __salt__['cmd.run'](cmd).splitlines() if not line.startswith('PID') ] service_labels_...
def get_all(): ''' Return all installed services CLI Example: .. code-block:: bash salt '*' service.get_all ''' cmd = 'launchctl list' service_lines = [ line for line in __salt__['cmd.run'](cmd).splitlines() if not line.startswith('PID') ] service_labels_...
[ "Return", "all", "installed", "services" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/launchctl_service.py#L151-L173
[ "def", "get_all", "(", ")", ":", "cmd", "=", "'launchctl list'", "service_lines", "=", "[", "line", "for", "line", "in", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", ".", "splitlines", "(", ")", "if", "not", "line", ".", "startswith", "(", "'PID...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
status
Return the status for a service via systemd. If the name contains globbing, a dict mapping service name to True/False values is returned. .. versionchanged:: 2018.3.0 The service name can now be a glob (e.g. ``salt*``) Args: name (str): The name of the service to check runas (s...
salt/modules/launchctl_service.py
def status(name, runas=None): ''' Return the status for a service via systemd. If the name contains globbing, a dict mapping service name to True/False values is returned. .. versionchanged:: 2018.3.0 The service name can now be a glob (e.g. ``salt*``) Args: name (str): The nam...
def status(name, runas=None): ''' Return the status for a service via systemd. If the name contains globbing, a dict mapping service name to True/False values is returned. .. versionchanged:: 2018.3.0 The service name can now be a glob (e.g. ``salt*``) Args: name (str): The nam...
[ "Return", "the", "status", "for", "a", "service", "via", "systemd", ".", "If", "the", "name", "contains", "globbing", "a", "dict", "mapping", "service", "name", "to", "True", "/", "False", "values", "is", "returned", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/launchctl_service.py#L222-L271
[ "def", "status", "(", "name", ",", "runas", "=", "None", ")", ":", "contains_globbing", "=", "bool", "(", "re", ".", "search", "(", "r'\\*|\\?|\\[.+\\]'", ",", "name", ")", ")", "if", "contains_globbing", ":", "services", "=", "fnmatch", ".", "filter", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
start
Start the specified service CLI Example: .. code-block:: bash salt '*' service.start <service label> salt '*' service.start org.ntp.ntpd salt '*' service.start /System/Library/LaunchDaemons/org.ntp.ntpd.plist
salt/modules/launchctl_service.py
def start(job_label, runas=None): ''' Start the specified service CLI Example: .. code-block:: bash salt '*' service.start <service label> salt '*' service.start org.ntp.ntpd salt '*' service.start /System/Library/LaunchDaemons/org.ntp.ntpd.plist ''' service = _service...
def start(job_label, runas=None): ''' Start the specified service CLI Example: .. code-block:: bash salt '*' service.start <service label> salt '*' service.start org.ntp.ntpd salt '*' service.start /System/Library/LaunchDaemons/org.ntp.ntpd.plist ''' service = _service...
[ "Start", "the", "specified", "service" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/launchctl_service.py#L295-L312
[ "def", "start", "(", "job_label", ",", "runas", "=", "None", ")", ":", "service", "=", "_service_by_name", "(", "job_label", ")", "if", "service", ":", "cmd", "=", "'launchctl load -w {0}'", ".", "format", "(", "service", "[", "'file_path'", "]", ",", "run...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
restart
Restart the named service CLI Example: .. code-block:: bash salt '*' service.restart <service label>
salt/modules/launchctl_service.py
def restart(job_label, runas=None): ''' Restart the named service CLI Example: .. code-block:: bash salt '*' service.restart <service label> ''' stop(job_label, runas=runas) return start(job_label, runas=runas)
def restart(job_label, runas=None): ''' Restart the named service CLI Example: .. code-block:: bash salt '*' service.restart <service label> ''' stop(job_label, runas=runas) return start(job_label, runas=runas)
[ "Restart", "the", "named", "service" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/launchctl_service.py#L315-L326
[ "def", "restart", "(", "job_label", ",", "runas", "=", "None", ")", ":", "stop", "(", "job_label", ",", "runas", "=", "runas", ")", "return", "start", "(", "job_label", ",", "runas", "=", "runas", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
enabled
Return True if the named service is enabled, false otherwise CLI Example: .. code-block:: bash salt '*' service.enabled <service label>
salt/modules/launchctl_service.py
def enabled(job_label, runas=None): ''' Return True if the named service is enabled, false otherwise CLI Example: .. code-block:: bash salt '*' service.enabled <service label> ''' overrides_data = dict(plistlib.readPlist( '/var/db/launchd.db/com.apple.launchd/overrides.plist' ...
def enabled(job_label, runas=None): ''' Return True if the named service is enabled, false otherwise CLI Example: .. code-block:: bash salt '*' service.enabled <service label> ''' overrides_data = dict(plistlib.readPlist( '/var/db/launchd.db/com.apple.launchd/overrides.plist' ...
[ "Return", "True", "if", "the", "named", "service", "is", "enabled", "false", "otherwise" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/launchctl_service.py#L329-L348
[ "def", "enabled", "(", "job_label", ",", "runas", "=", "None", ")", ":", "overrides_data", "=", "dict", "(", "plistlib", ".", "readPlist", "(", "'/var/db/launchd.db/com.apple.launchd/overrides.plist'", ")", ")", "if", "overrides_data", ".", "get", "(", "job_label"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_api_params
Retrieve the API params from the config file.
salt/modules/mandrill.py
def _get_api_params(api_url=None, api_version=None, api_key=None): ''' Retrieve the API params from the config file. ''' mandrill_cfg = __salt__['config.merge']('mandrill') if not mandrill_cfg: mandrill_cfg = {} return { 'api_url': api_url ...
def _get_api_params(api_url=None, api_version=None, api_key=None): ''' Retrieve the API params from the config file. ''' mandrill_cfg = __salt__['config.merge']('mandrill') if not mandrill_cfg: mandrill_cfg = {} return { 'api_url': api_url ...
[ "Retrieve", "the", "API", "params", "from", "the", "config", "file", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mandrill.py#L64-L77
[ "def", "_get_api_params", "(", "api_url", "=", "None", ",", "api_version", "=", "None", ",", "api_key", "=", "None", ")", ":", "mandrill_cfg", "=", "__salt__", "[", "'config.merge'", "]", "(", "'mandrill'", ")", "if", "not", "mandrill_cfg", ":", "mandrill_cf...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_url
Build the API URL.
salt/modules/mandrill.py
def _get_url(method, api_url, api_version): ''' Build the API URL. ''' return '{url}/{version}/{method}.json'.format(url=api_url, version=float(api_version), method=method)
def _get_url(method, api_url, api_version): ''' Build the API URL. ''' return '{url}/{version}/{method}.json'.format(url=api_url, version=float(api_version), method=method)
[ "Build", "the", "API", "URL", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mandrill.py#L80-L88
[ "def", "_get_url", "(", "method", ",", "api_url", ",", "api_version", ")", ":", "return", "'{url}/{version}/{method}.json'", ".", "format", "(", "url", "=", "api_url", ",", "version", "=", "float", "(", "api_version", ")", ",", "method", "=", "method", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_http_request
Make the HTTP request and return the body as python object.
salt/modules/mandrill.py
def _http_request(url, headers=None, data=None): ''' Make the HTTP request and return the body as python object. ''' if not headers: headers = _get_headers() session = requests.session() log.debug('Querying %s', url) req = session.post(url, ...
def _http_request(url, headers=None, data=None): ''' Make the HTTP request and return the body as python object. ''' if not headers: headers = _get_headers() session = requests.session() log.debug('Querying %s', url) req = session.post(url, ...
[ "Make", "the", "HTTP", "request", "and", "return", "the", "body", "as", "python", "object", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mandrill.py#L101-L132
[ "def", "_http_request", "(", "url", ",", "headers", "=", "None", ",", "data", "=", "None", ")", ":", "if", "not", "headers", ":", "headers", "=", "_get_headers", "(", ")", "session", "=", "requests", ".", "session", "(", ")", "log", ".", "debug", "("...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
send
Send out the email using the details from the ``message`` argument. message The information on the message to send. This argument must be sent as dictionary with at fields as specified in the Mandrill API documentation. asynchronous: ``False`` Enable a background sending mode t...
salt/modules/mandrill.py
def send(message, asynchronous=False, ip_pool=None, send_at=None, api_url=None, api_version=None, api_key=None, **kwargs): ''' Send out the email using the details from the ``message`` argument. message The information on the message to...
def send(message, asynchronous=False, ip_pool=None, send_at=None, api_url=None, api_version=None, api_key=None, **kwargs): ''' Send out the email using the details from the ``message`` argument. message The information on the message to...
[ "Send", "out", "the", "email", "using", "the", "details", "from", "the", "message", "argument", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mandrill.py#L140-L252
[ "def", "send", "(", "message", ",", "asynchronous", "=", "False", ",", "ip_pool", "=", "None", ",", "send_at", "=", "None", ",", "api_url", "=", "None", ",", "api_version", "=", "None", ",", "api_key", "=", "None", ",", "*", "*", "kwargs", ")", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_send_command
Send a command to the modjk loadbalancer The minion need to be able to publish the commands to the load balancer cmd: worker_stop - won't get any traffic from the lbn worker_activate - activate the worker worker_disable - will get traffic only for current sessions
salt/states/modjk_worker.py
def _send_command(cmd, worker, lbn, target, profile='default', tgt_type='glob'): ''' Send a command to the modjk loadbalancer The minion need to be able to publish the commands to the load balancer cmd: wo...
def _send_command(cmd, worker, lbn, target, profile='default', tgt_type='glob'): ''' Send a command to the modjk loadbalancer The minion need to be able to publish the commands to the load balancer cmd: wo...
[ "Send", "a", "command", "to", "the", "modjk", "loadbalancer", "The", "minion", "need", "to", "be", "able", "to", "publish", "the", "commands", "to", "the", "load", "balancer" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/modjk_worker.py#L31-L80
[ "def", "_send_command", "(", "cmd", ",", "worker", ",", "lbn", ",", "target", ",", "profile", "=", "'default'", ",", "tgt_type", "=", "'glob'", ")", ":", "ret", "=", "{", "'code'", ":", "False", ",", "'msg'", ":", "'OK'", ",", "'minions'", ":", "[", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_worker_status
Check if the worker is in `activation` state in the targeted load balancers The function will return the following dictionary: result - False if no server returned from the published command errors - list of servers that couldn't find the worker wrong_state - list of servers that the worker...
salt/states/modjk_worker.py
def _worker_status(target, worker, activation, profile='default', tgt_type='glob'): ''' Check if the worker is in `activation` state in the targeted load balancers The function will return the following dictionary: result -...
def _worker_status(target, worker, activation, profile='default', tgt_type='glob'): ''' Check if the worker is in `activation` state in the targeted load balancers The function will return the following dictionary: result -...
[ "Check", "if", "the", "worker", "is", "in", "activation", "state", "in", "the", "targeted", "load", "balancers" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/modjk_worker.py#L83-L121
[ "def", "_worker_status", "(", "target", ",", "worker", ",", "activation", ",", "profile", "=", "'default'", ",", "tgt_type", "=", "'glob'", ")", ":", "ret", "=", "{", "'result'", ":", "True", ",", "'errors'", ":", "[", "]", ",", "'wrong_state'", ":", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_talk2modjk
Wrapper function for the stop/disable/activate functions
salt/states/modjk_worker.py
def _talk2modjk(name, lbn, target, action, profile='default', tgt_type='glob'): ''' Wrapper function for the stop/disable/activate functions ''' ret = {'name': name, 'result': True, 'changes': {}, 'comment': ''} action_map = { 'worker_stop': 'STP', ...
def _talk2modjk(name, lbn, target, action, profile='default', tgt_type='glob'): ''' Wrapper function for the stop/disable/activate functions ''' ret = {'name': name, 'result': True, 'changes': {}, 'comment': ''} action_map = { 'worker_stop': 'STP', ...
[ "Wrapper", "function", "for", "the", "stop", "/", "disable", "/", "activate", "functions" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/modjk_worker.py#L124-L171
[ "def", "_talk2modjk", "(", "name", ",", "lbn", ",", "target", ",", "action", ",", "profile", "=", "'default'", ",", "tgt_type", "=", "'glob'", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'changes'", ":", "{",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
stop
.. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Stop the named worker from the lbn load balancers at the targeted minions The worker won't get any traffic from the lbn Example: .. code-block:: yaml ...
salt/states/modjk_worker.py
def stop(name, lbn, target, profile='default', tgt_type='glob'): ''' .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Stop the named worker from the lbn load balancers at the targeted minions The worker wo...
def stop(name, lbn, target, profile='default', tgt_type='glob'): ''' .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Stop the named worker from the lbn load balancers at the targeted minions The worker wo...
[ "..", "versionchanged", "::", "2017", ".", "7", ".", "0", "The", "expr_form", "argument", "has", "been", "renamed", "to", "tgt_type", "earlier", "releases", "must", "use", "expr_form", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/modjk_worker.py#L174-L194
[ "def", "stop", "(", "name", ",", "lbn", ",", "target", ",", "profile", "=", "'default'", ",", "tgt_type", "=", "'glob'", ")", ":", "return", "_talk2modjk", "(", "name", ",", "lbn", ",", "target", ",", "'worker_stop'", ",", "profile", ",", "tgt_type", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
activate
.. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Activate the named worker from the lbn load balancers at the targeted minions Example: .. code-block:: yaml disable-before-deploy: modj...
salt/states/modjk_worker.py
def activate(name, lbn, target, profile='default', tgt_type='glob'): ''' .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Activate the named worker from the lbn load balancers at the targeted minions ...
def activate(name, lbn, target, profile='default', tgt_type='glob'): ''' .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Activate the named worker from the lbn load balancers at the targeted minions ...
[ "..", "versionchanged", "::", "2017", ".", "7", ".", "0", "The", "expr_form", "argument", "has", "been", "renamed", "to", "tgt_type", "earlier", "releases", "must", "use", "expr_form", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/modjk_worker.py#L197-L217
[ "def", "activate", "(", "name", ",", "lbn", ",", "target", ",", "profile", "=", "'default'", ",", "tgt_type", "=", "'glob'", ")", ":", "return", "_talk2modjk", "(", "name", ",", "lbn", ",", "target", ",", "'worker_activate'", ",", "profile", ",", "tgt_ty...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
disable
.. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Disable the named worker from the lbn load balancers at the targeted minions. The worker will get traffic only for current sessions and won't get new ones. ...
salt/states/modjk_worker.py
def disable(name, lbn, target, profile='default', tgt_type='glob'): ''' .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Disable the named worker from the lbn load balancers at the targeted minions. The wo...
def disable(name, lbn, target, profile='default', tgt_type='glob'): ''' .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Disable the named worker from the lbn load balancers at the targeted minions. The wo...
[ "..", "versionchanged", "::", "2017", ".", "7", ".", "0", "The", "expr_form", "argument", "has", "been", "renamed", "to", "tgt_type", "earlier", "releases", "must", "use", "expr_form", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/modjk_worker.py#L220-L241
[ "def", "disable", "(", "name", ",", "lbn", ",", "target", ",", "profile", "=", "'default'", ",", "tgt_type", "=", "'glob'", ")", ":", "return", "_talk2modjk", "(", "name", ",", "lbn", ",", "target", ",", "'worker_disable'", ",", "profile", ",", "tgt_type...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_search
Recursively look up all grains in the metadata server
salt/grains/metadata.py
def _search(prefix="latest/"): ''' Recursively look up all grains in the metadata server ''' ret = {} linedata = http.query(os.path.join(HOST, prefix), headers=True) if 'body' not in linedata: return ret body = salt.utils.stringutils.to_unicode(linedata['body']) if linedata['head...
def _search(prefix="latest/"): ''' Recursively look up all grains in the metadata server ''' ret = {} linedata = http.query(os.path.join(HOST, prefix), headers=True) if 'body' not in linedata: return ret body = salt.utils.stringutils.to_unicode(linedata['body']) if linedata['head...
[ "Recursively", "look", "up", "all", "grains", "in", "the", "metadata", "server" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/metadata.py#L49-L84
[ "def", "_search", "(", "prefix", "=", "\"latest/\"", ")", ":", "ret", "=", "{", "}", "linedata", "=", "http", ".", "query", "(", "os", ".", "path", ".", "join", "(", "HOST", ",", "prefix", ")", ",", "headers", "=", "True", ")", "if", "'body'", "n...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
has_value
Determine whether a named value exists in the grains dictionary. Given a grains dictionary that contains the following structure:: {'pkg': {'apache': 'httpd'}} One would determine if the apache key in the pkg dict exists by:: pkg:apache CLI Example: .. code-block:: bash sa...
salt/client/ssh/wrapper/grains.py
def has_value(key): ''' Determine whether a named value exists in the grains dictionary. Given a grains dictionary that contains the following structure:: {'pkg': {'apache': 'httpd'}} One would determine if the apache key in the pkg dict exists by:: pkg:apache CLI Example: ...
def has_value(key): ''' Determine whether a named value exists in the grains dictionary. Given a grains dictionary that contains the following structure:: {'pkg': {'apache': 'httpd'}} One would determine if the apache key in the pkg dict exists by:: pkg:apache CLI Example: ...
[ "Determine", "whether", "a", "named", "value", "exists", "in", "the", "grains", "dictionary", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/grains.py#L85-L105
[ "def", "has_value", "(", "key", ")", ":", "return", "True", "if", "salt", ".", "utils", ".", "data", ".", "traverse_dict_and_list", "(", "__grains__", ",", "key", ",", "False", ")", "else", "False" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
item
Return one or more grains CLI Example: .. code-block:: bash salt '*' grains.item os salt '*' grains.item os osrelease oscodename Sanitized CLI Example: .. code-block:: bash salt '*' grains.item host sanitize=True
salt/client/ssh/wrapper/grains.py
def item(*args, **kwargs): ''' Return one or more grains CLI Example: .. code-block:: bash salt '*' grains.item os salt '*' grains.item os osrelease oscodename Sanitized CLI Example: .. code-block:: bash salt '*' grains.item host sanitize=True ''' ret = {} ...
def item(*args, **kwargs): ''' Return one or more grains CLI Example: .. code-block:: bash salt '*' grains.item os salt '*' grains.item os osrelease oscodename Sanitized CLI Example: .. code-block:: bash salt '*' grains.item host sanitize=True ''' ret = {} ...
[ "Return", "one", "or", "more", "grains" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/grains.py#L134-L161
[ "def", "item", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "}", "for", "arg", "in", "args", ":", "try", ":", "ret", "[", "arg", "]", "=", "__grains__", "[", "arg", "]", "except", "KeyError", ":", "pass", "if", "salt", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
filter_by
.. versionadded:: 0.17.0 Look up the given grain in a given dictionary for the current OS and return the result Although this may occasionally be useful at the CLI, the primary intent of this function is for use in Jinja to make short work of creating lookup tables for OS-specific data. For exampl...
salt/client/ssh/wrapper/grains.py
def filter_by(lookup_dict, grain='os_family', merge=None, default='default', base=None): ''' .. versionadded:: 0.17.0 Look up the given grain in a given dictionary for the current OS and return the result Although this may occasionally be use...
def filter_by(lookup_dict, grain='os_family', merge=None, default='default', base=None): ''' .. versionadded:: 0.17.0 Look up the given grain in a given dictionary for the current OS and return the result Although this may occasionally be use...
[ "..", "versionadded", "::", "0", ".", "17", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/grains.py#L177-L286
[ "def", "filter_by", "(", "lookup_dict", ",", "grain", "=", "'os_family'", ",", "merge", "=", "None", ",", "default", "=", "'default'", ",", "base", "=", "None", ")", ":", "ret", "=", "lookup_dict", ".", "get", "(", "__grains__", ".", "get", "(", "grain...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure VPC exists. name Name of the VPC. cidr_block The range of IPs in CIDR format, for example: 10.0.0.0/24. Block size must be between /16 and /28 netmask. instance_tenancy Instances launched in this VPC will be ingle-tenant or dedicated hardware. dns_suppo...
salt/states/boto_vpc.py
def present(name, cidr_block, instance_tenancy=None, dns_support=None, dns_hostnames=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Ensure VPC exists. name Name of the VPC. cidr_block The range of IPs in CIDR format, for example: 10.0.0.0...
def present(name, cidr_block, instance_tenancy=None, dns_support=None, dns_hostnames=None, tags=None, region=None, key=None, keyid=None, profile=None): ''' Ensure VPC exists. name Name of the VPC. cidr_block The range of IPs in CIDR format, for example: 10.0.0.0...
[ "Ensure", "VPC", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L172-L245
[ "def", "present", "(", "name", ",", "cidr_block", ",", "instance_tenancy", "=", "None", ",", "dns_support", "=", "None", ",", "dns_hostnames", "=", "None", ",", "tags", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
Ensure VPC with passed properties is absent. name Name of the VPC. tags A list of tags. All tags must match. region Region to connect to. key Secret key to be used. keyid Access key to be used. profile A dict with region, key and keyid, or a ...
salt/states/boto_vpc.py
def absent(name, tags=None, region=None, key=None, keyid=None, profile=None): ''' Ensure VPC with passed properties is absent. name Name of the VPC. tags A list of tags. All tags must match. region Region to connect to. key Secret key to be used. keyid ...
def absent(name, tags=None, region=None, key=None, keyid=None, profile=None): ''' Ensure VPC with passed properties is absent. name Name of the VPC. tags A list of tags. All tags must match. region Region to connect to. key Secret key to be used. keyid ...
[ "Ensure", "VPC", "with", "passed", "properties", "is", "absent", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L248-L304
[ "def", "absent", "(", "name", ",", "tags", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
dhcp_options_present
Ensure a set of DHCP options with the given settings exist. Note that the current implementation only SETS values during option set creation. It is unable to update option sets in place, and thus merely verifies the set exists via the given name and/or dhcp_options_id param. name (string) ...
salt/states/boto_vpc.py
def dhcp_options_present(name, dhcp_options_id=None, vpc_name=None, vpc_id=None, domain_name=None, domain_name_servers=None, ntp_servers=None, netbios_name_servers=None, netbios_node_type=None, tags=None, region=None, key=None, keyid=None, profi...
def dhcp_options_present(name, dhcp_options_id=None, vpc_name=None, vpc_id=None, domain_name=None, domain_name_servers=None, ntp_servers=None, netbios_name_servers=None, netbios_node_type=None, tags=None, region=None, key=None, keyid=None, profi...
[ "Ensure", "a", "set", "of", "DHCP", "options", "with", "the", "given", "settings", "exist", ".", "Note", "that", "the", "current", "implementation", "only", "SETS", "values", "during", "option", "set", "creation", ".", "It", "is", "unable", "to", "update", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L307-L428
[ "def", "dhcp_options_present", "(", "name", ",", "dhcp_options_id", "=", "None", ",", "vpc_name", "=", "None", ",", "vpc_id", "=", "None", ",", "domain_name", "=", "None", ",", "domain_name_servers", "=", "None", ",", "ntp_servers", "=", "None", ",", "netbio...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
dhcp_options_absent
Ensure a set of DHCP options with the given settings exist. name (string) Name of the DHCP options set. dhcp_options_id (string) Id of the DHCP options set. region (string) Region to connect to. key (string) Secret key to be used. ...
salt/states/boto_vpc.py
def dhcp_options_absent(name=None, dhcp_options_id=None, region=None, key=None, keyid=None, profile=None): ''' Ensure a set of DHCP options with the given settings exist. name (string) Name of the DHCP options set. dhcp_options_id (string) Id of the DHCP options set. ...
def dhcp_options_absent(name=None, dhcp_options_id=None, region=None, key=None, keyid=None, profile=None): ''' Ensure a set of DHCP options with the given settings exist. name (string) Name of the DHCP options set. dhcp_options_id (string) Id of the DHCP options set. ...
[ "Ensure", "a", "set", "of", "DHCP", "options", "with", "the", "given", "settings", "exist", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L431-L497
[ "def", "dhcp_options_absent", "(", "name", "=", "None", ",", "dhcp_options_id", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
subnet_present
Ensure a subnet exists. name Name of the subnet. cidr_block The range if IPs for the subnet, in CIDR format. For example: 10.0.0.0/24. Block size must be between /16 and /28 netmask. vpc_name Name of the VPC in which the subnet should be placed. Either vpc_name or ...
salt/states/boto_vpc.py
def subnet_present(name, cidr_block, vpc_name=None, vpc_id=None, availability_zone=None, tags=None, region=None, key=None, keyid=None, profile=None, route_table_id=None, route_table_name=None, auto_assign_public_ipv4=False): ''' Ensure...
def subnet_present(name, cidr_block, vpc_name=None, vpc_id=None, availability_zone=None, tags=None, region=None, key=None, keyid=None, profile=None, route_table_id=None, route_table_name=None, auto_assign_public_ipv4=False): ''' Ensure...
[ "Ensure", "a", "subnet", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/boto_vpc.py#L500-L671
[ "def", "subnet_present", "(", "name", ",", "cidr_block", ",", "vpc_name", "=", "None", ",", "vpc_id", "=", "None", ",", "availability_zone", "=", "None", ",", "tags", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46