partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
get_load
Return the load data that marks a specified jid
salt/returners/mysql.py
def get_load(jid): ''' Return the load data that marks a specified jid ''' with _get_serv(ret=None, commit=True) as cur: sql = '''SELECT `load` FROM `jids` WHERE `jid` = %s;''' cur.execute(sql, (jid,)) data = cur.fetchone() if data: return salt.utils.json.loa...
def get_load(jid): ''' Return the load data that marks a specified jid ''' with _get_serv(ret=None, commit=True) as cur: sql = '''SELECT `load` FROM `jids` WHERE `jid` = %s;''' cur.execute(sql, (jid,)) data = cur.fetchone() if data: return salt.utils.json.loa...
[ "Return", "the", "load", "data", "that", "marks", "a", "specified", "jid" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/mysql.py#L354-L365
[ "def", "get_load", "(", "jid", ")", ":", "with", "_get_serv", "(", "ret", "=", "None", ",", "commit", "=", "True", ")", "as", "cur", ":", "sql", "=", "'''SELECT `load` FROM `jids` WHERE `jid` = %s;'''", "cur", ".", "execute", "(", "sql", ",", "(", "jid", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_jid
Return the information returned when the specified job id was executed
salt/returners/mysql.py
def get_jid(jid): ''' Return the information returned when the specified job id was executed ''' with _get_serv(ret=None, commit=True) as cur: sql = '''SELECT id, full_ret FROM `salt_returns` WHERE `jid` = %s''' cur.execute(sql, (jid,)) data = cur.fetchall() ...
def get_jid(jid): ''' Return the information returned when the specified job id was executed ''' with _get_serv(ret=None, commit=True) as cur: sql = '''SELECT id, full_ret FROM `salt_returns` WHERE `jid` = %s''' cur.execute(sql, (jid,)) data = cur.fetchall() ...
[ "Return", "the", "information", "returned", "when", "the", "specified", "job", "id", "was", "executed" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/mysql.py#L368-L383
[ "def", "get_jid", "(", "jid", ")", ":", "with", "_get_serv", "(", "ret", "=", "None", ",", "commit", "=", "True", ")", "as", "cur", ":", "sql", "=", "'''SELECT id, full_ret FROM `salt_returns`\n WHERE `jid` = %s'''", "cur", ".", "execute", "(", "s...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_fun
Return a dict of the last function called for all minions
salt/returners/mysql.py
def get_fun(fun): ''' Return a dict of the last function called for all minions ''' with _get_serv(ret=None, commit=True) as cur: sql = '''SELECT s.id,s.jid, s.full_ret FROM `salt_returns` s JOIN ( SELECT MAX(`jid`) as jid from `salt_returns` ...
def get_fun(fun): ''' Return a dict of the last function called for all minions ''' with _get_serv(ret=None, commit=True) as cur: sql = '''SELECT s.id,s.jid, s.full_ret FROM `salt_returns` s JOIN ( SELECT MAX(`jid`) as jid from `salt_returns` ...
[ "Return", "a", "dict", "of", "the", "last", "function", "called", "for", "all", "minions" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/mysql.py#L386-L407
[ "def", "get_fun", "(", "fun", ")", ":", "with", "_get_serv", "(", "ret", "=", "None", ",", "commit", "=", "True", ")", "as", "cur", ":", "sql", "=", "'''SELECT s.id,s.jid, s.full_ret\n FROM `salt_returns` s\n JOIN ( SELECT MAX(`jid`) as jid\n...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_jids_filter
Return a list of all job ids :param int count: show not more than the count of most recent jobs :param bool filter_find_jobs: filter out 'saltutil.find_job' jobs
salt/returners/mysql.py
def get_jids_filter(count, filter_find_job=True): ''' Return a list of all job ids :param int count: show not more than the count of most recent jobs :param bool filter_find_jobs: filter out 'saltutil.find_job' jobs ''' with _get_serv(ret=None, commit=True) as cur: sql = '''SELECT * FRO...
def get_jids_filter(count, filter_find_job=True): ''' Return a list of all job ids :param int count: show not more than the count of most recent jobs :param bool filter_find_jobs: filter out 'saltutil.find_job' jobs ''' with _get_serv(ret=None, commit=True) as cur: sql = '''SELECT * FRO...
[ "Return", "a", "list", "of", "all", "job", "ids", ":", "param", "int", "count", ":", "show", "not", "more", "than", "the", "count", "of", "most", "recent", "jobs", ":", "param", "bool", "filter_find_jobs", ":", "filter", "out", "saltutil", ".", "find_job...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/mysql.py#L429-L452
[ "def", "get_jids_filter", "(", "count", ",", "filter_find_job", "=", "True", ")", ":", "with", "_get_serv", "(", "ret", "=", "None", ",", "commit", "=", "True", ")", "as", "cur", ":", "sql", "=", "'''SELECT * FROM (\n SELECT DISTINCT `jid` ,`lo...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_minions
Return a list of minions
salt/returners/mysql.py
def get_minions(): ''' Return a list of minions ''' with _get_serv(ret=None, commit=True) as cur: sql = '''SELECT DISTINCT id FROM `salt_returns`''' cur.execute(sql) data = cur.fetchall() ret = [] for minion in data: ret.append(minion...
def get_minions(): ''' Return a list of minions ''' with _get_serv(ret=None, commit=True) as cur: sql = '''SELECT DISTINCT id FROM `salt_returns`''' cur.execute(sql) data = cur.fetchall() ret = [] for minion in data: ret.append(minion...
[ "Return", "a", "list", "of", "minions" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/mysql.py#L455-L469
[ "def", "get_minions", "(", ")", ":", "with", "_get_serv", "(", "ret", "=", "None", ",", "commit", "=", "True", ")", "as", "cur", ":", "sql", "=", "'''SELECT DISTINCT id\n FROM `salt_returns`'''", "cur", ".", "execute", "(", "sql", ")", "data", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_purge_jobs
Purge records from the returner tables. :param job_age_in_seconds: Purge jobs older than this :return:
salt/returners/mysql.py
def _purge_jobs(timestamp): ''' Purge records from the returner tables. :param job_age_in_seconds: Purge jobs older than this :return: ''' with _get_serv() as cur: try: sql = 'delete from `jids` where jid in (select distinct jid from salt_returns where alter_time < %s)' ...
def _purge_jobs(timestamp): ''' Purge records from the returner tables. :param job_age_in_seconds: Purge jobs older than this :return: ''' with _get_serv() as cur: try: sql = 'delete from `jids` where jid in (select distinct jid from salt_returns where alter_time < %s)' ...
[ "Purge", "records", "from", "the", "returner", "tables", ".", ":", "param", "job_age_in_seconds", ":", "Purge", "jobs", "older", "than", "this", ":", "return", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/mysql.py#L479-L513
[ "def", "_purge_jobs", "(", "timestamp", ")", ":", "with", "_get_serv", "(", ")", "as", "cur", ":", "try", ":", "sql", "=", "'delete from `jids` where jid in (select distinct jid from salt_returns where alter_time < %s)'", "cur", ".", "execute", "(", "sql", ",", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_archive_jobs
Copy rows to a set of backup tables, then purge rows. :param timestamp: Archive rows older than this timestamp :return:
salt/returners/mysql.py
def _archive_jobs(timestamp): ''' Copy rows to a set of backup tables, then purge rows. :param timestamp: Archive rows older than this timestamp :return: ''' source_tables = ['jids', 'salt_returns', 'salt_events'] with _get_serv() as cur: ta...
def _archive_jobs(timestamp): ''' Copy rows to a set of backup tables, then purge rows. :param timestamp: Archive rows older than this timestamp :return: ''' source_tables = ['jids', 'salt_returns', 'salt_events'] with _get_serv() as cur: ta...
[ "Copy", "rows", "to", "a", "set", "of", "backup", "tables", "then", "purge", "rows", ".", ":", "param", "timestamp", ":", "Archive", "rows", "older", "than", "this", "timestamp", ":", "return", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/mysql.py#L516-L570
[ "def", "_archive_jobs", "(", "timestamp", ")", ":", "source_tables", "=", "[", "'jids'", ",", "'salt_returns'", ",", "'salt_events'", "]", "with", "_get_serv", "(", ")", "as", "cur", ":", "target_tables", "=", "{", "}", "for", "table_name", "in", "source_tab...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
clean_old_jobs
Called in the master's event loop every loop_interval. Archives and/or deletes the events and job details from the database. :return:
salt/returners/mysql.py
def clean_old_jobs(): ''' Called in the master's event loop every loop_interval. Archives and/or deletes the events and job details from the database. :return: ''' if __opts__.get('keep_jobs', False) and int(__opts__.get('keep_jobs', 0)) > 0: try: with _get_serv() as cur: ...
def clean_old_jobs(): ''' Called in the master's event loop every loop_interval. Archives and/or deletes the events and job details from the database. :return: ''' if __opts__.get('keep_jobs', False) and int(__opts__.get('keep_jobs', 0)) > 0: try: with _get_serv() as cur: ...
[ "Called", "in", "the", "master", "s", "event", "loop", "every", "loop_interval", ".", "Archives", "and", "/", "or", "deletes", "the", "events", "and", "job", "details", "from", "the", "database", ".", ":", "return", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/mysql.py#L573-L594
[ "def", "clean_old_jobs", "(", ")", ":", "if", "__opts__", ".", "get", "(", "'keep_jobs'", ",", "False", ")", "and", "int", "(", "__opts__", ".", "get", "(", "'keep_jobs'", ",", "0", ")", ")", ">", "0", ":", "try", ":", "with", "_get_serv", "(", ")"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_verify_options
Verify options and log warnings Returns True if all options can be verified, otherwise False
salt/returners/syslog_return.py
def _verify_options(options): ''' Verify options and log warnings Returns True if all options can be verified, otherwise False ''' # sanity check all vals used for bitwise operations later bitwise_args = [('level', options['level']), ('facility', options['facility']) ...
def _verify_options(options): ''' Verify options and log warnings Returns True if all options can be verified, otherwise False ''' # sanity check all vals used for bitwise operations later bitwise_args = [('level', options['level']), ('facility', options['facility']) ...
[ "Verify", "options", "and", "log", "warnings" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/syslog_return.py#L135-L166
[ "def", "_verify_options", "(", "options", ")", ":", "# sanity check all vals used for bitwise operations later", "bitwise_args", "=", "[", "(", "'level'", ",", "options", "[", "'level'", "]", ")", ",", "(", "'facility'", ",", "options", "[", "'facility'", "]", ")"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
returner
Return data to the local syslog
salt/returners/syslog_return.py
def returner(ret): ''' Return data to the local syslog ''' _options = _get_options(ret) if not _verify_options(_options): return # Get values from syslog module level = getattr(syslog, _options['level']) facility = getattr(syslog, _options['facility']) # parse for syslog ...
def returner(ret): ''' Return data to the local syslog ''' _options = _get_options(ret) if not _verify_options(_options): return # Get values from syslog module level = getattr(syslog, _options['level']) facility = getattr(syslog, _options['facility']) # parse for syslog ...
[ "Return", "data", "to", "the", "local", "syslog" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/syslog_return.py#L175-L204
[ "def", "returner", "(", "ret", ")", ":", "_options", "=", "_get_options", "(", "ret", ")", "if", "not", "_verify_options", "(", "_options", ")", ":", "return", "# Get values from syslog module", "level", "=", "getattr", "(", "syslog", ",", "_options", "[", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
OptionParser.error
error(msg : string) Print a usage message incorporating 'msg' to stderr and exit. This keeps option parsing exit status uniform for all parsing errors.
salt/utils/parsers.py
def error(self, msg): ''' error(msg : string) Print a usage message incorporating 'msg' to stderr and exit. This keeps option parsing exit status uniform for all parsing errors. ''' self.print_usage(sys.stderr) self.exit(salt.defaults.exitcodes.EX_USAGE, '{0}: er...
def error(self, msg): ''' error(msg : string) Print a usage message incorporating 'msg' to stderr and exit. This keeps option parsing exit status uniform for all parsing errors. ''' self.print_usage(sys.stderr) self.exit(salt.defaults.exitcodes.EX_USAGE, '{0}: er...
[ "error", "(", "msg", ":", "string", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/parsers.py#L279-L287
[ "def", "error", "(", "self", ",", "msg", ")", ":", "self", ".", "print_usage", "(", "sys", ".", "stderr", ")", "self", ".", "exit", "(", "salt", ".", "defaults", ".", "exitcodes", ".", "EX_USAGE", ",", "'{0}: error: {1}\\n'", ".", "format", "(", "self"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
DaemonMixIn.check_running
Check if a pid file exists and if it is associated with a running process.
salt/utils/parsers.py
def check_running(self): ''' Check if a pid file exists and if it is associated with a running process. ''' if self.check_pidfile(): pid = self.get_pidfile() if not salt.utils.platform.is_windows(): if self.check_pidfile() and self.is_daem...
def check_running(self): ''' Check if a pid file exists and if it is associated with a running process. ''' if self.check_pidfile(): pid = self.get_pidfile() if not salt.utils.platform.is_windows(): if self.check_pidfile() and self.is_daem...
[ "Check", "if", "a", "pid", "file", "exists", "and", "if", "it", "is", "associated", "with", "a", "running", "process", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/parsers.py#L1045-L1060
[ "def", "check_running", "(", "self", ")", ":", "if", "self", ".", "check_pidfile", "(", ")", ":", "pid", "=", "self", ".", "get_pidfile", "(", ")", "if", "not", "salt", ".", "utils", ".", "platform", ".", "is_windows", "(", ")", ":", "if", "self", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltSupportOptionParser.find_existing_configs
Find configuration files on the system. :return:
salt/utils/parsers.py
def find_existing_configs(self, default): ''' Find configuration files on the system. :return: ''' configs = [] for cfg in [default, self._config_filename_, 'minion', 'proxy', 'cloud', 'spm']: if not cfg: continue config_path = self...
def find_existing_configs(self, default): ''' Find configuration files on the system. :return: ''' configs = [] for cfg in [default, self._config_filename_, 'minion', 'proxy', 'cloud', 'spm']: if not cfg: continue config_path = self...
[ "Find", "configuration", "files", "on", "the", "system", ".", ":", "return", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/parsers.py#L1950-L1966
[ "def", "find_existing_configs", "(", "self", ",", "default", ")", ":", "configs", "=", "[", "]", "for", "cfg", "in", "[", "default", ",", "self", ".", "_config_filename_", ",", "'minion'", ",", "'proxy'", ",", "'cloud'", ",", "'spm'", "]", ":", "if", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltSupportOptionParser.setup_config
Open suitable config file. :return:
salt/utils/parsers.py
def setup_config(self, cfg=None): ''' Open suitable config file. :return: ''' _opts, _args = optparse.OptionParser.parse_args(self) configs = self.find_existing_configs(_opts.support_unit) if configs and cfg not in configs: cfg = configs[0] re...
def setup_config(self, cfg=None): ''' Open suitable config file. :return: ''' _opts, _args = optparse.OptionParser.parse_args(self) configs = self.find_existing_configs(_opts.support_unit) if configs and cfg not in configs: cfg = configs[0] re...
[ "Open", "suitable", "config", "file", ".", ":", "return", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/parsers.py#L1968-L1978
[ "def", "setup_config", "(", "self", ",", "cfg", "=", "None", ")", ":", "_opts", ",", "_args", "=", "optparse", ".", "OptionParser", ".", "parse_args", "(", "self", ")", "configs", "=", "self", ".", "find_existing_configs", "(", "_opts", ".", "support_unit"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
coalesce
Manage coalescing settings of network device name Interface name to apply coalescing settings .. code-block:: yaml eth0: ethtool.coalesce: - name: eth0 - adaptive_rx: on - adaptive_tx: on - rx_usecs: 24 - rx_frame: 0 ...
salt/states/ethtool.py
def coalesce(name, **kwargs): ''' Manage coalescing settings of network device name Interface name to apply coalescing settings .. code-block:: yaml eth0: ethtool.coalesce: - name: eth0 - adaptive_rx: on - adaptive_tx: on - rx_...
def coalesce(name, **kwargs): ''' Manage coalescing settings of network device name Interface name to apply coalescing settings .. code-block:: yaml eth0: ethtool.coalesce: - name: eth0 - adaptive_rx: on - adaptive_tx: on - rx_...
[ "Manage", "coalescing", "settings", "of", "network", "device" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/ethtool.py#L51-L144
[ "def", "coalesce", "(", "name", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "'Network device {0} coalescing settings are up to date.'", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
datacenter_configured
Makes sure a datacenter exists. If the state is run by an ``esxdatacenter`` minion, the name of the datacenter is retrieved from the proxy details, otherwise the datacenter has the same name as the state. Supported proxies: esxdatacenter name: Datacenter name. Ignored if the proxytype is ...
salt/states/esxdatacenter.py
def datacenter_configured(name): ''' Makes sure a datacenter exists. If the state is run by an ``esxdatacenter`` minion, the name of the datacenter is retrieved from the proxy details, otherwise the datacenter has the same name as the state. Supported proxies: esxdatacenter name: ...
def datacenter_configured(name): ''' Makes sure a datacenter exists. If the state is run by an ``esxdatacenter`` minion, the name of the datacenter is retrieved from the proxy details, otherwise the datacenter has the same name as the state. Supported proxies: esxdatacenter name: ...
[ "Makes", "sure", "a", "datacenter", "exists", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/esxdatacenter.py#L72-L126
[ "def", "datacenter_configured", "(", "name", ")", ":", "proxy_type", "=", "__salt__", "[", "'vsphere.get_proxy_type'", "]", "(", ")", "if", "proxy_type", "==", "'esxdatacenter'", ":", "dc_name", "=", "__salt__", "[", "'esxdatacenter.get_details'", "]", "(", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_container_path
Generate all the possible paths within an OpenConfig-like object. This function returns a generator.
salt/modules/napalm_formula.py
def _container_path(model, key=None, container=None, delim=DEFAULT_TARGET_DELIM): ''' Generate all the possible paths within an OpenConfig-like object. This function returns a generator. ''' if not key: key = '' if not container...
def _container_path(model, key=None, container=None, delim=DEFAULT_TARGET_DELIM): ''' Generate all the possible paths within an OpenConfig-like object. This function returns a generator. ''' if not key: key = '' if not container...
[ "Generate", "all", "the", "possible", "paths", "within", "an", "OpenConfig", "-", "like", "object", ".", "This", "function", "returns", "a", "generator", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_formula.py#L42-L68
[ "def", "_container_path", "(", "model", ",", "key", "=", "None", ",", "container", "=", "None", ",", "delim", "=", "DEFAULT_TARGET_DELIM", ")", ":", "if", "not", "key", ":", "key", "=", "''", "if", "not", "container", ":", "container", "=", "'config'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
setval
Set a value under the dictionary hierarchy identified under the key. The target 'foo/bar/baz' returns the dictionary hierarchy {'foo': {'bar': {'baz': {}}}}. .. note:: Currently this doesn't work with integers, i.e. cannot build lists dynamically. CLI Example: .. code-block:: bas...
salt/modules/napalm_formula.py
def setval(key, val, dict_=None, delim=DEFAULT_TARGET_DELIM): ''' Set a value under the dictionary hierarchy identified under the key. The target 'foo/bar/baz' returns the dictionary hierarchy {'foo': {'bar': {'baz': {}}}}. .. note:: Currently this doesn't work with integers, i.e. ...
def setval(key, val, dict_=None, delim=DEFAULT_TARGET_DELIM): ''' Set a value under the dictionary hierarchy identified under the key. The target 'foo/bar/baz' returns the dictionary hierarchy {'foo': {'bar': {'baz': {}}}}. .. note:: Currently this doesn't work with integers, i.e. ...
[ "Set", "a", "value", "under", "the", "dictionary", "hierarchy", "identified", "under", "the", "key", ".", "The", "target", "foo", "/", "bar", "/", "baz", "returns", "the", "dictionary", "hierarchy", "{", "foo", ":", "{", "bar", ":", "{", "baz", ":", "{...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_formula.py#L107-L133
[ "def", "setval", "(", "key", ",", "val", ",", "dict_", "=", "None", ",", "delim", "=", "DEFAULT_TARGET_DELIM", ")", ":", "if", "not", "dict_", ":", "dict_", "=", "{", "}", "prev_hier", "=", "dict_", "dict_hier", "=", "key", ".", "split", "(", "delim"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
traverse
Traverse a dict or list using a colon-delimited (or otherwise delimited, using the ``delimiter`` param) target string. The target ``foo:bar:0`` will return ``data['foo']['bar'][0]`` if this value exists, and will otherwise return the dict in the default argument. Function will automatically determine th...
salt/modules/napalm_formula.py
def traverse(data, key, default=None, delimiter=DEFAULT_TARGET_DELIM): ''' Traverse a dict or list using a colon-delimited (or otherwise delimited, using the ``delimiter`` param) target string. The target ``foo:bar:0`` will return ``data['foo']['bar'][0]`` if this value exists, and will otherwise re...
def traverse(data, key, default=None, delimiter=DEFAULT_TARGET_DELIM): ''' Traverse a dict or list using a colon-delimited (or otherwise delimited, using the ``delimiter`` param) target string. The target ``foo:bar:0`` will return ``data['foo']['bar'][0]`` if this value exists, and will otherwise re...
[ "Traverse", "a", "dict", "or", "list", "using", "a", "colon", "-", "delimited", "(", "or", "otherwise", "delimited", "using", "the", "delimiter", "param", ")", "target", "string", ".", "The", "target", "foo", ":", "bar", ":", "0", "will", "return", "data...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_formula.py#L136-L153
[ "def", "traverse", "(", "data", ",", "key", ",", "default", "=", "None", ",", "delimiter", "=", "DEFAULT_TARGET_DELIM", ")", ":", "return", "_traverse_dict_and_list", "(", "data", ",", "key", ",", "default", "=", "default", ",", "delimiter", "=", "delimiter"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
dictupdate
Recursive version of the default dict.update Merges upd recursively into dest If recursive_update=False, will use the classic dict.update, or fall back on a manual merge (helpful for non-dict types like ``FunctionWrapper``). If ``merge_lists=True``, will aggregate list object types instead of replace...
salt/modules/napalm_formula.py
def dictupdate(dest, upd, recursive_update=True, merge_lists=False): ''' Recursive version of the default dict.update Merges upd recursively into dest If recursive_update=False, will use the classic dict.update, or fall back on a manual merge (helpful for non-dict types like ``FunctionWrapper``). ...
def dictupdate(dest, upd, recursive_update=True, merge_lists=False): ''' Recursive version of the default dict.update Merges upd recursively into dest If recursive_update=False, will use the classic dict.update, or fall back on a manual merge (helpful for non-dict types like ``FunctionWrapper``). ...
[ "Recursive", "version", "of", "the", "default", "dict", ".", "update" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_formula.py#L156-L170
[ "def", "dictupdate", "(", "dest", ",", "upd", ",", "recursive_update", "=", "True", ",", "merge_lists", "=", "False", ")", ":", "return", "salt", ".", "utils", ".", "dictupdate", ".", "update", "(", "dest", ",", "upd", ",", "recursive_update", "=", "recu...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
defaults
Apply the defaults to a Python dictionary having the structure as described in the OpenConfig standards. model The OpenConfig model to apply the defaults to. defaults The dictionary of defaults. This argument must equally be structured with respect to the OpenConfig standards. ...
salt/modules/napalm_formula.py
def defaults(model, defaults_, delim='//', flipped_merge=False): ''' Apply the defaults to a Python dictionary having the structure as described in the OpenConfig standards. model The OpenConfig model to apply the defaults to. defaults The dic...
def defaults(model, defaults_, delim='//', flipped_merge=False): ''' Apply the defaults to a Python dictionary having the structure as described in the OpenConfig standards. model The OpenConfig model to apply the defaults to. defaults The dic...
[ "Apply", "the", "defaults", "to", "a", "Python", "dictionary", "having", "the", "structure", "as", "described", "in", "the", "OpenConfig", "standards", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_formula.py#L173-L234
[ "def", "defaults", "(", "model", ",", "defaults_", ",", "delim", "=", "'//'", ",", "flipped_merge", "=", "False", ")", ":", "merged", "=", "{", "}", "log", ".", "debug", "(", "'Applying the defaults:'", ")", "log", ".", "debug", "(", "defaults_", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
render_field
Render a field found under the ``field`` level of the hierarchy in the ``dictionary`` object. This is useful to render a field in a Jinja template without worrying that the hierarchy might not exist. For example if we do the following in Jinja: ``{{ interfaces.interface.Ethernet5.config.description }}``...
salt/modules/napalm_formula.py
def render_field(dictionary, field, prepend=None, append=None, quotes=False, **opts): ''' Render a field found under the ``field`` level of the hierarchy in the ``dictionary`` object. This is useful to render a field in...
def render_field(dictionary, field, prepend=None, append=None, quotes=False, **opts): ''' Render a field found under the ``field`` level of the hierarchy in the ``dictionary`` object. This is useful to render a field in...
[ "Render", "a", "field", "found", "under", "the", "field", "level", "of", "the", "hierarchy", "in", "the", "dictionary", "object", ".", "This", "is", "useful", "to", "render", "a", "field", "in", "a", "Jinja", "template", "without", "worrying", "that", "the...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_formula.py#L237-L314
[ "def", "render_field", "(", "dictionary", ",", "field", ",", "prepend", "=", "None", ",", "append", "=", "None", ",", "quotes", "=", "False", ",", "*", "*", "opts", ")", ":", "value", "=", "traverse", "(", "dictionary", ",", "field", ")", "if", "valu...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
render_fields
This function works similarly to :mod:`render_field <salt.modules.napalm_formula.render_field>` but for a list of fields from the same dictionary, rendering, indenting and distributing them on separate lines. dictionary The dictionary to traverse. fields A list of field names or pa...
salt/modules/napalm_formula.py
def render_fields(dictionary, *fields, **opts): ''' This function works similarly to :mod:`render_field <salt.modules.napalm_formula.render_field>` but for a list of fields from the same dictionary, rendering, indenting and distributing them on separate lines. ...
def render_fields(dictionary, *fields, **opts): ''' This function works similarly to :mod:`render_field <salt.modules.napalm_formula.render_field>` but for a list of fields from the same dictionary, rendering, indenting and distributing them on separate lines. ...
[ "This", "function", "works", "similarly", "to", ":", "mod", ":", "render_field", "<salt", ".", "modules", ".", "napalm_formula", ".", "render_field", ">", "but", "for", "a", "list", "of", "fields", "from", "the", "same", "dictionary", "rendering", "indenting",...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_formula.py#L317-L367
[ "def", "render_fields", "(", "dictionary", ",", "*", "fields", ",", "*", "*", "opts", ")", ":", "results", "=", "[", "]", "for", "field", "in", "fields", ":", "res", "=", "render_field", "(", "dictionary", ",", "field", ",", "*", "*", "opts", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
installed
Install the windows feature. To install a single feature, use the ``name`` parameter. To install multiple features, use the ``features`` parameter. .. note:: Some features require reboot after un/installation. If so, until the server is restarted other features can not be installed! Args: ...
salt/states/win_servermanager.py
def installed(name, features=None, recurse=False, restart=False, source=None, exclude=None): ''' Install the windows feature. To install a single feature, use the ``name`` parameter. To install multiple features, use the ``features`` para...
def installed(name, features=None, recurse=False, restart=False, source=None, exclude=None): ''' Install the windows feature. To install a single feature, use the ``name`` parameter. To install multiple features, use the ``features`` para...
[ "Install", "the", "windows", "feature", ".", "To", "install", "a", "single", "feature", "use", "the", "name", "parameter", ".", "To", "install", "multiple", "features", "use", "the", "features", "parameter", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_servermanager.py#L25-L189
[ "def", "installed", "(", "name", ",", "features", "=", "None", ",", "recurse", "=", "False", ",", "restart", "=", "False", ",", "source", "=", "None", ",", "exclude", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
removed
Remove the windows feature To remove a single feature, use the ``name`` parameter. To remove multiple features, use the ``features`` parameter. Args: name (str): Short name of the feature (the right column in win_servermanager.list_available). This can be a single feature or a ...
salt/states/win_servermanager.py
def removed(name, features=None, remove_payload=False, restart=False): ''' Remove the windows feature To remove a single feature, use the ``name`` parameter. To remove multiple features, use the ``features`` parameter. Args: name (str): Short name of the feature (the right column in...
def removed(name, features=None, remove_payload=False, restart=False): ''' Remove the windows feature To remove a single feature, use the ``name`` parameter. To remove multiple features, use the ``features`` parameter. Args: name (str): Short name of the feature (the right column in...
[ "Remove", "the", "windows", "feature", "To", "remove", "a", "single", "feature", "use", "the", "name", "parameter", ".", "To", "remove", "multiple", "features", "use", "the", "features", "parameter", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_servermanager.py#L192-L320
[ "def", "removed", "(", "name", ",", "features", "=", "None", ",", "remove_payload", "=", "False", ",", "restart", "=", "False", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'changes'", ":", "{", "}", ",", "'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_check_cors_origin
Check if an origin match cors allowed origins
salt/netapi/rest_tornado/saltnado.py
def _check_cors_origin(origin, allowed_origins): ''' Check if an origin match cors allowed origins ''' if isinstance(allowed_origins, list): if origin in allowed_origins: return origin elif allowed_origins == '*': return allowed_origins elif allowed_origins == origin:...
def _check_cors_origin(origin, allowed_origins): ''' Check if an origin match cors allowed origins ''' if isinstance(allowed_origins, list): if origin in allowed_origins: return origin elif allowed_origins == '*': return allowed_origins elif allowed_origins == origin:...
[ "Check", "if", "an", "origin", "match", "cors", "allowed", "origins" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L1750-L1761
[ "def", "_check_cors_origin", "(", "origin", ",", "allowed_origins", ")", ":", "if", "isinstance", "(", "allowed_origins", ",", "list", ")", ":", "if", "origin", "in", "allowed_origins", ":", "return", "origin", "elif", "allowed_origins", "==", "'*'", ":", "ret...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
EventListener.clean_by_request
Remove all futures that were waiting for request `request` since it is done waiting
salt/netapi/rest_tornado/saltnado.py
def clean_by_request(self, request): ''' Remove all futures that were waiting for request `request` since it is done waiting ''' if request not in self.request_map: return for tag, matcher, future in self.request_map[request]: # timeout the future ...
def clean_by_request(self, request): ''' Remove all futures that were waiting for request `request` since it is done waiting ''' if request not in self.request_map: return for tag, matcher, future in self.request_map[request]: # timeout the future ...
[ "Remove", "all", "futures", "that", "were", "waiting", "for", "request", "request", "since", "it", "is", "done", "waiting" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L302-L316
[ "def", "clean_by_request", "(", "self", ",", "request", ")", ":", "if", "request", "not", "in", "self", ".", "request_map", ":", "return", "for", "tag", ",", "matcher", ",", "future", "in", "self", ".", "request_map", "[", "request", "]", ":", "# timeout...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
EventListener.get_event
Get an event (asynchronous of course) return a future that will get it later
salt/netapi/rest_tornado/saltnado.py
def get_event(self, request, tag='', matcher=prefix_matcher.__func__, callback=None, timeout=None ): ''' Get an event (asynchronous of course) return a future that will get it later ''' ...
def get_event(self, request, tag='', matcher=prefix_matcher.__func__, callback=None, timeout=None ): ''' Get an event (asynchronous of course) return a future that will get it later ''' ...
[ "Get", "an", "event", "(", "asynchronous", "of", "course", ")", "return", "a", "future", "that", "will", "get", "it", "later" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L330-L360
[ "def", "get_event", "(", "self", ",", "request", ",", "tag", "=", "''", ",", "matcher", "=", "prefix_matcher", ".", "__func__", ",", "callback", "=", "None", ",", "timeout", "=", "None", ")", ":", "# if the request finished, no reason to allow event fetching, sinc...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
EventListener._timeout_future
Timeout a specific future
salt/netapi/rest_tornado/saltnado.py
def _timeout_future(self, tag, matcher, future): ''' Timeout a specific future ''' if (tag, matcher) not in self.tag_map: return if not future.done(): future.set_exception(TimeoutException()) self.tag_map[(tag, matcher)].remove(future) ...
def _timeout_future(self, tag, matcher, future): ''' Timeout a specific future ''' if (tag, matcher) not in self.tag_map: return if not future.done(): future.set_exception(TimeoutException()) self.tag_map[(tag, matcher)].remove(future) ...
[ "Timeout", "a", "specific", "future" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L362-L372
[ "def", "_timeout_future", "(", "self", ",", "tag", ",", "matcher", ",", "future", ")", ":", "if", "(", "tag", ",", "matcher", ")", "not", "in", "self", ".", "tag_map", ":", "return", "if", "not", "future", ".", "done", "(", ")", ":", "future", ".",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
EventListener._handle_event_socket_recv
Callback for events on the event sub socket
salt/netapi/rest_tornado/saltnado.py
def _handle_event_socket_recv(self, raw): ''' Callback for events on the event sub socket ''' mtag, data = self.event.unpack(raw, self.event.serial) # see if we have any futures that need this info: for (tag, matcher), futures in six.iteritems(self.tag_map): ...
def _handle_event_socket_recv(self, raw): ''' Callback for events on the event sub socket ''' mtag, data = self.event.unpack(raw, self.event.serial) # see if we have any futures that need this info: for (tag, matcher), futures in six.iteritems(self.tag_map): ...
[ "Callback", "for", "events", "on", "the", "event", "sub", "socket" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L374-L398
[ "def", "_handle_event_socket_recv", "(", "self", ",", "raw", ")", ":", "mtag", ",", "data", "=", "self", ".", "event", ".", "unpack", "(", "raw", ",", "self", ".", "event", ".", "serial", ")", "# see if we have any futures that need this info:", "for", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
BaseSaltAPIHandler._verify_client
Verify that the client is in fact one we have
salt/netapi/rest_tornado/saltnado.py
def _verify_client(self, low): ''' Verify that the client is in fact one we have ''' if 'client' not in low or low.get('client') not in self.saltclients: self.set_status(400) self.write("400 Invalid Client: Client not found in salt clients") self.finis...
def _verify_client(self, low): ''' Verify that the client is in fact one we have ''' if 'client' not in low or low.get('client') not in self.saltclients: self.set_status(400) self.write("400 Invalid Client: Client not found in salt clients") self.finis...
[ "Verify", "that", "the", "client", "is", "in", "fact", "one", "we", "have" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L407-L416
[ "def", "_verify_client", "(", "self", ",", "low", ")", ":", "if", "'client'", "not", "in", "low", "or", "low", ".", "get", "(", "'client'", ")", "not", "in", "self", ".", "saltclients", ":", "self", ".", "set_status", "(", "400", ")", "self", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
BaseSaltAPIHandler.initialize
Initialize the handler before requests are called
salt/netapi/rest_tornado/saltnado.py
def initialize(self): ''' Initialize the handler before requests are called ''' if not hasattr(self.application, 'event_listener'): log.debug('init a listener') self.application.event_listener = EventListener( self.application.mod_opts, ...
def initialize(self): ''' Initialize the handler before requests are called ''' if not hasattr(self.application, 'event_listener'): log.debug('init a listener') self.application.event_listener = EventListener( self.application.mod_opts, ...
[ "Initialize", "the", "handler", "before", "requests", "are", "called" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L418-L440
[ "def", "initialize", "(", "self", ")", ":", "if", "not", "hasattr", "(", "self", ".", "application", ",", "'event_listener'", ")", ":", "log", ".", "debug", "(", "'init a listener'", ")", "self", ".", "application", ".", "event_listener", "=", "EventListener...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
BaseSaltAPIHandler.token
The token used for the request
salt/netapi/rest_tornado/saltnado.py
def token(self): ''' The token used for the request ''' # find the token (cookie or headers) if AUTH_TOKEN_HEADER in self.request.headers: return self.request.headers[AUTH_TOKEN_HEADER] else: return self.get_cookie(AUTH_COOKIE_NAME)
def token(self): ''' The token used for the request ''' # find the token (cookie or headers) if AUTH_TOKEN_HEADER in self.request.headers: return self.request.headers[AUTH_TOKEN_HEADER] else: return self.get_cookie(AUTH_COOKIE_NAME)
[ "The", "token", "used", "for", "the", "request" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L443-L451
[ "def", "token", "(", "self", ")", ":", "# find the token (cookie or headers)", "if", "AUTH_TOKEN_HEADER", "in", "self", ".", "request", ".", "headers", ":", "return", "self", ".", "request", ".", "headers", "[", "AUTH_TOKEN_HEADER", "]", "else", ":", "return", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
BaseSaltAPIHandler._verify_auth
Boolean whether the request is auth'd
salt/netapi/rest_tornado/saltnado.py
def _verify_auth(self): ''' Boolean whether the request is auth'd ''' return self.token and bool(self.application.auth.get_tok(self.token))
def _verify_auth(self): ''' Boolean whether the request is auth'd ''' return self.token and bool(self.application.auth.get_tok(self.token))
[ "Boolean", "whether", "the", "request", "is", "auth", "d" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L453-L458
[ "def", "_verify_auth", "(", "self", ")", ":", "return", "self", ".", "token", "and", "bool", "(", "self", ".", "application", ".", "auth", ".", "get_tok", "(", "self", ".", "token", ")", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
BaseSaltAPIHandler.prepare
Run before get/posts etc. Pre-flight checks: - verify that we can speak back to them (compatible accept header)
salt/netapi/rest_tornado/saltnado.py
def prepare(self): ''' Run before get/posts etc. Pre-flight checks: - verify that we can speak back to them (compatible accept header) ''' # Find an acceptable content-type accept_header = self.request.headers.get('Accept', '*/*') # Ignore any parameter, inclu...
def prepare(self): ''' Run before get/posts etc. Pre-flight checks: - verify that we can speak back to them (compatible accept header) ''' # Find an acceptable content-type accept_header = self.request.headers.get('Accept', '*/*') # Ignore any parameter, inclu...
[ "Run", "before", "get", "/", "posts", "etc", ".", "Pre", "-", "flight", "checks", ":", "-", "verify", "that", "we", "can", "speak", "back", "to", "them", "(", "compatible", "accept", "header", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L460-L490
[ "def", "prepare", "(", "self", ")", ":", "# Find an acceptable content-type", "accept_header", "=", "self", ".", "request", ".", "headers", ".", "get", "(", "'Accept'", ",", "'*/*'", ")", "# Ignore any parameter, including q (quality) one", "parsed_accept_header", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
BaseSaltAPIHandler.serialize
Serlialize the output based on the Accept header
salt/netapi/rest_tornado/saltnado.py
def serialize(self, data): ''' Serlialize the output based on the Accept header ''' self.set_header('Content-Type', self.content_type) return self.dumper(data)
def serialize(self, data): ''' Serlialize the output based on the Accept header ''' self.set_header('Content-Type', self.content_type) return self.dumper(data)
[ "Serlialize", "the", "output", "based", "on", "the", "Accept", "header" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L514-L520
[ "def", "serialize", "(", "self", ",", "data", ")", ":", "self", ".", "set_header", "(", "'Content-Type'", ",", "self", ".", "content_type", ")", "return", "self", ".", "dumper", "(", "data", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
BaseSaltAPIHandler._form_loader
function to get the data from the urlencoded forms ignore the data passed in and just get the args from wherever they are
salt/netapi/rest_tornado/saltnado.py
def _form_loader(self, _): ''' function to get the data from the urlencoded forms ignore the data passed in and just get the args from wherever they are ''' data = {} for key in self.request.arguments: val = self.get_arguments(key) if len(val) == 1...
def _form_loader(self, _): ''' function to get the data from the urlencoded forms ignore the data passed in and just get the args from wherever they are ''' data = {} for key in self.request.arguments: val = self.get_arguments(key) if len(val) == 1...
[ "function", "to", "get", "the", "data", "from", "the", "urlencoded", "forms", "ignore", "the", "data", "passed", "in", "and", "just", "get", "the", "args", "from", "wherever", "they", "are" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L522-L534
[ "def", "_form_loader", "(", "self", ",", "_", ")", ":", "data", "=", "{", "}", "for", "key", "in", "self", ".", "request", ".", "arguments", ":", "val", "=", "self", ".", "get_arguments", "(", "key", ")", "if", "len", "(", "val", ")", "==", "1", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
BaseSaltAPIHandler.deserialize
Deserialize the data based on request content type headers
salt/netapi/rest_tornado/saltnado.py
def deserialize(self, data): ''' Deserialize the data based on request content type headers ''' ct_in_map = { 'application/x-www-form-urlencoded': self._form_loader, 'application/json': salt.utils.json.loads, 'application/x-yaml': salt.utils.yaml.safe_...
def deserialize(self, data): ''' Deserialize the data based on request content type headers ''' ct_in_map = { 'application/x-www-form-urlencoded': self._form_loader, 'application/json': salt.utils.json.loads, 'application/x-yaml': salt.utils.yaml.safe_...
[ "Deserialize", "the", "data", "based", "on", "request", "content", "type", "headers" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L536-L556
[ "def", "deserialize", "(", "self", ",", "data", ")", ":", "ct_in_map", "=", "{", "'application/x-www-form-urlencoded'", ":", "self", ".", "_form_loader", ",", "'application/json'", ":", "salt", ".", "utils", ".", "json", ".", "loads", ",", "'application/x-yaml'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
BaseSaltAPIHandler._get_lowstate
Format the incoming data into a lowstate object
salt/netapi/rest_tornado/saltnado.py
def _get_lowstate(self): ''' Format the incoming data into a lowstate object ''' if not self.request.body: return data = self.deserialize(self.request.body) self.request_payload = copy(data) if data and 'arg' in data and not isinstance(data['arg'], li...
def _get_lowstate(self): ''' Format the incoming data into a lowstate object ''' if not self.request.body: return data = self.deserialize(self.request.body) self.request_payload = copy(data) if data and 'arg' in data and not isinstance(data['arg'], li...
[ "Format", "the", "incoming", "data", "into", "a", "lowstate", "object" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L558-L575
[ "def", "_get_lowstate", "(", "self", ")", ":", "if", "not", "self", ".", "request", ".", "body", ":", "return", "data", "=", "self", ".", "deserialize", "(", "self", ".", "request", ".", "body", ")", "self", ".", "request_payload", "=", "copy", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
BaseSaltAPIHandler.set_default_headers
Set default CORS headers
salt/netapi/rest_tornado/saltnado.py
def set_default_headers(self): ''' Set default CORS headers ''' mod_opts = self.application.mod_opts if mod_opts.get('cors_origin'): origin = self.request.headers.get('Origin') allowed_origin = _check_cors_origin(origin, mod_opts['cors_origin']) ...
def set_default_headers(self): ''' Set default CORS headers ''' mod_opts = self.application.mod_opts if mod_opts.get('cors_origin'): origin = self.request.headers.get('Origin') allowed_origin = _check_cors_origin(origin, mod_opts['cors_origin']) ...
[ "Set", "default", "CORS", "headers" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L577-L589
[ "def", "set_default_headers", "(", "self", ")", ":", "mod_opts", "=", "self", ".", "application", ".", "mod_opts", "if", "mod_opts", ".", "get", "(", "'cors_origin'", ")", ":", "origin", "=", "self", ".", "request", ".", "headers", ".", "get", "(", "'Ori...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
BaseSaltAPIHandler.options
Return CORS headers for preflight requests
salt/netapi/rest_tornado/saltnado.py
def options(self, *args, **kwargs): ''' Return CORS headers for preflight requests ''' # Allow X-Auth-Token in requests request_headers = self.request.headers.get('Access-Control-Request-Headers') allowed_headers = request_headers.split(',') # Filter allowed head...
def options(self, *args, **kwargs): ''' Return CORS headers for preflight requests ''' # Allow X-Auth-Token in requests request_headers = self.request.headers.get('Access-Control-Request-Headers') allowed_headers = request_headers.split(',') # Filter allowed head...
[ "Return", "CORS", "headers", "for", "preflight", "requests" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L591-L611
[ "def", "options", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Allow X-Auth-Token in requests", "request_headers", "=", "self", ".", "request", ".", "headers", ".", "get", "(", "'Access-Control-Request-Headers'", ")", "allowed_headers", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltAuthHandler.get
All logins are done over post, this is a parked endpoint .. http:get:: /login :status 401: |401| :status 406: |406| **Example request:** .. code-block:: bash curl -i localhost:8000/login .. code-block:: text GET /login HTTP/1.1 ...
salt/netapi/rest_tornado/saltnado.py
def get(self): ''' All logins are done over post, this is a parked endpoint .. http:get:: /login :status 401: |401| :status 406: |406| **Example request:** .. code-block:: bash curl -i localhost:8000/login .. code-block:: text ...
def get(self): ''' All logins are done over post, this is a parked endpoint .. http:get:: /login :status 401: |401| :status 406: |406| **Example request:** .. code-block:: bash curl -i localhost:8000/login .. code-block:: text ...
[ "All", "logins", "are", "done", "over", "post", "this", "is", "a", "parked", "endpoint" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L618-L655
[ "def", "get", "(", "self", ")", ":", "self", ".", "set_status", "(", "401", ")", "self", ".", "set_header", "(", "'WWW-Authenticate'", ",", "'Session'", ")", "ret", "=", "{", "'status'", ":", "'401 Unauthorized'", ",", "'return'", ":", "'Please log in'", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltAuthHandler.post
:ref:`Authenticate <rest_tornado-auth>` against Salt's eauth system .. http:post:: /login :reqheader X-Auth-Token: |req_token| :reqheader Accept: |req_accept| :reqheader Content-Type: |req_ct| :form eauth: the eauth backend configured for the user :...
salt/netapi/rest_tornado/saltnado.py
def post(self): ''' :ref:`Authenticate <rest_tornado-auth>` against Salt's eauth system .. http:post:: /login :reqheader X-Auth-Token: |req_token| :reqheader Accept: |req_accept| :reqheader Content-Type: |req_ct| :form eauth: the eauth backend c...
def post(self): ''' :ref:`Authenticate <rest_tornado-auth>` against Salt's eauth system .. http:post:: /login :reqheader X-Auth-Token: |req_token| :reqheader Accept: |req_accept| :reqheader Content-Type: |req_ct| :form eauth: the eauth backend c...
[ ":", "ref", ":", "Authenticate", "<rest_tornado", "-", "auth", ">", "against", "Salt", "s", "eauth", "system" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L658-L788
[ "def", "post", "(", "self", ")", ":", "try", ":", "if", "not", "isinstance", "(", "self", ".", "request_payload", ",", "dict", ")", ":", "self", ".", "send_error", "(", "400", ")", "return", "creds", "=", "{", "'username'", ":", "self", ".", "request...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltAPIHandler.get
An endpoint to determine salt-api capabilities .. http:get:: / :reqheader Accept: |req_accept| :status 200: |200| :status 401: |401| :status 406: |406| **Example request:** .. code-block:: bash curl -i localhost:8000 .. c...
salt/netapi/rest_tornado/saltnado.py
def get(self): ''' An endpoint to determine salt-api capabilities .. http:get:: / :reqheader Accept: |req_accept| :status 200: |200| :status 401: |401| :status 406: |406| **Example request:** .. code-block:: bash c...
def get(self): ''' An endpoint to determine salt-api capabilities .. http:get:: / :reqheader Accept: |req_accept| :status 200: |200| :status 401: |401| :status 406: |406| **Example request:** .. code-block:: bash c...
[ "An", "endpoint", "to", "determine", "salt", "-", "api", "capabilities" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L795-L831
[ "def", "get", "(", "self", ")", ":", "ret", "=", "{", "\"clients\"", ":", "list", "(", "self", ".", "saltclients", ".", "keys", "(", ")", ")", ",", "\"return\"", ":", "\"Welcome\"", "}", "self", ".", "write", "(", "self", ".", "serialize", "(", "re...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltAPIHandler.disbatch
Disbatch all lowstates to the appropriate clients
salt/netapi/rest_tornado/saltnado.py
def disbatch(self): ''' Disbatch all lowstates to the appropriate clients ''' ret = [] # check clients before going, we want to throw 400 if one is bad for low in self.lowstate: if not self._verify_client(low): return # Make sure ...
def disbatch(self): ''' Disbatch all lowstates to the appropriate clients ''' ret = [] # check clients before going, we want to throw 400 if one is bad for low in self.lowstate: if not self._verify_client(low): return # Make sure ...
[ "Disbatch", "all", "lowstates", "to", "the", "appropriate", "clients" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L912-L946
[ "def", "disbatch", "(", "self", ")", ":", "ret", "=", "[", "]", "# check clients before going, we want to throw 400 if one is bad", "for", "low", "in", "self", ".", "lowstate", ":", "if", "not", "self", ".", "_verify_client", "(", "low", ")", ":", "return", "#...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltAPIHandler._disbatch_local
Dispatch local client commands
salt/netapi/rest_tornado/saltnado.py
def _disbatch_local(self, chunk): ''' Dispatch local client commands ''' # Generate jid and find all minions before triggering a job to subscribe all returns from minions full_return = chunk.pop('full_return', False) chunk['jid'] = salt.utils.jid.gen_jid(self.application....
def _disbatch_local(self, chunk): ''' Dispatch local client commands ''' # Generate jid and find all minions before triggering a job to subscribe all returns from minions full_return = chunk.pop('full_return', False) chunk['jid'] = salt.utils.jid.gen_jid(self.application....
[ "Dispatch", "local", "client", "commands" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L949-L1070
[ "def", "_disbatch_local", "(", "self", ",", "chunk", ")", ":", "# Generate jid and find all minions before triggering a job to subscribe all returns from minions", "full_return", "=", "chunk", ".", "pop", "(", "'full_return'", ",", "False", ")", "chunk", "[", "'jid'", "]"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltAPIHandler.job_not_running
Return a future which will complete once jid (passed in) is no longer running on tgt
salt/netapi/rest_tornado/saltnado.py
def job_not_running(self, jid, tgt, tgt_type, minions, is_finished): ''' Return a future which will complete once jid (passed in) is no longer running on tgt ''' ping_pub_data = yield self.saltclients['local'](tgt, 'saltutil...
def job_not_running(self, jid, tgt, tgt_type, minions, is_finished): ''' Return a future which will complete once jid (passed in) is no longer running on tgt ''' ping_pub_data = yield self.saltclients['local'](tgt, 'saltutil...
[ "Return", "a", "future", "which", "will", "complete", "once", "jid", "(", "passed", "in", ")", "is", "no", "longer", "running", "on", "tgt" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L1073-L1111
[ "def", "job_not_running", "(", "self", ",", "jid", ",", "tgt", ",", "tgt_type", ",", "minions", ",", "is_finished", ")", ":", "ping_pub_data", "=", "yield", "self", ".", "saltclients", "[", "'local'", "]", "(", "tgt", ",", "'saltutil.find_job'", ",", "[", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltAPIHandler._disbatch_local_async
Disbatch local client_async commands
salt/netapi/rest_tornado/saltnado.py
def _disbatch_local_async(self, chunk): ''' Disbatch local client_async commands ''' f_call = self._format_call_run_job_async(chunk) # fire a job off pub_data = yield self.saltclients['local_async'](*f_call.get('args', ()), **f_call.get('kwargs', {})) raise torna...
def _disbatch_local_async(self, chunk): ''' Disbatch local client_async commands ''' f_call = self._format_call_run_job_async(chunk) # fire a job off pub_data = yield self.saltclients['local_async'](*f_call.get('args', ()), **f_call.get('kwargs', {})) raise torna...
[ "Disbatch", "local", "client_async", "commands" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L1114-L1122
[ "def", "_disbatch_local_async", "(", "self", ",", "chunk", ")", ":", "f_call", "=", "self", ".", "_format_call_run_job_async", "(", "chunk", ")", "# fire a job off", "pub_data", "=", "yield", "self", ".", "saltclients", "[", "'local_async'", "]", "(", "*", "f_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltAPIHandler._disbatch_runner
Disbatch runner client commands
salt/netapi/rest_tornado/saltnado.py
def _disbatch_runner(self, chunk): ''' Disbatch runner client commands ''' full_return = chunk.pop('full_return', False) pub_data = self.saltclients['runner'](chunk) tag = pub_data['tag'] + '/ret' try: event = yield self.application.event_listener.get_...
def _disbatch_runner(self, chunk): ''' Disbatch runner client commands ''' full_return = chunk.pop('full_return', False) pub_data = self.saltclients['runner'](chunk) tag = pub_data['tag'] + '/ret' try: event = yield self.application.event_listener.get_...
[ "Disbatch", "runner", "client", "commands" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L1125-L1139
[ "def", "_disbatch_runner", "(", "self", ",", "chunk", ")", ":", "full_return", "=", "chunk", ".", "pop", "(", "'full_return'", ",", "False", ")", "pub_data", "=", "self", ".", "saltclients", "[", "'runner'", "]", "(", "chunk", ")", "tag", "=", "pub_data"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltAPIHandler._disbatch_runner_async
Disbatch runner client_async commands
salt/netapi/rest_tornado/saltnado.py
def _disbatch_runner_async(self, chunk): ''' Disbatch runner client_async commands ''' pub_data = self.saltclients['runner'](chunk) raise tornado.gen.Return(pub_data)
def _disbatch_runner_async(self, chunk): ''' Disbatch runner client_async commands ''' pub_data = self.saltclients['runner'](chunk) raise tornado.gen.Return(pub_data)
[ "Disbatch", "runner", "client_async", "commands" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L1142-L1147
[ "def", "_disbatch_runner_async", "(", "self", ",", "chunk", ")", ":", "pub_data", "=", "self", ".", "saltclients", "[", "'runner'", "]", "(", "chunk", ")", "raise", "tornado", ".", "gen", ".", "Return", "(", "pub_data", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
MinionSaltAPIHandler.get
A convenience URL for getting lists of minions or getting minion details .. http:get:: /minions/(mid) :reqheader X-Auth-Token: |req_token| :reqheader Accept: |req_accept| :status 200: |200| :status 401: |401| :status 406: |406| **Ex...
salt/netapi/rest_tornado/saltnado.py
def get(self, mid=None): # pylint: disable=W0221 ''' A convenience URL for getting lists of minions or getting minion details .. http:get:: /minions/(mid) :reqheader X-Auth-Token: |req_token| :reqheader Accept: |req_accept| :status 200: |200| ...
def get(self, mid=None): # pylint: disable=W0221 ''' A convenience URL for getting lists of minions or getting minion details .. http:get:: /minions/(mid) :reqheader X-Auth-Token: |req_token| :reqheader Accept: |req_accept| :status 200: |200| ...
[ "A", "convenience", "URL", "for", "getting", "lists", "of", "minions", "or", "getting", "minion", "details" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L1165-L1214
[ "def", "get", "(", "self", ",", "mid", "=", "None", ")", ":", "# pylint: disable=W0221", "# if you aren't authenticated, redirect to login", "if", "not", "self", ".", "_verify_auth", "(", ")", ":", "self", ".", "redirect", "(", "'/login'", ")", "return", "self",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
MinionSaltAPIHandler.post
Start an execution command and immediately return the job id .. http:post:: /minions :reqheader X-Auth-Token: |req_token| :reqheader Accept: |req_accept| :reqheader Content-Type: |req_ct| :resheader Content-Type: |res_ct| :status 200: |200| ...
salt/netapi/rest_tornado/saltnado.py
def post(self): ''' Start an execution command and immediately return the job id .. http:post:: /minions :reqheader X-Auth-Token: |req_token| :reqheader Accept: |req_accept| :reqheader Content-Type: |req_ct| :resheader Content-Type: |res_ct| ...
def post(self): ''' Start an execution command and immediately return the job id .. http:post:: /minions :reqheader X-Auth-Token: |req_token| :reqheader Accept: |req_accept| :reqheader Content-Type: |req_ct| :resheader Content-Type: |res_ct| ...
[ "Start", "an", "execution", "command", "and", "immediately", "return", "the", "job", "id" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L1217-L1286
[ "def", "post", "(", "self", ")", ":", "# if you aren't authenticated, redirect to login", "if", "not", "self", ".", "_verify_auth", "(", ")", ":", "self", ".", "redirect", "(", "'/login'", ")", "return", "# verify that all lowstates are the correct client type", "for", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
JobsSaltAPIHandler.get
A convenience URL for getting lists of previously run jobs or getting the return from a single job .. http:get:: /jobs/(jid) List jobs or show a single job from the job cache. :status 200: |200| :status 401: |401| :status 406: |406| **Example r...
salt/netapi/rest_tornado/saltnado.py
def get(self, jid=None): # pylint: disable=W0221 ''' A convenience URL for getting lists of previously run jobs or getting the return from a single job .. http:get:: /jobs/(jid) List jobs or show a single job from the job cache. :status 200: |200| ...
def get(self, jid=None): # pylint: disable=W0221 ''' A convenience URL for getting lists of previously run jobs or getting the return from a single job .. http:get:: /jobs/(jid) List jobs or show a single job from the job cache. :status 200: |200| ...
[ "A", "convenience", "URL", "for", "getting", "lists", "of", "previously", "run", "jobs", "or", "getting", "the", "return", "from", "a", "single", "job" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L1294-L1392
[ "def", "get", "(", "self", ",", "jid", "=", "None", ")", ":", "# pylint: disable=W0221", "# if you aren't authenticated, redirect to login", "if", "not", "self", ".", "_verify_auth", "(", ")", ":", "self", ".", "redirect", "(", "'/login'", ")", "return", "if", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
EventsSaltAPIHandler.get
r''' An HTTP stream of the Salt master event bus This stream is formatted per the Server Sent Events (SSE) spec. Each event is formatted as JSON. .. http:get:: /events :status 200: |200| :status 401: |401| :status 406: |406| **Example reque...
salt/netapi/rest_tornado/saltnado.py
def get(self): r''' An HTTP stream of the Salt master event bus This stream is formatted per the Server Sent Events (SSE) spec. Each event is formatted as JSON. .. http:get:: /events :status 200: |200| :status 401: |401| :status 406: |406| ...
def get(self): r''' An HTTP stream of the Salt master event bus This stream is formatted per the Server Sent Events (SSE) spec. Each event is formatted as JSON. .. http:get:: /events :status 200: |200| :status 401: |401| :status 406: |406| ...
[ "r", "An", "HTTP", "stream", "of", "the", "Salt", "master", "event", "bus" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L1471-L1584
[ "def", "get", "(", "self", ")", ":", "# if you aren't authenticated, redirect to login", "if", "not", "self", ".", "_verify_auth", "(", ")", ":", "self", ".", "redirect", "(", "'/login'", ")", "return", "# set the streaming headers", "self", ".", "set_header", "("...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
WebhookSaltAPIHandler.post
Fire an event in Salt with a custom event tag and data .. http:post:: /hook :status 200: |200| :status 401: |401| :status 406: |406| :status 413: request body is too large **Example request:** .. code-block:: bash curl -sS localhos...
salt/netapi/rest_tornado/saltnado.py
def post(self, tag_suffix=None): # pylint: disable=W0221 ''' Fire an event in Salt with a custom event tag and data .. http:post:: /hook :status 200: |200| :status 401: |401| :status 406: |406| :status 413: request body is too large **E...
def post(self, tag_suffix=None): # pylint: disable=W0221 ''' Fire an event in Salt with a custom event tag and data .. http:post:: /hook :status 200: |200| :status 401: |401| :status 406: |406| :status 413: request body is too large **E...
[ "Fire", "an", "event", "in", "Salt", "with", "a", "custom", "event", "tag", "and", "data" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/saltnado.py#L1628-L1747
[ "def", "post", "(", "self", ",", "tag_suffix", "=", "None", ")", ":", "# pylint: disable=W0221", "disable_auth", "=", "self", ".", "application", ".", "mod_opts", ".", "get", "(", "'webhook_disable_auth'", ")", "if", "not", "disable_auth", "and", "not", "self"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
beacon
Called several times each second https://docs.saltstack.com/en/latest/topics/beacons/#the-beacon-function .. code-block:: yaml beacons: proxy_example: - endpoint: beacon
salt/beacons/proxy_example.py
def beacon(config): ''' Called several times each second https://docs.saltstack.com/en/latest/topics/beacons/#the-beacon-function .. code-block:: yaml beacons: proxy_example: - endpoint: beacon ''' # Important!!! # Although this toy example makes an HTTP call ...
def beacon(config): ''' Called several times each second https://docs.saltstack.com/en/latest/topics/beacons/#the-beacon-function .. code-block:: yaml beacons: proxy_example: - endpoint: beacon ''' # Important!!! # Although this toy example makes an HTTP call ...
[ "Called", "several", "times", "each", "second", "https", ":", "//", "docs", ".", "saltstack", ".", "com", "/", "en", "/", "latest", "/", "topics", "/", "beacons", "/", "#the", "-", "beacon", "-", "function" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/proxy_example.py#L46-L71
[ "def", "beacon", "(", "config", ")", ":", "# Important!!!", "# Although this toy example makes an HTTP call", "# to get beacon information", "# please be advised that doing CPU or IO intensive", "# operations in this method will cause the beacon loop", "# to block.", "_config", "=", "{",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
Ensure user account is absent name : string username
salt/states/pdbedit.py
def absent(name): ''' Ensure user account is absent name : string username ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} # remove if needed if name in __salt__['pdbedit.list'](False): res = __salt__['pdbedit.delete']...
def absent(name): ''' Ensure user account is absent name : string username ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} # remove if needed if name in __salt__['pdbedit.list'](False): res = __salt__['pdbedit.delete']...
[ "Ensure", "user", "account", "is", "absent" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pdbedit.py#L53-L75
[ "def", "absent", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "# remove if needed", "if", "name", "in", "__salt__", "[", "'pdbedit.list'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
managed
Manage user account login : string login name password : string password password_hashed : boolean set if password is a nt hash instead of plain text domain : string users domain profile : string profile path script : string logon script drive...
salt/states/pdbedit.py
def managed(name, **kwargs): ''' Manage user account login : string login name password : string password password_hashed : boolean set if password is a nt hash instead of plain text domain : string users domain profile : string profile path scrip...
def managed(name, **kwargs): ''' Manage user account login : string login name password : string password password_hashed : boolean set if password is a nt hash instead of plain text domain : string users domain profile : string profile path scrip...
[ "Manage", "user", "account" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pdbedit.py#L78-L146
[ "def", "managed", "(", "name", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "# save state", "saved", "=", "__salt__", "["...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_write_proxy_conf
write to file
salt/modules/salt_proxy.py
def _write_proxy_conf(proxyfile): ''' write to file ''' msg = 'Invalid value for proxy file provided!, Supplied value = {0}' \ .format(proxyfile) log.trace('Salt Proxy Module: write proxy conf') if proxyfile: log.debug('Writing proxy conf file') with salt.utils.files.fo...
def _write_proxy_conf(proxyfile): ''' write to file ''' msg = 'Invalid value for proxy file provided!, Supplied value = {0}' \ .format(proxyfile) log.trace('Salt Proxy Module: write proxy conf') if proxyfile: log.debug('Writing proxy conf file') with salt.utils.files.fo...
[ "write", "to", "file" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/salt_proxy.py#L24-L41
[ "def", "_write_proxy_conf", "(", "proxyfile", ")", ":", "msg", "=", "'Invalid value for proxy file provided!, Supplied value = {0}'", ".", "format", "(", "proxyfile", ")", "log", ".", "trace", "(", "'Salt Proxy Module: write proxy conf'", ")", "if", "proxyfile", ":", "l...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_proxy_conf_file
Check if proxy conf exists and update
salt/modules/salt_proxy.py
def _proxy_conf_file(proxyfile, test): ''' Check if proxy conf exists and update ''' changes_old = [] changes_new = [] success = True if not os.path.exists(proxyfile): try: if not test: changes_new.append(_write_proxy_conf(proxyfile)) msg =...
def _proxy_conf_file(proxyfile, test): ''' Check if proxy conf exists and update ''' changes_old = [] changes_new = [] success = True if not os.path.exists(proxyfile): try: if not test: changes_new.append(_write_proxy_conf(proxyfile)) msg =...
[ "Check", "if", "proxy", "conf", "exists", "and", "update" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/salt_proxy.py#L44-L70
[ "def", "_proxy_conf_file", "(", "proxyfile", ",", "test", ")", ":", "changes_old", "=", "[", "]", "changes_new", "=", "[", "]", "success", "=", "True", "if", "not", "os", ".", "path", ".", "exists", "(", "proxyfile", ")", ":", "try", ":", "if", "not"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_is_proxy_running
Check if proxy for this name is running
salt/modules/salt_proxy.py
def _is_proxy_running(proxyname): ''' Check if proxy for this name is running ''' cmd = ('ps ax | grep "salt-proxy --proxyid={0}" | grep -v grep' .format(salt.ext.six.moves.shlex_quote(proxyname))) cmdout = __salt__['cmd.run_all']( cmd, timeout=5, python_shell=True...
def _is_proxy_running(proxyname): ''' Check if proxy for this name is running ''' cmd = ('ps ax | grep "salt-proxy --proxyid={0}" | grep -v grep' .format(salt.ext.six.moves.shlex_quote(proxyname))) cmdout = __salt__['cmd.run_all']( cmd, timeout=5, python_shell=True...
[ "Check", "if", "proxy", "for", "this", "name", "is", "running" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/salt_proxy.py#L73-L86
[ "def", "_is_proxy_running", "(", "proxyname", ")", ":", "cmd", "=", "(", "'ps ax | grep \"salt-proxy --proxyid={0}\" | grep -v grep'", ".", "format", "(", "salt", ".", "ext", ".", "six", ".", "moves", ".", "shlex_quote", "(", "proxyname", ")", ")", ")", "cmdout"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_proxy_process
Check and execute proxy process
salt/modules/salt_proxy.py
def _proxy_process(proxyname, test): ''' Check and execute proxy process ''' changes_old = [] changes_new = [] if not _is_proxy_running(proxyname): if not test: __salt__['cmd.run_all']( 'salt-proxy --proxyid={0} -l info -d'.format(salt.ext.six.moves.shlex_quot...
def _proxy_process(proxyname, test): ''' Check and execute proxy process ''' changes_old = [] changes_new = [] if not _is_proxy_running(proxyname): if not test: __salt__['cmd.run_all']( 'salt-proxy --proxyid={0} -l info -d'.format(salt.ext.six.moves.shlex_quot...
[ "Check", "and", "execute", "proxy", "process" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/salt_proxy.py#L89-L108
[ "def", "_proxy_process", "(", "proxyname", ",", "test", ")", ":", "changes_old", "=", "[", "]", "changes_new", "=", "[", "]", "if", "not", "_is_proxy_running", "(", "proxyname", ")", ":", "if", "not", "test", ":", "__salt__", "[", "'cmd.run_all'", "]", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
configure_proxy
Create the salt proxy file and start the proxy process if required Parameters: proxyname: Name to be used for this proxy (should match entries in pillar) start: Boolean indicating if the process should be started default = True CLI Example: .. code-...
salt/modules/salt_proxy.py
def configure_proxy(proxyname, start=True): ''' Create the salt proxy file and start the proxy process if required Parameters: proxyname: Name to be used for this proxy (should match entries in pillar) start: Boolean indicating if the process should be started ...
def configure_proxy(proxyname, start=True): ''' Create the salt proxy file and start the proxy process if required Parameters: proxyname: Name to be used for this proxy (should match entries in pillar) start: Boolean indicating if the process should be started ...
[ "Create", "the", "salt", "proxy", "file", "and", "start", "the", "proxy", "process", "if", "required" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/salt_proxy.py#L111-L156
[ "def", "configure_proxy", "(", "proxyname", ",", "start", "=", "True", ")", ":", "changes_new", "=", "[", "]", "changes_old", "=", "[", "]", "status_file", "=", "True", "test", "=", "__opts__", "[", "'test'", "]", "# write the proxy file if necessary", "proxyf...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltInfo.publish_minions
Publishes minions as a list of dicts.
salt/netapi/rest_tornado/event_processor.py
def publish_minions(self): ''' Publishes minions as a list of dicts. ''' log.debug('in publish minions') minions = {} log.debug('starting loop') for minion, minion_info in six.iteritems(self.minions): log.debug(minion) # log.debug(minion_i...
def publish_minions(self): ''' Publishes minions as a list of dicts. ''' log.debug('in publish minions') minions = {} log.debug('starting loop') for minion, minion_info in six.iteritems(self.minions): log.debug(minion) # log.debug(minion_i...
[ "Publishes", "minions", "as", "a", "list", "of", "dicts", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/event_processor.py#L32-L50
[ "def", "publish_minions", "(", "self", ")", ":", "log", ".", "debug", "(", "'in publish minions'", ")", "minions", "=", "{", "}", "log", ".", "debug", "(", "'starting loop'", ")", "for", "minion", ",", "minion_info", "in", "six", ".", "iteritems", "(", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltInfo.publish
Publishes the data to the event stream.
salt/netapi/rest_tornado/event_processor.py
def publish(self, key, data): ''' Publishes the data to the event stream. ''' publish_data = {key: data} pub = salt.utils.json.dumps(publish_data) + str('\n\n') # future lint: disable=blacklisted-function self.handler.write_message(pub)
def publish(self, key, data): ''' Publishes the data to the event stream. ''' publish_data = {key: data} pub = salt.utils.json.dumps(publish_data) + str('\n\n') # future lint: disable=blacklisted-function self.handler.write_message(pub)
[ "Publishes", "the", "data", "to", "the", "event", "stream", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/event_processor.py#L52-L58
[ "def", "publish", "(", "self", ",", "key", ",", "data", ")", ":", "publish_data", "=", "{", "key", ":", "data", "}", "pub", "=", "salt", ".", "utils", ".", "json", ".", "dumps", "(", "publish_data", ")", "+", "str", "(", "'\\n\\n'", ")", "# future ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltInfo.process_minion_update
Associate grains data with a minion and publish minion update
salt/netapi/rest_tornado/event_processor.py
def process_minion_update(self, event_data): ''' Associate grains data with a minion and publish minion update ''' tag = event_data['tag'] event_info = event_data['data'] mid = tag.split('/')[-1] if not self.minions.get(mid, None): self.minions[mid] ...
def process_minion_update(self, event_data): ''' Associate grains data with a minion and publish minion update ''' tag = event_data['tag'] event_info = event_data['data'] mid = tag.split('/')[-1] if not self.minions.get(mid, None): self.minions[mid] ...
[ "Associate", "grains", "data", "with", "a", "minion", "and", "publish", "minion", "update" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/event_processor.py#L60-L76
[ "def", "process_minion_update", "(", "self", ",", "event_data", ")", ":", "tag", "=", "event_data", "[", "'tag'", "]", "event_info", "=", "event_data", "[", "'data'", "]", "mid", "=", "tag", ".", "split", "(", "'/'", ")", "[", "-", "1", "]", "if", "n...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltInfo.process_ret_job_event
Process a /ret event returned by Salt for a particular minion. These events contain the returned results from a particular execution.
salt/netapi/rest_tornado/event_processor.py
def process_ret_job_event(self, event_data): ''' Process a /ret event returned by Salt for a particular minion. These events contain the returned results from a particular execution. ''' tag = event_data['tag'] event_info = event_data['data'] _, _, jid, _, mid = ...
def process_ret_job_event(self, event_data): ''' Process a /ret event returned by Salt for a particular minion. These events contain the returned results from a particular execution. ''' tag = event_data['tag'] event_info = event_data['data'] _, _, jid, _, mid = ...
[ "Process", "a", "/", "ret", "event", "returned", "by", "Salt", "for", "a", "particular", "minion", ".", "These", "events", "contain", "the", "returned", "results", "from", "a", "particular", "execution", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/event_processor.py#L78-L100
[ "def", "process_ret_job_event", "(", "self", ",", "event_data", ")", ":", "tag", "=", "event_data", "[", "'tag'", "]", "event_info", "=", "event_data", "[", "'data'", "]", "_", ",", "_", ",", "jid", ",", "_", ",", "mid", "=", "tag", ".", "split", "("...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltInfo.process_new_job_event
Creates a new job with properties from the event data like jid, function, args, timestamp. Also sets the initial state to started. Minions that are participating in this job are also noted.
salt/netapi/rest_tornado/event_processor.py
def process_new_job_event(self, event_data): ''' Creates a new job with properties from the event data like jid, function, args, timestamp. Also sets the initial state to started. Minions that are participating in this job are also noted. ''' job = None ...
def process_new_job_event(self, event_data): ''' Creates a new job with properties from the event data like jid, function, args, timestamp. Also sets the initial state to started. Minions that are participating in this job are also noted. ''' job = None ...
[ "Creates", "a", "new", "job", "with", "properties", "from", "the", "event", "data", "like", "jid", "function", "args", "timestamp", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/event_processor.py#L102-L129
[ "def", "process_new_job_event", "(", "self", ",", "event_data", ")", ":", "job", "=", "None", "tag", "=", "event_data", "[", "'tag'", "]", "event_info", "=", "event_data", "[", "'data'", "]", "minions", "=", "{", "}", "for", "mid", "in", "event_info", "[...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltInfo.process_key_event
Tag: salt/key Data: {'_stamp': '2014-05-20T22:45:04.345583', 'act': 'delete', 'id': 'compute.home', 'result': True}
salt/netapi/rest_tornado/event_processor.py
def process_key_event(self, event_data): ''' Tag: salt/key Data: {'_stamp': '2014-05-20T22:45:04.345583', 'act': 'delete', 'id': 'compute.home', 'result': True} ''' tag = event_data['tag'] event_info = event_data['data'] if eve...
def process_key_event(self, event_data): ''' Tag: salt/key Data: {'_stamp': '2014-05-20T22:45:04.345583', 'act': 'delete', 'id': 'compute.home', 'result': True} ''' tag = event_data['tag'] event_info = event_data['data'] if eve...
[ "Tag", ":", "salt", "/", "key", "Data", ":", "{", "_stamp", ":", "2014", "-", "05", "-", "20T22", ":", "45", ":", "04", ".", "345583", "act", ":", "delete", "id", ":", "compute", ".", "home", "result", ":", "True", "}" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/event_processor.py#L131-L149
[ "def", "process_key_event", "(", "self", ",", "event_data", ")", ":", "tag", "=", "event_data", "[", "'tag'", "]", "event_info", "=", "event_data", "[", "'data'", "]", "if", "event_info", "[", "'act'", "]", "==", "'delete'", ":", "self", ".", "minions", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltInfo.process_presence_events
Check if any minions have connected or dropped. Send a message to the client if they have.
salt/netapi/rest_tornado/event_processor.py
def process_presence_events(self, salt_data, token, opts): ''' Check if any minions have connected or dropped. Send a message to the client if they have. ''' log.debug('In presence') changed = False # check if any connections were dropped if set(salt_data...
def process_presence_events(self, salt_data, token, opts): ''' Check if any minions have connected or dropped. Send a message to the client if they have. ''' log.debug('In presence') changed = False # check if any connections were dropped if set(salt_data...
[ "Check", "if", "any", "minions", "have", "connected", "or", "dropped", ".", "Send", "a", "message", "to", "the", "client", "if", "they", "have", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/event_processor.py#L151-L202
[ "def", "process_presence_events", "(", "self", ",", "salt_data", ",", "token", ",", "opts", ")", ":", "log", ".", "debug", "(", "'In presence'", ")", "changed", "=", "False", "# check if any connections were dropped", "if", "set", "(", "salt_data", "[", "'data'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltInfo.process
Process events and publish data
salt/netapi/rest_tornado/event_processor.py
def process(self, salt_data, token, opts): ''' Process events and publish data ''' log.debug('In process %s', threading.current_thread()) log.debug(salt_data['tag']) log.debug(salt_data) parts = salt_data['tag'].split('/') if len(parts) < 2: r...
def process(self, salt_data, token, opts): ''' Process events and publish data ''' log.debug('In process %s', threading.current_thread()) log.debug(salt_data['tag']) log.debug(salt_data) parts = salt_data['tag'].split('/') if len(parts) < 2: r...
[ "Process", "events", "and", "publish", "data" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/netapi/rest_tornado/event_processor.py#L204-L233
[ "def", "process", "(", "self", ",", "salt_data", ",", "token", ",", "opts", ")", ":", "log", ".", "debug", "(", "'In process %s'", ",", "threading", ".", "current_thread", "(", ")", ")", "log", ".", "debug", "(", "salt_data", "[", "'tag'", "]", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get
Get data from the mine based on the target, function and tgt_type This will actually run the function on all targeted minions (like publish.publish), as salt-ssh clients can't update the mine themselves. We will look for mine_functions in the roster, pillar, and master config, in that order, looking f...
salt/client/ssh/wrapper/mine.py
def get(tgt, fun, tgt_type='glob', roster='flat'): ''' Get data from the mine based on the target, function and tgt_type This will actually run the function on all targeted minions (like publish.publish), as salt-ssh clients can't update the mine themselves. We will look for mine_functions in the ...
def get(tgt, fun, tgt_type='glob', roster='flat'): ''' Get data from the mine based on the target, function and tgt_type This will actually run the function on all targeted minions (like publish.publish), as salt-ssh clients can't update the mine themselves. We will look for mine_functions in the ...
[ "Get", "data", "from", "the", "mine", "based", "on", "the", "target", "function", "and", "tgt_type" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/mine.py#L17-L63
[ "def", "get", "(", "tgt", ",", "fun", ",", "tgt_type", "=", "'glob'", ",", "roster", "=", "'flat'", ")", ":", "# Set up opts for the SSH object", "opts", "=", "copy", ".", "deepcopy", "(", "__context__", "[", "'master_opts'", "]", ")", "minopts", "=", "cop...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
wait_for
Call `func` at regular intervals and Waits until the given function returns a truthy value within the given timeout and returns that value. @param func: @type func: function @param timeout: @type timeout: int | float @param step: Interval at which we should check for the value @type step: i...
salt/utils/timeout.py
def wait_for(func, timeout=10, step=1, default=None, func_args=(), func_kwargs=None): ''' Call `func` at regular intervals and Waits until the given function returns a truthy value within the given timeout and returns that value. @param func: @type func: function @param timeout: @type timeo...
def wait_for(func, timeout=10, step=1, default=None, func_args=(), func_kwargs=None): ''' Call `func` at regular intervals and Waits until the given function returns a truthy value within the given timeout and returns that value. @param func: @type func: function @param timeout: @type timeo...
[ "Call", "func", "at", "regular", "intervals", "and", "Waits", "until", "the", "given", "function", "returns", "a", "truthy", "value", "within", "the", "given", "timeout", "and", "returns", "that", "value", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/timeout.py#L12-L50
[ "def", "wait_for", "(", "func", ",", "timeout", "=", "10", ",", "step", "=", "1", ",", "default", "=", "None", ",", "func_args", "=", "(", ")", ",", "func_kwargs", "=", "None", ")", ":", "if", "func_kwargs", "is", "None", ":", "func_kwargs", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_enabled
Return a list of service that are enabled on boot CLI Example: .. code-block:: bash salt '*' service.get_enabled
salt/modules/debian_service.py
def get_enabled(): ''' Return a list of service that are enabled on boot CLI Example: .. code-block:: bash salt '*' service.get_enabled ''' prefix = '/etc/rc[S{0}].d/S'.format(_get_runlevel()) ret = set() lines = glob.glob('{0}*'.format(prefix)) for line in lines: ...
def get_enabled(): ''' Return a list of service that are enabled on boot CLI Example: .. code-block:: bash salt '*' service.get_enabled ''' prefix = '/etc/rc[S{0}].d/S'.format(_get_runlevel()) ret = set() lines = glob.glob('{0}*'.format(prefix)) for line in lines: ...
[ "Return", "a", "list", "of", "service", "that", "are", "enabled", "on", "boot" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debian_service.py#L76-L91
[ "def", "get_enabled", "(", ")", ":", "prefix", "=", "'/etc/rc[S{0}].d/S'", ".", "format", "(", "_get_runlevel", "(", ")", ")", "ret", "=", "set", "(", ")", "lines", "=", "glob", ".", "glob", "(", "'{0}*'", ".", "format", "(", "prefix", ")", ")", "for...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_all
Return all available boot services CLI Example: .. code-block:: bash salt '*' service.get_all
salt/modules/debian_service.py
def get_all(): ''' Return all available boot services CLI Example: .. code-block:: bash salt '*' service.get_all ''' ret = set() lines = glob.glob('/etc/init.d/*') for line in lines: service = line.split('/etc/init.d/')[1] # Remove README. If it's an enabled s...
def get_all(): ''' Return all available boot services CLI Example: .. code-block:: bash salt '*' service.get_all ''' ret = set() lines = glob.glob('/etc/init.d/*') for line in lines: service = line.split('/etc/init.d/')[1] # Remove README. If it's an enabled s...
[ "Return", "all", "available", "boot", "services" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debian_service.py#L136-L153
[ "def", "get_all", "(", ")", ":", "ret", "=", "set", "(", ")", "lines", "=", "glob", ".", "glob", "(", "'/etc/init.d/*'", ")", "for", "line", "in", "lines", ":", "service", "=", "line", ".", "split", "(", "'/etc/init.d/'", ")", "[", "1", "]", "# Rem...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
enable
Enable the named service to start at boot CLI Example: .. code-block:: bash salt '*' service.enable <service name>
salt/modules/debian_service.py
def enable(name, **kwargs): ''' Enable the named service to start at boot CLI Example: .. code-block:: bash salt '*' service.enable <service name> ''' osmajor = _osrel()[0] if osmajor < '6': cmd = 'update-rc.d -f {0} defaults 99'.format(_cmd_quote(name)) else: ...
def enable(name, **kwargs): ''' Enable the named service to start at boot CLI Example: .. code-block:: bash salt '*' service.enable <service name> ''' osmajor = _osrel()[0] if osmajor < '6': cmd = 'update-rc.d -f {0} defaults 99'.format(_cmd_quote(name)) else: ...
[ "Enable", "the", "named", "service", "to", "start", "at", "boot" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debian_service.py#L273-L295
[ "def", "enable", "(", "name", ",", "*", "*", "kwargs", ")", ":", "osmajor", "=", "_osrel", "(", ")", "[", "0", "]", "if", "osmajor", "<", "'6'", ":", "cmd", "=", "'update-rc.d -f {0} defaults 99'", ".", "format", "(", "_cmd_quote", "(", "name", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
disable
Disable the named service to start at boot CLI Example: .. code-block:: bash salt '*' service.disable <service name>
salt/modules/debian_service.py
def disable(name, **kwargs): ''' Disable the named service to start at boot CLI Example: .. code-block:: bash salt '*' service.disable <service name> ''' osmajor = _osrel()[0] if osmajor < '6': cmd = 'update-rc.d -f {0} remove'.format(name) else: cmd = 'update-...
def disable(name, **kwargs): ''' Disable the named service to start at boot CLI Example: .. code-block:: bash salt '*' service.disable <service name> ''' osmajor = _osrel()[0] if osmajor < '6': cmd = 'update-rc.d -f {0} remove'.format(name) else: cmd = 'update-...
[ "Disable", "the", "named", "service", "to", "start", "at", "boot" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debian_service.py#L298-L313
[ "def", "disable", "(", "name", ",", "*", "*", "kwargs", ")", ":", "osmajor", "=", "_osrel", "(", ")", "[", "0", "]", "if", "osmajor", "<", "'6'", ":", "cmd", "=", "'update-rc.d -f {0} remove'", ".", "format", "(", "name", ")", "else", ":", "cmd", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_kwargs
get connection args
salt/modules/keystone.py
def _get_kwargs(profile=None, **connection_args): ''' get connection args ''' if profile: prefix = profile + ":keystone." else: prefix = "keystone." def get(key, default=None): ''' look in connection_args first, then default to config file ''' ret...
def _get_kwargs(profile=None, **connection_args): ''' get connection args ''' if profile: prefix = profile + ":keystone." else: prefix = "keystone." def get(key, default=None): ''' look in connection_args first, then default to config file ''' ret...
[ "get", "connection", "args" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L94-L135
[ "def", "_get_kwargs", "(", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "if", "profile", ":", "prefix", "=", "profile", "+", "\":keystone.\"", "else", ":", "prefix", "=", "\"keystone.\"", "def", "get", "(", "key", ",", "default", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
api_version
Returns the API version derived from endpoint's response. CLI Example: .. code-block:: bash salt '*' keystone.api_version
salt/modules/keystone.py
def api_version(profile=None, **connection_args): ''' Returns the API version derived from endpoint's response. CLI Example: .. code-block:: bash salt '*' keystone.api_version ''' kwargs = _get_kwargs(profile=profile, **connection_args) auth_url = kwargs.get('auth_url', kwargs.get...
def api_version(profile=None, **connection_args): ''' Returns the API version derived from endpoint's response. CLI Example: .. code-block:: bash salt '*' keystone.api_version ''' kwargs = _get_kwargs(profile=profile, **connection_args) auth_url = kwargs.get('auth_url', kwargs.get...
[ "Returns", "the", "API", "version", "derived", "from", "endpoint", "s", "response", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L138-L154
[ "def", "api_version", "(", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kwargs", "=", "_get_kwargs", "(", "profile", "=", "profile", ",", "*", "*", "connection_args", ")", "auth_url", "=", "kwargs", ".", "get", "(", "'auth_url'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
auth
Set up keystone credentials. Only intended to be used within Keystone-enabled modules. CLI Example: .. code-block:: bash salt '*' keystone.auth
salt/modules/keystone.py
def auth(profile=None, **connection_args): ''' Set up keystone credentials. Only intended to be used within Keystone-enabled modules. CLI Example: .. code-block:: bash salt '*' keystone.auth ''' __utils__['versions.warn_until']( 'Neon', ( 'The keystone modu...
def auth(profile=None, **connection_args): ''' Set up keystone credentials. Only intended to be used within Keystone-enabled modules. CLI Example: .. code-block:: bash salt '*' keystone.auth ''' __utils__['versions.warn_until']( 'Neon', ( 'The keystone modu...
[ "Set", "up", "keystone", "credentials", ".", "Only", "intended", "to", "be", "used", "within", "Keystone", "-", "enabled", "modules", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L157-L192
[ "def", "auth", "(", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "__utils__", "[", "'versions.warn_until'", "]", "(", "'Neon'", ",", "(", "'The keystone module has been deprecated and will be removed in {version}. '", "'Please update to using the key...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ec2_credentials_create
Create EC2-compatible credentials for user per tenant CLI Examples: .. code-block:: bash salt '*' keystone.ec2_credentials_create name=admin tenant=admin salt '*' keystone.ec2_credentials_create \ user_id=c965f79c4f864eaaa9c3b41904e67082 \ tenant_id=722787eb540849158668370dc6...
salt/modules/keystone.py
def ec2_credentials_create(user_id=None, name=None, tenant_id=None, tenant=None, profile=None, **connection_args): ''' Create EC2-compatible credentials for user per tenant CLI Examples: .. code-block:: bash salt '*' keystone.ec2_credentia...
def ec2_credentials_create(user_id=None, name=None, tenant_id=None, tenant=None, profile=None, **connection_args): ''' Create EC2-compatible credentials for user per tenant CLI Examples: .. code-block:: bash salt '*' keystone.ec2_credentia...
[ "Create", "EC2", "-", "compatible", "credentials", "for", "user", "per", "tenant" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L195-L229
[ "def", "ec2_credentials_create", "(", "user_id", "=", "None", ",", "name", "=", "None", ",", "tenant_id", "=", "None", ",", "tenant", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "pro...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ec2_credentials_delete
Delete EC2-compatible credentials CLI Examples: .. code-block:: bash salt '*' keystone.ec2_credentials_delete \ 860f8c2c38ca4fab989f9bc56a061a64 access_key=5f66d2f24f604b8bb9cd28886106f442 salt '*' keystone.ec2_credentials_delete name=admin \ access_key=5f66d2f24f604b8bb9cd28...
salt/modules/keystone.py
def ec2_credentials_delete(user_id=None, name=None, access_key=None, profile=None, **connection_args): ''' Delete EC2-compatible credentials CLI Examples: .. code-block:: bash salt '*' keystone.ec2_credentials_delete \ 860f8c2c38ca4fab989f9bc56a061a64 access...
def ec2_credentials_delete(user_id=None, name=None, access_key=None, profile=None, **connection_args): ''' Delete EC2-compatible credentials CLI Examples: .. code-block:: bash salt '*' keystone.ec2_credentials_delete \ 860f8c2c38ca4fab989f9bc56a061a64 access...
[ "Delete", "EC2", "-", "compatible", "credentials" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L232-L255
[ "def", "ec2_credentials_delete", "(", "user_id", "=", "None", ",", "name", "=", "None", ",", "access_key", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "conn...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ec2_credentials_get
Return ec2_credentials for a user (keystone ec2-credentials-get) CLI Examples: .. code-block:: bash salt '*' keystone.ec2_credentials_get c965f79c4f864eaaa9c3b41904e67082 access=722787eb540849158668370 salt '*' keystone.ec2_credentials_get user_id=c965f79c4f864eaaa9c3b41904e67082 access=72278...
salt/modules/keystone.py
def ec2_credentials_get(user_id=None, name=None, access=None, profile=None, **connection_args): ''' Return ec2_credentials for a user (keystone ec2-credentials-get) CLI Examples: .. code-block:: bash salt '*' keystone.ec2_credentials_get c965f79c4f864eaaa9c3b41904e6708...
def ec2_credentials_get(user_id=None, name=None, access=None, profile=None, **connection_args): ''' Return ec2_credentials for a user (keystone ec2-credentials-get) CLI Examples: .. code-block:: bash salt '*' keystone.ec2_credentials_get c965f79c4f864eaaa9c3b41904e6708...
[ "Return", "ec2_credentials", "for", "a", "user", "(", "keystone", "ec2", "-", "credentials", "-", "get", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L258-L288
[ "def", "ec2_credentials_get", "(", "user_id", "=", "None", ",", "name", "=", "None", ",", "access", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ec2_credentials_list
Return a list of ec2_credentials for a specific user (keystone ec2-credentials-list) CLI Examples: .. code-block:: bash salt '*' keystone.ec2_credentials_list 298ce377245c4ec9b70e1c639c89e654 salt '*' keystone.ec2_credentials_list user_id=298ce377245c4ec9b70e1c639c89e654 salt '*' keys...
salt/modules/keystone.py
def ec2_credentials_list(user_id=None, name=None, profile=None, **connection_args): ''' Return a list of ec2_credentials for a specific user (keystone ec2-credentials-list) CLI Examples: .. code-block:: bash salt '*' keystone.ec2_credentials_list 298ce377245c4ec9b70e1...
def ec2_credentials_list(user_id=None, name=None, profile=None, **connection_args): ''' Return a list of ec2_credentials for a specific user (keystone ec2-credentials-list) CLI Examples: .. code-block:: bash salt '*' keystone.ec2_credentials_list 298ce377245c4ec9b70e1...
[ "Return", "a", "list", "of", "ec2_credentials", "for", "a", "specific", "user", "(", "keystone", "ec2", "-", "credentials", "-", "list", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L291-L318
[ "def", "ec2_credentials_list", "(", "user_id", "=", "None", ",", "name", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", "ret", "=", "{"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
endpoint_get
Return a specific endpoint (keystone endpoint-get) CLI Example: .. code-block:: bash salt 'v2' keystone.endpoint_get nova [region=RegionOne] salt 'v3' keystone.endpoint_get nova interface=admin [region=RegionOne]
salt/modules/keystone.py
def endpoint_get(service, region=None, profile=None, interface=None, **connection_args): ''' Return a specific endpoint (keystone endpoint-get) CLI Example: .. code-block:: bash salt 'v2' keystone.endpoint_get nova [region=RegionOne] salt 'v3' keystone.endpoint_get nova interface=adm...
def endpoint_get(service, region=None, profile=None, interface=None, **connection_args): ''' Return a specific endpoint (keystone endpoint-get) CLI Example: .. code-block:: bash salt 'v2' keystone.endpoint_get nova [region=RegionOne] salt 'v3' keystone.endpoint_get nova interface=adm...
[ "Return", "a", "specific", "endpoint", "(", "keystone", "endpoint", "-", "get", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L321-L349
[ "def", "endpoint_get", "(", "service", ",", "region", "=", "None", ",", "profile", "=", "None", ",", "interface", "=", "None", ",", "*", "*", "connection_args", ")", ":", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", "services", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
endpoint_list
Return a list of available endpoints (keystone endpoints-list) CLI Example: .. code-block:: bash salt '*' keystone.endpoint_list
salt/modules/keystone.py
def endpoint_list(profile=None, **connection_args): ''' Return a list of available endpoints (keystone endpoints-list) CLI Example: .. code-block:: bash salt '*' keystone.endpoint_list ''' kstone = auth(profile, **connection_args) ret = {} for endpoint in kstone.endpoints.lis...
def endpoint_list(profile=None, **connection_args): ''' Return a list of available endpoints (keystone endpoints-list) CLI Example: .. code-block:: bash salt '*' keystone.endpoint_list ''' kstone = auth(profile, **connection_args) ret = {} for endpoint in kstone.endpoints.lis...
[ "Return", "a", "list", "of", "available", "endpoints", "(", "keystone", "endpoints", "-", "list", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L352-L369
[ "def", "endpoint_list", "(", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", "ret", "=", "{", "}", "for", "endpoint", "in", "kstone", ".", "endpoints", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
train
endpoint_create
Create an endpoint for an Openstack service CLI Examples: .. code-block:: bash salt 'v2' keystone.endpoint_create nova 'http://public/url' 'http://internal/url' 'http://adminurl/url' region salt 'v3' keystone.endpoint_create nova url='http://public/url' interface='public' region='RegionOne'
salt/modules/keystone.py
def endpoint_create(service, publicurl=None, internalurl=None, adminurl=None, region=None, profile=None, url=None, interface=None, **connection_args): ''' Create an endpoint for an Openstack service CLI Examples: .. code-block:: bash salt 'v2' keystone.endpoint_create nova...
def endpoint_create(service, publicurl=None, internalurl=None, adminurl=None, region=None, profile=None, url=None, interface=None, **connection_args): ''' Create an endpoint for an Openstack service CLI Examples: .. code-block:: bash salt 'v2' keystone.endpoint_create nova...
[ "Create", "an", "endpoint", "for", "an", "Openstack", "service" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L372-L402
[ "def", "endpoint_create", "(", "service", ",", "publicurl", "=", "None", ",", "internalurl", "=", "None", ",", "adminurl", "=", "None", ",", "region", "=", "None", ",", "profile", "=", "None", ",", "url", "=", "None", ",", "interface", "=", "None", ","...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
endpoint_delete
Delete endpoints of an Openstack service CLI Examples: .. code-block:: bash salt 'v2' keystone.endpoint_delete nova [region=RegionOne] salt 'v3' keystone.endpoint_delete nova interface=admin [region=RegionOne]
salt/modules/keystone.py
def endpoint_delete(service, region=None, profile=None, interface=None, **connection_args): ''' Delete endpoints of an Openstack service CLI Examples: .. code-block:: bash salt 'v2' keystone.endpoint_delete nova [region=RegionOne] salt 'v3' keystone.endpoint_delete nova interface=adm...
def endpoint_delete(service, region=None, profile=None, interface=None, **connection_args): ''' Delete endpoints of an Openstack service CLI Examples: .. code-block:: bash salt 'v2' keystone.endpoint_delete nova [region=RegionOne] salt 'v3' keystone.endpoint_delete nova interface=adm...
[ "Delete", "endpoints", "of", "an", "Openstack", "service" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L405-L424
[ "def", "endpoint_delete", "(", "service", ",", "region", "=", "None", ",", "profile", "=", "None", ",", "interface", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
role_create
Create a named role. CLI Example: .. code-block:: bash salt '*' keystone.role_create admin
salt/modules/keystone.py
def role_create(name, profile=None, **connection_args): ''' Create a named role. CLI Example: .. code-block:: bash salt '*' keystone.role_create admin ''' kstone = auth(profile, **connection_args) if 'Error' not in role_get(name=name, profile=profile, **connection_args): ...
def role_create(name, profile=None, **connection_args): ''' Create a named role. CLI Example: .. code-block:: bash salt '*' keystone.role_create admin ''' kstone = auth(profile, **connection_args) if 'Error' not in role_get(name=name, profile=profile, **connection_args): ...
[ "Create", "a", "named", "role", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L427-L442
[ "def", "role_create", "(", "name", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", "if", "'Error'", "not", "in", "role_get", "(", "name", "=", "name"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
role_delete
Delete a role (keystone role-delete) CLI Examples: .. code-block:: bash salt '*' keystone.role_delete c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.role_delete role_id=c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.role_delete name=admin
salt/modules/keystone.py
def role_delete(role_id=None, name=None, profile=None, **connection_args): ''' Delete a role (keystone role-delete) CLI Examples: .. code-block:: bash salt '*' keystone.role_delete c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.role_delete role_id=c965f79c4f864eaa...
def role_delete(role_id=None, name=None, profile=None, **connection_args): ''' Delete a role (keystone role-delete) CLI Examples: .. code-block:: bash salt '*' keystone.role_delete c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.role_delete role_id=c965f79c4f864eaa...
[ "Delete", "a", "role", "(", "keystone", "role", "-", "delete", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L445-L475
[ "def", "role_delete", "(", "role_id", "=", "None", ",", "name", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", "if", "name", ":", "fo...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
role_get
Return a specific roles (keystone role-get) CLI Examples: .. code-block:: bash salt '*' keystone.role_get c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.role_get role_id=c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.role_get name=nova
salt/modules/keystone.py
def role_get(role_id=None, name=None, profile=None, **connection_args): ''' Return a specific roles (keystone role-get) CLI Examples: .. code-block:: bash salt '*' keystone.role_get c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.role_get role_id=c965f79c4f864eaaa9c3b41904e67082 ...
def role_get(role_id=None, name=None, profile=None, **connection_args): ''' Return a specific roles (keystone role-get) CLI Examples: .. code-block:: bash salt '*' keystone.role_get c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.role_get role_id=c965f79c4f864eaaa9c3b41904e67082 ...
[ "Return", "a", "specific", "roles", "(", "keystone", "role", "-", "get", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L478-L503
[ "def", "role_get", "(", "role_id", "=", "None", ",", "name", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", "ret", "=", "{", "}", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
role_list
Return a list of available roles (keystone role-list) CLI Example: .. code-block:: bash salt '*' keystone.role_list
salt/modules/keystone.py
def role_list(profile=None, **connection_args): ''' Return a list of available roles (keystone role-list) CLI Example: .. code-block:: bash salt '*' keystone.role_list ''' kstone = auth(profile, **connection_args) ret = {} for role in kstone.roles.list(): ret[role.name...
def role_list(profile=None, **connection_args): ''' Return a list of available roles (keystone role-list) CLI Example: .. code-block:: bash salt '*' keystone.role_list ''' kstone = auth(profile, **connection_args) ret = {} for role in kstone.roles.list(): ret[role.name...
[ "Return", "a", "list", "of", "available", "roles", "(", "keystone", "role", "-", "list", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L506-L522
[ "def", "role_list", "(", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", "ret", "=", "{", "}", "for", "role", "in", "kstone", ".", "roles", ".", "list",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
service_create
Add service to Keystone service catalog CLI Examples: .. code-block:: bash salt '*' keystone.service_create nova compute \ 'OpenStack Compute Service'
salt/modules/keystone.py
def service_create(name, service_type, description=None, profile=None, **connection_args): ''' Add service to Keystone service catalog CLI Examples: .. code-block:: bash salt '*' keystone.service_create nova compute \ 'OpenStack Compute Service' ''' kstone = auth(pr...
def service_create(name, service_type, description=None, profile=None, **connection_args): ''' Add service to Keystone service catalog CLI Examples: .. code-block:: bash salt '*' keystone.service_create nova compute \ 'OpenStack Compute Service' ''' kstone = auth(pr...
[ "Add", "service", "to", "Keystone", "service", "catalog" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L525-L539
[ "def", "service_create", "(", "name", ",", "service_type", ",", "description", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", "service", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
service_delete
Delete a service from Keystone service catalog CLI Examples: .. code-block:: bash salt '*' keystone.service_delete c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.service_delete name=nova
salt/modules/keystone.py
def service_delete(service_id=None, name=None, profile=None, **connection_args): ''' Delete a service from Keystone service catalog CLI Examples: .. code-block:: bash salt '*' keystone.service_delete c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.service_delete name=nova ''' ...
def service_delete(service_id=None, name=None, profile=None, **connection_args): ''' Delete a service from Keystone service catalog CLI Examples: .. code-block:: bash salt '*' keystone.service_delete c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.service_delete name=nova ''' ...
[ "Delete", "a", "service", "from", "Keystone", "service", "catalog" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L542-L558
[ "def", "service_delete", "(", "service_id", "=", "None", ",", "name", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", "if", "name", ":",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
service_get
Return a specific services (keystone service-get) CLI Examples: .. code-block:: bash salt '*' keystone.service_get c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.service_get service_id=c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.service_get name=nova
salt/modules/keystone.py
def service_get(service_id=None, name=None, profile=None, **connection_args): ''' Return a specific services (keystone service-get) CLI Examples: .. code-block:: bash salt '*' keystone.service_get c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.service_get service_id=c965f79c4f864e...
def service_get(service_id=None, name=None, profile=None, **connection_args): ''' Return a specific services (keystone service-get) CLI Examples: .. code-block:: bash salt '*' keystone.service_get c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.service_get service_id=c965f79c4f864e...
[ "Return", "a", "specific", "services", "(", "keystone", "service", "-", "get", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L561-L586
[ "def", "service_get", "(", "service_id", "=", "None", ",", "name", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", "ret", "=", "{", "}...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
service_list
Return a list of available services (keystone services-list) CLI Example: .. code-block:: bash salt '*' keystone.service_list
salt/modules/keystone.py
def service_list(profile=None, **connection_args): ''' Return a list of available services (keystone services-list) CLI Example: .. code-block:: bash salt '*' keystone.service_list ''' kstone = auth(profile, **connection_args) ret = {} for service in kstone.services.list(): ...
def service_list(profile=None, **connection_args): ''' Return a list of available services (keystone services-list) CLI Example: .. code-block:: bash salt '*' keystone.service_list ''' kstone = auth(profile, **connection_args) ret = {} for service in kstone.services.list(): ...
[ "Return", "a", "list", "of", "available", "services", "(", "keystone", "services", "-", "list", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L589-L605
[ "def", "service_list", "(", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", "ret", "=", "{", "}", "for", "service", "in", "kstone", ".", "services", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
tenant_create
Create a keystone tenant CLI Examples: .. code-block:: bash salt '*' keystone.tenant_create nova description='nova tenant' salt '*' keystone.tenant_create test enabled=False
salt/modules/keystone.py
def tenant_create(name, description=None, enabled=True, profile=None, **connection_args): ''' Create a keystone tenant CLI Examples: .. code-block:: bash salt '*' keystone.tenant_create nova description='nova tenant' salt '*' keystone.tenant_create test enabled=False...
def tenant_create(name, description=None, enabled=True, profile=None, **connection_args): ''' Create a keystone tenant CLI Examples: .. code-block:: bash salt '*' keystone.tenant_create nova description='nova tenant' salt '*' keystone.tenant_create test enabled=False...
[ "Create", "a", "keystone", "tenant" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L608-L622
[ "def", "tenant_create", "(", "name", ",", "description", "=", "None", ",", "enabled", "=", "True", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", "n...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
tenant_delete
Delete a tenant (keystone tenant-delete) CLI Examples: .. code-block:: bash salt '*' keystone.tenant_delete c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.tenant_delete tenant_id=c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.tenant_delete name=demo
salt/modules/keystone.py
def tenant_delete(tenant_id=None, name=None, profile=None, **connection_args): ''' Delete a tenant (keystone tenant-delete) CLI Examples: .. code-block:: bash salt '*' keystone.tenant_delete c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.tenant_delete tenant_id=c965f79c4f864eaaa9c...
def tenant_delete(tenant_id=None, name=None, profile=None, **connection_args): ''' Delete a tenant (keystone tenant-delete) CLI Examples: .. code-block:: bash salt '*' keystone.tenant_delete c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.tenant_delete tenant_id=c965f79c4f864eaaa9c...
[ "Delete", "a", "tenant", "(", "keystone", "tenant", "-", "delete", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L661-L686
[ "def", "tenant_delete", "(", "tenant_id", "=", "None", ",", "name", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", "if", "name", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
project_delete
Delete a project (keystone project-delete). Overrides keystone tenant-delete form api V2. For keystone api V3 only. .. versionadded:: 2016.11.0 project_id The project id. name The project name. profile Configuration profile - if configuration for multiple openstack accoun...
salt/modules/keystone.py
def project_delete(project_id=None, name=None, profile=None, **connection_args): ''' Delete a project (keystone project-delete). Overrides keystone tenant-delete form api V2. For keystone api V3 only. .. versionadded:: 2016.11.0 project_id The project id. name The project name...
def project_delete(project_id=None, name=None, profile=None, **connection_args): ''' Delete a project (keystone project-delete). Overrides keystone tenant-delete form api V2. For keystone api V3 only. .. versionadded:: 2016.11.0 project_id The project id. name The project name...
[ "Delete", "a", "project", "(", "keystone", "project", "-", "delete", ")", ".", "Overrides", "keystone", "tenant", "-", "delete", "form", "api", "V2", ".", "For", "keystone", "api", "V3", "only", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L689-L718
[ "def", "project_delete", "(", "project_id", "=", "None", ",", "name", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", "if", "_OS_IDENTITY_API_VERSION", ">"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
tenant_get
Return a specific tenants (keystone tenant-get) CLI Examples: .. code-block:: bash salt '*' keystone.tenant_get c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.tenant_get tenant_id=c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.tenant_get name=nova
salt/modules/keystone.py
def tenant_get(tenant_id=None, name=None, profile=None, **connection_args): ''' Return a specific tenants (keystone tenant-get) CLI Examples: .. code-block:: bash salt '*' keystone.tenant_get c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.tenant_get tenant_id=c965f7...
def tenant_get(tenant_id=None, name=None, profile=None, **connection_args): ''' Return a specific tenants (keystone tenant-get) CLI Examples: .. code-block:: bash salt '*' keystone.tenant_get c965f79c4f864eaaa9c3b41904e67082 salt '*' keystone.tenant_get tenant_id=c965f7...
[ "Return", "a", "specific", "tenants", "(", "keystone", "tenant", "-", "get", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/keystone.py#L721-L748
[ "def", "tenant_get", "(", "tenant_id", "=", "None", ",", "name", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "kstone", "=", "auth", "(", "profile", ",", "*", "*", "connection_args", ")", "ret", "=", "{", "}",...
e8541fd6e744ab0df786c0f76102e41631f45d46