repo
stringclasses
85 values
path
stringlengths
8
121
func_name
stringlengths
1
82
original_string
stringlengths
112
65.5k
language
stringclasses
1 value
code
stringlengths
112
65.5k
code_tokens
listlengths
20
4.09k
docstring
stringlengths
3
46.3k
docstring_tokens
listlengths
1
564
sha
stringclasses
85 values
url
stringlengths
93
218
partition
stringclasses
1 value
saltstack/salt
salt/modules/pacmanpkg.py
_uninstall
def _uninstall(action='remove', name=None, pkgs=None, **kwargs): ''' remove and purge do identical things but with different pacman commands, this function performs the common logic. ''' try: pkg_params = __salt__['pkg_resource.parse_targets'](name, pkgs)[0] except MinionError as exc: ...
python
def _uninstall(action='remove', name=None, pkgs=None, **kwargs): ''' remove and purge do identical things but with different pacman commands, this function performs the common logic. ''' try: pkg_params = __salt__['pkg_resource.parse_targets'](name, pkgs)[0] except MinionError as exc: ...
[ "def", "_uninstall", "(", "action", "=", "'remove'", ",", "name", "=", "None", ",", "pkgs", "=", "None", ",", "*", "*", "kwargs", ")", ":", "try", ":", "pkg_params", "=", "__salt__", "[", "'pkg_resource.parse_targets'", "]", "(", "name", ",", "pkgs", "...
remove and purge do identical things but with different pacman commands, this function performs the common logic.
[ "remove", "and", "purge", "do", "identical", "things", "but", "with", "different", "pacman", "commands", "this", "function", "performs", "the", "common", "logic", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pacmanpkg.py#L706-L754
train
saltstack/salt
salt/modules/pacmanpkg.py
file_list
def file_list(*packages, **kwargs): ''' List the files that belong to a package. Not specifying any packages will return a list of _every_ file on the system's package database (not generally recommended). CLI Examples: .. code-block:: bash salt '*' pkg.file_list httpd salt '*...
python
def file_list(*packages, **kwargs): ''' List the files that belong to a package. Not specifying any packages will return a list of _every_ file on the system's package database (not generally recommended). CLI Examples: .. code-block:: bash salt '*' pkg.file_list httpd salt '*...
[ "def", "file_list", "(", "*", "packages", ",", "*", "*", "kwargs", ")", ":", "errors", "=", "[", "]", "ret", "=", "[", "]", "cmd", "=", "[", "'pacman'", ",", "'-Ql'", "]", "if", "packages", "and", "os", ".", "path", ".", "exists", "(", "packages"...
List the files that belong to a package. Not specifying any packages will return a list of _every_ file on the system's package database (not generally recommended). CLI Examples: .. code-block:: bash salt '*' pkg.file_list httpd salt '*' pkg.file_list httpd postfix salt '*' p...
[ "List", "the", "files", "that", "belong", "to", "a", "package", ".", "Not", "specifying", "any", "packages", "will", "return", "a", "list", "of", "_every_", "file", "on", "the", "system", "s", "package", "database", "(", "not", "generally", "recommended", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pacmanpkg.py#L846-L877
train
saltstack/salt
salt/modules/pacmanpkg.py
list_repo_pkgs
def list_repo_pkgs(*args, **kwargs): ''' Returns all available packages. Optionally, package names (and name globs) can be passed and the results will be filtered to packages matching those names. This function can be helpful in discovering the version or repo to specify in a :mod:`pkg.installe...
python
def list_repo_pkgs(*args, **kwargs): ''' Returns all available packages. Optionally, package names (and name globs) can be passed and the results will be filtered to packages matching those names. This function can be helpful in discovering the version or repo to specify in a :mod:`pkg.installe...
[ "def", "list_repo_pkgs", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "kwargs", ")", "fromrepo", "=", "kwargs", ".", "pop", "(", "'fromrepo'", ",", "''", ...
Returns all available packages. Optionally, package names (and name globs) can be passed and the results will be filtered to packages matching those names. This function can be helpful in discovering the version or repo to specify in a :mod:`pkg.installed <salt.states.pkg.installed>` state. The re...
[ "Returns", "all", "available", "packages", ".", "Optionally", "package", "names", "(", "and", "name", "globs", ")", "can", "be", "passed", "and", "the", "results", "will", "be", "filtered", "to", "packages", "matching", "those", "names", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/pacmanpkg.py#L946-L1066
train
saltstack/salt
salt/cli/spm.py
SPM.run
def run(self): ''' Run the api ''' ui = salt.spm.SPMCmdlineInterface() self.parse_args() self.setup_logfile_logger() v_dirs = [ self.config['spm_cache_dir'], ] verify_env(v_dirs, self.config['user'], ...
python
def run(self): ''' Run the api ''' ui = salt.spm.SPMCmdlineInterface() self.parse_args() self.setup_logfile_logger() v_dirs = [ self.config['spm_cache_dir'], ] verify_env(v_dirs, self.config['user'], ...
[ "def", "run", "(", "self", ")", ":", "ui", "=", "salt", ".", "spm", ".", "SPMCmdlineInterface", "(", ")", "self", ".", "parse_args", "(", ")", "self", ".", "setup_logfile_logger", "(", ")", "v_dirs", "=", "[", "self", ".", "config", "[", "'spm_cache_di...
Run the api
[ "Run", "the", "api" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/spm.py#L25-L41
train
saltstack/salt
salt/pillar/sql_base.py
SqlBaseExtPillar.extract_queries
def extract_queries(self, args, kwargs): ''' This function normalizes the config block into a set of queries we can use. The return is a list of consistently laid out dicts. ''' # Please note the function signature is NOT an error. Neither args, nor # kwargs should have...
python
def extract_queries(self, args, kwargs): ''' This function normalizes the config block into a set of queries we can use. The return is a list of consistently laid out dicts. ''' # Please note the function signature is NOT an error. Neither args, nor # kwargs should have...
[ "def", "extract_queries", "(", "self", ",", "args", ",", "kwargs", ")", ":", "# Please note the function signature is NOT an error. Neither args, nor", "# kwargs should have asterisks. We are passing in a list and dict,", "# rather than receiving variable args. Adding asterisks WILL BREAK...
This function normalizes the config block into a set of queries we can use. The return is a list of consistently laid out dicts.
[ "This", "function", "normalizes", "the", "config", "block", "into", "a", "set", "of", "queries", "we", "can", "use", ".", "The", "return", "is", "a", "list", "of", "consistently", "laid", "out", "dicts", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/sql_base.py#L230-L284
train
saltstack/salt
salt/pillar/sql_base.py
SqlBaseExtPillar.enter_root
def enter_root(self, root): ''' Set self.focus for kwarg queries ''' # There is no collision protection on root name isolation if root: self.result[root] = self.focus = {} else: self.focus = self.result
python
def enter_root(self, root): ''' Set self.focus for kwarg queries ''' # There is no collision protection on root name isolation if root: self.result[root] = self.focus = {} else: self.focus = self.result
[ "def", "enter_root", "(", "self", ",", "root", ")", ":", "# There is no collision protection on root name isolation", "if", "root", ":", "self", ".", "result", "[", "root", "]", "=", "self", ".", "focus", "=", "{", "}", "else", ":", "self", ".", "focus", "...
Set self.focus for kwarg queries
[ "Set", "self", ".", "focus", "for", "kwarg", "queries" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/sql_base.py#L286-L294
train
saltstack/salt
salt/pillar/sql_base.py
SqlBaseExtPillar.process_fields
def process_fields(self, field_names, depth): ''' The primary purpose of this function is to store the sql field list and the depth to which we process. ''' # List of field names in correct order. self.field_names = field_names # number of fields. self.num...
python
def process_fields(self, field_names, depth): ''' The primary purpose of this function is to store the sql field list and the depth to which we process. ''' # List of field names in correct order. self.field_names = field_names # number of fields. self.num...
[ "def", "process_fields", "(", "self", ",", "field_names", ",", "depth", ")", ":", "# List of field names in correct order.", "self", ".", "field_names", "=", "field_names", "# number of fields.", "self", ".", "num_fields", "=", "len", "(", "field_names", ")", "# Con...
The primary purpose of this function is to store the sql field list and the depth to which we process.
[ "The", "primary", "purpose", "of", "this", "function", "is", "to", "store", "the", "sql", "field", "list", "and", "the", "depth", "to", "which", "we", "process", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/sql_base.py#L296-L309
train
saltstack/salt
salt/pillar/sql_base.py
SqlBaseExtPillar.process_results
def process_results(self, rows): ''' This function takes a list of database results and iterates over, merging them into a dict form. ''' listify = OrderedDict() listify_dicts = OrderedDict() for ret in rows: # crd is the Current Return Data level, to ...
python
def process_results(self, rows): ''' This function takes a list of database results and iterates over, merging them into a dict form. ''' listify = OrderedDict() listify_dicts = OrderedDict() for ret in rows: # crd is the Current Return Data level, to ...
[ "def", "process_results", "(", "self", ",", "rows", ")", ":", "listify", "=", "OrderedDict", "(", ")", "listify_dicts", "=", "OrderedDict", "(", ")", "for", "ret", "in", "rows", ":", "# crd is the Current Return Data level, to make this non-recursive.", "crd", "=", ...
This function takes a list of database results and iterates over, merging them into a dict form.
[ "This", "function", "takes", "a", "list", "of", "database", "results", "and", "iterates", "over", "merging", "them", "into", "a", "dict", "form", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/sql_base.py#L311-L416
train
saltstack/salt
salt/pillar/sql_base.py
SqlBaseExtPillar.fetch
def fetch(self, minion_id, pillar, # pylint: disable=W0613 *args, **kwargs): ''' Execute queries, merge and return as a dict. ''' db_name = self._db_name() log.info('Querying %s for information for %s', db_name, minion_id) ...
python
def fetch(self, minion_id, pillar, # pylint: disable=W0613 *args, **kwargs): ''' Execute queries, merge and return as a dict. ''' db_name = self._db_name() log.info('Querying %s for information for %s', db_name, minion_id) ...
[ "def", "fetch", "(", "self", ",", "minion_id", ",", "pillar", ",", "# pylint: disable=W0613", "*", "args", ",", "*", "*", "kwargs", ")", ":", "db_name", "=", "self", ".", "_db_name", "(", ")", "log", ".", "info", "(", "'Querying %s for information for %s'", ...
Execute queries, merge and return as a dict.
[ "Execute", "queries", "merge", "and", "return", "as", "a", "dict", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/sql_base.py#L418-L451
train
saltstack/salt
salt/modules/bridge.py
_linux_brshow
def _linux_brshow(br=None): ''' Internal, returns bridges and enslaved interfaces (GNU/Linux - brctl) ''' brctl = _tool_path('brctl') if br: cmd = '{0} show {1}'.format(brctl, br) else: cmd = '{0} show'.format(brctl) brs = {} for line in __salt__['cmd.run'](cmd, python...
python
def _linux_brshow(br=None): ''' Internal, returns bridges and enslaved interfaces (GNU/Linux - brctl) ''' brctl = _tool_path('brctl') if br: cmd = '{0} show {1}'.format(brctl, br) else: cmd = '{0} show'.format(brctl) brs = {} for line in __salt__['cmd.run'](cmd, python...
[ "def", "_linux_brshow", "(", "br", "=", "None", ")", ":", "brctl", "=", "_tool_path", "(", "'brctl'", ")", "if", "br", ":", "cmd", "=", "'{0} show {1}'", ".", "format", "(", "brctl", ",", "br", ")", "else", ":", "cmd", "=", "'{0} show'", ".", "format...
Internal, returns bridges and enslaved interfaces (GNU/Linux - brctl)
[ "Internal", "returns", "bridges", "and", "enslaved", "interfaces", "(", "GNU", "/", "Linux", "-", "brctl", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L47-L91
train
saltstack/salt
salt/modules/bridge.py
_linux_bradd
def _linux_bradd(br): ''' Internal, creates the bridge ''' brctl = _tool_path('brctl') return __salt__['cmd.run']('{0} addbr {1}'.format(brctl, br), python_shell=False)
python
def _linux_bradd(br): ''' Internal, creates the bridge ''' brctl = _tool_path('brctl') return __salt__['cmd.run']('{0} addbr {1}'.format(brctl, br), python_shell=False)
[ "def", "_linux_bradd", "(", "br", ")", ":", "brctl", "=", "_tool_path", "(", "'brctl'", ")", "return", "__salt__", "[", "'cmd.run'", "]", "(", "'{0} addbr {1}'", ".", "format", "(", "brctl", ",", "br", ")", ",", "python_shell", "=", "False", ")" ]
Internal, creates the bridge
[ "Internal", "creates", "the", "bridge" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L94-L100
train
saltstack/salt
salt/modules/bridge.py
_linux_brdel
def _linux_brdel(br): ''' Internal, deletes the bridge ''' brctl = _tool_path('brctl') return __salt__['cmd.run']('{0} delbr {1}'.format(brctl, br), python_shell=False)
python
def _linux_brdel(br): ''' Internal, deletes the bridge ''' brctl = _tool_path('brctl') return __salt__['cmd.run']('{0} delbr {1}'.format(brctl, br), python_shell=False)
[ "def", "_linux_brdel", "(", "br", ")", ":", "brctl", "=", "_tool_path", "(", "'brctl'", ")", "return", "__salt__", "[", "'cmd.run'", "]", "(", "'{0} delbr {1}'", ".", "format", "(", "brctl", ",", "br", ")", ",", "python_shell", "=", "False", ")" ]
Internal, deletes the bridge
[ "Internal", "deletes", "the", "bridge" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L103-L109
train
saltstack/salt
salt/modules/bridge.py
_linux_delif
def _linux_delif(br, iface): ''' Internal, removes an interface from a bridge ''' brctl = _tool_path('brctl') return __salt__['cmd.run']('{0} delif {1} {2}'.format(brctl, br, iface), python_shell=False)
python
def _linux_delif(br, iface): ''' Internal, removes an interface from a bridge ''' brctl = _tool_path('brctl') return __salt__['cmd.run']('{0} delif {1} {2}'.format(brctl, br, iface), python_shell=False)
[ "def", "_linux_delif", "(", "br", ",", "iface", ")", ":", "brctl", "=", "_tool_path", "(", "'brctl'", ")", "return", "__salt__", "[", "'cmd.run'", "]", "(", "'{0} delif {1} {2}'", ".", "format", "(", "brctl", ",", "br", ",", "iface", ")", ",", "python_sh...
Internal, removes an interface from a bridge
[ "Internal", "removes", "an", "interface", "from", "a", "bridge" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L121-L127
train
saltstack/salt
salt/modules/bridge.py
_linux_stp
def _linux_stp(br, state): ''' Internal, sets STP state ''' brctl = _tool_path('brctl') return __salt__['cmd.run']('{0} stp {1} {2}'.format(brctl, br, state), python_shell=False)
python
def _linux_stp(br, state): ''' Internal, sets STP state ''' brctl = _tool_path('brctl') return __salt__['cmd.run']('{0} stp {1} {2}'.format(brctl, br, state), python_shell=False)
[ "def", "_linux_stp", "(", "br", ",", "state", ")", ":", "brctl", "=", "_tool_path", "(", "'brctl'", ")", "return", "__salt__", "[", "'cmd.run'", "]", "(", "'{0} stp {1} {2}'", ".", "format", "(", "brctl", ",", "br", ",", "state", ")", ",", "python_shell"...
Internal, sets STP state
[ "Internal", "sets", "STP", "state" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L130-L136
train
saltstack/salt
salt/modules/bridge.py
_bsd_brshow
def _bsd_brshow(br=None): ''' Internal, returns bridges and member interfaces (BSD-like: ifconfig) ''' if __grains__['kernel'] == 'NetBSD': return _netbsd_brshow(br) ifconfig = _tool_path('ifconfig') ifaces = {} if br: ifaces[br] = br else: cmd = '{0} -g bridge...
python
def _bsd_brshow(br=None): ''' Internal, returns bridges and member interfaces (BSD-like: ifconfig) ''' if __grains__['kernel'] == 'NetBSD': return _netbsd_brshow(br) ifconfig = _tool_path('ifconfig') ifaces = {} if br: ifaces[br] = br else: cmd = '{0} -g bridge...
[ "def", "_bsd_brshow", "(", "br", "=", "None", ")", ":", "if", "__grains__", "[", "'kernel'", "]", "==", "'NetBSD'", ":", "return", "_netbsd_brshow", "(", "br", ")", "ifconfig", "=", "_tool_path", "(", "'ifconfig'", ")", "ifaces", "=", "{", "}", "if", "...
Internal, returns bridges and member interfaces (BSD-like: ifconfig)
[ "Internal", "returns", "bridges", "and", "member", "interfaces", "(", "BSD", "-", "like", ":", "ifconfig", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L139-L174
train
saltstack/salt
salt/modules/bridge.py
_netbsd_brshow
def _netbsd_brshow(br=None): ''' Internal, returns bridges and enslaved interfaces (NetBSD - brconfig) ''' brconfig = _tool_path('brconfig') if br: cmd = '{0} {1}'.format(brconfig, br) else: cmd = '{0} -a'.format(brconfig) brs = {} start_int = False for line in __s...
python
def _netbsd_brshow(br=None): ''' Internal, returns bridges and enslaved interfaces (NetBSD - brconfig) ''' brconfig = _tool_path('brconfig') if br: cmd = '{0} {1}'.format(brconfig, br) else: cmd = '{0} -a'.format(brconfig) brs = {} start_int = False for line in __s...
[ "def", "_netbsd_brshow", "(", "br", "=", "None", ")", ":", "brconfig", "=", "_tool_path", "(", "'brconfig'", ")", "if", "br", ":", "cmd", "=", "'{0} {1}'", ".", "format", "(", "brconfig", ",", "br", ")", "else", ":", "cmd", "=", "'{0} -a'", ".", "for...
Internal, returns bridges and enslaved interfaces (NetBSD - brconfig)
[ "Internal", "returns", "bridges", "and", "enslaved", "interfaces", "(", "NetBSD", "-", "brconfig", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L177-L214
train
saltstack/salt
salt/modules/bridge.py
_bsd_bradd
def _bsd_bradd(br): ''' Internal, creates the bridge ''' kernel = __grains__['kernel'] ifconfig = _tool_path('ifconfig') if not br: return False if __salt__['cmd.retcode']('{0} {1} create up'.format(ifconfig, br), python_shell=False) != 0: ret...
python
def _bsd_bradd(br): ''' Internal, creates the bridge ''' kernel = __grains__['kernel'] ifconfig = _tool_path('ifconfig') if not br: return False if __salt__['cmd.retcode']('{0} {1} create up'.format(ifconfig, br), python_shell=False) != 0: ret...
[ "def", "_bsd_bradd", "(", "br", ")", ":", "kernel", "=", "__grains__", "[", "'kernel'", "]", "ifconfig", "=", "_tool_path", "(", "'ifconfig'", ")", "if", "not", "br", ":", "return", "False", "if", "__salt__", "[", "'cmd.retcode'", "]", "(", "'{0} {1} creat...
Internal, creates the bridge
[ "Internal", "creates", "the", "bridge" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L217-L238
train
saltstack/salt
salt/modules/bridge.py
_bsd_brdel
def _bsd_brdel(br): ''' Internal, deletes the bridge ''' ifconfig = _tool_path('ifconfig') if not br: return False return __salt__['cmd.run']('{0} {1} destroy'.format(ifconfig, br), python_shell=False)
python
def _bsd_brdel(br): ''' Internal, deletes the bridge ''' ifconfig = _tool_path('ifconfig') if not br: return False return __salt__['cmd.run']('{0} {1} destroy'.format(ifconfig, br), python_shell=False)
[ "def", "_bsd_brdel", "(", "br", ")", ":", "ifconfig", "=", "_tool_path", "(", "'ifconfig'", ")", "if", "not", "br", ":", "return", "False", "return", "__salt__", "[", "'cmd.run'", "]", "(", "'{0} {1} destroy'", ".", "format", "(", "ifconfig", ",", "br", ...
Internal, deletes the bridge
[ "Internal", "deletes", "the", "bridge" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L241-L249
train
saltstack/salt
salt/modules/bridge.py
_bsd_addif
def _bsd_addif(br, iface): ''' Internal, adds an interface to a bridge ''' kernel = __grains__['kernel'] if kernel == 'NetBSD': cmd = _tool_path('brconfig') brcmd = 'add' else: cmd = _tool_path('ifconfig') brcmd = 'addem' if not br or not iface: retur...
python
def _bsd_addif(br, iface): ''' Internal, adds an interface to a bridge ''' kernel = __grains__['kernel'] if kernel == 'NetBSD': cmd = _tool_path('brconfig') brcmd = 'add' else: cmd = _tool_path('ifconfig') brcmd = 'addem' if not br or not iface: retur...
[ "def", "_bsd_addif", "(", "br", ",", "iface", ")", ":", "kernel", "=", "__grains__", "[", "'kernel'", "]", "if", "kernel", "==", "'NetBSD'", ":", "cmd", "=", "_tool_path", "(", "'brconfig'", ")", "brcmd", "=", "'add'", "else", ":", "cmd", "=", "_tool_p...
Internal, adds an interface to a bridge
[ "Internal", "adds", "an", "interface", "to", "a", "bridge" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L252-L268
train
saltstack/salt
salt/modules/bridge.py
_bsd_stp
def _bsd_stp(br, state, iface): ''' Internal, sets STP state. On BSD-like, it is required to specify the STP physical interface ''' kernel = __grains__['kernel'] if kernel == 'NetBSD': cmd = _tool_path('brconfig') else: cmd = _tool_path('ifconfig') if not br or not iface...
python
def _bsd_stp(br, state, iface): ''' Internal, sets STP state. On BSD-like, it is required to specify the STP physical interface ''' kernel = __grains__['kernel'] if kernel == 'NetBSD': cmd = _tool_path('brconfig') else: cmd = _tool_path('ifconfig') if not br or not iface...
[ "def", "_bsd_stp", "(", "br", ",", "state", ",", "iface", ")", ":", "kernel", "=", "__grains__", "[", "'kernel'", "]", "if", "kernel", "==", "'NetBSD'", ":", "cmd", "=", "_tool_path", "(", "'brconfig'", ")", "else", ":", "cmd", "=", "_tool_path", "(", ...
Internal, sets STP state. On BSD-like, it is required to specify the STP physical interface
[ "Internal", "sets", "STP", "state", ".", "On", "BSD", "-", "like", "it", "is", "required", "to", "specify", "the", "STP", "physical", "interface" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L290-L305
train
saltstack/salt
salt/modules/bridge.py
_os_dispatch
def _os_dispatch(func, *args, **kwargs): ''' Internal, dispatches functions by operating system ''' if __grains__['kernel'] in SUPPORTED_BSD_LIKE: kernel = 'bsd' else: kernel = __grains__['kernel'].lower() _os_func = getattr(sys.modules[__name__], '_{0}_{1}'.format(kernel, func)...
python
def _os_dispatch(func, *args, **kwargs): ''' Internal, dispatches functions by operating system ''' if __grains__['kernel'] in SUPPORTED_BSD_LIKE: kernel = 'bsd' else: kernel = __grains__['kernel'].lower() _os_func = getattr(sys.modules[__name__], '_{0}_{1}'.format(kernel, func)...
[ "def", "_os_dispatch", "(", "func", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "if", "__grains__", "[", "'kernel'", "]", "in", "SUPPORTED_BSD_LIKE", ":", "kernel", "=", "'bsd'", "else", ":", "kernel", "=", "__grains__", "[", "'kernel'", "]", ...
Internal, dispatches functions by operating system
[ "Internal", "dispatches", "functions", "by", "operating", "system" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L308-L320
train
saltstack/salt
salt/modules/bridge.py
list_
def list_(): ''' Returns the machine's bridges list CLI Example: .. code-block:: bash salt '*' bridge.list ''' brs = _os_dispatch('brshow') if not brs: return None brlist = [] for br in brs: brlist.append(br) return brlist
python
def list_(): ''' Returns the machine's bridges list CLI Example: .. code-block:: bash salt '*' bridge.list ''' brs = _os_dispatch('brshow') if not brs: return None brlist = [] for br in brs: brlist.append(br) return brlist
[ "def", "list_", "(", ")", ":", "brs", "=", "_os_dispatch", "(", "'brshow'", ")", "if", "not", "brs", ":", "return", "None", "brlist", "=", "[", "]", "for", "br", "in", "brs", ":", "brlist", ".", "append", "(", "br", ")", "return", "brlist" ]
Returns the machine's bridges list CLI Example: .. code-block:: bash salt '*' bridge.list
[ "Returns", "the", "machine", "s", "bridges", "list" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L342-L359
train
saltstack/salt
salt/modules/bridge.py
find_interfaces
def find_interfaces(*args): ''' Returns the bridge to which the interfaces are bond to CLI Example: .. code-block:: bash salt '*' bridge.find_interfaces eth0 [eth1...] ''' brs = _os_dispatch('brshow') if not brs: return None iflist = {} for iface in args: ...
python
def find_interfaces(*args): ''' Returns the bridge to which the interfaces are bond to CLI Example: .. code-block:: bash salt '*' bridge.find_interfaces eth0 [eth1...] ''' brs = _os_dispatch('brshow') if not brs: return None iflist = {} for iface in args: ...
[ "def", "find_interfaces", "(", "*", "args", ")", ":", "brs", "=", "_os_dispatch", "(", "'brshow'", ")", "if", "not", "brs", ":", "return", "None", "iflist", "=", "{", "}", "for", "iface", "in", "args", ":", "for", "br", "in", "brs", ":", "try", ":"...
Returns the bridge to which the interfaces are bond to CLI Example: .. code-block:: bash salt '*' bridge.find_interfaces eth0 [eth1...]
[ "Returns", "the", "bridge", "to", "which", "the", "interfaces", "are", "bond", "to" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L380-L404
train
saltstack/salt
salt/modules/bridge.py
stp
def stp(br=None, state='disable', iface=None): ''' Sets Spanning Tree Protocol state for a bridge CLI Example: .. code-block:: bash salt '*' bridge.stp br0 enable salt '*' bridge.stp br0 disable For BSD-like operating systems, it is required to add the interface on which to e...
python
def stp(br=None, state='disable', iface=None): ''' Sets Spanning Tree Protocol state for a bridge CLI Example: .. code-block:: bash salt '*' bridge.stp br0 enable salt '*' bridge.stp br0 disable For BSD-like operating systems, it is required to add the interface on which to e...
[ "def", "stp", "(", "br", "=", "None", ",", "state", "=", "'disable'", ",", "iface", "=", "None", ")", ":", "kernel", "=", "__grains__", "[", "'kernel'", "]", "if", "kernel", "==", "'Linux'", ":", "states", "=", "{", "'enable'", ":", "'on'", ",", "'...
Sets Spanning Tree Protocol state for a bridge CLI Example: .. code-block:: bash salt '*' bridge.stp br0 enable salt '*' bridge.stp br0 disable For BSD-like operating systems, it is required to add the interface on which to enable the STP. CLI Example: .. code-block:: bash ...
[ "Sets", "Spanning", "Tree", "Protocol", "state", "for", "a", "bridge" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bridge.py#L459-L488
train
saltstack/salt
salt/utils/decorators/state.py
OutputUnifier.content_check
def content_check(self, result): ''' Checks for specific types in the state output. Raises an Exception in case particular rule is broken. :param result: :return: ''' if not isinstance(result, dict): err_msg = 'Malformed state return. Data must be a d...
python
def content_check(self, result): ''' Checks for specific types in the state output. Raises an Exception in case particular rule is broken. :param result: :return: ''' if not isinstance(result, dict): err_msg = 'Malformed state return. Data must be a d...
[ "def", "content_check", "(", "self", ",", "result", ")", ":", "if", "not", "isinstance", "(", "result", ",", "dict", ")", ":", "err_msg", "=", "'Malformed state return. Data must be a dictionary type.'", "elif", "not", "isinstance", "(", "result", ".", "get", "(...
Checks for specific types in the state output. Raises an Exception in case particular rule is broken. :param result: :return:
[ "Checks", "for", "specific", "types", "in", "the", "state", "output", ".", "Raises", "an", "Exception", "in", "case", "particular", "rule", "is", "broken", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/decorators/state.py#L48-L73
train
saltstack/salt
salt/utils/decorators/state.py
OutputUnifier.unify
def unify(self, result): ''' While comments as a list are allowed, comments needs to be strings for backward compatibility. See such claim here: https://github.com/saltstack/salt/pull/43070 Rules applied: - 'comment' is joined into a multi-line string, in case the valu...
python
def unify(self, result): ''' While comments as a list are allowed, comments needs to be strings for backward compatibility. See such claim here: https://github.com/saltstack/salt/pull/43070 Rules applied: - 'comment' is joined into a multi-line string, in case the valu...
[ "def", "unify", "(", "self", ",", "result", ")", ":", "if", "isinstance", "(", "result", ".", "get", "(", "'comment'", ")", ",", "list", ")", ":", "result", "[", "'comment'", "]", "=", "u'\\n'", ".", "join", "(", "[", "salt", ".", "utils", ".", "...
While comments as a list are allowed, comments needs to be strings for backward compatibility. See such claim here: https://github.com/saltstack/salt/pull/43070 Rules applied: - 'comment' is joined into a multi-line string, in case the value is a list. - 'result' should be a...
[ "While", "comments", "as", "a", "list", "are", "allowed", "comments", "needs", "to", "be", "strings", "for", "backward", "compatibility", ".", "See", "such", "claim", "here", ":", "https", ":", "//", "github", ".", "com", "/", "saltstack", "/", "salt", "...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/decorators/state.py#L75-L95
train
saltstack/salt
salt/modules/mac_xattr.py
list_
def list_(path, **kwargs): ''' List all of the extended attributes on the given file/directory :param str path: The file(s) to get attributes from :param bool hex: Return the values with forced hexadecimal values :return: A dictionary containing extended attributes and values for the give...
python
def list_(path, **kwargs): ''' List all of the extended attributes on the given file/directory :param str path: The file(s) to get attributes from :param bool hex: Return the values with forced hexadecimal values :return: A dictionary containing extended attributes and values for the give...
[ "def", "list_", "(", "path", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "kwargs", ")", "hex_", "=", "kwargs", ".", "pop", "(", "'hex'", ",", "False", ")", "if", "kwargs...
List all of the extended attributes on the given file/directory :param str path: The file(s) to get attributes from :param bool hex: Return the values with forced hexadecimal values :return: A dictionary containing extended attributes and values for the given file :rtype: dict :raises: C...
[ "List", "all", "of", "the", "extended", "attributes", "on", "the", "given", "file", "/", "directory" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_xattr.py#L36-L79
train
saltstack/salt
salt/modules/mac_xattr.py
read
def read(path, attribute, **kwargs): ''' Read the given attributes on the given file/directory :param str path: The file to get attributes from :param str attribute: The attribute to read :param bool hex: Return the values with forced hexadecimal values :return: A string containing the value...
python
def read(path, attribute, **kwargs): ''' Read the given attributes on the given file/directory :param str path: The file to get attributes from :param str attribute: The attribute to read :param bool hex: Return the values with forced hexadecimal values :return: A string containing the value...
[ "def", "read", "(", "path", ",", "attribute", ",", "*", "*", "kwargs", ")", ":", "kwargs", "=", "salt", ".", "utils", ".", "args", ".", "clean_kwargs", "(", "*", "*", "kwargs", ")", "hex_", "=", "kwargs", ".", "pop", "(", "'hex'", ",", "False", "...
Read the given attributes on the given file/directory :param str path: The file to get attributes from :param str attribute: The attribute to read :param bool hex: Return the values with forced hexadecimal values :return: A string containing the value of the named attribute :rtype: str :rai...
[ "Read", "the", "given", "attributes", "on", "the", "given", "file", "/", "directory" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_xattr.py#L82-L124
train
saltstack/salt
salt/modules/mac_xattr.py
delete
def delete(path, attribute): ''' Removes the given attribute from the file :param str path: The file(s) to get attributes from :param str attribute: The attribute name to be deleted from the file/directory :return: True if successful, otherwise False :rtype: bool :raises: Command...
python
def delete(path, attribute): ''' Removes the given attribute from the file :param str path: The file(s) to get attributes from :param str attribute: The attribute name to be deleted from the file/directory :return: True if successful, otherwise False :rtype: bool :raises: Command...
[ "def", "delete", "(", "path", ",", "attribute", ")", ":", "cmd", "=", "'xattr -d \"{0}\" \"{1}\"'", ".", "format", "(", "attribute", ",", "path", ")", "try", ":", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_success", "(", "cmd", ")", "exce...
Removes the given attribute from the file :param str path: The file(s) to get attributes from :param str attribute: The attribute name to be deleted from the file/directory :return: True if successful, otherwise False :rtype: bool :raises: CommandExecutionError on file not found, attribu...
[ "Removes", "the", "given", "attribute", "from", "the", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_xattr.py#L171-L202
train
saltstack/salt
salt/modules/mac_xattr.py
clear
def clear(path): ''' Causes the all attributes on the file/directory to be removed :param str path: The file(s) to get attributes from :return: True if successful, otherwise False :raises: CommandExecutionError on file not found or any other unknown error CLI Example: .. code-block:: ba...
python
def clear(path): ''' Causes the all attributes on the file/directory to be removed :param str path: The file(s) to get attributes from :return: True if successful, otherwise False :raises: CommandExecutionError on file not found or any other unknown error CLI Example: .. code-block:: ba...
[ "def", "clear", "(", "path", ")", ":", "cmd", "=", "'xattr -c \"{0}\"'", ".", "format", "(", "path", ")", "try", ":", "salt", ".", "utils", ".", "mac_utils", ".", "execute_return_success", "(", "cmd", ")", "except", "CommandExecutionError", "as", "exc", ":...
Causes the all attributes on the file/directory to be removed :param str path: The file(s) to get attributes from :return: True if successful, otherwise False :raises: CommandExecutionError on file not found or any other unknown error CLI Example: .. code-block:: bash salt '*' xattr.de...
[ "Causes", "the", "all", "attributes", "on", "the", "file", "/", "directory", "to", "be", "removed" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_xattr.py#L205-L229
train
saltstack/salt
salt/modules/rallydev.py
_get_token
def _get_token(): ''' Get an auth token ''' username = __opts__.get('rallydev', {}).get('username', None) password = __opts__.get('rallydev', {}).get('password', None) path = 'https://rally1.rallydev.com/slm/webservice/v2.0/security/authorize' result = salt.utils.http.query( path, ...
python
def _get_token(): ''' Get an auth token ''' username = __opts__.get('rallydev', {}).get('username', None) password = __opts__.get('rallydev', {}).get('password', None) path = 'https://rally1.rallydev.com/slm/webservice/v2.0/security/authorize' result = salt.utils.http.query( path, ...
[ "def", "_get_token", "(", ")", ":", "username", "=", "__opts__", ".", "get", "(", "'rallydev'", ",", "{", "}", ")", ".", "get", "(", "'username'", ",", "None", ")", "password", "=", "__opts__", ".", "get", "(", "'rallydev'", ",", "{", "}", ")", "."...
Get an auth token
[ "Get", "an", "auth", "token" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rallydev.py#L39-L61
train
saltstack/salt
salt/modules/rallydev.py
_query
def _query(action=None, command=None, args=None, method='GET', header_dict=None, data=None): ''' Make a web call to RallyDev. ''' token = _get_token() username = __opts__.get('rallydev', {}).get('username', None) password = __opts__.get('ral...
python
def _query(action=None, command=None, args=None, method='GET', header_dict=None, data=None): ''' Make a web call to RallyDev. ''' token = _get_token() username = __opts__.get('rallydev', {}).get('username', None) password = __opts__.get('ral...
[ "def", "_query", "(", "action", "=", "None", ",", "command", "=", "None", ",", "args", "=", "None", ",", "method", "=", "'GET'", ",", "header_dict", "=", "None", ",", "data", "=", "None", ")", ":", "token", "=", "_get_token", "(", ")", "username", ...
Make a web call to RallyDev.
[ "Make", "a", "web", "call", "to", "RallyDev", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rallydev.py#L64-L123
train
saltstack/salt
salt/modules/rallydev.py
query_item
def query_item(name, query_string, order='Rank'): ''' Query a type of record for one or more items. Requires a valid query string. See https://rally1.rallydev.com/slm/doc/webservice/introduction.jsp for information on query syntax. CLI Example: .. code-block:: bash salt myminion rally...
python
def query_item(name, query_string, order='Rank'): ''' Query a type of record for one or more items. Requires a valid query string. See https://rally1.rallydev.com/slm/doc/webservice/introduction.jsp for information on query syntax. CLI Example: .. code-block:: bash salt myminion rally...
[ "def", "query_item", "(", "name", ",", "query_string", ",", "order", "=", "'Rank'", ")", ":", "status", ",", "result", "=", "_query", "(", "action", "=", "name", ",", "args", "=", "{", "'query'", ":", "query_string", ",", "'order'", ":", "order", "}", ...
Query a type of record for one or more items. Requires a valid query string. See https://rally1.rallydev.com/slm/doc/webservice/introduction.jsp for information on query syntax. CLI Example: .. code-block:: bash salt myminion rallydev.query_<item name> <query string> [<order>] salt my...
[ "Query", "a", "type", "of", "record", "for", "one", "or", "more", "items", ".", "Requires", "a", "valid", "query", "string", ".", "See", "https", ":", "//", "rally1", ".", "rallydev", ".", "com", "/", "slm", "/", "doc", "/", "webservice", "/", "intro...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rallydev.py#L142-L161
train
saltstack/salt
salt/modules/rallydev.py
show_item
def show_item(name, id_): ''' Show an item CLI Example: .. code-block:: bash salt myminion rallydev.show_<item name> <item id> ''' status, result = _query(action=name, command=id_) return result
python
def show_item(name, id_): ''' Show an item CLI Example: .. code-block:: bash salt myminion rallydev.show_<item name> <item id> ''' status, result = _query(action=name, command=id_) return result
[ "def", "show_item", "(", "name", ",", "id_", ")", ":", "status", ",", "result", "=", "_query", "(", "action", "=", "name", ",", "command", "=", "id_", ")", "return", "result" ]
Show an item CLI Example: .. code-block:: bash salt myminion rallydev.show_<item name> <item id>
[ "Show", "an", "item" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rallydev.py#L164-L175
train
saltstack/salt
salt/modules/rallydev.py
update_item
def update_item(name, id_, field=None, value=None, postdata=None): ''' Update an item. Either a field and a value, or a chunk of POST data, may be used, but not both. CLI Example: .. code-block:: bash salt myminion rallydev.update_<item name> <item id> field=<field> value=<value> ...
python
def update_item(name, id_, field=None, value=None, postdata=None): ''' Update an item. Either a field and a value, or a chunk of POST data, may be used, but not both. CLI Example: .. code-block:: bash salt myminion rallydev.update_<item name> <item id> field=<field> value=<value> ...
[ "def", "update_item", "(", "name", ",", "id_", ",", "field", "=", "None", ",", "value", "=", "None", ",", "postdata", "=", "None", ")", ":", "if", "field", "and", "value", ":", "if", "postdata", ":", "raise", "SaltInvocationError", "(", "'Either a field ...
Update an item. Either a field and a value, or a chunk of POST data, may be used, but not both. CLI Example: .. code-block:: bash salt myminion rallydev.update_<item name> <item id> field=<field> value=<value> salt myminion rallydev.update_<item name> <item id> postdata=<post data>
[ "Update", "an", "item", ".", "Either", "a", "field", "and", "a", "value", "or", "a", "chunk", "of", "POST", "data", "may", "be", "used", "but", "not", "both", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rallydev.py#L178-L207
train
saltstack/salt
salt/_compat.py
text_
def text_(s, encoding='latin-1', errors='strict'): ''' If ``s`` is an instance of ``binary_type``, return ``s.decode(encoding, errors)``, otherwise return ``s`` ''' return s.decode(encoding, errors) if isinstance(s, binary_type) else s
python
def text_(s, encoding='latin-1', errors='strict'): ''' If ``s`` is an instance of ``binary_type``, return ``s.decode(encoding, errors)``, otherwise return ``s`` ''' return s.decode(encoding, errors) if isinstance(s, binary_type) else s
[ "def", "text_", "(", "s", ",", "encoding", "=", "'latin-1'", ",", "errors", "=", "'strict'", ")", ":", "return", "s", ".", "decode", "(", "encoding", ",", "errors", ")", "if", "isinstance", "(", "s", ",", "binary_type", ")", "else", "s" ]
If ``s`` is an instance of ``binary_type``, return ``s.decode(encoding, errors)``, otherwise return ``s``
[ "If", "s", "is", "an", "instance", "of", "binary_type", "return", "s", ".", "decode", "(", "encoding", "errors", ")", "otherwise", "return", "s" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/_compat.py#L60-L65
train
saltstack/salt
salt/_compat.py
ascii_native_
def ascii_native_(s): ''' Python 3: If ``s`` is an instance of ``text_type``, return ``s.encode('ascii')``, otherwise return ``str(s, 'ascii', 'strict')`` Python 2: If ``s`` is an instance of ``text_type``, return ``s.encode('ascii')``, otherwise return ``str(s)`` ''' if isinstance(s, text_...
python
def ascii_native_(s): ''' Python 3: If ``s`` is an instance of ``text_type``, return ``s.encode('ascii')``, otherwise return ``str(s, 'ascii', 'strict')`` Python 2: If ``s`` is an instance of ``text_type``, return ``s.encode('ascii')``, otherwise return ``str(s)`` ''' if isinstance(s, text_...
[ "def", "ascii_native_", "(", "s", ")", ":", "if", "isinstance", "(", "s", ",", "text_type", ")", ":", "s", "=", "s", ".", "encode", "(", "'ascii'", ")", "return", "str", "(", "s", ",", "'ascii'", ",", "'strict'", ")", "if", "PY3", "else", "s" ]
Python 3: If ``s`` is an instance of ``text_type``, return ``s.encode('ascii')``, otherwise return ``str(s, 'ascii', 'strict')`` Python 2: If ``s`` is an instance of ``text_type``, return ``s.encode('ascii')``, otherwise return ``str(s)``
[ "Python", "3", ":", "If", "s", "is", "an", "instance", "of", "text_type", "return", "s", ".", "encode", "(", "ascii", ")", "otherwise", "return", "str", "(", "s", "ascii", "strict", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/_compat.py#L76-L87
train
saltstack/salt
salt/_compat.py
native_
def native_(s, encoding='latin-1', errors='strict'): ''' Python 3: If ``s`` is an instance of ``text_type``, return ``s``, otherwise return ``str(s, encoding, errors)`` Python 2: If ``s`` is an instance of ``text_type``, return ``s.encode(encoding, errors)``, otherwise return ``str(s)`` ''' ...
python
def native_(s, encoding='latin-1', errors='strict'): ''' Python 3: If ``s`` is an instance of ``text_type``, return ``s``, otherwise return ``str(s, encoding, errors)`` Python 2: If ``s`` is an instance of ``text_type``, return ``s.encode(encoding, errors)``, otherwise return ``str(s)`` ''' ...
[ "def", "native_", "(", "s", ",", "encoding", "=", "'latin-1'", ",", "errors", "=", "'strict'", ")", ":", "if", "PY3", ":", "out", "=", "s", "if", "isinstance", "(", "s", ",", "text_type", ")", "else", "str", "(", "s", ",", "encoding", ",", "errors"...
Python 3: If ``s`` is an instance of ``text_type``, return ``s``, otherwise return ``str(s, encoding, errors)`` Python 2: If ``s`` is an instance of ``text_type``, return ``s.encode(encoding, errors)``, otherwise return ``str(s)``
[ "Python", "3", ":", "If", "s", "is", "an", "instance", "of", "text_type", "return", "s", "otherwise", "return", "str", "(", "s", "encoding", "errors", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/_compat.py#L90-L103
train
saltstack/salt
salt/_compat.py
IPv6AddressScoped._is_packed_binary
def _is_packed_binary(self, data): ''' Check if data is hexadecimal packed :param data: :return: ''' packed = False if isinstance(data, bytes) and len(data) == 16 and b':' not in data: try: packed = bool(int(binascii.hexlify(data), 16)...
python
def _is_packed_binary(self, data): ''' Check if data is hexadecimal packed :param data: :return: ''' packed = False if isinstance(data, bytes) and len(data) == 16 and b':' not in data: try: packed = bool(int(binascii.hexlify(data), 16)...
[ "def", "_is_packed_binary", "(", "self", ",", "data", ")", ":", "packed", "=", "False", "if", "isinstance", "(", "data", ",", "bytes", ")", "and", "len", "(", "data", ")", "==", "16", "and", "b':'", "not", "in", "data", ":", "try", ":", "packed", "...
Check if data is hexadecimal packed :param data: :return:
[ "Check", "if", "data", "is", "hexadecimal", "packed" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/_compat.py#L183-L197
train
saltstack/salt
salt/modules/win_iis.py
_get_binding_info
def _get_binding_info(host_header='', ip_address='*', port=80): ''' Combine the host header, IP address, and TCP port into bindingInformation format. Binding Information specifies information to communicate with a site. It includes the IP address, the port number, and an optional host header (usuall...
python
def _get_binding_info(host_header='', ip_address='*', port=80): ''' Combine the host header, IP address, and TCP port into bindingInformation format. Binding Information specifies information to communicate with a site. It includes the IP address, the port number, and an optional host header (usuall...
[ "def", "_get_binding_info", "(", "host_header", "=", "''", ",", "ip_address", "=", "'*'", ",", "port", "=", "80", ")", ":", "return", "':'", ".", "join", "(", "[", "ip_address", ",", "six", ".", "text_type", "(", "port", ")", ",", "host_header", ".", ...
Combine the host header, IP address, and TCP port into bindingInformation format. Binding Information specifies information to communicate with a site. It includes the IP address, the port number, and an optional host header (usually a host name) to communicate with the site. Args: host_header ...
[ "Combine", "the", "host", "header", "IP", "address", "and", "TCP", "port", "into", "bindingInformation", "format", ".", "Binding", "Information", "specifies", "information", "to", "communicate", "with", "a", "site", ".", "It", "includes", "the", "IP", "address",...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L56-L73
train
saltstack/salt
salt/modules/win_iis.py
_list_certs
def _list_certs(certificate_store='My'): ''' List details of available certificates in the LocalMachine certificate store. Args: certificate_store (str): The name of the certificate store on the local machine. Returns: dict: A dictionary of certificates found in the sto...
python
def _list_certs(certificate_store='My'): ''' List details of available certificates in the LocalMachine certificate store. Args: certificate_store (str): The name of the certificate store on the local machine. Returns: dict: A dictionary of certificates found in the sto...
[ "def", "_list_certs", "(", "certificate_store", "=", "'My'", ")", ":", "ret", "=", "dict", "(", ")", "blacklist_keys", "=", "[", "'DnsNameList'", ",", "'Thumbprint'", "]", "ps_cmd", "=", "[", "'Get-ChildItem'", ",", "'-Path'", ",", "r\"'Cert:\\LocalMachine\\{0}'...
List details of available certificates in the LocalMachine certificate store. Args: certificate_store (str): The name of the certificate store on the local machine. Returns: dict: A dictionary of certificates found in the store
[ "List", "details", "of", "available", "certificates", "in", "the", "LocalMachine", "certificate", "store", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L76-L116
train
saltstack/salt
salt/modules/win_iis.py
_srvmgr
def _srvmgr(cmd, return_json=False): ''' Execute a powershell command from the WebAdministration PS module. Args: cmd (list): The command to execute in a list return_json (bool): True formats the return in JSON, False just returns the output of the command. Returns: ...
python
def _srvmgr(cmd, return_json=False): ''' Execute a powershell command from the WebAdministration PS module. Args: cmd (list): The command to execute in a list return_json (bool): True formats the return in JSON, False just returns the output of the command. Returns: ...
[ "def", "_srvmgr", "(", "cmd", ",", "return_json", "=", "False", ")", ":", "if", "isinstance", "(", "cmd", ",", "list", ")", ":", "cmd", "=", "' '", ".", "join", "(", "cmd", ")", "if", "return_json", ":", "cmd", "=", "'ConvertTo-Json -Compress -Depth 4 -I...
Execute a powershell command from the WebAdministration PS module. Args: cmd (list): The command to execute in a list return_json (bool): True formats the return in JSON, False just returns the output of the command. Returns: str: The output from the command
[ "Execute", "a", "powershell", "command", "from", "the", "WebAdministration", "PS", "module", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L135-L163
train
saltstack/salt
salt/modules/win_iis.py
_collection_match_to_index
def _collection_match_to_index(pspath, colfilter, name, match): ''' Returns index of collection item matching the match dictionary. ''' collection = get_webconfiguration_settings(pspath, [{'name': name, 'filter': colfilter}])[0]['value'] for idx, collect_dict in enumerate(collection): if all...
python
def _collection_match_to_index(pspath, colfilter, name, match): ''' Returns index of collection item matching the match dictionary. ''' collection = get_webconfiguration_settings(pspath, [{'name': name, 'filter': colfilter}])[0]['value'] for idx, collect_dict in enumerate(collection): if all...
[ "def", "_collection_match_to_index", "(", "pspath", ",", "colfilter", ",", "name", ",", "match", ")", ":", "collection", "=", "get_webconfiguration_settings", "(", "pspath", ",", "[", "{", "'name'", ":", "name", ",", "'filter'", ":", "colfilter", "}", "]", "...
Returns index of collection item matching the match dictionary.
[ "Returns", "index", "of", "collection", "item", "matching", "the", "match", "dictionary", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L166-L174
train
saltstack/salt
salt/modules/win_iis.py
_prepare_settings
def _prepare_settings(pspath, settings): ''' Prepare settings before execution with get or set functions. Removes settings with a match parameter when index is not found. ''' prepared_settings = [] for setting in settings: match = re.search(r'Collection\[(\{.*\})\]', setting['name']) ...
python
def _prepare_settings(pspath, settings): ''' Prepare settings before execution with get or set functions. Removes settings with a match parameter when index is not found. ''' prepared_settings = [] for setting in settings: match = re.search(r'Collection\[(\{.*\})\]', setting['name']) ...
[ "def", "_prepare_settings", "(", "pspath", ",", "settings", ")", ":", "prepared_settings", "=", "[", "]", "for", "setting", "in", "settings", ":", "match", "=", "re", ".", "search", "(", "r'Collection\\[(\\{.*\\})\\]'", ",", "setting", "[", "'name'", "]", ")...
Prepare settings before execution with get or set functions. Removes settings with a match parameter when index is not found.
[ "Prepare", "settings", "before", "execution", "with", "get", "or", "set", "functions", ".", "Removes", "settings", "with", "a", "match", "parameter", "when", "index", "is", "not", "found", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L177-L194
train
saltstack/salt
salt/modules/win_iis.py
list_sites
def list_sites(): ''' List all the currently deployed websites. Returns: dict: A dictionary of the IIS sites and their properties. CLI Example: .. code-block:: bash salt '*' win_iis.list_sites ''' ret = dict() ps_cmd = ['Get-ChildItem', '-Path', r"'IIS:\...
python
def list_sites(): ''' List all the currently deployed websites. Returns: dict: A dictionary of the IIS sites and their properties. CLI Example: .. code-block:: bash salt '*' win_iis.list_sites ''' ret = dict() ps_cmd = ['Get-ChildItem', '-Path', r"'IIS:\...
[ "def", "list_sites", "(", ")", ":", "ret", "=", "dict", "(", ")", "ps_cmd", "=", "[", "'Get-ChildItem'", ",", "'-Path'", ",", "r\"'IIS:\\Sites'\"", ",", "'|'", ",", "'Select-Object applicationPool, applicationDefaults, Bindings, ID, Name, PhysicalPath, State'", "]", "ke...
List all the currently deployed websites. Returns: dict: A dictionary of the IIS sites and their properties. CLI Example: .. code-block:: bash salt '*' win_iis.list_sites
[ "List", "all", "the", "currently", "deployed", "websites", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L197-L264
train
saltstack/salt
salt/modules/win_iis.py
create_site
def create_site(name, sourcepath, apppool='', hostheader='', ipaddress='*', port=80, protocol='http', preload=''): ''' Create a basic website in IIS. .. note:: This function only validates against the site name, and will return True even if the site already exists with a di...
python
def create_site(name, sourcepath, apppool='', hostheader='', ipaddress='*', port=80, protocol='http', preload=''): ''' Create a basic website in IIS. .. note:: This function only validates against the site name, and will return True even if the site already exists with a di...
[ "def", "create_site", "(", "name", ",", "sourcepath", ",", "apppool", "=", "''", ",", "hostheader", "=", "''", ",", "ipaddress", "=", "'*'", ",", "port", "=", "80", ",", "protocol", "=", "'http'", ",", "preload", "=", "''", ")", ":", "protocol", "=",...
Create a basic website in IIS. .. note:: This function only validates against the site name, and will return True even if the site already exists with a different configuration. It will not modify the configuration of an existing site. Args: name (str): The IIS site name. ...
[ "Create", "a", "basic", "website", "in", "IIS", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L267-L351
train
saltstack/salt
salt/modules/win_iis.py
modify_site
def modify_site(name, sourcepath=None, apppool=None, preload=None): ''' Modify a basic website in IIS. .. versionadded:: 2017.7.0 Args: name (str): The IIS site name. sourcepath (str): The physical path of the IIS site. apppool (str): The name of the IIS application pool. ...
python
def modify_site(name, sourcepath=None, apppool=None, preload=None): ''' Modify a basic website in IIS. .. versionadded:: 2017.7.0 Args: name (str): The IIS site name. sourcepath (str): The physical path of the IIS site. apppool (str): The name of the IIS application pool. ...
[ "def", "modify_site", "(", "name", ",", "sourcepath", "=", "None", ",", "apppool", "=", "None", ",", "preload", "=", "None", ")", ":", "site_path", "=", "r'IIS:\\Sites\\{0}'", ".", "format", "(", "name", ")", "current_sites", "=", "list_sites", "(", ")", ...
Modify a basic website in IIS. .. versionadded:: 2017.7.0 Args: name (str): The IIS site name. sourcepath (str): The physical path of the IIS site. apppool (str): The name of the IIS application pool. preload (bool): Whether preloading should be enabled Returns: bo...
[ "Modify", "a", "basic", "website", "in", "IIS", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L354-L426
train
saltstack/salt
salt/modules/win_iis.py
remove_site
def remove_site(name): ''' Delete a website from IIS. Args: name (str): The IIS site name. Returns: bool: True if successful, otherwise False .. note:: This will not remove the application pool used by the site. CLI Example: .. code-block:: bash salt '*...
python
def remove_site(name): ''' Delete a website from IIS. Args: name (str): The IIS site name. Returns: bool: True if successful, otherwise False .. note:: This will not remove the application pool used by the site. CLI Example: .. code-block:: bash salt '*...
[ "def", "remove_site", "(", "name", ")", ":", "current_sites", "=", "list_sites", "(", ")", "if", "name", "not", "in", "current_sites", ":", "log", ".", "debug", "(", "'Site already absent: %s'", ",", "name", ")", "return", "True", "ps_cmd", "=", "[", "'Rem...
Delete a website from IIS. Args: name (str): The IIS site name. Returns: bool: True if successful, otherwise False .. note:: This will not remove the application pool used by the site. CLI Example: .. code-block:: bash salt '*' win_iis.remove_site name='My Test...
[ "Delete", "a", "website", "from", "IIS", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L429-L466
train
saltstack/salt
salt/modules/win_iis.py
stop_site
def stop_site(name): ''' Stop a Web Site in IIS. .. versionadded:: 2017.7.0 Args: name (str): The name of the website to stop. Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.stop_site name='My Test Site' ...
python
def stop_site(name): ''' Stop a Web Site in IIS. .. versionadded:: 2017.7.0 Args: name (str): The name of the website to stop. Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.stop_site name='My Test Site' ...
[ "def", "stop_site", "(", "name", ")", ":", "ps_cmd", "=", "[", "'Stop-WebSite'", ",", "r\"'{0}'\"", ".", "format", "(", "name", ")", "]", "cmd_ret", "=", "_srvmgr", "(", "ps_cmd", ")", "return", "cmd_ret", "[", "'retcode'", "]", "==", "0" ]
Stop a Web Site in IIS. .. versionadded:: 2017.7.0 Args: name (str): The name of the website to stop. Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.stop_site name='My Test Site'
[ "Stop", "a", "Web", "Site", "in", "IIS", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L469-L491
train
saltstack/salt
salt/modules/win_iis.py
start_site
def start_site(name): ''' Start a Web Site in IIS. .. versionadded:: 2017.7.0 Args: name (str): The name of the website to start. Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.start_site name='My Test Site'...
python
def start_site(name): ''' Start a Web Site in IIS. .. versionadded:: 2017.7.0 Args: name (str): The name of the website to start. Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.start_site name='My Test Site'...
[ "def", "start_site", "(", "name", ")", ":", "ps_cmd", "=", "[", "'Start-WebSite'", ",", "r\"'{0}'\"", ".", "format", "(", "name", ")", "]", "cmd_ret", "=", "_srvmgr", "(", "ps_cmd", ")", "return", "cmd_ret", "[", "'retcode'", "]", "==", "0" ]
Start a Web Site in IIS. .. versionadded:: 2017.7.0 Args: name (str): The name of the website to start. Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.start_site name='My Test Site'
[ "Start", "a", "Web", "Site", "in", "IIS", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L494-L516
train
saltstack/salt
salt/modules/win_iis.py
list_bindings
def list_bindings(site): ''' Get all configured IIS bindings for the specified site. Args: site (str): The name if the IIS Site Returns: dict: A dictionary of the binding names and properties. CLI Example: .. code-block:: bash salt '*' win_iis.list_bindings site ...
python
def list_bindings(site): ''' Get all configured IIS bindings for the specified site. Args: site (str): The name if the IIS Site Returns: dict: A dictionary of the binding names and properties. CLI Example: .. code-block:: bash salt '*' win_iis.list_bindings site ...
[ "def", "list_bindings", "(", "site", ")", ":", "ret", "=", "dict", "(", ")", "sites", "=", "list_sites", "(", ")", "if", "site", "not", "in", "sites", ":", "log", ".", "warning", "(", "'Site not found: %s'", ",", "site", ")", "return", "ret", "ret", ...
Get all configured IIS bindings for the specified site. Args: site (str): The name if the IIS Site Returns: dict: A dictionary of the binding names and properties. CLI Example: .. code-block:: bash salt '*' win_iis.list_bindings site
[ "Get", "all", "configured", "IIS", "bindings", "for", "the", "specified", "site", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L540-L568
train
saltstack/salt
salt/modules/win_iis.py
create_binding
def create_binding(site, hostheader='', ipaddress='*', port=80, protocol='http', sslflags=None): ''' Create an IIS Web Binding. .. note:: This function only validates against the binding ipaddress:port:hostheader combination, and will return True even if the bind...
python
def create_binding(site, hostheader='', ipaddress='*', port=80, protocol='http', sslflags=None): ''' Create an IIS Web Binding. .. note:: This function only validates against the binding ipaddress:port:hostheader combination, and will return True even if the bind...
[ "def", "create_binding", "(", "site", ",", "hostheader", "=", "''", ",", "ipaddress", "=", "'*'", ",", "port", "=", "80", ",", "protocol", "=", "'http'", ",", "sslflags", "=", "None", ")", ":", "protocol", "=", "six", ".", "text_type", "(", "protocol",...
Create an IIS Web Binding. .. note:: This function only validates against the binding ipaddress:port:hostheader combination, and will return True even if the binding already exists with a different configuration. It will not modify the configuration of an existing binding. Arg...
[ "Create", "an", "IIS", "Web", "Binding", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L571-L650
train
saltstack/salt
salt/modules/win_iis.py
modify_binding
def modify_binding(site, binding, hostheader=None, ipaddress=None, port=None, sslflags=None): ''' Modify an IIS Web Binding. Use ``site`` and ``binding`` to target the binding. .. versionadded:: 2017.7.0 Args: site (str): The IIS site name. binding (str): The bin...
python
def modify_binding(site, binding, hostheader=None, ipaddress=None, port=None, sslflags=None): ''' Modify an IIS Web Binding. Use ``site`` and ``binding`` to target the binding. .. versionadded:: 2017.7.0 Args: site (str): The IIS site name. binding (str): The bin...
[ "def", "modify_binding", "(", "site", ",", "binding", ",", "hostheader", "=", "None", ",", "ipaddress", "=", "None", ",", "port", "=", "None", ",", "sslflags", "=", "None", ")", ":", "if", "sslflags", "is", "not", "None", "and", "sslflags", "not", "in"...
Modify an IIS Web Binding. Use ``site`` and ``binding`` to target the binding. .. versionadded:: 2017.7.0 Args: site (str): The IIS site name. binding (str): The binding to edit. This is a combination of the IP address, port, and hostheader. It is in the following format: ...
[ "Modify", "an", "IIS", "Web", "Binding", ".", "Use", "site", "and", "binding", "to", "target", "the", "binding", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L653-L739
train
saltstack/salt
salt/modules/win_iis.py
remove_binding
def remove_binding(site, hostheader='', ipaddress='*', port=80): ''' Remove an IIS binding. Args: site (str): The IIS site name. hostheader (str): The host header of the binding. ipaddress (str): The IP address of the binding. port (int): The TCP port of the binding. Re...
python
def remove_binding(site, hostheader='', ipaddress='*', port=80): ''' Remove an IIS binding. Args: site (str): The IIS site name. hostheader (str): The host header of the binding. ipaddress (str): The IP address of the binding. port (int): The TCP port of the binding. Re...
[ "def", "remove_binding", "(", "site", ",", "hostheader", "=", "''", ",", "ipaddress", "=", "'*'", ",", "port", "=", "80", ")", ":", "name", "=", "_get_binding_info", "(", "hostheader", ",", "ipaddress", ",", "port", ")", "current_bindings", "=", "list_bind...
Remove an IIS binding. Args: site (str): The IIS site name. hostheader (str): The host header of the binding. ipaddress (str): The IP address of the binding. port (int): The TCP port of the binding. Returns: bool: True if successful, otherwise False CLI Example: ...
[ "Remove", "an", "IIS", "binding", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L742-L784
train
saltstack/salt
salt/modules/win_iis.py
list_cert_bindings
def list_cert_bindings(site): ''' List certificate bindings for an IIS site. .. versionadded:: 2016.11.0 Args: site (str): The IIS site name. Returns: dict: A dictionary of the binding names and properties. CLI Example: .. code-block:: bash salt '*' win_iis.list...
python
def list_cert_bindings(site): ''' List certificate bindings for an IIS site. .. versionadded:: 2016.11.0 Args: site (str): The IIS site name. Returns: dict: A dictionary of the binding names and properties. CLI Example: .. code-block:: bash salt '*' win_iis.list...
[ "def", "list_cert_bindings", "(", "site", ")", ":", "ret", "=", "dict", "(", ")", "sites", "=", "list_sites", "(", ")", "if", "site", "not", "in", "sites", ":", "log", ".", "warning", "(", "'Site not found: %s'", ",", "site", ")", "return", "ret", "for...
List certificate bindings for an IIS site. .. versionadded:: 2016.11.0 Args: site (str): The IIS site name. Returns: dict: A dictionary of the binding names and properties. CLI Example: .. code-block:: bash salt '*' win_iis.list_bindings site
[ "List", "certificate", "bindings", "for", "an", "IIS", "site", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L787-L819
train
saltstack/salt
salt/modules/win_iis.py
create_cert_binding
def create_cert_binding(name, site, hostheader='', ipaddress='*', port=443, sslflags=0): ''' Assign a certificate to an IIS Web Binding. .. versionadded:: 2016.11.0 .. note:: The web binding that the certificate is being assigned to must already exist. Arg...
python
def create_cert_binding(name, site, hostheader='', ipaddress='*', port=443, sslflags=0): ''' Assign a certificate to an IIS Web Binding. .. versionadded:: 2016.11.0 .. note:: The web binding that the certificate is being assigned to must already exist. Arg...
[ "def", "create_cert_binding", "(", "name", ",", "site", ",", "hostheader", "=", "''", ",", "ipaddress", "=", "'*'", ",", "port", "=", "443", ",", "sslflags", "=", "0", ")", ":", "name", "=", "six", ".", "text_type", "(", "name", ")", ".", "upper", ...
Assign a certificate to an IIS Web Binding. .. versionadded:: 2016.11.0 .. note:: The web binding that the certificate is being assigned to must already exist. Args: name (str): The thumbprint of the certificate. site (str): The IIS site name. hostheader (str): Th...
[ "Assign", "a", "certificate", "to", "an", "IIS", "Web", "Binding", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L822-L930
train
saltstack/salt
salt/modules/win_iis.py
remove_cert_binding
def remove_cert_binding(name, site, hostheader='', ipaddress='*', port=443): ''' Remove a certificate from an IIS Web Binding. .. versionadded:: 2016.11.0 .. note:: This function only removes the certificate from the web binding. It does not remove the web binding itself. Args: ...
python
def remove_cert_binding(name, site, hostheader='', ipaddress='*', port=443): ''' Remove a certificate from an IIS Web Binding. .. versionadded:: 2016.11.0 .. note:: This function only removes the certificate from the web binding. It does not remove the web binding itself. Args: ...
[ "def", "remove_cert_binding", "(", "name", ",", "site", ",", "hostheader", "=", "''", ",", "ipaddress", "=", "'*'", ",", "port", "=", "443", ")", ":", "name", "=", "six", ".", "text_type", "(", "name", ")", ".", "upper", "(", ")", "binding_info", "="...
Remove a certificate from an IIS Web Binding. .. versionadded:: 2016.11.0 .. note:: This function only removes the certificate from the web binding. It does not remove the web binding itself. Args: name (str): The thumbprint of the certificate. site (str): The IIS site na...
[ "Remove", "a", "certificate", "from", "an", "IIS", "Web", "Binding", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L933-L1002
train
saltstack/salt
salt/modules/win_iis.py
list_apppools
def list_apppools(): ''' List all configured IIS application pools. Returns: dict: A dictionary of IIS application pools and their details. CLI Example: .. code-block:: bash salt '*' win_iis.list_apppools ''' ret = dict() ps_cmd = [] ps_cmd.append(r"Get-ChildItem ...
python
def list_apppools(): ''' List all configured IIS application pools. Returns: dict: A dictionary of IIS application pools and their details. CLI Example: .. code-block:: bash salt '*' win_iis.list_apppools ''' ret = dict() ps_cmd = [] ps_cmd.append(r"Get-ChildItem ...
[ "def", "list_apppools", "(", ")", ":", "ret", "=", "dict", "(", ")", "ps_cmd", "=", "[", "]", "ps_cmd", ".", "append", "(", "r\"Get-ChildItem -Path 'IIS:\\AppPools' | Select-Object Name, State\"", ")", "# Include the equivalent of output from the Applications column, since th...
List all configured IIS application pools. Returns: dict: A dictionary of IIS application pools and their details. CLI Example: .. code-block:: bash salt '*' win_iis.list_apppools
[ "List", "all", "configured", "IIS", "application", "pools", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L1005-L1063
train
saltstack/salt
salt/modules/win_iis.py
create_apppool
def create_apppool(name): ''' Create an IIS application pool. .. note:: This function only validates against the application pool name, and will return True even if the application pool already exists with a different configuration. It will not modify the configuration of an existi...
python
def create_apppool(name): ''' Create an IIS application pool. .. note:: This function only validates against the application pool name, and will return True even if the application pool already exists with a different configuration. It will not modify the configuration of an existi...
[ "def", "create_apppool", "(", "name", ")", ":", "current_apppools", "=", "list_apppools", "(", ")", "apppool_path", "=", "r'IIS:\\AppPools\\{0}'", ".", "format", "(", "name", ")", "if", "name", "in", "current_apppools", ":", "log", ".", "debug", "(", "\"Applic...
Create an IIS application pool. .. note:: This function only validates against the application pool name, and will return True even if the application pool already exists with a different configuration. It will not modify the configuration of an existing application pool. Args...
[ "Create", "an", "IIS", "application", "pool", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L1066-L1106
train
saltstack/salt
salt/modules/win_iis.py
stop_apppool
def stop_apppool(name): ''' Stop an IIS application pool. .. versionadded:: 2017.7.0 Args: name (str): The name of the App Pool to stop. Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.stop_apppool name='MyTe...
python
def stop_apppool(name): ''' Stop an IIS application pool. .. versionadded:: 2017.7.0 Args: name (str): The name of the App Pool to stop. Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.stop_apppool name='MyTe...
[ "def", "stop_apppool", "(", "name", ")", ":", "ps_cmd", "=", "[", "'Stop-WebAppPool'", ",", "r\"'{0}'\"", ".", "format", "(", "name", ")", "]", "cmd_ret", "=", "_srvmgr", "(", "ps_cmd", ")", "return", "cmd_ret", "[", "'retcode'", "]", "==", "0" ]
Stop an IIS application pool. .. versionadded:: 2017.7.0 Args: name (str): The name of the App Pool to stop. Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.stop_apppool name='MyTestPool'
[ "Stop", "an", "IIS", "application", "pool", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L1145-L1167
train
saltstack/salt
salt/modules/win_iis.py
start_apppool
def start_apppool(name): ''' Start an IIS application pool. .. versionadded:: 2017.7.0 Args: name (str): The name of the App Pool to start. Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.start_apppool name='...
python
def start_apppool(name): ''' Start an IIS application pool. .. versionadded:: 2017.7.0 Args: name (str): The name of the App Pool to start. Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.start_apppool name='...
[ "def", "start_apppool", "(", "name", ")", ":", "ps_cmd", "=", "[", "'Start-WebAppPool'", ",", "r\"'{0}'\"", ".", "format", "(", "name", ")", "]", "cmd_ret", "=", "_srvmgr", "(", "ps_cmd", ")", "return", "cmd_ret", "[", "'retcode'", "]", "==", "0" ]
Start an IIS application pool. .. versionadded:: 2017.7.0 Args: name (str): The name of the App Pool to start. Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.start_apppool name='MyTestPool'
[ "Start", "an", "IIS", "application", "pool", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L1170-L1192
train
saltstack/salt
salt/modules/win_iis.py
restart_apppool
def restart_apppool(name): ''' Restart an IIS application pool. .. versionadded:: 2016.11.0 Args: name (str): The name of the IIS application pool. Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.restart_appp...
python
def restart_apppool(name): ''' Restart an IIS application pool. .. versionadded:: 2016.11.0 Args: name (str): The name of the IIS application pool. Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.restart_appp...
[ "def", "restart_apppool", "(", "name", ")", ":", "ps_cmd", "=", "[", "'Restart-WebAppPool'", ",", "r\"'{0}'\"", ".", "format", "(", "name", ")", "]", "cmd_ret", "=", "_srvmgr", "(", "ps_cmd", ")", "return", "cmd_ret", "[", "'retcode'", "]", "==", "0" ]
Restart an IIS application pool. .. versionadded:: 2016.11.0 Args: name (str): The name of the IIS application pool. Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.restart_apppool name='MyTestPool'
[ "Restart", "an", "IIS", "application", "pool", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L1195-L1217
train
saltstack/salt
salt/modules/win_iis.py
get_container_setting
def get_container_setting(name, container, settings): ''' Get the value of the setting for the IIS container. .. versionadded:: 2016.11.0 Args: name (str): The name of the IIS container. container (str): The type of IIS container. The container types are: AppPools, Sites, S...
python
def get_container_setting(name, container, settings): ''' Get the value of the setting for the IIS container. .. versionadded:: 2016.11.0 Args: name (str): The name of the IIS container. container (str): The type of IIS container. The container types are: AppPools, Sites, S...
[ "def", "get_container_setting", "(", "name", ",", "container", ",", "settings", ")", ":", "ret", "=", "dict", "(", ")", "ps_cmd", "=", "list", "(", ")", "ps_cmd_validate", "=", "list", "(", ")", "container_path", "=", "r\"IIS:\\{0}\\{1}\"", ".", "format", ...
Get the value of the setting for the IIS container. .. versionadded:: 2016.11.0 Args: name (str): The name of the IIS container. container (str): The type of IIS container. The container types are: AppPools, Sites, SslBindings settings (dict): A dictionary of the setting na...
[ "Get", "the", "value", "of", "the", "setting", "for", "the", "IIS", "container", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L1220-L1294
train
saltstack/salt
salt/modules/win_iis.py
set_container_setting
def set_container_setting(name, container, settings): ''' Set the value of the setting for an IIS container. .. versionadded:: 2016.11.0 Args: name (str): The name of the IIS container. container (str): The type of IIS container. The container types are: AppPools, Sites, Ss...
python
def set_container_setting(name, container, settings): ''' Set the value of the setting for an IIS container. .. versionadded:: 2016.11.0 Args: name (str): The name of the IIS container. container (str): The type of IIS container. The container types are: AppPools, Sites, Ss...
[ "def", "set_container_setting", "(", "name", ",", "container", ",", "settings", ")", ":", "identityType_map2string", "=", "{", "'0'", ":", "'LocalSystem'", ",", "'1'", ":", "'LocalService'", ",", "'2'", ":", "'NetworkService'", ",", "'3'", ":", "'SpecificUser'",...
Set the value of the setting for an IIS container. .. versionadded:: 2016.11.0 Args: name (str): The name of the IIS container. container (str): The type of IIS container. The container types are: AppPools, Sites, SslBindings settings (dict): A dictionary of the setting nam...
[ "Set", "the", "value", "of", "the", "setting", "for", "an", "IIS", "container", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L1297-L1383
train
saltstack/salt
salt/modules/win_iis.py
list_apps
def list_apps(site): ''' Get all configured IIS applications for the specified site. Args: site (str): The IIS site name. Returns: A dictionary of the application names and properties. CLI Example: .. code-block:: bash salt '*' win_iis.list_apps site ''' ret = dict()...
python
def list_apps(site): ''' Get all configured IIS applications for the specified site. Args: site (str): The IIS site name. Returns: A dictionary of the application names and properties. CLI Example: .. code-block:: bash salt '*' win_iis.list_apps site ''' ret = dict()...
[ "def", "list_apps", "(", "site", ")", ":", "ret", "=", "dict", "(", ")", "ps_cmd", "=", "list", "(", ")", "ps_cmd", ".", "append", "(", "\"Get-WebApplication -Site '{0}'\"", ".", "format", "(", "site", ")", ")", "ps_cmd", ".", "append", "(", "r\"| Select...
Get all configured IIS applications for the specified site. Args: site (str): The IIS site name. Returns: A dictionary of the application names and properties. CLI Example: .. code-block:: bash salt '*' win_iis.list_apps site
[ "Get", "all", "configured", "IIS", "applications", "for", "the", "specified", "site", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L1386-L1438
train
saltstack/salt
salt/modules/win_iis.py
create_app
def create_app(name, site, sourcepath, apppool=None): ''' Create an IIS application. .. note:: This function only validates against the application name, and will return True even if the application already exists with a different configuration. It will not modify the configuration...
python
def create_app(name, site, sourcepath, apppool=None): ''' Create an IIS application. .. note:: This function only validates against the application name, and will return True even if the application already exists with a different configuration. It will not modify the configuration...
[ "def", "create_app", "(", "name", ",", "site", ",", "sourcepath", ",", "apppool", "=", "None", ")", ":", "current_apps", "=", "list_apps", "(", "site", ")", "if", "name", "in", "current_apps", ":", "log", ".", "debug", "(", "'Application already present: %s'...
Create an IIS application. .. note:: This function only validates against the application name, and will return True even if the application already exists with a different configuration. It will not modify the configuration of an existing application. Args: name (str)...
[ "Create", "an", "IIS", "application", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L1441-L1500
train
saltstack/salt
salt/modules/win_iis.py
remove_app
def remove_app(name, site): ''' Remove an IIS application. Args: name (str): The application name. site (str): The IIS site name. Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.remove_app name='app0' site...
python
def remove_app(name, site): ''' Remove an IIS application. Args: name (str): The application name. site (str): The IIS site name. Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.remove_app name='app0' site...
[ "def", "remove_app", "(", "name", ",", "site", ")", ":", "current_apps", "=", "list_apps", "(", "site", ")", "if", "name", "not", "in", "current_apps", ":", "log", ".", "debug", "(", "'Application already absent: %s'", ",", "name", ")", "return", "True", "...
Remove an IIS application. Args: name (str): The application name. site (str): The IIS site name. Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.remove_app name='app0' site='site0'
[ "Remove", "an", "IIS", "application", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L1503-L1544
train
saltstack/salt
salt/modules/win_iis.py
list_vdirs
def list_vdirs(site, app=_DEFAULT_APP): ''' Get all configured IIS virtual directories for the specified site, or for the combination of site and application. Args: site (str): The IIS site name. app (str): The IIS application. Returns: dict: A dictionary of the virtual dir...
python
def list_vdirs(site, app=_DEFAULT_APP): ''' Get all configured IIS virtual directories for the specified site, or for the combination of site and application. Args: site (str): The IIS site name. app (str): The IIS application. Returns: dict: A dictionary of the virtual dir...
[ "def", "list_vdirs", "(", "site", ",", "app", "=", "_DEFAULT_APP", ")", ":", "ret", "=", "dict", "(", ")", "ps_cmd", "=", "[", "'Get-WebVirtualDirectory'", ",", "'-Site'", ",", "r\"'{0}'\"", ".", "format", "(", "site", ")", ",", "'-Application'", ",", "r...
Get all configured IIS virtual directories for the specified site, or for the combination of site and application. Args: site (str): The IIS site name. app (str): The IIS application. Returns: dict: A dictionary of the virtual directory names and properties. CLI Example: ...
[ "Get", "all", "configured", "IIS", "virtual", "directories", "for", "the", "specified", "site", "or", "for", "the", "combination", "of", "site", "and", "application", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L1547-L1586
train
saltstack/salt
salt/modules/win_iis.py
create_vdir
def create_vdir(name, site, sourcepath, app=_DEFAULT_APP): ''' Create an IIS virtual directory. .. note:: This function only validates against the virtual directory name, and will return True even if the virtual directory already exists with a different configuration. It will not m...
python
def create_vdir(name, site, sourcepath, app=_DEFAULT_APP): ''' Create an IIS virtual directory. .. note:: This function only validates against the virtual directory name, and will return True even if the virtual directory already exists with a different configuration. It will not m...
[ "def", "create_vdir", "(", "name", ",", "site", ",", "sourcepath", ",", "app", "=", "_DEFAULT_APP", ")", ":", "current_vdirs", "=", "list_vdirs", "(", "site", ",", "app", ")", "if", "name", "in", "current_vdirs", ":", "log", ".", "debug", "(", "'Virtual ...
Create an IIS virtual directory. .. note:: This function only validates against the virtual directory name, and will return True even if the virtual directory already exists with a different configuration. It will not modify the configuration of an existing virtual directory. ...
[ "Create", "an", "IIS", "virtual", "directory", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L1589-L1648
train
saltstack/salt
salt/modules/win_iis.py
remove_vdir
def remove_vdir(name, site, app=_DEFAULT_APP): ''' Remove an IIS virtual directory. Args: name (str): The virtual directory name. site (str): The IIS site name. app (str): The IIS application. Returns: bool: True if successful, otherwise False CLI Example: .. ...
python
def remove_vdir(name, site, app=_DEFAULT_APP): ''' Remove an IIS virtual directory. Args: name (str): The virtual directory name. site (str): The IIS site name. app (str): The IIS application. Returns: bool: True if successful, otherwise False CLI Example: .. ...
[ "def", "remove_vdir", "(", "name", ",", "site", ",", "app", "=", "_DEFAULT_APP", ")", ":", "current_vdirs", "=", "list_vdirs", "(", "site", ",", "app", ")", "app_path", "=", "os", ".", "path", ".", "join", "(", "*", "app", ".", "rstrip", "(", "'/'", ...
Remove an IIS virtual directory. Args: name (str): The virtual directory name. site (str): The IIS site name. app (str): The IIS application. Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.remove_vdir nam...
[ "Remove", "an", "IIS", "virtual", "directory", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L1651-L1701
train
saltstack/salt
salt/modules/win_iis.py
create_backup
def create_backup(name): r''' Backup an IIS Configuration on the System. .. versionadded:: 2017.7.0 .. note:: Backups are stored in the ``$env:Windir\System32\inetsrv\backup`` folder. Args: name (str): The name to give the backup Returns: bool: True if success...
python
def create_backup(name): r''' Backup an IIS Configuration on the System. .. versionadded:: 2017.7.0 .. note:: Backups are stored in the ``$env:Windir\System32\inetsrv\backup`` folder. Args: name (str): The name to give the backup Returns: bool: True if success...
[ "def", "create_backup", "(", "name", ")", ":", "if", "name", "in", "list_backups", "(", ")", ":", "raise", "CommandExecutionError", "(", "'Backup already present: {0}'", ".", "format", "(", "name", ")", ")", "ps_cmd", "=", "[", "'Backup-WebConfiguration'", ",", ...
r''' Backup an IIS Configuration on the System. .. versionadded:: 2017.7.0 .. note:: Backups are stored in the ``$env:Windir\System32\inetsrv\backup`` folder. Args: name (str): The name to give the backup Returns: bool: True if successful, otherwise False CLI...
[ "r", "Backup", "an", "IIS", "Configuration", "on", "the", "System", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L1749-L1784
train
saltstack/salt
salt/modules/win_iis.py
remove_backup
def remove_backup(name): ''' Remove an IIS Configuration backup from the System. .. versionadded:: 2017.7.0 Args: name (str): The name of the backup to remove Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.r...
python
def remove_backup(name): ''' Remove an IIS Configuration backup from the System. .. versionadded:: 2017.7.0 Args: name (str): The name of the backup to remove Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.r...
[ "def", "remove_backup", "(", "name", ")", ":", "if", "name", "not", "in", "list_backups", "(", ")", ":", "log", ".", "debug", "(", "'Backup already removed: %s'", ",", "name", ")", "return", "True", "ps_cmd", "=", "[", "'Remove-WebConfigurationBackup'", ",", ...
Remove an IIS Configuration backup from the System. .. versionadded:: 2017.7.0 Args: name (str): The name of the backup to remove Returns: bool: True if successful, otherwise False CLI Example: .. code-block:: bash salt '*' win_iis.remove_backup backup_20170209
[ "Remove", "an", "IIS", "Configuration", "backup", "from", "the", "System", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L1787-L1819
train
saltstack/salt
salt/modules/win_iis.py
list_worker_processes
def list_worker_processes(apppool): ''' Returns a list of worker processes that correspond to the passed application pool. .. versionadded:: 2017.7.0 Args: apppool (str): The application pool to query Returns: dict: A dictionary of worker processes with their process IDs ...
python
def list_worker_processes(apppool): ''' Returns a list of worker processes that correspond to the passed application pool. .. versionadded:: 2017.7.0 Args: apppool (str): The application pool to query Returns: dict: A dictionary of worker processes with their process IDs ...
[ "def", "list_worker_processes", "(", "apppool", ")", ":", "ps_cmd", "=", "[", "'Get-ChildItem'", ",", "r\"'IIS:\\AppPools\\{0}\\WorkerProcesses'\"", ".", "format", "(", "apppool", ")", "]", "cmd_ret", "=", "_srvmgr", "(", "cmd", "=", "ps_cmd", ",", "return_json", ...
Returns a list of worker processes that correspond to the passed application pool. .. versionadded:: 2017.7.0 Args: apppool (str): The application pool to query Returns: dict: A dictionary of worker processes with their process IDs CLI Example: .. code-block:: bash ...
[ "Returns", "a", "list", "of", "worker", "processes", "that", "correspond", "to", "the", "passed", "application", "pool", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L1822-L1858
train
saltstack/salt
salt/modules/win_iis.py
get_webapp_settings
def get_webapp_settings(name, site, settings): r''' .. versionadded:: 2017.7.0 Get the value of the setting for the IIS web application. .. note:: Params are case sensitive :param str name: The name of the IIS web application. :param str site: The site name contains the web applicatio...
python
def get_webapp_settings(name, site, settings): r''' .. versionadded:: 2017.7.0 Get the value of the setting for the IIS web application. .. note:: Params are case sensitive :param str name: The name of the IIS web application. :param str site: The site name contains the web applicatio...
[ "def", "get_webapp_settings", "(", "name", ",", "site", ",", "settings", ")", ":", "ret", "=", "dict", "(", ")", "pscmd", "=", "list", "(", ")", "availableSettings", "=", "(", "'physicalPath'", ",", "'applicationPool'", ",", "'userName'", ",", "'password'", ...
r''' .. versionadded:: 2017.7.0 Get the value of the setting for the IIS web application. .. note:: Params are case sensitive :param str name: The name of the IIS web application. :param str site: The site name contains the web application. Example: Default Web Site :param str...
[ "r", "..", "versionadded", "::", "2017", ".", "7", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L1861-L1934
train
saltstack/salt
salt/modules/win_iis.py
set_webapp_settings
def set_webapp_settings(name, site, settings): r''' .. versionadded:: 2017.7.0 Configure an IIS application. .. note:: This function only configures an existing app. Params are case sensitive. :param str name: The IIS application. :param str site: The IIS site name. :param...
python
def set_webapp_settings(name, site, settings): r''' .. versionadded:: 2017.7.0 Configure an IIS application. .. note:: This function only configures an existing app. Params are case sensitive. :param str name: The IIS application. :param str site: The IIS site name. :param...
[ "def", "set_webapp_settings", "(", "name", ",", "site", ",", "settings", ")", ":", "pscmd", "=", "list", "(", ")", "current_apps", "=", "list_apps", "(", "site", ")", "current_sites", "=", "list_sites", "(", ")", "availableSettings", "=", "(", "'physicalPath...
r''' .. versionadded:: 2017.7.0 Configure an IIS application. .. note:: This function only configures an existing app. Params are case sensitive. :param str name: The IIS application. :param str site: The IIS site name. :param str settings: A dictionary of the setting names an...
[ "r", "..", "versionadded", "::", "2017", ".", "7", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L1937-L2042
train
saltstack/salt
salt/modules/win_iis.py
get_webconfiguration_settings
def get_webconfiguration_settings(name, settings, location=''): r''' Get the webconfiguration settings for the IIS PSPath. Args: name (str): The PSPath of the IIS webconfiguration settings. settings (list): A list of dictionaries containing setting name and filter. location (str): T...
python
def get_webconfiguration_settings(name, settings, location=''): r''' Get the webconfiguration settings for the IIS PSPath. Args: name (str): The PSPath of the IIS webconfiguration settings. settings (list): A list of dictionaries containing setting name and filter. location (str): T...
[ "def", "get_webconfiguration_settings", "(", "name", ",", "settings", ",", "location", "=", "''", ")", ":", "ret", "=", "{", "}", "ps_cmd", "=", "[", "]", "ps_cmd_validate", "=", "[", "]", "if", "not", "settings", ":", "log", ".", "warning", "(", "'No ...
r''' Get the webconfiguration settings for the IIS PSPath. Args: name (str): The PSPath of the IIS webconfiguration settings. settings (list): A list of dictionaries containing setting name and filter. location (str): The location of the settings (optional) Returns: dict: A...
[ "r", "Get", "the", "webconfiguration", "settings", "for", "the", "IIS", "PSPath", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L2045-L2122
train
saltstack/salt
salt/modules/win_iis.py
set_webconfiguration_settings
def set_webconfiguration_settings(name, settings, location=''): r''' Set the value of the setting for an IIS container. Args: name (str): The PSPath of the IIS webconfiguration settings. settings (list): A list of dictionaries containing setting name, filter and value. location (str...
python
def set_webconfiguration_settings(name, settings, location=''): r''' Set the value of the setting for an IIS container. Args: name (str): The PSPath of the IIS webconfiguration settings. settings (list): A list of dictionaries containing setting name, filter and value. location (str...
[ "def", "set_webconfiguration_settings", "(", "name", ",", "settings", ",", "location", "=", "''", ")", ":", "ps_cmd", "=", "[", "]", "if", "not", "settings", ":", "log", ".", "warning", "(", "'No settings provided'", ")", "return", "False", "settings", "=", ...
r''' Set the value of the setting for an IIS container. Args: name (str): The PSPath of the IIS webconfiguration settings. settings (list): A list of dictionaries containing setting name, filter and value. location (str): The location of the settings (optional) Returns: boo...
[ "r", "Set", "the", "value", "of", "the", "setting", "for", "an", "IIS", "container", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_iis.py#L2125-L2214
train
saltstack/salt
salt/runners/ddns.py
create
def create(zone, name, ttl, rdtype, data, keyname, keyfile, nameserver, timeout, port=53, keyalgorithm='hmac-md5'): ''' Create a DNS record. The nameserver must be an IP address and the master running this runner must have create privileges on that server. CLI Example: .. code-block:: b...
python
def create(zone, name, ttl, rdtype, data, keyname, keyfile, nameserver, timeout, port=53, keyalgorithm='hmac-md5'): ''' Create a DNS record. The nameserver must be an IP address and the master running this runner must have create privileges on that server. CLI Example: .. code-block:: b...
[ "def", "create", "(", "zone", ",", "name", ",", "ttl", ",", "rdtype", ",", "data", ",", "keyname", ",", "keyfile", ",", "nameserver", ",", "timeout", ",", "port", "=", "53", ",", "keyalgorithm", "=", "'hmac-md5'", ")", ":", "if", "zone", "in", "name"...
Create a DNS record. The nameserver must be an IP address and the master running this runner must have create privileges on that server. CLI Example: .. code-block:: bash salt-run ddns.create domain.com my-test-vm 3600 A 10.20.30.40 my-tsig-key /etc/salt/tsig.keyring 10.0.0.1 5
[ "Create", "a", "DNS", "record", ".", "The", "nameserver", "must", "be", "an", "IP", "address", "and", "the", "master", "running", "this", "runner", "must", "have", "create", "privileges", "on", "that", "server", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/ddns.py#L56-L91
train
saltstack/salt
salt/runners/ddns.py
add_host
def add_host(zone, name, ttl, ip, keyname, keyfile, nameserver, timeout, port=53, keyalgorithm='hmac-md5'): ''' Create both A and PTR (reverse) records for a host. CLI Example: .. code-block:: bash salt-run ddns.add_host domain.com my-test-vm 3600 10.20.30.40 my-tsig-key /etc/sal...
python
def add_host(zone, name, ttl, ip, keyname, keyfile, nameserver, timeout, port=53, keyalgorithm='hmac-md5'): ''' Create both A and PTR (reverse) records for a host. CLI Example: .. code-block:: bash salt-run ddns.add_host domain.com my-test-vm 3600 10.20.30.40 my-tsig-key /etc/sal...
[ "def", "add_host", "(", "zone", ",", "name", ",", "ttl", ",", "ip", ",", "keyname", ",", "keyfile", ",", "nameserver", ",", "timeout", ",", "port", "=", "53", ",", "keyalgorithm", "=", "'hmac-md5'", ")", ":", "res", "=", "[", "]", "if", "zone", "in...
Create both A and PTR (reverse) records for a host. CLI Example: .. code-block:: bash salt-run ddns.add_host domain.com my-test-vm 3600 10.20.30.40 my-tsig-key /etc/salt/tsig.keyring 10.0.0.1 5
[ "Create", "both", "A", "and", "PTR", "(", "reverse", ")", "records", "for", "a", "host", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/ddns.py#L187-L229
train
saltstack/salt
salt/runners/ddns.py
delete_host
def delete_host(zone, name, keyname, keyfile, nameserver, timeout, port=53, keyalgorithm='hmac-md5'): ''' Delete both forward (A) and reverse (PTR) records for a host only if the forward (A) record exists. CLI Example: .. code-block:: bash salt-run ddns.delete_host domain....
python
def delete_host(zone, name, keyname, keyfile, nameserver, timeout, port=53, keyalgorithm='hmac-md5'): ''' Delete both forward (A) and reverse (PTR) records for a host only if the forward (A) record exists. CLI Example: .. code-block:: bash salt-run ddns.delete_host domain....
[ "def", "delete_host", "(", "zone", ",", "name", ",", "keyname", ",", "keyfile", ",", "nameserver", ",", "timeout", ",", "port", "=", "53", ",", "keyalgorithm", "=", "'hmac-md5'", ")", ":", "res", "=", "[", "]", "if", "zone", "in", "name", ":", "name"...
Delete both forward (A) and reverse (PTR) records for a host only if the forward (A) record exists. CLI Example: .. code-block:: bash salt-run ddns.delete_host domain.com my-test-vm my-tsig-key /etc/salt/tsig.keyring 10.0.0.1 5
[ "Delete", "both", "forward", "(", "A", ")", "and", "reverse", "(", "PTR", ")", "records", "for", "a", "host", "only", "if", "the", "forward", "(", "A", ")", "record", "exists", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/ddns.py#L232-L282
train
saltstack/salt
salt/utils/pkg/deb.py
combine_comments
def combine_comments(comments): ''' Given a list of comments, or a comment submitted as a string, return a single line of text containing all of the comments. ''' if isinstance(comments, list): for idx in range(len(comments)): if not isinstance(comments[idx], six.string_types): ...
python
def combine_comments(comments): ''' Given a list of comments, or a comment submitted as a string, return a single line of text containing all of the comments. ''' if isinstance(comments, list): for idx in range(len(comments)): if not isinstance(comments[idx], six.string_types): ...
[ "def", "combine_comments", "(", "comments", ")", ":", "if", "isinstance", "(", "comments", ",", "list", ")", ":", "for", "idx", "in", "range", "(", "len", "(", "comments", ")", ")", ":", "if", "not", "isinstance", "(", "comments", "[", "idx", "]", ",...
Given a list of comments, or a comment submitted as a string, return a single line of text containing all of the comments.
[ "Given", "a", "list", "of", "comments", "or", "a", "comment", "submitted", "as", "a", "string", "return", "a", "single", "line", "of", "text", "containing", "all", "of", "the", "comments", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/deb.py#L14-L28
train
saltstack/salt
salt/utils/pkg/deb.py
strip_uri
def strip_uri(repo): ''' Remove the trailing slash from the URI in a repo definition ''' splits = repo.split() for idx in range(len(splits)): if any(splits[idx].startswith(x) for x in ('http://', 'https://', 'ftp://')): splits[idx] = splits[idx].rstrip('/') ret...
python
def strip_uri(repo): ''' Remove the trailing slash from the URI in a repo definition ''' splits = repo.split() for idx in range(len(splits)): if any(splits[idx].startswith(x) for x in ('http://', 'https://', 'ftp://')): splits[idx] = splits[idx].rstrip('/') ret...
[ "def", "strip_uri", "(", "repo", ")", ":", "splits", "=", "repo", ".", "split", "(", ")", "for", "idx", "in", "range", "(", "len", "(", "splits", ")", ")", ":", "if", "any", "(", "splits", "[", "idx", "]", ".", "startswith", "(", "x", ")", "for...
Remove the trailing slash from the URI in a repo definition
[ "Remove", "the", "trailing", "slash", "from", "the", "URI", "in", "a", "repo", "definition" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/pkg/deb.py#L31-L40
train
saltstack/salt
salt/cloud/clouds/vmware.py
_get_si
def _get_si(): ''' Authenticate with vCenter server and return service instance object. ''' url = config.get_cloud_config_value( 'url', get_configured_provider(), __opts__, search_global=False ) username = config.get_cloud_config_value( 'user', get_configured_provider(), __opts_...
python
def _get_si(): ''' Authenticate with vCenter server and return service instance object. ''' url = config.get_cloud_config_value( 'url', get_configured_provider(), __opts__, search_global=False ) username = config.get_cloud_config_value( 'user', get_configured_provider(), __opts_...
[ "def", "_get_si", "(", ")", ":", "url", "=", "config", ".", "get_cloud_config_value", "(", "'url'", ",", "get_configured_provider", "(", ")", ",", "__opts__", ",", "search_global", "=", "False", ")", "username", "=", "config", ".", "get_cloud_config_value", "(...
Authenticate with vCenter server and return service instance object.
[ "Authenticate", "with", "vCenter", "server", "and", "return", "service", "instance", "object", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vmware.py#L238-L263
train
saltstack/salt
salt/cloud/clouds/vmware.py
_add_new_ide_controller_helper
def _add_new_ide_controller_helper(ide_controller_label, controller_key, bus_number): ''' Helper function for adding new IDE controllers .. versionadded:: 2016.3.0 Args: ide_controller_label: label of the IDE controller ...
python
def _add_new_ide_controller_helper(ide_controller_label, controller_key, bus_number): ''' Helper function for adding new IDE controllers .. versionadded:: 2016.3.0 Args: ide_controller_label: label of the IDE controller ...
[ "def", "_add_new_ide_controller_helper", "(", "ide_controller_label", ",", "controller_key", ",", "bus_number", ")", ":", "if", "controller_key", "is", "None", ":", "controller_key", "=", "randint", "(", "-", "200", ",", "250", ")", "ide_spec", "=", "vim", ".", ...
Helper function for adding new IDE controllers .. versionadded:: 2016.3.0 Args: ide_controller_label: label of the IDE controller controller_key: if not None, the controller key to use; otherwise it is randomly generated bus_number: bus number Returns: created device spec for an IDE con...
[ "Helper", "function", "for", "adding", "new", "IDE", "controllers" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vmware.py#L554-L584
train
saltstack/salt
salt/cloud/clouds/vmware.py
_valid_ip
def _valid_ip(ip_address): ''' Check if the IP address is valid and routable Return either True or False ''' try: address = ipaddress.IPv4Address(ip_address) except ipaddress.AddressValueError: return False if address.is_unspecified or \ address.is_loopback or \ ...
python
def _valid_ip(ip_address): ''' Check if the IP address is valid and routable Return either True or False ''' try: address = ipaddress.IPv4Address(ip_address) except ipaddress.AddressValueError: return False if address.is_unspecified or \ address.is_loopback or \ ...
[ "def", "_valid_ip", "(", "ip_address", ")", ":", "try", ":", "address", "=", "ipaddress", ".", "IPv4Address", "(", "ip_address", ")", "except", "ipaddress", ".", "AddressValueError", ":", "return", "False", "if", "address", ".", "is_unspecified", "or", "addres...
Check if the IP address is valid and routable Return either True or False
[ "Check", "if", "the", "IP", "address", "is", "valid", "and", "routable", "Return", "either", "True", "or", "False" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vmware.py#L993-L1011
train
saltstack/salt
salt/cloud/clouds/vmware.py
_valid_ip6
def _valid_ip6(ip_address): ''' Check if the IPv6 address is valid and routable Return either True or False ''' # Validate IPv6 address try: address = ipaddress.IPv6Address(ip_address) except ipaddress.AddressValueError: return False if address.is_unspecified or \ ...
python
def _valid_ip6(ip_address): ''' Check if the IPv6 address is valid and routable Return either True or False ''' # Validate IPv6 address try: address = ipaddress.IPv6Address(ip_address) except ipaddress.AddressValueError: return False if address.is_unspecified or \ ...
[ "def", "_valid_ip6", "(", "ip_address", ")", ":", "# Validate IPv6 address", "try", ":", "address", "=", "ipaddress", ".", "IPv6Address", "(", "ip_address", ")", "except", "ipaddress", ".", "AddressValueError", ":", "return", "False", "if", "address", ".", "is_u...
Check if the IPv6 address is valid and routable Return either True or False
[ "Check", "if", "the", "IPv6", "address", "is", "valid", "and", "routable", "Return", "either", "True", "or", "False" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vmware.py#L1014-L1036
train
saltstack/salt
salt/cloud/clouds/vmware.py
_master_supports_ipv6
def _master_supports_ipv6(): ''' Check if the salt master has a valid and routable IPv6 address available ''' master_fqdn = salt.utils.network.get_fqhostname() pillar_util = salt.utils.master.MasterPillarUtil(master_fqdn, tgt_type='glob', ...
python
def _master_supports_ipv6(): ''' Check if the salt master has a valid and routable IPv6 address available ''' master_fqdn = salt.utils.network.get_fqhostname() pillar_util = salt.utils.master.MasterPillarUtil(master_fqdn, tgt_type='glob', ...
[ "def", "_master_supports_ipv6", "(", ")", ":", "master_fqdn", "=", "salt", ".", "utils", ".", "network", ".", "get_fqhostname", "(", ")", "pillar_util", "=", "salt", ".", "utils", ".", "master", ".", "MasterPillarUtil", "(", "master_fqdn", ",", "tgt_type", "...
Check if the salt master has a valid and routable IPv6 address available
[ "Check", "if", "the", "salt", "master", "has", "a", "valid", "and", "routable", "IPv6", "address", "available" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vmware.py#L1039-L1055
train
saltstack/salt
salt/cloud/clouds/vmware.py
_get_hba_type
def _get_hba_type(hba_type): ''' Convert a string representation of a HostHostBusAdapter into an object reference. ''' if hba_type == "parallel": return vim.host.ParallelScsiHba elif hba_type == "block": return vim.host.BlockHba elif hba_type == "iscsi": return vim.ho...
python
def _get_hba_type(hba_type): ''' Convert a string representation of a HostHostBusAdapter into an object reference. ''' if hba_type == "parallel": return vim.host.ParallelScsiHba elif hba_type == "block": return vim.host.BlockHba elif hba_type == "iscsi": return vim.ho...
[ "def", "_get_hba_type", "(", "hba_type", ")", ":", "if", "hba_type", "==", "\"parallel\"", ":", "return", "vim", ".", "host", ".", "ParallelScsiHba", "elif", "hba_type", "==", "\"block\"", ":", "return", "vim", ".", "host", ".", "BlockHba", "elif", "hba_type...
Convert a string representation of a HostHostBusAdapter into an object reference.
[ "Convert", "a", "string", "representation", "of", "a", "HostHostBusAdapter", "into", "an", "object", "reference", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vmware.py#L1484-L1498
train
saltstack/salt
salt/cloud/clouds/vmware.py
get_vcenter_version
def get_vcenter_version(kwargs=None, call=None): ''' Show the vCenter Server version with build number. CLI Example: .. code-block:: bash salt-cloud -f get_vcenter_version my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( 'The get_vcenter_versi...
python
def get_vcenter_version(kwargs=None, call=None): ''' Show the vCenter Server version with build number. CLI Example: .. code-block:: bash salt-cloud -f get_vcenter_version my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( 'The get_vcenter_versi...
[ "def", "get_vcenter_version", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The get_vcenter_version function must be called with '", "'-f or --function.'", ")", "# Get the in...
Show the vCenter Server version with build number. CLI Example: .. code-block:: bash salt-cloud -f get_vcenter_version my-vmware-config
[ "Show", "the", "vCenter", "Server", "version", "with", "build", "number", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vmware.py#L1528-L1547
train
saltstack/salt
salt/cloud/clouds/vmware.py
list_datacenters
def list_datacenters(kwargs=None, call=None): ''' List all the data centers for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_datacenters my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( 'The list_datacenters fun...
python
def list_datacenters(kwargs=None, call=None): ''' List all the data centers for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_datacenters my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( 'The list_datacenters fun...
[ "def", "list_datacenters", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_datacenters function must be called with '", "'-f or --function.'", ")", "return", "{", ...
List all the data centers for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_datacenters my-vmware-config
[ "List", "all", "the", "data", "centers", "for", "this", "VMware", "environment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vmware.py#L1550-L1566
train
saltstack/salt
salt/cloud/clouds/vmware.py
list_portgroups
def list_portgroups(kwargs=None, call=None): ''' List all the distributed virtual portgroups for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_portgroups my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( 'The list...
python
def list_portgroups(kwargs=None, call=None): ''' List all the distributed virtual portgroups for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_portgroups my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( 'The list...
[ "def", "list_portgroups", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_portgroups function must be called with '", "'-f or --function.'", ")", "return", "{", "'...
List all the distributed virtual portgroups for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_portgroups my-vmware-config
[ "List", "all", "the", "distributed", "virtual", "portgroups", "for", "this", "VMware", "environment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vmware.py#L1569-L1585
train
saltstack/salt
salt/cloud/clouds/vmware.py
list_clusters
def list_clusters(kwargs=None, call=None): ''' List all the clusters for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_clusters my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( 'The list_clusters function must be...
python
def list_clusters(kwargs=None, call=None): ''' List all the clusters for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_clusters my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( 'The list_clusters function must be...
[ "def", "list_clusters", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_clusters function must be called with '", "'-f or --function.'", ")", "return", "{", "'Clus...
List all the clusters for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_clusters my-vmware-config
[ "List", "all", "the", "clusters", "for", "this", "VMware", "environment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vmware.py#L1588-L1604
train
saltstack/salt
salt/cloud/clouds/vmware.py
list_datastore_clusters
def list_datastore_clusters(kwargs=None, call=None): ''' List all the datastore clusters for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_datastore_clusters my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( 'The ...
python
def list_datastore_clusters(kwargs=None, call=None): ''' List all the datastore clusters for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_datastore_clusters my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( 'The ...
[ "def", "list_datastore_clusters", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_datastore_clusters function must be called with '", "'-f or --function.'", ")", "retu...
List all the datastore clusters for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_datastore_clusters my-vmware-config
[ "List", "all", "the", "datastore", "clusters", "for", "this", "VMware", "environment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vmware.py#L1607-L1623
train
saltstack/salt
salt/cloud/clouds/vmware.py
list_datastores
def list_datastores(kwargs=None, call=None): ''' List all the datastores for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_datastores my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( 'The list_datastores function...
python
def list_datastores(kwargs=None, call=None): ''' List all the datastores for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_datastores my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( 'The list_datastores function...
[ "def", "list_datastores", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_datastores function must be called with '", "'-f or --function.'", ")", "return", "{", "'...
List all the datastores for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_datastores my-vmware-config
[ "List", "all", "the", "datastores", "for", "this", "VMware", "environment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vmware.py#L1626-L1642
train
saltstack/salt
salt/cloud/clouds/vmware.py
list_datastores_full
def list_datastores_full(kwargs=None, call=None): ''' List all the datastores for this VMware environment, with extra information CLI Example: .. code-block:: bash salt-cloud -f list_datastores_full my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( ...
python
def list_datastores_full(kwargs=None, call=None): ''' List all the datastores for this VMware environment, with extra information CLI Example: .. code-block:: bash salt-cloud -f list_datastores_full my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( ...
[ "def", "list_datastores_full", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_datastores_full function must be called with '", "'-f or --function.'", ")", "return", ...
List all the datastores for this VMware environment, with extra information CLI Example: .. code-block:: bash salt-cloud -f list_datastores_full my-vmware-config
[ "List", "all", "the", "datastores", "for", "this", "VMware", "environment", "with", "extra", "information" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vmware.py#L1645-L1661
train
saltstack/salt
salt/cloud/clouds/vmware.py
list_datastore_full
def list_datastore_full(kwargs=None, call=None, datastore=None): ''' Returns a dictionary with basic information for the given datastore CLI Example: .. code-block:: bash salt-cloud -f list_datastore_full my-vmware-config datastore=datastore-name ''' if call != 'function': rai...
python
def list_datastore_full(kwargs=None, call=None, datastore=None): ''' Returns a dictionary with basic information for the given datastore CLI Example: .. code-block:: bash salt-cloud -f list_datastore_full my-vmware-config datastore=datastore-name ''' if call != 'function': rai...
[ "def", "list_datastore_full", "(", "kwargs", "=", "None", ",", "call", "=", "None", ",", "datastore", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_datastore_full function must be called with '", "'-f o...
Returns a dictionary with basic information for the given datastore CLI Example: .. code-block:: bash salt-cloud -f list_datastore_full my-vmware-config datastore=datastore-name
[ "Returns", "a", "dictionary", "with", "basic", "information", "for", "the", "given", "datastore" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vmware.py#L1664-L1688
train
saltstack/salt
salt/cloud/clouds/vmware.py
list_hosts
def list_hosts(kwargs=None, call=None): ''' List all the hosts for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_hosts my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( 'The list_hosts function must be called with...
python
def list_hosts(kwargs=None, call=None): ''' List all the hosts for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_hosts my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( 'The list_hosts function must be called with...
[ "def", "list_hosts", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_hosts function must be called with '", "'-f or --function.'", ")", "return", "{", "'Hosts'", ...
List all the hosts for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_hosts my-vmware-config
[ "List", "all", "the", "hosts", "for", "this", "VMware", "environment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vmware.py#L1691-L1707
train
saltstack/salt
salt/cloud/clouds/vmware.py
list_resourcepools
def list_resourcepools(kwargs=None, call=None): ''' List all the resource pools for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_resourcepools my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( 'The list_resourcep...
python
def list_resourcepools(kwargs=None, call=None): ''' List all the resource pools for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_resourcepools my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( 'The list_resourcep...
[ "def", "list_resourcepools", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_resourcepools function must be called with '", "'-f or --function.'", ")", "return", "{"...
List all the resource pools for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_resourcepools my-vmware-config
[ "List", "all", "the", "resource", "pools", "for", "this", "VMware", "environment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vmware.py#L1710-L1726
train
saltstack/salt
salt/cloud/clouds/vmware.py
list_networks
def list_networks(kwargs=None, call=None): ''' List all the standard networks for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_networks my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( 'The list_networks functio...
python
def list_networks(kwargs=None, call=None): ''' List all the standard networks for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_networks my-vmware-config ''' if call != 'function': raise SaltCloudSystemExit( 'The list_networks functio...
[ "def", "list_networks", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "!=", "'function'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_networks function must be called with '", "'-f or --function.'", ")", "return", "{", "'Netw...
List all the standard networks for this VMware environment CLI Example: .. code-block:: bash salt-cloud -f list_networks my-vmware-config
[ "List", "all", "the", "standard", "networks", "for", "this", "VMware", "environment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vmware.py#L1729-L1745
train
saltstack/salt
salt/cloud/clouds/vmware.py
list_nodes_min
def list_nodes_min(kwargs=None, call=None): ''' Return a list of all VMs and templates that are on the specified provider, with no details CLI Example: .. code-block:: bash salt-cloud -f list_nodes_min my-vmware-config ''' if call == 'action': raise SaltCloudSystemExit( ...
python
def list_nodes_min(kwargs=None, call=None): ''' Return a list of all VMs and templates that are on the specified provider, with no details CLI Example: .. code-block:: bash salt-cloud -f list_nodes_min my-vmware-config ''' if call == 'action': raise SaltCloudSystemExit( ...
[ "def", "list_nodes_min", "(", "kwargs", "=", "None", ",", "call", "=", "None", ")", ":", "if", "call", "==", "'action'", ":", "raise", "SaltCloudSystemExit", "(", "'The list_nodes_min function must be called '", "'with -f or --function.'", ")", "ret", "=", "{", "}...
Return a list of all VMs and templates that are on the specified provider, with no details CLI Example: .. code-block:: bash salt-cloud -f list_nodes_min my-vmware-config
[ "Return", "a", "list", "of", "all", "VMs", "and", "templates", "that", "are", "on", "the", "specified", "provider", "with", "no", "details" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/vmware.py#L1748-L1772
train