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
unpack
.. versionadded:: 2018.3.4 Wraps msgpack.unpack. By default, this function uses the msgpack module and falls back to msgpack_pure, if the msgpack is not available. You can pass an alternate msgpack module using the _msgpack_module argument.
salt/utils/msgpack.py
def unpack(stream, **kwargs): ''' .. versionadded:: 2018.3.4 Wraps msgpack.unpack. By default, this function uses the msgpack module and falls back to msgpack_pure, if the msgpack is not available. You can pass an alternate msgpack module using the _msgpack_module argument. ''' msgpack...
def unpack(stream, **kwargs): ''' .. versionadded:: 2018.3.4 Wraps msgpack.unpack. By default, this function uses the msgpack module and falls back to msgpack_pure, if the msgpack is not available. You can pass an alternate msgpack module using the _msgpack_module argument. ''' msgpack...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "4" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/msgpack.py#L62-L73
[ "def", "unpack", "(", "stream", ",", "*", "*", "kwargs", ")", ":", "msgpack_module", "=", "kwargs", ".", "pop", "(", "'_msgpack_module'", ",", "msgpack", ")", "return", "msgpack_module", ".", "unpack", "(", "stream", ",", "*", "*", "kwargs", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
unpackb
.. versionadded:: 2018.3.4 Wraps msgpack.unpack. By default, this function uses the msgpack module and falls back to msgpack_pure, if the msgpack is not available. You can pass an alternate msgpack module using the _msgpack_module argument.
salt/utils/msgpack.py
def unpackb(packed, **kwargs): ''' .. versionadded:: 2018.3.4 Wraps msgpack.unpack. By default, this function uses the msgpack module and falls back to msgpack_pure, if the msgpack is not available. You can pass an alternate msgpack module using the _msgpack_module argument. ''' msgpac...
def unpackb(packed, **kwargs): ''' .. versionadded:: 2018.3.4 Wraps msgpack.unpack. By default, this function uses the msgpack module and falls back to msgpack_pure, if the msgpack is not available. You can pass an alternate msgpack module using the _msgpack_module argument. ''' msgpac...
[ "..", "versionadded", "::", "2018", ".", "3", ".", "4" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/msgpack.py#L76-L87
[ "def", "unpackb", "(", "packed", ",", "*", "*", "kwargs", ")", ":", "msgpack_module", "=", "kwargs", ".", "pop", "(", "'_msgpack_module'", ",", "msgpack", ")", "return", "msgpack_module", ".", "unpackb", "(", "packed", ",", "*", "*", "kwargs", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
timeout
If any minion's status is older than the timeout value then apply the given action to the timed out key. This example will remove keys to minions that have not checked in for 300 seconds (5 minutes) USAGE: .. code-block:: yaml statreg: status.reg clean_keys: key.t...
salt/thorium/key.py
def timeout(name, delete=0, reject=0): ''' If any minion's status is older than the timeout value then apply the given action to the timed out key. This example will remove keys to minions that have not checked in for 300 seconds (5 minutes) USAGE: .. code-block:: yaml statreg: ...
def timeout(name, delete=0, reject=0): ''' If any minion's status is older than the timeout value then apply the given action to the timed out key. This example will remove keys to minions that have not checked in for 300 seconds (5 minutes) USAGE: .. code-block:: yaml statreg: ...
[ "If", "any", "minion", "s", "status", "is", "older", "than", "the", "timeout", "value", "then", "apply", "the", "given", "action", "to", "the", "timed", "out", "key", ".", "This", "example", "will", "remove", "keys", "to", "minions", "that", "have", "not...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/thorium/key.py#L24-L80
[ "def", "timeout", "(", "name", ",", "delete", "=", "0", ",", "reject", "=", "0", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", ",", "'result'", ":", "True", "}", "now", "=", "tim...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_notifier
Check the context for the notifier and construct it if not present
salt/beacons/inotify.py
def _get_notifier(config): ''' Check the context for the notifier and construct it if not present ''' if 'inotify.notifier' not in __context__: __context__['inotify.queue'] = collections.deque() wm = pyinotify.WatchManager() __context__['inotify.notifier'] = pyinotify.Notifier(wm...
def _get_notifier(config): ''' Check the context for the notifier and construct it if not present ''' if 'inotify.notifier' not in __context__: __context__['inotify.queue'] = collections.deque() wm = pyinotify.WatchManager() __context__['inotify.notifier'] = pyinotify.Notifier(wm...
[ "Check", "the", "context", "for", "the", "notifier", "and", "construct", "it", "if", "not", "present" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/inotify.py#L70-L82
[ "def", "_get_notifier", "(", "config", ")", ":", "if", "'inotify.notifier'", "not", "in", "__context__", ":", "__context__", "[", "'inotify.queue'", "]", "=", "collections", ".", "deque", "(", ")", "wm", "=", "pyinotify", ".", "WatchManager", "(", ")", "__co...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
validate
Validate the beacon configuration
salt/beacons/inotify.py
def validate(config): ''' Validate the beacon configuration ''' VALID_MASK = [ 'access', 'attrib', 'close_nowrite', 'close_write', 'create', 'delete', 'delete_self', 'excl_unlink', 'ignored', 'modify', 'moved_from',...
def validate(config): ''' Validate the beacon configuration ''' VALID_MASK = [ 'access', 'attrib', 'close_nowrite', 'close_write', 'create', 'delete', 'delete_self', 'excl_unlink', 'ignored', 'modify', 'moved_from',...
[ "Validate", "the", "beacon", "configuration" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/inotify.py#L85-L150
[ "def", "validate", "(", "config", ")", ":", "VALID_MASK", "=", "[", "'access'", ",", "'attrib'", ",", "'close_nowrite'", ",", "'close_write'", ",", "'create'", ",", "'delete'", ",", "'delete_self'", ",", "'excl_unlink'", ",", "'ignored'", ",", "'modify'", ",",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
beacon
Watch the configured files Example Config .. code-block:: yaml beacons: inotify: - files: /path/to/file/or/dir: mask: - open - create - close_write recurse: True ...
salt/beacons/inotify.py
def beacon(config): ''' Watch the configured files Example Config .. code-block:: yaml beacons: inotify: - files: /path/to/file/or/dir: mask: - open - create - close_write ...
def beacon(config): ''' Watch the configured files Example Config .. code-block:: yaml beacons: inotify: - files: /path/to/file/or/dir: mask: - open - create - close_write ...
[ "Watch", "the", "configured", "files" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/inotify.py#L153-L323
[ "def", "beacon", "(", "config", ")", ":", "_config", "=", "{", "}", "list", "(", "map", "(", "_config", ".", "update", ",", "config", ")", ")", "ret", "=", "[", "]", "notifier", "=", "_get_notifier", "(", "_config", ")", "wm", "=", "notifier", ".",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_gem
Run the actual gem command. If rvm or rbenv is installed, run the command using the corresponding module. rbenv is not available on windows, so don't try. :param command: string Command to run :param ruby: string : None If RVM or rbenv are installed, the ruby version and gemset to use. Igno...
salt/modules/gem.py
def _gem(command, ruby=None, runas=None, gem_bin=None): ''' Run the actual gem command. If rvm or rbenv is installed, run the command using the corresponding module. rbenv is not available on windows, so don't try. :param command: string Command to run :param ruby: string : None If RVM ...
def _gem(command, ruby=None, runas=None, gem_bin=None): ''' Run the actual gem command. If rvm or rbenv is installed, run the command using the corresponding module. rbenv is not available on windows, so don't try. :param command: string Command to run :param ruby: string : None If RVM ...
[ "Run", "the", "actual", "gem", "command", ".", "If", "rvm", "or", "rbenv", "is", "installed", "run", "the", "command", "using", "the", "corresponding", "module", ".", "rbenv", "is", "not", "available", "on", "windows", "so", "don", "t", "try", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L23-L64
[ "def", "_gem", "(", "command", ",", "ruby", "=", "None", ",", "runas", "=", "None", ",", "gem_bin", "=", "None", ")", ":", "cmdline", "=", "[", "gem_bin", "or", "'gem'", "]", "+", "command", "# If a custom gem is given, use that and don't check for rvm/rbenv. Us...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
install
Installs one or several gems. :param gems: string The gems to install :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the ruby version and gemset to use. Ignored if ``gem_bin`` is specified. :par...
salt/modules/gem.py
def install(gems, # pylint: disable=C0103 ruby=None, gem_bin=None, runas=None, version=None, rdoc=False, ri=False, pre_releases=False, proxy=None, source=None): # pylint: disable=C0103 ''' ...
def install(gems, # pylint: disable=C0103 ruby=None, gem_bin=None, runas=None, version=None, rdoc=False, ri=False, pre_releases=False, proxy=None, source=None): # pylint: disable=C0103 ''' ...
[ "Installs", "one", "or", "several", "gems", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L67-L146
[ "def", "install", "(", "gems", ",", "# pylint: disable=C0103", "ruby", "=", "None", ",", "gem_bin", "=", "None", ",", "runas", "=", "None", ",", "version", "=", "None", ",", "rdoc", "=", "False", ",", "ri", "=", "False", ",", "pre_releases", "=", "Fals...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
uninstall
Uninstall one or several gems. :param gems: string The gems to uninstall. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the ruby version and gemset to use. Ignored if ``gem_bin`` is specified. ...
salt/modules/gem.py
def uninstall(gems, ruby=None, runas=None, gem_bin=None): ''' Uninstall one or several gems. :param gems: string The gems to uninstall. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the ruby versio...
def uninstall(gems, ruby=None, runas=None, gem_bin=None): ''' Uninstall one or several gems. :param gems: string The gems to uninstall. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the ruby versio...
[ "Uninstall", "one", "or", "several", "gems", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L149-L177
[ "def", "uninstall", "(", "gems", ",", "ruby", "=", "None", ",", "runas", "=", "None", ",", "gem_bin", "=", "None", ")", ":", "try", ":", "gems", "=", "gems", ".", "split", "(", ")", "except", "AttributeError", ":", "pass", "return", "_gem", "(", "[...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update
Update one or several gems. :param gems: string The gems to update. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the ruby version and gemset to use. Ignored if ``gem_bin`` is specified. :param...
salt/modules/gem.py
def update(gems, ruby=None, runas=None, gem_bin=None): ''' Update one or several gems. :param gems: string The gems to update. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the ruby version and gem...
def update(gems, ruby=None, runas=None, gem_bin=None): ''' Update one or several gems. :param gems: string The gems to update. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the ruby version and gem...
[ "Update", "one", "or", "several", "gems", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L180-L208
[ "def", "update", "(", "gems", ",", "ruby", "=", "None", ",", "runas", "=", "None", ",", "gem_bin", "=", "None", ")", ":", "try", ":", "gems", "=", "gems", ".", "split", "(", ")", "except", "AttributeError", ":", "pass", "return", "_gem", "(", "[", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update_system
Update rubygems. :param version: string : (newest) The version of rubygems to install. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the ruby version and gemset to use. Ignored if ``gem_bin`` is sp...
salt/modules/gem.py
def update_system(version='', ruby=None, runas=None, gem_bin=None): ''' Update rubygems. :param version: string : (newest) The version of rubygems to install. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are ins...
def update_system(version='', ruby=None, runas=None, gem_bin=None): ''' Update rubygems. :param version: string : (newest) The version of rubygems to install. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are ins...
[ "Update", "rubygems", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L211-L234
[ "def", "update_system", "(", "version", "=", "''", ",", "ruby", "=", "None", ",", "runas", "=", "None", ",", "gem_bin", "=", "None", ")", ":", "return", "_gem", "(", "[", "'update'", ",", "'--system'", ",", "version", "]", ",", "ruby", ",", "gem_bin"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
version
Print out the version of gem :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the ruby version and gemset to use. Ignored if ``gem_bin`` is specified. :param runas: string : None The user to run gem a...
salt/modules/gem.py
def version(ruby=None, runas=None, gem_bin=None): ''' Print out the version of gem :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the ruby version and gemset to use. Ignored if ``gem_bin`` is specified....
def version(ruby=None, runas=None, gem_bin=None): ''' Print out the version of gem :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the ruby version and gemset to use. Ignored if ``gem_bin`` is specified....
[ "Print", "out", "the", "version", "of", "gem" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L237-L266
[ "def", "version", "(", "ruby", "=", "None", ",", "runas", "=", "None", ",", "gem_bin", "=", "None", ")", ":", "cmd", "=", "[", "'--version'", "]", "stdout", "=", "_gem", "(", "cmd", ",", "ruby", ",", "gem_bin", "=", "gem_bin", ",", "runas", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_
List locally installed gems. :param prefix: string : Only list gems when the name matches this prefix. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the ruby version and gemset to use. Ignored if `...
salt/modules/gem.py
def list_(prefix='', ruby=None, runas=None, gem_bin=None): ''' List locally installed gems. :param prefix: string : Only list gems when the name matches this prefix. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv ...
def list_(prefix='', ruby=None, runas=None, gem_bin=None): ''' List locally installed gems. :param prefix: string : Only list gems when the name matches this prefix. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv ...
[ "List", "locally", "installed", "gems", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L276-L310
[ "def", "list_", "(", "prefix", "=", "''", ",", "ruby", "=", "None", ",", "runas", "=", "None", ",", "gem_bin", "=", "None", ")", ":", "cmd", "=", "[", "'list'", "]", "if", "prefix", ":", "cmd", ".", "append", "(", "prefix", ")", "stdout", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_upgrades
.. versionadded:: 2015.8.0 Check if an upgrade is available for installed gems gem_bin : None Full path to ``gem`` binary to use. ruby : None If RVM or rbenv are installed, the ruby version and gemset to use. Ignored if ``gem_bin`` is specified. runas : None The user to...
salt/modules/gem.py
def list_upgrades(ruby=None, runas=None, gem_bin=None): ''' .. versionadded:: 2015.8.0 Check if an upgrade is available for installed gems gem_bin : None Full path to ``gem`` binary to use. ruby : None If RVM or rbenv are installed, the ruby vers...
def list_upgrades(ruby=None, runas=None, gem_bin=None): ''' .. versionadded:: 2015.8.0 Check if an upgrade is available for installed gems gem_bin : None Full path to ``gem`` binary to use. ruby : None If RVM or rbenv are installed, the ruby vers...
[ "..", "versionadded", "::", "2015", ".", "8", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L313-L348
[ "def", "list_upgrades", "(", "ruby", "=", "None", ",", "runas", "=", "None", ",", "gem_bin", "=", "None", ")", ":", "result", "=", "_gem", "(", "[", "'outdated'", "]", ",", "ruby", ",", "gem_bin", "=", "gem_bin", ",", "runas", "=", "runas", ")", "r...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sources_add
Add a gem source. :param source_uri: string The source URI to add. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the ruby version and gemset to use. Ignored if ``gem_bin`` is specified. :param ...
salt/modules/gem.py
def sources_add(source_uri, ruby=None, runas=None, gem_bin=None): ''' Add a gem source. :param source_uri: string The source URI to add. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the ruby versi...
def sources_add(source_uri, ruby=None, runas=None, gem_bin=None): ''' Add a gem source. :param source_uri: string The source URI to add. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the ruby versi...
[ "Add", "a", "gem", "source", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L351-L374
[ "def", "sources_add", "(", "source_uri", ",", "ruby", "=", "None", ",", "runas", "=", "None", ",", "gem_bin", "=", "None", ")", ":", "return", "_gem", "(", "[", "'sources'", ",", "'--add'", ",", "source_uri", "]", ",", "ruby", ",", "gem_bin", "=", "g...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sources_remove
Remove a gem source. :param source_uri: string The source URI to remove. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the ruby version and gemset to use. Ignored if ``gem_bin`` is specified. :...
salt/modules/gem.py
def sources_remove(source_uri, ruby=None, runas=None, gem_bin=None): ''' Remove a gem source. :param source_uri: string The source URI to remove. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the r...
def sources_remove(source_uri, ruby=None, runas=None, gem_bin=None): ''' Remove a gem source. :param source_uri: string The source URI to remove. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the r...
[ "Remove", "a", "gem", "source", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L377-L400
[ "def", "sources_remove", "(", "source_uri", ",", "ruby", "=", "None", ",", "runas", "=", "None", ",", "gem_bin", "=", "None", ")", ":", "return", "_gem", "(", "[", "'sources'", ",", "'--remove'", ",", "source_uri", "]", ",", "ruby", ",", "gem_bin", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
sources_list
List the configured gem sources. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the ruby version and gemset to use. Ignored if ``gem_bin`` is specified. :param runas: string : None The user to run g...
salt/modules/gem.py
def sources_list(ruby=None, runas=None, gem_bin=None): ''' List the configured gem sources. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the ruby version and gemset to use. Ignored if ``gem_bin`` is s...
def sources_list(ruby=None, runas=None, gem_bin=None): ''' List the configured gem sources. :param gem_bin: string : None Full path to ``gem`` binary to use. :param ruby: string : None If RVM or rbenv are installed, the ruby version and gemset to use. Ignored if ``gem_bin`` is s...
[ "List", "the", "configured", "gem", "sources", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/gem.py#L403-L422
[ "def", "sources_list", "(", "ruby", "=", "None", ",", "runas", "=", "None", ",", "gem_bin", "=", "None", ")", ":", "ret", "=", "_gem", "(", "[", "'sources'", "]", ",", "ruby", ",", "gem_bin", "=", "gem_bin", ",", "runas", "=", "runas", ")", "return...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
generate_ticket
Generate an icinga2 ticket on the master. name The domain name for which this ticket will be generated output grain: output in a grain other: the file to store results None: output to the result comment (default) grain: grain to store the output (need output=grain...
salt/states/icinga2.py
def generate_ticket(name, output=None, grain=None, key=None, overwrite=True): ''' Generate an icinga2 ticket on the master. name The domain name for which this ticket will be generated output grain: output in a grain other: the file to store results None: output to the...
def generate_ticket(name, output=None, grain=None, key=None, overwrite=True): ''' Generate an icinga2 ticket on the master. name The domain name for which this ticket will be generated output grain: output in a grain other: the file to store results None: output to the...
[ "Generate", "an", "icinga2", "ticket", "on", "the", "master", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/icinga2.py#L40-L131
[ "def", "generate_ticket", "(", "name", ",", "output", "=", "None", ",", "grain", "=", "None", ",", "key", "=", "None", ",", "overwrite", "=", "True", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
generate_cert
Generate an icinga2 certificate and key on the client. name The domain name for which this certificate and key will be generated
salt/states/icinga2.py
def generate_cert(name): ''' Generate an icinga2 certificate and key on the client. name The domain name for which this certificate and key will be generated ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} cert = "{0}{1}.crt".forma...
def generate_cert(name): ''' Generate an icinga2 certificate and key on the client. name The domain name for which this certificate and key will be generated ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} cert = "{0}{1}.crt".forma...
[ "Generate", "an", "icinga2", "certificate", "and", "key", "on", "the", "client", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/icinga2.py#L134-L163
[ "def", "generate_cert", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "cert", "=", "\"{0}{1}.crt\"", ".", "format", "(", "get_certs_path",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
save_cert
Save the certificate on master icinga2 node. name The domain name for which this certificate will be saved master Icinga2 master node for which this certificate will be saved
salt/states/icinga2.py
def save_cert(name, master): ''' Save the certificate on master icinga2 node. name The domain name for which this certificate will be saved master Icinga2 master node for which this certificate will be saved ''' ret = {'name': name, 'changes': {}, 'result'...
def save_cert(name, master): ''' Save the certificate on master icinga2 node. name The domain name for which this certificate will be saved master Icinga2 master node for which this certificate will be saved ''' ret = {'name': name, 'changes': {}, 'result'...
[ "Save", "the", "certificate", "on", "master", "icinga2", "node", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/icinga2.py#L166-L196
[ "def", "save_cert", "(", "name", ",", "master", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "cert", "=", "\"{0}trusted-master.crt\"", ".", "format", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
request_cert
Request CA certificate from master icinga2 node. name The domain name for which this certificate will be saved master Icinga2 master node for which this certificate will be saved ticket Authentication ticket generated on icinga2 master port Icinga2 port, defaults to 5...
salt/states/icinga2.py
def request_cert(name, master, ticket, port="5665"): ''' Request CA certificate from master icinga2 node. name The domain name for which this certificate will be saved master Icinga2 master node for which this certificate will be saved ticket Authentication ticket generate...
def request_cert(name, master, ticket, port="5665"): ''' Request CA certificate from master icinga2 node. name The domain name for which this certificate will be saved master Icinga2 master node for which this certificate will be saved ticket Authentication ticket generate...
[ "Request", "CA", "certificate", "from", "master", "icinga2", "node", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/icinga2.py#L199-L239
[ "def", "request_cert", "(", "name", ",", "master", ",", "ticket", ",", "port", "=", "\"5665\"", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "cert...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
node_setup
Setup the icinga2 node. name The domain name for which this certificate will be saved master Icinga2 master node for which this certificate will be saved ticket Authentication ticket generated on icinga2 master
salt/states/icinga2.py
def node_setup(name, master, ticket): ''' Setup the icinga2 node. name The domain name for which this certificate will be saved master Icinga2 master node for which this certificate will be saved ticket Authentication ticket generated on icinga2 master ''' ret = {'...
def node_setup(name, master, ticket): ''' Setup the icinga2 node. name The domain name for which this certificate will be saved master Icinga2 master node for which this certificate will be saved ticket Authentication ticket generated on icinga2 master ''' ret = {'...
[ "Setup", "the", "icinga2", "node", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/icinga2.py#L242-L280
[ "def", "node_setup", "(", "name", ",", "master", ",", "ticket", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "cert", "=", "\"{0}{1}.crt.orig\"", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
avail_images
Return available Linode images. CLI Example: .. code-block:: bash salt-cloud --list-images my-linode-config salt-cloud -f avail_images my-linode-config
salt/cloud/clouds/linode.py
def avail_images(call=None): ''' Return available Linode images. CLI Example: .. code-block:: bash salt-cloud --list-images my-linode-config salt-cloud -f avail_images my-linode-config ''' if call == 'action': raise SaltCloudException( 'The avail_images fun...
def avail_images(call=None): ''' Return available Linode images. CLI Example: .. code-block:: bash salt-cloud --list-images my-linode-config salt-cloud -f avail_images my-linode-config ''' if call == 'action': raise SaltCloudException( 'The avail_images fun...
[ "Return", "available", "Linode", "images", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L110-L133
[ "def", "avail_images", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudException", "(", "'The avail_images function must be called with -f or --function.'", ")", "response", "=", "_query", "(", "'avail'", ",", "'distribution...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
avail_locations
Return available Linode datacenter locations. CLI Example: .. code-block:: bash salt-cloud --list-locations my-linode-config salt-cloud -f avail_locations my-linode-config
salt/cloud/clouds/linode.py
def avail_locations(call=None): ''' Return available Linode datacenter locations. CLI Example: .. code-block:: bash salt-cloud --list-locations my-linode-config salt-cloud -f avail_locations my-linode-config ''' if call == 'action': raise SaltCloudException( ...
def avail_locations(call=None): ''' Return available Linode datacenter locations. CLI Example: .. code-block:: bash salt-cloud --list-locations my-linode-config salt-cloud -f avail_locations my-linode-config ''' if call == 'action': raise SaltCloudException( ...
[ "Return", "available", "Linode", "datacenter", "locations", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L136-L159
[ "def", "avail_locations", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudException", "(", "'The avail_locations function must be called with -f or --function.'", ")", "response", "=", "_query", "(", "'avail'", ",", "'datace...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
avail_sizes
Return available Linode sizes. CLI Example: .. code-block:: bash salt-cloud --list-sizes my-linode-config salt-cloud -f avail_sizes my-linode-config
salt/cloud/clouds/linode.py
def avail_sizes(call=None): ''' Return available Linode sizes. CLI Example: .. code-block:: bash salt-cloud --list-sizes my-linode-config salt-cloud -f avail_sizes my-linode-config ''' if call == 'action': raise SaltCloudException( 'The avail_locations func...
def avail_sizes(call=None): ''' Return available Linode sizes. CLI Example: .. code-block:: bash salt-cloud --list-sizes my-linode-config salt-cloud -f avail_sizes my-linode-config ''' if call == 'action': raise SaltCloudException( 'The avail_locations func...
[ "Return", "available", "Linode", "sizes", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L162-L185
[ "def", "avail_sizes", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudException", "(", "'The avail_locations function must be called with -f or --function.'", ")", "response", "=", "_query", "(", "'avail'", ",", "'LinodePlan...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
boot
Boot a Linode. name The name of the Linode to boot. Can be used instead of ``linode_id``. linode_id The ID of the Linode to boot. If provided, will be used as an alternative to ``name`` and reduces the number of API calls to Linode by one. Will be preferred over ``name``. ...
salt/cloud/clouds/linode.py
def boot(name=None, kwargs=None, call=None): ''' Boot a Linode. name The name of the Linode to boot. Can be used instead of ``linode_id``. linode_id The ID of the Linode to boot. If provided, will be used as an alternative to ``name`` and reduces the number of API calls to ...
def boot(name=None, kwargs=None, call=None): ''' Boot a Linode. name The name of the Linode to boot. Can be used instead of ``linode_id``. linode_id The ID of the Linode to boot. If provided, will be used as an alternative to ``name`` and reduces the number of API calls to ...
[ "Boot", "a", "Linode", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L188-L272
[ "def", "boot", "(", "name", "=", "None", ",", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "name", "is", "None", "and", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The boot action requires a \\'name\\'.'", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
clone
Clone a Linode. linode_id The ID of the Linode to clone. Required. datacenter_id The ID of the Datacenter where the Linode will be placed. Required. plan_id The ID of the plan (size) of the Linode. Required. CLI Example: .. code-block:: bash salt-cloud -f clone ...
salt/cloud/clouds/linode.py
def clone(kwargs=None, call=None): ''' Clone a Linode. linode_id The ID of the Linode to clone. Required. datacenter_id The ID of the Datacenter where the Linode will be placed. Required. plan_id The ID of the plan (size) of the Linode. Required. CLI Example: .. ...
def clone(kwargs=None, call=None): ''' Clone a Linode. linode_id The ID of the Linode to clone. Required. datacenter_id The ID of the Datacenter where the Linode will be placed. Required. plan_id The ID of the plan (size) of the Linode. Required. CLI Example: .. ...
[ "Clone", "a", "Linode", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L275-L320
[ "def", "clone", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The clone function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", ":", "kwarg...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
Create a single Linode VM.
salt/cloud/clouds/linode.py
def create(vm_): ''' Create a single Linode VM. ''' name = vm_['name'] try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured(__opts__, __active_provider_...
def create(vm_): ''' Create a single Linode VM. ''' name = vm_['name'] try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured(__opts__, __active_provider_...
[ "Create", "a", "single", "Linode", "VM", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L323-L537
[ "def", "create", "(", "vm_", ")", ":", "name", "=", "vm_", "[", "'name'", "]", "try", ":", "# Check for required profile parameters before sending any API calls.", "if", "vm_", "[", "'profile'", "]", "and", "config", ".", "is_profile_configured", "(", "__opts__", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_config
Creates a Linode Configuration Profile. name The name of the VM to create the config for. linode_id The ID of the Linode to create the configuration for. root_disk_id The Root Disk ID to be used for this config. swap_disk_id The Swap Disk ID to be used for this config...
salt/cloud/clouds/linode.py
def create_config(kwargs=None, call=None): ''' Creates a Linode Configuration Profile. name The name of the VM to create the config for. linode_id The ID of the Linode to create the configuration for. root_disk_id The Root Disk ID to be used for this config. swap_disk...
def create_config(kwargs=None, call=None): ''' Creates a Linode Configuration Profile. name The name of the VM to create the config for. linode_id The ID of the Linode to create the configuration for. root_disk_id The Root Disk ID to be used for this config. swap_disk...
[ "Creates", "a", "Linode", "Configuration", "Profile", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L540-L603
[ "def", "create_config", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The create_config function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_disk_from_distro
r''' Creates the disk for the Linode from the distribution. vm\_ The VM profile to create the disk for. linode_id The ID of the Linode to create the distribution disk for. Required. swap_size The size of the disk, in MB.
salt/cloud/clouds/linode.py
def create_disk_from_distro(vm_, linode_id, swap_size=None): r''' Creates the disk for the Linode from the distribution. vm\_ The VM profile to create the disk for. linode_id The ID of the Linode to create the distribution disk for. Required. swap_size The size of the disk...
def create_disk_from_distro(vm_, linode_id, swap_size=None): r''' Creates the disk for the Linode from the distribution. vm\_ The VM profile to create the disk for. linode_id The ID of the Linode to create the distribution disk for. Required. swap_size The size of the disk...
[ "r", "Creates", "the", "disk", "for", "the", "Linode", "from", "the", "distribution", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L606-L644
[ "def", "create_disk_from_distro", "(", "vm_", ",", "linode_id", ",", "swap_size", "=", "None", ")", ":", "kwargs", "=", "{", "}", "if", "swap_size", "is", "None", ":", "swap_size", "=", "get_swap_size", "(", "vm_", ")", "pub_key", "=", "get_pub_key", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_swap_disk
r''' Creates the disk for the specified Linode. vm\_ The VM profile to create the swap disk for. linode_id The ID of the Linode to create the swap disk for. swap_size The size of the disk, in MB.
salt/cloud/clouds/linode.py
def create_swap_disk(vm_, linode_id, swap_size=None): r''' Creates the disk for the specified Linode. vm\_ The VM profile to create the swap disk for. linode_id The ID of the Linode to create the swap disk for. swap_size The size of the disk, in MB. ''' kwargs = {}...
def create_swap_disk(vm_, linode_id, swap_size=None): r''' Creates the disk for the specified Linode. vm\_ The VM profile to create the swap disk for. linode_id The ID of the Linode to create the swap disk for. swap_size The size of the disk, in MB. ''' kwargs = {}...
[ "r", "Creates", "the", "disk", "for", "the", "specified", "Linode", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L647-L673
[ "def", "create_swap_disk", "(", "vm_", ",", "linode_id", ",", "swap_size", "=", "None", ")", ":", "kwargs", "=", "{", "}", "if", "not", "swap_size", ":", "swap_size", "=", "get_swap_size", "(", "vm_", ")", "kwargs", ".", "update", "(", "{", "'LinodeID'",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_data_disk
r''' Create a data disk for the linode (type is hardcoded to ext4 at the moment) .. versionadded:: 2016.3.0 vm\_ The VM profile to create the data disk for. linode_id The ID of the Linode to create the data disk for. data_size The size of the disk, in MB.
salt/cloud/clouds/linode.py
def create_data_disk(vm_=None, linode_id=None, data_size=None): r''' Create a data disk for the linode (type is hardcoded to ext4 at the moment) .. versionadded:: 2016.3.0 vm\_ The VM profile to create the data disk for. linode_id The ID of the Linode to create the data disk for. ...
def create_data_disk(vm_=None, linode_id=None, data_size=None): r''' Create a data disk for the linode (type is hardcoded to ext4 at the moment) .. versionadded:: 2016.3.0 vm\_ The VM profile to create the data disk for. linode_id The ID of the Linode to create the data disk for. ...
[ "r", "Create", "a", "data", "disk", "for", "the", "linode", "(", "type", "is", "hardcoded", "to", "ext4", "at", "the", "moment", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L676-L701
[ "def", "create_data_disk", "(", "vm_", "=", "None", ",", "linode_id", "=", "None", ",", "data_size", "=", "None", ")", ":", "kwargs", "=", "{", "}", "kwargs", ".", "update", "(", "{", "'LinodeID'", ":", "linode_id", ",", "'Label'", ":", "vm_", "[", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_private_ip
r''' Creates a private IP for the specified Linode. linode_id The ID of the Linode to create the IP address for.
salt/cloud/clouds/linode.py
def create_private_ip(linode_id): r''' Creates a private IP for the specified Linode. linode_id The ID of the Linode to create the IP address for. ''' kwargs = {'LinodeID': linode_id} result = _query('linode', 'ip.addprivate', args=kwargs) return _clean_data(result)
def create_private_ip(linode_id): r''' Creates a private IP for the specified Linode. linode_id The ID of the Linode to create the IP address for. ''' kwargs = {'LinodeID': linode_id} result = _query('linode', 'ip.addprivate', args=kwargs) return _clean_data(result)
[ "r", "Creates", "a", "private", "IP", "for", "the", "specified", "Linode", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L704-L714
[ "def", "create_private_ip", "(", "linode_id", ")", ":", "kwargs", "=", "{", "'LinodeID'", ":", "linode_id", "}", "result", "=", "_query", "(", "'linode'", ",", "'ip.addprivate'", ",", "args", "=", "kwargs", ")", "return", "_clean_data", "(", "result", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_config_id
Returns a config_id for a given linode. .. versionadded:: 2015.8.0 name The name of the Linode for which to get the config_id. Can be used instead of ``linode_id``.h linode_id The ID of the Linode for which to get the config_id. Can be used instead of ``name``. CLI Ex...
salt/cloud/clouds/linode.py
def get_config_id(kwargs=None, call=None): ''' Returns a config_id for a given linode. .. versionadded:: 2015.8.0 name The name of the Linode for which to get the config_id. Can be used instead of ``linode_id``.h linode_id The ID of the Linode for which to get the config_i...
def get_config_id(kwargs=None, call=None): ''' Returns a config_id for a given linode. .. versionadded:: 2015.8.0 name The name of the Linode for which to get the config_id. Can be used instead of ``linode_id``.h linode_id The ID of the Linode for which to get the config_i...
[ "Returns", "a", "config_id", "for", "a", "given", "linode", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L764-L806
[ "def", "get_config_id", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudException", "(", "'The get_config_id function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_disk_size
r''' Returns the size of of the root disk in MB. vm\_ The VM to get the disk size for.
salt/cloud/clouds/linode.py
def get_disk_size(vm_, swap, linode_id): r''' Returns the size of of the root disk in MB. vm\_ The VM to get the disk size for. ''' disk_size = get_linode(kwargs={'linode_id': linode_id})['TOTALHD'] return config.get_cloud_config_value( 'disk_size', vm_, __opts__, default=disk_s...
def get_disk_size(vm_, swap, linode_id): r''' Returns the size of of the root disk in MB. vm\_ The VM to get the disk size for. ''' disk_size = get_linode(kwargs={'linode_id': linode_id})['TOTALHD'] return config.get_cloud_config_value( 'disk_size', vm_, __opts__, default=disk_s...
[ "r", "Returns", "the", "size", "of", "of", "the", "root", "disk", "in", "MB", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L820-L830
[ "def", "get_disk_size", "(", "vm_", ",", "swap", ",", "linode_id", ")", ":", "disk_size", "=", "get_linode", "(", "kwargs", "=", "{", "'linode_id'", ":", "linode_id", "}", ")", "[", "'TOTALHD'", "]", "return", "config", ".", "get_cloud_config_value", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_data_disk_size
Return the size of of the data disk in MB .. versionadded:: 2016.3.0
salt/cloud/clouds/linode.py
def get_data_disk_size(vm_, swap, linode_id): ''' Return the size of of the data disk in MB .. versionadded:: 2016.3.0 ''' disk_size = get_linode(kwargs={'linode_id': linode_id})['TOTALHD'] root_disk_size = config.get_cloud_config_value( 'disk_size', vm_, __opts__, default=disk_size - s...
def get_data_disk_size(vm_, swap, linode_id): ''' Return the size of of the data disk in MB .. versionadded:: 2016.3.0 ''' disk_size = get_linode(kwargs={'linode_id': linode_id})['TOTALHD'] root_disk_size = config.get_cloud_config_value( 'disk_size', vm_, __opts__, default=disk_size - s...
[ "Return", "the", "size", "of", "of", "the", "data", "disk", "in", "MB" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L833-L843
[ "def", "get_data_disk_size", "(", "vm_", ",", "swap", ",", "linode_id", ")", ":", "disk_size", "=", "get_linode", "(", "kwargs", "=", "{", "'linode_id'", ":", "linode_id", "}", ")", "[", "'TOTALHD'", "]", "root_disk_size", "=", "config", ".", "get_cloud_conf...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_distribution_id
r''' Returns the distribution ID for a VM vm\_ The VM to get the distribution ID for
salt/cloud/clouds/linode.py
def get_distribution_id(vm_): r''' Returns the distribution ID for a VM vm\_ The VM to get the distribution ID for ''' distributions = _query('avail', 'distributions')['DATA'] vm_image_name = config.get_cloud_config_value('image', vm_, __opts__) distro_id = '' for distro in di...
def get_distribution_id(vm_): r''' Returns the distribution ID for a VM vm\_ The VM to get the distribution ID for ''' distributions = _query('avail', 'distributions')['DATA'] vm_image_name = config.get_cloud_config_value('image', vm_, __opts__) distro_id = '' for distro in di...
[ "r", "Returns", "the", "distribution", "ID", "for", "a", "VM" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L846-L872
[ "def", "get_distribution_id", "(", "vm_", ")", ":", "distributions", "=", "_query", "(", "'avail'", ",", "'distributions'", ")", "[", "'DATA'", "]", "vm_image_name", "=", "config", ".", "get_cloud_config_value", "(", "'image'", ",", "vm_", ",", "__opts__", ")"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_ips
Returns public and private IP addresses. linode_id Limits the IP addresses returned to the specified Linode ID.
salt/cloud/clouds/linode.py
def get_ips(linode_id=None): ''' Returns public and private IP addresses. linode_id Limits the IP addresses returned to the specified Linode ID. ''' if linode_id: ips = _query('linode', 'ip.list', args={'LinodeID': linode_id}) else: ips = _query('linode', 'ip.list') ...
def get_ips(linode_id=None): ''' Returns public and private IP addresses. linode_id Limits the IP addresses returned to the specified Linode ID. ''' if linode_id: ips = _query('linode', 'ip.list', args={'LinodeID': linode_id}) else: ips = _query('linode', 'ip.list') ...
[ "Returns", "public", "and", "private", "IP", "addresses", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L875-L912
[ "def", "get_ips", "(", "linode_id", "=", "None", ")", ":", "if", "linode_id", ":", "ips", "=", "_query", "(", "'linode'", ",", "'ip.list'", ",", "args", "=", "{", "'LinodeID'", ":", "linode_id", "}", ")", "else", ":", "ips", "=", "_query", "(", "'lin...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_linode
Returns data for a single named Linode. name The name of the Linode for which to get data. Can be used instead ``linode_id``. Note this will induce an additional API call compared to using ``linode_id``. linode_id The ID of the Linode for which to get data. Can be used instead ...
salt/cloud/clouds/linode.py
def get_linode(kwargs=None, call=None): ''' Returns data for a single named Linode. name The name of the Linode for which to get data. Can be used instead ``linode_id``. Note this will induce an additional API call compared to using ``linode_id``. linode_id The ID of th...
def get_linode(kwargs=None, call=None): ''' Returns data for a single named Linode. name The name of the Linode for which to get data. Can be used instead ``linode_id``. Note this will induce an additional API call compared to using ``linode_id``. linode_id The ID of th...
[ "Returns", "data", "for", "a", "single", "named", "Linode", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L915-L955
[ "def", "get_linode", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The get_linode function must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", ":"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_linode_id_from_name
Returns the Linode ID for a VM from the provided name. name The name of the Linode from which to get the Linode ID. Required.
salt/cloud/clouds/linode.py
def get_linode_id_from_name(name): ''' Returns the Linode ID for a VM from the provided name. name The name of the Linode from which to get the Linode ID. Required. ''' nodes = _query('linode', 'list')['DATA'] linode_id = '' for node in nodes: if name == node['LABEL']: ...
def get_linode_id_from_name(name): ''' Returns the Linode ID for a VM from the provided name. name The name of the Linode from which to get the Linode ID. Required. ''' nodes = _query('linode', 'list')['DATA'] linode_id = '' for node in nodes: if name == node['LABEL']: ...
[ "Returns", "the", "Linode", "ID", "for", "a", "VM", "from", "the", "provided", "name", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L958-L976
[ "def", "get_linode_id_from_name", "(", "name", ")", ":", "nodes", "=", "_query", "(", "'linode'", ",", "'list'", ")", "[", "'DATA'", "]", "linode_id", "=", "''", "for", "node", "in", "nodes", ":", "if", "name", "==", "node", "[", "'LABEL'", "]", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_password
r''' Return the password to use for a VM. vm\_ The configuration to obtain the password from.
salt/cloud/clouds/linode.py
def get_password(vm_): r''' Return the password to use for a VM. vm\_ The configuration to obtain the password from. ''' return config.get_cloud_config_value( 'password', vm_, __opts__, default=config.get_cloud_config_value( 'passwd', vm_, __opts__, s...
def get_password(vm_): r''' Return the password to use for a VM. vm\_ The configuration to obtain the password from. ''' return config.get_cloud_config_value( 'password', vm_, __opts__, default=config.get_cloud_config_value( 'passwd', vm_, __opts__, s...
[ "r", "Return", "the", "password", "to", "use", "for", "a", "VM", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L979-L993
[ "def", "get_password", "(", "vm_", ")", ":", "return", "config", ".", "get_cloud_config_value", "(", "'password'", ",", "vm_", ",", "__opts__", ",", "default", "=", "config", ".", "get_cloud_config_value", "(", "'passwd'", ",", "vm_", ",", "__opts__", ",", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_decode_linode_plan_label
Attempts to decode a user-supplied Linode plan label into the format in Linode API output label The label, or name, of the plan to decode. Example: `Linode 2048` will decode to `Linode 2GB`
salt/cloud/clouds/linode.py
def _decode_linode_plan_label(label): ''' Attempts to decode a user-supplied Linode plan label into the format in Linode API output label The label, or name, of the plan to decode. Example: `Linode 2048` will decode to `Linode 2GB` ''' sizes = avail_sizes() if label no...
def _decode_linode_plan_label(label): ''' Attempts to decode a user-supplied Linode plan label into the format in Linode API output label The label, or name, of the plan to decode. Example: `Linode 2048` will decode to `Linode 2GB` ''' sizes = avail_sizes() if label no...
[ "Attempts", "to", "decode", "a", "user", "-", "supplied", "Linode", "plan", "label", "into", "the", "format", "in", "Linode", "API", "output" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L996-L1049
[ "def", "_decode_linode_plan_label", "(", "label", ")", ":", "sizes", "=", "avail_sizes", "(", ")", "if", "label", "not", "in", "sizes", ":", "if", "'GB'", "in", "label", ":", "raise", "SaltCloudException", "(", "'Invalid Linode plan ({}) specified - call avail_sizes...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_plan_id
Returns the Linode Plan ID. label The label, or name, of the plan to get the ID from. CLI Example: .. code-block:: bash salt-cloud -f get_plan_id linode label="Linode 1024"
salt/cloud/clouds/linode.py
def get_plan_id(kwargs=None, call=None): ''' Returns the Linode Plan ID. label The label, or name, of the plan to get the ID from. CLI Example: .. code-block:: bash salt-cloud -f get_plan_id linode label="Linode 1024" ''' if call == 'action': raise SaltCloudExcept...
def get_plan_id(kwargs=None, call=None): ''' Returns the Linode Plan ID. label The label, or name, of the plan to get the ID from. CLI Example: .. code-block:: bash salt-cloud -f get_plan_id linode label="Linode 1024" ''' if call == 'action': raise SaltCloudExcept...
[ "Returns", "the", "Linode", "Plan", "ID", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1052-L1081
[ "def", "get_plan_id", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudException", "(", "'The show_instance action must be called with -f or --function.'", ")", "if", "kwargs", "is", "None", ":...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_vm_size
r''' Returns the VM's size. vm\_ The VM to get the size for.
salt/cloud/clouds/linode.py
def get_vm_size(vm_): r''' Returns the VM's size. vm\_ The VM to get the size for. ''' vm_size = config.get_cloud_config_value('size', vm_, __opts__) ram = avail_sizes()[vm_size]['RAM'] if vm_size.startswith('Linode'): vm_size = vm_size.replace('Linode ', '') if ram ==...
def get_vm_size(vm_): r''' Returns the VM's size. vm\_ The VM to get the size for. ''' vm_size = config.get_cloud_config_value('size', vm_, __opts__) ram = avail_sizes()[vm_size]['RAM'] if vm_size.startswith('Linode'): vm_size = vm_size.replace('Linode ', '') if ram ==...
[ "r", "Returns", "the", "VM", "s", "size", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1128-L1146
[ "def", "get_vm_size", "(", "vm_", ")", ":", "vm_size", "=", "config", ".", "get_cloud_config_value", "(", "'size'", ",", "vm_", ",", "__opts__", ")", "ram", "=", "avail_sizes", "(", ")", "[", "vm_size", "]", "[", "'RAM'", "]", "if", "vm_size", ".", "st...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_nodes_min
Return a list of the VMs that are on the provider. Only a list of VM names and their state is returned. This is the minimum amount of information needed to check for existing VMs. .. versionadded:: 2015.8.0 CLI Example: .. code-block:: bash salt-cloud -f list_nodes_min my-linode-config ...
salt/cloud/clouds/linode.py
def list_nodes_min(call=None): ''' Return a list of the VMs that are on the provider. Only a list of VM names and their state is returned. This is the minimum amount of information needed to check for existing VMs. .. versionadded:: 2015.8.0 CLI Example: .. code-block:: bash salt...
def list_nodes_min(call=None): ''' Return a list of the VMs that are on the provider. Only a list of VM names and their state is returned. This is the minimum amount of information needed to check for existing VMs. .. versionadded:: 2015.8.0 CLI Example: .. code-block:: bash salt...
[ "Return", "a", "list", "of", "the", "VMs", "that", "are", "on", "the", "provider", ".", "Only", "a", "list", "of", "VM", "names", "and", "their", "state", "is", "returned", ".", "This", "is", "the", "minimum", "amount", "of", "information", "needed", "...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1199-L1231
[ "def", "list_nodes_min", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_nodes_min function must be called with -f or --function.'", ")", "ret", "=", "{", "}", "nodes", "=", "_query", "(", "'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
reboot
Reboot a linode. .. versionadded:: 2015.8.0 name The name of the VM to reboot. CLI Example: .. code-block:: bash salt-cloud -a reboot vm_name
salt/cloud/clouds/linode.py
def reboot(name, call=None): ''' Reboot a linode. .. versionadded:: 2015.8.0 name The name of the VM to reboot. CLI Example: .. code-block:: bash salt-cloud -a reboot vm_name ''' if call != 'action': raise SaltCloudException( 'The show_instance ac...
def reboot(name, call=None): ''' Reboot a linode. .. versionadded:: 2015.8.0 name The name of the VM to reboot. CLI Example: .. code-block:: bash salt-cloud -a reboot vm_name ''' if call != 'action': raise SaltCloudException( 'The show_instance ac...
[ "Reboot", "a", "linode", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1243-L1272
[ "def", "reboot", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudException", "(", "'The show_instance action must be called with -a or --action.'", ")", "node_id", "=", "get_linode_id_from_name", "(", "name", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_instance
Displays details about a particular Linode VM. Either a name or a linode_id must be provided. .. versionadded:: 2015.8.0 name The name of the VM for which to display details. CLI Example: .. code-block:: bash salt-cloud -a show_instance vm_name .. note:: The ``imag...
salt/cloud/clouds/linode.py
def show_instance(name, call=None): ''' Displays details about a particular Linode VM. Either a name or a linode_id must be provided. .. versionadded:: 2015.8.0 name The name of the VM for which to display details. CLI Example: .. code-block:: bash salt-cloud -a show_ins...
def show_instance(name, call=None): ''' Displays details about a particular Linode VM. Either a name or a linode_id must be provided. .. versionadded:: 2015.8.0 name The name of the VM for which to display details. CLI Example: .. code-block:: bash salt-cloud -a show_ins...
[ "Displays", "details", "about", "a", "particular", "Linode", "VM", ".", "Either", "a", "name", "or", "a", "linode_id", "must", "be", "provided", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1275-L1315
[ "def", "show_instance", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudException", "(", "'The show_instance action must be called with -a or --action.'", ")", "node_id", "=", "get_linode_id_from_name", "(", "na...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_pricing
Show pricing for a particular profile. This is only an estimate, based on unofficial pricing sources. .. versionadded:: 2015.8.0 CLI Example: .. code-block:: bash salt-cloud -f show_pricing my-linode-config profile=my-linode-profile
salt/cloud/clouds/linode.py
def show_pricing(kwargs=None, call=None): ''' Show pricing for a particular profile. This is only an estimate, based on unofficial pricing sources. .. versionadded:: 2015.8.0 CLI Example: .. code-block:: bash salt-cloud -f show_pricing my-linode-config profile=my-linode-profile '...
def show_pricing(kwargs=None, call=None): ''' Show pricing for a particular profile. This is only an estimate, based on unofficial pricing sources. .. versionadded:: 2015.8.0 CLI Example: .. code-block:: bash salt-cloud -f show_pricing my-linode-config profile=my-linode-profile '...
[ "Show", "pricing", "for", "a", "particular", "profile", ".", "This", "is", "only", "an", "estimate", "based", "on", "unofficial", "pricing", "sources", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1318-L1360
[ "def", "show_pricing", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudException", "(", "'The show_instance action must be called with -f or --function.'", ")", "profile", "=", "__opts__", "["...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
start
Start a VM in Linode. name The name of the VM to start. CLI Example: .. code-block:: bash salt-cloud -a stop vm_name
salt/cloud/clouds/linode.py
def start(name, call=None): ''' Start a VM in Linode. name The name of the VM to start. CLI Example: .. code-block:: bash salt-cloud -a stop vm_name ''' if call != 'action': raise SaltCloudException( 'The start action must be called with -a or --action...
def start(name, call=None): ''' Start a VM in Linode. name The name of the VM to start. CLI Example: .. code-block:: bash salt-cloud -a stop vm_name ''' if call != 'action': raise SaltCloudException( 'The start action must be called with -a or --action...
[ "Start", "a", "VM", "in", "Linode", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1363-L1398
[ "def", "start", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'action'", ":", "raise", "SaltCloudException", "(", "'The start action must be called with -a or --action.'", ")", "node_id", "=", "get_linode_id_from_name", "(", "name", ")", "n...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update_linode
Updates a Linode's properties. linode_id The ID of the Linode to shutdown. Required. update_args The args to update the Linode with. Must be in dictionary form.
salt/cloud/clouds/linode.py
def update_linode(linode_id, update_args=None): ''' Updates a Linode's properties. linode_id The ID of the Linode to shutdown. Required. update_args The args to update the Linode with. Must be in dictionary form. ''' update_args.update({'LinodeID': linode_id}) result = _qu...
def update_linode(linode_id, update_args=None): ''' Updates a Linode's properties. linode_id The ID of the Linode to shutdown. Required. update_args The args to update the Linode with. Must be in dictionary form. ''' update_args.update({'LinodeID': linode_id}) result = _qu...
[ "Updates", "a", "Linode", "s", "properties", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1438-L1452
[ "def", "update_linode", "(", "linode_id", ",", "update_args", "=", "None", ")", ":", "update_args", ".", "update", "(", "{", "'LinodeID'", ":", "linode_id", "}", ")", "result", "=", "_query", "(", "'linode'", ",", "'update'", ",", "args", "=", "update_args...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_clean_data
Returns the DATA response from a Linode API query as a single pre-formatted dictionary api_response The query to be cleaned.
salt/cloud/clouds/linode.py
def _clean_data(api_response): ''' Returns the DATA response from a Linode API query as a single pre-formatted dictionary api_response The query to be cleaned. ''' data = {} data.update(api_response['DATA']) if not data: response_data = api_response['DATA'] data.upd...
def _clean_data(api_response): ''' Returns the DATA response from a Linode API query as a single pre-formatted dictionary api_response The query to be cleaned. ''' data = {} data.update(api_response['DATA']) if not data: response_data = api_response['DATA'] data.upd...
[ "Returns", "the", "DATA", "response", "from", "a", "Linode", "API", "query", "as", "a", "single", "pre", "-", "formatted", "dictionary" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1455-L1469
[ "def", "_clean_data", "(", "api_response", ")", ":", "data", "=", "{", "}", "data", ".", "update", "(", "api_response", "[", "'DATA'", "]", ")", "if", "not", "data", ":", "response_data", "=", "api_response", "[", "'DATA'", "]", "data", ".", "update", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_list_linodes
Helper function to format and parse linode data
salt/cloud/clouds/linode.py
def _list_linodes(full=False): ''' Helper function to format and parse linode data ''' nodes = _query('linode', 'list')['DATA'] ips = get_ips() ret = {} for node in nodes: this_node = {} linode_id = six.text_type(node['LINODEID']) this_node['id'] = linode_id ...
def _list_linodes(full=False): ''' Helper function to format and parse linode data ''' nodes = _query('linode', 'list')['DATA'] ips = get_ips() ret = {} for node in nodes: this_node = {} linode_id = six.text_type(node['LINODEID']) this_node['id'] = linode_id ...
[ "Helper", "function", "to", "format", "and", "parse", "linode", "data" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1472-L1502
[ "def", "_list_linodes", "(", "full", "=", "False", ")", ":", "nodes", "=", "_query", "(", "'linode'", ",", "'list'", ")", "[", "'DATA'", "]", "ips", "=", "get_ips", "(", ")", "ret", "=", "{", "}", "for", "node", "in", "nodes", ":", "this_node", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_query
Make a web call to the Linode API.
salt/cloud/clouds/linode.py
def _query(action=None, command=None, args=None, method='GET', header_dict=None, data=None, url='https://api.linode.com/'): ''' Make a web call to the Linode API. ''' global LASTCALL vm_ = get_configured_provider() ratelimit_slee...
def _query(action=None, command=None, args=None, method='GET', header_dict=None, data=None, url='https://api.linode.com/'): ''' Make a web call to the Linode API. ''' global LASTCALL vm_ = get_configured_provider() ratelimit_slee...
[ "Make", "a", "web", "call", "to", "the", "Linode", "API", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1505-L1582
[ "def", "_query", "(", "action", "=", "None", ",", "command", "=", "None", ",", "args", "=", "None", ",", "method", "=", "'GET'", ",", "header_dict", "=", "None", ",", "data", "=", "None", ",", "url", "=", "'https://api.linode.com/'", ")", ":", "global"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_wait_for_job
Wait for a Job to return. linode_id The ID of the Linode to wait on. Required. job_id The ID of the job to wait for. timeout The amount of time to wait for a status to update. quiet Log status updates to debug logs when True. Otherwise, logs to info.
salt/cloud/clouds/linode.py
def _wait_for_job(linode_id, job_id, timeout=300, quiet=True): ''' Wait for a Job to return. linode_id The ID of the Linode to wait on. Required. job_id The ID of the job to wait for. timeout The amount of time to wait for a status to update. quiet Log status ...
def _wait_for_job(linode_id, job_id, timeout=300, quiet=True): ''' Wait for a Job to return. linode_id The ID of the Linode to wait on. Required. job_id The ID of the job to wait for. timeout The amount of time to wait for a status to update. quiet Log status ...
[ "Wait", "for", "a", "Job", "to", "return", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1585-L1616
[ "def", "_wait_for_job", "(", "linode_id", ",", "job_id", ",", "timeout", "=", "300", ",", "quiet", "=", "True", ")", ":", "interval", "=", "5", "iterations", "=", "int", "(", "timeout", "/", "interval", ")", "for", "i", "in", "range", "(", "0", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_wait_for_status
Wait for a certain status from Linode. linode_id The ID of the Linode to wait on. Required. status The status to look for to update. timeout The amount of time to wait for a status to update. quiet Log status updates to debug logs when False. Otherwise, logs to info.
salt/cloud/clouds/linode.py
def _wait_for_status(linode_id, status=None, timeout=300, quiet=True): ''' Wait for a certain status from Linode. linode_id The ID of the Linode to wait on. Required. status The status to look for to update. timeout The amount of time to wait for a status to update. q...
def _wait_for_status(linode_id, status=None, timeout=300, quiet=True): ''' Wait for a certain status from Linode. linode_id The ID of the Linode to wait on. Required. status The status to look for to update. timeout The amount of time to wait for a status to update. q...
[ "Wait", "for", "a", "certain", "status", "from", "Linode", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1619-L1658
[ "def", "_wait_for_status", "(", "linode_id", ",", "status", "=", "None", ",", "timeout", "=", "300", ",", "quiet", "=", "True", ")", ":", "if", "status", "is", "None", ":", "status", "=", "_get_status_id_by_name", "(", "'brand_new'", ")", "status_desc_waitin...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_status_descr_by_id
Return linode status by ID status_id linode VM status ID
salt/cloud/clouds/linode.py
def _get_status_descr_by_id(status_id): ''' Return linode status by ID status_id linode VM status ID ''' for status_name, status_data in six.iteritems(LINODE_STATUS): if status_data['code'] == int(status_id): return status_data['descr'] return LINODE_STATUS.get(statu...
def _get_status_descr_by_id(status_id): ''' Return linode status by ID status_id linode VM status ID ''' for status_name, status_data in six.iteritems(LINODE_STATUS): if status_data['code'] == int(status_id): return status_data['descr'] return LINODE_STATUS.get(statu...
[ "Return", "linode", "status", "by", "ID" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1661-L1671
[ "def", "_get_status_descr_by_id", "(", "status_id", ")", ":", "for", "status_name", ",", "status_data", "in", "six", ".", "iteritems", "(", "LINODE_STATUS", ")", ":", "if", "status_data", "[", "'code'", "]", "==", "int", "(", "status_id", ")", ":", "return",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_validate_name
Checks if the provided name fits Linode's labeling parameters. .. versionadded:: 2015.5.6 name The VM name to validate
salt/cloud/clouds/linode.py
def _validate_name(name): ''' Checks if the provided name fits Linode's labeling parameters. .. versionadded:: 2015.5.6 name The VM name to validate ''' name = six.text_type(name) name_length = len(name) regex = re.compile(r'^[a-zA-Z0-9][A-Za-z0-9_-]*[a-zA-Z0-9]$') if name...
def _validate_name(name): ''' Checks if the provided name fits Linode's labeling parameters. .. versionadded:: 2015.5.6 name The VM name to validate ''' name = six.text_type(name) name_length = len(name) regex = re.compile(r'^[a-zA-Z0-9][A-Za-z0-9_-]*[a-zA-Z0-9]$') if name...
[ "Checks", "if", "the", "provided", "name", "fits", "Linode", "s", "labeling", "parameters", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/linode.py#L1684-L1711
[ "def", "_validate_name", "(", "name", ")", ":", "name", "=", "six", ".", "text_type", "(", "name", ")", "name_length", "=", "len", "(", "name", ")", "regex", "=", "re", ".", "compile", "(", "r'^[a-zA-Z0-9][A-Za-z0-9_-]*[a-zA-Z0-9]$'", ")", "if", "name_length...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_capirca_platform
Given the following NAPALM grains, we can determine the Capirca platform name: - vendor - device model - operating system Not the most optimal.
salt/modules/napalm_netacl.py
def _get_capirca_platform(): # pylint: disable=too-many-return-statements ''' Given the following NAPALM grains, we can determine the Capirca platform name: - vendor - device model - operating system Not the most optimal. ''' vendor = __grains__['vendor'].lower() os_ = __grains__[...
def _get_capirca_platform(): # pylint: disable=too-many-return-statements ''' Given the following NAPALM grains, we can determine the Capirca platform name: - vendor - device model - operating system Not the most optimal. ''' vendor = __grains__['vendor'].lower() os_ = __grains__[...
[ "Given", "the", "following", "NAPALM", "grains", "we", "can", "determine", "the", "Capirca", "platform", "name", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L80-L108
[ "def", "_get_capirca_platform", "(", ")", ":", "# pylint: disable=too-many-return-statements", "vendor", "=", "__grains__", "[", "'vendor'", "]", ".", "lower", "(", ")", "os_", "=", "__grains__", "[", "'os'", "]", ".", "lower", "(", ")", "model", "=", "__grain...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
load_term_config
Generate and load the configuration of a policy term. filter_name The name of the policy filter. term_name The name of the term. filter_options Additional filter options. These options are platform-specific. See the complete list of options_. .. _options: https://...
salt/modules/napalm_netacl.py
def load_term_config(filter_name, term_name, filter_options=None, pillar_key='acl', pillarenv=None, saltenv=None, merge_pillar=True, revision_id=None, r...
def load_term_config(filter_name, term_name, filter_options=None, pillar_key='acl', pillarenv=None, saltenv=None, merge_pillar=True, revision_id=None, r...
[ "Generate", "and", "load", "the", "configuration", "of", "a", "policy", "term", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L116-L451
[ "def", "load_term_config", "(", "filter_name", ",", "term_name", ",", "filter_options", "=", "None", ",", "pillar_key", "=", "'acl'", ",", "pillarenv", "=", "None", ",", "saltenv", "=", "None", ",", "merge_pillar", "=", "True", ",", "revision_id", "=", "None...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
load_filter_config
Generate and load the configuration of a policy filter. .. note:: The order of the terms is very important. The configuration loaded on the device respects the order defined in the ``terms`` and/or inside the pillar. When merging the ``terms`` with the pillar data, consider the ...
salt/modules/napalm_netacl.py
def load_filter_config(filter_name, filter_options=None, terms=None, prepend=True, pillar_key='acl', pillarenv=None, saltenv=None, merge_pillar=True, ...
def load_filter_config(filter_name, filter_options=None, terms=None, prepend=True, pillar_key='acl', pillarenv=None, saltenv=None, merge_pillar=True, ...
[ "Generate", "and", "load", "the", "configuration", "of", "a", "policy", "filter", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L455-L665
[ "def", "load_filter_config", "(", "filter_name", ",", "filter_options", "=", "None", ",", "terms", "=", "None", ",", "prepend", "=", "True", ",", "pillar_key", "=", "'acl'", ",", "pillarenv", "=", "None", ",", "saltenv", "=", "None", ",", "merge_pillar", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
load_policy_config
Generate and load the configuration of the whole policy. .. note:: The order of the filters and their terms is very important. The configuration loaded on the device respects the order defined in the ``filters`` and/or inside the pillar. When merging the ``filters`` with the pilla...
salt/modules/napalm_netacl.py
def load_policy_config(filters=None, prepend=True, pillar_key='acl', pillarenv=None, saltenv=None, merge_pillar=True, only_lower_merge=False, revision_id=None,...
def load_policy_config(filters=None, prepend=True, pillar_key='acl', pillarenv=None, saltenv=None, merge_pillar=True, only_lower_merge=False, revision_id=None,...
[ "Generate", "and", "load", "the", "configuration", "of", "the", "whole", "policy", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L669-L855
[ "def", "load_policy_config", "(", "filters", "=", "None", ",", "prepend", "=", "True", ",", "pillar_key", "=", "'acl'", ",", "pillarenv", "=", "None", ",", "saltenv", "=", "None", ",", "merge_pillar", "=", "True", ",", "only_lower_merge", "=", "False", ","...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_filter_pillar
Helper that can be used inside a state SLS, in order to get the filter configuration given its name. filter_name The name of the filter. pillar_key The root key of the whole policy config. pillarenv Query the master to generate fresh pillar data on the fly, specificall...
salt/modules/napalm_netacl.py
def get_filter_pillar(filter_name, pillar_key='acl', pillarenv=None, saltenv=None): ''' Helper that can be used inside a state SLS, in order to get the filter configuration given its name. filter_name The name of the filter. ...
def get_filter_pillar(filter_name, pillar_key='acl', pillarenv=None, saltenv=None): ''' Helper that can be used inside a state SLS, in order to get the filter configuration given its name. filter_name The name of the filter. ...
[ "Helper", "that", "can", "be", "used", "inside", "a", "state", "SLS", "in", "order", "to", "get", "the", "filter", "configuration", "given", "its", "name", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L858-L883
[ "def", "get_filter_pillar", "(", "filter_name", ",", "pillar_key", "=", "'acl'", ",", "pillarenv", "=", "None", ",", "saltenv", "=", "None", ")", ":", "return", "__salt__", "[", "'capirca.get_filter_pillar'", "]", "(", "filter_name", ",", "pillar_key", "=", "p...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_term_pillar
Helper that can be used inside a state SLS, in order to get the term configuration given its name, under a certain filter uniquely identified by its name. filter_name The name of the filter. term_name The name of the term. pillar_key: ``acl`` The root key of the whole poli...
salt/modules/napalm_netacl.py
def get_term_pillar(filter_name, term_name, pillar_key='acl', pillarenv=None, saltenv=None): ''' Helper that can be used inside a state SLS, in order to get the term configuration given its name, under a certain filter uniqu...
def get_term_pillar(filter_name, term_name, pillar_key='acl', pillarenv=None, saltenv=None): ''' Helper that can be used inside a state SLS, in order to get the term configuration given its name, under a certain filter uniqu...
[ "Helper", "that", "can", "be", "used", "inside", "a", "state", "SLS", "in", "order", "to", "get", "the", "term", "configuration", "given", "its", "name", "under", "a", "certain", "filter", "uniquely", "identified", "by", "its", "name", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_netacl.py#L886-L917
[ "def", "get_term_pillar", "(", "filter_name", ",", "term_name", ",", "pillar_key", "=", "'acl'", ",", "pillarenv", "=", "None", ",", "saltenv", "=", "None", ")", ":", "return", "__salt__", "[", "'capirca.get_term_pillar'", "]", "(", "filter_name", ",", "term_n...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_blade
Get Pure Storage FlasBlade configuration 1) From the minion config pure_tags: fb: san_ip: management vip or hostname for the FlashBlade api_token: A valid api token for the FlashBlade being managed 2) From environment (PUREFB_IP and PUREFB_API) 3) From the pillar (...
salt/modules/purefb.py
def _get_blade(): ''' Get Pure Storage FlasBlade configuration 1) From the minion config pure_tags: fb: san_ip: management vip or hostname for the FlashBlade api_token: A valid api token for the FlashBlade being managed 2) From environment (PUREFB_IP and PUREFB...
def _get_blade(): ''' Get Pure Storage FlasBlade configuration 1) From the minion config pure_tags: fb: san_ip: management vip or hostname for the FlashBlade api_token: A valid api token for the FlashBlade being managed 2) From environment (PUREFB_IP and PUREFB...
[ "Get", "Pure", "Storage", "FlasBlade", "configuration" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/purefb.py#L85-L123
[ "def", "_get_blade", "(", ")", ":", "try", ":", "blade_name", "=", "__opts__", "[", "'pure_tags'", "]", "[", "'fb'", "]", ".", "get", "(", "'san_ip'", ")", "api_token", "=", "__opts__", "[", "'pure_tags'", "]", "[", "'fb'", "]", ".", "get", "(", "'ap...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_fs
Private function to check for existance of a filesystem
salt/modules/purefb.py
def _get_fs(name, blade): ''' Private function to check for existance of a filesystem ''' _fs = [] _fs.append(name) try: res = blade.file_systems.list_file_systems(names=_fs) return res.items[0] except rest.ApiException: return None
def _get_fs(name, blade): ''' Private function to check for existance of a filesystem ''' _fs = [] _fs.append(name) try: res = blade.file_systems.list_file_systems(names=_fs) return res.items[0] except rest.ApiException: return None
[ "Private", "function", "to", "check", "for", "existance", "of", "a", "filesystem" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/purefb.py#L126-L137
[ "def", "_get_fs", "(", "name", ",", "blade", ")", ":", "_fs", "=", "[", "]", "_fs", ".", "append", "(", "name", ")", "try", ":", "res", "=", "blade", ".", "file_systems", ".", "list_file_systems", "(", "names", "=", "_fs", ")", "return", "res", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_snapshot
Return name of Snapshot or None
salt/modules/purefb.py
def _get_snapshot(name, suffix, blade): ''' Return name of Snapshot or None ''' try: filt = 'source=\'{}\' and suffix=\'{}\''.format(name, suffix) res = blade.file_system_snapshots.list_file_system_snapshots(filter=filt) return res.items[0] except rest.ApiException: ...
def _get_snapshot(name, suffix, blade): ''' Return name of Snapshot or None ''' try: filt = 'source=\'{}\' and suffix=\'{}\''.format(name, suffix) res = blade.file_system_snapshots.list_file_system_snapshots(filter=filt) return res.items[0] except rest.ApiException: ...
[ "Return", "name", "of", "Snapshot", "or", "None" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/purefb.py#L140-L150
[ "def", "_get_snapshot", "(", "name", ",", "suffix", ",", "blade", ")", ":", "try", ":", "filt", "=", "'source=\\'{}\\' and suffix=\\'{}\\''", ".", "format", "(", "name", ",", "suffix", ")", "res", "=", "blade", ".", "file_system_snapshots", ".", "list_file_sys...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_deleted_fs
Private function to check if a file systeem has already been deleted
salt/modules/purefb.py
def _get_deleted_fs(name, blade): ''' Private function to check if a file systeem has already been deleted ''' try: _fs = _get_fs(name, blade) if _fs and _fs.destroyed: return _fs except rest.ApiException: return None
def _get_deleted_fs(name, blade): ''' Private function to check if a file systeem has already been deleted ''' try: _fs = _get_fs(name, blade) if _fs and _fs.destroyed: return _fs except rest.ApiException: return None
[ "Private", "function", "to", "check", "if", "a", "file", "systeem", "has", "already", "been", "deleted" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/purefb.py#L153-L163
[ "def", "_get_deleted_fs", "(", "name", ",", "blade", ")", ":", "try", ":", "_fs", "=", "_get_fs", "(", "name", ",", "blade", ")", "if", "_fs", "and", "_fs", ".", "destroyed", ":", "return", "_fs", "except", "rest", ".", "ApiException", ":", "return", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
started
Ensures, that syslog-ng is started via the given parameters. Users shouldn't use this function, if the service module is available on their system.
salt/states/syslog_ng.py
def started(name=None, user=None, group=None, chroot=None, caps=None, no_caps=False, pidfile=None, enable_core=False, fd_limit=None, verbose=False, debug=False, trace=False, yy...
def started(name=None, user=None, group=None, chroot=None, caps=None, no_caps=False, pidfile=None, enable_core=False, fd_limit=None, verbose=False, debug=False, trace=False, yy...
[ "Ensures", "that", "syslog", "-", "ng", "is", "started", "via", "the", "given", "parameters", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/syslog_ng.py#L76-L115
[ "def", "started", "(", "name", "=", "None", ",", "user", "=", "None", ",", "group", "=", "None", ",", "chroot", "=", "None", ",", "caps", "=", "None", ",", "no_caps", "=", "False", ",", "pidfile", "=", "None", ",", "enable_core", "=", "False", ",",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SSHClient._prep_ssh
Prepare the arguments
salt/client/ssh/client.py
def _prep_ssh( self, tgt, fun, arg=(), timeout=None, tgt_type='glob', kwarg=None, **kwargs): ''' Prepare the arguments ''' opts = copy.deepcopy(self.opts) opts.update(kwargs) i...
def _prep_ssh( self, tgt, fun, arg=(), timeout=None, tgt_type='glob', kwarg=None, **kwargs): ''' Prepare the arguments ''' opts = copy.deepcopy(self.opts) opts.update(kwargs) i...
[ "Prepare", "the", "arguments" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/client.py#L43-L64
[ "def", "_prep_ssh", "(", "self", ",", "tgt", ",", "fun", ",", "arg", "=", "(", ")", ",", "timeout", "=", "None", ",", "tgt_type", "=", "'glob'", ",", "kwarg", "=", "None", ",", "*", "*", "kwargs", ")", ":", "opts", "=", "copy", ".", "deepcopy", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SSHClient.cmd_iter
Execute a single command via the salt-ssh subsystem and return a generator .. versionadded:: 2015.5.0
salt/client/ssh/client.py
def cmd_iter( self, tgt, fun, arg=(), timeout=None, tgt_type='glob', ret='', kwarg=None, **kwargs): ''' Execute a single command via the salt-ssh subsystem and return a generator ...
def cmd_iter( self, tgt, fun, arg=(), timeout=None, tgt_type='glob', ret='', kwarg=None, **kwargs): ''' Execute a single command via the salt-ssh subsystem and return a generator ...
[ "Execute", "a", "single", "command", "via", "the", "salt", "-", "ssh", "subsystem", "and", "return", "a", "generator" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/client.py#L66-L91
[ "def", "cmd_iter", "(", "self", ",", "tgt", ",", "fun", ",", "arg", "=", "(", ")", ",", "timeout", "=", "None", ",", "tgt_type", "=", "'glob'", ",", "ret", "=", "''", ",", "kwarg", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ssh", "=", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SSHClient.cmd
Execute a single command via the salt-ssh subsystem and return all routines at once .. versionadded:: 2015.5.0
salt/client/ssh/client.py
def cmd(self, tgt, fun, arg=(), timeout=None, tgt_type='glob', kwarg=None, **kwargs): ''' Execute a single command via the salt-ssh subsystem and return all routines at once .. versionadded:: 2015.5.0 ...
def cmd(self, tgt, fun, arg=(), timeout=None, tgt_type='glob', kwarg=None, **kwargs): ''' Execute a single command via the salt-ssh subsystem and return all routines at once .. versionadded:: 2015.5.0 ...
[ "Execute", "a", "single", "command", "via", "the", "salt", "-", "ssh", "subsystem", "and", "return", "all", "routines", "at", "once" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/client.py#L93-L118
[ "def", "cmd", "(", "self", ",", "tgt", ",", "fun", ",", "arg", "=", "(", ")", ",", "timeout", "=", "None", ",", "tgt_type", "=", "'glob'", ",", "kwarg", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ssh", "=", "self", ".", "_prep_ssh", "(", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SSHClient.cmd_sync
Execute a salt-ssh call synchronously. .. versionadded:: 2015.5.0 WARNING: Eauth is **NOT** respected .. code-block:: python client.cmd_sync({ 'tgt': 'silver', 'fun': 'test.ping', 'arg': (), 'tgt_type'='glob', ...
salt/client/ssh/client.py
def cmd_sync(self, low): ''' Execute a salt-ssh call synchronously. .. versionadded:: 2015.5.0 WARNING: Eauth is **NOT** respected .. code-block:: python client.cmd_sync({ 'tgt': 'silver', 'fun': 'test.ping', 'arg': ...
def cmd_sync(self, low): ''' Execute a salt-ssh call synchronously. .. versionadded:: 2015.5.0 WARNING: Eauth is **NOT** respected .. code-block:: python client.cmd_sync({ 'tgt': 'silver', 'fun': 'test.ping', 'arg': ...
[ "Execute", "a", "salt", "-", "ssh", "call", "synchronously", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/client.py#L120-L152
[ "def", "cmd_sync", "(", "self", ",", "low", ")", ":", "kwargs", "=", "copy", ".", "deepcopy", "(", "low", ")", "for", "ignore", "in", "[", "'tgt'", ",", "'fun'", ",", "'arg'", ",", "'timeout'", ",", "'tgt_type'", ",", "'kwarg'", "]", ":", "if", "ig...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SSHClient.cmd_subset
Execute a command on a random subset of the targeted systems The function signature is the same as :py:meth:`cmd` with the following exceptions. :param sub: The number of systems to execute on .. code-block:: python >>> import salt.client.ssh.client >>> sshcli...
salt/client/ssh/client.py
def cmd_subset( self, tgt, fun, arg=(), timeout=None, tgt_type='glob', ret='', kwarg=None, sub=3, **kwargs): ''' Execute a command on a random subset of the targeted systems T...
def cmd_subset( self, tgt, fun, arg=(), timeout=None, tgt_type='glob', ret='', kwarg=None, sub=3, **kwargs): ''' Execute a command on a random subset of the targeted systems T...
[ "Execute", "a", "command", "on", "a", "random", "subset", "of", "the", "targeted", "systems" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/client.py#L174-L214
[ "def", "cmd_subset", "(", "self", ",", "tgt", ",", "fun", ",", "arg", "=", "(", ")", ",", "timeout", "=", "None", ",", "tgt_type", "=", "'glob'", ",", "ret", "=", "''", ",", "kwarg", "=", "None", ",", "sub", "=", "3", ",", "*", "*", "kwargs", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_
Verify that the given module is set to the given target name The name of the module target The target to be set for this module module_parameter additional params passed to the defined module action_parameter additional params passed to the defined action .. code...
salt/states/eselect.py
def set_(name, target, module_parameter=None, action_parameter=None): ''' Verify that the given module is set to the given target name The name of the module target The target to be set for this module module_parameter additional params passed to the defined module ac...
def set_(name, target, module_parameter=None, action_parameter=None): ''' Verify that the given module is set to the given target name The name of the module target The target to be set for this module module_parameter additional params passed to the defined module ac...
[ "Verify", "that", "the", "given", "module", "is", "set", "to", "the", "given", "target" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/eselect.py#L26-L85
[ "def", "set_", "(", "name", ",", "target", ",", "module_parameter", "=", "None", ",", "action_parameter", "=", "None", ")", ":", "ret", "=", "{", "'changes'", ":", "{", "}", ",", "'comment'", ":", "''", ",", "'name'", ":", "name", ",", "'result'", ":...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_filter_list
Filters a list of dictionary by a set of key-value pair. :param input_list: is a list of dictionaries :param search_key: is the key we are looking for :param search_value: is the value we are looking for the key specified in search_key :return: filered list of dictionaries
salt/modules/napalm_network.py
def _filter_list(input_list, search_key, search_value): ''' Filters a list of dictionary by a set of key-value pair. :param input_list: is a list of dictionaries :param search_key: is the key we are looking for :param search_value: is the value we are looking for the key specified in search_ke...
def _filter_list(input_list, search_key, search_value): ''' Filters a list of dictionary by a set of key-value pair. :param input_list: is a list of dictionaries :param search_key: is the key we are looking for :param search_value: is the value we are looking for the key specified in search_ke...
[ "Filters", "a", "list", "of", "dictionary", "by", "a", "set", "of", "key", "-", "value", "pair", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L70-L87
[ "def", "_filter_list", "(", "input_list", ",", "search_key", ",", "search_value", ")", ":", "output_list", "=", "list", "(", ")", "for", "dictionary", "in", "input_list", ":", "if", "dictionary", ".", "get", "(", "search_key", ")", "==", "search_value", ":",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_filter_dict
Filters a dictionary of dictionaries by a key-value pair. :param input_dict: is a dictionary whose values are lists of dictionaries :param search_key: is the key in the leaf dictionaries :param search_values: is the value in the leaf dictionaries :return: filtered dictionary
salt/modules/napalm_network.py
def _filter_dict(input_dict, search_key, search_value): ''' Filters a dictionary of dictionaries by a key-value pair. :param input_dict: is a dictionary whose values are lists of dictionaries :param search_key: is the key in the leaf dictionaries :param search_values: is the value in the lea...
def _filter_dict(input_dict, search_key, search_value): ''' Filters a dictionary of dictionaries by a key-value pair. :param input_dict: is a dictionary whose values are lists of dictionaries :param search_key: is the key in the leaf dictionaries :param search_values: is the value in the lea...
[ "Filters", "a", "dictionary", "of", "dictionaries", "by", "a", "key", "-", "value", "pair", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L90-L108
[ "def", "_filter_dict", "(", "input_dict", ",", "search_key", ",", "search_value", ")", ":", "output_dict", "=", "dict", "(", ")", "for", "key", ",", "key_list", "in", "six", ".", "iteritems", "(", "input_dict", ")", ":", "key_list_filtered", "=", "_filter_li...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_explicit_close
Will explicily close the config session with the network device, when running in a now-always-alive proxy minion or regular minion. This helper must be used in configuration-related functions, as the session is preserved and not closed before making any changes.
salt/modules/napalm_network.py
def _explicit_close(napalm_device): ''' Will explicily close the config session with the network device, when running in a now-always-alive proxy minion or regular minion. This helper must be used in configuration-related functions, as the session is preserved and not closed before making any change...
def _explicit_close(napalm_device): ''' Will explicily close the config session with the network device, when running in a now-always-alive proxy minion or regular minion. This helper must be used in configuration-related functions, as the session is preserved and not closed before making any change...
[ "Will", "explicily", "close", "the", "config", "session", "with", "the", "network", "device", "when", "running", "in", "a", "now", "-", "always", "-", "alive", "proxy", "minion", "or", "regular", "minion", ".", "This", "helper", "must", "be", "used", "in",...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L142-L158
[ "def", "_explicit_close", "(", "napalm_device", ")", ":", "if", "salt", ".", "utils", ".", "napalm", ".", "not_always_alive", "(", "__opts__", ")", ":", "# force closing the configuration session", "# when running in a non-always-alive proxy", "# or regular minion", "try", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_config_logic
Builds the config logic for `load_config` and `load_template` functions.
salt/modules/napalm_network.py
def _config_logic(napalm_device, loaded_result, test=False, debug=False, replace=False, commit_config=True, loaded_config=None, commit_in=None, commit_at=None, ...
def _config_logic(napalm_device, loaded_result, test=False, debug=False, replace=False, commit_config=True, loaded_config=None, commit_in=None, commit_at=None, ...
[ "Builds", "the", "config", "logic", "for", "load_config", "and", "load_template", "functions", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L161-L345
[ "def", "_config_logic", "(", "napalm_device", ",", "loaded_result", ",", "test", "=", "False", ",", "debug", "=", "False", ",", "replace", "=", "False", ",", "commit_config", "=", "True", ",", "loaded_config", "=", "None", ",", "commit_in", "=", "None", ",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cli
Returns a dictionary with the raw output of all commands passed as arguments. commands List of commands to be executed on the device. textfsm_parse: ``False`` Try parsing the outputs using the TextFSM templates. .. versionadded:: 2018.3.0 .. note:: This option can...
salt/modules/napalm_network.py
def cli(*commands, **kwargs): # pylint: disable=unused-argument ''' Returns a dictionary with the raw output of all commands passed as arguments. commands List of commands to be executed on the device. textfsm_parse: ``False`` Try parsing the outputs using the TextFSM templates. ...
def cli(*commands, **kwargs): # pylint: disable=unused-argument ''' Returns a dictionary with the raw output of all commands passed as arguments. commands List of commands to be executed on the device. textfsm_parse: ``False`` Try parsing the outputs using the TextFSM templates. ...
[ "Returns", "a", "dictionary", "with", "the", "raw", "output", "of", "all", "commands", "passed", "as", "arguments", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L492-L783
[ "def", "cli", "(", "*", "commands", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "raw_cli_outputs", "=", "salt", ".", "utils", ".", "napalm", ".", "call", "(", "napalm_device", ",", "# pylint: disable=undefined-variable", "'cli'", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
traceroute
Calls the method traceroute from the NAPALM driver object and returns a dictionary with the result of the traceroute command executed on the device. destination Hostname or address of remote host source Source address to use in outgoing traceroute packets ttl IP maximum time-t...
salt/modules/napalm_network.py
def traceroute(destination, source=None, ttl=None, timeout=None, vrf=None, **kwargs): # pylint: disable=unused-argument ''' Calls the method traceroute from the NAPALM driver object and returns a dictionary with the result of the traceroute command executed on the device. destination Hostname...
def traceroute(destination, source=None, ttl=None, timeout=None, vrf=None, **kwargs): # pylint: disable=unused-argument ''' Calls the method traceroute from the NAPALM driver object and returns a dictionary with the result of the traceroute command executed on the device. destination Hostname...
[ "Calls", "the", "method", "traceroute", "from", "the", "NAPALM", "driver", "object", "and", "returns", "a", "dictionary", "with", "the", "result", "of", "the", "traceroute", "command", "executed", "on", "the", "device", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L787-L828
[ "def", "traceroute", "(", "destination", ",", "source", "=", "None", ",", "ttl", "=", "None", ",", "timeout", "=", "None", ",", "vrf", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "return", "salt", ".", "utils", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
train
ping
Executes a ping on the network device and returns a dictionary as a result. destination Hostname or IP address of remote host source Source address of echo request ttl IP time-to-live value (IPv6 hop-limit value) (1..255 hops) timeout Maximum wait time after sending f...
salt/modules/napalm_network.py
def ping(destination, source=None, ttl=None, timeout=None, size=None, count=None, vrf=None, **kwargs): # pylint: disable=unused-argument ''' Executes a ping on the network device and returns a dictionary as a result. destination Hostname or IP address of remote host source Source add...
def ping(destination, source=None, ttl=None, timeout=None, size=None, count=None, vrf=None, **kwargs): # pylint: disable=unused-argument ''' Executes a ping on the network device and returns a dictionary as a result. destination Hostname or IP address of remote host source Source add...
[ "Executes", "a", "ping", "on", "the", "network", "device", "and", "returns", "a", "dictionary", "as", "a", "result", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L832-L881
[ "def", "ping", "(", "destination", ",", "source", "=", "None", ",", "ttl", "=", "None", ",", "timeout", "=", "None", ",", "size", "=", "None", ",", "count", "=", "None", ",", "vrf", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
arp
NAPALM returns a list of dictionaries with details of the ARP entries. :param interface: interface name to filter on :param ipaddr: IP address to filter on :param macaddr: MAC address to filter on :return: List of the entries in the ARP table CLI Example: .. code-block:: bash salt '*...
salt/modules/napalm_network.py
def arp(interface='', ipaddr='', macaddr='', **kwargs): # pylint: disable=unused-argument ''' NAPALM returns a list of dictionaries with details of the ARP entries. :param interface: interface name to filter on :param ipaddr: IP address to filter on :param macaddr: MAC address to filter on :r...
def arp(interface='', ipaddr='', macaddr='', **kwargs): # pylint: disable=unused-argument ''' NAPALM returns a list of dictionaries with details of the ARP entries. :param interface: interface name to filter on :param ipaddr: IP address to filter on :param macaddr: MAC address to filter on :r...
[ "NAPALM", "returns", "a", "list", "of", "dictionaries", "with", "details", "of", "the", "ARP", "entries", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L885-L947
[ "def", "arp", "(", "interface", "=", "''", ",", "ipaddr", "=", "''", ",", "macaddr", "=", "''", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "proxy_output", "=", "salt", ".", "utils", ".", "napalm", ".", "call", "(", "napalm_de...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
lldp
Returns a detailed view of the LLDP neighbors. :param interface: interface name to filter on :return: A dictionary with the LLDL neighbors. The keys are the interfaces with LLDP activated on. CLI Example: .. code-block:: bash salt '*' net.lldp salt '*' net.lldp inte...
salt/modules/napalm_network.py
def lldp(interface='', **kwargs): # pylint: disable=unused-argument ''' Returns a detailed view of the LLDP neighbors. :param interface: interface name to filter on :return: A dictionary with the LLDL neighbors. The keys are the interfaces with LLDP activated on. CLI Example: ...
def lldp(interface='', **kwargs): # pylint: disable=unused-argument ''' Returns a detailed view of the LLDP neighbors. :param interface: interface name to filter on :return: A dictionary with the LLDL neighbors. The keys are the interfaces with LLDP activated on. CLI Example: ...
[ "Returns", "a", "detailed", "view", "of", "the", "LLDP", "neighbors", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L1058-L1117
[ "def", "lldp", "(", "interface", "=", "''", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "proxy_output", "=", "salt", ".", "utils", ".", "napalm", ".", "call", "(", "napalm_device", ",", "# pylint: disable=undefined-variable", "'get_lldp...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
mac
Returns the MAC Address Table on the device. :param address: MAC address to filter on :param interface: Interface name to filter on :param vlan: VLAN identifier :return: A list of dictionaries representing the entries in the MAC Address Table CLI Example: .. code-block:: bash ...
salt/modules/napalm_network.py
def mac(address='', interface='', vlan=0, **kwargs): # pylint: disable=unused-argument ''' Returns the MAC Address Table on the device. :param address: MAC address to filter on :param interface: Interface name to filter on :param vlan: VLAN identifier :return: A list of dictio...
def mac(address='', interface='', vlan=0, **kwargs): # pylint: disable=unused-argument ''' Returns the MAC Address Table on the device. :param address: MAC address to filter on :param interface: Interface name to filter on :param vlan: VLAN identifier :return: A list of dictio...
[ "Returns", "the", "MAC", "Address", "Table", "on", "the", "device", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L1121-L1190
[ "def", "mac", "(", "address", "=", "''", ",", "interface", "=", "''", ",", "vlan", "=", "0", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "proxy_output", "=", "salt", ".", "utils", ".", "napalm", ".", "call", "(", "napalm_devic...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
load_config
Applies configuration changes on the device. It can be loaded from a file or from inline string. If you send both a filename and a string containing the configuration, the file has higher precedence. By default this function will commit the changes. If there are no changes, it does not commit and the flag ...
salt/modules/napalm_network.py
def load_config(filename=None, text=None, test=False, commit=True, debug=False, replace=False, commit_in=None, commit_at=None, revert_in=None, revert_at=None, c...
def load_config(filename=None, text=None, test=False, commit=True, debug=False, replace=False, commit_in=None, commit_at=None, revert_in=None, revert_at=None, c...
[ "Applies", "configuration", "changes", "on", "the", "device", ".", "It", "can", "be", "loaded", "from", "a", "file", "or", "from", "inline", "string", ".", "If", "you", "send", "both", "a", "filename", "and", "a", "string", "containing", "the", "configurat...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L1296-L1551
[ "def", "load_config", "(", "filename", "=", "None", ",", "text", "=", "None", ",", "test", "=", "False", ",", "commit", "=", "True", ",", "debug", "=", "False", ",", "replace", "=", "False", ",", "commit_in", "=", "None", ",", "commit_at", "=", "None...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
load_template
Renders a configuration template (default: Jinja) and loads the result on the device. By default this function will commit the changes. If there are no changes, it does not commit, discards he config and the flag ``already_configured`` will be set as ``True`` to point this out. To avoid committing the...
salt/modules/napalm_network.py
def load_template(template_name=None, template_source=None, context=None, defaults=None, template_engine='jinja', saltenv='base', template_hash=None, template_hash_name=None, s...
def load_template(template_name=None, template_source=None, context=None, defaults=None, template_engine='jinja', saltenv='base', template_hash=None, template_hash_name=None, s...
[ "Renders", "a", "configuration", "template", "(", "default", ":", "Jinja", ")", "and", "loads", "the", "result", "on", "the", "device", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L1555-L2082
[ "def", "load_template", "(", "template_name", "=", "None", ",", "template_source", "=", "None", ",", "context", "=", "None", ",", "defaults", "=", "None", ",", "template_engine", "=", "'jinja'", ",", "saltenv", "=", "'base'", ",", "template_hash", "=", "None...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
config_changed
Will prompt if the configuration has been changed. :return: A tuple with a boolean that specifies if the config was changed on the device.\ And a string that provides more details of the reason why the configuration was not changed. CLI Example: .. code-block:: bash salt '*' net.config_chang...
salt/modules/napalm_network.py
def config_changed(inherit_napalm_device=None, **kwargs): # pylint: disable=unused-argument ''' Will prompt if the configuration has been changed. :return: A tuple with a boolean that specifies if the config was changed on the device.\ And a string that provides more details of the reason why the con...
def config_changed(inherit_napalm_device=None, **kwargs): # pylint: disable=unused-argument ''' Will prompt if the configuration has been changed. :return: A tuple with a boolean that specifies if the config was changed on the device.\ And a string that provides more details of the reason why the con...
[ "Will", "prompt", "if", "the", "configuration", "has", "been", "changed", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L2166-L2193
[ "def", "config_changed", "(", "inherit_napalm_device", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "is_config_changed", "=", "False", "reason", "=", "''", "try_compare", "=", "compare_config", "(", "inherit_napalm_device", "=",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
config_control
Will check if the configuration was changed. If differences found, will try to commit. In case commit unsuccessful, will try to rollback. :return: A tuple with a boolean that specifies if the config was changed/committed/rollbacked on the device.\ And a string that provides more details of the reason w...
salt/modules/napalm_network.py
def config_control(inherit_napalm_device=None, **kwargs): # pylint: disable=unused-argument ''' Will check if the configuration was changed. If differences found, will try to commit. In case commit unsuccessful, will try to rollback. :return: A tuple with a boolean that specifies if the config wa...
def config_control(inherit_napalm_device=None, **kwargs): # pylint: disable=unused-argument ''' Will check if the configuration was changed. If differences found, will try to commit. In case commit unsuccessful, will try to rollback. :return: A tuple with a boolean that specifies if the config wa...
[ "Will", "check", "if", "the", "configuration", "was", "changed", ".", "If", "differences", "found", "will", "try", "to", "commit", ".", "In", "case", "commit", "unsuccessful", "will", "try", "to", "rollback", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L2197-L2235
[ "def", "config_control", "(", "inherit_napalm_device", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "result", "=", "True", "comment", "=", "''", "changed", ",", "not_changed_rsn", "=", "config_changed", "(", "inherit_napalm_de...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cancel_commit
.. versionadded:: 2019.2.0 Cancel a commit scheduled to be executed via the ``commit_in`` and ``commit_at`` arguments from the :py:func:`net.load_template <salt.modules.napalm_network.load_template>` or :py:func:`net.load_config <salt.modules.napalm_network.load_config>` execution functions. The co...
salt/modules/napalm_network.py
def cancel_commit(jid): ''' .. versionadded:: 2019.2.0 Cancel a commit scheduled to be executed via the ``commit_in`` and ``commit_at`` arguments from the :py:func:`net.load_template <salt.modules.napalm_network.load_template>` or :py:func:`net.load_config <salt.modules.napalm_network.load_conf...
def cancel_commit(jid): ''' .. versionadded:: 2019.2.0 Cancel a commit scheduled to be executed via the ``commit_in`` and ``commit_at`` arguments from the :py:func:`net.load_template <salt.modules.napalm_network.load_template>` or :py:func:`net.load_config <salt.modules.napalm_network.load_conf...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L2238-L2262
[ "def", "cancel_commit", "(", "jid", ")", ":", "job_name", "=", "'__napalm_commit_{}'", ".", "format", "(", "jid", ")", "removed", "=", "__salt__", "[", "'schedule.delete'", "]", "(", "job_name", ")", "if", "removed", "[", "'result'", "]", ":", "saved", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
confirm_commit
.. versionadded:: 2019.2.0 Confirm a commit scheduled to be reverted via the ``revert_in`` and ``revert_at`` arguments from the :mod:`net.load_template <salt.modules.napalm_network.load_template>` or :mod:`net.load_config <salt.modules.napalm_network.load_config>` execution functions. The commit I...
salt/modules/napalm_network.py
def confirm_commit(jid): ''' .. versionadded:: 2019.2.0 Confirm a commit scheduled to be reverted via the ``revert_in`` and ``revert_at`` arguments from the :mod:`net.load_template <salt.modules.napalm_network.load_template>` or :mod:`net.load_config <salt.modules.napalm_network.load_config>` ...
def confirm_commit(jid): ''' .. versionadded:: 2019.2.0 Confirm a commit scheduled to be reverted via the ``revert_in`` and ``revert_at`` arguments from the :mod:`net.load_template <salt.modules.napalm_network.load_template>` or :mod:`net.load_config <salt.modules.napalm_network.load_config>` ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L2265-L2291
[ "def", "confirm_commit", "(", "jid", ")", ":", "if", "__grains__", "[", "'os'", "]", "==", "'junos'", ":", "# Confirm the commit, by committing (i.e., invoking the RPC call)", "confirmed", "=", "__salt__", "[", "'napalm.junos_commit'", "]", "(", ")", "confirmed", "[",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
save_config
.. versionadded:: 2019.2.0 Save the configuration to a file on the local file system. source: ``running`` The configuration source. Choose from: ``running``, ``candidate``, ``startup``. Default: ``running``. path Absolute path to file where to save the configuration. To pu...
salt/modules/napalm_network.py
def save_config(source=None, path=None): ''' .. versionadded:: 2019.2.0 Save the configuration to a file on the local file system. source: ``running`` The configuration source. Choose from: ``running``, ``candidate``, ``startup``. Default: ``running``. path ...
def save_config(source=None, path=None): ''' .. versionadded:: 2019.2.0 Save the configuration to a file on the local file system. source: ``running`` The configuration source. Choose from: ``running``, ``candidate``, ``startup``. Default: ``running``. path ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L2294-L2330
[ "def", "save_config", "(", "source", "=", "None", ",", "path", "=", "None", ")", ":", "if", "not", "source", ":", "source", "=", "'running'", "if", "not", "path", ":", "path", "=", "salt", ".", "utils", ".", "files", ".", "mkstemp", "(", ")", "runn...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
replace_pattern
.. versionadded:: 2019.2.0 Replace occurrences of a pattern in the configuration source. If ``show_changes`` is ``True``, then a diff of what changed will be returned, otherwise a ``True`` will be returned when changes are made, and ``False`` when no changes are made. This is a pure Python implemen...
salt/modules/napalm_network.py
def replace_pattern(pattern, repl, count=0, flags=8, bufsize=1, append_if_not_found=False, prepend_if_not_found=False, not_found_content=None, search_only=False...
def replace_pattern(pattern, repl, count=0, flags=8, bufsize=1, append_if_not_found=False, prepend_if_not_found=False, not_found_content=None, search_only=False...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L2333-L2473
[ "def", "replace_pattern", "(", "pattern", ",", "repl", ",", "count", "=", "0", ",", "flags", "=", "8", ",", "bufsize", "=", "1", ",", "append_if_not_found", "=", "False", ",", "prepend_if_not_found", "=", "False", ",", "not_found_content", "=", "None", ","...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
blockreplace
.. versionadded:: 2019.2.0 Replace content of the configuration source, delimited by the line markers. A block of content delimited by comments can help you manage several lines without worrying about old entries removal. marker_start The line content identifying a line as the start of the co...
salt/modules/napalm_network.py
def blockreplace(marker_start, marker_end, content='', append_if_not_found=False, prepend_if_not_found=False, show_changes=True, append_newline=False, source='running', path=None, ...
def blockreplace(marker_start, marker_end, content='', append_if_not_found=False, prepend_if_not_found=False, show_changes=True, append_newline=False, source='running', path=None, ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L2476-L2582
[ "def", "blockreplace", "(", "marker_start", ",", "marker_end", ",", "content", "=", "''", ",", "append_if_not_found", "=", "False", ",", "prepend_if_not_found", "=", "False", ",", "show_changes", "=", "True", ",", "append_newline", "=", "False", ",", "source", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
patch
.. versionadded:: 2019.2.0 Apply a patch to the configuration source, and load the result into the running config of the device. patchfile A patch file to apply to the configuration source. options Options to pass to patch. source_hash If the patch file (specified via the...
salt/modules/napalm_network.py
def patch(patchfile, options='', saltenv='base', source_hash=None, show_changes=True, source='running', path=None, test=False, commit=True, debug=False, replace=True): ''' .. versionadded:: 2019.2.0 Apply a ...
def patch(patchfile, options='', saltenv='base', source_hash=None, show_changes=True, source='running', path=None, test=False, commit=True, debug=False, replace=True): ''' .. versionadded:: 2019.2.0 Apply a ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_network.py#L2585-L2670
[ "def", "patch", "(", "patchfile", ",", "options", "=", "''", ",", "saltenv", "=", "'base'", ",", "source_hash", "=", "None", ",", "show_changes", "=", "True", ",", "source", "=", "'running'", ",", "path", "=", "None", ",", "test", "=", "False", ",", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
SaltRun.run
Execute salt-run
salt/cli/run.py
def run(self): ''' Execute salt-run ''' import salt.runner self.parse_args() # Setup file logging! self.setup_logfile_logger() verify_log(self.config) profiling_enabled = self.options.profiling_enabled runner = salt.runner.Runner(self.con...
def run(self): ''' Execute salt-run ''' import salt.runner self.parse_args() # Setup file logging! self.setup_logfile_logger() verify_log(self.config) profiling_enabled = self.options.profiling_enabled runner = salt.runner.Runner(self.con...
[ "Execute", "salt", "-", "run" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/run.py#L17-L58
[ "def", "run", "(", "self", ")", ":", "import", "salt", ".", "runner", "self", ".", "parse_args", "(", ")", "# Setup file logging!", "self", ".", "setup_logfile_logger", "(", ")", "verify_log", "(", "self", ".", "config", ")", "profiling_enabled", "=", "self"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
blade_idrac
Set parameters for iDRAC in a blade. :param idrac_password: Password to use to connect to the iDRACs directly (idrac_ipmi and idrac_dnsname must be set directly on the iDRAC. They can't be set through the CMC. If this password is present, use it instead of the CMC password) :param idr...
salt/states/dellchassis.py
def blade_idrac(name, idrac_password=None, idrac_ipmi=None, idrac_ip=None, idrac_netmask=None, idrac_gateway=None, idrac_dnsname=None, idrac_dhcp=None): ''' Set parameters for iDRAC in a blade. :param idrac_password: Password to use to connect to the iDRACs d...
def blade_idrac(name, idrac_password=None, idrac_ipmi=None, idrac_ip=None, idrac_netmask=None, idrac_gateway=None, idrac_dnsname=None, idrac_dhcp=None): ''' Set parameters for iDRAC in a blade. :param idrac_password: Password to use to connect to the iDRACs d...
[ "Set", "parameters", "for", "iDRAC", "in", "a", "blade", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/dellchassis.py#L174-L317
[ "def", "blade_idrac", "(", "name", ",", "idrac_password", "=", "None", ",", "idrac_ipmi", "=", "None", ",", "idrac_ip", "=", "None", ",", "idrac_netmask", "=", "None", ",", "idrac_gateway", "=", "None", ",", "idrac_dnsname", "=", "None", ",", "idrac_dhcp", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
chassis
Manage a Dell Chassis. chassis_name The name of the chassis. datacenter The datacenter in which the chassis is located location The location of the chassis. password Password for the chassis. Note: If this password is set for the chassis, the current implement...
salt/states/dellchassis.py
def chassis(name, chassis_name=None, password=None, datacenter=None, location=None, mode=None, idrac_launch=None, slot_names=None, blade_power_states=None): ''' Manage a Dell Chassis. chassis_name The name of the chassis. datacenter The datacenter in which the c...
def chassis(name, chassis_name=None, password=None, datacenter=None, location=None, mode=None, idrac_launch=None, slot_names=None, blade_power_states=None): ''' Manage a Dell Chassis. chassis_name The name of the chassis. datacenter The datacenter in which the c...
[ "Manage", "a", "Dell", "Chassis", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/dellchassis.py#L320-L546
[ "def", "chassis", "(", "name", ",", "chassis_name", "=", "None", ",", "password", "=", "None", ",", "datacenter", "=", "None", ",", "location", "=", "None", ",", "mode", "=", "None", ",", "idrac_launch", "=", "None", ",", "slot_names", "=", "None", ","...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
switch
Manage switches in a Dell Chassis. name The switch designation (e.g. switch-1, switch-2) ip The Static IP Address of the switch netmask The netmask for the static IP gateway The gateway for the static IP dhcp True: Enable DHCP False: Do not change...
salt/states/dellchassis.py
def switch(name, ip=None, netmask=None, gateway=None, dhcp=None, password=None, snmp=None): ''' Manage switches in a Dell Chassis. name The switch designation (e.g. switch-1, switch-2) ip The Static IP Address of the switch netmask The netmask for the stati...
def switch(name, ip=None, netmask=None, gateway=None, dhcp=None, password=None, snmp=None): ''' Manage switches in a Dell Chassis. name The switch designation (e.g. switch-1, switch-2) ip The Static IP Address of the switch netmask The netmask for the stati...
[ "Manage", "switches", "in", "a", "Dell", "Chassis", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/dellchassis.py#L549-L664
[ "def", "switch", "(", "name", ",", "ip", "=", "None", ",", "netmask", "=", "None", ",", "gateway", "=", "None", ",", "dhcp", "=", "None", ",", "password", "=", "None", ",", "snmp", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_firmware_update
Update firmware for a single host
salt/states/dellchassis.py
def _firmware_update(firmwarefile='', host='', directory=''): ''' Update firmware for a single host ''' dest = os.path.join(directory, firmwarefile[7:]) __salt__['cp.get_file'](firmwarefile, dest) username = __pillar__['proxy']['admin_user'] password = __pillar__['prox...
def _firmware_update(firmwarefile='', host='', directory=''): ''' Update firmware for a single host ''' dest = os.path.join(directory, firmwarefile[7:]) __salt__['cp.get_file'](firmwarefile, dest) username = __pillar__['proxy']['admin_user'] password = __pillar__['prox...
[ "Update", "firmware", "for", "a", "single", "host" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/dellchassis.py#L667-L681
[ "def", "_firmware_update", "(", "firmwarefile", "=", "''", ",", "host", "=", "''", ",", "directory", "=", "''", ")", ":", "dest", "=", "os", ".", "path", ".", "join", "(", "directory", ",", "firmwarefile", "[", "7", ":", "]", ")", "__salt__", "[", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
firmware_update
State to update the firmware on host using the ``racadm`` command firmwarefile filename (string) starting with ``salt://`` host string representing the hostname supplied to the ``racadm`` command directory Directory name where firmwarefile...
salt/states/dellchassis.py
def firmware_update(hosts=None, directory=''): ''' State to update the firmware on host using the ``racadm`` command firmwarefile filename (string) starting with ``salt://`` host string representing the hostname supplied to the ``racadm`` command ...
def firmware_update(hosts=None, directory=''): ''' State to update the firmware on host using the ``racadm`` command firmwarefile filename (string) starting with ``salt://`` host string representing the hostname supplied to the ``racadm`` command ...
[ "State", "to", "update", "the", "firmware", "on", "host", "using", "the", "racadm", "command" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/dellchassis.py#L684-L731
[ "def", "firmware_update", "(", "hosts", "=", "None", ",", "directory", "=", "''", ")", ":", "ret", "=", "{", "}", "ret", ".", "changes", "=", "{", "}", "success", "=", "True", "for", "host", ",", "firmwarefile", "in", "hosts", ":", "try", ":", "_fi...
e8541fd6e744ab0df786c0f76102e41631f45d46