partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
train
get_info
Retrieves information about a registered nameserver. Returns the following information: - IP Address set for the nameserver - Domain name which was queried - A list of nameservers and their statuses sld SLD of the domain name tld TLD of the domain name nameserver ...
salt/modules/namecheap_domains_ns.py
def get_info(sld, tld, nameserver): ''' Retrieves information about a registered nameserver. Returns the following information: - IP Address set for the nameserver - Domain name which was queried - A list of nameservers and their statuses sld SLD of the domain name tld ...
def get_info(sld, tld, nameserver): ''' Retrieves information about a registered nameserver. Returns the following information: - IP Address set for the nameserver - Domain name which was queried - A list of nameservers and their statuses sld SLD of the domain name tld ...
[ "Retrieves", "information", "about", "a", "registered", "nameserver", ".", "Returns", "the", "following", "information", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains_ns.py#L52-L87
[ "def", "get_info", "(", "sld", ",", "tld", ",", "nameserver", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.ns.delete'", ")", "opts", "[", "'SLD'", "]", "=", "sld", "opts", "[", "'TLD'", "]", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update
Deletes a nameserver. Returns ``True`` if the nameserver was updated successfully. sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to create old_ip Current ip address new_ip New ip address CLI Example: .. code-blo...
salt/modules/namecheap_domains_ns.py
def update(sld, tld, nameserver, old_ip, new_ip): ''' Deletes a nameserver. Returns ``True`` if the nameserver was updated successfully. sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to create old_ip Current ip address ne...
def update(sld, tld, nameserver, old_ip, new_ip): ''' Deletes a nameserver. Returns ``True`` if the nameserver was updated successfully. sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to create old_ip Current ip address ne...
[ "Deletes", "a", "nameserver", ".", "Returns", "True", "if", "the", "nameserver", "was", "updated", "successfully", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains_ns.py#L90-L128
[ "def", "update", "(", "sld", ",", "tld", ",", "nameserver", ",", "old_ip", ",", "new_ip", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.ns.update'", ")", "opts", "[", "'SLD'", "]", "=", "sld", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
delete
Deletes a nameserver. Returns ``True`` if the nameserver was deleted successfully sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to delete CLI Example: .. code-block:: bash salt '*' namecheap_domains_ns.delete sld tld nameserver
salt/modules/namecheap_domains_ns.py
def delete(sld, tld, nameserver): ''' Deletes a nameserver. Returns ``True`` if the nameserver was deleted successfully sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to delete CLI Example: .. code-block:: bash salt '*' n...
def delete(sld, tld, nameserver): ''' Deletes a nameserver. Returns ``True`` if the nameserver was deleted successfully sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to delete CLI Example: .. code-block:: bash salt '*' n...
[ "Deletes", "a", "nameserver", ".", "Returns", "True", "if", "the", "nameserver", "was", "deleted", "successfully" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains_ns.py#L131-L161
[ "def", "delete", "(", "sld", ",", "tld", ",", "nameserver", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.ns.delete'", ")", "opts", "[", "'SLD'", "]", "=", "sld", "opts", "[", "'TLD'", "]", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
Creates a new nameserver. Returns ``True`` if the nameserver was created successfully. sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to create ip Nameserver IP address CLI Example: .. code-block:: bash salt '*' name...
salt/modules/namecheap_domains_ns.py
def create(sld, tld, nameserver, ip): ''' Creates a new nameserver. Returns ``True`` if the nameserver was created successfully. sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to create ip Nameserver IP address CLI Example...
def create(sld, tld, nameserver, ip): ''' Creates a new nameserver. Returns ``True`` if the nameserver was created successfully. sld SLD of the domain name tld TLD of the domain name nameserver Nameserver to create ip Nameserver IP address CLI Example...
[ "Creates", "a", "new", "nameserver", ".", "Returns", "True", "if", "the", "nameserver", "was", "created", "successfully", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/namecheap_domains_ns.py#L164-L199
[ "def", "create", "(", "sld", ",", "tld", ",", "nameserver", ",", "ip", ")", ":", "opts", "=", "salt", ".", "utils", ".", "namecheap", ".", "get_opts", "(", "'namecheap.domains.ns.create'", ")", "opts", "[", "'SLD'", "]", "=", "sld", "opts", "[", "'TLD'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
version
Shows installed version of dnsmasq. CLI Example: .. code-block:: bash salt '*' dnsmasq.version
salt/modules/dnsmasq.py
def version(): ''' Shows installed version of dnsmasq. CLI Example: .. code-block:: bash salt '*' dnsmasq.version ''' cmd = 'dnsmasq -v' out = __salt__['cmd.run'](cmd).splitlines() comps = out[0].split() return comps[2]
def version(): ''' Shows installed version of dnsmasq. CLI Example: .. code-block:: bash salt '*' dnsmasq.version ''' cmd = 'dnsmasq -v' out = __salt__['cmd.run'](cmd).splitlines() comps = out[0].split() return comps[2]
[ "Shows", "installed", "version", "of", "dnsmasq", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsmasq.py#L35-L48
[ "def", "version", "(", ")", ":", "cmd", "=", "'dnsmasq -v'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", ".", "splitlines", "(", ")", "comps", "=", "out", "[", "0", "]", ".", "split", "(", ")", "return", "comps", "[", "2", "]"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
fullversion
Shows installed version of dnsmasq and compile options. CLI Example: .. code-block:: bash salt '*' dnsmasq.fullversion
salt/modules/dnsmasq.py
def fullversion(): ''' Shows installed version of dnsmasq and compile options. CLI Example: .. code-block:: bash salt '*' dnsmasq.fullversion ''' cmd = 'dnsmasq -v' out = __salt__['cmd.run'](cmd).splitlines() comps = out[0].split() version_num = comps[2] comps = out[1]...
def fullversion(): ''' Shows installed version of dnsmasq and compile options. CLI Example: .. code-block:: bash salt '*' dnsmasq.fullversion ''' cmd = 'dnsmasq -v' out = __salt__['cmd.run'](cmd).splitlines() comps = out[0].split() version_num = comps[2] comps = out[1]...
[ "Shows", "installed", "version", "of", "dnsmasq", "and", "compile", "options", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsmasq.py#L51-L67
[ "def", "fullversion", "(", ")", ":", "cmd", "=", "'dnsmasq -v'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", ".", "splitlines", "(", ")", "comps", "=", "out", "[", "0", "]", ".", "split", "(", ")", "version_num", "=", "comps", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_config
Sets a value or a set of values in the specified file. By default, if conf-dir is configured in this file, salt will attempt to set the option in any file inside the conf-dir where it has already been enabled. If it does not find it inside any files, it will append it to the main config file. Setting fo...
salt/modules/dnsmasq.py
def set_config(config_file='/etc/dnsmasq.conf', follow=True, **kwargs): ''' Sets a value or a set of values in the specified file. By default, if conf-dir is configured in this file, salt will attempt to set the option in any file inside the conf-dir where it has already been enabled. If it does not...
def set_config(config_file='/etc/dnsmasq.conf', follow=True, **kwargs): ''' Sets a value or a set of values in the specified file. By default, if conf-dir is configured in this file, salt will attempt to set the option in any file inside the conf-dir where it has already been enabled. If it does not...
[ "Sets", "a", "value", "or", "a", "set", "of", "values", "in", "the", "specified", "file", ".", "By", "default", "if", "conf", "-", "dir", "is", "configured", "in", "this", "file", "salt", "will", "attempt", "to", "set", "the", "option", "in", "any", ...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsmasq.py#L70-L131
[ "def", "set_config", "(", "config_file", "=", "'/etc/dnsmasq.conf'", ",", "follow", "=", "True", ",", "*", "*", "kwargs", ")", ":", "dnsopts", "=", "get_config", "(", "config_file", ")", "includes", "=", "[", "config_file", "]", "if", "follow", "is", "True...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_config
Dumps all options from the config file. config_file The location of the config file from which to obtain contents. Defaults to ``/etc/dnsmasq.conf``. CLI Examples: .. code-block:: bash salt '*' dnsmasq.get_config salt '*' dnsmasq.get_config config_file=/etc/dnsmasq.conf
salt/modules/dnsmasq.py
def get_config(config_file='/etc/dnsmasq.conf'): ''' Dumps all options from the config file. config_file The location of the config file from which to obtain contents. Defaults to ``/etc/dnsmasq.conf``. CLI Examples: .. code-block:: bash salt '*' dnsmasq.get_config ...
def get_config(config_file='/etc/dnsmasq.conf'): ''' Dumps all options from the config file. config_file The location of the config file from which to obtain contents. Defaults to ``/etc/dnsmasq.conf``. CLI Examples: .. code-block:: bash salt '*' dnsmasq.get_config ...
[ "Dumps", "all", "options", "from", "the", "config", "file", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsmasq.py#L134-L160
[ "def", "get_config", "(", "config_file", "=", "'/etc/dnsmasq.conf'", ")", ":", "dnsopts", "=", "_parse_dnamasq", "(", "config_file", ")", "if", "'conf-dir'", "in", "dnsopts", ":", "for", "filename", "in", "os", ".", "listdir", "(", "dnsopts", "[", "'conf-dir'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_parse_dnamasq
Generic function for parsing dnsmasq files including includes.
salt/modules/dnsmasq.py
def _parse_dnamasq(filename): ''' Generic function for parsing dnsmasq files including includes. ''' fileopts = {} if not os.path.isfile(filename): raise CommandExecutionError( 'Error: No such file \'{0}\''.format(filename) ) with salt.utils.files.fopen(filename, 'r...
def _parse_dnamasq(filename): ''' Generic function for parsing dnsmasq files including includes. ''' fileopts = {} if not os.path.isfile(filename): raise CommandExecutionError( 'Error: No such file \'{0}\''.format(filename) ) with salt.utils.files.fopen(filename, 'r...
[ "Generic", "function", "for", "parsing", "dnsmasq", "files", "including", "includes", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dnsmasq.py#L163-L194
[ "def", "_parse_dnamasq", "(", "filename", ")", ":", "fileopts", "=", "{", "}", "if", "not", "os", ".", "path", ".", "isfile", "(", "filename", ")", ":", "raise", "CommandExecutionError", "(", "'Error: No such file \\'{0}\\''", ".", "format", "(", "filename", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
output
Read in the dict structure generated by the salt key API methods and print the structure.
salt/output/key.py
def output(data, **kwargs): # pylint: disable=unused-argument ''' Read in the dict structure generated by the salt key API methods and print the structure. ''' color = salt.utils.color.get_colors( __opts__.get('color'), __opts__.get('color_theme')) strip_colors = __opts_...
def output(data, **kwargs): # pylint: disable=unused-argument ''' Read in the dict structure generated by the salt key API methods and print the structure. ''' color = salt.utils.color.get_colors( __opts__.get('color'), __opts__.get('color_theme')) strip_colors = __opts_...
[ "Read", "in", "the", "dict", "structure", "generated", "by", "the", "salt", "key", "API", "methods", "and", "print", "the", "structure", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/output/key.py#L16-L107
[ "def", "output", "(", "data", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=unused-argument", "color", "=", "salt", ".", "utils", ".", "color", ".", "get_colors", "(", "__opts__", ".", "get", "(", "'color'", ")", ",", "__opts__", ".", "get", "(",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_sqs_conn
Get a boto connection to SQS.
salt/engines/sqs_events.py
def _get_sqs_conn(profile, region=None, key=None, keyid=None): ''' Get a boto connection to SQS. ''' if profile: if isinstance(profile, six.string_types): _profile = __opts__[profile] elif isinstance(profile, dict): _profile = profile key = _profile.get('k...
def _get_sqs_conn(profile, region=None, key=None, keyid=None): ''' Get a boto connection to SQS. ''' if profile: if isinstance(profile, six.string_types): _profile = __opts__[profile] elif isinstance(profile, dict): _profile = profile key = _profile.get('k...
[ "Get", "a", "boto", "connection", "to", "SQS", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/sqs_events.py#L105-L131
[ "def", "_get_sqs_conn", "(", "profile", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ")", ":", "if", "profile", ":", "if", "isinstance", "(", "profile", ",", "six", ".", "string_types", ")", ":", "_profile", "=", "_...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
start
Listen to sqs and fire message on event bus
salt/engines/sqs_events.py
def start(queue, profile=None, tag='salt/engine/sqs', owner_acct_id=None): ''' Listen to sqs and fire message on event bus ''' if __opts__.get('__role') == 'master': fire_master = salt.utils.event.get_master_event( __opts__, __opts__['sock_dir'], listen=False)...
def start(queue, profile=None, tag='salt/engine/sqs', owner_acct_id=None): ''' Listen to sqs and fire message on event bus ''' if __opts__.get('__role') == 'master': fire_master = salt.utils.event.get_master_event( __opts__, __opts__['sock_dir'], listen=False)...
[ "Listen", "to", "sqs", "and", "fire", "message", "on", "event", "bus" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/sqs_events.py#L151-L172
[ "def", "start", "(", "queue", ",", "profile", "=", "None", ",", "tag", "=", "'salt/engine/sqs'", ",", "owner_acct_id", "=", "None", ")", ":", "if", "__opts__", ".", "get", "(", "'__role'", ")", "==", "'master'", ":", "fire_master", "=", "salt", ".", "u...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_file
Send a file from the master to the location in specified .. note:: gzip compression is not supported in the salt-ssh version of cp.get_file. The argument is only accepted for interface compatibility.
salt/client/ssh/wrapper/cp.py
def get_file(path, dest, saltenv='base', makedirs=False, template=None, gzip=None): ''' Send a file from the master to the location in specified .. note:: gzip compression is not supported in the salt-ssh version of cp.get_fi...
def get_file(path, dest, saltenv='base', makedirs=False, template=None, gzip=None): ''' Send a file from the master to the location in specified .. note:: gzip compression is not supported in the salt-ssh version of cp.get_fi...
[ "Send", "a", "file", "from", "the", "master", "to", "the", "location", "in", "specified" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/cp.py#L20-L50
[ "def", "get_file", "(", "path", ",", "dest", ",", "saltenv", "=", "'base'", ",", "makedirs", "=", "False", ",", "template", "=", "None", ",", "gzip", "=", "None", ")", ":", "if", "gzip", "is", "not", "None", ":", "log", ".", "warning", "(", "'The g...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_dir
Transfer a directory down
salt/client/ssh/wrapper/cp.py
def get_dir(path, dest, saltenv='base'): ''' Transfer a directory down ''' src = __context__['fileclient'].cache_dir( path, saltenv, cachedir=os.path.join('salt-ssh', __salt__.kwargs['id_'])) src = ' '.join(src) single = salt.client.ssh.Single( __opts__, ...
def get_dir(path, dest, saltenv='base'): ''' Transfer a directory down ''' src = __context__['fileclient'].cache_dir( path, saltenv, cachedir=os.path.join('salt-ssh', __salt__.kwargs['id_'])) src = ' '.join(src) single = salt.client.ssh.Single( __opts__, ...
[ "Transfer", "a", "directory", "down" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/client/ssh/wrapper/cp.py#L53-L67
[ "def", "get_dir", "(", "path", ",", "dest", ",", "saltenv", "=", "'base'", ")", ":", "src", "=", "__context__", "[", "'fileclient'", "]", ".", "cache_dir", "(", "path", ",", "saltenv", ",", "cachedir", "=", "os", ".", "path", ".", "join", "(", "'salt...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
freeze
Freeze python types by turning them into immutable structures.
salt/utils/immutabletypes.py
def freeze(obj): ''' Freeze python types by turning them into immutable structures. ''' if isinstance(obj, dict): return ImmutableDict(obj) if isinstance(obj, list): return ImmutableList(obj) if isinstance(obj, set): return ImmutableSet(obj) return obj
def freeze(obj): ''' Freeze python types by turning them into immutable structures. ''' if isinstance(obj, dict): return ImmutableDict(obj) if isinstance(obj, list): return ImmutableList(obj) if isinstance(obj, set): return ImmutableSet(obj) return obj
[ "Freeze", "python", "types", "by", "turning", "them", "into", "immutable", "structures", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/immutabletypes.py#L105-L115
[ "def", "freeze", "(", "obj", ")", ":", "if", "isinstance", "(", "obj", ",", "dict", ")", ":", "return", "ImmutableDict", "(", "obj", ")", "if", "isinstance", "(", "obj", ",", "list", ")", ":", "return", "ImmutableList", "(", "obj", ")", "if", "isinst...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
display
Display alternatives settings for defined command name CLI Example: .. code-block:: bash salt '*' alternatives.display editor
salt/modules/alternatives.py
def display(name): ''' Display alternatives settings for defined command name CLI Example: .. code-block:: bash salt '*' alternatives.display editor ''' cmd = [_get_cmd(), '--display', name] out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] > 0 and out['...
def display(name): ''' Display alternatives settings for defined command name CLI Example: .. code-block:: bash salt '*' alternatives.display editor ''' cmd = [_get_cmd(), '--display', name] out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] > 0 and out['...
[ "Display", "alternatives", "settings", "for", "defined", "command", "name" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/alternatives.py#L53-L67
[ "def", "display", "(", "name", ")", ":", "cmd", "=", "[", "_get_cmd", "(", ")", ",", "'--display'", ",", "name", "]", "out", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "if", "out", "[", "'retcode'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_link
Display master link for the alternative .. versionadded:: 2015.8.13,2016.3.4,2016.11.0 CLI Example: .. code-block:: bash salt '*' alternatives.show_link editor
salt/modules/alternatives.py
def show_link(name): ''' Display master link for the alternative .. versionadded:: 2015.8.13,2016.3.4,2016.11.0 CLI Example: .. code-block:: bash salt '*' alternatives.show_link editor ''' if __grains__['os_family'] == 'RedHat': path = '/var/lib/' elif __grains__['os...
def show_link(name): ''' Display master link for the alternative .. versionadded:: 2015.8.13,2016.3.4,2016.11.0 CLI Example: .. code-block:: bash salt '*' alternatives.show_link editor ''' if __grains__['os_family'] == 'RedHat': path = '/var/lib/' elif __grains__['os...
[ "Display", "master", "link", "for", "the", "alternative" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/alternatives.py#L70-L104
[ "def", "show_link", "(", "name", ")", ":", "if", "__grains__", "[", "'os_family'", "]", "==", "'RedHat'", ":", "path", "=", "'/var/lib/'", "elif", "__grains__", "[", "'os_family'", "]", "==", "'Suse'", ":", "path", "=", "'/var/lib/rpm/'", "else", ":", "pat...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
check_exists
Check if the given path is an alternative for a name. .. versionadded:: 2015.8.4 CLI Example: .. code-block:: bash salt '*' alternatives.check_exists name path
salt/modules/alternatives.py
def check_exists(name, path): ''' Check if the given path is an alternative for a name. .. versionadded:: 2015.8.4 CLI Example: .. code-block:: bash salt '*' alternatives.check_exists name path ''' cmd = [_get_cmd(), '--display', name] out = __salt__['cmd.run_all'](cmd, pytho...
def check_exists(name, path): ''' Check if the given path is an alternative for a name. .. versionadded:: 2015.8.4 CLI Example: .. code-block:: bash salt '*' alternatives.check_exists name path ''' cmd = [_get_cmd(), '--display', name] out = __salt__['cmd.run_all'](cmd, pytho...
[ "Check", "if", "the", "given", "path", "is", "an", "alternative", "for", "a", "name", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/alternatives.py#L125-L143
[ "def", "check_exists", "(", "name", ",", "path", ")", ":", "cmd", "=", "[", "_get_cmd", "(", ")", ",", "'--display'", ",", "name", "]", "out", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "if", "out"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
install
Install symbolic links determining default commands CLI Example: .. code-block:: bash salt '*' alternatives.install editor /usr/bin/editor /usr/bin/emacs23 50
salt/modules/alternatives.py
def install(name, link, path, priority): ''' Install symbolic links determining default commands CLI Example: .. code-block:: bash salt '*' alternatives.install editor /usr/bin/editor /usr/bin/emacs23 50 ''' cmd = [_get_cmd(), '--install', link, name, path, six.text_type(priority)] ...
def install(name, link, path, priority): ''' Install symbolic links determining default commands CLI Example: .. code-block:: bash salt '*' alternatives.install editor /usr/bin/editor /usr/bin/emacs23 50 ''' cmd = [_get_cmd(), '--install', link, name, path, six.text_type(priority)] ...
[ "Install", "symbolic", "links", "determining", "default", "commands" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/alternatives.py#L163-L177
[ "def", "install", "(", "name", ",", "link", ",", "path", ",", "priority", ")", ":", "cmd", "=", "[", "_get_cmd", "(", ")", ",", "'--install'", ",", "link", ",", "name", ",", "path", ",", "six", ".", "text_type", "(", "priority", ")", "]", "out", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
remove
Remove symbolic links determining the default commands. CLI Example: .. code-block:: bash salt '*' alternatives.remove name path
salt/modules/alternatives.py
def remove(name, path): ''' Remove symbolic links determining the default commands. CLI Example: .. code-block:: bash salt '*' alternatives.remove name path ''' cmd = [_get_cmd(), '--remove', name, path] out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] ...
def remove(name, path): ''' Remove symbolic links determining the default commands. CLI Example: .. code-block:: bash salt '*' alternatives.remove name path ''' cmd = [_get_cmd(), '--remove', name, path] out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] ...
[ "Remove", "symbolic", "links", "determining", "the", "default", "commands", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/alternatives.py#L180-L194
[ "def", "remove", "(", "name", ",", "path", ")", ":", "cmd", "=", "[", "_get_cmd", "(", ")", ",", "'--remove'", ",", "name", ",", "path", "]", "out", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "if...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
auto
Trigger alternatives to set the path for <name> as specified by priority. CLI Example: .. code-block:: bash salt '*' alternatives.auto name
salt/modules/alternatives.py
def auto(name): ''' Trigger alternatives to set the path for <name> as specified by priority. CLI Example: .. code-block:: bash salt '*' alternatives.auto name ''' cmd = [_get_cmd(), '--auto', name] out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] >...
def auto(name): ''' Trigger alternatives to set the path for <name> as specified by priority. CLI Example: .. code-block:: bash salt '*' alternatives.auto name ''' cmd = [_get_cmd(), '--auto', name] out = __salt__['cmd.run_all'](cmd, python_shell=False) if out['retcode'] >...
[ "Trigger", "alternatives", "to", "set", "the", "path", "for", "<name", ">", "as", "specified", "by", "priority", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/alternatives.py#L197-L212
[ "def", "auto", "(", "name", ")", ":", "cmd", "=", "[", "_get_cmd", "(", ")", ",", "'--auto'", ",", "name", "]", "out", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "if", "out", "[", "'retcode'", "]...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_read_link
Read the link from /etc/alternatives Throws an OSError if the link does not exist
salt/modules/alternatives.py
def _read_link(name): ''' Read the link from /etc/alternatives Throws an OSError if the link does not exist ''' alt_link_path = '/etc/alternatives/{0}'.format(name) return salt.utils.path.readlink(alt_link_path)
def _read_link(name): ''' Read the link from /etc/alternatives Throws an OSError if the link does not exist ''' alt_link_path = '/etc/alternatives/{0}'.format(name) return salt.utils.path.readlink(alt_link_path)
[ "Read", "the", "link", "from", "/", "etc", "/", "alternatives" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/alternatives.py#L232-L239
[ "def", "_read_link", "(", "name", ")", ":", "alt_link_path", "=", "'/etc/alternatives/{0}'", ".", "format", "(", "name", ")", "return", "salt", ".", "utils", ".", "path", ".", "readlink", "(", "alt_link_path", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_placement_solver
Returns a placement solver service_instance Service instance to the host or vCenter
salt/utils/pbm.py
def get_placement_solver(service_instance): ''' Returns a placement solver service_instance Service instance to the host or vCenter ''' stub = salt.utils.vmware.get_new_service_instance_stub( service_instance, ns='pbm/2.0', path='/pbm/sdk') pbm_si = pbm.ServiceInstance('ServiceI...
def get_placement_solver(service_instance): ''' Returns a placement solver service_instance Service instance to the host or vCenter ''' stub = salt.utils.vmware.get_new_service_instance_stub( service_instance, ns='pbm/2.0', path='/pbm/sdk') pbm_si = pbm.ServiceInstance('ServiceI...
[ "Returns", "a", "placement", "solver" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L98-L120
[ "def", "get_placement_solver", "(", "service_instance", ")", ":", "stub", "=", "salt", ".", "utils", ".", "vmware", ".", "get_new_service_instance_stub", "(", "service_instance", ",", "ns", "=", "'pbm/2.0'", ",", "path", "=", "'/pbm/sdk'", ")", "pbm_si", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_capability_definitions
Returns a list of all capability definitions. profile_manager Reference to the profile manager.
salt/utils/pbm.py
def get_capability_definitions(profile_manager): ''' Returns a list of all capability definitions. profile_manager Reference to the profile manager. ''' res_type = pbm.profile.ResourceType( resourceType=pbm.profile.ResourceTypeEnum.STORAGE) try: cap_categories = profile_...
def get_capability_definitions(profile_manager): ''' Returns a list of all capability definitions. profile_manager Reference to the profile manager. ''' res_type = pbm.profile.ResourceType( resourceType=pbm.profile.ResourceTypeEnum.STORAGE) try: cap_categories = profile_...
[ "Returns", "a", "list", "of", "all", "capability", "definitions", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L123-L147
[ "def", "get_capability_definitions", "(", "profile_manager", ")", ":", "res_type", "=", "pbm", ".", "profile", ".", "ResourceType", "(", "resourceType", "=", "pbm", ".", "profile", ".", "ResourceTypeEnum", ".", "STORAGE", ")", "try", ":", "cap_categories", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_policies_by_id
Returns a list of policies with the specified ids. profile_manager Reference to the profile manager. policy_ids List of policy ids to retrieve.
salt/utils/pbm.py
def get_policies_by_id(profile_manager, policy_ids): ''' Returns a list of policies with the specified ids. profile_manager Reference to the profile manager. policy_ids List of policy ids to retrieve. ''' try: return profile_manager.RetrieveContent(policy_ids) excep...
def get_policies_by_id(profile_manager, policy_ids): ''' Returns a list of policies with the specified ids. profile_manager Reference to the profile manager. policy_ids List of policy ids to retrieve. ''' try: return profile_manager.RetrieveContent(policy_ids) excep...
[ "Returns", "a", "list", "of", "policies", "with", "the", "specified", "ids", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L150-L171
[ "def", "get_policies_by_id", "(", "profile_manager", ",", "policy_ids", ")", ":", "try", ":", "return", "profile_manager", ".", "RetrieveContent", "(", "policy_ids", ")", "except", "vim", ".", "fault", ".", "NoPermission", "as", "exc", ":", "log", ".", "except...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_storage_policies
Returns a list of the storage policies, filtered by name. profile_manager Reference to the profile manager. policy_names List of policy names to filter by. Default is None. get_all_policies Flag specifying to return all policies, regardless of the specified filter.
salt/utils/pbm.py
def get_storage_policies(profile_manager, policy_names=None, get_all_policies=False): ''' Returns a list of the storage policies, filtered by name. profile_manager Reference to the profile manager. policy_names List of policy names to filter by. Default...
def get_storage_policies(profile_manager, policy_names=None, get_all_policies=False): ''' Returns a list of the storage policies, filtered by name. profile_manager Reference to the profile manager. policy_names List of policy names to filter by. Default...
[ "Returns", "a", "list", "of", "the", "storage", "policies", "filtered", "by", "name", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L174-L213
[ "def", "get_storage_policies", "(", "profile_manager", ",", "policy_names", "=", "None", ",", "get_all_policies", "=", "False", ")", ":", "res_type", "=", "pbm", ".", "profile", ".", "ResourceType", "(", "resourceType", "=", "pbm", ".", "profile", ".", "Resour...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_storage_policy
Creates a storage policy. profile_manager Reference to the profile manager. policy_spec Policy update spec.
salt/utils/pbm.py
def create_storage_policy(profile_manager, policy_spec): ''' Creates a storage policy. profile_manager Reference to the profile manager. policy_spec Policy update spec. ''' try: profile_manager.Create(policy_spec) except vim.fault.NoPermission as exc: log.ex...
def create_storage_policy(profile_manager, policy_spec): ''' Creates a storage policy. profile_manager Reference to the profile manager. policy_spec Policy update spec. ''' try: profile_manager.Create(policy_spec) except vim.fault.NoPermission as exc: log.ex...
[ "Creates", "a", "storage", "policy", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L216-L237
[ "def", "create_storage_policy", "(", "profile_manager", ",", "policy_spec", ")", ":", "try", ":", "profile_manager", ".", "Create", "(", "policy_spec", ")", "except", "vim", ".", "fault", ".", "NoPermission", "as", "exc", ":", "log", ".", "exception", "(", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
update_storage_policy
Updates a storage policy. profile_manager Reference to the profile manager. policy Reference to the policy to be updated. policy_spec Policy update spec.
salt/utils/pbm.py
def update_storage_policy(profile_manager, policy, policy_spec): ''' Updates a storage policy. profile_manager Reference to the profile manager. policy Reference to the policy to be updated. policy_spec Policy update spec. ''' try: profile_manager.Update(po...
def update_storage_policy(profile_manager, policy, policy_spec): ''' Updates a storage policy. profile_manager Reference to the profile manager. policy Reference to the policy to be updated. policy_spec Policy update spec. ''' try: profile_manager.Update(po...
[ "Updates", "a", "storage", "policy", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L240-L264
[ "def", "update_storage_policy", "(", "profile_manager", ",", "policy", ",", "policy_spec", ")", ":", "try", ":", "profile_manager", ".", "Update", "(", "policy", ".", "profileId", ",", "policy_spec", ")", "except", "vim", ".", "fault", ".", "NoPermission", "as...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_default_storage_policy_of_datastore
Returns the default storage policy reference assigned to a datastore. profile_manager Reference to the profile manager. datastore Reference to the datastore.
salt/utils/pbm.py
def get_default_storage_policy_of_datastore(profile_manager, datastore): ''' Returns the default storage policy reference assigned to a datastore. profile_manager Reference to the profile manager. datastore Reference to the datastore. ''' # Retrieve all datastores visible h...
def get_default_storage_policy_of_datastore(profile_manager, datastore): ''' Returns the default storage policy reference assigned to a datastore. profile_manager Reference to the profile manager. datastore Reference to the datastore. ''' # Retrieve all datastores visible h...
[ "Returns", "the", "default", "storage", "policy", "reference", "assigned", "to", "a", "datastore", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L267-L297
[ "def", "get_default_storage_policy_of_datastore", "(", "profile_manager", ",", "datastore", ")", ":", "# Retrieve all datastores visible", "hub", "=", "pbm", ".", "placement", ".", "PlacementHub", "(", "hubId", "=", "datastore", ".", "_moId", ",", "hubType", "=", "'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
assign_default_storage_policy_to_datastore
Assigns a storage policy as the default policy to a datastore. profile_manager Reference to the profile manager. policy Reference to the policy to assigned. datastore Reference to the datastore.
salt/utils/pbm.py
def assign_default_storage_policy_to_datastore(profile_manager, policy, datastore): ''' Assigns a storage policy as the default policy to a datastore. profile_manager Reference to the profile manager. policy Reference to the policy to assi...
def assign_default_storage_policy_to_datastore(profile_manager, policy, datastore): ''' Assigns a storage policy as the default policy to a datastore. profile_manager Reference to the profile manager. policy Reference to the policy to assi...
[ "Assigns", "a", "storage", "policy", "as", "the", "default", "policy", "to", "a", "datastore", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pbm.py#L300-L329
[ "def", "assign_default_storage_policy_to_datastore", "(", "profile_manager", ",", "policy", ",", "datastore", ")", ":", "placement_hub", "=", "pbm", ".", "placement", ".", "PlacementHub", "(", "hubId", "=", "datastore", ".", "_moId", ",", "hubType", "=", "'Datasto...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
set_
Set a value into the Redis SDB.
salt/sdb/redis_sdb.py
def set_(key, value, profile=None): ''' Set a value into the Redis SDB. ''' if not profile: return False redis_kwargs = profile.copy() redis_kwargs.pop('driver') redis_conn = redis.StrictRedis(**redis_kwargs) return redis_conn.set(key, value)
def set_(key, value, profile=None): ''' Set a value into the Redis SDB. ''' if not profile: return False redis_kwargs = profile.copy() redis_kwargs.pop('driver') redis_conn = redis.StrictRedis(**redis_kwargs) return redis_conn.set(key, value)
[ "Set", "a", "value", "into", "the", "Redis", "SDB", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/sdb/redis_sdb.py#L51-L60
[ "def", "set_", "(", "key", ",", "value", ",", "profile", "=", "None", ")", ":", "if", "not", "profile", ":", "return", "False", "redis_kwargs", "=", "profile", ".", "copy", "(", ")", "redis_kwargs", ".", "pop", "(", "'driver'", ")", "redis_conn", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get
Get a value from the Redis SDB.
salt/sdb/redis_sdb.py
def get(key, profile=None): ''' Get a value from the Redis SDB. ''' if not profile: return False redis_kwargs = profile.copy() redis_kwargs.pop('driver') redis_conn = redis.StrictRedis(**redis_kwargs) return redis_conn.get(key)
def get(key, profile=None): ''' Get a value from the Redis SDB. ''' if not profile: return False redis_kwargs = profile.copy() redis_kwargs.pop('driver') redis_conn = redis.StrictRedis(**redis_kwargs) return redis_conn.get(key)
[ "Get", "a", "value", "from", "the", "Redis", "SDB", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/sdb/redis_sdb.py#L63-L72
[ "def", "get", "(", "key", ",", "profile", "=", "None", ")", ":", "if", "not", "profile", ":", "return", "False", "redis_kwargs", "=", "profile", ".", "copy", "(", ")", "redis_kwargs", ".", "pop", "(", "'driver'", ")", "redis_conn", "=", "redis", ".", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
balancer_present
Ensures a load balancer is present. :param name: Load Balancer name :type name: ``str`` :param port: Port the load balancer should listen on, defaults to 80 :type port: ``str`` :param protocol: Loadbalancer protocol, defaults to http. :type protocol: ``str`` :param profile: The profil...
salt/states/libcloud_loadbalancer.py
def balancer_present(name, port, protocol, profile, algorithm=None, members=None, **libcloud_kwargs): ''' Ensures a load balancer is present. :param name: Load Balancer name :type name: ``str`` :param port: Port the load balancer should listen on, defaults to 80 :type port: ``str`` :par...
def balancer_present(name, port, protocol, profile, algorithm=None, members=None, **libcloud_kwargs): ''' Ensures a load balancer is present. :param name: Load Balancer name :type name: ``str`` :param port: Port the load balancer should listen on, defaults to 80 :type port: ``str`` :par...
[ "Ensures", "a", "load", "balancer", "is", "present", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/libcloud_loadbalancer.py#L76-L114
[ "def", "balancer_present", "(", "name", ",", "port", ",", "protocol", ",", "profile", ",", "algorithm", "=", "None", ",", "members", "=", "None", ",", "*", "*", "libcloud_kwargs", ")", ":", "balancers", "=", "__salt__", "[", "'libcloud_loadbalancer.list_balanc...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
balancer_absent
Ensures a load balancer is absent. :param name: Load Balancer name :type name: ``str`` :param profile: The profile key :type profile: ``str``
salt/states/libcloud_loadbalancer.py
def balancer_absent(name, profile, **libcloud_kwargs): ''' Ensures a load balancer is absent. :param name: Load Balancer name :type name: ``str`` :param profile: The profile key :type profile: ``str`` ''' balancers = __salt__['libcloud_loadbalancer.list_balancers'](profile) match...
def balancer_absent(name, profile, **libcloud_kwargs): ''' Ensures a load balancer is absent. :param name: Load Balancer name :type name: ``str`` :param profile: The profile key :type profile: ``str`` ''' balancers = __salt__['libcloud_loadbalancer.list_balancers'](profile) match...
[ "Ensures", "a", "load", "balancer", "is", "absent", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/libcloud_loadbalancer.py#L117-L133
[ "def", "balancer_absent", "(", "name", ",", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "balancers", "=", "__salt__", "[", "'libcloud_loadbalancer.list_balancers'", "]", "(", "profile", ")", "match", "=", "[", "z", "for", "z", "in", "balancers", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
member_present
Ensure a load balancer member is present :param ip: IP address for the new member :type ip: ``str`` :param port: Port for the new member :type port: ``int`` :param balancer_id: id of a load balancer you want to attach the member to :type balancer_id: ``str`` :param profile: The profil...
salt/states/libcloud_loadbalancer.py
def member_present(ip, port, balancer_id, profile, **libcloud_kwargs): ''' Ensure a load balancer member is present :param ip: IP address for the new member :type ip: ``str`` :param port: Port for the new member :type port: ``int`` :param balancer_id: id of a load balancer you want to a...
def member_present(ip, port, balancer_id, profile, **libcloud_kwargs): ''' Ensure a load balancer member is present :param ip: IP address for the new member :type ip: ``str`` :param port: Port for the new member :type port: ``int`` :param balancer_id: id of a load balancer you want to a...
[ "Ensure", "a", "load", "balancer", "member", "is", "present" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/libcloud_loadbalancer.py#L136-L157
[ "def", "member_present", "(", "ip", ",", "port", ",", "balancer_id", ",", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "existing_members", "=", "__salt__", "[", "'libcloud_loadbalancer.list_balancer_members'", "]", "(", "balancer_id", ",", "profile", ")"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
member_absent
Ensure a load balancer member is absent, based on IP and Port :param ip: IP address for the member :type ip: ``str`` :param port: Port for the member :type port: ``int`` :param balancer_id: id of a load balancer you want to detach the member from :type balancer_id: ``str`` :param prof...
salt/states/libcloud_loadbalancer.py
def member_absent(ip, port, balancer_id, profile, **libcloud_kwargs): ''' Ensure a load balancer member is absent, based on IP and Port :param ip: IP address for the member :type ip: ``str`` :param port: Port for the member :type port: ``int`` :param balancer_id: id of a load balancer y...
def member_absent(ip, port, balancer_id, profile, **libcloud_kwargs): ''' Ensure a load balancer member is absent, based on IP and Port :param ip: IP address for the member :type ip: ``str`` :param port: Port for the member :type port: ``int`` :param balancer_id: id of a load balancer y...
[ "Ensure", "a", "load", "balancer", "member", "is", "absent", "based", "on", "IP", "and", "Port" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/libcloud_loadbalancer.py#L160-L181
[ "def", "member_absent", "(", "ip", ",", "port", ",", "balancer_id", ",", "profile", ",", "*", "*", "libcloud_kwargs", ")", ":", "existing_members", "=", "__salt__", "[", "'libcloud_loadbalancer.list_balancer_members'", "]", "(", "balancer_id", ",", "profile", ")",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_parser
parses the output into a dictionary
salt/modules/sysbench.py
def _parser(result): ''' parses the output into a dictionary ''' # regexes to match _total_time = re.compile(r'total time:\s*(\d*.\d*s)') _total_execution = re.compile(r'event execution:\s*(\d*.\d*s?)') _min_response_time = re.compile(r'min:\s*(\d*.\d*ms)') _max_response_time = re.compi...
def _parser(result): ''' parses the output into a dictionary ''' # regexes to match _total_time = re.compile(r'total time:\s*(\d*.\d*s)') _total_execution = re.compile(r'event execution:\s*(\d*.\d*s?)') _min_response_time = re.compile(r'min:\s*(\d*.\d*ms)') _max_response_time = re.compi...
[ "parses", "the", "output", "into", "a", "dictionary" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysbench.py#L25-L56
[ "def", "_parser", "(", "result", ")", ":", "# regexes to match", "_total_time", "=", "re", ".", "compile", "(", "r'total time:\\s*(\\d*.\\d*s)'", ")", "_total_execution", "=", "re", ".", "compile", "(", "r'event execution:\\s*(\\d*.\\d*s?)'", ")", "_min_response_time", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
cpu
Tests for the CPU performance of minions. CLI Examples: .. code-block:: bash salt '*' sysbench.cpu
salt/modules/sysbench.py
def cpu(): ''' Tests for the CPU performance of minions. CLI Examples: .. code-block:: bash salt '*' sysbench.cpu ''' # Test data max_primes = [500, 1000, 2500, 5000] # Initializing the test variables test_command = 'sysbench --test=cpu --cpu-max-prime={0} run' resul...
def cpu(): ''' Tests for the CPU performance of minions. CLI Examples: .. code-block:: bash salt '*' sysbench.cpu ''' # Test data max_primes = [500, 1000, 2500, 5000] # Initializing the test variables test_command = 'sysbench --test=cpu --cpu-max-prime={0} run' resul...
[ "Tests", "for", "the", "CPU", "performance", "of", "minions", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysbench.py#L59-L85
[ "def", "cpu", "(", ")", ":", "# Test data", "max_primes", "=", "[", "500", ",", "1000", ",", "2500", ",", "5000", "]", "# Initializing the test variables", "test_command", "=", "'sysbench --test=cpu --cpu-max-prime={0} run'", "result", "=", "None", "ret_val", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
threads
This tests the performance of the processor's scheduler CLI Example: .. code-block:: bash salt '*' sysbench.threads
salt/modules/sysbench.py
def threads(): ''' This tests the performance of the processor's scheduler CLI Example: .. code-block:: bash salt '*' sysbench.threads ''' # Test data thread_yields = [100, 200, 500, 1000] thread_locks = [2, 4, 8, 16] # Initializing the test variables test_command = ...
def threads(): ''' This tests the performance of the processor's scheduler CLI Example: .. code-block:: bash salt '*' sysbench.threads ''' # Test data thread_yields = [100, 200, 500, 1000] thread_locks = [2, 4, 8, 16] # Initializing the test variables test_command = ...
[ "This", "tests", "the", "performance", "of", "the", "processor", "s", "scheduler" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysbench.py#L88-L116
[ "def", "threads", "(", ")", ":", "# Test data", "thread_yields", "=", "[", "100", ",", "200", ",", "500", ",", "1000", "]", "thread_locks", "=", "[", "2", ",", "4", ",", "8", ",", "16", "]", "# Initializing the test variables", "test_command", "=", "'sys...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
mutex
Tests the implementation of mutex CLI Examples: .. code-block:: bash salt '*' sysbench.mutex
salt/modules/sysbench.py
def mutex(): ''' Tests the implementation of mutex CLI Examples: .. code-block:: bash salt '*' sysbench.mutex ''' # Test options and the values they take # --mutex-num = [50,500,1000] # --mutex-locks = [10000,25000,50000] # --mutex-loops = [2500,5000,10000] # Test da...
def mutex(): ''' Tests the implementation of mutex CLI Examples: .. code-block:: bash salt '*' sysbench.mutex ''' # Test options and the values they take # --mutex-num = [50,500,1000] # --mutex-locks = [10000,25000,50000] # --mutex-loops = [2500,5000,10000] # Test da...
[ "Tests", "the", "implementation", "of", "mutex" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysbench.py#L119-L155
[ "def", "mutex", "(", ")", ":", "# Test options and the values they take", "# --mutex-num = [50,500,1000]", "# --mutex-locks = [10000,25000,50000]", "# --mutex-loops = [2500,5000,10000]", "# Test data (Orthogonal test cases)", "mutex_num", "=", "[", "50", ",", "50", ",", "50", ","...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
memory
This tests the memory for read and write operations. CLI Examples: .. code-block:: bash salt '*' sysbench.memory
salt/modules/sysbench.py
def memory(): ''' This tests the memory for read and write operations. CLI Examples: .. code-block:: bash salt '*' sysbench.memory ''' # test defaults # --memory-block-size = 10M # --memory-total-size = 1G # We test memory read / write against global / local scope of mem...
def memory(): ''' This tests the memory for read and write operations. CLI Examples: .. code-block:: bash salt '*' sysbench.memory ''' # test defaults # --memory-block-size = 10M # --memory-total-size = 1G # We test memory read / write against global / local scope of mem...
[ "This", "tests", "the", "memory", "for", "read", "and", "write", "operations", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysbench.py#L158-L193
[ "def", "memory", "(", ")", ":", "# test defaults", "# --memory-block-size = 10M", "# --memory-total-size = 1G", "# We test memory read / write against global / local scope of memory", "# Test data", "memory_oper", "=", "[", "'read'", ",", "'write'", "]", "memory_scope", "=", "[...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
fileio
This tests for the file read and write operations Various modes of operations are * sequential write * sequential rewrite * sequential read * random read * random write * random read and write The test works with 32 files with each file being 1Gb in size The test consumes a lot of ...
salt/modules/sysbench.py
def fileio(): ''' This tests for the file read and write operations Various modes of operations are * sequential write * sequential rewrite * sequential read * random read * random write * random read and write The test works with 32 files with each file being 1Gb in size T...
def fileio(): ''' This tests for the file read and write operations Various modes of operations are * sequential write * sequential rewrite * sequential read * random read * random write * random read and write The test works with 32 files with each file being 1Gb in size T...
[ "This", "tests", "for", "the", "file", "read", "and", "write", "operations", "Various", "modes", "of", "operations", "are" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/sysbench.py#L196-L244
[ "def", "fileio", "(", ")", ":", "# Test data", "test_modes", "=", "[", "'seqwr'", ",", "'seqrewr'", ",", "'seqrd'", ",", "'rndrd'", ",", "'rndwr'", ",", "'rndrw'", "]", "# Initializing the required variables", "test_command", "=", "'sysbench --num-threads=16 --test=fi...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
version
Return LVM version from lvm version CLI Example: .. code-block:: bash salt '*' lvm.version
salt/modules/linux_lvm.py
def version(): ''' Return LVM version from lvm version CLI Example: .. code-block:: bash salt '*' lvm.version ''' cmd = 'lvm version' out = __salt__['cmd.run'](cmd).splitlines() ret = out[0].split(': ') return ret[1].strip()
def version(): ''' Return LVM version from lvm version CLI Example: .. code-block:: bash salt '*' lvm.version ''' cmd = 'lvm version' out = __salt__['cmd.run'](cmd).splitlines() ret = out[0].split(': ') return ret[1].strip()
[ "Return", "LVM", "version", "from", "lvm", "version" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L32-L45
[ "def", "version", "(", ")", ":", "cmd", "=", "'lvm version'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", ".", "splitlines", "(", ")", "ret", "=", "out", "[", "0", "]", ".", "split", "(", "': '", ")", "return", "ret", "[", "1"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
fullversion
Return all version info from lvm version CLI Example: .. code-block:: bash salt '*' lvm.fullversion
salt/modules/linux_lvm.py
def fullversion(): ''' Return all version info from lvm version CLI Example: .. code-block:: bash salt '*' lvm.fullversion ''' ret = {} cmd = 'lvm version' out = __salt__['cmd.run'](cmd).splitlines() for line in out: comps = line.split(':') ret[comps[0].str...
def fullversion(): ''' Return all version info from lvm version CLI Example: .. code-block:: bash salt '*' lvm.fullversion ''' ret = {} cmd = 'lvm version' out = __salt__['cmd.run'](cmd).splitlines() for line in out: comps = line.split(':') ret[comps[0].str...
[ "Return", "all", "version", "info", "from", "lvm", "version" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L48-L64
[ "def", "fullversion", "(", ")", ":", "ret", "=", "{", "}", "cmd", "=", "'lvm version'", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ")", ".", "splitlines", "(", ")", "for", "line", "in", "out", ":", "comps", "=", "line", ".", "split"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
pvdisplay
Return information about the physical volume(s) pvname physical device name real dereference any symlinks and report the real device .. versionadded:: 2015.8.7 quiet if the physical volume is not present, do not show any error CLI Examples: .. code-block:: bash...
salt/modules/linux_lvm.py
def pvdisplay(pvname='', real=False, quiet=False): ''' Return information about the physical volume(s) pvname physical device name real dereference any symlinks and report the real device .. versionadded:: 2015.8.7 quiet if the physical volume is not present, do n...
def pvdisplay(pvname='', real=False, quiet=False): ''' Return information about the physical volume(s) pvname physical device name real dereference any symlinks and report the real device .. versionadded:: 2015.8.7 quiet if the physical volume is not present, do n...
[ "Return", "information", "about", "the", "physical", "volume", "(", "s", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L67-L123
[ "def", "pvdisplay", "(", "pvname", "=", "''", ",", "real", "=", "False", ",", "quiet", "=", "False", ")", ":", "ret", "=", "{", "}", "cmd", "=", "[", "'pvdisplay'", ",", "'-c'", "]", "if", "pvname", ":", "cmd", ".", "append", "(", "pvname", ")", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vgdisplay
Return information about the volume group(s) vgname volume group name quiet if the volume group is not present, do not show any error CLI Examples: .. code-block:: bash salt '*' lvm.vgdisplay salt '*' lvm.vgdisplay nova-volumes
salt/modules/linux_lvm.py
def vgdisplay(vgname='', quiet=False): ''' Return information about the volume group(s) vgname volume group name quiet if the volume group is not present, do not show any error CLI Examples: .. code-block:: bash salt '*' lvm.vgdisplay salt '*' lvm.vgdisplay n...
def vgdisplay(vgname='', quiet=False): ''' Return information about the volume group(s) vgname volume group name quiet if the volume group is not present, do not show any error CLI Examples: .. code-block:: bash salt '*' lvm.vgdisplay salt '*' lvm.vgdisplay n...
[ "Return", "information", "about", "the", "volume", "group", "(", "s", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L126-L175
[ "def", "vgdisplay", "(", "vgname", "=", "''", ",", "quiet", "=", "False", ")", ":", "ret", "=", "{", "}", "cmd", "=", "[", "'vgdisplay'", ",", "'-c'", "]", "if", "vgname", ":", "cmd", ".", "append", "(", "vgname", ")", "cmd_ret", "=", "__salt__", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
lvdisplay
Return information about the logical volume(s) lvname logical device name quiet if the logical volume is not present, do not show any error CLI Examples: .. code-block:: bash salt '*' lvm.lvdisplay salt '*' lvm.lvdisplay /dev/vg_myserver/root
salt/modules/linux_lvm.py
def lvdisplay(lvname='', quiet=False): ''' Return information about the logical volume(s) lvname logical device name quiet if the logical volume is not present, do not show any error CLI Examples: .. code-block:: bash salt '*' lvm.lvdisplay salt '*' lvm.lvdis...
def lvdisplay(lvname='', quiet=False): ''' Return information about the logical volume(s) lvname logical device name quiet if the logical volume is not present, do not show any error CLI Examples: .. code-block:: bash salt '*' lvm.lvdisplay salt '*' lvm.lvdis...
[ "Return", "information", "about", "the", "logical", "volume", "(", "s", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L178-L223
[ "def", "lvdisplay", "(", "lvname", "=", "''", ",", "quiet", "=", "False", ")", ":", "ret", "=", "{", "}", "cmd", "=", "[", "'lvdisplay'", ",", "'-c'", "]", "if", "lvname", ":", "cmd", ".", "append", "(", "lvname", ")", "cmd_ret", "=", "__salt__", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
pvcreate
Set a physical device to be used as an LVM physical volume override Skip devices, if they are already LVM physical volumes CLI Examples: .. code-block:: bash salt mymachine lvm.pvcreate /dev/sdb1,/dev/sdb2 salt mymachine lvm.pvcreate /dev/sdb1 dataalignmentoffset=7s
salt/modules/linux_lvm.py
def pvcreate(devices, override=True, **kwargs): ''' Set a physical device to be used as an LVM physical volume override Skip devices, if they are already LVM physical volumes CLI Examples: .. code-block:: bash salt mymachine lvm.pvcreate /dev/sdb1,/dev/sdb2 salt mymachine...
def pvcreate(devices, override=True, **kwargs): ''' Set a physical device to be used as an LVM physical volume override Skip devices, if they are already LVM physical volumes CLI Examples: .. code-block:: bash salt mymachine lvm.pvcreate /dev/sdb1,/dev/sdb2 salt mymachine...
[ "Set", "a", "physical", "device", "to", "be", "used", "as", "an", "LVM", "physical", "volume" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L226-L278
[ "def", "pvcreate", "(", "devices", ",", "override", "=", "True", ",", "*", "*", "kwargs", ")", ":", "if", "not", "devices", ":", "return", "'Error: at least one device is required'", "if", "isinstance", "(", "devices", ",", "six", ".", "string_types", ")", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
pvremove
Remove a physical device being used as an LVM physical volume override Skip devices, if they are already not used as LVM physical volumes CLI Examples: .. code-block:: bash salt mymachine lvm.pvremove /dev/sdb1,/dev/sdb2
salt/modules/linux_lvm.py
def pvremove(devices, override=True): ''' Remove a physical device being used as an LVM physical volume override Skip devices, if they are already not used as LVM physical volumes CLI Examples: .. code-block:: bash salt mymachine lvm.pvremove /dev/sdb1,/dev/sdb2 ''' if is...
def pvremove(devices, override=True): ''' Remove a physical device being used as an LVM physical volume override Skip devices, if they are already not used as LVM physical volumes CLI Examples: .. code-block:: bash salt mymachine lvm.pvremove /dev/sdb1,/dev/sdb2 ''' if is...
[ "Remove", "a", "physical", "device", "being", "used", "as", "an", "LVM", "physical", "volume" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L281-L317
[ "def", "pvremove", "(", "devices", ",", "override", "=", "True", ")", ":", "if", "isinstance", "(", "devices", ",", "six", ".", "string_types", ")", ":", "devices", "=", "devices", ".", "split", "(", "','", ")", "cmd", "=", "[", "'pvremove'", ",", "'...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vgcreate
Create an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgcreate my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgcreate my_vg /dev/sdb1 clustered=y
salt/modules/linux_lvm.py
def vgcreate(vgname, devices, **kwargs): ''' Create an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgcreate my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgcreate my_vg /dev/sdb1 clustered=y ''' if not vgname or not devices: return 'Error: vgn...
def vgcreate(vgname, devices, **kwargs): ''' Create an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgcreate my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgcreate my_vg /dev/sdb1 clustered=y ''' if not vgname or not devices: return 'Error: vgn...
[ "Create", "an", "LVM", "volume", "group" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L320-L348
[ "def", "vgcreate", "(", "vgname", ",", "devices", ",", "*", "*", "kwargs", ")", ":", "if", "not", "vgname", "or", "not", "devices", ":", "return", "'Error: vgname and device(s) are both required'", "if", "isinstance", "(", "devices", ",", "six", ".", "string_t...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vgextend
Add physical volumes to an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgextend my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgextend my_vg /dev/sdb1
salt/modules/linux_lvm.py
def vgextend(vgname, devices): ''' Add physical volumes to an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgextend my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgextend my_vg /dev/sdb1 ''' if not vgname or not devices: return 'Error: vgname a...
def vgextend(vgname, devices): ''' Add physical volumes to an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgextend my_vg /dev/sdb1,/dev/sdb2 salt mymachine lvm.vgextend my_vg /dev/sdb1 ''' if not vgname or not devices: return 'Error: vgname a...
[ "Add", "physical", "volumes", "to", "an", "LVM", "volume", "group" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L351-L372
[ "def", "vgextend", "(", "vgname", ",", "devices", ")", ":", "if", "not", "vgname", "or", "not", "devices", ":", "return", "'Error: vgname and device(s) are both required'", "if", "isinstance", "(", "devices", ",", "six", ".", "string_types", ")", ":", "devices",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
lvcreate
Create a new logical volume, with option for which physical volume to be used CLI Examples: .. code-block:: bash salt '*' lvm.lvcreate new_volume_name vg_name size=10G salt '*' lvm.lvcreate new_volume_name vg_name extents=100 pv=/dev/sdb salt '*' lvm.lvcreate new_snapshot ...
salt/modules/linux_lvm.py
def lvcreate(lvname, vgname, size=None, extents=None, snapshot=None, pv=None, thinvolume=False, thinpool=False, force=False, **kwargs): ''' Create a new logical volume, with option for which phys...
def lvcreate(lvname, vgname, size=None, extents=None, snapshot=None, pv=None, thinvolume=False, thinpool=False, force=False, **kwargs): ''' Create a new logical volume, with option for which phys...
[ "Create", "a", "new", "logical", "volume", "with", "option", "for", "which", "physical", "volume", "to", "be", "used" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L375-L465
[ "def", "lvcreate", "(", "lvname", ",", "vgname", ",", "size", "=", "None", ",", "extents", "=", "None", ",", "snapshot", "=", "None", ",", "pv", "=", "None", ",", "thinvolume", "=", "False", ",", "thinpool", "=", "False", ",", "force", "=", "False", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
vgremove
Remove an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgremove vgname salt mymachine lvm.vgremove vgname force=True
salt/modules/linux_lvm.py
def vgremove(vgname): ''' Remove an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgremove vgname salt mymachine lvm.vgremove vgname force=True ''' cmd = ['vgremove', '-f', vgname] out = __salt__['cmd.run'](cmd, python_shell=False) return out.s...
def vgremove(vgname): ''' Remove an LVM volume group CLI Examples: .. code-block:: bash salt mymachine lvm.vgremove vgname salt mymachine lvm.vgremove vgname force=True ''' cmd = ['vgremove', '-f', vgname] out = __salt__['cmd.run'](cmd, python_shell=False) return out.s...
[ "Remove", "an", "LVM", "volume", "group" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L468-L481
[ "def", "vgremove", "(", "vgname", ")", ":", "cmd", "=", "[", "'vgremove'", ",", "'-f'", ",", "vgname", "]", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "return", "out", ".", "strip", "(", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
lvremove
Remove a given existing logical volume from a named existing volume group CLI Example: .. code-block:: bash salt '*' lvm.lvremove lvname vgname force=True
salt/modules/linux_lvm.py
def lvremove(lvname, vgname): ''' Remove a given existing logical volume from a named existing volume group CLI Example: .. code-block:: bash salt '*' lvm.lvremove lvname vgname force=True ''' cmd = ['lvremove', '-f', '{0}/{1}'.format(vgname, lvname)] out = __salt__['cmd.run'](cmd...
def lvremove(lvname, vgname): ''' Remove a given existing logical volume from a named existing volume group CLI Example: .. code-block:: bash salt '*' lvm.lvremove lvname vgname force=True ''' cmd = ['lvremove', '-f', '{0}/{1}'.format(vgname, lvname)] out = __salt__['cmd.run'](cmd...
[ "Remove", "a", "given", "existing", "logical", "volume", "from", "a", "named", "existing", "volume", "group" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L484-L496
[ "def", "lvremove", "(", "lvname", ",", "vgname", ")", ":", "cmd", "=", "[", "'lvremove'", ",", "'-f'", ",", "'{0}/{1}'", ".", "format", "(", "vgname", ",", "lvname", ")", "]", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "cmd", ",", "python_sh...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
lvresize
Return information about the logical volume(s) CLI Examples: .. code-block:: bash salt '*' lvm.lvresize +12M /dev/mapper/vg1-test salt '*' lvm.lvresize lvpath=/dev/mapper/vg1-test extents=+100%FREE
salt/modules/linux_lvm.py
def lvresize(size=None, lvpath=None, extents=None): ''' Return information about the logical volume(s) CLI Examples: .. code-block:: bash salt '*' lvm.lvresize +12M /dev/mapper/vg1-test salt '*' lvm.lvresize lvpath=/dev/mapper/vg1-test extents=+100%FREE ''' if size and exten...
def lvresize(size=None, lvpath=None, extents=None): ''' Return information about the logical volume(s) CLI Examples: .. code-block:: bash salt '*' lvm.lvresize +12M /dev/mapper/vg1-test salt '*' lvm.lvresize lvpath=/dev/mapper/vg1-test extents=+100%FREE ''' if size and exten...
[ "Return", "information", "about", "the", "logical", "volume", "(", "s", ")" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_lvm.py#L499-L528
[ "def", "lvresize", "(", "size", "=", "None", ",", "lvpath", "=", "None", ",", "extents", "=", "None", ")", ":", "if", "size", "and", "extents", ":", "log", ".", "error", "(", "'Error: Please specify only one of size or extents'", ")", "return", "{", "}", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
resource_groups_list
.. versionadded:: 2019.2.0 List all resource groups within a subscription. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_groups_list
salt/modules/azurearm_resource.py
def resource_groups_list(**kwargs): ''' .. versionadded:: 2019.2.0 List all resource groups within a subscription. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_groups_list ''' result = {} resconn = __utils__['azurearm.get_client']('resource', **kwar...
def resource_groups_list(**kwargs): ''' .. versionadded:: 2019.2.0 List all resource groups within a subscription. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_groups_list ''' result = {} resconn = __utils__['azurearm.get_client']('resource', **kwar...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L81-L105
[ "def", "resource_groups_list", "(", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "groups", "=", "__utils__", "[", "'azu...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
resource_group_check_existence
.. versionadded:: 2019.2.0 Check for the existence of a named resource group in the current subscription. :param name: The resource group name to check. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_group_check_existence testgroup
salt/modules/azurearm_resource.py
def resource_group_check_existence(name, **kwargs): ''' .. versionadded:: 2019.2.0 Check for the existence of a named resource group in the current subscription. :param name: The resource group name to check. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_gro...
def resource_group_check_existence(name, **kwargs): ''' .. versionadded:: 2019.2.0 Check for the existence of a named resource group in the current subscription. :param name: The resource group name to check. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_gro...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L108-L131
[ "def", "resource_group_check_existence", "(", "name", ",", "*", "*", "kwargs", ")", ":", "result", "=", "False", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "result", "=", "re...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
resource_group_get
.. versionadded:: 2019.2.0 Get a dictionary representing a resource group's properties. :param name: The resource group name to get. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_group_get testgroup
salt/modules/azurearm_resource.py
def resource_group_get(name, **kwargs): ''' .. versionadded:: 2019.2.0 Get a dictionary representing a resource group's properties. :param name: The resource group name to get. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_group_get testgroup ''' re...
def resource_group_get(name, **kwargs): ''' .. versionadded:: 2019.2.0 Get a dictionary representing a resource group's properties. :param name: The resource group name to get. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_group_get testgroup ''' re...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L134-L159
[ "def", "resource_group_get", "(", "name", ",", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "group", "=", "resconn", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
resource_group_create_or_update
.. versionadded:: 2019.2.0 Create or update a resource group in a given location. :param name: The name of the resource group to create or update. :param location: The location of the resource group. This value is not able to be updated once the resource group is created. CLI Example: ....
salt/modules/azurearm_resource.py
def resource_group_create_or_update(name, location, **kwargs): # pylint: disable=invalid-name ''' .. versionadded:: 2019.2.0 Create or update a resource group in a given location. :param name: The name of the resource group to create or update. :param location: The location of the resource group...
def resource_group_create_or_update(name, location, **kwargs): # pylint: disable=invalid-name ''' .. versionadded:: 2019.2.0 Create or update a resource group in a given location. :param name: The name of the resource group to create or update. :param location: The location of the resource group...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L162-L194
[ "def", "resource_group_create_or_update", "(", "name", ",", "location", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=invalid-name", "result", "=", "{", "}", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
resource_group_delete
.. versionadded:: 2019.2.0 Delete a resource group from the subscription. :param name: The resource group name to delete. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_group_delete testgroup
salt/modules/azurearm_resource.py
def resource_group_delete(name, **kwargs): ''' .. versionadded:: 2019.2.0 Delete a resource group from the subscription. :param name: The resource group name to delete. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_group_delete testgroup ''' result ...
def resource_group_delete(name, **kwargs): ''' .. versionadded:: 2019.2.0 Delete a resource group from the subscription. :param name: The resource group name to delete. CLI Example: .. code-block:: bash salt-call azurearm_resource.resource_group_delete testgroup ''' result ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L197-L221
[ "def", "resource_group_delete", "(", "name", ",", "*", "*", "kwargs", ")", ":", "result", "=", "False", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "group", "=", "resconn", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
deployment_operation_get
.. versionadded:: 2019.2.0 Get a deployment operation within a deployment. :param operation: The operation ID of the operation within the deployment. :param deployment: The name of the deployment containing the operation. :param resource_group: The resource group name assigned to the deploym...
salt/modules/azurearm_resource.py
def deployment_operation_get(operation, deployment, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Get a deployment operation within a deployment. :param operation: The operation ID of the operation within the deployment. :param deployment: The name of the deployment containing the ope...
def deployment_operation_get(operation, deployment, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Get a deployment operation within a deployment. :param operation: The operation ID of the operation within the deployment. :param deployment: The name of the deployment containing the ope...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L224-L257
[ "def", "deployment_operation_get", "(", "operation", ",", "deployment", ",", "resource_group", ",", "*", "*", "kwargs", ")", ":", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "op...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
deployment_operations_list
.. versionadded:: 2019.2.0 List all deployment operations within a deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. :param result_limit: (Default: 10) The limit on the list of deployment operation...
salt/modules/azurearm_resource.py
def deployment_operations_list(name, resource_group, result_limit=10, **kwargs): ''' .. versionadded:: 2019.2.0 List all deployment operations within a deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. ...
def deployment_operations_list(name, resource_group, result_limit=10, **kwargs): ''' .. versionadded:: 2019.2.0 List all deployment operations within a deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L260-L298
[ "def", "deployment_operations_list", "(", "name", ",", "resource_group", ",", "result_limit", "=", "10", ",", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
deployment_delete
.. versionadded:: 2019.2.0 Delete a deployment. :param name: The name of the deployment to delete. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-block:: bash salt-call azurearm_resource.deployment_delete testdeploy testgroup
salt/modules/azurearm_resource.py
def deployment_delete(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Delete a deployment. :param name: The name of the deployment to delete. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-block:: bash sal...
def deployment_delete(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Delete a deployment. :param name: The name of the deployment to delete. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-block:: bash sal...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L301-L331
[ "def", "deployment_delete", "(", "name", ",", "resource_group", ",", "*", "*", "kwargs", ")", ":", "result", "=", "False", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "deploy"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
deployment_check_existence
.. versionadded:: 2019.2.0 Check the existence of a deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-block:: bash salt-call azurearm_resource.deployment_check_existence ...
salt/modules/azurearm_resource.py
def deployment_check_existence(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Check the existence of a deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-b...
def deployment_check_existence(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Check the existence of a deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-b...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L334-L362
[ "def", "deployment_check_existence", "(", "name", ",", "resource_group", ",", "*", "*", "kwargs", ")", ":", "result", "=", "False", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
deployment_get
.. versionadded:: 2019.2.0 Get details about a specific deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-block:: bash salt-call azurearm_resource.deployment_get testdepl...
salt/modules/azurearm_resource.py
def deployment_get(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Get details about a specific deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-block:: b...
def deployment_get(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Get details about a specific deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-block:: b...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L473-L502
[ "def", "deployment_get", "(", "name", ",", "resource_group", ",", "*", "*", "kwargs", ")", ":", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "deploy", "=", "resconn", ".", "d...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
deployment_cancel
.. versionadded:: 2019.2.0 Cancel a deployment if in 'Accepted' or 'Running' state. :param name: The name of the deployment to cancel. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-block:: bash salt-call azurearm_resource.deploy...
salt/modules/azurearm_resource.py
def deployment_cancel(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Cancel a deployment if in 'Accepted' or 'Running' state. :param name: The name of the deployment to cancel. :param resource_group: The resource group name assigned to the deployment. CLI Example: ...
def deployment_cancel(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Cancel a deployment if in 'Accepted' or 'Running' state. :param name: The name of the deployment to cancel. :param resource_group: The resource group name assigned to the deployment. CLI Example: ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L505-L537
[ "def", "deployment_cancel", "(", "name", ",", "resource_group", ",", "*", "*", "kwargs", ")", ":", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "resconn", ".", "deployments", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
deployment_validate
.. versionadded:: 2019.2.0 Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager. :param name: The name of the deployment to validate. :param resource_group: The resource group name assigned to the deployment. :param deploy_mode:...
salt/modules/azurearm_resource.py
def deployment_validate(name, resource_group, deploy_mode=None, debug_setting=None, deploy_params=None, parameters_link=None, deploy_template=None, template_link=None, **kwargs): ''' .. versionadded:: 2019.2.0 Validates whether the spe...
def deployment_validate(name, resource_group, deploy_mode=None, debug_setting=None, deploy_params=None, parameters_link=None, deploy_template=None, template_link=None, **kwargs): ''' .. versionadded:: 2019.2.0 Validates whether the spe...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L540-L640
[ "def", "deployment_validate", "(", "name", ",", "resource_group", ",", "deploy_mode", "=", "None", ",", "debug_setting", "=", "None", ",", "deploy_params", "=", "None", ",", "parameters_link", "=", "None", ",", "deploy_template", "=", "None", ",", "template_link...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
deployment_export_template
.. versionadded:: 2019.2.0 Exports the template used for the specified deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. CLI Example: .. code-block:: bash salt-call azurearm_resource.deployme...
salt/modules/azurearm_resource.py
def deployment_export_template(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Exports the template used for the specified deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. CLI Exam...
def deployment_export_template(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Exports the template used for the specified deployment. :param name: The name of the deployment to query. :param resource_group: The resource group name assigned to the deployment. CLI Exam...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L643-L672
[ "def", "deployment_export_template", "(", "name", ",", "resource_group", ",", "*", "*", "kwargs", ")", ":", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "deploy", "=", "resconn",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
deployments_list
.. versionadded:: 2019.2.0 List all deployments within a resource group. CLI Example: .. code-block:: bash salt-call azurearm_resource.deployments_list testgroup
salt/modules/azurearm_resource.py
def deployments_list(resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 List all deployments within a resource group. CLI Example: .. code-block:: bash salt-call azurearm_resource.deployments_list testgroup ''' result = {} resconn = __utils__['azurearm.get_client']('r...
def deployments_list(resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 List all deployments within a resource group. CLI Example: .. code-block:: bash salt-call azurearm_resource.deployments_list testgroup ''' result = {} resconn = __utils__['azurearm.get_client']('r...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L675-L703
[ "def", "deployments_list", "(", "resource_group", ",", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "resconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'resource'", ",", "*", "*", "kwargs", ")", "try", ":", "deployments", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
subscriptions_list_locations
.. versionadded:: 2019.2.0 List all locations for a subscription. :param subscription_id: The ID of the subscription to query. CLI Example: .. code-block:: bash salt-call azurearm_resource.subscriptions_list_locations XXXXXXXX
salt/modules/azurearm_resource.py
def subscriptions_list_locations(subscription_id=None, **kwargs): ''' .. versionadded:: 2019.2.0 List all locations for a subscription. :param subscription_id: The ID of the subscription to query. CLI Example: .. code-block:: bash salt-call azurearm_resource.subscriptions_list_locat...
def subscriptions_list_locations(subscription_id=None, **kwargs): ''' .. versionadded:: 2019.2.0 List all locations for a subscription. :param subscription_id: The ID of the subscription to query. CLI Example: .. code-block:: bash salt-call azurearm_resource.subscriptions_list_locat...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L706-L742
[ "def", "subscriptions_list_locations", "(", "subscription_id", "=", "None", ",", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "if", "not", "subscription_id", ":", "subscription_id", "=", "kwargs", ".", "get", "(", "'subscription_id'", ")", "elif", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
subscription_get
.. versionadded:: 2019.2.0 Get details about a subscription. :param subscription_id: The ID of the subscription to query. CLI Example: .. code-block:: bash salt-call azurearm_resource.subscription_get XXXXXXXX
salt/modules/azurearm_resource.py
def subscription_get(subscription_id=None, **kwargs): ''' .. versionadded:: 2019.2.0 Get details about a subscription. :param subscription_id: The ID of the subscription to query. CLI Example: .. code-block:: bash salt-call azurearm_resource.subscription_get XXXXXXXX ''' re...
def subscription_get(subscription_id=None, **kwargs): ''' .. versionadded:: 2019.2.0 Get details about a subscription. :param subscription_id: The ID of the subscription to query. CLI Example: .. code-block:: bash salt-call azurearm_resource.subscription_get XXXXXXXX ''' re...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L745-L778
[ "def", "subscription_get", "(", "subscription_id", "=", "None", ",", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "if", "not", "subscription_id", ":", "subscription_id", "=", "kwargs", ".", "get", "(", "'subscription_id'", ")", "elif", "not", "kw...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
subscriptions_list
.. versionadded:: 2019.2.0 List all subscriptions for a tenant. CLI Example: .. code-block:: bash salt-call azurearm_resource.subscriptions_list
salt/modules/azurearm_resource.py
def subscriptions_list(**kwargs): ''' .. versionadded:: 2019.2.0 List all subscriptions for a tenant. CLI Example: .. code-block:: bash salt-call azurearm_resource.subscriptions_list ''' result = {} subconn = __utils__['azurearm.get_client']('subscription', **kwargs) try...
def subscriptions_list(**kwargs): ''' .. versionadded:: 2019.2.0 List all subscriptions for a tenant. CLI Example: .. code-block:: bash salt-call azurearm_resource.subscriptions_list ''' result = {} subconn = __utils__['azurearm.get_client']('subscription', **kwargs) try...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L781-L805
[ "def", "subscriptions_list", "(", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "subconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'subscription'", ",", "*", "*", "kwargs", ")", "try", ":", "subs", "=", "__utils__", "[", "'azu...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
tenants_list
.. versionadded:: 2019.2.0 List all tenants for your account. CLI Example: .. code-block:: bash salt-call azurearm_resource.tenants_list
salt/modules/azurearm_resource.py
def tenants_list(**kwargs): ''' .. versionadded:: 2019.2.0 List all tenants for your account. CLI Example: .. code-block:: bash salt-call azurearm_resource.tenants_list ''' result = {} subconn = __utils__['azurearm.get_client']('subscription', **kwargs) try: tena...
def tenants_list(**kwargs): ''' .. versionadded:: 2019.2.0 List all tenants for your account. CLI Example: .. code-block:: bash salt-call azurearm_resource.tenants_list ''' result = {} subconn = __utils__['azurearm.get_client']('subscription', **kwargs) try: tena...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L808-L832
[ "def", "tenants_list", "(", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "subconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'subscription'", ",", "*", "*", "kwargs", ")", "try", ":", "tenants", "=", "__utils__", "[", "'azurea...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
policy_assignment_delete
.. versionadded:: 2019.2.0 Delete a policy assignment. :param name: The name of the policy assignment to delete. :param scope: The scope of the policy assignment. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_assignment_delete testassign \ /subscriptions/...
salt/modules/azurearm_resource.py
def policy_assignment_delete(name, scope, **kwargs): ''' .. versionadded:: 2019.2.0 Delete a policy assignment. :param name: The name of the policy assignment to delete. :param scope: The scope of the policy assignment. CLI Example: .. code-block:: bash salt-call azurearm_resou...
def policy_assignment_delete(name, scope, **kwargs): ''' .. versionadded:: 2019.2.0 Delete a policy assignment. :param name: The name of the policy assignment to delete. :param scope: The scope of the policy assignment. CLI Example: .. code-block:: bash salt-call azurearm_resou...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L835-L865
[ "def", "policy_assignment_delete", "(", "name", ",", "scope", ",", "*", "*", "kwargs", ")", ":", "result", "=", "False", "polconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'policy'", ",", "*", "*", "kwargs", ")", "try", ":", "# pylint: d...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
policy_assignment_create
.. versionadded:: 2019.2.0 Create a policy assignment. :param name: The name of the policy assignment to create. :param scope: The scope of the policy assignment. :param definition_name: The name of the policy definition to assign. CLI Example: .. code-block:: bash salt-call azure...
salt/modules/azurearm_resource.py
def policy_assignment_create(name, scope, definition_name, **kwargs): ''' .. versionadded:: 2019.2.0 Create a policy assignment. :param name: The name of the policy assignment to create. :param scope: The scope of the policy assignment. :param definition_name: The name of the policy definiti...
def policy_assignment_create(name, scope, definition_name, **kwargs): ''' .. versionadded:: 2019.2.0 Create a policy assignment. :param name: The name of the policy assignment to create. :param scope: The scope of the policy assignment. :param definition_name: The name of the policy definiti...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L868-L943
[ "def", "policy_assignment_create", "(", "name", ",", "scope", ",", "definition_name", ",", "*", "*", "kwargs", ")", ":", "polconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'policy'", ",", "*", "*", "kwargs", ")", "# \"get\" doesn't work for bu...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
policy_assignment_get
.. versionadded:: 2019.2.0 Get details about a specific policy assignment. :param name: The name of the policy assignment to query. :param scope: The scope of the policy assignment. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_assignment_get testassign \ ...
salt/modules/azurearm_resource.py
def policy_assignment_get(name, scope, **kwargs): ''' .. versionadded:: 2019.2.0 Get details about a specific policy assignment. :param name: The name of the policy assignment to query. :param scope: The scope of the policy assignment. CLI Example: .. code-block:: bash salt-cal...
def policy_assignment_get(name, scope, **kwargs): ''' .. versionadded:: 2019.2.0 Get details about a specific policy assignment. :param name: The name of the policy assignment to query. :param scope: The scope of the policy assignment. CLI Example: .. code-block:: bash salt-cal...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L946-L975
[ "def", "policy_assignment_get", "(", "name", ",", "scope", ",", "*", "*", "kwargs", ")", ":", "polconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'policy'", ",", "*", "*", "kwargs", ")", "try", ":", "policy", "=", "polconn", ".", "polic...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
policy_assignments_list_for_resource_group
.. versionadded:: 2019.2.0 List all policy assignments for a resource group. :param resource_group: The resource group name to list policy assignments within. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_assignments_list_for_resource_group testgroup
salt/modules/azurearm_resource.py
def policy_assignments_list_for_resource_group(resource_group, **kwargs): # pylint: disable=invalid-name ''' .. versionadded:: 2019.2.0 List all policy assignments for a resource group. :param resource_group: The resource group name to list policy assignments within. CLI Example: .. code-bl...
def policy_assignments_list_for_resource_group(resource_group, **kwargs): # pylint: disable=invalid-name ''' .. versionadded:: 2019.2.0 List all policy assignments for a resource group. :param resource_group: The resource group name to list policy assignments within. CLI Example: .. code-bl...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L978-L1009
[ "def", "policy_assignments_list_for_resource_group", "(", "resource_group", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=invalid-name", "result", "=", "{", "}", "polconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'policy'", ",", "*", "*", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
policy_assignments_list
.. versionadded:: 2019.2.0 List all policy assignments for a subscription. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_assignments_list
salt/modules/azurearm_resource.py
def policy_assignments_list(**kwargs): ''' .. versionadded:: 2019.2.0 List all policy assignments for a subscription. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_assignments_list ''' result = {} polconn = __utils__['azurearm.get_client']('policy', **...
def policy_assignments_list(**kwargs): ''' .. versionadded:: 2019.2.0 List all policy assignments for a subscription. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_assignments_list ''' result = {} polconn = __utils__['azurearm.get_client']('policy', **...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L1012-L1036
[ "def", "policy_assignments_list", "(", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "polconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'policy'", ",", "*", "*", "kwargs", ")", "try", ":", "policy_assign", "=", "__utils__", "[",...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
policy_definition_create_or_update
.. versionadded:: 2019.2.0 Create or update a policy definition. :param name: The name of the policy definition to create or update. :param policy_rule: A dictionary defining the `policy rule <https://docs.microsoft.com/en-us/azure/azure-policy/policy-definition#policy-rule>`_. CLI Example: ...
salt/modules/azurearm_resource.py
def policy_definition_create_or_update(name, policy_rule, **kwargs): # pylint: disable=invalid-name ''' .. versionadded:: 2019.2.0 Create or update a policy definition. :param name: The name of the policy definition to create or update. :param policy_rule: A dictionary defining the `poli...
def policy_definition_create_or_update(name, policy_rule, **kwargs): # pylint: disable=invalid-name ''' .. versionadded:: 2019.2.0 Create or update a policy definition. :param name: The name of the policy definition to create or update. :param policy_rule: A dictionary defining the `poli...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L1039-L1091
[ "def", "policy_definition_create_or_update", "(", "name", ",", "policy_rule", ",", "*", "*", "kwargs", ")", ":", "# pylint: disable=invalid-name", "if", "not", "isinstance", "(", "policy_rule", ",", "dict", ")", ":", "result", "=", "{", "'error'", ":", "'The pol...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
policy_definition_delete
.. versionadded:: 2019.2.0 Delete a policy definition. :param name: The name of the policy definition to delete. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_definition_delete testpolicy
salt/modules/azurearm_resource.py
def policy_definition_delete(name, **kwargs): ''' .. versionadded:: 2019.2.0 Delete a policy definition. :param name: The name of the policy definition to delete. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_definition_delete testpolicy ''' result = ...
def policy_definition_delete(name, **kwargs): ''' .. versionadded:: 2019.2.0 Delete a policy definition. :param name: The name of the policy definition to delete. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_definition_delete testpolicy ''' result = ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L1094-L1120
[ "def", "policy_definition_delete", "(", "name", ",", "*", "*", "kwargs", ")", ":", "result", "=", "False", "polconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'policy'", ",", "*", "*", "kwargs", ")", "try", ":", "# pylint: disable=unused-vari...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
policy_definition_get
.. versionadded:: 2019.2.0 Get details about a specific policy definition. :param name: The name of the policy definition to query. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_definition_get testpolicy
salt/modules/azurearm_resource.py
def policy_definition_get(name, **kwargs): ''' .. versionadded:: 2019.2.0 Get details about a specific policy definition. :param name: The name of the policy definition to query. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_definition_get testpolicy ''' ...
def policy_definition_get(name, **kwargs): ''' .. versionadded:: 2019.2.0 Get details about a specific policy definition. :param name: The name of the policy definition to query. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_definition_get testpolicy ''' ...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L1123-L1148
[ "def", "policy_definition_get", "(", "name", ",", "*", "*", "kwargs", ")", ":", "polconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'policy'", ",", "*", "*", "kwargs", ")", "try", ":", "policy_def", "=", "polconn", ".", "policy_definitions"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
policy_definitions_list
.. versionadded:: 2019.2.0 List all policy definitions for a subscription. :param hide_builtin: Boolean which will filter out BuiltIn policy definitions from the result. CLI Example: .. code-block:: bash salt-call azurearm_resource.policy_definitions_list
salt/modules/azurearm_resource.py
def policy_definitions_list(hide_builtin=False, **kwargs): ''' .. versionadded:: 2019.2.0 List all policy definitions for a subscription. :param hide_builtin: Boolean which will filter out BuiltIn policy definitions from the result. CLI Example: .. code-block:: bash salt-call azurea...
def policy_definitions_list(hide_builtin=False, **kwargs): ''' .. versionadded:: 2019.2.0 List all policy definitions for a subscription. :param hide_builtin: Boolean which will filter out BuiltIn policy definitions from the result. CLI Example: .. code-block:: bash salt-call azurea...
[ "..", "versionadded", "::", "2019", ".", "2", ".", "0" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/azurearm_resource.py#L1151-L1178
[ "def", "policy_definitions_list", "(", "hide_builtin", "=", "False", ",", "*", "*", "kwargs", ")", ":", "result", "=", "{", "}", "polconn", "=", "__utils__", "[", "'azurearm.get_client'", "]", "(", "'policy'", ",", "*", "*", "kwargs", ")", "try", ":", "p...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
query_instance
Query an instance upon creation from the Joyent API
salt/cloud/clouds/joyent.py
def query_instance(vm_=None, call=None): ''' Query an instance upon creation from the Joyent API ''' if isinstance(vm_, six.string_types) and call == 'action': vm_ = {'name': vm_, 'provider': 'joyent'} if call == 'function': # Technically this function may be called other ways too, ...
def query_instance(vm_=None, call=None): ''' Query an instance upon creation from the Joyent API ''' if isinstance(vm_, six.string_types) and call == 'action': vm_ = {'name': vm_, 'provider': 'joyent'} if call == 'function': # Technically this function may be called other ways too, ...
[ "Query", "an", "instance", "upon", "creation", "from", "the", "Joyent", "API" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L172-L235
[ "def", "query_instance", "(", "vm_", "=", "None", ",", "call", "=", "None", ")", ":", "if", "isinstance", "(", "vm_", ",", "six", ".", "string_types", ")", "and", "call", "==", "'action'", ":", "vm_", "=", "{", "'name'", ":", "vm_", ",", "'provider'"...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create
Create a single VM from a data dict CLI Example: .. code-block:: bash salt-cloud -p profile_name vm_name
salt/cloud/clouds/joyent.py
def create(vm_): ''' Create a single VM from a data dict CLI Example: .. code-block:: bash salt-cloud -p profile_name vm_name ''' try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured(__opts__, ...
def create(vm_): ''' Create a single VM from a data dict CLI Example: .. code-block:: bash salt-cloud -p profile_name vm_name ''' try: # Check for required profile parameters before sending any API calls. if vm_['profile'] and config.is_profile_configured(__opts__, ...
[ "Create", "a", "single", "VM", "from", "a", "data", "dict" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L238-L322
[ "def", "create", "(", "vm_", ")", ":", "try", ":", "# Check for required profile parameters before sending any API calls.", "if", "vm_", "[", "'profile'", "]", "and", "config", ".", "is_profile_configured", "(", "__opts__", ",", "__active_provider_name__", "or", "'joyen...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
create_node
convenience function to make the rest api call for node creation.
salt/cloud/clouds/joyent.py
def create_node(**kwargs): ''' convenience function to make the rest api call for node creation. ''' name = kwargs['name'] size = kwargs['size'] image = kwargs['image'] location = kwargs['location'] networks = kwargs.get('networks') tag = kwargs.get('tag') locality = kwargs.get('...
def create_node(**kwargs): ''' convenience function to make the rest api call for node creation. ''' name = kwargs['name'] size = kwargs['size'] image = kwargs['image'] location = kwargs['location'] networks = kwargs.get('networks') tag = kwargs.get('tag') locality = kwargs.get('...
[ "convenience", "function", "to", "make", "the", "rest", "api", "call", "for", "node", "creation", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L325-L370
[ "def", "create_node", "(", "*", "*", "kwargs", ")", ":", "name", "=", "kwargs", "[", "'name'", "]", "size", "=", "kwargs", "[", "'size'", "]", "image", "=", "kwargs", "[", "'image'", "]", "location", "=", "kwargs", "[", "'location'", "]", "networks", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
destroy
destroy a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: array of booleans , true if successfully stopped and true if successfully removed CLI Example: .. code-block:: bash salt-cloud -d vm_name
salt/cloud/clouds/joyent.py
def destroy(name, call=None): ''' destroy a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: array of booleans , true if successfully stopped and true if successfully removed CLI Example: .. code-block:: bash ...
def destroy(name, call=None): ''' destroy a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: array of booleans , true if successfully stopped and true if successfully removed CLI Example: .. code-block:: bash ...
[ "destroy", "a", "machine", "by", "name" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L373-L420
[ "def", "destroy", "(", "name", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The destroy action must be called with -d, --destroy, '", "'-a or --action.'", ")", "__utils__", "[", "'cloud.fire_event'", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
reboot
reboot a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: true if successful CLI Example: .. code-block:: bash salt-cloud -a reboot vm_name
salt/cloud/clouds/joyent.py
def reboot(name, call=None): ''' reboot a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: true if successful CLI Example: .. code-block:: bash salt-cloud -a reboot vm_name ''' node = get_node(name) ret = ...
def reboot(name, call=None): ''' reboot a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: true if successful CLI Example: .. code-block:: bash salt-cloud -a reboot vm_name ''' node = get_node(name) ret = ...
[ "reboot", "a", "machine", "by", "name", ":", "param", "name", ":", "name", "given", "to", "the", "machine", ":", "param", "call", ":", "call", "value", "in", "this", "case", "is", "action", ":", "return", ":", "true", "if", "successful" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L423-L440
[ "def", "reboot", "(", "name", ",", "call", "=", "None", ")", ":", "node", "=", "get_node", "(", "name", ")", "ret", "=", "take_action", "(", "name", "=", "name", ",", "call", "=", "call", ",", "method", "=", "'POST'", ",", "command", "=", "'my/mach...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
take_action
take action call used by start,stop, reboot :param name: name given to the machine :param call: call value in this case is 'action' :command: api path :data: any data to be passed to the api, must be in json format :method: GET,POST,or DELETE :location: data center to execute the command on ...
salt/cloud/clouds/joyent.py
def take_action(name=None, call=None, command=None, data=None, method='GET', location=DEFAULT_LOCATION): ''' take action call used by start,stop, reboot :param name: name given to the machine :param call: call value in this case is 'action' :command: api path :data: any data to ...
def take_action(name=None, call=None, command=None, data=None, method='GET', location=DEFAULT_LOCATION): ''' take action call used by start,stop, reboot :param name: name given to the machine :param call: call value in this case is 'action' :command: api path :data: any data to ...
[ "take", "action", "call", "used", "by", "start", "stop", "reboot", ":", "param", "name", ":", "name", "given", "to", "the", "machine", ":", "param", "call", ":", "call", "value", "in", "this", "case", "is", "action", ":", "command", ":", "api", "path",...
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L484-L524
[ "def", "take_action", "(", "name", "=", "None", ",", "call", "=", "None", ",", "command", "=", "None", ",", "data", "=", "None", ",", "method", "=", "'GET'", ",", "location", "=", "DEFAULT_LOCATION", ")", ":", "caller", "=", "inspect", ".", "stack", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
get_location
Return the joyent data center to use, in this order: - CLI parameter - VM parameter - Cloud profile setting
salt/cloud/clouds/joyent.py
def get_location(vm_=None): ''' Return the joyent data center to use, in this order: - CLI parameter - VM parameter - Cloud profile setting ''' return __opts__.get( 'location', config.get_cloud_config_value( 'location', vm_ or get_configure...
def get_location(vm_=None): ''' Return the joyent data center to use, in this order: - CLI parameter - VM parameter - Cloud profile setting ''' return __opts__.get( 'location', config.get_cloud_config_value( 'location', vm_ or get_configure...
[ "Return", "the", "joyent", "data", "center", "to", "use", "in", "this", "order", ":", "-", "CLI", "parameter", "-", "VM", "parameter", "-", "Cloud", "profile", "setting" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L538-L554
[ "def", "get_location", "(", "vm_", "=", "None", ")", ":", "return", "__opts__", ".", "get", "(", "'location'", ",", "config", ".", "get_cloud_config_value", "(", "'location'", ",", "vm_", "or", "get_configured_provider", "(", ")", ",", "__opts__", ",", "defa...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
avail_locations
List all available locations
salt/cloud/clouds/joyent.py
def avail_locations(call=None): ''' List all available locations ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_locations function must be called with ' '-f or --function, or with the --list-locations option' ) ret = {} for key in JOYENT_L...
def avail_locations(call=None): ''' List all available locations ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_locations function must be called with ' '-f or --function, or with the --list-locations option' ) ret = {} for key in JOYENT_L...
[ "List", "all", "available", "locations" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L557-L587
[ "def", "avail_locations", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_locations function must be called with '", "'-f or --function, or with the --list-locations option'", ")", "ret", "=", "{", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
has_method
Find if the provided object has a specific method
salt/cloud/clouds/joyent.py
def has_method(obj, method_name): ''' Find if the provided object has a specific method ''' if method_name in dir(obj): return True log.error('Method \'%s\' not yet supported!', method_name) return False
def has_method(obj, method_name): ''' Find if the provided object has a specific method ''' if method_name in dir(obj): return True log.error('Method \'%s\' not yet supported!', method_name) return False
[ "Find", "if", "the", "provided", "object", "has", "a", "specific", "method" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L590-L598
[ "def", "has_method", "(", "obj", ",", "method_name", ")", ":", "if", "method_name", "in", "dir", "(", "obj", ")", ":", "return", "True", "log", ".", "error", "(", "'Method \\'%s\\' not yet supported!'", ",", "method_name", ")", "return", "False" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
train
key_list
convert list to dictionary using the key as the identifier :param items: array to iterate over :return: dictionary
salt/cloud/clouds/joyent.py
def key_list(items=None): ''' convert list to dictionary using the key as the identifier :param items: array to iterate over :return: dictionary ''' if items is None: items = [] ret = {} if items and isinstance(items, list): for item in items: if 'name' in it...
def key_list(items=None): ''' convert list to dictionary using the key as the identifier :param items: array to iterate over :return: dictionary ''' if items is None: items = [] ret = {} if items and isinstance(items, list): for item in items: if 'name' in it...
[ "convert", "list", "to", "dictionary", "using", "the", "key", "as", "the", "identifier", ":", "param", "items", ":", "array", "to", "iterate", "over", ":", "return", ":", "dictionary" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L601-L618
[ "def", "key_list", "(", "items", "=", "None", ")", ":", "if", "items", "is", "None", ":", "items", "=", "[", "]", "ret", "=", "{", "}", "if", "items", "and", "isinstance", "(", "items", ",", "list", ")", ":", "for", "item", "in", "items", ":", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_instance
get details about a machine :param name: name given to the machine :param call: call value in this case is 'action' :return: machine information CLI Example: .. code-block:: bash salt-cloud -a show_instance vm_name
salt/cloud/clouds/joyent.py
def show_instance(name, call=None): ''' get details about a machine :param name: name given to the machine :param call: call value in this case is 'action' :return: machine information CLI Example: .. code-block:: bash salt-cloud -a show_instance vm_name ''' node = get_nod...
def show_instance(name, call=None): ''' get details about a machine :param name: name given to the machine :param call: call value in this case is 'action' :return: machine information CLI Example: .. code-block:: bash salt-cloud -a show_instance vm_name ''' node = get_nod...
[ "get", "details", "about", "a", "machine", ":", "param", "name", ":", "name", "given", "to", "the", "machine", ":", "param", "call", ":", "call", "value", "in", "this", "case", "is", "action", ":", "return", ":", "machine", "information" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L633-L650
[ "def", "show_instance", "(", "name", ",", "call", "=", "None", ")", ":", "node", "=", "get_node", "(", "name", ")", "ret", "=", "query", "(", "command", "=", "'my/machines/{0}'", ".", "format", "(", "node", "[", "'id'", "]", ")", ",", "location", "="...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
reformat_node
Reformat the returned data from joyent, determine public/private IPs and strip out fields if necessary to provide either full or brief content. :param item: node dictionary :param full: full or brief output :return: dict
salt/cloud/clouds/joyent.py
def reformat_node(item=None, full=False): ''' Reformat the returned data from joyent, determine public/private IPs and strip out fields if necessary to provide either full or brief content. :param item: node dictionary :param full: full or brief output :return: dict ''' desired_keys = [...
def reformat_node(item=None, full=False): ''' Reformat the returned data from joyent, determine public/private IPs and strip out fields if necessary to provide either full or brief content. :param item: node dictionary :param full: full or brief output :return: dict ''' desired_keys = [...
[ "Reformat", "the", "returned", "data", "from", "joyent", "determine", "public", "/", "private", "IPs", "and", "strip", "out", "fields", "if", "necessary", "to", "provide", "either", "full", "or", "brief", "content", "." ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L674-L714
[ "def", "reformat_node", "(", "item", "=", "None", ",", "full", "=", "False", ")", ":", "desired_keys", "=", "[", "'id'", ",", "'name'", ",", "'state'", ",", "'public_ips'", ",", "'private_ips'", ",", "'size'", ",", "'image'", ",", "'location'", "]", "ite...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_nodes
list of nodes, keeping only a brief listing CLI Example: .. code-block:: bash salt-cloud -Q
salt/cloud/clouds/joyent.py
def list_nodes(full=False, call=None): ''' list of nodes, keeping only a brief listing CLI Example: .. code-block:: bash salt-cloud -Q ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes function must be called with -f or --function.' ) ...
def list_nodes(full=False, call=None): ''' list of nodes, keeping only a brief listing CLI Example: .. code-block:: bash salt-cloud -Q ''' if call == 'action': raise SaltCloudSystemExit( 'The list_nodes function must be called with -f or --function.' ) ...
[ "list", "of", "nodes", "keeping", "only", "a", "brief", "listing" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L717-L755
[ "def", "list_nodes", "(", "full", "=", "False", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_nodes function must be called with -f or --function.'", ")", "ret", "=", "{", "}", "if", "POL...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
_get_proto
Checks configuration to see whether the user has SSL turned on. Default is: .. code-block:: yaml use_ssl: True
salt/cloud/clouds/joyent.py
def _get_proto(): ''' Checks configuration to see whether the user has SSL turned on. Default is: .. code-block:: yaml use_ssl: True ''' use_ssl = config.get_cloud_config_value( 'use_ssl', get_configured_provider(), __opts__, search_global=False, def...
def _get_proto(): ''' Checks configuration to see whether the user has SSL turned on. Default is: .. code-block:: yaml use_ssl: True ''' use_ssl = config.get_cloud_config_value( 'use_ssl', get_configured_provider(), __opts__, search_global=False, def...
[ "Checks", "configuration", "to", "see", "whether", "the", "user", "has", "SSL", "turned", "on", ".", "Default", "is", ":" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L785-L802
[ "def", "_get_proto", "(", ")", ":", "use_ssl", "=", "config", ".", "get_cloud_config_value", "(", "'use_ssl'", ",", "get_configured_provider", "(", ")", ",", "__opts__", ",", "search_global", "=", "False", ",", "default", "=", "True", ")", "if", "use_ssl", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
avail_images
Get list of available images CLI Example: .. code-block:: bash salt-cloud --list-images Can use a custom URL for images. Default is: .. code-block:: yaml image_url: images.joyent.com/images
salt/cloud/clouds/joyent.py
def avail_images(call=None): ''' Get list of available images CLI Example: .. code-block:: bash salt-cloud --list-images Can use a custom URL for images. Default is: .. code-block:: yaml image_url: images.joyent.com/images ''' if call == 'action': raise Salt...
def avail_images(call=None): ''' Get list of available images CLI Example: .. code-block:: bash salt-cloud --list-images Can use a custom URL for images. Default is: .. code-block:: yaml image_url: images.joyent.com/images ''' if call == 'action': raise Salt...
[ "Get", "list", "of", "available", "images" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L805-L848
[ "def", "avail_images", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_images function must be called with '", "'-f or --function, or with the --list-images option'", ")", "user", "=", "config", "."...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
avail_sizes
get list of available packages CLI Example: .. code-block:: bash salt-cloud --list-sizes
salt/cloud/clouds/joyent.py
def avail_sizes(call=None): ''' get list of available packages CLI Example: .. code-block:: bash salt-cloud --list-sizes ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes function must be called with ' '-f or --function, or with the -...
def avail_sizes(call=None): ''' get list of available packages CLI Example: .. code-block:: bash salt-cloud --list-sizes ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_sizes function must be called with ' '-f or --function, or with the -...
[ "get", "list", "of", "available", "packages" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L851-L870
[ "def", "avail_sizes", "(", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The avail_sizes function must be called with '", "'-f or --function, or with the --list-sizes option'", ")", "rcode", ",", "items", "=", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
list_keys
List the keys available
salt/cloud/clouds/joyent.py
def list_keys(kwargs=None, call=None): ''' List the keys available ''' if call != 'function': log.error( 'The list_keys function must be called with -f or --function.' ) return False if not kwargs: kwargs = {} ret = {} rcode, data = query(command...
def list_keys(kwargs=None, call=None): ''' List the keys available ''' if call != 'function': log.error( 'The list_keys function must be called with -f or --function.' ) return False if not kwargs: kwargs = {} ret = {} rcode, data = query(command...
[ "List", "the", "keys", "available" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L873-L890
[ "def", "list_keys", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "log", ".", "error", "(", "'The list_keys function must be called with -f or --function.'", ")", "return", "False", "if", "not", "kwargs", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
train
show_key
List the keys available
salt/cloud/clouds/joyent.py
def show_key(kwargs=None, call=None): ''' List the keys available ''' if call != 'function': log.error( 'The list_keys function must be called with -f or --function.' ) return False if not kwargs: kwargs = {} if 'keyname' not in kwargs: log.e...
def show_key(kwargs=None, call=None): ''' List the keys available ''' if call != 'function': log.error( 'The list_keys function must be called with -f or --function.' ) return False if not kwargs: kwargs = {} if 'keyname' not in kwargs: log.e...
[ "List", "the", "keys", "available" ]
saltstack/salt
python
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/joyent.py#L893-L914
[ "def", "show_key", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "log", ".", "error", "(", "'The list_keys function must be called with -f or --function.'", ")", "return", "False", "if", "not", "kwargs", ...
e8541fd6e744ab0df786c0f76102e41631f45d46