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
clear_triggers
r''' Remove all triggers from the task. :param str name: The name of the task from which to clear all triggers. :param str location: A string value representing the location of the task. Default is '\\' which is the root for the task scheduler (C:\Windows\System32\tasks). :return: Tru...
salt/modules/win_task.py
def clear_triggers(name, location='\\'): r''' Remove all triggers from the task. :param str name: The name of the task from which to clear all triggers. :param str location: A string value representing the location of the task. Default is '\\' which is the root for the task scheduler (...
def clear_triggers(name, location='\\'): r''' Remove all triggers from the task. :param str name: The name of the task from which to clear all triggers. :param str location: A string value representing the location of the task. Default is '\\' which is the root for the task scheduler (...
[ "r", "Remove", "all", "triggers", "from", "the", "task", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_task.py#L2205-L2246
[ "def", "clear_triggers", "(", "name", ",", "location", "=", "'\\\\'", ")", ":", "# Check for existing task", "if", "name", "not", "in", "list_tasks", "(", "location", ")", ":", "return", "'{0} not found in {1}'", ".", "format", "(", "name", ",", "location", ")...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_conn
Get a connection to CouchDB
salt/sdb/couchdb.py
def _get_conn(profile): ''' Get a connection to CouchDB ''' DEFAULT_BASE_URL = _construct_uri(profile) or 'http://localhost:5984' server = couchdb.Server() if profile['database'] not in server: server.create(profile['database']) return server
def _get_conn(profile): ''' Get a connection to CouchDB ''' DEFAULT_BASE_URL = _construct_uri(profile) or 'http://localhost:5984' server = couchdb.Server() if profile['database'] not in server: server.create(profile['database']) return server
[ "Get", "a", "connection", "to", "CouchDB" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/sdb/couchdb.py#L79-L88
[ "def", "_get_conn", "(", "profile", ")", ":", "DEFAULT_BASE_URL", "=", "_construct_uri", "(", "profile", ")", "or", "'http://localhost:5984'", "server", "=", "couchdb", ".", "Server", "(", ")", "if", "profile", "[", "'database'", "]", "not", "in", "server", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_
Set a key/value pair in couchdb
salt/sdb/couchdb.py
def set_(key, value, profile=None): ''' Set a key/value pair in couchdb ''' db = _get_db(profile) return db.save({'_id': uuid4().hex, key: value})
def set_(key, value, profile=None): ''' Set a key/value pair in couchdb ''' db = _get_db(profile) return db.save({'_id': uuid4().hex, key: value})
[ "Set", "a", "key", "/", "value", "pair", "in", "couchdb" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/sdb/couchdb.py#L91-L96
[ "def", "set_", "(", "key", ",", "value", ",", "profile", "=", "None", ")", ":", "db", "=", "_get_db", "(", "profile", ")", "return", "db", ".", "save", "(", "{", "'_id'", ":", "uuid4", "(", ")", ".", "hex", ",", "key", ":", "value", "}", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
gen_key
Generate a key for use with salt-ssh
salt/client/ssh/shell.py
def gen_key(path): ''' Generate a key for use with salt-ssh ''' cmd = 'ssh-keygen -P "" -f {0} -t rsa -q'.format(path) if not os.path.isdir(os.path.dirname(path)): os.makedirs(os.path.dirname(path)) subprocess.call(cmd, shell=True)
def gen_key(path): ''' Generate a key for use with salt-ssh ''' cmd = 'ssh-keygen -P "" -f {0} -t rsa -q'.format(path) if not os.path.isdir(os.path.dirname(path)): os.makedirs(os.path.dirname(path)) subprocess.call(cmd, shell=True)
[ "Generate", "a", "key", "for", "use", "with", "salt", "-", "ssh" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/shell.py#L42-L49
[ "def", "gen_key", "(", "path", ")", ":", "cmd", "=", "'ssh-keygen -P \"\" -f {0} -t rsa -q'", ".", "format", "(", "path", ")", "if", "not", "os", ".", "path", ".", "isdir", "(", "os", ".", "path", ".", "dirname", "(", "path", ")", ")", ":", "os", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
gen_shell
Return the correct shell interface for the target system
salt/client/ssh/shell.py
def gen_shell(opts, **kwargs): ''' Return the correct shell interface for the target system ''' if kwargs['winrm']: try: import saltwinshell shell = saltwinshell.Shell(opts, **kwargs) except ImportError: log.error('The saltwinshell library is not avail...
def gen_shell(opts, **kwargs): ''' Return the correct shell interface for the target system ''' if kwargs['winrm']: try: import saltwinshell shell = saltwinshell.Shell(opts, **kwargs) except ImportError: log.error('The saltwinshell library is not avail...
[ "Return", "the", "correct", "shell", "interface", "for", "the", "target", "system" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/shell.py#L52-L65
[ "def", "gen_shell", "(", "opts", ",", "*", "*", "kwargs", ")", ":", "if", "kwargs", "[", "'winrm'", "]", ":", "try", ":", "import", "saltwinshell", "shell", "=", "saltwinshell", ".", "Shell", "(", "opts", ",", "*", "*", "kwargs", ")", "except", "Impo...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Shell.get_error
Parse out an error and return a targeted error string
salt/client/ssh/shell.py
def get_error(self, errstr): ''' Parse out an error and return a targeted error string ''' for line in errstr.split('\n'): if line.startswith('ssh:'): return line if line.startswith('Pseudo-terminal'): continue if 'to th...
def get_error(self, errstr): ''' Parse out an error and return a targeted error string ''' for line in errstr.split('\n'): if line.startswith('ssh:'): return line if line.startswith('Pseudo-terminal'): continue if 'to th...
[ "Parse", "out", "an", "error", "and", "return", "a", "targeted", "error", "string" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/shell.py#L106-L118
[ "def", "get_error", "(", "self", ",", "errstr", ")", ":", "for", "line", "in", "errstr", ".", "split", "(", "'\\n'", ")", ":", "if", "line", ".", "startswith", "(", "'ssh:'", ")", ":", "return", "line", "if", "line", ".", "startswith", "(", "'Pseudo-...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Shell._key_opts
Return options for the ssh command base for Salt to call
salt/client/ssh/shell.py
def _key_opts(self): ''' Return options for the ssh command base for Salt to call ''' options = [ 'KbdInteractiveAuthentication=no', ] if self.passwd: options.append('PasswordAuthentication=yes') else: options....
def _key_opts(self): ''' Return options for the ssh command base for Salt to call ''' options = [ 'KbdInteractiveAuthentication=no', ] if self.passwd: options.append('PasswordAuthentication=yes') else: options....
[ "Return", "options", "for", "the", "ssh", "command", "base", "for", "Salt", "to", "call" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/shell.py#L120-L154
[ "def", "_key_opts", "(", "self", ")", ":", "options", "=", "[", "'KbdInteractiveAuthentication=no'", ",", "]", "if", "self", ".", "passwd", ":", "options", ".", "append", "(", "'PasswordAuthentication=yes'", ")", "else", ":", "options", ".", "append", "(", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Shell._passwd_opts
Return options to pass to ssh
salt/client/ssh/shell.py
def _passwd_opts(self): ''' Return options to pass to ssh ''' # TODO ControlMaster does not work without ControlPath # user could take advantage of it if they set ControlPath in their # ssh config. Also, ControlPersist not widely available. options = ['ControlMas...
def _passwd_opts(self): ''' Return options to pass to ssh ''' # TODO ControlMaster does not work without ControlPath # user could take advantage of it if they set ControlPath in their # ssh config. Also, ControlPersist not widely available. options = ['ControlMas...
[ "Return", "options", "to", "pass", "to", "ssh" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/shell.py#L156-L194
[ "def", "_passwd_opts", "(", "self", ")", ":", "# TODO ControlMaster does not work without ControlPath", "# user could take advantage of it if they set ControlPath in their", "# ssh config. Also, ControlPersist not widely available.", "options", "=", "[", "'ControlMaster=auto'", ",", "'S...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Shell._copy_id_str_old
Return the string to execute ssh-copy-id
salt/client/ssh/shell.py
def _copy_id_str_old(self): ''' Return the string to execute ssh-copy-id ''' if self.passwd: # Using single quotes prevents shell expansion and # passwords containing '$' return "{0} {1} '{2} -p {3} {4} {5}@{6}'".format( 'ssh-copy-i...
def _copy_id_str_old(self): ''' Return the string to execute ssh-copy-id ''' if self.passwd: # Using single quotes prevents shell expansion and # passwords containing '$' return "{0} {1} '{2} -p {3} {4} {5}@{6}'".format( 'ssh-copy-i...
[ "Return", "the", "string", "to", "execute", "ssh", "-", "copy", "-", "id" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/shell.py#L200-L215
[ "def", "_copy_id_str_old", "(", "self", ")", ":", "if", "self", ".", "passwd", ":", "# Using single quotes prevents shell expansion and", "# passwords containing '$'", "return", "\"{0} {1} '{2} -p {3} {4} {5}@{6}'\"", ".", "format", "(", "'ssh-copy-id'", ",", "'-i {0}.pub'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Shell.copy_id
Execute ssh-copy-id to plant the id file on the target
salt/client/ssh/shell.py
def copy_id(self): ''' Execute ssh-copy-id to plant the id file on the target ''' stdout, stderr, retcode = self._run_cmd(self._copy_id_str_old()) if salt.defaults.exitcodes.EX_OK != retcode and 'Usage' in stderr: stdout, stderr, retcode = self._run_cmd(self._copy_id_...
def copy_id(self): ''' Execute ssh-copy-id to plant the id file on the target ''' stdout, stderr, retcode = self._run_cmd(self._copy_id_str_old()) if salt.defaults.exitcodes.EX_OK != retcode and 'Usage' in stderr: stdout, stderr, retcode = self._run_cmd(self._copy_id_...
[ "Execute", "ssh", "-", "copy", "-", "id", "to", "plant", "the", "id", "file", "on", "the", "target" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/shell.py#L235-L242
[ "def", "copy_id", "(", "self", ")", ":", "stdout", ",", "stderr", ",", "retcode", "=", "self", ".", "_run_cmd", "(", "self", ".", "_copy_id_str_old", "(", ")", ")", "if", "salt", ".", "defaults", ".", "exitcodes", ".", "EX_OK", "!=", "retcode", "and", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Shell._cmd_str
Return the cmd string to execute
salt/client/ssh/shell.py
def _cmd_str(self, cmd, ssh='ssh'): ''' Return the cmd string to execute ''' # TODO: if tty, then our SSH_SHIM cannot be supplied from STDIN Will # need to deliver the SHIM to the remote host and execute it there command = [ssh] if ssh != 'scp': comm...
def _cmd_str(self, cmd, ssh='ssh'): ''' Return the cmd string to execute ''' # TODO: if tty, then our SSH_SHIM cannot be supplied from STDIN Will # need to deliver the SHIM to the remote host and execute it there command = [ssh] if ssh != 'scp': comm...
[ "Return", "the", "cmd", "string", "to", "execute" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/shell.py#L244-L267
[ "def", "_cmd_str", "(", "self", ",", "cmd", ",", "ssh", "=", "'ssh'", ")", ":", "# TODO: if tty, then our SSH_SHIM cannot be supplied from STDIN Will", "# need to deliver the SHIM to the remote host and execute it there", "command", "=", "[", "ssh", "]", "if", "ssh", "!=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Shell._old_run_cmd
Cleanly execute the command string
salt/client/ssh/shell.py
def _old_run_cmd(self, cmd): ''' Cleanly execute the command string ''' try: proc = subprocess.Popen( cmd, shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE, ) data = proc.commun...
def _old_run_cmd(self, cmd): ''' Cleanly execute the command string ''' try: proc = subprocess.Popen( cmd, shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE, ) data = proc.commun...
[ "Cleanly", "execute", "the", "command", "string" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/shell.py#L269-L284
[ "def", "_old_run_cmd", "(", "self", ",", "cmd", ")", ":", "try", ":", "proc", "=", "subprocess", ".", "Popen", "(", "cmd", ",", "shell", "=", "True", ",", "stderr", "=", "subprocess", ".", "PIPE", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Shell._run_nb_cmd
cmd iterator
salt/client/ssh/shell.py
def _run_nb_cmd(self, cmd): ''' cmd iterator ''' try: proc = salt.utils.nb_popen.NonBlockingPopen( cmd, shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE, ) while True: ...
def _run_nb_cmd(self, cmd): ''' cmd iterator ''' try: proc = salt.utils.nb_popen.NonBlockingPopen( cmd, shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE, ) while True: ...
[ "cmd", "iterator" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/shell.py#L286-L308
[ "def", "_run_nb_cmd", "(", "self", ",", "cmd", ")", ":", "try", ":", "proc", "=", "salt", ".", "utils", ".", "nb_popen", ".", "NonBlockingPopen", "(", "cmd", ",", "shell", "=", "True", ",", "stderr", "=", "subprocess", ".", "PIPE", ",", "stdout", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Shell.exec_nb_cmd
Yield None until cmd finished
salt/client/ssh/shell.py
def exec_nb_cmd(self, cmd): ''' Yield None until cmd finished ''' r_out = [] r_err = [] rcode = None cmd = self._cmd_str(cmd) logmsg = 'Executing non-blocking command: {0}'.format(cmd) if self.passwd: logmsg = logmsg.replace(self.passw...
def exec_nb_cmd(self, cmd): ''' Yield None until cmd finished ''' r_out = [] r_err = [] rcode = None cmd = self._cmd_str(cmd) logmsg = 'Executing non-blocking command: {0}'.format(cmd) if self.passwd: logmsg = logmsg.replace(self.passw...
[ "Yield", "None", "until", "cmd", "finished" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/shell.py#L310-L330
[ "def", "exec_nb_cmd", "(", "self", ",", "cmd", ")", ":", "r_out", "=", "[", "]", "r_err", "=", "[", "]", "rcode", "=", "None", "cmd", "=", "self", ".", "_cmd_str", "(", "cmd", ")", "logmsg", "=", "'Executing non-blocking command: {0}'", ".", "format", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Shell.exec_cmd
Execute a remote command
salt/client/ssh/shell.py
def exec_cmd(self, cmd): ''' Execute a remote command ''' cmd = self._cmd_str(cmd) logmsg = 'Executing command: {0}'.format(cmd) if self.passwd: logmsg = logmsg.replace(self.passwd, ('*' * 6)) if 'decode("base64")' in logmsg or 'base64.b64decode(' in ...
def exec_cmd(self, cmd): ''' Execute a remote command ''' cmd = self._cmd_str(cmd) logmsg = 'Executing command: {0}'.format(cmd) if self.passwd: logmsg = logmsg.replace(self.passwd, ('*' * 6)) if 'decode("base64")' in logmsg or 'base64.b64decode(' in ...
[ "Execute", "a", "remote", "command" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/shell.py#L332-L348
[ "def", "exec_cmd", "(", "self", ",", "cmd", ")", ":", "cmd", "=", "self", ".", "_cmd_str", "(", "cmd", ")", "logmsg", "=", "'Executing command: {0}'", ".", "format", "(", "cmd", ")", "if", "self", ".", "passwd", ":", "logmsg", "=", "logmsg", ".", "re...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Shell.send
scp a file or files to a remote system
salt/client/ssh/shell.py
def send(self, local, remote, makedirs=False): ''' scp a file or files to a remote system ''' if makedirs: self.exec_cmd('mkdir -p {0}'.format(os.path.dirname(remote))) # scp needs [<ipv6} host = self.host if ':' in host: host = '[{0}]'.fo...
def send(self, local, remote, makedirs=False): ''' scp a file or files to a remote system ''' if makedirs: self.exec_cmd('mkdir -p {0}'.format(os.path.dirname(remote))) # scp needs [<ipv6} host = self.host if ':' in host: host = '[{0}]'.fo...
[ "scp", "a", "file", "or", "files", "to", "a", "remote", "system" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/shell.py#L350-L370
[ "def", "send", "(", "self", ",", "local", ",", "remote", ",", "makedirs", "=", "False", ")", ":", "if", "makedirs", ":", "self", ".", "exec_cmd", "(", "'mkdir -p {0}'", ".", "format", "(", "os", ".", "path", ".", "dirname", "(", "remote", ")", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
Shell._run_cmd
Execute a shell command via VT. This is blocking and assumes that ssh is being run
salt/client/ssh/shell.py
def _run_cmd(self, cmd, key_accept=False, passwd_retries=3): ''' Execute a shell command via VT. This is blocking and assumes that ssh is being run ''' if not cmd: return '', 'No command or passphrase', 245 term = salt.utils.vt.Terminal( cmd, ...
def _run_cmd(self, cmd, key_accept=False, passwd_retries=3): ''' Execute a shell command via VT. This is blocking and assumes that ssh is being run ''' if not cmd: return '', 'No command or passphrase', 245 term = salt.utils.vt.Terminal( cmd, ...
[ "Execute", "a", "shell", "command", "via", "VT", ".", "This", "is", "blocking", "and", "assumes", "that", "ssh", "is", "being", "run" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/shell.py#L372-L441
[ "def", "_run_cmd", "(", "self", ",", "cmd", ",", "key_accept", "=", "False", ",", "passwd_retries", "=", "3", ")", ":", "if", "not", "cmd", ":", "return", "''", ",", "'No command or passphrase'", ",", "245", "term", "=", "salt", ".", "utils", ".", "vt"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
setup_handlers
sets up the sentry handler
salt/log/handlers/sentry_mod.py
def setup_handlers(): ''' sets up the sentry handler ''' __grains__ = salt.loader.grains(__opts__) __salt__ = salt.loader.minion_mods(__opts__) if 'sentry_handler' not in __opts__: log.debug('No \'sentry_handler\' key was found in the configuration') return False options = {}...
def setup_handlers(): ''' sets up the sentry handler ''' __grains__ = salt.loader.grains(__opts__) __salt__ = salt.loader.minion_mods(__opts__) if 'sentry_handler' not in __opts__: log.debug('No \'sentry_handler\' key was found in the configuration') return False options = {}...
[ "sets", "up", "the", "sentry", "handler" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/log/handlers/sentry_mod.py#L120-L235
[ "def", "setup_handlers", "(", ")", ":", "__grains__", "=", "salt", ".", "loader", ".", "grains", "(", "__opts__", ")", "__salt__", "=", "salt", ".", "loader", ".", "minion_mods", "(", "__opts__", ")", "if", "'sentry_handler'", "not", "in", "__opts__", ":",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_config
Return a value for 'name' from master config file options or defaults.
salt/auth/ldap.py
def _config(key, mandatory=True, opts=None): ''' Return a value for 'name' from master config file options or defaults. ''' try: if opts: value = opts['auth.ldap.{0}'.format(key)] else: value = __opts__['auth.ldap.{0}'.format(key)] except KeyError: try...
def _config(key, mandatory=True, opts=None): ''' Return a value for 'name' from master config file options or defaults. ''' try: if opts: value = opts['auth.ldap.{0}'.format(key)] else: value = __opts__['auth.ldap.{0}'.format(key)] except KeyError: try...
[ "Return", "a", "value", "for", "name", "from", "master", "config", "file", "options", "or", "defaults", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/ldap.py#L51-L68
[ "def", "_config", "(", "key", ",", "mandatory", "=", "True", ",", "opts", "=", "None", ")", ":", "try", ":", "if", "opts", ":", "value", "=", "opts", "[", "'auth.ldap.{0}'", ".", "format", "(", "key", ")", "]", "else", ":", "value", "=", "__opts__"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_render_template
Render config template, substituting username where found.
salt/auth/ldap.py
def _render_template(param, username): ''' Render config template, substituting username where found. ''' env = Environment() template = env.from_string(param) variables = {'username': username} return template.render(variables)
def _render_template(param, username): ''' Render config template, substituting username where found. ''' env = Environment() template = env.from_string(param) variables = {'username': username} return template.render(variables)
[ "Render", "config", "template", "substituting", "username", "where", "found", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/ldap.py#L71-L78
[ "def", "_render_template", "(", "param", ",", "username", ")", ":", "env", "=", "Environment", "(", ")", "template", "=", "env", ".", "from_string", "(", "param", ")", "variables", "=", "{", "'username'", ":", "username", "}", "return", "template", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_bind_for_search
Bind with binddn and bindpw only for searching LDAP :param anonymous: Try binding anonymously :param opts: Pass in when __opts__ is not available :return: LDAPConnection object
salt/auth/ldap.py
def _bind_for_search(anonymous=False, opts=None): ''' Bind with binddn and bindpw only for searching LDAP :param anonymous: Try binding anonymously :param opts: Pass in when __opts__ is not available :return: LDAPConnection object ''' # Get config params; create connection dictionary con...
def _bind_for_search(anonymous=False, opts=None): ''' Bind with binddn and bindpw only for searching LDAP :param anonymous: Try binding anonymously :param opts: Pass in when __opts__ is not available :return: LDAPConnection object ''' # Get config params; create connection dictionary con...
[ "Bind", "with", "binddn", "and", "bindpw", "only", "for", "searching", "LDAP", ":", "param", "anonymous", ":", "Try", "binding", "anonymously", ":", "param", "opts", ":", "Pass", "in", "when", "__opts__", "is", "not", "available", ":", "return", ":", "LDAP...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/ldap.py#L140-L183
[ "def", "_bind_for_search", "(", "anonymous", "=", "False", ",", "opts", "=", "None", ")", ":", "# Get config params; create connection dictionary", "connargs", "=", "{", "}", "# config params (auth.ldap.*)", "params", "=", "{", "'mandatory'", ":", "[", "'uri'", ",",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_bind
Authenticate via an LDAP bind
salt/auth/ldap.py
def _bind(username, password, anonymous=False, opts=None): ''' Authenticate via an LDAP bind ''' # Get config params; create connection dictionary basedn = _config('basedn', opts=opts) scope = _config('scope', opts=opts) connargs = {} # config params (auth.ldap.*) params = { ...
def _bind(username, password, anonymous=False, opts=None): ''' Authenticate via an LDAP bind ''' # Get config params; create connection dictionary basedn = _config('basedn', opts=opts) scope = _config('scope', opts=opts) connargs = {} # config params (auth.ldap.*) params = { ...
[ "Authenticate", "via", "an", "LDAP", "bind" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/ldap.py#L186-L290
[ "def", "_bind", "(", "username", ",", "password", ",", "anonymous", "=", "False", ",", "opts", "=", "None", ")", ":", "# Get config params; create connection dictionary", "basedn", "=", "_config", "(", "'basedn'", ",", "opts", "=", "opts", ")", "scope", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
auth
Simple LDAP auth
salt/auth/ldap.py
def auth(username, password): ''' Simple LDAP auth ''' if not HAS_LDAP: log.error('LDAP authentication requires python-ldap module') return False bind = None # If bind credentials are configured, verify that we receive a valid bind if _config('binddn', mandatory=False) and ...
def auth(username, password): ''' Simple LDAP auth ''' if not HAS_LDAP: log.error('LDAP authentication requires python-ldap module') return False bind = None # If bind credentials are configured, verify that we receive a valid bind if _config('binddn', mandatory=False) and ...
[ "Simple", "LDAP", "auth" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/ldap.py#L293-L322
[ "def", "auth", "(", "username", ",", "password", ")", ":", "if", "not", "HAS_LDAP", ":", "log", ".", "error", "(", "'LDAP authentication requires python-ldap module'", ")", "return", "False", "bind", "=", "None", "# If bind credentials are configured, verify that we rec...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
groups
Authenticate against an LDAP group Behavior is highly dependent on if Active Directory is in use. AD handles group membership very differently than OpenLDAP. See the :ref:`External Authentication <acl-eauth>` documentation for a thorough discussion of available parameters for customizing the search. ...
salt/auth/ldap.py
def groups(username, **kwargs): ''' Authenticate against an LDAP group Behavior is highly dependent on if Active Directory is in use. AD handles group membership very differently than OpenLDAP. See the :ref:`External Authentication <acl-eauth>` documentation for a thorough discussion of availa...
def groups(username, **kwargs): ''' Authenticate against an LDAP group Behavior is highly dependent on if Active Directory is in use. AD handles group membership very differently than OpenLDAP. See the :ref:`External Authentication <acl-eauth>` documentation for a thorough discussion of availa...
[ "Authenticate", "against", "an", "LDAP", "group" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/ldap.py#L325-L436
[ "def", "groups", "(", "username", ",", "*", "*", "kwargs", ")", ":", "group_list", "=", "[", "]", "# If bind credentials are configured, use them instead of user's", "if", "_config", "(", "'binddn'", ",", "mandatory", "=", "False", ")", "and", "_config", "(", "'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
process_acl
Query LDAP, retrieve list of minion_ids from an OU or other search. For each minion_id returned from the LDAP search, copy the perms matchers into the auth dictionary :param auth_list: :param opts: __opts__ for when __opts__ is not injected :return: Modified auth list.
salt/auth/ldap.py
def process_acl(auth_list, opts=None): ''' Query LDAP, retrieve list of minion_ids from an OU or other search. For each minion_id returned from the LDAP search, copy the perms matchers into the auth dictionary :param auth_list: :param opts: __opts__ for when __opts__ is not injected :return:...
def process_acl(auth_list, opts=None): ''' Query LDAP, retrieve list of minion_ids from an OU or other search. For each minion_id returned from the LDAP search, copy the perms matchers into the auth dictionary :param auth_list: :param opts: __opts__ for when __opts__ is not injected :return:...
[ "Query", "LDAP", "retrieve", "list", "of", "minion_ids", "from", "an", "OU", "or", "other", "search", ".", "For", "each", "minion_id", "returned", "from", "the", "LDAP", "search", "copy", "the", "perms", "matchers", "into", "the", "auth", "dictionary", ":", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/ldap.py#L509-L525
[ "def", "process_acl", "(", "auth_list", ",", "opts", "=", "None", ")", ":", "ou_names", "=", "[", "]", "for", "item", "in", "auth_list", ":", "if", "isinstance", "(", "item", ",", "six", ".", "string_types", ")", ":", "continue", "ou_names", ".", "exte...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_netmiko_args
Check for Netmiko arguments that were passed in as NAPALM optional arguments. Return a dictionary of these optional args that will be passed into the Netmiko ConnectHandler call. .. note:: This is a port of the NAPALM helper for backwards compatibility with older versions of NAPALM, and s...
salt/modules/napalm_mod.py
def _get_netmiko_args(optional_args): ''' Check for Netmiko arguments that were passed in as NAPALM optional arguments. Return a dictionary of these optional args that will be passed into the Netmiko ConnectHandler call. .. note:: This is a port of the NAPALM helper for backwards compatib...
def _get_netmiko_args(optional_args): ''' Check for Netmiko arguments that were passed in as NAPALM optional arguments. Return a dictionary of these optional args that will be passed into the Netmiko ConnectHandler call. .. note:: This is a port of the NAPALM helper for backwards compatib...
[ "Check", "for", "Netmiko", "arguments", "that", "were", "passed", "in", "as", "NAPALM", "optional", "arguments", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L81-L118
[ "def", "_get_netmiko_args", "(", "optional_args", ")", ":", "if", "HAS_NETMIKO_HELPERS", ":", "return", "napalm", ".", "base", ".", "netmiko_helpers", ".", "netmiko_args", "(", "optional_args", ")", "# Older version don't have the netmiko_helpers module, the following code is...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
reconnect
Reconnect the NAPALM proxy when the connection is dropped by the network device. The connection can be forced to be restarted using the ``force`` argument. .. note:: This function can be used only when running proxy minions. CLI Example: .. code-block:: bash salt '*' napalm....
salt/modules/napalm_mod.py
def reconnect(force=False, **kwargs): # pylint: disable=unused-argument ''' Reconnect the NAPALM proxy when the connection is dropped by the network device. The connection can be forced to be restarted using the ``force`` argument. .. note:: This function can be used only when running...
def reconnect(force=False, **kwargs): # pylint: disable=unused-argument ''' Reconnect the NAPALM proxy when the connection is dropped by the network device. The connection can be forced to be restarted using the ``force`` argument. .. note:: This function can be used only when running...
[ "Reconnect", "the", "NAPALM", "proxy", "when", "the", "connection", "is", "dropped", "by", "the", "network", "device", ".", "The", "connection", "can", "be", "forced", "to", "be", "restarted", "using", "the", "force", "argument", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L195-L249
[ "def", "reconnect", "(", "force", "=", "False", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "default_ret", "=", "{", "'out'", ":", "None", ",", "'result'", ":", "True", ",", "'comment'", ":", "'Already alive.'", "}", "if", "not", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
call
Execute arbitrary methods from the NAPALM library. To see the expected output, please consult the NAPALM documentation. .. note:: This feature is not recommended to be used in production. It should be used for testing only! CLI Example: .. code-block:: bash salt '*' napalm.c...
salt/modules/napalm_mod.py
def call(method, *args, **kwargs): ''' Execute arbitrary methods from the NAPALM library. To see the expected output, please consult the NAPALM documentation. .. note:: This feature is not recommended to be used in production. It should be used for testing only! CLI Example: ...
def call(method, *args, **kwargs): ''' Execute arbitrary methods from the NAPALM library. To see the expected output, please consult the NAPALM documentation. .. note:: This feature is not recommended to be used in production. It should be used for testing only! CLI Example: ...
[ "Execute", "arbitrary", "methods", "from", "the", "NAPALM", "library", ".", "To", "see", "the", "expected", "output", "please", "consult", "the", "NAPALM", "documentation", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L253-L281
[ "def", "call", "(", "method", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "clean_kwargs", "=", "{", "}", "for", "karg", ",", "warg", "in", "six", ".", "iteritems", "(", "kwargs", ")", ":", "# remove the __pub args", "if", "not", "karg", ".",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
compliance_report
Return the compliance report. filepath The absolute path to the validation file. .. versionchanged:: 2019.2.0 Beginning with release codename ``2019.2.0``, this function has been enhanced, to be able to leverage the multi-engine template rendering of Salt, besides the poss...
salt/modules/napalm_mod.py
def compliance_report(filepath=None, string=None, renderer='jinja|yaml', **kwargs): ''' Return the compliance report. filepath The absolute path to the validation file. .. versionchanged:: 2019.2.0 Beginning with re...
def compliance_report(filepath=None, string=None, renderer='jinja|yaml', **kwargs): ''' Return the compliance report. filepath The absolute path to the validation file. .. versionchanged:: 2019.2.0 Beginning with re...
[ "Return", "the", "compliance", "report", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L285-L417
[ "def", "compliance_report", "(", "filepath", "=", "None", ",", "string", "=", "None", ",", "renderer", "=", "'jinja|yaml'", ",", "*", "*", "kwargs", ")", ":", "validation_string", "=", "__salt__", "[", "'slsutil.renderer'", "]", "(", "path", "=", "filepath",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
netmiko_args
.. versionadded:: 2019.2.0 Return the key-value arguments used for the authentication arguments for the netmiko module. When running in a non-native NAPALM driver (e.g., ``panos``, `f5``, ``mos`` - either from https://github.com/napalm-automation-community or defined in user's own environment, one...
salt/modules/napalm_mod.py
def netmiko_args(**kwargs): ''' .. versionadded:: 2019.2.0 Return the key-value arguments used for the authentication arguments for the netmiko module. When running in a non-native NAPALM driver (e.g., ``panos``, `f5``, ``mos`` - either from https://github.com/napalm-automation-community or de...
def netmiko_args(**kwargs): ''' .. versionadded:: 2019.2.0 Return the key-value arguments used for the authentication arguments for the netmiko module. When running in a non-native NAPALM driver (e.g., ``panos``, `f5``, ``mos`` - either from https://github.com/napalm-automation-community or de...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L421-L488
[ "def", "netmiko_args", "(", "*", "*", "kwargs", ")", ":", "if", "not", "HAS_NETMIKO", ":", "raise", "CommandExecutionError", "(", "'Please install netmiko to be able to use this feature.'", ")", "kwargs", "=", "{", "}", "napalm_opts", "=", "salt", ".", "utils", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
train
netmiko_fun
.. versionadded:: 2019.2.0 Call an arbitrary function from the :mod:`Netmiko<salt.modules.netmiko_mod>` module, passing the authentication details from the existing NAPALM connection. fun The name of the function from the :mod:`Netmiko<salt.modules.netmiko_mod>` to invoke. args ...
salt/modules/napalm_mod.py
def netmiko_fun(fun, *args, **kwargs): ''' .. versionadded:: 2019.2.0 Call an arbitrary function from the :mod:`Netmiko<salt.modules.netmiko_mod>` module, passing the authentication details from the existing NAPALM connection. fun The name of the function from the :mod:`Netmiko<salt.mo...
def netmiko_fun(fun, *args, **kwargs): ''' .. versionadded:: 2019.2.0 Call an arbitrary function from the :mod:`Netmiko<salt.modules.netmiko_mod>` module, passing the authentication details from the existing NAPALM connection. fun The name of the function from the :mod:`Netmiko<salt.mo...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L492-L522
[ "def", "netmiko_fun", "(", "fun", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "'netmiko.'", "not", "in", "fun", ":", "fun", "=", "'netmiko.{fun}'", ".", "format", "(", "fun", "=", "fun", ")", "netmiko_kwargs", "=", "netmiko_args", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
netmiko_call
.. versionadded:: 2019.2.0 Execute an arbitrary Netmiko method, passing the authentication details from the existing NAPALM connection. method The name of the Netmiko method to execute. args List of arguments to send to the Netmiko method specified in ``method``. kwargs K...
salt/modules/napalm_mod.py
def netmiko_call(method, *args, **kwargs): ''' .. versionadded:: 2019.2.0 Execute an arbitrary Netmiko method, passing the authentication details from the existing NAPALM connection. method The name of the Netmiko method to execute. args List of arguments to send to the Netmik...
def netmiko_call(method, *args, **kwargs): ''' .. versionadded:: 2019.2.0 Execute an arbitrary Netmiko method, passing the authentication details from the existing NAPALM connection. method The name of the Netmiko method to execute. args List of arguments to send to the Netmik...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L526-L551
[ "def", "netmiko_call", "(", "method", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "netmiko_kwargs", "=", "netmiko_args", "(", ")", "kwargs", ".", "update", "(", "netmiko_kwargs", ")", "return", "__salt__", "[", "'netmiko.call'", "]", "(", "method"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
netmiko_multi_call
.. versionadded:: 2019.2.0 Execute a list of arbitrary Netmiko methods, passing the authentication details from the existing NAPALM connection. methods List of dictionaries with the following keys: - ``name``: the name of the Netmiko function to invoke. - ``args``: list of argumen...
salt/modules/napalm_mod.py
def netmiko_multi_call(*methods, **kwargs): ''' .. versionadded:: 2019.2.0 Execute a list of arbitrary Netmiko methods, passing the authentication details from the existing NAPALM connection. methods List of dictionaries with the following keys: - ``name``: the name of the Netmiko...
def netmiko_multi_call(*methods, **kwargs): ''' .. versionadded:: 2019.2.0 Execute a list of arbitrary Netmiko methods, passing the authentication details from the existing NAPALM connection. methods List of dictionaries with the following keys: - ``name``: the name of the Netmiko...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L555-L578
[ "def", "netmiko_multi_call", "(", "*", "methods", ",", "*", "*", "kwargs", ")", ":", "netmiko_kwargs", "=", "netmiko_args", "(", ")", "kwargs", ".", "update", "(", "netmiko_kwargs", ")", "return", "__salt__", "[", "'netmiko.multi_call'", "]", "(", "*", "meth...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
netmiko_commands
.. versionadded:: 2019.2.0 Invoke one or more commands to be executed on the remote device, via Netmiko. Returns a list of strings, with the output from each command. commands A list of commands to be executed. expect_string Regular expression pattern to use for determining end of out...
salt/modules/napalm_mod.py
def netmiko_commands(*commands, **kwargs): ''' .. versionadded:: 2019.2.0 Invoke one or more commands to be executed on the remote device, via Netmiko. Returns a list of strings, with the output from each command. commands A list of commands to be executed. expect_string Regul...
def netmiko_commands(*commands, **kwargs): ''' .. versionadded:: 2019.2.0 Invoke one or more commands to be executed on the remote device, via Netmiko. Returns a list of strings, with the output from each command. commands A list of commands to be executed. expect_string Regul...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L582-L628
[ "def", "netmiko_commands", "(", "*", "commands", ",", "*", "*", "kwargs", ")", ":", "conn", "=", "netmiko_conn", "(", "*", "*", "kwargs", ")", "ret", "=", "[", "]", "for", "cmd", "in", "commands", ":", "ret", ".", "append", "(", "conn", ".", "send_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
netmiko_config
.. versionadded:: 2019.2.0 Load a list of configuration commands on the remote device, via Netmiko. .. warning:: Please remember that ``netmiko`` does not have any rollback safeguards and any configuration change will be directly loaded into the running config if the platform doesn't ...
salt/modules/napalm_mod.py
def netmiko_config(*config_commands, **kwargs): ''' .. versionadded:: 2019.2.0 Load a list of configuration commands on the remote device, via Netmiko. .. warning:: Please remember that ``netmiko`` does not have any rollback safeguards and any configuration change will be directly loa...
def netmiko_config(*config_commands, **kwargs): ''' .. versionadded:: 2019.2.0 Load a list of configuration commands on the remote device, via Netmiko. .. warning:: Please remember that ``netmiko`` does not have any rollback safeguards and any configuration change will be directly loa...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L632-L699
[ "def", "netmiko_config", "(", "*", "config_commands", ",", "*", "*", "kwargs", ")", ":", "netmiko_kwargs", "=", "netmiko_args", "(", ")", "kwargs", ".", "update", "(", "netmiko_kwargs", ")", "return", "__salt__", "[", "'netmiko.send_config'", "]", "(", "config...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
junos_rpc
.. versionadded:: 2019.2.0 Execute an RPC request on the remote Junos device. cmd The RPC request to the executed. To determine the RPC request, you can check the from the command line of the device, by executing the usual command followed by ``| display xml rpc``, e.g., ``show...
salt/modules/napalm_mod.py
def junos_rpc(cmd=None, dest=None, format=None, **kwargs): ''' .. versionadded:: 2019.2.0 Execute an RPC request on the remote Junos device. cmd The RPC request to the executed. To determine the RPC request, you can check the from the command line of the device, by executing the usual ...
def junos_rpc(cmd=None, dest=None, format=None, **kwargs): ''' .. versionadded:: 2019.2.0 Execute an RPC request on the remote Junos device. cmd The RPC request to the executed. To determine the RPC request, you can check the from the command line of the device, by executing the usual ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L729-L785
[ "def", "junos_rpc", "(", "cmd", "=", "None", ",", "dest", "=", "None", ",", "format", "=", "None", ",", "*", "*", "kwargs", ")", ":", "prep", "=", "_junos_prep_fun", "(", "napalm_device", ")", "# pylint: disable=undefined-variable", "if", "not", "prep", "[...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
junos_install_os
.. versionadded:: 2019.2.0 Installs the given image on the device. path The image file source. This argument supports the following URIs: - Absolute path on the Minion. - ``salt://`` to fetch from the Salt fileserver. - ``http://`` and ``https://`` - ``ftp://`` ...
salt/modules/napalm_mod.py
def junos_install_os(path=None, **kwargs): ''' .. versionadded:: 2019.2.0 Installs the given image on the device. path The image file source. This argument supports the following URIs: - Absolute path on the Minion. - ``salt://`` to fetch from the Salt fileserver. - ``...
def junos_install_os(path=None, **kwargs): ''' .. versionadded:: 2019.2.0 Installs the given image on the device. path The image file source. This argument supports the following URIs: - Absolute path on the Minion. - ``salt://`` to fetch from the Salt fileserver. - ``...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L838-L873
[ "def", "junos_install_os", "(", "path", "=", "None", ",", "*", "*", "kwargs", ")", ":", "prep", "=", "_junos_prep_fun", "(", "napalm_device", ")", "# pylint: disable=undefined-variable", "if", "not", "prep", "[", "'result'", "]", ":", "return", "prep", "return...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
junos_facts
.. versionadded:: 2019.2.0 The complete list of Junos facts collected by ``junos-eznc``. CLI Example: .. code-block:: bash salt '*' napalm.junos_facts
salt/modules/napalm_mod.py
def junos_facts(**kwargs): ''' .. versionadded:: 2019.2.0 The complete list of Junos facts collected by ``junos-eznc``. CLI Example: .. code-block:: bash salt '*' napalm.junos_facts ''' prep = _junos_prep_fun(napalm_device) # pylint: disable=undefined-variable if not prep['r...
def junos_facts(**kwargs): ''' .. versionadded:: 2019.2.0 The complete list of Junos facts collected by ``junos-eznc``. CLI Example: .. code-block:: bash salt '*' napalm.junos_facts ''' prep = _junos_prep_fun(napalm_device) # pylint: disable=undefined-variable if not prep['r...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L877-L902
[ "def", "junos_facts", "(", "*", "*", "kwargs", ")", ":", "prep", "=", "_junos_prep_fun", "(", "napalm_device", ")", "# pylint: disable=undefined-variable", "if", "not", "prep", "[", "'result'", "]", ":", "return", "prep", "facts", "=", "dict", "(", "napalm_dev...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
junos_cli
.. versionadded:: 2019.2.0 Execute a CLI command and return the output in the specified format. command The command to execute on the Junos CLI. format: ``text`` Format in which to get the CLI output (either ``text`` or ``xml``). dev_timeout: ``30`` The NETCONF RPC timeout (i...
salt/modules/napalm_mod.py
def junos_cli(command, format=None, dev_timeout=None, dest=None, **kwargs): ''' .. versionadded:: 2019.2.0 Execute a CLI command and return the output in the specified format. command The command to execute on the Junos CLI. format: ``text`` Format in which to get the CLI output (...
def junos_cli(command, format=None, dev_timeout=None, dest=None, **kwargs): ''' .. versionadded:: 2019.2.0 Execute a CLI command and return the output in the specified format. command The command to execute on the Junos CLI. format: ``text`` Format in which to get the CLI output (...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L906-L939
[ "def", "junos_cli", "(", "command", ",", "format", "=", "None", ",", "dev_timeout", "=", "None", ",", "dest", "=", "None", ",", "*", "*", "kwargs", ")", ":", "prep", "=", "_junos_prep_fun", "(", "napalm_device", ")", "# pylint: disable=undefined-variable", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
junos_copy_file
.. versionadded:: 2019.2.0 Copies the file on the remote Junos device. src The source file path. This argument accepts the usual Salt URIs (e.g., ``salt://``, ``http://``, ``https://``, ``s3://``, ``ftp://``, etc.). dst The destination path on the device where to copy the file. ...
salt/modules/napalm_mod.py
def junos_copy_file(src, dst, **kwargs): ''' .. versionadded:: 2019.2.0 Copies the file on the remote Junos device. src The source file path. This argument accepts the usual Salt URIs (e.g., ``salt://``, ``http://``, ``https://``, ``s3://``, ``ftp://``, etc.). dst The dest...
def junos_copy_file(src, dst, **kwargs): ''' .. versionadded:: 2019.2.0 Copies the file on the remote Junos device. src The source file path. This argument accepts the usual Salt URIs (e.g., ``salt://``, ``http://``, ``https://``, ``s3://``, ``ftp://``, etc.). dst The dest...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L943-L966
[ "def", "junos_copy_file", "(", "src", ",", "dst", ",", "*", "*", "kwargs", ")", ":", "prep", "=", "_junos_prep_fun", "(", "napalm_device", ")", "# pylint: disable=undefined-variable", "if", "not", "prep", "[", "'result'", "]", ":", "return", "prep", "cached_sr...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
junos_call
.. versionadded:: 2019.2.0 Execute an arbitrary function from the :mod:`junos execution module <salt.module.junos>`. To check what ``args`` and ``kwargs`` you must send to the function, please consult the appropriate documentation. fun The name of the function. E.g., ``set_hostname``. ...
salt/modules/napalm_mod.py
def junos_call(fun, *args, **kwargs): ''' .. versionadded:: 2019.2.0 Execute an arbitrary function from the :mod:`junos execution module <salt.module.junos>`. To check what ``args`` and ``kwargs`` you must send to the function, please consult the appropriate documentation. fun The ...
def junos_call(fun, *args, **kwargs): ''' .. versionadded:: 2019.2.0 Execute an arbitrary function from the :mod:`junos execution module <salt.module.junos>`. To check what ``args`` and ``kwargs`` you must send to the function, please consult the appropriate documentation. fun The ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L970-L1008
[ "def", "junos_call", "(", "fun", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "prep", "=", "_junos_prep_fun", "(", "napalm_device", ")", "# pylint: disable=undefined-variable", "if", "not", "prep", "[", "'result'", "]", ":", "return", "prep", "if", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
pyeapi_nxos_api_args
.. versionadded:: 2019.2.0 Return the key-value arguments used for the authentication arguments for the :mod:`pyeapi execution module <salt.module.arista_pyeapi>`. CLI Example: .. code-block:: bash salt '*' napalm.pyeapi_nxos_api_args
salt/modules/napalm_mod.py
def pyeapi_nxos_api_args(**prev_kwargs): ''' .. versionadded:: 2019.2.0 Return the key-value arguments used for the authentication arguments for the :mod:`pyeapi execution module <salt.module.arista_pyeapi>`. CLI Example: .. code-block:: bash salt '*' napalm.pyeapi_nxos_api_args ...
def pyeapi_nxos_api_args(**prev_kwargs): ''' .. versionadded:: 2019.2.0 Return the key-value arguments used for the authentication arguments for the :mod:`pyeapi execution module <salt.module.arista_pyeapi>`. CLI Example: .. code-block:: bash salt '*' napalm.pyeapi_nxos_api_args ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L1011-L1035
[ "def", "pyeapi_nxos_api_args", "(", "*", "*", "prev_kwargs", ")", ":", "kwargs", "=", "{", "}", "napalm_opts", "=", "salt", ".", "utils", ".", "napalm", ".", "get_device_opts", "(", "__opts__", ",", "salt_obj", "=", "__salt__", ")", "optional_args", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
pyeapi_call
.. versionadded:: 2019.2.0 Invoke an arbitrary method from the ``pyeapi`` library. This function forwards the existing connection details to the :mod:`pyeapi.run_commands <salt.module.arista_pyeapi.run_commands>` execution function. method The name of the ``pyeapi`` method to invoke. ...
salt/modules/napalm_mod.py
def pyeapi_call(method, *args, **kwargs): ''' .. versionadded:: 2019.2.0 Invoke an arbitrary method from the ``pyeapi`` library. This function forwards the existing connection details to the :mod:`pyeapi.run_commands <salt.module.arista_pyeapi.run_commands>` execution function. method ...
def pyeapi_call(method, *args, **kwargs): ''' .. versionadded:: 2019.2.0 Invoke an arbitrary method from the ``pyeapi`` library. This function forwards the existing connection details to the :mod:`pyeapi.run_commands <salt.module.arista_pyeapi.run_commands>` execution function. method ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L1065-L1088
[ "def", "pyeapi_call", "(", "method", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "pyeapi_kwargs", "=", "pyeapi_nxos_api_args", "(", "*", "*", "kwargs", ")", "return", "__salt__", "[", "'pyeapi.call'", "]", "(", "method", ",", "*", "args", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
pyeapi_config
.. versionadded:: 2019.2.0 Configures the Arista switch with the specified commands, via the ``pyeapi`` library. This function forwards the existing connection details to the :mod:`pyeapi.run_commands <salt.module.arista_pyeapi.run_commands>` execution function. commands The list of config...
salt/modules/napalm_mod.py
def pyeapi_config(commands=None, config_file=None, template_engine='jinja', context=None, defaults=None, saltenv='base', **kwargs): ''' .. versionadded:: 2019.2.0 Configures the Arista switch with th...
def pyeapi_config(commands=None, config_file=None, template_engine='jinja', context=None, defaults=None, saltenv='base', **kwargs): ''' .. versionadded:: 2019.2.0 Configures the Arista switch with th...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L1117-L1179
[ "def", "pyeapi_config", "(", "commands", "=", "None", ",", "config_file", "=", "None", ",", "template_engine", "=", "'jinja'", ",", "context", "=", "None", ",", "defaults", "=", "None", ",", "saltenv", "=", "'base'", ",", "*", "*", "kwargs", ")", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
nxos_api_rpc
.. versionadded:: 2019.2.0 Execute an arbitrary RPC request via the Nexus API. commands The RPC commands to be executed. method: ``cli`` The type of the response, i.e., raw text (``cli_ascii``) or structured document (``cli``). Defaults to ``cli`` (structured data). CLI Examp...
salt/modules/napalm_mod.py
def nxos_api_rpc(commands, method='cli', **kwargs): ''' .. versionadded:: 2019.2.0 Execute an arbitrary RPC request via the Nexus API. commands The RPC commands to be executed. method: ``cli`` The type of the response, i.e., raw text (``cli_ascii`...
def nxos_api_rpc(commands, method='cli', **kwargs): ''' .. versionadded:: 2019.2.0 Execute an arbitrary RPC request via the Nexus API. commands The RPC commands to be executed. method: ``cli`` The type of the response, i.e., raw text (``cli_ascii`...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L1183-L1205
[ "def", "nxos_api_rpc", "(", "commands", ",", "method", "=", "'cli'", ",", "*", "*", "kwargs", ")", ":", "nxos_api_kwargs", "=", "pyeapi_nxos_api_args", "(", "*", "*", "kwargs", ")", "return", "__salt__", "[", "'nxos_api.rpc'", "]", "(", "commands", ",", "m...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
nxos_api_config
.. versionadded:: 2019.2.0 Configures the Nexus switch with the specified commands, via the NX-API. commands The list of configuration commands to load on the Nexus switch. .. note:: This argument is ignored when ``config_file`` is specified. config_file The source fi...
salt/modules/napalm_mod.py
def nxos_api_config(commands=None, config_file=None, template_engine='jinja', context=None, defaults=None, saltenv='base', **kwargs): ''' .. versionadded:: 2019.2.0 Configures the Nexus ...
def nxos_api_config(commands=None, config_file=None, template_engine='jinja', context=None, defaults=None, saltenv='base', **kwargs): ''' .. versionadded:: 2019.2.0 Configures the Nexus ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L1209-L1269
[ "def", "nxos_api_config", "(", "commands", "=", "None", ",", "config_file", "=", "None", ",", "template_engine", "=", "'jinja'", ",", "context", "=", "None", ",", "defaults", "=", "None", ",", "saltenv", "=", "'base'", ",", "*", "*", "kwargs", ")", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
nxos_api_show
.. versionadded:: 2019.2.0 Execute one or more show (non-configuration) commands. commands The commands to be executed. raw_text: ``True`` Whether to return raw text or structured data. CLI Example: .. code-block:: bash salt '*' napalm.nxos_api_show 'show version' ...
salt/modules/napalm_mod.py
def nxos_api_show(commands, raw_text=True, **kwargs): ''' .. versionadded:: 2019.2.0 Execute one or more show (non-configuration) commands. commands The commands to be executed. raw_text: ``True`` Whether to return raw text or structured data. CLI Example: .. code-block:...
def nxos_api_show(commands, raw_text=True, **kwargs): ''' .. versionadded:: 2019.2.0 Execute one or more show (non-configuration) commands. commands The commands to be executed. raw_text: ``True`` Whether to return raw text or structured data. CLI Example: .. code-block:...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L1273-L1295
[ "def", "nxos_api_show", "(", "commands", ",", "raw_text", "=", "True", ",", "*", "*", "kwargs", ")", ":", "nxos_api_kwargs", "=", "pyeapi_nxos_api_args", "(", "*", "*", "kwargs", ")", "return", "__salt__", "[", "'nxos_api.show'", "]", "(", "commands", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
rpc
.. versionadded:: 2019.2.0 This is a wrapper to execute RPC requests on various network operating systems supported by NAPALM, invoking the following functions for the NAPALM native drivers: - :py:func:`napalm.junos_rpc <salt.modules.napalm_mod.junos_rpc>` for ``junos`` - :py:func:`napalm.pyeapi_r...
salt/modules/napalm_mod.py
def rpc(command, **kwargs): ''' .. versionadded:: 2019.2.0 This is a wrapper to execute RPC requests on various network operating systems supported by NAPALM, invoking the following functions for the NAPALM native drivers: - :py:func:`napalm.junos_rpc <salt.modules.napalm_mod.junos_rpc>` for `...
def rpc(command, **kwargs): ''' .. versionadded:: 2019.2.0 This is a wrapper to execute RPC requests on various network operating systems supported by NAPALM, invoking the following functions for the NAPALM native drivers: - :py:func:`napalm.junos_rpc <salt.modules.napalm_mod.junos_rpc>` for `...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L1299-L1352
[ "def", "rpc", "(", "command", ",", "*", "*", "kwargs", ")", ":", "default_map", "=", "{", "'junos'", ":", "'napalm.junos_rpc'", ",", "'eos'", ":", "'napalm.pyeapi_run_commands'", ",", "'nxos'", ":", "'napalm.nxos_api_rpc'", "}", "napalm_map", "=", "__salt__", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
config_find_lines
r''' .. versionadded:: 2019.2.0 Return the configuration lines that match the regular expressions from the ``regex`` argument. The configuration is read from the network device interrogated. regex The regular expression to match the configuration lines against. source: ``running`` ...
salt/modules/napalm_mod.py
def config_find_lines(regex, source='running'): r''' .. versionadded:: 2019.2.0 Return the configuration lines that match the regular expressions from the ``regex`` argument. The configuration is read from the network device interrogated. regex The regular expression to match the confi...
def config_find_lines(regex, source='running'): r''' .. versionadded:: 2019.2.0 Return the configuration lines that match the regular expressions from the ``regex`` argument. The configuration is read from the network device interrogated. regex The regular expression to match the confi...
[ "r", "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L1356-L1379
[ "def", "config_find_lines", "(", "regex", ",", "source", "=", "'running'", ")", ":", "config_txt", "=", "__salt__", "[", "'net.config'", "]", "(", "source", "=", "source", ")", "[", "'out'", "]", "[", "source", "]", "return", "__salt__", "[", "'ciscoconfpa...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
config_lines_w_child
r''' .. versionadded:: 2019.2.0 Return the configuration lines that match the regular expressions from the ``parent_regex`` argument, having child lines matching ``child_regex``. The configuration is read from the network device interrogated. .. note:: This function is only available only...
salt/modules/napalm_mod.py
def config_lines_w_child(parent_regex, child_regex, source='running'): r''' .. versionadded:: 2019.2.0 Return the configuration lines that match the regular expressions from the ``parent_regex`` argument, having child lines matching ``child_regex``. The configuration is read from the network devic...
def config_lines_w_child(parent_regex, child_regex, source='running'): r''' .. versionadded:: 2019.2.0 Return the configuration lines that match the regular expressions from the ``parent_regex`` argument, having child lines matching ``child_regex``. The configuration is read from the network devic...
[ "r", "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L1383-L1418
[ "def", "config_lines_w_child", "(", "parent_regex", ",", "child_regex", ",", "source", "=", "'running'", ")", ":", "config_txt", "=", "__salt__", "[", "'net.config'", "]", "(", "source", "=", "source", ")", "[", "'out'", "]", "[", "source", "]", "return", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
config_lines_wo_child
.. versionadded:: 2019.2.0 Return the configuration lines that match the regular expressions from the ``parent_regex`` argument, having the child lines *not* matching ``child_regex``. The configuration is read from the network device interrogated. .. note:: This function is only available ...
salt/modules/napalm_mod.py
def config_lines_wo_child(parent_regex, child_regex, source='running'): ''' .. versionadded:: 2019.2.0 Return the configuration lines that match the regular expressions from the ``parent_regex`` argument, having the child lines *not* matching ``child_regex``. The configuration is read from th...
def config_lines_wo_child(parent_regex, child_regex, source='running'): ''' .. versionadded:: 2019.2.0 Return the configuration lines that match the regular expressions from the ``parent_regex`` argument, having the child lines *not* matching ``child_regex``. The configuration is read from th...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L1422-L1458
[ "def", "config_lines_wo_child", "(", "parent_regex", ",", "child_regex", ",", "source", "=", "'running'", ")", ":", "config_txt", "=", "__salt__", "[", "'net.config'", "]", "(", "source", "=", "source", ")", "[", "'out'", "]", "[", "source", "]", "return", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
config_filter_lines
r''' .. versionadded:: 2019.2.0 Return a list of detailed matches, for the configuration blocks (parent-child relationship) whose parent respects the regular expressions configured via the ``parent_regex`` argument, and the child matches the ``child_regex`` regular expression. The result is a list ...
salt/modules/napalm_mod.py
def config_filter_lines(parent_regex, child_regex, source='running'): r''' .. versionadded:: 2019.2.0 Return a list of detailed matches, for the configuration blocks (parent-child relationship) whose parent respects the regular expressions configured via the ``parent_regex`` argument, and the child...
def config_filter_lines(parent_regex, child_regex, source='running'): r''' .. versionadded:: 2019.2.0 Return a list of detailed matches, for the configuration blocks (parent-child relationship) whose parent respects the regular expressions configured via the ``parent_regex`` argument, and the child...
[ "r", "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L1462-L1505
[ "def", "config_filter_lines", "(", "parent_regex", ",", "child_regex", ",", "source", "=", "'running'", ")", ":", "config_txt", "=", "__salt__", "[", "'net.config'", "]", "(", "source", "=", "source", ")", "[", "'out'", "]", "[", "source", "]", "return", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
config_tree
.. versionadded:: 2019.2.0 Transform Cisco IOS style configuration to structured Python dictionary. Depending on the value of the ``with_tags`` argument, this function may provide different views, valuable in different situations. source: ``running`` The configuration type to retrieve from the...
salt/modules/napalm_mod.py
def config_tree(source='running', with_tags=False): ''' .. versionadded:: 2019.2.0 Transform Cisco IOS style configuration to structured Python dictionary. Depending on the value of the ``with_tags`` argument, this function may provide different views, valuable in different situations. source:...
def config_tree(source='running', with_tags=False): ''' .. versionadded:: 2019.2.0 Transform Cisco IOS style configuration to structured Python dictionary. Depending on the value of the ``with_tags`` argument, this function may provide different views, valuable in different situations. source:...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L1508-L1530
[ "def", "config_tree", "(", "source", "=", "'running'", ",", "with_tags", "=", "False", ")", ":", "config_txt", "=", "__salt__", "[", "'net.config'", "]", "(", "source", "=", "source", ")", "[", "'out'", "]", "[", "source", "]", "return", "__salt__", "[",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
config_merge_tree
.. versionadded:: 2019.2.0 Return the merge tree of the ``initial_config`` with the ``merge_config``, as a Python dictionary. source: ``running`` The configuration type to retrieve from the network device. Default: ``running``. Available options: ``running``, ``startup``, ``candidate``. ...
salt/modules/napalm_mod.py
def config_merge_tree(source='running', merge_config=None, merge_path=None, saltenv='base'): ''' .. versionadded:: 2019.2.0 Return the merge tree of the ``initial_config`` with the ``merge_config``, as a Python dictionary. source: `...
def config_merge_tree(source='running', merge_config=None, merge_path=None, saltenv='base'): ''' .. versionadded:: 2019.2.0 Return the merge tree of the ``initial_config`` with the ``merge_config``, as a Python dictionary. source: `...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L1533-L1571
[ "def", "config_merge_tree", "(", "source", "=", "'running'", ",", "merge_config", "=", "None", ",", "merge_path", "=", "None", ",", "saltenv", "=", "'base'", ")", ":", "config_txt", "=", "__salt__", "[", "'net.config'", "]", "(", "source", "=", "source", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
config_merge_text
.. versionadded:: 2019.2.0 Return the merge result of the configuration from ``source`` with the merge configuration, as plain text (without loading the config on the device). source: ``running`` The configuration type to retrieve from the network device. Default: ``running``. Availabl...
salt/modules/napalm_mod.py
def config_merge_text(source='running', merge_config=None, merge_path=None, saltenv='base'): ''' .. versionadded:: 2019.2.0 Return the merge result of the configuration from ``source`` with the merge configuration, as plain text (without...
def config_merge_text(source='running', merge_config=None, merge_path=None, saltenv='base'): ''' .. versionadded:: 2019.2.0 Return the merge result of the configuration from ``source`` with the merge configuration, as plain text (without...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L1574-L1613
[ "def", "config_merge_text", "(", "source", "=", "'running'", ",", "merge_config", "=", "None", ",", "merge_path", "=", "None", ",", "saltenv", "=", "'base'", ")", ":", "config_txt", "=", "__salt__", "[", "'net.config'", "]", "(", "source", "=", "source", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
config_merge_diff
.. versionadded:: 2019.2.0 Return the merge diff, as text, after merging the merge config into the configuration source requested (without loading the config on the device). source: ``running`` The configuration type to retrieve from the network device. Default: ``running``. Available opti...
salt/modules/napalm_mod.py
def config_merge_diff(source='running', merge_config=None, merge_path=None, saltenv='base'): ''' .. versionadded:: 2019.2.0 Return the merge diff, as text, after merging the merge config into the configuration source requested (without l...
def config_merge_diff(source='running', merge_config=None, merge_path=None, saltenv='base'): ''' .. versionadded:: 2019.2.0 Return the merge diff, as text, after merging the merge config into the configuration source requested (without l...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L1616-L1654
[ "def", "config_merge_diff", "(", "source", "=", "'running'", ",", "merge_config", "=", "None", ",", "merge_path", "=", "None", ",", "saltenv", "=", "'base'", ")", ":", "config_txt", "=", "__salt__", "[", "'net.config'", "]", "(", "source", "=", "source", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
config_diff_tree
.. versionadded:: 2019.2.0 Return the diff, as Python dictionary, between two different sources. The sources can be either specified using the ``source1`` and ``source2`` arguments when retrieving from the managed network device. source1: ``candidate`` The source from where to retrieve the con...
salt/modules/napalm_mod.py
def config_diff_tree(source1='candidate', candidate_path=None, source2='running', running_path=None): ''' .. versionadded:: 2019.2.0 Return the diff, as Python dictionary, between two different sources. The sources can be either specified u...
def config_diff_tree(source1='candidate', candidate_path=None, source2='running', running_path=None): ''' .. versionadded:: 2019.2.0 Return the diff, as Python dictionary, between two different sources. The sources can be either specified u...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L1657-L1717
[ "def", "config_diff_tree", "(", "source1", "=", "'candidate'", ",", "candidate_path", "=", "None", ",", "source2", "=", "'running'", ",", "running_path", "=", "None", ")", ":", "get_config", "=", "__salt__", "[", "'net.config'", "]", "(", ")", "[", "'out'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
scp_get
.. versionadded:: 2019.2.0 Transfer files and directories from remote network device to the localhost of the Minion. .. note:: This function is only available only when the underlying library `scp <https://github.com/jbardin/scp.py>`_ is installed. See :mod:`scp module <sal...
salt/modules/napalm_mod.py
def scp_get(remote_path, local_path='', recursive=False, preserve_times=False, **kwargs): ''' .. versionadded:: 2019.2.0 Transfer files and directories from remote network device to the localhost of the Minion. .. note:: This function is only...
def scp_get(remote_path, local_path='', recursive=False, preserve_times=False, **kwargs): ''' .. versionadded:: 2019.2.0 Transfer files and directories from remote network device to the localhost of the Minion. .. note:: This function is only...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L1777-L1855
[ "def", "scp_get", "(", "remote_path", ",", "local_path", "=", "''", ",", "recursive", "=", "False", ",", "preserve_times", "=", "False", ",", "*", "*", "kwargs", ")", ":", "conn_args", "=", "netmiko_args", "(", "*", "*", "kwargs", ")", "conn_args", "[", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
scp_put
.. versionadded:: 2019.2.0 Transfer files and directories to remote network device. .. note:: This function is only available only when the underlying library `scp <https://github.com/jbardin/scp.py>`_ is installed. See :mod:`scp module <salt.modules.scp_mod>` for more ...
salt/modules/napalm_mod.py
def scp_put(files, remote_path=None, recursive=False, preserve_times=False, saltenv='base', **kwargs): ''' .. versionadded:: 2019.2.0 Transfer files and directories to remote network device. .. note:: This function is only available o...
def scp_put(files, remote_path=None, recursive=False, preserve_times=False, saltenv='base', **kwargs): ''' .. versionadded:: 2019.2.0 Transfer files and directories to remote network device. .. note:: This function is only available o...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_mod.py#L1859-L1957
[ "def", "scp_put", "(", "files", ",", "remote_path", "=", "None", ",", "recursive", "=", "False", ",", "preserve_times", "=", "False", ",", "saltenv", "=", "'base'", ",", "*", "*", "kwargs", ")", ":", "conn_args", "=", "netmiko_args", "(", "*", "*", "kw...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_config
Return configuration
salt/utils/nacl.py
def _get_config(**kwargs): ''' Return configuration ''' config = { 'box_type': 'sealedbox', 'sk': None, 'sk_file': os.path.join(kwargs['opts'].get('pki_dir'), 'master/nacl'), 'pk': None, 'pk_file': os.path.join(kwargs['opts'].get('pki_dir'), 'master/nacl.pub'), ...
def _get_config(**kwargs): ''' Return configuration ''' config = { 'box_type': 'sealedbox', 'sk': None, 'sk_file': os.path.join(kwargs['opts'].get('pki_dir'), 'master/nacl'), 'pk': None, 'pk_file': os.path.join(kwargs['opts'].get('pki_dir'), 'master/nacl.pub'), ...
[ "Return", "configuration" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/nacl.py#L43-L64
[ "def", "_get_config", "(", "*", "*", "kwargs", ")", ":", "config", "=", "{", "'box_type'", ":", "'sealedbox'", ",", "'sk'", ":", "None", ",", "'sk_file'", ":", "os", ".", "path", ".", "join", "(", "kwargs", "[", "'opts'", "]", ".", "get", "(", "'pk...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_sk
Return sk
salt/utils/nacl.py
def _get_sk(**kwargs): ''' Return sk ''' config = _get_config(**kwargs) key = salt.utils.stringutils.to_str(config['sk']) sk_file = config['sk_file'] if not key and sk_file: with salt.utils.files.fopen(sk_file, 'rb') as keyf: key = salt.utils.stringutils.to_unicode(keyf.r...
def _get_sk(**kwargs): ''' Return sk ''' config = _get_config(**kwargs) key = salt.utils.stringutils.to_str(config['sk']) sk_file = config['sk_file'] if not key and sk_file: with salt.utils.files.fopen(sk_file, 'rb') as keyf: key = salt.utils.stringutils.to_unicode(keyf.r...
[ "Return", "sk" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/nacl.py#L67-L79
[ "def", "_get_sk", "(", "*", "*", "kwargs", ")", ":", "config", "=", "_get_config", "(", "*", "*", "kwargs", ")", "key", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_str", "(", "config", "[", "'sk'", "]", ")", "sk_file", "=", "config", "[...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_pk
Return pk
salt/utils/nacl.py
def _get_pk(**kwargs): ''' Return pk ''' config = _get_config(**kwargs) pubkey = salt.utils.stringutils.to_str(config['pk']) pk_file = config['pk_file'] if not pubkey and pk_file: with salt.utils.files.fopen(pk_file, 'rb') as keyf: pubkey = salt.utils.stringutils.to_unico...
def _get_pk(**kwargs): ''' Return pk ''' config = _get_config(**kwargs) pubkey = salt.utils.stringutils.to_str(config['pk']) pk_file = config['pk_file'] if not pubkey and pk_file: with salt.utils.files.fopen(pk_file, 'rb') as keyf: pubkey = salt.utils.stringutils.to_unico...
[ "Return", "pk" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/nacl.py#L82-L95
[ "def", "_get_pk", "(", "*", "*", "kwargs", ")", ":", "config", "=", "_get_config", "(", "*", "*", "kwargs", ")", "pubkey", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_str", "(", "config", "[", "'pk'", "]", ")", "pk_file", "=", "config", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
keygen
Use libnacl to generate a keypair. If no `sk_file` is defined return a keypair. If only the `sk_file` is defined `pk_file` will use the same name with a postfix `.pub`. When the `sk_file` is already existing, but `pk_file` is not. The `pk_file` will be generated using the `sk_file`. CLI Examples...
salt/utils/nacl.py
def keygen(sk_file=None, pk_file=None, **kwargs): ''' Use libnacl to generate a keypair. If no `sk_file` is defined return a keypair. If only the `sk_file` is defined `pk_file` will use the same name with a postfix `.pub`. When the `sk_file` is already existing, but `pk_file` is not. The `pk_file...
def keygen(sk_file=None, pk_file=None, **kwargs): ''' Use libnacl to generate a keypair. If no `sk_file` is defined return a keypair. If only the `sk_file` is defined `pk_file` will use the same name with a postfix `.pub`. When the `sk_file` is already existing, but `pk_file` is not. The `pk_file...
[ "Use", "libnacl", "to", "generate", "a", "keypair", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/nacl.py#L98-L177
[ "def", "keygen", "(", "sk_file", "=", "None", ",", "pk_file", "=", "None", ",", "*", "*", "kwargs", ")", ":", "if", "'keyfile'", "in", "kwargs", ":", "salt", ".", "utils", ".", "versions", ".", "warn_until", "(", "'Neon'", ",", "'The \\'keyfile\\' argume...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
enc
Alias to `{box_type}_encrypt` box_type: secretbox, sealedbox(default)
salt/utils/nacl.py
def enc(data, **kwargs): ''' Alias to `{box_type}_encrypt` box_type: secretbox, sealedbox(default) ''' if 'keyfile' in kwargs: salt.utils.versions.warn_until( 'Neon', 'The \'keyfile\' argument has been deprecated and will be removed in Salt ' '{version}. ...
def enc(data, **kwargs): ''' Alias to `{box_type}_encrypt` box_type: secretbox, sealedbox(default) ''' if 'keyfile' in kwargs: salt.utils.versions.warn_until( 'Neon', 'The \'keyfile\' argument has been deprecated and will be removed in Salt ' '{version}. ...
[ "Alias", "to", "{", "box_type", "}", "_encrypt" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/nacl.py#L180-L205
[ "def", "enc", "(", "data", ",", "*", "*", "kwargs", ")", ":", "if", "'keyfile'", "in", "kwargs", ":", "salt", ".", "utils", ".", "versions", ".", "warn_until", "(", "'Neon'", ",", "'The \\'keyfile\\' argument has been deprecated and will be removed in Salt '", "'{...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
enc_file
This is a helper function to encrypt a file and return its contents. You can provide an optional output file using `out` `name` can be a local file or when not using `salt-run` can be a url like `salt://`, `https://` etc. CLI Examples: .. code-block:: bash salt-run nacl.enc_file name=/tmp/i...
salt/utils/nacl.py
def enc_file(name, out=None, **kwargs): ''' This is a helper function to encrypt a file and return its contents. You can provide an optional output file using `out` `name` can be a local file or when not using `salt-run` can be a url like `salt://`, `https://` etc. CLI Examples: .. code-bloc...
def enc_file(name, out=None, **kwargs): ''' This is a helper function to encrypt a file and return its contents. You can provide an optional output file using `out` `name` can be a local file or when not using `salt-run` can be a url like `salt://`, `https://` etc. CLI Examples: .. code-bloc...
[ "This", "is", "a", "helper", "function", "to", "encrypt", "a", "file", "and", "return", "its", "contents", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/nacl.py#L208-L238
[ "def", "enc_file", "(", "name", ",", "out", "=", "None", ",", "*", "*", "kwargs", ")", ":", "try", ":", "data", "=", "__salt__", "[", "'cp.get_file_str'", "]", "(", "name", ")", "except", "Exception", "as", "e", ":", "# likly using salt-run so fallback to ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
dec
Alias to `{box_type}_decrypt` box_type: secretbox, sealedbox(default)
salt/utils/nacl.py
def dec(data, **kwargs): ''' Alias to `{box_type}_decrypt` box_type: secretbox, sealedbox(default) ''' if 'keyfile' in kwargs: salt.utils.versions.warn_until( 'Neon', 'The \'keyfile\' argument has been deprecated and will be removed in Salt ' '{version}. ...
def dec(data, **kwargs): ''' Alias to `{box_type}_decrypt` box_type: secretbox, sealedbox(default) ''' if 'keyfile' in kwargs: salt.utils.versions.warn_until( 'Neon', 'The \'keyfile\' argument has been deprecated and will be removed in Salt ' '{version}. ...
[ "Alias", "to", "{", "box_type", "}", "_decrypt" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/nacl.py#L241-L272
[ "def", "dec", "(", "data", ",", "*", "*", "kwargs", ")", ":", "if", "'keyfile'", "in", "kwargs", ":", "salt", ".", "utils", ".", "versions", ".", "warn_until", "(", "'Neon'", ",", "'The \\'keyfile\\' argument has been deprecated and will be removed in Salt '", "'{...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sealedbox_encrypt
Encrypt data using a public key generated from `nacl.keygen`. The encryptd data can be decrypted using `nacl.sealedbox_decrypt` only with the secret key. CLI Examples: .. code-block:: bash salt-run nacl.sealedbox_encrypt datatoenc salt-call --local nacl.sealedbox_encrypt datatoenc pk_file...
salt/utils/nacl.py
def sealedbox_encrypt(data, **kwargs): ''' Encrypt data using a public key generated from `nacl.keygen`. The encryptd data can be decrypted using `nacl.sealedbox_decrypt` only with the secret key. CLI Examples: .. code-block:: bash salt-run nacl.sealedbox_encrypt datatoenc salt-ca...
def sealedbox_encrypt(data, **kwargs): ''' Encrypt data using a public key generated from `nacl.keygen`. The encryptd data can be decrypted using `nacl.sealedbox_decrypt` only with the secret key. CLI Examples: .. code-block:: bash salt-run nacl.sealedbox_encrypt datatoenc salt-ca...
[ "Encrypt", "data", "using", "a", "public", "key", "generated", "from", "nacl", ".", "keygen", ".", "The", "encryptd", "data", "can", "be", "decrypted", "using", "nacl", ".", "sealedbox_decrypt", "only", "with", "the", "secret", "key", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/nacl.py#L308-L326
[ "def", "sealedbox_encrypt", "(", "data", ",", "*", "*", "kwargs", ")", ":", "# ensure data is in bytes", "data", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_bytes", "(", "data", ")", "pk", "=", "_get_pk", "(", "*", "*", "kwargs", ")", "b", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sealedbox_decrypt
Decrypt data using a secret key that was encrypted using a public key with `nacl.sealedbox_encrypt`. CLI Examples: .. code-block:: bash salt-call nacl.sealedbox_decrypt pEXHQM6cuaF7A= salt-call --local nacl.sealedbox_decrypt data='pEXHQM6cuaF7A=' sk_file=/etc/salt/pki/master/nacl salt...
salt/utils/nacl.py
def sealedbox_decrypt(data, **kwargs): ''' Decrypt data using a secret key that was encrypted using a public key with `nacl.sealedbox_encrypt`. CLI Examples: .. code-block:: bash salt-call nacl.sealedbox_decrypt pEXHQM6cuaF7A= salt-call --local nacl.sealedbox_decrypt data='pEXHQM6cuaF...
def sealedbox_decrypt(data, **kwargs): ''' Decrypt data using a secret key that was encrypted using a public key with `nacl.sealedbox_encrypt`. CLI Examples: .. code-block:: bash salt-call nacl.sealedbox_decrypt pEXHQM6cuaF7A= salt-call --local nacl.sealedbox_decrypt data='pEXHQM6cuaF...
[ "Decrypt", "data", "using", "a", "secret", "key", "that", "was", "encrypted", "using", "a", "public", "key", "with", "nacl", ".", "sealedbox_encrypt", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/nacl.py#L329-L350
[ "def", "sealedbox_decrypt", "(", "data", ",", "*", "*", "kwargs", ")", ":", "if", "data", "is", "None", ":", "return", "None", "# ensure data is in bytes", "data", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_bytes", "(", "data", ")", "sk", "=...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
secretbox_encrypt
Encrypt data using a secret key generated from `nacl.keygen`. The same secret key can be used to decrypt the data using `nacl.secretbox_decrypt`. CLI Examples: .. code-block:: bash salt-run nacl.secretbox_encrypt datatoenc salt-call --local nacl.secretbox_encrypt datatoenc sk_file=/etc/sa...
salt/utils/nacl.py
def secretbox_encrypt(data, **kwargs): ''' Encrypt data using a secret key generated from `nacl.keygen`. The same secret key can be used to decrypt the data using `nacl.secretbox_decrypt`. CLI Examples: .. code-block:: bash salt-run nacl.secretbox_encrypt datatoenc salt-call --loc...
def secretbox_encrypt(data, **kwargs): ''' Encrypt data using a secret key generated from `nacl.keygen`. The same secret key can be used to decrypt the data using `nacl.secretbox_decrypt`. CLI Examples: .. code-block:: bash salt-run nacl.secretbox_encrypt datatoenc salt-call --loc...
[ "Encrypt", "data", "using", "a", "secret", "key", "generated", "from", "nacl", ".", "keygen", ".", "The", "same", "secret", "key", "can", "be", "used", "to", "decrypt", "the", "data", "using", "nacl", ".", "secretbox_decrypt", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/nacl.py#L353-L371
[ "def", "secretbox_encrypt", "(", "data", ",", "*", "*", "kwargs", ")", ":", "# ensure data is in bytes", "data", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_bytes", "(", "data", ")", "sk", "=", "_get_sk", "(", "*", "*", "kwargs", ")", "b", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
secretbox_decrypt
Decrypt data that was encrypted using `nacl.secretbox_encrypt` using the secret key that was generated from `nacl.keygen`. CLI Examples: .. code-block:: bash salt-call nacl.secretbox_decrypt pEXHQM6cuaF7A= salt-call --local nacl.secretbox_decrypt data='pEXHQM6cuaF7A=' sk_file=/etc/salt/pk...
salt/utils/nacl.py
def secretbox_decrypt(data, **kwargs): ''' Decrypt data that was encrypted using `nacl.secretbox_encrypt` using the secret key that was generated from `nacl.keygen`. CLI Examples: .. code-block:: bash salt-call nacl.secretbox_decrypt pEXHQM6cuaF7A= salt-call --local nacl.secretbox...
def secretbox_decrypt(data, **kwargs): ''' Decrypt data that was encrypted using `nacl.secretbox_encrypt` using the secret key that was generated from `nacl.keygen`. CLI Examples: .. code-block:: bash salt-call nacl.secretbox_decrypt pEXHQM6cuaF7A= salt-call --local nacl.secretbox...
[ "Decrypt", "data", "that", "was", "encrypted", "using", "nacl", ".", "secretbox_encrypt", "using", "the", "secret", "key", "that", "was", "generated", "from", "nacl", ".", "keygen", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/nacl.py#L374-L396
[ "def", "secretbox_decrypt", "(", "data", ",", "*", "*", "kwargs", ")", ":", "if", "data", "is", "None", ":", "return", "None", "# ensure data is in bytes", "data", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_bytes", "(", "data", ")", "key", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
present
Ensure the grafana dashboard exists and is managed. name Name of the grafana dashboard. base_dashboards_from_pillar A pillar key that contains a list of dashboards to inherit from base_panels_from_pillar A pillar key that contains a list of panels to inherit from base_rows_fr...
salt/states/grafana_dashboard.py
def present(name, base_dashboards_from_pillar=None, base_panels_from_pillar=None, base_rows_from_pillar=None, dashboard=None, profile='grafana'): ''' Ensure the grafana dashboard exists and is managed. name Name of the grafana dashboard. ...
def present(name, base_dashboards_from_pillar=None, base_panels_from_pillar=None, base_rows_from_pillar=None, dashboard=None, profile='grafana'): ''' Ensure the grafana dashboard exists and is managed. name Name of the grafana dashboard. ...
[ "Ensure", "the", "grafana", "dashboard", "exists", "and", "is", "managed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L63-L190
[ "def", "present", "(", "name", ",", "base_dashboards_from_pillar", "=", "None", ",", "base_panels_from_pillar", "=", "None", ",", "base_rows_from_pillar", "=", "None", ",", "dashboard", "=", "None", ",", "profile", "=", "'grafana'", ")", ":", "ret", "=", "{", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
absent
Ensure the named grafana dashboard is absent. name Name of the grafana dashboard. profile A pillar key or dict that contains grafana information
salt/states/grafana_dashboard.py
def absent(name, profile='grafana'): ''' Ensure the named grafana dashboard is absent. name Name of the grafana dashboard. profile A pillar key or dict that contains grafana information ''' ret = {'name': name, 'result': True, 'comment': '', 'changes': {}} if isinstance(pr...
def absent(name, profile='grafana'): ''' Ensure the named grafana dashboard is absent. name Name of the grafana dashboard. profile A pillar key or dict that contains grafana information ''' ret = {'name': name, 'result': True, 'comment': '', 'changes': {}} if isinstance(pr...
[ "Ensure", "the", "named", "grafana", "dashboard", "is", "absent", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L193-L222
[ "def", "absent", "(", "name", ",", "profile", "=", "'grafana'", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}", "if", "isinstance", "(", "profile", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_cleaned
Return a copy without fields that can differ.
salt/states/grafana_dashboard.py
def _cleaned(_dashboard): '''Return a copy without fields that can differ.''' dashboard = copy.deepcopy(_dashboard) for ignored_dashboard_field in _IGNORED_DASHBOARD_FIELDS: dashboard.pop(ignored_dashboard_field, None) for row in dashboard.get('rows', []): for ignored_row_field in _IGNO...
def _cleaned(_dashboard): '''Return a copy without fields that can differ.''' dashboard = copy.deepcopy(_dashboard) for ignored_dashboard_field in _IGNORED_DASHBOARD_FIELDS: dashboard.pop(ignored_dashboard_field, None) for row in dashboard.get('rows', []): for ignored_row_field in _IGNO...
[ "Return", "a", "copy", "without", "fields", "that", "can", "differ", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L241-L258
[ "def", "_cleaned", "(", "_dashboard", ")", ":", "dashboard", "=", "copy", ".", "deepcopy", "(", "_dashboard", ")", "for", "ignored_dashboard_field", "in", "_IGNORED_DASHBOARD_FIELDS", ":", "dashboard", ".", "pop", "(", "ignored_dashboard_field", ",", "None", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_inherited_dashboard
Return a dashboard with properties from parents.
salt/states/grafana_dashboard.py
def _inherited_dashboard(dashboard, base_dashboards_from_pillar, ret): '''Return a dashboard with properties from parents.''' base_dashboards = [] for base_dashboard_from_pillar in base_dashboards_from_pillar: base_dashboard = __salt__['pillar.get'](base_dashboard_from_pillar) if base_dashbo...
def _inherited_dashboard(dashboard, base_dashboards_from_pillar, ret): '''Return a dashboard with properties from parents.''' base_dashboards = [] for base_dashboard_from_pillar in base_dashboards_from_pillar: base_dashboard = __salt__['pillar.get'](base_dashboard_from_pillar) if base_dashbo...
[ "Return", "a", "dashboard", "with", "properties", "from", "parents", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L261-L282
[ "def", "_inherited_dashboard", "(", "dashboard", ",", "base_dashboards_from_pillar", ",", "ret", ")", ":", "base_dashboards", "=", "[", "]", "for", "base_dashboard_from_pillar", "in", "base_dashboards_from_pillar", ":", "base_dashboard", "=", "__salt__", "[", "'pillar.g...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_inherited_row
Return a row with properties from parents.
salt/states/grafana_dashboard.py
def _inherited_row(row, base_rows_from_pillar, ret): '''Return a row with properties from parents.''' base_rows = [] for base_row_from_pillar in base_rows_from_pillar: base_row = __salt__['pillar.get'](base_row_from_pillar) if base_row: base_rows.append(base_row) elif bas...
def _inherited_row(row, base_rows_from_pillar, ret): '''Return a row with properties from parents.''' base_rows = [] for base_row_from_pillar in base_rows_from_pillar: base_row = __salt__['pillar.get'](base_row_from_pillar) if base_row: base_rows.append(base_row) elif bas...
[ "Return", "a", "row", "with", "properties", "from", "parents", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L285-L303
[ "def", "_inherited_row", "(", "row", ",", "base_rows_from_pillar", ",", "ret", ")", ":", "base_rows", "=", "[", "]", "for", "base_row_from_pillar", "in", "base_rows_from_pillar", ":", "base_row", "=", "__salt__", "[", "'pillar.get'", "]", "(", "base_row_from_pilla...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_inherited_panel
Return a panel with properties from parents.
salt/states/grafana_dashboard.py
def _inherited_panel(panel, base_panels_from_pillar, ret): '''Return a panel with properties from parents.''' base_panels = [] for base_panel_from_pillar in base_panels_from_pillar: base_panel = __salt__['pillar.get'](base_panel_from_pillar) if base_panel: base_panels.append(base...
def _inherited_panel(panel, base_panels_from_pillar, ret): '''Return a panel with properties from parents.''' base_panels = [] for base_panel_from_pillar in base_panels_from_pillar: base_panel = __salt__['pillar.get'](base_panel_from_pillar) if base_panel: base_panels.append(base...
[ "Return", "a", "panel", "with", "properties", "from", "parents", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L306-L324
[ "def", "_inherited_panel", "(", "panel", ",", "base_panels_from_pillar", ",", "ret", ")", ":", "base_panels", "=", "[", "]", "for", "base_panel_from_pillar", "in", "base_panels_from_pillar", ":", "base_panel", "=", "__salt__", "[", "'pillar.get'", "]", "(", "base_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_auto_adjust_panel_spans
Adjust panel spans to take up the available width. For each group of panels that would be laid out on the same level, scale up the unspecified panel spans to fill up the level.
salt/states/grafana_dashboard.py
def _auto_adjust_panel_spans(dashboard): '''Adjust panel spans to take up the available width. For each group of panels that would be laid out on the same level, scale up the unspecified panel spans to fill up the level. ''' for row in dashboard.get('rows', []): levels = [] current_...
def _auto_adjust_panel_spans(dashboard): '''Adjust panel spans to take up the available width. For each group of panels that would be laid out on the same level, scale up the unspecified panel spans to fill up the level. ''' for row in dashboard.get('rows', []): levels = [] current_...
[ "Adjust", "panel", "spans", "to", "take", "up", "the", "available", "width", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L331-L362
[ "def", "_auto_adjust_panel_spans", "(", "dashboard", ")", ":", "for", "row", "in", "dashboard", ".", "get", "(", "'rows'", ",", "[", "]", ")", ":", "levels", "=", "[", "]", "current_level", "=", "[", "]", "levels", ".", "append", "(", "current_level", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_ensure_pinned_rows
Pin rows to the top of the dashboard.
salt/states/grafana_dashboard.py
def _ensure_pinned_rows(dashboard): '''Pin rows to the top of the dashboard.''' pinned_row_titles = __salt__['pillar.get'](_PINNED_ROWS_PILLAR) if not pinned_row_titles: return pinned_row_titles_lower = [] for title in pinned_row_titles: pinned_row_titles_lower.append(title.lower())...
def _ensure_pinned_rows(dashboard): '''Pin rows to the top of the dashboard.''' pinned_row_titles = __salt__['pillar.get'](_PINNED_ROWS_PILLAR) if not pinned_row_titles: return pinned_row_titles_lower = [] for title in pinned_row_titles: pinned_row_titles_lower.append(title.lower())...
[ "Pin", "rows", "to", "the", "top", "of", "the", "dashboard", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L365-L380
[ "def", "_ensure_pinned_rows", "(", "dashboard", ")", ":", "pinned_row_titles", "=", "__salt__", "[", "'pillar.get'", "]", "(", "_PINNED_ROWS_PILLAR", ")", "if", "not", "pinned_row_titles", ":", "return", "pinned_row_titles_lower", "=", "[", "]", "for", "title", "i...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_ensure_panel_ids
Assign panels auto-incrementing IDs.
salt/states/grafana_dashboard.py
def _ensure_panel_ids(dashboard): '''Assign panels auto-incrementing IDs.''' panel_id = 1 for row in dashboard.get('rows', []): for panel in row.get('panels', []): panel['id'] = panel_id panel_id += 1
def _ensure_panel_ids(dashboard): '''Assign panels auto-incrementing IDs.''' panel_id = 1 for row in dashboard.get('rows', []): for panel in row.get('panels', []): panel['id'] = panel_id panel_id += 1
[ "Assign", "panels", "auto", "-", "incrementing", "IDs", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L383-L389
[ "def", "_ensure_panel_ids", "(", "dashboard", ")", ":", "panel_id", "=", "1", "for", "row", "in", "dashboard", ".", "get", "(", "'rows'", ",", "[", "]", ")", ":", "for", "panel", "in", "row", ".", "get", "(", "'panels'", ",", "[", "]", ")", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_ensure_annotations
Explode annotation_tags into annotations.
salt/states/grafana_dashboard.py
def _ensure_annotations(dashboard): '''Explode annotation_tags into annotations.''' if 'annotation_tags' not in dashboard: return tags = dashboard['annotation_tags'] annotations = { 'enable': True, 'list': [], } for tag in tags: annotations['list'].append({ ...
def _ensure_annotations(dashboard): '''Explode annotation_tags into annotations.''' if 'annotation_tags' not in dashboard: return tags = dashboard['annotation_tags'] annotations = { 'enable': True, 'list': [], } for tag in tags: annotations['list'].append({ ...
[ "Explode", "annotation_tags", "into", "annotations", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L392-L413
[ "def", "_ensure_annotations", "(", "dashboard", ")", ":", "if", "'annotation_tags'", "not", "in", "dashboard", ":", "return", "tags", "=", "dashboard", "[", "'annotation_tags'", "]", "annotations", "=", "{", "'enable'", ":", "True", ",", "'list'", ":", "[", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get
Get a specific dashboard.
salt/states/grafana_dashboard.py
def _get(url, profile): '''Get a specific dashboard.''' request_url = "{0}/api/dashboards/{1}".format(profile.get('grafana_url'), url) response = requests.get( request_url, headers={ "Accept": "application/json", "Auth...
def _get(url, profile): '''Get a specific dashboard.''' request_url = "{0}/api/dashboards/{1}".format(profile.get('grafana_url'), url) response = requests.get( request_url, headers={ "Accept": "application/json", "Auth...
[ "Get", "a", "specific", "dashboard", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L416-L433
[ "def", "_get", "(", "url", ",", "profile", ")", ":", "request_url", "=", "\"{0}/api/dashboards/{1}\"", ".", "format", "(", "profile", ".", "get", "(", "'grafana_url'", ")", ",", "url", ")", "response", "=", "requests", ".", "get", "(", "request_url", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_delete
Delete a specific dashboard.
salt/states/grafana_dashboard.py
def _delete(url, profile): '''Delete a specific dashboard.''' request_url = "{0}/api/dashboards/{1}".format(profile.get('grafana_url'), url) response = requests.delete( request_url, headers={ "Accept": "application/json", ...
def _delete(url, profile): '''Delete a specific dashboard.''' request_url = "{0}/api/dashboards/{1}".format(profile.get('grafana_url'), url) response = requests.delete( request_url, headers={ "Accept": "application/json", ...
[ "Delete", "a", "specific", "dashboard", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L436-L449
[ "def", "_delete", "(", "url", ",", "profile", ")", ":", "request_url", "=", "\"{0}/api/dashboards/{1}\"", ".", "format", "(", "profile", ".", "get", "(", "'grafana_url'", ")", ",", "url", ")", "response", "=", "requests", ".", "delete", "(", "request_url", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_update
Update a specific dashboard.
salt/states/grafana_dashboard.py
def _update(dashboard, profile): '''Update a specific dashboard.''' payload = { 'dashboard': dashboard, 'overwrite': True } request_url = "{0}/api/dashboards/db".format(profile.get('grafana_url')) response = requests.post( request_url, headers={ "Authoriza...
def _update(dashboard, profile): '''Update a specific dashboard.''' payload = { 'dashboard': dashboard, 'overwrite': True } request_url = "{0}/api/dashboards/db".format(profile.get('grafana_url')) response = requests.post( request_url, headers={ "Authoriza...
[ "Update", "a", "specific", "dashboard", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L452-L466
[ "def", "_update", "(", "dashboard", ",", "profile", ")", ":", "payload", "=", "{", "'dashboard'", ":", "dashboard", ",", "'overwrite'", ":", "True", "}", "request_url", "=", "\"{0}/api/dashboards/db\"", ".", "format", "(", "profile", ".", "get", "(", "'grafa...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_dashboard_diff
Return a dictionary of changes between dashboards.
salt/states/grafana_dashboard.py
def _dashboard_diff(_new_dashboard, _old_dashboard): '''Return a dictionary of changes between dashboards.''' diff = {} # Dashboard diff new_dashboard = copy.deepcopy(_new_dashboard) old_dashboard = copy.deepcopy(_old_dashboard) dashboard_diff = DictDiffer(new_dashboard, old_dashboard) diff...
def _dashboard_diff(_new_dashboard, _old_dashboard): '''Return a dictionary of changes between dashboards.''' diff = {} # Dashboard diff new_dashboard = copy.deepcopy(_new_dashboard) old_dashboard = copy.deepcopy(_old_dashboard) dashboard_diff = DictDiffer(new_dashboard, old_dashboard) diff...
[ "Return", "a", "dictionary", "of", "changes", "between", "dashboards", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L469-L537
[ "def", "_dashboard_diff", "(", "_new_dashboard", ",", "_old_dashboard", ")", ":", "diff", "=", "{", "}", "# Dashboard diff", "new_dashboard", "=", "copy", ".", "deepcopy", "(", "_new_dashboard", ")", "old_dashboard", "=", "copy", ".", "deepcopy", "(", "_old_dash...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_stripped
Strip falsey entries.
salt/states/grafana_dashboard.py
def _stripped(d): '''Strip falsey entries.''' ret = {} for k, v in six.iteritems(d): if v: ret[k] = v return ret
def _stripped(d): '''Strip falsey entries.''' ret = {} for k, v in six.iteritems(d): if v: ret[k] = v return ret
[ "Strip", "falsey", "entries", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_dashboard.py#L540-L546
[ "def", "_stripped", "(", "d", ")", ":", "ret", "=", "{", "}", "for", "k", ",", "v", "in", "six", ".", "iteritems", "(", "d", ")", ":", "if", "v", ":", "ret", "[", "k", "]", "=", "v", "return", "ret" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_retrieve_channel_id
Given an email address, checks the local cache if corresponding email address: channel_id mapping exists email Email escalation policy profile A dict of telemetry config information.
salt/modules/telemetry.py
def _retrieve_channel_id(email, profile='telemetry'): ''' Given an email address, checks the local cache if corresponding email address: channel_id mapping exists email Email escalation policy profile A dict of telemetry config information. ''' key = "telemetry.channels"...
def _retrieve_channel_id(email, profile='telemetry'): ''' Given an email address, checks the local cache if corresponding email address: channel_id mapping exists email Email escalation policy profile A dict of telemetry config information. ''' key = "telemetry.channels"...
[ "Given", "an", "email", "address", "checks", "the", "local", "cache", "if", "corresponding", "email", "address", ":", "channel_id", "mapping", "exists" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/telemetry.py#L91-L116
[ "def", "_retrieve_channel_id", "(", "email", ",", "profile", "=", "'telemetry'", ")", ":", "key", "=", "\"telemetry.channels\"", "auth", "=", "_auth", "(", "profile", "=", "profile", ")", "if", "key", "not", "in", "__context__", ":", "get_url", "=", "_get_te...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_alert_config
Get all alert definitions associated with a given deployment or if metric_name is specified, obtain the specific alert config Returns dictionary or list of dictionaries. CLI Example: salt myminion telemetry.get_alert_config rs-ds033197 currentConnections profile=telemetry salt myminion te...
salt/modules/telemetry.py
def get_alert_config(deployment_id, metric_name=None, api_key=None, profile="telemetry"): ''' Get all alert definitions associated with a given deployment or if metric_name is specified, obtain the specific alert config Returns dictionary or list of dictionaries. CLI Example: salt myminio...
def get_alert_config(deployment_id, metric_name=None, api_key=None, profile="telemetry"): ''' Get all alert definitions associated with a given deployment or if metric_name is specified, obtain the specific alert config Returns dictionary or list of dictionaries. CLI Example: salt myminio...
[ "Get", "all", "alert", "definitions", "associated", "with", "a", "given", "deployment", "or", "if", "metric_name", "is", "specified", "obtain", "the", "specific", "alert", "config" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/telemetry.py#L119-L159
[ "def", "get_alert_config", "(", "deployment_id", ",", "metric_name", "=", "None", ",", "api_key", "=", "None", ",", "profile", "=", "\"telemetry\"", ")", ":", "auth", "=", "_auth", "(", "profile", "=", "profile", ")", "alert", "=", "False", "key", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_notification_channel_id
Given an email address, creates a notification-channels if one is not found and also returns the corresponding notification channel id. notify_channel Email escalation policy profile A dict of telemetry config information. CLI Example: salt myminion telemetry.get_notificat...
salt/modules/telemetry.py
def get_notification_channel_id(notify_channel, profile="telemetry"): ''' Given an email address, creates a notification-channels if one is not found and also returns the corresponding notification channel id. notify_channel Email escalation policy profile A dict of telemetry co...
def get_notification_channel_id(notify_channel, profile="telemetry"): ''' Given an email address, creates a notification-channels if one is not found and also returns the corresponding notification channel id. notify_channel Email escalation policy profile A dict of telemetry co...
[ "Given", "an", "email", "address", "creates", "a", "notification", "-", "channels", "if", "one", "is", "not", "found", "and", "also", "returns", "the", "corresponding", "notification", "channel", "id", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/telemetry.py#L162-L203
[ "def", "get_notification_channel_id", "(", "notify_channel", ",", "profile", "=", "\"telemetry\"", ")", ":", "# This helper is used to procure the channel ids", "# used to notify when the alarm threshold is violated", "auth", "=", "_auth", "(", "profile", "=", "profile", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_alarms
get all the alarms set up against the current deployment Returns dictionary of alarm information CLI Example: salt myminion telemetry.get_alarms rs-ds033197 profile=telemetry
salt/modules/telemetry.py
def get_alarms(deployment_id, profile="telemetry"): ''' get all the alarms set up against the current deployment Returns dictionary of alarm information CLI Example: salt myminion telemetry.get_alarms rs-ds033197 profile=telemetry ''' auth = _auth(profile=profile) try: r...
def get_alarms(deployment_id, profile="telemetry"): ''' get all the alarms set up against the current deployment Returns dictionary of alarm information CLI Example: salt myminion telemetry.get_alarms rs-ds033197 profile=telemetry ''' auth = _auth(profile=profile) try: r...
[ "get", "all", "the", "alarms", "set", "up", "against", "the", "current", "deployment" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/telemetry.py#L206-L234
[ "def", "get_alarms", "(", "deployment_id", ",", "profile", "=", "\"telemetry\"", ")", ":", "auth", "=", "_auth", "(", "profile", "=", "profile", ")", "try", ":", "response", "=", "requests", ".", "get", "(", "_get_telemetry_base", "(", "profile", ")", "+",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_alarm
create an telemetry alarms. data is a dict of alert configuration data. Returns (bool success, str message) tuple. CLI Example: salt myminion telemetry.create_alarm rs-ds033197 {} profile=telemetry
salt/modules/telemetry.py
def create_alarm(deployment_id, metric_name, data, api_key=None, profile="telemetry"): ''' create an telemetry alarms. data is a dict of alert configuration data. Returns (bool success, str message) tuple. CLI Example: salt myminion telemetry.create_alarm rs-ds033197 {} profile=telemetry...
def create_alarm(deployment_id, metric_name, data, api_key=None, profile="telemetry"): ''' create an telemetry alarms. data is a dict of alert configuration data. Returns (bool success, str message) tuple. CLI Example: salt myminion telemetry.create_alarm rs-ds033197 {} profile=telemetry...
[ "create", "an", "telemetry", "alarms", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/telemetry.py#L237-L287
[ "def", "create_alarm", "(", "deployment_id", ",", "metric_name", ",", "data", ",", "api_key", "=", "None", ",", "profile", "=", "\"telemetry\"", ")", ":", "auth", "=", "_auth", "(", "api_key", ",", "profile", ")", "request_uri", "=", "_get_telemetry_base", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update_alarm
update an telemetry alarms. data is a dict of alert configuration data. Returns (bool success, str message) tuple. CLI Example: salt myminion telemetry.update_alarm rs-ds033197 {} profile=telemetry
salt/modules/telemetry.py
def update_alarm(deployment_id, metric_name, data, api_key=None, profile="telemetry"): ''' update an telemetry alarms. data is a dict of alert configuration data. Returns (bool success, str message) tuple. CLI Example: salt myminion telemetry.update_alarm rs-ds033197 {} profile=telemetry ...
def update_alarm(deployment_id, metric_name, data, api_key=None, profile="telemetry"): ''' update an telemetry alarms. data is a dict of alert configuration data. Returns (bool success, str message) tuple. CLI Example: salt myminion telemetry.update_alarm rs-ds033197 {} profile=telemetry ...
[ "update", "an", "telemetry", "alarms", ".", "data", "is", "a", "dict", "of", "alert", "configuration", "data", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/telemetry.py#L290-L343
[ "def", "update_alarm", "(", "deployment_id", ",", "metric_name", ",", "data", ",", "api_key", "=", "None", ",", "profile", "=", "\"telemetry\"", ")", ":", "auth", "=", "_auth", "(", "api_key", ",", "profile", ")", "alert", "=", "get_alert_config", "(", "de...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete_alarms
delete an alert specified by alert_id or if not specified blows away all the alerts in the current deployment. Returns (bool success, str message) tuple. CLI Example: salt myminion telemetry.delete_alarms rs-ds033197 profile=telemetry
salt/modules/telemetry.py
def delete_alarms(deployment_id, alert_id=None, metric_name=None, api_key=None, profile='telemetry'): '''delete an alert specified by alert_id or if not specified blows away all the alerts in the current deployment. Returns (bool success, str message) tuple. CLI Example: salt myminion te...
def delete_alarms(deployment_id, alert_id=None, metric_name=None, api_key=None, profile='telemetry'): '''delete an alert specified by alert_id or if not specified blows away all the alerts in the current deployment. Returns (bool success, str message) tuple. CLI Example: salt myminion te...
[ "delete", "an", "alert", "specified", "by", "alert_id", "or", "if", "not", "specified", "blows", "away", "all", "the", "alerts", "in", "the", "current", "deployment", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/telemetry.py#L346-L388
[ "def", "delete_alarms", "(", "deployment_id", ",", "alert_id", "=", "None", ",", "metric_name", "=", "None", ",", "api_key", "=", "None", ",", "profile", "=", "'telemetry'", ")", ":", "auth", "=", "_auth", "(", "profile", "=", "profile", ")", "if", "aler...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
__decompressContent
Decompress returned HTTP content depending on the specified encoding. Currently supports identity/none, deflate, and gzip, which should cover 99%+ of the content on the internet.
salt/utils/http.py
def __decompressContent(coding, pgctnt): ''' Decompress returned HTTP content depending on the specified encoding. Currently supports identity/none, deflate, and gzip, which should cover 99%+ of the content on the internet. ''' log.trace("Decompressing %s byte content with compression type: %s"...
def __decompressContent(coding, pgctnt): ''' Decompress returned HTTP content depending on the specified encoding. Currently supports identity/none, deflate, and gzip, which should cover 99%+ of the content on the internet. ''' log.trace("Decompressing %s byte content with compression type: %s"...
[ "Decompress", "returned", "HTTP", "content", "depending", "on", "the", "specified", "encoding", ".", "Currently", "supports", "identity", "/", "none", "deflate", "and", "gzip", "which", "should", "cover", "99%", "+", "of", "the", "content", "on", "the", "inter...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L101-L129
[ "def", "__decompressContent", "(", "coding", ",", "pgctnt", ")", ":", "log", ".", "trace", "(", "\"Decompressing %s byte content with compression type: %s\"", ",", "len", "(", "pgctnt", ")", ",", "coding", ")", "if", "coding", "==", "'deflate'", ":", "pgctnt", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
query
Query a resource, and decode the return data
salt/utils/http.py
def query(url, method='GET', params=None, data=None, data_file=None, header_dict=None, header_list=None, header_file=None, username=None, password=None, auth=None, decode=False, decode_type='auto', ...
def query(url, method='GET', params=None, data=None, data_file=None, header_dict=None, header_list=None, header_file=None, username=None, password=None, auth=None, decode=False, decode_type='auto', ...
[ "Query", "a", "resource", "and", "decode", "the", "return", "data" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L133-L700
[ "def", "query", "(", "url", ",", "method", "=", "'GET'", ",", "params", "=", "None", ",", "data", "=", "None", ",", "data_file", "=", "None", ",", "header_dict", "=", "None", ",", "header_list", "=", "None", ",", "header_file", "=", "None", ",", "use...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_ca_bundle
Return the location of the ca bundle file. See the following article: http://tinyurl.com/k7rx42a
salt/utils/http.py
def get_ca_bundle(opts=None): ''' Return the location of the ca bundle file. See the following article: http://tinyurl.com/k7rx42a ''' if hasattr(get_ca_bundle, '__return_value__'): return get_ca_bundle.__return_value__ if opts is None: opts = {} opts_bundle = opts.get...
def get_ca_bundle(opts=None): ''' Return the location of the ca bundle file. See the following article: http://tinyurl.com/k7rx42a ''' if hasattr(get_ca_bundle, '__return_value__'): return get_ca_bundle.__return_value__ if opts is None: opts = {} opts_bundle = opts.get...
[ "Return", "the", "location", "of", "the", "ca", "bundle", "file", ".", "See", "the", "following", "article", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L703-L750
[ "def", "get_ca_bundle", "(", "opts", "=", "None", ")", ":", "if", "hasattr", "(", "get_ca_bundle", ",", "'__return_value__'", ")", ":", "return", "get_ca_bundle", ".", "__return_value__", "if", "opts", "is", "None", ":", "opts", "=", "{", "}", "opts_bundle",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update_ca_bundle
Attempt to update the CA bundle file from a URL If not specified, the local location on disk (``target``) will be auto-detected, if possible. If it is not found, then a new location on disk will be created and updated. The default ``source`` is: http://curl.haxx.se/ca/cacert.pem This is ...
salt/utils/http.py
def update_ca_bundle( target=None, source=None, opts=None, merge_files=None, ): ''' Attempt to update the CA bundle file from a URL If not specified, the local location on disk (``target``) will be auto-detected, if possible. If it is not found, then a new locati...
def update_ca_bundle( target=None, source=None, opts=None, merge_files=None, ): ''' Attempt to update the CA bundle file from a URL If not specified, the local location on disk (``target``) will be auto-detected, if possible. If it is not found, then a new locati...
[ "Attempt", "to", "update", "the", "CA", "bundle", "file", "from", "a", "URL" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L753-L836
[ "def", "update_ca_bundle", "(", "target", "=", "None", ",", "source", "=", "None", ",", "opts", "=", "None", ",", "merge_files", "=", "None", ",", ")", ":", "if", "opts", "is", "None", ":", "opts", "=", "{", "}", "if", "target", "is", "None", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_render
Render a template
salt/utils/http.py
def _render(template, render, renderer, template_dict, opts): ''' Render a template ''' if render: if template_dict is None: template_dict = {} if not renderer: renderer = opts.get('renderer', 'jinja|yaml') rend = salt.loader.render(opts, {}) black...
def _render(template, render, renderer, template_dict, opts): ''' Render a template ''' if render: if template_dict is None: template_dict = {} if not renderer: renderer = opts.get('renderer', 'jinja|yaml') rend = salt.loader.render(opts, {}) black...
[ "Render", "a", "template" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L839-L858
[ "def", "_render", "(", "template", ",", "render", ",", "renderer", ",", "template_dict", ",", "opts", ")", ":", "if", "render", ":", "if", "template_dict", "is", "None", ":", "template_dict", "=", "{", "}", "if", "not", "renderer", ":", "renderer", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
parse_cookie_header
Parse the "Set-cookie" header, and return a list of cookies. This function is here because Tornado's HTTPClient doesn't handle cookies.
salt/utils/http.py
def parse_cookie_header(header): ''' Parse the "Set-cookie" header, and return a list of cookies. This function is here because Tornado's HTTPClient doesn't handle cookies. ''' attribs = ('expires', 'path', 'domain', 'version', 'httponly', 'secure', 'comment', 'max-age') # Split into cookie(s)...
def parse_cookie_header(header): ''' Parse the "Set-cookie" header, and return a list of cookies. This function is here because Tornado's HTTPClient doesn't handle cookies. ''' attribs = ('expires', 'path', 'domain', 'version', 'httponly', 'secure', 'comment', 'max-age') # Split into cookie(s)...
[ "Parse", "the", "Set", "-", "cookie", "header", "and", "return", "a", "list", "of", "cookies", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L861-L953
[ "def", "parse_cookie_header", "(", "header", ")", ":", "attribs", "=", "(", "'expires'", ",", "'path'", ",", "'domain'", ",", "'version'", ",", "'httponly'", ",", "'secure'", ",", "'comment'", ",", "'max-age'", ")", "# Split into cookie(s); handles headers with mult...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sanitize_url
Make sure no secret fields show up in logs
salt/utils/http.py
def sanitize_url(url, hide_fields): ''' Make sure no secret fields show up in logs ''' if isinstance(hide_fields, list): url_comps = splitquery(url) log_url = url_comps[0] if len(url_comps) > 1: log_url += '?' for pair in url_comps[1:]: url_tmp = N...
def sanitize_url(url, hide_fields): ''' Make sure no secret fields show up in logs ''' if isinstance(hide_fields, list): url_comps = splitquery(url) log_url = url_comps[0] if len(url_comps) > 1: log_url += '?' for pair in url_comps[1:]: url_tmp = N...
[ "Make", "sure", "no", "secret", "fields", "show", "up", "in", "logs" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L956-L977
[ "def", "sanitize_url", "(", "url", ",", "hide_fields", ")", ":", "if", "isinstance", "(", "hide_fields", ",", "list", ")", ":", "url_comps", "=", "splitquery", "(", "url", ")", "log_url", "=", "url_comps", "[", "0", "]", "if", "len", "(", "url_comps", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_sanitize_url_components
Recursive function to sanitize each component of the url.
salt/utils/http.py
def _sanitize_url_components(comp_list, field): ''' Recursive function to sanitize each component of the url. ''' if not comp_list: return '' elif comp_list[0].startswith('{0}='.format(field)): ret = '{0}=XXXXXXXXXX&'.format(field) comp_list.remove(comp_list[0]) retur...
def _sanitize_url_components(comp_list, field): ''' Recursive function to sanitize each component of the url. ''' if not comp_list: return '' elif comp_list[0].startswith('{0}='.format(field)): ret = '{0}=XXXXXXXXXX&'.format(field) comp_list.remove(comp_list[0]) retur...
[ "Recursive", "function", "to", "sanitize", "each", "component", "of", "the", "url", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/http.py#L980-L993
[ "def", "_sanitize_url_components", "(", "comp_list", ",", "field", ")", ":", "if", "not", "comp_list", ":", "return", "''", "elif", "comp_list", "[", "0", "]", ".", "startswith", "(", "'{0}='", ".", "format", "(", "field", ")", ")", ":", "ret", "=", "'...
e8541fd6e744ab0df786c0f76102e41631f45d46