id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
34,200 | saltstack/salt | salt/states/panos.py | _validate_response | def _validate_response(response):
'''
Validates a response from a Palo Alto device. Used to verify success of commands.
'''
if not response:
return False, 'Unable to validate response from device.'
elif 'msg' in response:
if 'line' in response['msg']:
if response['msg'][... | python | def _validate_response(response):
'''
Validates a response from a Palo Alto device. Used to verify success of commands.
'''
if not response:
return False, 'Unable to validate response from device.'
elif 'msg' in response:
if 'line' in response['msg']:
if response['msg'][... | [
"def",
"_validate_response",
"(",
"response",
")",
":",
"if",
"not",
"response",
":",
"return",
"False",
",",
"'Unable to validate response from device.'",
"elif",
"'msg'",
"in",
"response",
":",
"if",
"'line'",
"in",
"response",
"[",
"'msg'",
"]",
":",
"if",
... | Validates a response from a Palo Alto device. Used to verify success of commands. | [
"Validates",
"a",
"response",
"from",
"a",
"Palo",
"Alto",
"device",
".",
"Used",
"to",
"verify",
"success",
"of",
"commands",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L240-L265 |
34,201 | saltstack/salt | salt/states/panos.py | add_config_lock | def add_config_lock(name):
'''
Prevent other users from changing configuration until the lock is released.
name: The name of the module function to execute.
SLS Example:
.. code-block:: yaml
panos/takelock:
panos.add_config_lock
'''
ret = _default_ret(name)
ret.... | python | def add_config_lock(name):
'''
Prevent other users from changing configuration until the lock is released.
name: The name of the module function to execute.
SLS Example:
.. code-block:: yaml
panos/takelock:
panos.add_config_lock
'''
ret = _default_ret(name)
ret.... | [
"def",
"add_config_lock",
"(",
"name",
")",
":",
"ret",
"=",
"_default_ret",
"(",
"name",
")",
"ret",
".",
"update",
"(",
"{",
"'changes'",
":",
"__salt__",
"[",
"'panos.add_config_lock'",
"]",
"(",
")",
",",
"'result'",
":",
"True",
"}",
")",
"return",
... | Prevent other users from changing configuration until the lock is released.
name: The name of the module function to execute.
SLS Example:
.. code-block:: yaml
panos/takelock:
panos.add_config_lock | [
"Prevent",
"other",
"users",
"from",
"changing",
"configuration",
"until",
"the",
"lock",
"is",
"released",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L268-L289 |
34,202 | saltstack/salt | salt/states/panos.py | address_exists | def address_exists(name,
addressname=None,
vsys=1,
ipnetmask=None,
iprange=None,
fqdn=None,
description=None,
commit=False):
'''
Ensures that an address object exists in the confi... | python | def address_exists(name,
addressname=None,
vsys=1,
ipnetmask=None,
iprange=None,
fqdn=None,
description=None,
commit=False):
'''
Ensures that an address object exists in the confi... | [
"def",
"address_exists",
"(",
"name",
",",
"addressname",
"=",
"None",
",",
"vsys",
"=",
"1",
",",
"ipnetmask",
"=",
"None",
",",
"iprange",
"=",
"None",
",",
"fqdn",
"=",
"None",
",",
"description",
"=",
"None",
",",
"commit",
"=",
"False",
")",
":"... | Ensures that an address object exists in the configured state. If it does not exist or is not configured with the
specified attributes, it will be adjusted to match the specified values.
This module will only process a single address type (ip-netmask, ip-range, or fqdn). It will process the specified
value... | [
"Ensures",
"that",
"an",
"address",
"object",
"exists",
"in",
"the",
"configured",
"state",
".",
"If",
"it",
"does",
"not",
"exist",
"or",
"is",
"not",
"configured",
"with",
"the",
"specified",
"attributes",
"it",
"will",
"be",
"adjusted",
"to",
"match",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L292-L424 |
34,203 | saltstack/salt | salt/states/panos.py | commit_config | def commit_config(name):
'''
Commits the candidate configuration to the running configuration.
name: The name of the module function to execute.
SLS Example:
.. code-block:: yaml
panos/commit:
panos.commit_config
'''
ret = _default_ret(name)
ret.update({
... | python | def commit_config(name):
'''
Commits the candidate configuration to the running configuration.
name: The name of the module function to execute.
SLS Example:
.. code-block:: yaml
panos/commit:
panos.commit_config
'''
ret = _default_ret(name)
ret.update({
... | [
"def",
"commit_config",
"(",
"name",
")",
":",
"ret",
"=",
"_default_ret",
"(",
"name",
")",
"ret",
".",
"update",
"(",
"{",
"'commit'",
":",
"__salt__",
"[",
"'panos.commit'",
"]",
"(",
")",
",",
"'result'",
":",
"True",
"}",
")",
"return",
"ret"
] | Commits the candidate configuration to the running configuration.
name: The name of the module function to execute.
SLS Example:
.. code-block:: yaml
panos/commit:
panos.commit_config | [
"Commits",
"the",
"candidate",
"configuration",
"to",
"the",
"running",
"configuration",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L589-L610 |
34,204 | saltstack/salt | salt/states/panos.py | delete_config | def delete_config(name, xpath=None, commit=False):
'''
Deletes a Palo Alto XPATH to a specific value.
Use the xpath parameter to specify the location of the object to be deleted.
name: The name of the module function to execute.
xpath(str): The XPATH of the configuration API tree to control.
... | python | def delete_config(name, xpath=None, commit=False):
'''
Deletes a Palo Alto XPATH to a specific value.
Use the xpath parameter to specify the location of the object to be deleted.
name: The name of the module function to execute.
xpath(str): The XPATH of the configuration API tree to control.
... | [
"def",
"delete_config",
"(",
"name",
",",
"xpath",
"=",
"None",
",",
"commit",
"=",
"False",
")",
":",
"ret",
"=",
"_default_ret",
"(",
"name",
")",
"if",
"not",
"xpath",
":",
"return",
"ret",
"query",
"=",
"{",
"'type'",
":",
"'config'",
",",
"'acti... | Deletes a Palo Alto XPATH to a specific value.
Use the xpath parameter to specify the location of the object to be deleted.
name: The name of the module function to execute.
xpath(str): The XPATH of the configuration API tree to control.
commit(bool): If true the firewall will commit the changes, if... | [
"Deletes",
"a",
"Palo",
"Alto",
"XPATH",
"to",
"a",
"specific",
"value",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L613-L660 |
34,205 | saltstack/salt | salt/states/panos.py | download_software | def download_software(name, version=None, synch=False, check=False):
'''
Ensures that a software version is downloaded.
name: The name of the module function to execute.
version(str): The software version to check. If this version is not already downloaded, it will attempt to download
the file fro... | python | def download_software(name, version=None, synch=False, check=False):
'''
Ensures that a software version is downloaded.
name: The name of the module function to execute.
version(str): The software version to check. If this version is not already downloaded, it will attempt to download
the file fro... | [
"def",
"download_software",
"(",
"name",
",",
"version",
"=",
"None",
",",
"synch",
"=",
"False",
",",
"check",
"=",
"False",
")",
":",
"ret",
"=",
"_default_ret",
"(",
"name",
")",
"if",
"check",
"is",
"True",
":",
"__salt__",
"[",
"'panos.check_softwar... | Ensures that a software version is downloaded.
name: The name of the module function to execute.
version(str): The software version to check. If this version is not already downloaded, it will attempt to download
the file from Palo Alto.
synch(bool): If true, after downloading the file it will be syn... | [
"Ensures",
"that",
"a",
"software",
"version",
"is",
"downloaded",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L663-L733 |
34,206 | saltstack/salt | salt/states/panos.py | edit_config | def edit_config(name, xpath=None, value=None, commit=False):
'''
Edits a Palo Alto XPATH to a specific value. This will always overwrite the existing value, even if it is not
changed.
You can replace an existing object hierarchy at a specified location in the configuration with a new value. Use
the... | python | def edit_config(name, xpath=None, value=None, commit=False):
'''
Edits a Palo Alto XPATH to a specific value. This will always overwrite the existing value, even if it is not
changed.
You can replace an existing object hierarchy at a specified location in the configuration with a new value. Use
the... | [
"def",
"edit_config",
"(",
"name",
",",
"xpath",
"=",
"None",
",",
"value",
"=",
"None",
",",
"commit",
"=",
"False",
")",
":",
"ret",
"=",
"_default_ret",
"(",
"name",
")",
"# Verify if the current XPATH is equal to the specified value.",
"# If we are equal, no cha... | Edits a Palo Alto XPATH to a specific value. This will always overwrite the existing value, even if it is not
changed.
You can replace an existing object hierarchy at a specified location in the configuration with a new value. Use
the xpath parameter to specify the location of the object, including the nod... | [
"Edits",
"a",
"Palo",
"Alto",
"XPATH",
"to",
"a",
"specific",
"value",
".",
"This",
"will",
"always",
"overwrite",
"the",
"existing",
"value",
"even",
"if",
"it",
"is",
"not",
"changed",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L736-L815 |
34,207 | saltstack/salt | salt/states/panos.py | move_config | def move_config(name, xpath=None, where=None, dst=None, commit=False):
'''
Moves a XPATH value to a new location.
Use the xpath parameter to specify the location of the object to be moved, the where parameter to
specify type of move, and dst parameter to specify the destination path.
name: The nam... | python | def move_config(name, xpath=None, where=None, dst=None, commit=False):
'''
Moves a XPATH value to a new location.
Use the xpath parameter to specify the location of the object to be moved, the where parameter to
specify type of move, and dst parameter to specify the destination path.
name: The nam... | [
"def",
"move_config",
"(",
"name",
",",
"xpath",
"=",
"None",
",",
"where",
"=",
"None",
",",
"dst",
"=",
"None",
",",
"commit",
"=",
"False",
")",
":",
"ret",
"=",
"_default_ret",
"(",
"name",
")",
"if",
"not",
"xpath",
":",
"return",
"ret",
"if",... | Moves a XPATH value to a new location.
Use the xpath parameter to specify the location of the object to be moved, the where parameter to
specify type of move, and dst parameter to specify the destination path.
name: The name of the module function to execute.
xpath(str): The XPATH of the configuratio... | [
"Moves",
"a",
"XPATH",
"value",
"to",
"a",
"new",
"location",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L818-L888 |
34,208 | saltstack/salt | salt/states/panos.py | remove_config_lock | def remove_config_lock(name):
'''
Release config lock previously held.
name: The name of the module function to execute.
SLS Example:
.. code-block:: yaml
panos/takelock:
panos.remove_config_lock
'''
ret = _default_ret(name)
ret.update({
'changes': __sal... | python | def remove_config_lock(name):
'''
Release config lock previously held.
name: The name of the module function to execute.
SLS Example:
.. code-block:: yaml
panos/takelock:
panos.remove_config_lock
'''
ret = _default_ret(name)
ret.update({
'changes': __sal... | [
"def",
"remove_config_lock",
"(",
"name",
")",
":",
"ret",
"=",
"_default_ret",
"(",
"name",
")",
"ret",
".",
"update",
"(",
"{",
"'changes'",
":",
"__salt__",
"[",
"'panos.remove_config_lock'",
"]",
"(",
")",
",",
"'result'",
":",
"True",
"}",
")",
"ret... | Release config lock previously held.
name: The name of the module function to execute.
SLS Example:
.. code-block:: yaml
panos/takelock:
panos.remove_config_lock | [
"Release",
"config",
"lock",
"previously",
"held",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L891-L912 |
34,209 | saltstack/salt | salt/states/panos.py | service_exists | def service_exists(name, servicename=None, vsys=1, protocol=None, port=None, description=None, commit=False):
'''
Ensures that a service object exists in the configured state. If it does not exist or is not configured with the
specified attributes, it will be adjusted to match the specified values.
nam... | python | def service_exists(name, servicename=None, vsys=1, protocol=None, port=None, description=None, commit=False):
'''
Ensures that a service object exists in the configured state. If it does not exist or is not configured with the
specified attributes, it will be adjusted to match the specified values.
nam... | [
"def",
"service_exists",
"(",
"name",
",",
"servicename",
"=",
"None",
",",
"vsys",
"=",
"1",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"description",
"=",
"None",
",",
"commit",
"=",
"False",
")",
":",
"ret",
"=",
"_default_ret",
... | Ensures that a service object exists in the configured state. If it does not exist or is not configured with the
specified attributes, it will be adjusted to match the specified values.
name: The name of the module function to execute.
servicename(str): The name of the security object. The name is case-s... | [
"Ensures",
"that",
"a",
"service",
"object",
"exists",
"in",
"the",
"configured",
"state",
".",
"If",
"it",
"does",
"not",
"exist",
"or",
"is",
"not",
"configured",
"with",
"the",
"specified",
"attributes",
"it",
"will",
"be",
"adjusted",
"to",
"match",
"t... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L1331-L1438 |
34,210 | saltstack/salt | salt/states/panos.py | service_group_exists | def service_group_exists(name,
groupname=None,
vsys=1,
members=None,
description=None,
commit=False):
'''
Ensures that a service group object exists in the configured state. If it does no... | python | def service_group_exists(name,
groupname=None,
vsys=1,
members=None,
description=None,
commit=False):
'''
Ensures that a service group object exists in the configured state. If it does no... | [
"def",
"service_group_exists",
"(",
"name",
",",
"groupname",
"=",
"None",
",",
"vsys",
"=",
"1",
",",
"members",
"=",
"None",
",",
"description",
"=",
"None",
",",
"commit",
"=",
"False",
")",
":",
"ret",
"=",
"_default_ret",
"(",
"name",
")",
"if",
... | Ensures that a service group object exists in the configured state. If it does not exist or is not configured with
the specified attributes, it will be adjusted to match the specified values.
This module will enforce group membership. If a group exists and contains members this state does not include,
thos... | [
"Ensures",
"that",
"a",
"service",
"group",
"object",
"exists",
"in",
"the",
"configured",
"state",
".",
"If",
"it",
"does",
"not",
"exist",
"or",
"is",
"not",
"configured",
"with",
"the",
"specified",
"attributes",
"it",
"will",
"be",
"adjusted",
"to",
"m... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L1441-L1544 |
34,211 | saltstack/salt | salt/states/panos.py | set_config | def set_config(name, xpath=None, value=None, commit=False):
'''
Sets a Palo Alto XPATH to a specific value. This will always overwrite the existing value, even if it is not
changed.
You can add or create a new object at a specified location in the configuration hierarchy. Use the xpath parameter
to... | python | def set_config(name, xpath=None, value=None, commit=False):
'''
Sets a Palo Alto XPATH to a specific value. This will always overwrite the existing value, even if it is not
changed.
You can add or create a new object at a specified location in the configuration hierarchy. Use the xpath parameter
to... | [
"def",
"set_config",
"(",
"name",
",",
"xpath",
"=",
"None",
",",
"value",
"=",
"None",
",",
"commit",
"=",
"False",
")",
":",
"ret",
"=",
"_default_ret",
"(",
"name",
")",
"result",
",",
"msg",
"=",
"_set_config",
"(",
"xpath",
",",
"value",
")",
... | Sets a Palo Alto XPATH to a specific value. This will always overwrite the existing value, even if it is not
changed.
You can add or create a new object at a specified location in the configuration hierarchy. Use the xpath parameter
to specify the location of the object in the configuration
name: The ... | [
"Sets",
"a",
"Palo",
"Alto",
"XPATH",
"to",
"a",
"specific",
"value",
".",
"This",
"will",
"always",
"overwrite",
"the",
"existing",
"value",
"even",
"if",
"it",
"is",
"not",
"changed",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/panos.py#L1547-L1592 |
34,212 | saltstack/salt | salt/modules/cmdmod.py | _check_cb | def _check_cb(cb_):
'''
If the callback is None or is not callable, return a lambda that returns
the value passed.
'''
if cb_ is not None:
if hasattr(cb_, '__call__'):
return cb_
else:
log.error('log_callback is not callable, ignoring')
return lambda x: x | python | def _check_cb(cb_):
'''
If the callback is None or is not callable, return a lambda that returns
the value passed.
'''
if cb_ is not None:
if hasattr(cb_, '__call__'):
return cb_
else:
log.error('log_callback is not callable, ignoring')
return lambda x: x | [
"def",
"_check_cb",
"(",
"cb_",
")",
":",
"if",
"cb_",
"is",
"not",
"None",
":",
"if",
"hasattr",
"(",
"cb_",
",",
"'__call__'",
")",
":",
"return",
"cb_",
"else",
":",
"log",
".",
"error",
"(",
"'log_callback is not callable, ignoring'",
")",
"return",
... | If the callback is None or is not callable, return a lambda that returns
the value passed. | [
"If",
"the",
"callback",
"is",
"None",
"or",
"is",
"not",
"callable",
"return",
"a",
"lambda",
"that",
"returns",
"the",
"value",
"passed",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L79-L89 |
34,213 | saltstack/salt | salt/modules/cmdmod.py | _render_cmd | def _render_cmd(cmd, cwd, template, saltenv='base', pillarenv=None, pillar_override=None):
'''
If template is a valid template engine, process the cmd and cwd through
that engine.
'''
if not template:
return (cmd, cwd)
# render the path as a template using path_template_engine as the en... | python | def _render_cmd(cmd, cwd, template, saltenv='base', pillarenv=None, pillar_override=None):
'''
If template is a valid template engine, process the cmd and cwd through
that engine.
'''
if not template:
return (cmd, cwd)
# render the path as a template using path_template_engine as the en... | [
"def",
"_render_cmd",
"(",
"cmd",
",",
"cwd",
",",
"template",
",",
"saltenv",
"=",
"'base'",
",",
"pillarenv",
"=",
"None",
",",
"pillar_override",
"=",
"None",
")",
":",
"if",
"not",
"template",
":",
"return",
"(",
"cmd",
",",
"cwd",
")",
"# render t... | If template is a valid template engine, process the cmd and cwd through
that engine. | [
"If",
"template",
"is",
"a",
"valid",
"template",
"engine",
"process",
"the",
"cmd",
"and",
"cwd",
"through",
"that",
"engine",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L123-L172 |
34,214 | saltstack/salt | salt/modules/cmdmod.py | _check_avail | def _check_avail(cmd):
'''
Check to see if the given command can be run
'''
if isinstance(cmd, list):
cmd = ' '.join([six.text_type(x) if not isinstance(x, six.string_types) else x
for x in cmd])
bret = True
wret = False
if __salt__['config.get']('cmd_blacklis... | python | def _check_avail(cmd):
'''
Check to see if the given command can be run
'''
if isinstance(cmd, list):
cmd = ' '.join([six.text_type(x) if not isinstance(x, six.string_types) else x
for x in cmd])
bret = True
wret = False
if __salt__['config.get']('cmd_blacklis... | [
"def",
"_check_avail",
"(",
"cmd",
")",
":",
"if",
"isinstance",
"(",
"cmd",
",",
"list",
")",
":",
"cmd",
"=",
"' '",
".",
"join",
"(",
"[",
"six",
".",
"text_type",
"(",
"x",
")",
"if",
"not",
"isinstance",
"(",
"x",
",",
"six",
".",
"string_ty... | Check to see if the given command can be run | [
"Check",
"to",
"see",
"if",
"the",
"given",
"command",
"can",
"be",
"run"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L222-L247 |
34,215 | saltstack/salt | salt/modules/cmdmod.py | _run_quiet | def _run_quiet(cmd,
cwd=None,
stdin=None,
output_encoding=None,
runas=None,
shell=DEFAULT_SHELL,
python_shell=False,
env=None,
template=None,
umask=None,
timeout=None,
... | python | def _run_quiet(cmd,
cwd=None,
stdin=None,
output_encoding=None,
runas=None,
shell=DEFAULT_SHELL,
python_shell=False,
env=None,
template=None,
umask=None,
timeout=None,
... | [
"def",
"_run_quiet",
"(",
"cmd",
",",
"cwd",
"=",
"None",
",",
"stdin",
"=",
"None",
",",
"output_encoding",
"=",
"None",
",",
"runas",
"=",
"None",
",",
"shell",
"=",
"DEFAULT_SHELL",
",",
"python_shell",
"=",
"False",
",",
"env",
"=",
"None",
",",
... | Helper for running commands quietly for minion startup | [
"Helper",
"for",
"running",
"commands",
"quietly",
"for",
"minion",
"startup"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cmdmod.py#L861-L902 |
34,216 | saltstack/salt | salt/modules/zoneadm.py | _is_globalzone | def _is_globalzone():
'''
Check if we are running in the globalzone
'''
if not __grains__['kernel'] == 'SunOS':
return False
zonename = __salt__['cmd.run_all']('zonename')
if zonename['retcode']:
return False
if zonename['stdout'] == 'global':
return True
return... | python | def _is_globalzone():
'''
Check if we are running in the globalzone
'''
if not __grains__['kernel'] == 'SunOS':
return False
zonename = __salt__['cmd.run_all']('zonename')
if zonename['retcode']:
return False
if zonename['stdout'] == 'global':
return True
return... | [
"def",
"_is_globalzone",
"(",
")",
":",
"if",
"not",
"__grains__",
"[",
"'kernel'",
"]",
"==",
"'SunOS'",
":",
"return",
"False",
"zonename",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"'zonename'",
")",
"if",
"zonename",
"[",
"'retcode'",
"]",
":",
... | Check if we are running in the globalzone | [
"Check",
"if",
"we",
"are",
"running",
"in",
"the",
"globalzone"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L36-L49 |
34,217 | saltstack/salt | salt/modules/zoneadm.py | list_zones | def list_zones(verbose=True, installed=False, configured=False, hide_global=True):
'''
List all zones
verbose : boolean
display additional zone information
installed : boolean
include installed zones in output
configured : boolean
include configured zones in output
hide_... | python | def list_zones(verbose=True, installed=False, configured=False, hide_global=True):
'''
List all zones
verbose : boolean
display additional zone information
installed : boolean
include installed zones in output
configured : boolean
include configured zones in output
hide_... | [
"def",
"list_zones",
"(",
"verbose",
"=",
"True",
",",
"installed",
"=",
"False",
",",
"configured",
"=",
"False",
",",
"hide_global",
"=",
"True",
")",
":",
"zones",
"=",
"{",
"}",
"## fetch zones",
"header",
"=",
"'zoneid:zonename:state:zonepath:uuid:brand:ip-... | List all zones
verbose : boolean
display additional zone information
installed : boolean
include installed zones in output
configured : boolean
include configured zones in output
hide_global : boolean
do not include global zone
CLI Example:
.. code-block:: bash... | [
"List",
"all",
"zones"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L77-L124 |
34,218 | saltstack/salt | salt/modules/zoneadm.py | attach | def attach(zone, force=False, brand_opts=None):
'''
Attach the specified zone.
zone : string
name of the zone
force : boolean
force the zone into the "installed" state with no validation
brand_opts : string
brand specific options to pass
CLI Example:
.. code-block:... | python | def attach(zone, force=False, brand_opts=None):
'''
Attach the specified zone.
zone : string
name of the zone
force : boolean
force the zone into the "installed" state with no validation
brand_opts : string
brand specific options to pass
CLI Example:
.. code-block:... | [
"def",
"attach",
"(",
"zone",
",",
"force",
"=",
"False",
",",
"brand_opts",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'status'",
":",
"True",
"}",
"## attach zone",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"'zoneadm -z {zone} attach{force}{bra... | Attach the specified zone.
zone : string
name of the zone
force : boolean
force the zone into the "installed" state with no validation
brand_opts : string
brand specific options to pass
CLI Example:
.. code-block:: bash
salt '*' zoneadm.attach lawrence
sal... | [
"Attach",
"the",
"specified",
"zone",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L334-L366 |
34,219 | saltstack/salt | salt/modules/zoneadm.py | ready | def ready(zone):
'''
Prepares a zone for running applications.
zone : string
name or uuid of the zone
CLI Example:
.. code-block:: bash
salt '*' zoneadm.ready clementine
'''
ret = {'status': True}
## ready zone
res = __salt__['cmd.run_all']('zoneadm {zone} ready'... | python | def ready(zone):
'''
Prepares a zone for running applications.
zone : string
name or uuid of the zone
CLI Example:
.. code-block:: bash
salt '*' zoneadm.ready clementine
'''
ret = {'status': True}
## ready zone
res = __salt__['cmd.run_all']('zoneadm {zone} ready'... | [
"def",
"ready",
"(",
"zone",
")",
":",
"ret",
"=",
"{",
"'status'",
":",
"True",
"}",
"## ready zone",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"'zoneadm {zone} ready'",
".",
"format",
"(",
"zone",
"=",
"'-u {0}'",
".",
"format",
"(",
"zon... | Prepares a zone for running applications.
zone : string
name or uuid of the zone
CLI Example:
.. code-block:: bash
salt '*' zoneadm.ready clementine | [
"Prepares",
"a",
"zone",
"for",
"running",
"applications",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L369-L394 |
34,220 | saltstack/salt | salt/modules/zoneadm.py | verify | def verify(zone):
'''
Check to make sure the configuration of the specified
zone can safely be installed on the machine.
zone : string
name of the zone
CLI Example:
.. code-block:: bash
salt '*' zoneadm.verify dolores
'''
ret = {'status': True}
## verify zone
... | python | def verify(zone):
'''
Check to make sure the configuration of the specified
zone can safely be installed on the machine.
zone : string
name of the zone
CLI Example:
.. code-block:: bash
salt '*' zoneadm.verify dolores
'''
ret = {'status': True}
## verify zone
... | [
"def",
"verify",
"(",
"zone",
")",
":",
"ret",
"=",
"{",
"'status'",
":",
"True",
"}",
"## verify zone",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"'zoneadm -z {zone} verify'",
".",
"format",
"(",
"zone",
"=",
"zone",
",",
")",
")",
"ret",
... | Check to make sure the configuration of the specified
zone can safely be installed on the machine.
zone : string
name of the zone
CLI Example:
.. code-block:: bash
salt '*' zoneadm.verify dolores | [
"Check",
"to",
"make",
"sure",
"the",
"configuration",
"of",
"the",
"specified",
"zone",
"can",
"safely",
"be",
"installed",
"on",
"the",
"machine",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L397-L423 |
34,221 | saltstack/salt | salt/modules/zoneadm.py | move | def move(zone, zonepath):
'''
Move zone to new zonepath.
zone : string
name or uuid of the zone
zonepath : string
new zonepath
CLI Example:
.. code-block:: bash
salt '*' zoneadm.move meave /sweetwater/meave
'''
ret = {'status': True}
## verify zone
re... | python | def move(zone, zonepath):
'''
Move zone to new zonepath.
zone : string
name or uuid of the zone
zonepath : string
new zonepath
CLI Example:
.. code-block:: bash
salt '*' zoneadm.move meave /sweetwater/meave
'''
ret = {'status': True}
## verify zone
re... | [
"def",
"move",
"(",
"zone",
",",
"zonepath",
")",
":",
"ret",
"=",
"{",
"'status'",
":",
"True",
"}",
"## verify zone",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"'zoneadm {zone} move {path}'",
".",
"format",
"(",
"zone",
"=",
"'-u {0}'",
"."... | Move zone to new zonepath.
zone : string
name or uuid of the zone
zonepath : string
new zonepath
CLI Example:
.. code-block:: bash
salt '*' zoneadm.move meave /sweetwater/meave | [
"Move",
"zone",
"to",
"new",
"zonepath",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L426-L454 |
34,222 | saltstack/salt | salt/modules/zoneadm.py | install | def install(zone, nodataset=False, brand_opts=None):
'''
Install the specified zone from the system.
zone : string
name of the zone
nodataset : boolean
do not create a ZFS file system
brand_opts : string
brand specific options to pass
CLI Example:
.. code-block:: b... | python | def install(zone, nodataset=False, brand_opts=None):
'''
Install the specified zone from the system.
zone : string
name of the zone
nodataset : boolean
do not create a ZFS file system
brand_opts : string
brand specific options to pass
CLI Example:
.. code-block:: b... | [
"def",
"install",
"(",
"zone",
",",
"nodataset",
"=",
"False",
",",
"brand_opts",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'status'",
":",
"True",
"}",
"## install zone",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"'zoneadm -z {zone} install{nod... | Install the specified zone from the system.
zone : string
name of the zone
nodataset : boolean
do not create a ZFS file system
brand_opts : string
brand specific options to pass
CLI Example:
.. code-block:: bash
salt '*' zoneadm.install dolores
salt '*' zo... | [
"Install",
"the",
"specified",
"zone",
"from",
"the",
"system",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L488-L520 |
34,223 | saltstack/salt | salt/modules/zoneadm.py | clone | def clone(zone, source, snapshot=None):
'''
Install a zone by copying an existing installed zone.
zone : string
name of the zone
source : string
zone to clone from
snapshot : string
optional name of snapshot to use as source
CLI Example:
.. code-block:: bash
... | python | def clone(zone, source, snapshot=None):
'''
Install a zone by copying an existing installed zone.
zone : string
name of the zone
source : string
zone to clone from
snapshot : string
optional name of snapshot to use as source
CLI Example:
.. code-block:: bash
... | [
"def",
"clone",
"(",
"zone",
",",
"source",
",",
"snapshot",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'status'",
":",
"True",
"}",
"## install zone",
"res",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"'zoneadm -z {zone} clone {snapshot}{source}'",
".",
... | Install a zone by copying an existing installed zone.
zone : string
name of the zone
source : string
zone to clone from
snapshot : string
optional name of snapshot to use as source
CLI Example:
.. code-block:: bash
salt '*' zoneadm.clone clementine dolores | [
"Install",
"a",
"zone",
"by",
"copying",
"an",
"existing",
"installed",
"zone",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zoneadm.py#L523-L554 |
34,224 | saltstack/salt | salt/fileserver/azurefs.py | envs | def envs():
'''
Each container configuration can have an environment setting, or defaults
to base
'''
saltenvs = []
for container in __opts__.get('azurefs', []):
saltenvs.append(container.get('saltenv', 'base'))
# Remove duplicates
return list(set(saltenvs)) | python | def envs():
'''
Each container configuration can have an environment setting, or defaults
to base
'''
saltenvs = []
for container in __opts__.get('azurefs', []):
saltenvs.append(container.get('saltenv', 'base'))
# Remove duplicates
return list(set(saltenvs)) | [
"def",
"envs",
"(",
")",
":",
"saltenvs",
"=",
"[",
"]",
"for",
"container",
"in",
"__opts__",
".",
"get",
"(",
"'azurefs'",
",",
"[",
"]",
")",
":",
"saltenvs",
".",
"append",
"(",
"container",
".",
"get",
"(",
"'saltenv'",
",",
"'base'",
")",
")"... | Each container configuration can have an environment setting, or defaults
to base | [
"Each",
"container",
"configuration",
"can",
"have",
"an",
"environment",
"setting",
"or",
"defaults",
"to",
"base"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L136-L145 |
34,225 | saltstack/salt | salt/fileserver/azurefs.py | file_hash | def file_hash(load, fnd):
'''
Return a file hash based on the hash type set in the master config
'''
if not all(x in load for x in ('path', 'saltenv')):
return '', None
ret = {'hash_type': __opts__['hash_type']}
relpath = fnd['rel']
path = fnd['path']
hash_cachedir = os.path.join... | python | def file_hash(load, fnd):
'''
Return a file hash based on the hash type set in the master config
'''
if not all(x in load for x in ('path', 'saltenv')):
return '', None
ret = {'hash_type': __opts__['hash_type']}
relpath = fnd['rel']
path = fnd['path']
hash_cachedir = os.path.join... | [
"def",
"file_hash",
"(",
"load",
",",
"fnd",
")",
":",
"if",
"not",
"all",
"(",
"x",
"in",
"load",
"for",
"x",
"in",
"(",
"'path'",
",",
"'saltenv'",
")",
")",
":",
"return",
"''",
",",
"None",
"ret",
"=",
"{",
"'hash_type'",
":",
"__opts__",
"["... | Return a file hash based on the hash type set in the master config | [
"Return",
"a",
"file",
"hash",
"based",
"on",
"the",
"hash",
"type",
"set",
"in",
"the",
"master",
"config"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L275-L299 |
34,226 | saltstack/salt | salt/fileserver/azurefs.py | file_list | def file_list(load):
'''
Return a list of all files in a specified environment
'''
ret = set()
try:
for container in __opts__['azurefs']:
if container.get('saltenv', 'base') != load['saltenv']:
continue
container_list = _get_container_path(container) +... | python | def file_list(load):
'''
Return a list of all files in a specified environment
'''
ret = set()
try:
for container in __opts__['azurefs']:
if container.get('saltenv', 'base') != load['saltenv']:
continue
container_list = _get_container_path(container) +... | [
"def",
"file_list",
"(",
"load",
")",
":",
"ret",
"=",
"set",
"(",
")",
"try",
":",
"for",
"container",
"in",
"__opts__",
"[",
"'azurefs'",
"]",
":",
"if",
"container",
".",
"get",
"(",
"'saltenv'",
",",
"'base'",
")",
"!=",
"load",
"[",
"'saltenv'",... | Return a list of all files in a specified environment | [
"Return",
"a",
"list",
"of",
"all",
"files",
"in",
"a",
"specified",
"environment"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L302-L323 |
34,227 | saltstack/salt | salt/fileserver/azurefs.py | dir_list | def dir_list(load):
'''
Return a list of all directories in a specified environment
'''
ret = set()
files = file_list(load)
for f in files:
dirname = f
while dirname:
dirname = os.path.dirname(dirname)
if dirname:
ret.add(dirname)
retur... | python | def dir_list(load):
'''
Return a list of all directories in a specified environment
'''
ret = set()
files = file_list(load)
for f in files:
dirname = f
while dirname:
dirname = os.path.dirname(dirname)
if dirname:
ret.add(dirname)
retur... | [
"def",
"dir_list",
"(",
"load",
")",
":",
"ret",
"=",
"set",
"(",
")",
"files",
"=",
"file_list",
"(",
"load",
")",
"for",
"f",
"in",
"files",
":",
"dirname",
"=",
"f",
"while",
"dirname",
":",
"dirname",
"=",
"os",
".",
"path",
".",
"dirname",
"... | Return a list of all directories in a specified environment | [
"Return",
"a",
"list",
"of",
"all",
"directories",
"in",
"a",
"specified",
"environment"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L326-L338 |
34,228 | saltstack/salt | salt/fileserver/azurefs.py | _get_container_path | def _get_container_path(container):
'''
Get the cache path for the container in question
Cache paths are generate by combining the account name, container name,
and saltenv, separated by underscores
'''
root = os.path.join(__opts__['cachedir'], 'azurefs')
container_dir = '{0}_{1}_{2}'.forma... | python | def _get_container_path(container):
'''
Get the cache path for the container in question
Cache paths are generate by combining the account name, container name,
and saltenv, separated by underscores
'''
root = os.path.join(__opts__['cachedir'], 'azurefs')
container_dir = '{0}_{1}_{2}'.forma... | [
"def",
"_get_container_path",
"(",
"container",
")",
":",
"root",
"=",
"os",
".",
"path",
".",
"join",
"(",
"__opts__",
"[",
"'cachedir'",
"]",
",",
"'azurefs'",
")",
"container_dir",
"=",
"'{0}_{1}_{2}'",
".",
"format",
"(",
"container",
".",
"get",
"(",
... | Get the cache path for the container in question
Cache paths are generate by combining the account name, container name,
and saltenv, separated by underscores | [
"Get",
"the",
"cache",
"path",
"for",
"the",
"container",
"in",
"question"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L341-L352 |
34,229 | saltstack/salt | salt/fileserver/azurefs.py | _get_container_service | def _get_container_service(container):
'''
Get the azure block blob service for the container in question
Try account_key, sas_token, and no auth in that order
'''
if 'account_key' in container:
account = azure.storage.CloudStorageAccount(container['account_name'], account_key=container['ac... | python | def _get_container_service(container):
'''
Get the azure block blob service for the container in question
Try account_key, sas_token, and no auth in that order
'''
if 'account_key' in container:
account = azure.storage.CloudStorageAccount(container['account_name'], account_key=container['ac... | [
"def",
"_get_container_service",
"(",
"container",
")",
":",
"if",
"'account_key'",
"in",
"container",
":",
"account",
"=",
"azure",
".",
"storage",
".",
"CloudStorageAccount",
"(",
"container",
"[",
"'account_name'",
"]",
",",
"account_key",
"=",
"container",
"... | Get the azure block blob service for the container in question
Try account_key, sas_token, and no auth in that order | [
"Get",
"the",
"azure",
"block",
"blob",
"service",
"for",
"the",
"container",
"in",
"question"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L355-L368 |
34,230 | saltstack/salt | salt/fileserver/azurefs.py | _validate_config | def _validate_config():
'''
Validate azurefs config, return False if it doesn't validate
'''
if not isinstance(__opts__['azurefs'], list):
log.error('azurefs configuration is not formed as a list, skipping azurefs')
return False
for container in __opts__['azurefs']:
if not is... | python | def _validate_config():
'''
Validate azurefs config, return False if it doesn't validate
'''
if not isinstance(__opts__['azurefs'], list):
log.error('azurefs configuration is not formed as a list, skipping azurefs')
return False
for container in __opts__['azurefs']:
if not is... | [
"def",
"_validate_config",
"(",
")",
":",
"if",
"not",
"isinstance",
"(",
"__opts__",
"[",
"'azurefs'",
"]",
",",
"list",
")",
":",
"log",
".",
"error",
"(",
"'azurefs configuration is not formed as a list, skipping azurefs'",
")",
"return",
"False",
"for",
"conta... | Validate azurefs config, return False if it doesn't validate | [
"Validate",
"azurefs",
"config",
"return",
"False",
"if",
"it",
"doesn",
"t",
"validate"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/azurefs.py#L371-L391 |
34,231 | saltstack/salt | salt/grains/smartos.py | _smartos_computenode_data | def _smartos_computenode_data():
'''
Return useful information from a SmartOS compute node
'''
# Provides:
# vms_total
# vms_running
# vms_stopped
# vms_type
# sdc_version
# vm_capable
# vm_hw_virt
grains = {}
# collect vm data
vms = {}
for vm ... | python | def _smartos_computenode_data():
'''
Return useful information from a SmartOS compute node
'''
# Provides:
# vms_total
# vms_running
# vms_stopped
# vms_type
# sdc_version
# vm_capable
# vm_hw_virt
grains = {}
# collect vm data
vms = {}
for vm ... | [
"def",
"_smartos_computenode_data",
"(",
")",
":",
"# Provides:",
"# vms_total",
"# vms_running",
"# vms_stopped",
"# vms_type",
"# sdc_version",
"# vm_capable",
"# vm_hw_virt",
"grains",
"=",
"{",
"}",
"# collect vm data",
"vms",
"=",
"{",
"}",
"for",
"vm... | Return useful information from a SmartOS compute node | [
"Return",
"useful",
"information",
"from",
"a",
"SmartOS",
"compute",
"node"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/smartos.py#L49-L99 |
34,232 | saltstack/salt | salt/grains/smartos.py | _smartos_zone_data | def _smartos_zone_data():
'''
Return useful information from a SmartOS zone
'''
# Provides:
# zoneid
# zonename
# imageversion
grains = {
'zoneid': __salt__['cmd.run']('zoneadm list -p | awk -F: \'{ print $1 }\'', python_shell=True),
'zonename': __salt__['cmd.run']... | python | def _smartos_zone_data():
'''
Return useful information from a SmartOS zone
'''
# Provides:
# zoneid
# zonename
# imageversion
grains = {
'zoneid': __salt__['cmd.run']('zoneadm list -p | awk -F: \'{ print $1 }\'', python_shell=True),
'zonename': __salt__['cmd.run']... | [
"def",
"_smartos_zone_data",
"(",
")",
":",
"# Provides:",
"# zoneid",
"# zonename",
"# imageversion",
"grains",
"=",
"{",
"'zoneid'",
":",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"'zoneadm list -p | awk -F: \\'{ print $1 }\\''",
",",
"python_shell",
"=",
"True",
... | Return useful information from a SmartOS zone | [
"Return",
"useful",
"information",
"from",
"a",
"SmartOS",
"zone"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/smartos.py#L102-L126 |
34,233 | saltstack/salt | salt/grains/smartos.py | smartos | def smartos():
'''
Provide grains for SmartOS
'''
grains = {}
if salt.utils.platform.is_smartos_zone():
grains = salt.utils.dictupdate.update(grains, _smartos_zone_data(), merge_lists=True)
grains = salt.utils.dictupdate.update(grains, _smartos_zone_pkgsrc_data(), merge_lists=True)
... | python | def smartos():
'''
Provide grains for SmartOS
'''
grains = {}
if salt.utils.platform.is_smartos_zone():
grains = salt.utils.dictupdate.update(grains, _smartos_zone_data(), merge_lists=True)
grains = salt.utils.dictupdate.update(grains, _smartos_zone_pkgsrc_data(), merge_lists=True)
... | [
"def",
"smartos",
"(",
")",
":",
"grains",
"=",
"{",
"}",
"if",
"salt",
".",
"utils",
".",
"platform",
".",
"is_smartos_zone",
"(",
")",
":",
"grains",
"=",
"salt",
".",
"utils",
".",
"dictupdate",
".",
"update",
"(",
"grains",
",",
"_smartos_zone_data... | Provide grains for SmartOS | [
"Provide",
"grains",
"for",
"SmartOS"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/smartos.py#L185-L198 |
34,234 | saltstack/salt | salt/engines/logentries.py | start | def start(endpoint='data.logentries.com',
port=10000,
token=None,
tag='salt/engines/logentries'):
'''
Listen to salt events and forward them to Logentries
'''
if __opts__.get('id').endswith('_master'):
event_bus = salt.utils.event.get_master_event(
__opt... | python | def start(endpoint='data.logentries.com',
port=10000,
token=None,
tag='salt/engines/logentries'):
'''
Listen to salt events and forward them to Logentries
'''
if __opts__.get('id').endswith('_master'):
event_bus = salt.utils.event.get_master_event(
__opt... | [
"def",
"start",
"(",
"endpoint",
"=",
"'data.logentries.com'",
",",
"port",
"=",
"10000",
",",
"token",
"=",
"None",
",",
"tag",
"=",
"'salt/engines/logentries'",
")",
":",
"if",
"__opts__",
".",
"get",
"(",
"'id'",
")",
".",
"endswith",
"(",
"'_master'",
... | Listen to salt events and forward them to Logentries | [
"Listen",
"to",
"salt",
"events",
"and",
"forward",
"them",
"to",
"Logentries"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/logentries.py#L174-L215 |
34,235 | saltstack/salt | salt/states/glusterfs.py | peered | def peered(name):
'''
Check if node is peered.
name
The remote host with which to peer.
.. code-block:: yaml
peer-cluster:
glusterfs.peered:
- name: two
peer-clusters:
glusterfs.peered:
- names:
- one
- t... | python | def peered(name):
'''
Check if node is peered.
name
The remote host with which to peer.
.. code-block:: yaml
peer-cluster:
glusterfs.peered:
- name: two
peer-clusters:
glusterfs.peered:
- names:
- one
- t... | [
"def",
"peered",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
",",
"'result'",
":",
"False",
"}",
"try",
":",
"suc",
".",
"check_name",
"(",
"name",
",",
"'a-zA-Z0-9._-... | Check if node is peered.
name
The remote host with which to peer.
.. code-block:: yaml
peer-cluster:
glusterfs.peered:
- name: two
peer-clusters:
glusterfs.peered:
- names:
- one
- two
- three
... | [
"Check",
"if",
"node",
"is",
"peered",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/glusterfs.py#L40-L108 |
34,236 | saltstack/salt | salt/states/glusterfs.py | volume_present | def volume_present(name, bricks, stripe=False, replica=False, device_vg=False,
transport='tcp', start=False, force=False, arbiter=False):
'''
Ensure that the volume exists
name
name of the volume
bricks
list of brick paths
replica
replica count for volum... | python | def volume_present(name, bricks, stripe=False, replica=False, device_vg=False,
transport='tcp', start=False, force=False, arbiter=False):
'''
Ensure that the volume exists
name
name of the volume
bricks
list of brick paths
replica
replica count for volum... | [
"def",
"volume_present",
"(",
"name",
",",
"bricks",
",",
"stripe",
"=",
"False",
",",
"replica",
"=",
"False",
",",
"device_vg",
"=",
"False",
",",
"transport",
"=",
"'tcp'",
",",
"start",
"=",
"False",
",",
"force",
"=",
"False",
",",
"arbiter",
"=",... | Ensure that the volume exists
name
name of the volume
bricks
list of brick paths
replica
replica count for volume
arbiter
use every third brick as arbiter (metadata only)
.. versionadded:: 2019.2.0
start
ensure that the volume is also started
... | [
"Ensure",
"that",
"the",
"volume",
"exists"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/glusterfs.py#L111-L222 |
34,237 | saltstack/salt | salt/states/glusterfs.py | started | def started(name):
'''
Check if volume has been started
name
name of the volume
.. code-block:: yaml
mycluster:
glusterfs.started: []
'''
ret = {'name': name,
'changes': {},
'comment': '',
'result': False}
volinfo = __salt__['glu... | python | def started(name):
'''
Check if volume has been started
name
name of the volume
.. code-block:: yaml
mycluster:
glusterfs.started: []
'''
ret = {'name': name,
'changes': {},
'comment': '',
'result': False}
volinfo = __salt__['glu... | [
"def",
"started",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
",",
"'result'",
":",
"False",
"}",
"volinfo",
"=",
"__salt__",
"[",
"'glusterfs.info'",
"]",
"(",
")",
"... | Check if volume has been started
name
name of the volume
.. code-block:: yaml
mycluster:
glusterfs.started: [] | [
"Check",
"if",
"volume",
"has",
"been",
"started"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/glusterfs.py#L225-L266 |
34,238 | saltstack/salt | salt/returners/nagios_nrdp_return.py | _prepare_xml | def _prepare_xml(options=None, state=None):
'''
Get the requests options from salt.
'''
if state:
_state = '0'
else:
_state = '2'
xml = "<?xml version='1.0'?>\n<checkresults>\n"
# No service defined then we set the status of the hostname
if 'service' in options and opt... | python | def _prepare_xml(options=None, state=None):
'''
Get the requests options from salt.
'''
if state:
_state = '0'
else:
_state = '2'
xml = "<?xml version='1.0'?>\n<checkresults>\n"
# No service defined then we set the status of the hostname
if 'service' in options and opt... | [
"def",
"_prepare_xml",
"(",
"options",
"=",
"None",
",",
"state",
"=",
"None",
")",
":",
"if",
"state",
":",
"_state",
"=",
"'0'",
"else",
":",
"_state",
"=",
"'2'",
"xml",
"=",
"\"<?xml version='1.0'?>\\n<checkresults>\\n\"",
"# No service defined then we set the... | Get the requests options from salt. | [
"Get",
"the",
"requests",
"options",
"from",
"salt",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/nagios_nrdp_return.py#L108-L138 |
34,239 | saltstack/salt | salt/returners/nagios_nrdp_return.py | _getText | def _getText(nodelist):
'''
Simple function to return value from XML
'''
rc = []
for node in nodelist:
if node.nodeType == node.TEXT_NODE:
rc.append(node.data)
return ''.join(rc) | python | def _getText(nodelist):
'''
Simple function to return value from XML
'''
rc = []
for node in nodelist:
if node.nodeType == node.TEXT_NODE:
rc.append(node.data)
return ''.join(rc) | [
"def",
"_getText",
"(",
"nodelist",
")",
":",
"rc",
"=",
"[",
"]",
"for",
"node",
"in",
"nodelist",
":",
"if",
"node",
".",
"nodeType",
"==",
"node",
".",
"TEXT_NODE",
":",
"rc",
".",
"append",
"(",
"node",
".",
"data",
")",
"return",
"''",
".",
... | Simple function to return value from XML | [
"Simple",
"function",
"to",
"return",
"value",
"from",
"XML"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/nagios_nrdp_return.py#L141-L149 |
34,240 | saltstack/salt | salt/returners/nagios_nrdp_return.py | _post_data | def _post_data(options=None, xml=None):
'''
Post data to Nagios NRDP
'''
params = {'token': options['token'].strip(), 'cmd': 'submitcheck', 'XMLDATA': xml}
res = salt.utils.http.query(
url=options['url'],
method='POST',
params=params,
data='',
decode=True,
... | python | def _post_data(options=None, xml=None):
'''
Post data to Nagios NRDP
'''
params = {'token': options['token'].strip(), 'cmd': 'submitcheck', 'XMLDATA': xml}
res = salt.utils.http.query(
url=options['url'],
method='POST',
params=params,
data='',
decode=True,
... | [
"def",
"_post_data",
"(",
"options",
"=",
"None",
",",
"xml",
"=",
"None",
")",
":",
"params",
"=",
"{",
"'token'",
":",
"options",
"[",
"'token'",
"]",
".",
"strip",
"(",
")",
",",
"'cmd'",
":",
"'submitcheck'",
",",
"'XMLDATA'",
":",
"xml",
"}",
... | Post data to Nagios NRDP | [
"Post",
"data",
"to",
"Nagios",
"NRDP"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/nagios_nrdp_return.py#L152-L184 |
34,241 | saltstack/salt | salt/returners/nagios_nrdp_return.py | returner | def returner(ret):
'''
Send a message to Nagios with the data
'''
_options = _get_options(ret)
log.debug('_options %s', _options)
_options['hostname'] = ret.get('id')
if 'url' not in _options or _options['url'] == '':
log.error('nagios_nrdp.url not defined in salt config')
... | python | def returner(ret):
'''
Send a message to Nagios with the data
'''
_options = _get_options(ret)
log.debug('_options %s', _options)
_options['hostname'] = ret.get('id')
if 'url' not in _options or _options['url'] == '':
log.error('nagios_nrdp.url not defined in salt config')
... | [
"def",
"returner",
"(",
"ret",
")",
":",
"_options",
"=",
"_get_options",
"(",
"ret",
")",
"log",
".",
"debug",
"(",
"'_options %s'",
",",
"_options",
")",
"_options",
"[",
"'hostname'",
"]",
"=",
"ret",
".",
"get",
"(",
"'id'",
")",
"if",
"'url'",
"... | Send a message to Nagios with the data | [
"Send",
"a",
"message",
"to",
"Nagios",
"with",
"the",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/nagios_nrdp_return.py#L187-L207 |
34,242 | saltstack/salt | salt/returners/influxdb_return.py | _get_serv | def _get_serv(ret=None):
'''
Return an influxdb client object
'''
_options = _get_options(ret)
host = _options.get('host')
port = _options.get('port')
database = _options.get('db')
user = _options.get('user')
password = _options.get('password')
version = _get_version(host, port, ... | python | def _get_serv(ret=None):
'''
Return an influxdb client object
'''
_options = _get_options(ret)
host = _options.get('host')
port = _options.get('port')
database = _options.get('db')
user = _options.get('user')
password = _options.get('password')
version = _get_version(host, port, ... | [
"def",
"_get_serv",
"(",
"ret",
"=",
"None",
")",
":",
"_options",
"=",
"_get_options",
"(",
"ret",
")",
"host",
"=",
"_options",
".",
"get",
"(",
"'host'",
")",
"port",
"=",
"_options",
".",
"get",
"(",
"'port'",
")",
"database",
"=",
"_options",
".... | Return an influxdb client object | [
"Return",
"an",
"influxdb",
"client",
"object"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/influxdb_return.py#L122-L147 |
34,243 | saltstack/salt | salt/returners/influxdb_return.py | returner | def returner(ret):
'''
Return data to a influxdb data store
'''
serv = _get_serv(ret)
# strip the 'return' key to avoid data duplication in the database
json_return = salt.utils.json.dumps(ret['return'])
del ret['return']
json_full_ret = salt.utils.json.dumps(ret)
# create legacy r... | python | def returner(ret):
'''
Return data to a influxdb data store
'''
serv = _get_serv(ret)
# strip the 'return' key to avoid data duplication in the database
json_return = salt.utils.json.dumps(ret['return'])
del ret['return']
json_full_ret = salt.utils.json.dumps(ret)
# create legacy r... | [
"def",
"returner",
"(",
"ret",
")",
":",
"serv",
"=",
"_get_serv",
"(",
"ret",
")",
"# strip the 'return' key to avoid data duplication in the database",
"json_return",
"=",
"salt",
".",
"utils",
".",
"json",
".",
"dumps",
"(",
"ret",
"[",
"'return'",
"]",
")",
... | Return data to a influxdb data store | [
"Return",
"data",
"to",
"a",
"influxdb",
"data",
"store"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/influxdb_return.py#L150-L192 |
34,244 | saltstack/salt | salt/utils/master.py | get_running_jobs | def get_running_jobs(opts):
'''
Return the running jobs on the master
'''
ret = []
proc_dir = os.path.join(opts['cachedir'], 'proc')
if not os.path.isdir(proc_dir):
return ret
for fn_ in os.listdir(proc_dir):
path = os.path.join(proc_dir, fn_)
data = read_proc_file(p... | python | def get_running_jobs(opts):
'''
Return the running jobs on the master
'''
ret = []
proc_dir = os.path.join(opts['cachedir'], 'proc')
if not os.path.isdir(proc_dir):
return ret
for fn_ in os.listdir(proc_dir):
path = os.path.join(proc_dir, fn_)
data = read_proc_file(p... | [
"def",
"get_running_jobs",
"(",
"opts",
")",
":",
"ret",
"=",
"[",
"]",
"proc_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"opts",
"[",
"'cachedir'",
"]",
",",
"'proc'",
")",
"if",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"proc_dir",
")",
... | Return the running jobs on the master | [
"Return",
"the",
"running",
"jobs",
"on",
"the",
"master"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L48-L65 |
34,245 | saltstack/salt | salt/utils/master.py | is_pid_healthy | def is_pid_healthy(pid):
'''
This is a health check that will confirm the PID is running
and executed by salt.
If pusutil is available:
* all architectures are checked
if psutil is not available:
* Linux/Solaris/etc: archs with `/proc/cmdline` available are checked
* AIX/Wi... | python | def is_pid_healthy(pid):
'''
This is a health check that will confirm the PID is running
and executed by salt.
If pusutil is available:
* all architectures are checked
if psutil is not available:
* Linux/Solaris/etc: archs with `/proc/cmdline` available are checked
* AIX/Wi... | [
"def",
"is_pid_healthy",
"(",
"pid",
")",
":",
"if",
"HAS_PSUTIL",
":",
"try",
":",
"proc",
"=",
"psutil",
".",
"Process",
"(",
"pid",
")",
"except",
"psutil",
".",
"NoSuchProcess",
":",
"log",
".",
"warning",
"(",
"\"PID %s is no longer running.\"",
",",
... | This is a health check that will confirm the PID is running
and executed by salt.
If pusutil is available:
* all architectures are checked
if psutil is not available:
* Linux/Solaris/etc: archs with `/proc/cmdline` available are checked
* AIX/Windows: assume PID is healhty and retu... | [
"This",
"is",
"a",
"health",
"check",
"that",
"will",
"confirm",
"the",
"PID",
"is",
"running",
"and",
"executed",
"by",
"salt",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L96-L129 |
34,246 | saltstack/salt | salt/utils/master.py | MasterPillarUtil.get_minion_pillar | def get_minion_pillar(self):
'''
Get pillar data for the targeted minions, either by fetching the
cached minion data on the master, or by compiling the minion's
pillar data on the master.
For runner modules that need access minion pillar data, this
function should be use... | python | def get_minion_pillar(self):
'''
Get pillar data for the targeted minions, either by fetching the
cached minion data on the master, or by compiling the minion's
pillar data on the master.
For runner modules that need access minion pillar data, this
function should be use... | [
"def",
"get_minion_pillar",
"(",
"self",
")",
":",
"minion_pillars",
"=",
"{",
"}",
"minion_grains",
"=",
"{",
"}",
"minion_ids",
"=",
"self",
".",
"_tgt_to_list",
"(",
")",
"if",
"any",
"(",
"arg",
"for",
"arg",
"in",
"[",
"self",
".",
"use_cached_grain... | Get pillar data for the targeted minions, either by fetching the
cached minion data on the master, or by compiling the minion's
pillar data on the master.
For runner modules that need access minion pillar data, this
function should be used instead of getting the pillar data by
e... | [
"Get",
"pillar",
"data",
"for",
"the",
"targeted",
"minions",
"either",
"by",
"fetching",
"the",
"cached",
"minion",
"data",
"on",
"the",
"master",
"or",
"by",
"compiling",
"the",
"minion",
"s",
"pillar",
"data",
"on",
"the",
"master",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L332-L369 |
34,247 | saltstack/salt | salt/utils/master.py | MasterPillarUtil.get_minion_grains | def get_minion_grains(self):
'''
Get grains data for the targeted minions, either by fetching the
cached minion data on the master, or by fetching the grains
directly on the minion.
By default, this function tries hard to get the grains data:
- Try to get the cached ... | python | def get_minion_grains(self):
'''
Get grains data for the targeted minions, either by fetching the
cached minion data on the master, or by fetching the grains
directly on the minion.
By default, this function tries hard to get the grains data:
- Try to get the cached ... | [
"def",
"get_minion_grains",
"(",
"self",
")",
":",
"minion_grains",
"=",
"{",
"}",
"minion_ids",
"=",
"self",
".",
"_tgt_to_list",
"(",
")",
"if",
"not",
"minion_ids",
":",
"return",
"{",
"}",
"if",
"any",
"(",
"arg",
"for",
"arg",
"in",
"[",
"self",
... | Get grains data for the targeted minions, either by fetching the
cached minion data on the master, or by fetching the grains
directly on the minion.
By default, this function tries hard to get the grains data:
- Try to get the cached minion grains if the master
has m... | [
"Get",
"grains",
"data",
"for",
"the",
"targeted",
"minions",
"either",
"by",
"fetching",
"the",
"cached",
"minion",
"data",
"on",
"the",
"master",
"or",
"by",
"fetching",
"the",
"grains",
"directly",
"on",
"the",
"minion",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L371-L397 |
34,248 | saltstack/salt | salt/utils/master.py | MasterPillarUtil.get_cached_mine_data | def get_cached_mine_data(self):
'''
Get cached mine data for the targeted minions.
'''
mine_data = {}
minion_ids = self._tgt_to_list()
log.debug('Getting cached mine data for: %s', minion_ids)
mine_data = self._get_cached_mine_data(*minion_ids)
return mine... | python | def get_cached_mine_data(self):
'''
Get cached mine data for the targeted minions.
'''
mine_data = {}
minion_ids = self._tgt_to_list()
log.debug('Getting cached mine data for: %s', minion_ids)
mine_data = self._get_cached_mine_data(*minion_ids)
return mine... | [
"def",
"get_cached_mine_data",
"(",
"self",
")",
":",
"mine_data",
"=",
"{",
"}",
"minion_ids",
"=",
"self",
".",
"_tgt_to_list",
"(",
")",
"log",
".",
"debug",
"(",
"'Getting cached mine data for: %s'",
",",
"minion_ids",
")",
"mine_data",
"=",
"self",
".",
... | Get cached mine data for the targeted minions. | [
"Get",
"cached",
"mine",
"data",
"for",
"the",
"targeted",
"minions",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L399-L407 |
34,249 | saltstack/salt | salt/utils/master.py | CacheTimer.run | def run(self):
'''
main loop that fires the event every second
'''
context = zmq.Context()
# the socket for outgoing timer events
socket = context.socket(zmq.PUB)
socket.setsockopt(zmq.LINGER, 100)
socket.bind('ipc://' + self.timer_sock)
count = 0... | python | def run(self):
'''
main loop that fires the event every second
'''
context = zmq.Context()
# the socket for outgoing timer events
socket = context.socket(zmq.PUB)
socket.setsockopt(zmq.LINGER, 100)
socket.bind('ipc://' + self.timer_sock)
count = 0... | [
"def",
"run",
"(",
"self",
")",
":",
"context",
"=",
"zmq",
".",
"Context",
"(",
")",
"# the socket for outgoing timer events",
"socket",
"=",
"context",
".",
"socket",
"(",
"zmq",
".",
"PUB",
")",
"socket",
".",
"setsockopt",
"(",
"zmq",
".",
"LINGER",
... | main loop that fires the event every second | [
"main",
"loop",
"that",
"fires",
"the",
"event",
"every",
"second"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L492-L509 |
34,250 | saltstack/salt | salt/utils/master.py | CacheWorker.run | def run(self):
'''
Gather currently connected minions and update the cache
'''
new_mins = list(salt.utils.minions.CkMinions(self.opts).connected_ids())
cc = cache_cli(self.opts)
cc.get_cached()
cc.put_cache([new_mins])
log.debug('ConCache CacheWorker updat... | python | def run(self):
'''
Gather currently connected minions and update the cache
'''
new_mins = list(salt.utils.minions.CkMinions(self.opts).connected_ids())
cc = cache_cli(self.opts)
cc.get_cached()
cc.put_cache([new_mins])
log.debug('ConCache CacheWorker updat... | [
"def",
"run",
"(",
"self",
")",
":",
"new_mins",
"=",
"list",
"(",
"salt",
".",
"utils",
".",
"minions",
".",
"CkMinions",
"(",
"self",
".",
"opts",
")",
".",
"connected_ids",
"(",
")",
")",
"cc",
"=",
"cache_cli",
"(",
"self",
".",
"opts",
")",
... | Gather currently connected minions and update the cache | [
"Gather",
"currently",
"connected",
"minions",
"and",
"update",
"the",
"cache"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L544-L552 |
34,251 | saltstack/salt | salt/utils/master.py | ConnectedCache.cleanup | def cleanup(self):
'''
remove sockets on shutdown
'''
log.debug('ConCache cleaning up')
if os.path.exists(self.cache_sock):
os.remove(self.cache_sock)
if os.path.exists(self.update_sock):
os.remove(self.update_sock)
if os.path.exists(self.u... | python | def cleanup(self):
'''
remove sockets on shutdown
'''
log.debug('ConCache cleaning up')
if os.path.exists(self.cache_sock):
os.remove(self.cache_sock)
if os.path.exists(self.update_sock):
os.remove(self.update_sock)
if os.path.exists(self.u... | [
"def",
"cleanup",
"(",
"self",
")",
":",
"log",
".",
"debug",
"(",
"'ConCache cleaning up'",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"self",
".",
"cache_sock",
")",
":",
"os",
".",
"remove",
"(",
"self",
".",
"cache_sock",
")",
"if",
"os",
... | remove sockets on shutdown | [
"remove",
"sockets",
"on",
"shutdown"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L613-L623 |
34,252 | saltstack/salt | salt/utils/master.py | ConnectedCache.secure | def secure(self):
'''
secure the sockets for root-only access
'''
log.debug('ConCache securing sockets')
if os.path.exists(self.cache_sock):
os.chmod(self.cache_sock, 0o600)
if os.path.exists(self.update_sock):
os.chmod(self.update_sock, 0o600)
... | python | def secure(self):
'''
secure the sockets for root-only access
'''
log.debug('ConCache securing sockets')
if os.path.exists(self.cache_sock):
os.chmod(self.cache_sock, 0o600)
if os.path.exists(self.update_sock):
os.chmod(self.update_sock, 0o600)
... | [
"def",
"secure",
"(",
"self",
")",
":",
"log",
".",
"debug",
"(",
"'ConCache securing sockets'",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"self",
".",
"cache_sock",
")",
":",
"os",
".",
"chmod",
"(",
"self",
".",
"cache_sock",
",",
"0o600",
... | secure the sockets for root-only access | [
"secure",
"the",
"sockets",
"for",
"root",
"-",
"only",
"access"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L625-L635 |
34,253 | saltstack/salt | salt/utils/master.py | ConnectedCache.stop | def stop(self):
'''
shutdown cache process
'''
# avoid getting called twice
self.cleanup()
if self.running:
self.running = False
self.timer_stop.set()
self.timer.join() | python | def stop(self):
'''
shutdown cache process
'''
# avoid getting called twice
self.cleanup()
if self.running:
self.running = False
self.timer_stop.set()
self.timer.join() | [
"def",
"stop",
"(",
"self",
")",
":",
"# avoid getting called twice",
"self",
".",
"cleanup",
"(",
")",
"if",
"self",
".",
"running",
":",
"self",
".",
"running",
"=",
"False",
"self",
".",
"timer_stop",
".",
"set",
"(",
")",
"self",
".",
"timer",
".",... | shutdown cache process | [
"shutdown",
"cache",
"process"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L637-L646 |
34,254 | saltstack/salt | salt/returners/sms_return.py | returner | def returner(ret):
'''
Return a response in an SMS message
'''
_options = _get_options(ret)
sid = _options.get('sid', None)
token = _options.get('token', None)
sender = _options.get('from', None)
receiver = _options.get('to', None)
if sid is None or token is None:
log.error... | python | def returner(ret):
'''
Return a response in an SMS message
'''
_options = _get_options(ret)
sid = _options.get('sid', None)
token = _options.get('token', None)
sender = _options.get('from', None)
receiver = _options.get('to', None)
if sid is None or token is None:
log.error... | [
"def",
"returner",
"(",
"ret",
")",
":",
"_options",
"=",
"_get_options",
"(",
"ret",
")",
"sid",
"=",
"_options",
".",
"get",
"(",
"'sid'",
",",
"None",
")",
"token",
"=",
"_options",
".",
"get",
"(",
"'token'",
",",
"None",
")",
"sender",
"=",
"_... | Return a response in an SMS message | [
"Return",
"a",
"response",
"in",
"an",
"SMS",
"message"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/sms_return.py#L72-L105 |
34,255 | saltstack/salt | salt/states/keystone_group.py | absent | def absent(name, auth=None, **kwargs):
'''
Ensure group does not exist
name
Name of the group
domain
The name or id of the domain
'''
ret = {'name': name,
'changes': {},
'result': True,
'comment': ''}
kwargs = __utils__['args.clean_kwargs']... | python | def absent(name, auth=None, **kwargs):
'''
Ensure group does not exist
name
Name of the group
domain
The name or id of the domain
'''
ret = {'name': name,
'changes': {},
'result': True,
'comment': ''}
kwargs = __utils__['args.clean_kwargs']... | [
"def",
"absent",
"(",
"name",
",",
"auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"kwargs",
"=",
"... | Ensure group does not exist
name
Name of the group
domain
The name or id of the domain | [
"Ensure",
"group",
"does",
"not",
"exist"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone_group.py#L108-L141 |
34,256 | saltstack/salt | salt/wheel/pillar_roots.py | find | def find(path, saltenv='base'):
'''
Return a dict of the files located with the given path and environment
'''
# Return a list of paths + text or bin
ret = []
if saltenv not in __opts__['pillar_roots']:
return ret
for root in __opts__['pillar_roots'][saltenv]:
full = os.path.... | python | def find(path, saltenv='base'):
'''
Return a dict of the files located with the given path and environment
'''
# Return a list of paths + text or bin
ret = []
if saltenv not in __opts__['pillar_roots']:
return ret
for root in __opts__['pillar_roots'][saltenv]:
full = os.path.... | [
"def",
"find",
"(",
"path",
",",
"saltenv",
"=",
"'base'",
")",
":",
"# Return a list of paths + text or bin",
"ret",
"=",
"[",
"]",
"if",
"saltenv",
"not",
"in",
"__opts__",
"[",
"'pillar_roots'",
"]",
":",
"return",
"ret",
"for",
"root",
"in",
"__opts__",
... | Return a dict of the files located with the given path and environment | [
"Return",
"a",
"dict",
"of",
"the",
"files",
"located",
"with",
"the",
"given",
"path",
"and",
"environment"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/pillar_roots.py#L19-L36 |
34,257 | saltstack/salt | salt/wheel/pillar_roots.py | list_env | def list_env(saltenv='base'):
'''
Return all of the file paths found in an environment
'''
ret = {}
if saltenv not in __opts__['pillar_roots']:
return ret
for f_root in __opts__['pillar_roots'][saltenv]:
ret[f_root] = {}
for root, dirs, files in salt.utils.path.os_walk(f_... | python | def list_env(saltenv='base'):
'''
Return all of the file paths found in an environment
'''
ret = {}
if saltenv not in __opts__['pillar_roots']:
return ret
for f_root in __opts__['pillar_roots'][saltenv]:
ret[f_root] = {}
for root, dirs, files in salt.utils.path.os_walk(f_... | [
"def",
"list_env",
"(",
"saltenv",
"=",
"'base'",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"saltenv",
"not",
"in",
"__opts__",
"[",
"'pillar_roots'",
"]",
":",
"return",
"ret",
"for",
"f_root",
"in",
"__opts__",
"[",
"'pillar_roots'",
"]",
"[",
"saltenv",
... | Return all of the file paths found in an environment | [
"Return",
"all",
"of",
"the",
"file",
"paths",
"found",
"in",
"an",
"environment"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/pillar_roots.py#L39-L66 |
34,258 | saltstack/salt | salt/wheel/pillar_roots.py | list_roots | def list_roots():
'''
Return all of the files names in all available environments
'''
ret = {}
for saltenv in __opts__['pillar_roots']:
ret[saltenv] = []
ret[saltenv].append(list_env(saltenv))
return ret | python | def list_roots():
'''
Return all of the files names in all available environments
'''
ret = {}
for saltenv in __opts__['pillar_roots']:
ret[saltenv] = []
ret[saltenv].append(list_env(saltenv))
return ret | [
"def",
"list_roots",
"(",
")",
":",
"ret",
"=",
"{",
"}",
"for",
"saltenv",
"in",
"__opts__",
"[",
"'pillar_roots'",
"]",
":",
"ret",
"[",
"saltenv",
"]",
"=",
"[",
"]",
"ret",
"[",
"saltenv",
"]",
".",
"append",
"(",
"list_env",
"(",
"saltenv",
")... | Return all of the files names in all available environments | [
"Return",
"all",
"of",
"the",
"files",
"names",
"in",
"all",
"available",
"environments"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/pillar_roots.py#L69-L77 |
34,259 | saltstack/salt | salt/wheel/pillar_roots.py | read | def read(path, saltenv='base'):
'''
Read the contents of a text file, if the file is binary then
'''
# Return a dict of paths + content
ret = []
files = find(path, saltenv)
for fn_ in files:
full = next(six.iterkeys(fn_))
form = fn_[full]
if form == 'txt':
... | python | def read(path, saltenv='base'):
'''
Read the contents of a text file, if the file is binary then
'''
# Return a dict of paths + content
ret = []
files = find(path, saltenv)
for fn_ in files:
full = next(six.iterkeys(fn_))
form = fn_[full]
if form == 'txt':
... | [
"def",
"read",
"(",
"path",
",",
"saltenv",
"=",
"'base'",
")",
":",
"# Return a dict of paths + content",
"ret",
"=",
"[",
"]",
"files",
"=",
"find",
"(",
"path",
",",
"saltenv",
")",
"for",
"fn_",
"in",
"files",
":",
"full",
"=",
"next",
"(",
"six",
... | Read the contents of a text file, if the file is binary then | [
"Read",
"the",
"contents",
"of",
"a",
"text",
"file",
"if",
"the",
"file",
"is",
"binary",
"then"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/pillar_roots.py#L80-L95 |
34,260 | saltstack/salt | salt/wheel/pillar_roots.py | write | def write(data, path, saltenv='base', index=0):
'''
Write the named file, by default the first file found is written, but the
index of the file can be specified to write to a lower priority file root
'''
if saltenv not in __opts__['pillar_roots']:
return 'Named environment {0} is not present... | python | def write(data, path, saltenv='base', index=0):
'''
Write the named file, by default the first file found is written, but the
index of the file can be specified to write to a lower priority file root
'''
if saltenv not in __opts__['pillar_roots']:
return 'Named environment {0} is not present... | [
"def",
"write",
"(",
"data",
",",
"path",
",",
"saltenv",
"=",
"'base'",
",",
"index",
"=",
"0",
")",
":",
"if",
"saltenv",
"not",
"in",
"__opts__",
"[",
"'pillar_roots'",
"]",
":",
"return",
"'Named environment {0} is not present'",
".",
"format",
"(",
"s... | Write the named file, by default the first file found is written, but the
index of the file can be specified to write to a lower priority file root | [
"Write",
"the",
"named",
"file",
"by",
"default",
"the",
"first",
"file",
"found",
"is",
"written",
"but",
"the",
"index",
"of",
"the",
"file",
"can",
"be",
"specified",
"to",
"write",
"to",
"a",
"lower",
"priority",
"file",
"root"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/pillar_roots.py#L98-L117 |
34,261 | saltstack/salt | salt/returners/xmpp_return.py | returner | def returner(ret):
'''
Send an xmpp message with the data
'''
_options = _get_options(ret)
from_jid = _options.get('from_jid')
password = _options.get('password')
recipient_jid = _options.get('recipient_jid')
if not from_jid:
log.error('xmpp.jid not defined in salt config')
... | python | def returner(ret):
'''
Send an xmpp message with the data
'''
_options = _get_options(ret)
from_jid = _options.get('from_jid')
password = _options.get('password')
recipient_jid = _options.get('recipient_jid')
if not from_jid:
log.error('xmpp.jid not defined in salt config')
... | [
"def",
"returner",
"(",
"ret",
")",
":",
"_options",
"=",
"_get_options",
"(",
"ret",
")",
"from_jid",
"=",
"_options",
".",
"get",
"(",
"'from_jid'",
")",
"password",
"=",
"_options",
".",
"get",
"(",
"'password'",
")",
"recipient_jid",
"=",
"_options",
... | Send an xmpp message with the data | [
"Send",
"an",
"xmpp",
"message",
"with",
"the",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/xmpp_return.py#L157-L198 |
34,262 | saltstack/salt | salt/states/win_iis.py | _get_binding_info | def _get_binding_info(hostheader='', ipaddress='*', port=80):
'''
Combine the host header, IP address, and TCP port into bindingInformation format.
'''
ret = r'{0}:{1}:{2}'.format(ipaddress, port, hostheader.replace(' ', ''))
return ret | python | def _get_binding_info(hostheader='', ipaddress='*', port=80):
'''
Combine the host header, IP address, and TCP port into bindingInformation format.
'''
ret = r'{0}:{1}:{2}'.format(ipaddress, port, hostheader.replace(' ', ''))
return ret | [
"def",
"_get_binding_info",
"(",
"hostheader",
"=",
"''",
",",
"ipaddress",
"=",
"'*'",
",",
"port",
"=",
"80",
")",
":",
"ret",
"=",
"r'{0}:{1}:{2}'",
".",
"format",
"(",
"ipaddress",
",",
"port",
",",
"hostheader",
".",
"replace",
"(",
"' '",
",",
"'... | Combine the host header, IP address, and TCP port into bindingInformation format. | [
"Combine",
"the",
"host",
"header",
"IP",
"address",
"and",
"TCP",
"port",
"into",
"bindingInformation",
"format",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L31-L37 |
34,263 | saltstack/salt | salt/states/win_iis.py | deployed | def deployed(name, sourcepath, apppool='', hostheader='', ipaddress='*', port=80, protocol='http', preload=''):
'''
Ensure the website has been deployed.
.. note:
This function only validates against the site name, and will return True even
if the site already exists with a different confi... | python | def deployed(name, sourcepath, apppool='', hostheader='', ipaddress='*', port=80, protocol='http', preload=''):
'''
Ensure the website has been deployed.
.. note:
This function only validates against the site name, and will return True even
if the site already exists with a different confi... | [
"def",
"deployed",
"(",
"name",
",",
"sourcepath",
",",
"apppool",
"=",
"''",
",",
"hostheader",
"=",
"''",
",",
"ipaddress",
"=",
"'*'",
",",
"port",
"=",
"80",
",",
"protocol",
"=",
"'http'",
",",
"preload",
"=",
"''",
")",
":",
"ret",
"=",
"{",
... | Ensure the website has been deployed.
.. 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.
:param str name: The IIS site name.
:pa... | [
"Ensure",
"the",
"website",
"has",
"been",
"deployed",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L40-L110 |
34,264 | saltstack/salt | salt/states/win_iis.py | create_binding | def create_binding(name, site, hostheader='', ipaddress='*', port=80, protocol='http', sslflags=0):
'''
Create an IIS 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 dif... | python | def create_binding(name, site, hostheader='', ipaddress='*', port=80, protocol='http', sslflags=0):
'''
Create an IIS 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 dif... | [
"def",
"create_binding",
"(",
"name",
",",
"site",
",",
"hostheader",
"=",
"''",
",",
"ipaddress",
"=",
"'*'",
",",
"port",
"=",
"80",
",",
"protocol",
"=",
"'http'",
",",
"sslflags",
"=",
"0",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",... | Create an IIS 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.
:param str site:... | [
"Create",
"an",
"IIS",
"binding",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L150-L209 |
34,265 | saltstack/salt | salt/states/win_iis.py | create_cert_binding | def create_cert_binding(name, site, hostheader='', ipaddress='*', port=443, sslflags=0):
'''
Assign a certificate to an IIS binding.
.. note:
The web binding that the certificate is being assigned to must already exist.
:param str name: The thumbprint of the certificate.
:param str site: ... | python | def create_cert_binding(name, site, hostheader='', ipaddress='*', port=443, sslflags=0):
'''
Assign a certificate to an IIS binding.
.. note:
The web binding that the certificate is being assigned to must already exist.
:param str name: The thumbprint of the certificate.
:param str site: ... | [
"def",
"create_cert_binding",
"(",
"name",
",",
"site",
",",
"hostheader",
"=",
"''",
",",
"ipaddress",
"=",
"'*'",
",",
"port",
"=",
"443",
",",
"sslflags",
"=",
"0",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}... | Assign a certificate to an IIS binding.
.. note:
The web binding that the certificate is being assigned to must already exist.
:param str name: The thumbprint of the certificate.
:param str site: The IIS site name.
:param str hostheader: The host header of the binding.
:param str ipaddres... | [
"Assign",
"a",
"certificate",
"to",
"an",
"IIS",
"binding",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L264-L331 |
34,266 | saltstack/salt | salt/states/win_iis.py | remove_cert_binding | def remove_cert_binding(name, site, hostheader='', ipaddress='*', port=443):
'''
Remove a certificate from an IIS binding.
.. note:
This function only removes the certificate from the web binding. It does
not remove the web binding itself.
:param str name: The thumbprint of the certif... | python | def remove_cert_binding(name, site, hostheader='', ipaddress='*', port=443):
'''
Remove a certificate from an IIS binding.
.. note:
This function only removes the certificate from the web binding. It does
not remove the web binding itself.
:param str name: The thumbprint of the certif... | [
"def",
"remove_cert_binding",
"(",
"name",
",",
"site",
",",
"hostheader",
"=",
"''",
",",
"ipaddress",
"=",
"'*'",
",",
"port",
"=",
"443",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"... | Remove a certificate from an IIS binding.
.. note:
This function only removes the certificate from the web binding. It does
not remove the web binding itself.
:param str name: The thumbprint of the certificate.
:param str site: The IIS site name.
:param str hostheader: The host header... | [
"Remove",
"a",
"certificate",
"from",
"an",
"IIS",
"binding",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L334-L396 |
34,267 | saltstack/salt | salt/states/win_iis.py | remove_apppool | def remove_apppool(name):
# Remove IIS AppPool
'''
Remove an IIS application pool.
:param str name: The name of the IIS application pool.
Usage:
.. code-block:: yaml
defaultapppool-remove:
win_iis.remove_apppool:
- name: DefaultAppPool
'''
ret = {... | python | def remove_apppool(name):
# Remove IIS AppPool
'''
Remove an IIS application pool.
:param str name: The name of the IIS application pool.
Usage:
.. code-block:: yaml
defaultapppool-remove:
win_iis.remove_apppool:
- name: DefaultAppPool
'''
ret = {... | [
"def",
"remove_apppool",
"(",
"name",
")",
":",
"# Remove IIS AppPool",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
"}",
"current_apppools",
"=",
"__salt__",
"[",
"'w... | Remove an IIS application pool.
:param str name: The name of the IIS application pool.
Usage:
.. code-block:: yaml
defaultapppool-remove:
win_iis.remove_apppool:
- name: DefaultAppPool | [
"Remove",
"an",
"IIS",
"application",
"pool",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L442-L477 |
34,268 | saltstack/salt | salt/modules/zabbix.py | _frontend_url | def _frontend_url():
'''
Tries to guess the url of zabbix frontend.
.. versionadded:: 2016.3.0
'''
hostname = socket.gethostname()
frontend_url = 'http://' + hostname + '/zabbix/api_jsonrpc.php'
try:
try:
response = salt.utils.http.query(frontend_url)
error =... | python | def _frontend_url():
'''
Tries to guess the url of zabbix frontend.
.. versionadded:: 2016.3.0
'''
hostname = socket.gethostname()
frontend_url = 'http://' + hostname + '/zabbix/api_jsonrpc.php'
try:
try:
response = salt.utils.http.query(frontend_url)
error =... | [
"def",
"_frontend_url",
"(",
")",
":",
"hostname",
"=",
"socket",
".",
"gethostname",
"(",
")",
"frontend_url",
"=",
"'http://'",
"+",
"hostname",
"+",
"'/zabbix/api_jsonrpc.php'",
"try",
":",
"try",
":",
"response",
"=",
"salt",
".",
"utils",
".",
"http",
... | Tries to guess the url of zabbix frontend.
.. versionadded:: 2016.3.0 | [
"Tries",
"to",
"guess",
"the",
"url",
"of",
"zabbix",
"frontend",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L108-L127 |
34,269 | saltstack/salt | salt/modules/zabbix.py | _query | def _query(method, params, url, auth=None):
'''
JSON request to Zabbix API.
.. versionadded:: 2016.3.0
:param method: actual operation to perform via the API
:param params: parameters required for specific method
:param url: url of zabbix api
:param auth: auth token for zabbix api (only fo... | python | def _query(method, params, url, auth=None):
'''
JSON request to Zabbix API.
.. versionadded:: 2016.3.0
:param method: actual operation to perform via the API
:param params: parameters required for specific method
:param url: url of zabbix api
:param auth: auth token for zabbix api (only fo... | [
"def",
"_query",
"(",
"method",
",",
"params",
",",
"url",
",",
"auth",
"=",
"None",
")",
":",
"unauthenticated_methods",
"=",
"[",
"'user.login'",
",",
"'apiinfo.version'",
",",
"]",
"header_dict",
"=",
"{",
"'Content-type'",
":",
"'application/json'",
"}",
... | JSON request to Zabbix API.
.. versionadded:: 2016.3.0
:param method: actual operation to perform via the API
:param params: parameters required for specific method
:param url: url of zabbix api
:param auth: auth token for zabbix api (only for methods with required authentication)
:return: Re... | [
"JSON",
"request",
"to",
"Zabbix",
"API",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L130-L177 |
34,270 | saltstack/salt | salt/modules/zabbix.py | _login | def _login(**kwargs):
'''
Log in to the API and generate the authentication token.
.. versionadded:: 2016.3.0
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts... | python | def _login(**kwargs):
'''
Log in to the API and generate the authentication token.
.. versionadded:: 2016.3.0
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts... | [
"def",
"_login",
"(",
"*",
"*",
"kwargs",
")",
":",
"connargs",
"=",
"dict",
"(",
")",
"def",
"_connarg",
"(",
"name",
",",
"key",
"=",
"None",
")",
":",
"'''\n Add key to connargs, only if name exists in our kwargs or, as zabbix.<name> in __opts__ or __pillar__\... | Log in to the API and generate the authentication token.
.. versionadded:: 2016.3.0
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module's docstring... | [
"Log",
"in",
"to",
"the",
"API",
"and",
"generate",
"the",
"authentication",
"token",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L180-L240 |
34,271 | saltstack/salt | salt/modules/zabbix.py | _params_extend | def _params_extend(params, _ignore_name=False, **kwargs):
'''
Extends the params dictionary by values from keyword arguments.
.. versionadded:: 2016.3.0
:param params: Dictionary with parameters for zabbix API.
:param _ignore_name: Salt State module is passing first line as 'name' parameter. If AP... | python | def _params_extend(params, _ignore_name=False, **kwargs):
'''
Extends the params dictionary by values from keyword arguments.
.. versionadded:: 2016.3.0
:param params: Dictionary with parameters for zabbix API.
:param _ignore_name: Salt State module is passing first line as 'name' parameter. If AP... | [
"def",
"_params_extend",
"(",
"params",
",",
"_ignore_name",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"# extend params value by optional zabbix API parameters",
"for",
"key",
"in",
"kwargs",
":",
"if",
"not",
"key",
".",
"startswith",
"(",
"'_'",
")",
... | Extends the params dictionary by values from keyword arguments.
.. versionadded:: 2016.3.0
:param params: Dictionary with parameters for zabbix API.
:param _ignore_name: Salt State module is passing first line as 'name' parameter. If API uses optional parameter
'name' (for ex. host_create, user_create... | [
"Extends",
"the",
"params",
"dictionary",
"by",
"values",
"from",
"keyword",
"arguments",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L243-L273 |
34,272 | saltstack/salt | salt/modules/zabbix.py | apiinfo_version | def apiinfo_version(**kwargs):
'''
Retrieve the version of the Zabbix API.
.. versionadded:: 2016.3.0
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pill... | python | def apiinfo_version(**kwargs):
'''
Retrieve the version of the Zabbix API.
.. versionadded:: 2016.3.0
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pill... | [
"def",
"apiinfo_version",
"(",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'apiinfo.version'",
"params",
"=",
"{",
"}",
"ret",
"=",
... | Retrieve the version of the Zabbix API.
.. versionadded:: 2016.3.0
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module's docstring)
:param _con... | [
"Retrieve",
"the",
"version",
"of",
"the",
"Zabbix",
"API",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L430-L458 |
34,273 | saltstack/salt | salt/modules/zabbix.py | user_delete | def user_delete(users, **kwargs):
'''
Delete zabbix users.
.. versionadded:: 2016.3.0
:param users: array of users (userids) to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix pass... | python | def user_delete(users, **kwargs):
'''
Delete zabbix users.
.. versionadded:: 2016.3.0
:param users: array of users (userids) to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix pass... | [
"def",
"user_delete",
"(",
"users",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'user.delete'",
"if",
"not",
"isinstance",
"(",... | Delete zabbix users.
.. versionadded:: 2016.3.0
:param users: array of users (userids) to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see m... | [
"Delete",
"zabbix",
"users",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L512-L545 |
34,274 | saltstack/salt | salt/modules/zabbix.py | user_exists | def user_exists(alias, **kwargs):
'''
Checks if user with given alias exists.
.. versionadded:: 2016.3.0
:param alias: user alias
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password ... | python | def user_exists(alias, **kwargs):
'''
Checks if user with given alias exists.
.. versionadded:: 2016.3.0
:param alias: user alias
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password ... | [
"def",
"user_exists",
"(",
"alias",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'user.get'",
"params",
"=",
"{",
"\"output\"",
... | Checks if user with given alias exists.
.. versionadded:: 2016.3.0
:param alias: user alias
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module... | [
"Checks",
"if",
"user",
"with",
"given",
"alias",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L548-L577 |
34,275 | saltstack/salt | salt/modules/zabbix.py | user_get | def user_get(alias=None, userids=None, **kwargs):
'''
Retrieve users according to the given parameters.
.. versionadded:: 2016.3.0
:param alias: user alias
:param userids: return only users with the given IDs
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, s... | python | def user_get(alias=None, userids=None, **kwargs):
'''
Retrieve users according to the given parameters.
.. versionadded:: 2016.3.0
:param alias: user alias
:param userids: return only users with the given IDs
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, s... | [
"def",
"user_get",
"(",
"alias",
"=",
"None",
",",
"userids",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'use... | Retrieve users according to the given parameters.
.. versionadded:: 2016.3.0
:param alias: user alias
:param userids: return only users with the given IDs
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Option... | [
"Retrieve",
"users",
"according",
"to",
"the",
"given",
"parameters",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L580-L617 |
34,276 | saltstack/salt | salt/modules/zabbix.py | user_addmedia | def user_addmedia(userids, active, mediatypeid, period, sendto, severity, **kwargs):
'''
Add new media to multiple users.
.. versionadded:: 2016.3.0
:param userids: ID of the user that uses the media
:param active: Whether the media is enabled (0 enabled, 1 disabled)
:param mediatypeid: ID of ... | python | def user_addmedia(userids, active, mediatypeid, period, sendto, severity, **kwargs):
'''
Add new media to multiple users.
.. versionadded:: 2016.3.0
:param userids: ID of the user that uses the media
:param active: Whether the media is enabled (0 enabled, 1 disabled)
:param mediatypeid: ID of ... | [
"def",
"user_addmedia",
"(",
"userids",
",",
"active",
",",
"mediatypeid",
",",
"period",
",",
"sendto",
",",
"severity",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
... | Add new media to multiple users.
.. versionadded:: 2016.3.0
:param userids: ID of the user that uses the media
:param active: Whether the media is enabled (0 enabled, 1 disabled)
:param mediatypeid: ID of the media type used by the media
:param period: Time when the notifications can be sent as a ... | [
"Add",
"new",
"media",
"to",
"multiple",
"users",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L702-L747 |
34,277 | saltstack/salt | salt/modules/zabbix.py | user_deletemedia | def user_deletemedia(mediaids, **kwargs):
'''
Delete media by id.
.. versionadded:: 2016.3.0
:param mediaids: IDs of the media to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix pa... | python | def user_deletemedia(mediaids, **kwargs):
'''
Delete media by id.
.. versionadded:: 2016.3.0
:param mediaids: IDs of the media to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix pa... | [
"def",
"user_deletemedia",
"(",
"mediaids",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'user.deletemedia'",
"if",
"not",
"isinst... | Delete media by id.
.. versionadded:: 2016.3.0
:param mediaids: IDs of the media to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module'... | [
"Delete",
"media",
"by",
"id",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L750-L782 |
34,278 | saltstack/salt | salt/modules/zabbix.py | usergroup_exists | def usergroup_exists(name=None, node=None, nodeids=None, **kwargs):
'''
Checks if at least one user group that matches the given filter criteria exists
.. versionadded:: 2016.3.0
:param name: names of the user groups
:param node: name of the node the user groups must belong to (This will override ... | python | def usergroup_exists(name=None, node=None, nodeids=None, **kwargs):
'''
Checks if at least one user group that matches the given filter criteria exists
.. versionadded:: 2016.3.0
:param name: names of the user groups
:param node: name of the node the user groups must belong to (This will override ... | [
"def",
"usergroup_exists",
"(",
"name",
"=",
"None",
",",
"node",
"=",
"None",
",",
"nodeids",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"zabbix_version",
"=",
"apiinfo_version",
"(",
"*",... | Checks if at least one user group that matches the given filter criteria exists
.. versionadded:: 2016.3.0
:param name: names of the user groups
:param node: name of the node the user groups must belong to (This will override the nodeids parameter.)
:param nodeids: IDs of the nodes the user groups mus... | [
"Checks",
"if",
"at",
"least",
"one",
"user",
"group",
"that",
"matches",
"the",
"given",
"filter",
"criteria",
"exists"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L888-L940 |
34,279 | saltstack/salt | salt/modules/zabbix.py | usergroup_list | def usergroup_list(**kwargs):
'''
Retrieve all enabled user groups.
.. versionadded:: 2016.3.0
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see... | python | def usergroup_list(**kwargs):
'''
Retrieve all enabled user groups.
.. versionadded:: 2016.3.0
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see... | [
"def",
"usergroup_list",
"(",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'usergroup.get'",
"params",
"=",
"{",
"\"output\"",
":",
"... | Retrieve all enabled user groups.
.. versionadded:: 2016.3.0
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module's docstring)
:param _connectio... | [
"Retrieve",
"all",
"enabled",
"user",
"groups",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1037-L1065 |
34,280 | saltstack/salt | salt/modules/zabbix.py | host_delete | def host_delete(hostids, **kwargs):
'''
Delete hosts.
.. versionadded:: 2016.3.0
:param hostids: Hosts (hostids) to delete.
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can a... | python | def host_delete(hostids, **kwargs):
'''
Delete hosts.
.. versionadded:: 2016.3.0
:param hostids: Hosts (hostids) to delete.
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can a... | [
"def",
"host_delete",
"(",
"hostids",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'host.delete'",
"if",
"not",
"isinstance",
"(... | Delete hosts.
.. versionadded:: 2016.3.0
:param hostids: Hosts (hostids) to delete.
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module's docst... | [
"Delete",
"hosts",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1126-L1158 |
34,281 | saltstack/salt | salt/modules/zabbix.py | host_exists | def host_exists(host=None, hostid=None, name=None, node=None, nodeids=None, **kwargs):
'''
Checks if at least one host that matches the given filter criteria exists.
.. versionadded:: 2016.3.0
:param host: technical name of the host
:param hostids: Hosts (hostids) to delete.
:param name: visib... | python | def host_exists(host=None, hostid=None, name=None, node=None, nodeids=None, **kwargs):
'''
Checks if at least one host that matches the given filter criteria exists.
.. versionadded:: 2016.3.0
:param host: technical name of the host
:param hostids: Hosts (hostids) to delete.
:param name: visib... | [
"def",
"host_exists",
"(",
"host",
"=",
"None",
",",
"hostid",
"=",
"None",
",",
"name",
"=",
"None",
",",
"node",
"=",
"None",
",",
"nodeids",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
"... | Checks if at least one host that matches the given filter criteria exists.
.. versionadded:: 2016.3.0
:param host: technical name of the host
:param hostids: Hosts (hostids) to delete.
:param name: visible name of the host
:param node: name of the node the hosts must belong to (zabbix API < 2.4)
... | [
"Checks",
"if",
"at",
"least",
"one",
"host",
"that",
"matches",
"the",
"given",
"filter",
"criteria",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1161-L1223 |
34,282 | saltstack/salt | salt/modules/zabbix.py | hostgroup_delete | def hostgroup_delete(hostgroupids, **kwargs):
'''
Delete the host group.
.. versionadded:: 2016.3.0
:param hostgroupids: IDs of the host groups to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Opt... | python | def hostgroup_delete(hostgroupids, **kwargs):
'''
Delete the host group.
.. versionadded:: 2016.3.0
:param hostgroupids: IDs of the host groups to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Opt... | [
"def",
"hostgroup_delete",
"(",
"hostgroupids",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'hostgroup.delete'",
"if",
"not",
"is... | Delete the host group.
.. versionadded:: 2016.3.0
:param hostgroupids: IDs of the host groups to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar... | [
"Delete",
"the",
"host",
"group",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1482-L1514 |
34,283 | saltstack/salt | salt/modules/zabbix.py | hostgroup_exists | def hostgroup_exists(name=None, groupid=None, node=None, nodeids=None, **kwargs):
'''
Checks if at least one host group that matches the given filter criteria exists.
.. versionadded:: 2016.3.0
:param name: names of the host groups
:param groupid: host group IDs
:param node: name of the node t... | python | def hostgroup_exists(name=None, groupid=None, node=None, nodeids=None, **kwargs):
'''
Checks if at least one host group that matches the given filter criteria exists.
.. versionadded:: 2016.3.0
:param name: names of the host groups
:param groupid: host group IDs
:param node: name of the node t... | [
"def",
"hostgroup_exists",
"(",
"name",
"=",
"None",
",",
"groupid",
"=",
"None",
",",
"node",
"=",
"None",
",",
"nodeids",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"zabbix_version",
"=... | Checks if at least one host group that matches the given filter criteria exists.
.. versionadded:: 2016.3.0
:param name: names of the host groups
:param groupid: host group IDs
:param node: name of the node the host groups must belong to (zabbix API < 2.4)
:param nodeids: IDs of the nodes the host... | [
"Checks",
"if",
"at",
"least",
"one",
"host",
"group",
"that",
"matches",
"the",
"given",
"filter",
"criteria",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1517-L1574 |
34,284 | saltstack/salt | salt/modules/zabbix.py | hostinterface_delete | def hostinterface_delete(interfaceids, **kwargs):
'''
Delete host interface
.. versionadded:: 2016.3.0
:param interfaceids: IDs of the host interfaces to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_passwo... | python | def hostinterface_delete(interfaceids, **kwargs):
'''
Delete host interface
.. versionadded:: 2016.3.0
:param interfaceids: IDs of the host interfaces to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_passwo... | [
"def",
"hostinterface_delete",
"(",
"interfaceids",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'hostinterface.delete'",
"if",
"isi... | Delete host interface
.. versionadded:: 2016.3.0
:param interfaceids: IDs of the host interfaces to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pil... | [
"Delete",
"host",
"interface"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1817-L1849 |
34,285 | saltstack/salt | salt/modules/zabbix.py | usermacro_get | def usermacro_get(macro=None, hostids=None, templateids=None, hostmacroids=None,
globalmacroids=None, globalmacro=False, **kwargs):
'''
Retrieve user macros according to the given parameters.
Args:
macro: name of the usermacro
hostids: Return macros for the... | python | def usermacro_get(macro=None, hostids=None, templateids=None, hostmacroids=None,
globalmacroids=None, globalmacro=False, **kwargs):
'''
Retrieve user macros according to the given parameters.
Args:
macro: name of the usermacro
hostids: Return macros for the... | [
"def",
"usermacro_get",
"(",
"macro",
"=",
"None",
",",
"hostids",
"=",
"None",
",",
"templateids",
"=",
"None",
",",
"hostmacroids",
"=",
"None",
",",
"globalmacroids",
"=",
"None",
",",
"globalmacro",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
... | Retrieve user macros according to the given parameters.
Args:
macro: name of the usermacro
hostids: Return macros for the given hostids
templateids: Return macros for the given templateids
hostmacroids: Return macros with the given hostmacroids
globalmac... | [
"Retrieve",
"user",
"macros",
"according",
"to",
"the",
"given",
"parameters",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1894-L1951 |
34,286 | saltstack/salt | salt/modules/zabbix.py | usermacro_create | def usermacro_create(macro, value, hostid, **kwargs):
'''
Create new host usermacro.
:param macro: name of the host usermacro
:param value: value of the host usermacro
:param hostid: hostid or templateid
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see mod... | python | def usermacro_create(macro, value, hostid, **kwargs):
'''
Create new host usermacro.
:param macro: name of the host usermacro
:param value: value of the host usermacro
:param hostid: hostid or templateid
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see mod... | [
"def",
"usermacro_create",
"(",
"macro",
",",
"value",
",",
"hostid",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"params",
"=",
"{",
"}",
... | Create new host usermacro.
:param macro: name of the host usermacro
:param value: value of the host usermacro
:param hostid: hostid or templateid
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbi... | [
"Create",
"new",
"host",
"usermacro",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1954-L1994 |
34,287 | saltstack/salt | salt/modules/zabbix.py | usermacro_delete | def usermacro_delete(macroids, **kwargs):
'''
Delete host usermacros.
:param macroids: macroids of the host usermacros
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be se... | python | def usermacro_delete(macroids, **kwargs):
'''
Delete host usermacros.
:param macroids: macroids of the host usermacros
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be se... | [
"def",
"usermacro_delete",
"(",
"macroids",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'usermacro.delete'",
"if",
"isinstance",
... | Delete host usermacros.
:param macroids: macroids of the host usermacros
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module's docstring)
:para... | [
"Delete",
"host",
"usermacros",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2038-L2070 |
34,288 | saltstack/salt | salt/modules/zabbix.py | usermacro_update | def usermacro_update(hostmacroid, value, **kwargs):
'''
Update existing host usermacro.
:param hostmacroid: id of the host usermacro
:param value: new value of the host usermacro
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _... | python | def usermacro_update(hostmacroid, value, **kwargs):
'''
Update existing host usermacro.
:param hostmacroid: id of the host usermacro
:param value: new value of the host usermacro
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _... | [
"def",
"usermacro_update",
"(",
"hostmacroid",
",",
"value",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"params",
"=",
"{",
"}",
"method",
"... | Update existing host usermacro.
:param hostmacroid: id of the host usermacro
:param value: new value of the host usermacro
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set... | [
"Update",
"existing",
"host",
"usermacro",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2108-L2140 |
34,289 | saltstack/salt | salt/modules/zabbix.py | usermacro_updateglobal | def usermacro_updateglobal(globalmacroid, value, **kwargs):
'''
Update existing global usermacro.
:param globalmacroid: id of the host usermacro
:param value: new value of the host usermacro
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
... | python | def usermacro_updateglobal(globalmacroid, value, **kwargs):
'''
Update existing global usermacro.
:param globalmacroid: id of the host usermacro
:param value: new value of the host usermacro
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
... | [
"def",
"usermacro_updateglobal",
"(",
"globalmacroid",
",",
"value",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"params",
"=",
"{",
"}",
"meth... | Update existing global usermacro.
:param globalmacroid: id of the host usermacro
:param value: new value of the host usermacro
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be... | [
"Update",
"existing",
"global",
"usermacro",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2143-L2175 |
34,290 | saltstack/salt | salt/modules/zabbix.py | mediatype_get | def mediatype_get(name=None, mediatypeids=None, **kwargs):
'''
Retrieve mediatypes according to the given parameters.
Args:
name: Name or description of the mediatype
mediatypeids: ids of the mediatypes
optional kwargs:
_connection_user: zabbix user (can als... | python | def mediatype_get(name=None, mediatypeids=None, **kwargs):
'''
Retrieve mediatypes according to the given parameters.
Args:
name: Name or description of the mediatype
mediatypeids: ids of the mediatypes
optional kwargs:
_connection_user: zabbix user (can als... | [
"def",
"mediatype_get",
"(",
"name",
"=",
"None",
",",
"mediatypeids",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"="... | Retrieve mediatypes according to the given parameters.
Args:
name: Name or description of the mediatype
mediatypeids: ids of the mediatypes
optional kwargs:
_connection_user: zabbix user (can also be set in opts or pillar, see module's docstring)
_co... | [
"Retrieve",
"mediatypes",
"according",
"to",
"the",
"given",
"parameters",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2178-L2220 |
34,291 | saltstack/salt | salt/modules/zabbix.py | mediatype_create | def mediatype_create(name, mediatype, **kwargs):
'''
Create new mediatype
.. note::
This function accepts all standard mediatype properties: keyword
argument names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documentation/3.0/manual/api/refere... | python | def mediatype_create(name, mediatype, **kwargs):
'''
Create new mediatype
.. note::
This function accepts all standard mediatype properties: keyword
argument names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documentation/3.0/manual/api/refere... | [
"def",
"mediatype_create",
"(",
"name",
",",
"mediatype",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'mediatype.create'",
"param... | Create new mediatype
.. note::
This function accepts all standard mediatype properties: keyword
argument names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documentation/3.0/manual/api/reference/mediatype/object
:param mediatype: media type - 0: e... | [
"Create",
"new",
"mediatype"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2223-L2268 |
34,292 | saltstack/salt | salt/modules/zabbix.py | mediatype_update | def mediatype_update(mediatypeid, name=False, mediatype=False, **kwargs):
'''
Update existing mediatype
.. note::
This function accepts all standard mediatype properties: keyword
argument names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/docum... | python | def mediatype_update(mediatypeid, name=False, mediatype=False, **kwargs):
'''
Update existing mediatype
.. note::
This function accepts all standard mediatype properties: keyword
argument names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/docum... | [
"def",
"mediatype_update",
"(",
"mediatypeid",
",",
"name",
"=",
"False",
",",
"mediatype",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args"... | Update existing mediatype
.. note::
This function accepts all standard mediatype properties: keyword
argument names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documentation/3.0/manual/api/reference/mediatype/object
:param mediatypeid: ID of the ... | [
"Update",
"existing",
"mediatype"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2305-L2343 |
34,293 | saltstack/salt | salt/modules/zabbix.py | template_get | def template_get(name=None, host=None, templateids=None, **kwargs):
'''
Retrieve templates according to the given parameters.
Args:
host: technical name of the template
name: visible name of the template
hostids: ids of the templates
optional kwargs:
_connec... | python | def template_get(name=None, host=None, templateids=None, **kwargs):
'''
Retrieve templates according to the given parameters.
Args:
host: technical name of the template
name: visible name of the template
hostids: ids of the templates
optional kwargs:
_connec... | [
"def",
"template_get",
"(",
"name",
"=",
"None",
",",
"host",
"=",
"None",
",",
"templateids",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn... | Retrieve templates according to the given parameters.
Args:
host: technical name of the template
name: visible name of the template
hostids: ids of the templates
optional kwargs:
_connection_user: zabbix user (can also be set in opts or pillar, see module's docstrin... | [
"Retrieve",
"templates",
"according",
"to",
"the",
"given",
"parameters",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2346-L2391 |
34,294 | saltstack/salt | salt/modules/zabbix.py | run_query | def run_query(method, params, **kwargs):
'''
Send Zabbix API call
Args:
method: actual operation to perform via the API
params: parameters required for specific method
optional kwargs:
_connection_user: zabbix user (can also be set in opts or pillar, see module's do... | python | def run_query(method, params, **kwargs):
'''
Send Zabbix API call
Args:
method: actual operation to perform via the API
params: parameters required for specific method
optional kwargs:
_connection_user: zabbix user (can also be set in opts or pillar, see module's do... | [
"def",
"run_query",
"(",
"method",
",",
"params",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"method",
"params",
"=",
"params... | Send Zabbix API call
Args:
method: actual operation to perform via the API
params: parameters required for specific method
optional kwargs:
_connection_user: zabbix user (can also be set in opts or pillar, see module's docstring)
_connection_password: zabbix... | [
"Send",
"Zabbix",
"API",
"call"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2394-L2433 |
34,295 | saltstack/salt | salt/states/lxd_container.py | absent | def absent(name,
stop=False,
remote_addr=None,
cert=None,
key=None,
verify_cert=True):
'''
Ensure a LXD container is not present, destroying it if present
name :
The name of the container to destroy
stop :
stop before destroying
... | python | def absent(name,
stop=False,
remote_addr=None,
cert=None,
key=None,
verify_cert=True):
'''
Ensure a LXD container is not present, destroying it if present
name :
The name of the container to destroy
stop :
stop before destroying
... | [
"def",
"absent",
"(",
"name",
",",
"stop",
"=",
"False",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'stop'",
":",
"s... | Ensure a LXD container is not present, destroying it if present
name :
The name of the container to destroy
stop :
stop before destroying
default: false
remote_addr :
An URL to a remote Server, you also have to give cert and key if you
provide remote_addr!
... | [
"Ensure",
"a",
"LXD",
"container",
"is",
"not",
"present",
"destroying",
"it",
"if",
"present"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lxd_container.py#L363-L440 |
34,296 | saltstack/salt | salt/states/lxd_container.py | running | def running(name,
restart=False,
remote_addr=None,
cert=None,
key=None,
verify_cert=True):
'''
Ensure a LXD container is running and restart it if restart is True
name :
The name of the container to start/restart.
restart :
re... | python | def running(name,
restart=False,
remote_addr=None,
cert=None,
key=None,
verify_cert=True):
'''
Ensure a LXD container is running and restart it if restart is True
name :
The name of the container to start/restart.
restart :
re... | [
"def",
"running",
"(",
"name",
",",
"restart",
"=",
"False",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'restart'",
":... | Ensure a LXD container is running and restart it if restart is True
name :
The name of the container to start/restart.
restart :
restart the container if it is already started.
remote_addr :
An URL to a remote Server, you also have to give cert and key if you
provide remot... | [
"Ensure",
"a",
"LXD",
"container",
"is",
"running",
"and",
"restart",
"it",
"if",
"restart",
"is",
"True"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lxd_container.py#L443-L536 |
34,297 | saltstack/salt | salt/states/lxd_container.py | stopped | def stopped(name,
kill=False,
remote_addr=None,
cert=None,
key=None,
verify_cert=True):
'''
Ensure a LXD container is stopped, kill it if kill is true else stop it
name :
The name of the container to stop
kill :
kill if true
... | python | def stopped(name,
kill=False,
remote_addr=None,
cert=None,
key=None,
verify_cert=True):
'''
Ensure a LXD container is stopped, kill it if kill is true else stop it
name :
The name of the container to stop
kill :
kill if true
... | [
"def",
"stopped",
"(",
"name",
",",
"kill",
"=",
"False",
",",
"remote_addr",
"=",
"None",
",",
"cert",
"=",
"None",
",",
"key",
"=",
"None",
",",
"verify_cert",
"=",
"True",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'kill'",
":",
"... | Ensure a LXD container is stopped, kill it if kill is true else stop it
name :
The name of the container to stop
kill :
kill if true
remote_addr :
An URL to a remote Server, you also have to give cert and key if you
provide remote_addr!
Examples:
https... | [
"Ensure",
"a",
"LXD",
"container",
"is",
"stopped",
"kill",
"it",
"if",
"kill",
"is",
"true",
"else",
"stop",
"it"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lxd_container.py#L640-L713 |
34,298 | saltstack/salt | salt/states/lxd_container.py | migrated | def migrated(name,
remote_addr,
cert,
key,
verify_cert,
src_remote_addr,
stop_and_start=False,
src_cert=None,
src_key=None,
src_verify_cert=None):
''' Ensure a container is migrated to another host
... | python | def migrated(name,
remote_addr,
cert,
key,
verify_cert,
src_remote_addr,
stop_and_start=False,
src_cert=None,
src_key=None,
src_verify_cert=None):
''' Ensure a container is migrated to another host
... | [
"def",
"migrated",
"(",
"name",
",",
"remote_addr",
",",
"cert",
",",
"key",
",",
"verify_cert",
",",
"src_remote_addr",
",",
"stop_and_start",
"=",
"False",
",",
"src_cert",
"=",
"None",
",",
"src_key",
"=",
"None",
",",
"src_verify_cert",
"=",
"None",
")... | Ensure a container is migrated to another host
If the container is running, it either must be shut down
first (use stop_and_start=True) or criu must be installed
on the source and destination machines.
For this operation both certs need to be authenticated,
use :mod:`lxd.authenticate <salt.states.... | [
"Ensure",
"a",
"container",
"is",
"migrated",
"to",
"another",
"host"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lxd_container.py#L716-L852 |
34,299 | saltstack/salt | salt/modules/bcache.py | uuid | def uuid(dev=None):
'''
Return the bcache UUID of a block device.
If no device is given, the Cache UUID is returned.
CLI example:
.. code-block:: bash
salt '*' bcache.uuid
salt '*' bcache.uuid /dev/sda
salt '*' bcache.uuid bcache0
'''
try:
if dev is None:
... | python | def uuid(dev=None):
'''
Return the bcache UUID of a block device.
If no device is given, the Cache UUID is returned.
CLI example:
.. code-block:: bash
salt '*' bcache.uuid
salt '*' bcache.uuid /dev/sda
salt '*' bcache.uuid bcache0
'''
try:
if dev is None:
... | [
"def",
"uuid",
"(",
"dev",
"=",
"None",
")",
":",
"try",
":",
"if",
"dev",
"is",
"None",
":",
"# take the only directory in /sys/fs/bcache and return it's basename",
"return",
"list",
"(",
"salt",
".",
"utils",
".",
"path",
".",
"os_walk",
"(",
"'/sys/fs/bcache/... | Return the bcache UUID of a block device.
If no device is given, the Cache UUID is returned.
CLI example:
.. code-block:: bash
salt '*' bcache.uuid
salt '*' bcache.uuid /dev/sda
salt '*' bcache.uuid bcache0 | [
"Return",
"the",
"bcache",
"UUID",
"of",
"a",
"block",
"device",
".",
"If",
"no",
"device",
"is",
"given",
"the",
"Cache",
"UUID",
"is",
"returned",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L57-L79 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.