partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | status_webapp | return the status of the webapp (stopped | running | missing)
app
the webapp context path
url : http://localhost:8080/manager
the URL of the server manager webapp
timeout : 180
timeout for HTTP request
CLI Examples:
.. code-block:: bash
salt '*' tomcat.status_weba... | salt/modules/tomcat.py | def status_webapp(app, url='http://localhost:8080/manager', timeout=180):
'''
return the status of the webapp (stopped | running | missing)
app
the webapp context path
url : http://localhost:8080/manager
the URL of the server manager webapp
timeout : 180
timeout for HTTP req... | def status_webapp(app, url='http://localhost:8080/manager', timeout=180):
'''
return the status of the webapp (stopped | running | missing)
app
the webapp context path
url : http://localhost:8080/manager
the URL of the server manager webapp
timeout : 180
timeout for HTTP req... | [
"return",
"the",
"status",
"of",
"the",
"webapp",
"(",
"stopped",
"|",
"running",
"|",
"missing",
")"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tomcat.py#L449-L473 | [
"def",
"status_webapp",
"(",
"app",
",",
"url",
"=",
"'http://localhost:8080/manager'",
",",
"timeout",
"=",
"180",
")",
":",
"webapps",
"=",
"ls",
"(",
"url",
",",
"timeout",
"=",
"timeout",
")",
"for",
"i",
"in",
"webapps",
":",
"if",
"i",
"==",
"app... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | serverinfo | return details about the server
url : http://localhost:8080/manager
the URL of the server manager webapp
timeout : 180
timeout for HTTP request
CLI Examples:
.. code-block:: bash
salt '*' tomcat.serverinfo
salt '*' tomcat.serverinfo http://localhost:8080/manager | salt/modules/tomcat.py | def serverinfo(url='http://localhost:8080/manager', timeout=180):
'''
return details about the server
url : http://localhost:8080/manager
the URL of the server manager webapp
timeout : 180
timeout for HTTP request
CLI Examples:
.. code-block:: bash
salt '*' tomcat.ser... | def serverinfo(url='http://localhost:8080/manager', timeout=180):
'''
return details about the server
url : http://localhost:8080/manager
the URL of the server manager webapp
timeout : 180
timeout for HTTP request
CLI Examples:
.. code-block:: bash
salt '*' tomcat.ser... | [
"return",
"details",
"about",
"the",
"server"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tomcat.py#L476-L503 | [
"def",
"serverinfo",
"(",
"url",
"=",
"'http://localhost:8080/manager'",
",",
"timeout",
"=",
"180",
")",
":",
"data",
"=",
"_wget",
"(",
"'serverinfo'",
",",
"{",
"}",
",",
"url",
",",
"timeout",
"=",
"timeout",
")",
"if",
"data",
"[",
"'res'",
"]",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | deploy_war | Deploy a WAR file
war
absolute path to WAR file (should be accessible by the user running
tomcat) or a path supported by the salt.modules.cp.get_file function
context
the context path to deploy
force : False
set True to deploy the webapp even one is deployed in the context
... | salt/modules/tomcat.py | def deploy_war(war,
context,
force='no',
url='http://localhost:8080/manager',
saltenv='base',
timeout=180,
temp_war_location=None,
version=True):
'''
Deploy a WAR file
war
absolute path to WAR f... | def deploy_war(war,
context,
force='no',
url='http://localhost:8080/manager',
saltenv='base',
timeout=180,
temp_war_location=None,
version=True):
'''
Deploy a WAR file
war
absolute path to WAR f... | [
"Deploy",
"a",
"WAR",
"file"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tomcat.py#L528-L635 | [
"def",
"deploy_war",
"(",
"war",
",",
"context",
",",
"force",
"=",
"'no'",
",",
"url",
"=",
"'http://localhost:8080/manager'",
",",
"saltenv",
"=",
"'base'",
",",
"timeout",
"=",
"180",
",",
"temp_war_location",
"=",
"None",
",",
"version",
"=",
"True",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | passwd | This function replaces the $CATALINA_HOME/bin/digest.sh script
convert a clear-text password to the $CATALINA_BASE/conf/tomcat-users.xml
format
CLI Examples:
.. code-block:: bash
salt '*' tomcat.passwd secret
salt '*' tomcat.passwd secret tomcat sha1
salt '*' tomcat.passwd sec... | salt/modules/tomcat.py | def passwd(passwd,
user='',
alg='sha1',
realm=None):
'''
This function replaces the $CATALINA_HOME/bin/digest.sh script
convert a clear-text password to the $CATALINA_BASE/conf/tomcat-users.xml
format
CLI Examples:
.. code-block:: bash
salt '*' tomcat.... | def passwd(passwd,
user='',
alg='sha1',
realm=None):
'''
This function replaces the $CATALINA_HOME/bin/digest.sh script
convert a clear-text password to the $CATALINA_BASE/conf/tomcat-users.xml
format
CLI Examples:
.. code-block:: bash
salt '*' tomcat.... | [
"This",
"function",
"replaces",
"the",
"$CATALINA_HOME",
"/",
"bin",
"/",
"digest",
".",
"sh",
"script",
"convert",
"a",
"clear",
"-",
"text",
"password",
"to",
"the",
"$CATALINA_BASE",
"/",
"conf",
"/",
"tomcat",
"-",
"users",
".",
"xml",
"format"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tomcat.py#L638-L663 | [
"def",
"passwd",
"(",
"passwd",
",",
"user",
"=",
"''",
",",
"alg",
"=",
"'sha1'",
",",
"realm",
"=",
"None",
")",
":",
"# Shouldn't it be SHA265 instead of SHA1?",
"digest",
"=",
"hasattr",
"(",
"hashlib",
",",
"alg",
")",
"and",
"getattr",
"(",
"hashlib"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | version | Return server version from catalina.sh version
CLI Example:
.. code-block:: bash
salt '*' tomcat.version | salt/modules/tomcat.py | def version():
'''
Return server version from catalina.sh version
CLI Example:
.. code-block:: bash
salt '*' tomcat.version
'''
cmd = __catalina_home() + '/bin/catalina.sh version'
out = __salt__['cmd.run'](cmd).splitlines()
for line in out:
if not line:
co... | def version():
'''
Return server version from catalina.sh version
CLI Example:
.. code-block:: bash
salt '*' tomcat.version
'''
cmd = __catalina_home() + '/bin/catalina.sh version'
out = __salt__['cmd.run'](cmd).splitlines()
for line in out:
if not line:
co... | [
"Return",
"server",
"version",
"from",
"catalina",
".",
"sh",
"version"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tomcat.py#L667-L684 | [
"def",
"version",
"(",
")",
":",
"cmd",
"=",
"__catalina_home",
"(",
")",
"+",
"'/bin/catalina.sh version'",
"out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
")",
".",
"splitlines",
"(",
")",
"for",
"line",
"in",
"out",
":",
"if",
"not",
"lin... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | fullversion | Return all server information from catalina.sh version
CLI Example:
.. code-block:: bash
salt '*' tomcat.fullversion | salt/modules/tomcat.py | def fullversion():
'''
Return all server information from catalina.sh version
CLI Example:
.. code-block:: bash
salt '*' tomcat.fullversion
'''
cmd = __catalina_home() + '/bin/catalina.sh version'
ret = {}
out = __salt__['cmd.run'](cmd).splitlines()
for line in out:
... | def fullversion():
'''
Return all server information from catalina.sh version
CLI Example:
.. code-block:: bash
salt '*' tomcat.fullversion
'''
cmd = __catalina_home() + '/bin/catalina.sh version'
ret = {}
out = __salt__['cmd.run'](cmd).splitlines()
for line in out:
... | [
"Return",
"all",
"server",
"information",
"from",
"catalina",
".",
"sh",
"version"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tomcat.py#L687-L706 | [
"def",
"fullversion",
"(",
")",
":",
"cmd",
"=",
"__catalina_home",
"(",
")",
"+",
"'/bin/catalina.sh version'",
"ret",
"=",
"{",
"}",
"out",
"=",
"__salt__",
"[",
"'cmd.run'",
"]",
"(",
"cmd",
")",
".",
"splitlines",
"(",
")",
"for",
"line",
"in",
"ou... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | signal | Signals catalina to start, stop, securestart, forcestop.
CLI Example:
.. code-block:: bash
salt '*' tomcat.signal start | salt/modules/tomcat.py | def signal(signal=None):
'''
Signals catalina to start, stop, securestart, forcestop.
CLI Example:
.. code-block:: bash
salt '*' tomcat.signal start
'''
valid_signals = {'forcestop': 'stop -force',
'securestart': 'start -security',
'start': 's... | def signal(signal=None):
'''
Signals catalina to start, stop, securestart, forcestop.
CLI Example:
.. code-block:: bash
salt '*' tomcat.signal start
'''
valid_signals = {'forcestop': 'stop -force',
'securestart': 'start -security',
'start': 's... | [
"Signals",
"catalina",
"to",
"start",
"stop",
"securestart",
"forcestop",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/tomcat.py#L709-L730 | [
"def",
"signal",
"(",
"signal",
"=",
"None",
")",
":",
"valid_signals",
"=",
"{",
"'forcestop'",
":",
"'stop -force'",
",",
"'securestart'",
":",
"'start -security'",
",",
"'start'",
":",
"'start'",
",",
"'stop'",
":",
"'stop'",
"}",
"if",
"signal",
"not",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_options | Get the appoptics options from salt. | salt/returners/appoptics_return.py | def _get_options(ret=None):
'''
Get the appoptics options from salt.
'''
attrs = {
'api_token': 'api_token',
'api_url': 'api_url',
'tags': 'tags',
'sls_states': 'sls_states'
}
_options = salt.returners.get_returner_options(
__virtualname__,
ret,
... | def _get_options(ret=None):
'''
Get the appoptics options from salt.
'''
attrs = {
'api_token': 'api_token',
'api_url': 'api_url',
'tags': 'tags',
'sls_states': 'sls_states'
}
_options = salt.returners.get_returner_options(
__virtualname__,
ret,
... | [
"Get",
"the",
"appoptics",
"options",
"from",
"salt",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/appoptics_return.py#L98-L123 | [
"def",
"_get_options",
"(",
"ret",
"=",
"None",
")",
":",
"attrs",
"=",
"{",
"'api_token'",
":",
"'api_token'",
",",
"'api_url'",
":",
"'api_url'",
",",
"'tags'",
":",
"'tags'",
",",
"'sls_states'",
":",
"'sls_states'",
"}",
"_options",
"=",
"salt",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_appoptics | Return an appoptics connection object. | salt/returners/appoptics_return.py | def _get_appoptics(options):
'''
Return an appoptics connection object.
'''
conn = appoptics_metrics.connect(
options.get('api_token'),
sanitizer=appoptics_metrics.sanitize_metric_name,
hostname=options.get('api_url'))
log.info("Connected to appoptics.")
return conn | def _get_appoptics(options):
'''
Return an appoptics connection object.
'''
conn = appoptics_metrics.connect(
options.get('api_token'),
sanitizer=appoptics_metrics.sanitize_metric_name,
hostname=options.get('api_url'))
log.info("Connected to appoptics.")
return conn | [
"Return",
"an",
"appoptics",
"connection",
"object",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/appoptics_return.py#L126-L135 | [
"def",
"_get_appoptics",
"(",
"options",
")",
":",
"conn",
"=",
"appoptics_metrics",
".",
"connect",
"(",
"options",
".",
"get",
"(",
"'api_token'",
")",
",",
"sanitizer",
"=",
"appoptics_metrics",
".",
"sanitize_metric_name",
",",
"hostname",
"=",
"options",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | returner | Parse the return data and return metrics to AppOptics.
For each state that's provided in the configuration, return tagged metrics for
the result of that state if it's present. | salt/returners/appoptics_return.py | def returner(ret):
'''
Parse the return data and return metrics to AppOptics.
For each state that's provided in the configuration, return tagged metrics for
the result of that state if it's present.
'''
options = _get_options(ret)
states_to_report = ['state.highstate']
if options.get('... | def returner(ret):
'''
Parse the return data and return metrics to AppOptics.
For each state that's provided in the configuration, return tagged metrics for
the result of that state if it's present.
'''
options = _get_options(ret)
states_to_report = ['state.highstate']
if options.get('... | [
"Parse",
"the",
"return",
"data",
"and",
"return",
"metrics",
"to",
"AppOptics",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/appoptics_return.py#L186-L209 | [
"def",
"returner",
"(",
"ret",
")",
":",
"options",
"=",
"_get_options",
"(",
"ret",
")",
"states_to_report",
"=",
"[",
"'state.highstate'",
"]",
"if",
"options",
".",
"get",
"(",
"'sls_states'",
")",
":",
"states_to_report",
".",
"append",
"(",
"'state.sls'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | .. versionadded:: Fluorine
Ensure service exists under service root.
:param host: Technical name of the host
:param service_root: Path of service (path is split by /)
:param service_name: Name of service
:param trigger_desc: Description of trigger in zabbix
:param _connection_user: Optional - ... | salt/states/zabbix_service.py | def present(host, service_root, trigger_desc, service_name=None, **kwargs):
'''
.. versionadded:: Fluorine
Ensure service exists under service root.
:param host: Technical name of the host
:param service_root: Path of service (path is split by /)
:param service_name: Name of service
:param... | def present(host, service_root, trigger_desc, service_name=None, **kwargs):
'''
.. versionadded:: Fluorine
Ensure service exists under service root.
:param host: Technical name of the host
:param service_root: Path of service (path is split by /)
:param service_name: Name of service
:param... | [
"..",
"versionadded",
"::",
"Fluorine"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zabbix_service.py#L17-L128 | [
"def",
"present",
"(",
"host",
",",
"service_root",
",",
"trigger_desc",
",",
"service_name",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"service_name",
":",
"service_name",
"=",
"host",
"changes_service_added",
"=",
"{",
"host",
":",
"{"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | .. versionadded:: Fluorine
Ensure service does not exists under service root.
:param host: Technical name of the host
:param service_root: Path of service (path is split /)
:param service_name: Name of service
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see m... | salt/states/zabbix_service.py | def absent(host, service_root, service_name=None, **kwargs):
'''
.. versionadded:: Fluorine
Ensure service does not exists under service root.
:param host: Technical name of the host
:param service_root: Path of service (path is split /)
:param service_name: Name of service
:param _connecti... | def absent(host, service_root, service_name=None, **kwargs):
'''
.. versionadded:: Fluorine
Ensure service does not exists under service root.
:param host: Technical name of the host
:param service_root: Path of service (path is split /)
:param service_name: Name of service
:param _connecti... | [
"..",
"versionadded",
"::",
"Fluorine",
"Ensure",
"service",
"does",
"not",
"exists",
"under",
"service",
"root",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/zabbix_service.py#L131-L225 | [
"def",
"absent",
"(",
"host",
",",
"service_root",
",",
"service_name",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"service_name",
":",
"service_name",
"=",
"host",
"changes_service_deleted",
"=",
"{",
"host",
":",
"{",
"'old'",
":",
"'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | filetree | Add all files in the tree. If the "path" is a file,
only that file will be added.
:param path: File or directory
:return: | salt/cli/support/intfunc.py | def filetree(collector, *paths):
'''
Add all files in the tree. If the "path" is a file,
only that file will be added.
:param path: File or directory
:return:
'''
_paths = []
# Unglob
for path in paths:
_paths += glob.glob(path)
for path in set(_paths):
if not pa... | def filetree(collector, *paths):
'''
Add all files in the tree. If the "path" is a file,
only that file will be added.
:param path: File or directory
:return:
'''
_paths = []
# Unglob
for path in paths:
_paths += glob.glob(path)
for path in set(_paths):
if not pa... | [
"Add",
"all",
"files",
"in",
"the",
"tree",
".",
"If",
"the",
"path",
"is",
"a",
"file",
"only",
"that",
"file",
"will",
"be",
"added",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cli/support/intfunc.py#L17-L53 | [
"def",
"filetree",
"(",
"collector",
",",
"*",
"paths",
")",
":",
"_paths",
"=",
"[",
"]",
"# Unglob",
"for",
"path",
"in",
"paths",
":",
"_paths",
"+=",
"glob",
".",
"glob",
"(",
"path",
")",
"for",
"path",
"in",
"set",
"(",
"_paths",
")",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_powercfg_minute_values | Returns the AC/DC values in an dict for a guid and subguid for a the given
scheme | salt/modules/win_powercfg.py | def _get_powercfg_minute_values(scheme, guid, subguid, safe_name):
'''
Returns the AC/DC values in an dict for a guid and subguid for a the given
scheme
'''
if scheme is None:
scheme = _get_current_scheme()
if __grains__['osrelease'] == '7':
cmd = 'powercfg /q {0} {1}'.format(sc... | def _get_powercfg_minute_values(scheme, guid, subguid, safe_name):
'''
Returns the AC/DC values in an dict for a guid and subguid for a the given
scheme
'''
if scheme is None:
scheme = _get_current_scheme()
if __grains__['osrelease'] == '7':
cmd = 'powercfg /q {0} {1}'.format(sc... | [
"Returns",
"the",
"AC",
"/",
"DC",
"values",
"in",
"an",
"dict",
"for",
"a",
"guid",
"and",
"subguid",
"for",
"a",
"the",
"given",
"scheme"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_powercfg.py#L44-L69 | [
"def",
"_get_powercfg_minute_values",
"(",
"scheme",
",",
"guid",
",",
"subguid",
",",
"safe_name",
")",
":",
"if",
"scheme",
"is",
"None",
":",
"scheme",
"=",
"_get_current_scheme",
"(",
")",
"if",
"__grains__",
"[",
"'osrelease'",
"]",
"==",
"'7'",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _set_powercfg_value | Sets the AC/DC values of a setting with the given power for the given scheme | salt/modules/win_powercfg.py | def _set_powercfg_value(scheme, sub_group, setting_guid, power, value):
'''
Sets the AC/DC values of a setting with the given power for the given scheme
'''
if scheme is None:
scheme = _get_current_scheme()
cmd = 'powercfg /set{0}valueindex {1} {2} {3} {4}' \
''.format(power, sche... | def _set_powercfg_value(scheme, sub_group, setting_guid, power, value):
'''
Sets the AC/DC values of a setting with the given power for the given scheme
'''
if scheme is None:
scheme = _get_current_scheme()
cmd = 'powercfg /set{0}valueindex {1} {2} {3} {4}' \
''.format(power, sche... | [
"Sets",
"the",
"AC",
"/",
"DC",
"values",
"of",
"a",
"setting",
"with",
"the",
"given",
"power",
"for",
"the",
"given",
"scheme"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_powercfg.py#L72-L81 | [
"def",
"_set_powercfg_value",
"(",
"scheme",
",",
"sub_group",
",",
"setting_guid",
",",
"power",
",",
"value",
")",
":",
"if",
"scheme",
"is",
"None",
":",
"scheme",
"=",
"_get_current_scheme",
"(",
")",
"cmd",
"=",
"'powercfg /set{0}valueindex {1} {2} {3} {4}'",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_monitor_timeout | Set the monitor timeout in minutes for the given power scheme
Args:
timeout (int):
The amount of time in minutes before the monitor will timeout
power (str):
Set the value for AC or DC power. Default is ``ac``. Valid options
are:
- ``ac`` (AC Po... | salt/modules/win_powercfg.py | def set_monitor_timeout(timeout, power='ac', scheme=None):
'''
Set the monitor timeout in minutes for the given power scheme
Args:
timeout (int):
The amount of time in minutes before the monitor will timeout
power (str):
Set the value for AC or DC power. Default is ... | def set_monitor_timeout(timeout, power='ac', scheme=None):
'''
Set the monitor timeout in minutes for the given power scheme
Args:
timeout (int):
The amount of time in minutes before the monitor will timeout
power (str):
Set the value for AC or DC power. Default is ... | [
"Set",
"the",
"monitor",
"timeout",
"in",
"minutes",
"for",
"the",
"given",
"power",
"scheme"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_powercfg.py#L84-L123 | [
"def",
"set_monitor_timeout",
"(",
"timeout",
",",
"power",
"=",
"'ac'",
",",
"scheme",
"=",
"None",
")",
":",
"return",
"_set_powercfg_value",
"(",
"scheme",
"=",
"scheme",
",",
"sub_group",
"=",
"'SUB_VIDEO'",
",",
"setting_guid",
"=",
"'VIDEOIDLE'",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_disk_timeout | Set the disk timeout in minutes for the given power scheme
Args:
timeout (int):
The amount of time in minutes before the disk will timeout
power (str):
Set the value for AC or DC power. Default is ``ac``. Valid options
are:
- ``ac`` (AC Power)
... | salt/modules/win_powercfg.py | def set_disk_timeout(timeout, power='ac', scheme=None):
'''
Set the disk timeout in minutes for the given power scheme
Args:
timeout (int):
The amount of time in minutes before the disk will timeout
power (str):
Set the value for AC or DC power. Default is ``ac``. V... | def set_disk_timeout(timeout, power='ac', scheme=None):
'''
Set the disk timeout in minutes for the given power scheme
Args:
timeout (int):
The amount of time in minutes before the disk will timeout
power (str):
Set the value for AC or DC power. Default is ``ac``. V... | [
"Set",
"the",
"disk",
"timeout",
"in",
"minutes",
"for",
"the",
"given",
"power",
"scheme"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_powercfg.py#L156-L195 | [
"def",
"set_disk_timeout",
"(",
"timeout",
",",
"power",
"=",
"'ac'",
",",
"scheme",
"=",
"None",
")",
":",
"return",
"_set_powercfg_value",
"(",
"scheme",
"=",
"scheme",
",",
"sub_group",
"=",
"'SUB_DISK'",
",",
"setting_guid",
"=",
"'DISKIDLE'",
",",
"powe... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_standby_timeout | Set the standby timeout in minutes for the given power scheme
Args:
timeout (int):
The amount of time in minutes before the computer sleeps
power (str):
Set the value for AC or DC power. Default is ``ac``. Valid options
are:
- ``ac`` (AC Power)
... | salt/modules/win_powercfg.py | def set_standby_timeout(timeout, power='ac', scheme=None):
'''
Set the standby timeout in minutes for the given power scheme
Args:
timeout (int):
The amount of time in minutes before the computer sleeps
power (str):
Set the value for AC or DC power. Default is ``ac`... | def set_standby_timeout(timeout, power='ac', scheme=None):
'''
Set the standby timeout in minutes for the given power scheme
Args:
timeout (int):
The amount of time in minutes before the computer sleeps
power (str):
Set the value for AC or DC power. Default is ``ac`... | [
"Set",
"the",
"standby",
"timeout",
"in",
"minutes",
"for",
"the",
"given",
"power",
"scheme"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_powercfg.py#L228-L267 | [
"def",
"set_standby_timeout",
"(",
"timeout",
",",
"power",
"=",
"'ac'",
",",
"scheme",
"=",
"None",
")",
":",
"return",
"_set_powercfg_value",
"(",
"scheme",
"=",
"scheme",
",",
"sub_group",
"=",
"'SUB_SLEEP'",
",",
"setting_guid",
"=",
"'STANDBYIDLE'",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_hibernate_timeout | Set the hibernate timeout in minutes for the given power scheme
Args:
timeout (int):
The amount of time in minutes before the computer hibernates
power (str):
Set the value for AC or DC power. Default is ``ac``. Valid options
are:
- ``ac`` (AC P... | salt/modules/win_powercfg.py | def set_hibernate_timeout(timeout, power='ac', scheme=None):
'''
Set the hibernate timeout in minutes for the given power scheme
Args:
timeout (int):
The amount of time in minutes before the computer hibernates
power (str):
Set the value for AC or DC power. Default ... | def set_hibernate_timeout(timeout, power='ac', scheme=None):
'''
Set the hibernate timeout in minutes for the given power scheme
Args:
timeout (int):
The amount of time in minutes before the computer hibernates
power (str):
Set the value for AC or DC power. Default ... | [
"Set",
"the",
"hibernate",
"timeout",
"in",
"minutes",
"for",
"the",
"given",
"power",
"scheme"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_powercfg.py#L299-L338 | [
"def",
"set_hibernate_timeout",
"(",
"timeout",
",",
"power",
"=",
"'ac'",
",",
"scheme",
"=",
"None",
")",
":",
"return",
"_set_powercfg_value",
"(",
"scheme",
"=",
"scheme",
",",
"sub_group",
"=",
"'SUB_SLEEP'",
",",
"setting_guid",
"=",
"'HIBERNATEIDLE'",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensure that a pagerduty schedule exists.
This method accepts as args everything defined in
https://developer.pagerduty.com/documentation/rest/schedules/create.
This means that most arguments are in a dict called "schedule."
User id's can be pagerduty id, or name, or email address. | salt/states/pagerduty_schedule.py | def present(profile='pagerduty', subdomain=None, api_key=None, **kwargs):
'''
Ensure that a pagerduty schedule exists.
This method accepts as args everything defined in
https://developer.pagerduty.com/documentation/rest/schedules/create.
This means that most arguments are in a dict called "schedule.... | def present(profile='pagerduty', subdomain=None, api_key=None, **kwargs):
'''
Ensure that a pagerduty schedule exists.
This method accepts as args everything defined in
https://developer.pagerduty.com/documentation/rest/schedules/create.
This means that most arguments are in a dict called "schedule.... | [
"Ensure",
"that",
"a",
"pagerduty",
"schedule",
"exists",
".",
"This",
"method",
"accepts",
"as",
"args",
"everything",
"defined",
"in",
"https",
":",
"//",
"developer",
".",
"pagerduty",
".",
"com",
"/",
"documentation",
"/",
"rest",
"/",
"schedules",
"/",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pagerduty_schedule.py#L48-L77 | [
"def",
"present",
"(",
"profile",
"=",
"'pagerduty'",
",",
"subdomain",
"=",
"None",
",",
"api_key",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# for convenience, we accept id, name, or email as the user id.",
"kwargs",
"[",
"'schedule'",
"]",
"[",
"'name'",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _diff | helper method to compare salt state info with the PagerDuty API json structure,
and determine if we need to update.
returns the dict to pass to the PD API to perform the update, or empty dict if no update. | salt/states/pagerduty_schedule.py | def _diff(state_data, resource_object):
'''helper method to compare salt state info with the PagerDuty API json structure,
and determine if we need to update.
returns the dict to pass to the PD API to perform the update, or empty dict if no update.
'''
state_data['id'] = resource_object['schedule'... | def _diff(state_data, resource_object):
'''helper method to compare salt state info with the PagerDuty API json structure,
and determine if we need to update.
returns the dict to pass to the PD API to perform the update, or empty dict if no update.
'''
state_data['id'] = resource_object['schedule'... | [
"helper",
"method",
"to",
"compare",
"salt",
"state",
"info",
"with",
"the",
"PagerDuty",
"API",
"json",
"structure",
"and",
"determine",
"if",
"we",
"need",
"to",
"update",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pagerduty_schedule.py#L94-L163 | [
"def",
"_diff",
"(",
"state_data",
",",
"resource_object",
")",
":",
"state_data",
"[",
"'id'",
"]",
"=",
"resource_object",
"[",
"'schedule'",
"]",
"[",
"'id'",
"]",
"objects_differ",
"=",
"None",
"# first check all the easy top-level properties: everything except the ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _cron_id | SAFETYBELT, Only set if we really have an identifier | salt/modules/cron.py | def _cron_id(cron):
'''SAFETYBELT, Only set if we really have an identifier'''
cid = None
if cron['identifier']:
cid = cron['identifier']
else:
cid = SALT_CRON_NO_IDENTIFIER
if cid:
return _ensure_string(cid) | def _cron_id(cron):
'''SAFETYBELT, Only set if we really have an identifier'''
cid = None
if cron['identifier']:
cid = cron['identifier']
else:
cid = SALT_CRON_NO_IDENTIFIER
if cid:
return _ensure_string(cid) | [
"SAFETYBELT",
"Only",
"set",
"if",
"we",
"really",
"have",
"an",
"identifier"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cron.py#L52-L60 | [
"def",
"_cron_id",
"(",
"cron",
")",
":",
"cid",
"=",
"None",
"if",
"cron",
"[",
"'identifier'",
"]",
":",
"cid",
"=",
"cron",
"[",
"'identifier'",
"]",
"else",
":",
"cid",
"=",
"SALT_CRON_NO_IDENTIFIER",
"if",
"cid",
":",
"return",
"_ensure_string",
"("... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _cron_matched | Check if:
- we find a cron with same cmd, old state behavior
- but also be smart enough to remove states changed crons where we do
not removed priorly by a cron.absent by matching on the provided
identifier.
We assure retrocompatibility by only checking on identifier if
and o... | salt/modules/cron.py | def _cron_matched(cron, cmd, identifier=None):
'''Check if:
- we find a cron with same cmd, old state behavior
- but also be smart enough to remove states changed crons where we do
not removed priorly by a cron.absent by matching on the provided
identifier.
We assure retrocompati... | def _cron_matched(cron, cmd, identifier=None):
'''Check if:
- we find a cron with same cmd, old state behavior
- but also be smart enough to remove states changed crons where we do
not removed priorly by a cron.absent by matching on the provided
identifier.
We assure retrocompati... | [
"Check",
"if",
":",
"-",
"we",
"find",
"a",
"cron",
"with",
"same",
"cmd",
"old",
"state",
"behavior",
"-",
"but",
"also",
"be",
"smart",
"enough",
"to",
"remove",
"states",
"changed",
"crons",
"where",
"we",
"do",
"not",
"removed",
"priorly",
"by",
"a... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cron.py#L63-L105 | [
"def",
"_cron_matched",
"(",
"cron",
",",
"cmd",
",",
"identifier",
"=",
"None",
")",
":",
"ret",
",",
"id_matched",
"=",
"False",
",",
"None",
"cid",
"=",
"_cron_id",
"(",
"cron",
")",
"if",
"cid",
":",
"if",
"not",
"identifier",
":",
"identifier",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _render_tab | Takes a tab list structure and renders it to a list for applying it to
a file | salt/modules/cron.py | def _render_tab(lst):
'''
Takes a tab list structure and renders it to a list for applying it to
a file
'''
ret = []
for pre in lst['pre']:
ret.append('{0}\n'.format(pre))
if ret:
if ret[-1] != TAG:
ret.append(TAG)
else:
ret.append(TAG)
for env in ... | def _render_tab(lst):
'''
Takes a tab list structure and renders it to a list for applying it to
a file
'''
ret = []
for pre in lst['pre']:
ret.append('{0}\n'.format(pre))
if ret:
if ret[-1] != TAG:
ret.append(TAG)
else:
ret.append(TAG)
for env in ... | [
"Takes",
"a",
"tab",
"list",
"structure",
"and",
"renders",
"it",
"to",
"a",
"list",
"for",
"applying",
"it",
"to",
"a",
"file"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cron.py#L119-L177 | [
"def",
"_render_tab",
"(",
"lst",
")",
":",
"ret",
"=",
"[",
"]",
"for",
"pre",
"in",
"lst",
"[",
"'pre'",
"]",
":",
"ret",
".",
"append",
"(",
"'{0}\\n'",
".",
"format",
"(",
"pre",
")",
")",
"if",
"ret",
":",
"if",
"ret",
"[",
"-",
"1",
"]"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_cron_cmdstr | Returns a format string, to be used to build a crontab command. | salt/modules/cron.py | def _get_cron_cmdstr(path, user=None):
'''
Returns a format string, to be used to build a crontab command.
'''
if user:
cmd = 'crontab -u {0}'.format(user)
else:
cmd = 'crontab'
return '{0} {1}'.format(cmd, path) | def _get_cron_cmdstr(path, user=None):
'''
Returns a format string, to be used to build a crontab command.
'''
if user:
cmd = 'crontab -u {0}'.format(user)
else:
cmd = 'crontab'
return '{0} {1}'.format(cmd, path) | [
"Returns",
"a",
"format",
"string",
"to",
"be",
"used",
"to",
"build",
"a",
"crontab",
"command",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cron.py#L180-L188 | [
"def",
"_get_cron_cmdstr",
"(",
"path",
",",
"user",
"=",
"None",
")",
":",
"if",
"user",
":",
"cmd",
"=",
"'crontab -u {0}'",
".",
"format",
"(",
"user",
")",
"else",
":",
"cmd",
"=",
"'crontab'",
"return",
"'{0} {1}'",
".",
"format",
"(",
"cmd",
",",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | write_cron_file | Writes the contents of a file to a user's crontab
CLI Example:
.. code-block:: bash
salt '*' cron.write_cron_file root /tmp/new_cron
.. versionchanged:: 2015.8.9
.. note::
Some OS' do not support specifying user via the `crontab` command i.e. (Solaris, AIX) | salt/modules/cron.py | def write_cron_file(user, path):
'''
Writes the contents of a file to a user's crontab
CLI Example:
.. code-block:: bash
salt '*' cron.write_cron_file root /tmp/new_cron
.. versionchanged:: 2015.8.9
.. note::
Some OS' do not support specifying user via the `crontab` command... | def write_cron_file(user, path):
'''
Writes the contents of a file to a user's crontab
CLI Example:
.. code-block:: bash
salt '*' cron.write_cron_file root /tmp/new_cron
.. versionchanged:: 2015.8.9
.. note::
Some OS' do not support specifying user via the `crontab` command... | [
"Writes",
"the",
"contents",
"of",
"a",
"file",
"to",
"a",
"user",
"s",
"crontab"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cron.py#L198-L220 | [
"def",
"write_cron_file",
"(",
"user",
",",
"path",
")",
":",
"if",
"_check_instance_uid_match",
"(",
"user",
")",
"or",
"__grains__",
".",
"get",
"(",
"'os_family'",
")",
"in",
"(",
"'Solaris'",
",",
"'AIX'",
")",
":",
"return",
"__salt__",
"[",
"'cmd.ret... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _write_cron_lines | Takes a list of lines to be committed to a user's crontab and writes it | salt/modules/cron.py | def _write_cron_lines(user, lines):
'''
Takes a list of lines to be committed to a user's crontab and writes it
'''
lines = [salt.utils.stringutils.to_str(_l) for _l in lines]
path = salt.utils.files.mkstemp()
if _check_instance_uid_match(user) or __grains__.get('os_family') in ('Solaris', 'AIX'... | def _write_cron_lines(user, lines):
'''
Takes a list of lines to be committed to a user's crontab and writes it
'''
lines = [salt.utils.stringutils.to_str(_l) for _l in lines]
path = salt.utils.files.mkstemp()
if _check_instance_uid_match(user) or __grains__.get('os_family') in ('Solaris', 'AIX'... | [
"Takes",
"a",
"list",
"of",
"lines",
"to",
"be",
"committed",
"to",
"a",
"user",
"s",
"crontab",
"and",
"writes",
"it"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cron.py#L248-L267 | [
"def",
"_write_cron_lines",
"(",
"user",
",",
"lines",
")",
":",
"lines",
"=",
"[",
"salt",
".",
"utils",
".",
"stringutils",
".",
"to_str",
"(",
"_l",
")",
"for",
"_l",
"in",
"lines",
"]",
"path",
"=",
"salt",
".",
"utils",
".",
"files",
".",
"mks... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _date_time_match | Returns true if the minute, hour, etc. params match their counterparts from
the dict returned from list_tab(). | salt/modules/cron.py | def _date_time_match(cron, **kwargs):
'''
Returns true if the minute, hour, etc. params match their counterparts from
the dict returned from list_tab().
'''
return all([kwargs.get(x) is None or cron[x] == six.text_type(kwargs[x])
or (six.text_type(kwargs[x]).lower() == 'random' and c... | def _date_time_match(cron, **kwargs):
'''
Returns true if the minute, hour, etc. params match their counterparts from
the dict returned from list_tab().
'''
return all([kwargs.get(x) is None or cron[x] == six.text_type(kwargs[x])
or (six.text_type(kwargs[x]).lower() == 'random' and c... | [
"Returns",
"true",
"if",
"the",
"minute",
"hour",
"etc",
".",
"params",
"match",
"their",
"counterparts",
"from",
"the",
"dict",
"returned",
"from",
"list_tab",
"()",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cron.py#L270-L277 | [
"def",
"_date_time_match",
"(",
"cron",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"all",
"(",
"[",
"kwargs",
".",
"get",
"(",
"x",
")",
"is",
"None",
"or",
"cron",
"[",
"x",
"]",
"==",
"six",
".",
"text_type",
"(",
"kwargs",
"[",
"x",
"]",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | raw_cron | Return the contents of the user's crontab
CLI Example:
.. code-block:: bash
salt '*' cron.raw_cron root | salt/modules/cron.py | def raw_cron(user):
'''
Return the contents of the user's crontab
CLI Example:
.. code-block:: bash
salt '*' cron.raw_cron root
'''
if _check_instance_uid_match(user) or __grains__.get('os_family') in ('Solaris', 'AIX'):
cmd = 'crontab -l'
# Preserve line endings
... | def raw_cron(user):
'''
Return the contents of the user's crontab
CLI Example:
.. code-block:: bash
salt '*' cron.raw_cron root
'''
if _check_instance_uid_match(user) or __grains__.get('os_family') in ('Solaris', 'AIX'):
cmd = 'crontab -l'
# Preserve line endings
... | [
"Return",
"the",
"contents",
"of",
"the",
"user",
"s",
"crontab"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cron.py#L280-L312 | [
"def",
"raw_cron",
"(",
"user",
")",
":",
"if",
"_check_instance_uid_match",
"(",
"user",
")",
"or",
"__grains__",
".",
"get",
"(",
"'os_family'",
")",
"in",
"(",
"'Solaris'",
",",
"'AIX'",
")",
":",
"cmd",
"=",
"'crontab -l'",
"# Preserve line endings",
"li... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_tab | Return the contents of the specified user's crontab
CLI Example:
.. code-block:: bash
salt '*' cron.list_tab root | salt/modules/cron.py | def list_tab(user):
'''
Return the contents of the specified user's crontab
CLI Example:
.. code-block:: bash
salt '*' cron.list_tab root
'''
data = raw_cron(user)
ret = {'pre': [],
'crons': [],
'special': [],
'env': []}
flag = False
commen... | def list_tab(user):
'''
Return the contents of the specified user's crontab
CLI Example:
.. code-block:: bash
salt '*' cron.list_tab root
'''
data = raw_cron(user)
ret = {'pre': [],
'crons': [],
'special': [],
'env': []}
flag = False
commen... | [
"Return",
"the",
"contents",
"of",
"the",
"specified",
"user",
"s",
"crontab"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cron.py#L315-L404 | [
"def",
"list_tab",
"(",
"user",
")",
":",
"data",
"=",
"raw_cron",
"(",
"user",
")",
"ret",
"=",
"{",
"'pre'",
":",
"[",
"]",
",",
"'crons'",
":",
"[",
"]",
",",
"'special'",
":",
"[",
"]",
",",
"'env'",
":",
"[",
"]",
"}",
"flag",
"=",
"Fals... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_entry | Return the specified entry from user's crontab.
identifier will be used if specified, otherwise will lookup cmd
Either identifier or cmd should be specified.
user:
User's crontab to query
identifier:
Search for line with identifier
cmd:
Search for cron line with cmd
C... | salt/modules/cron.py | def get_entry(user, identifier=None, cmd=None):
'''
Return the specified entry from user's crontab.
identifier will be used if specified, otherwise will lookup cmd
Either identifier or cmd should be specified.
user:
User's crontab to query
identifier:
Search for line with ident... | def get_entry(user, identifier=None, cmd=None):
'''
Return the specified entry from user's crontab.
identifier will be used if specified, otherwise will lookup cmd
Either identifier or cmd should be specified.
user:
User's crontab to query
identifier:
Search for line with ident... | [
"Return",
"the",
"specified",
"entry",
"from",
"user",
"s",
"crontab",
".",
"identifier",
"will",
"be",
"used",
"if",
"specified",
"otherwise",
"will",
"lookup",
"cmd",
"Either",
"identifier",
"or",
"cmd",
"should",
"be",
"specified",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cron.py#L411-L438 | [
"def",
"get_entry",
"(",
"user",
",",
"identifier",
"=",
"None",
",",
"cmd",
"=",
"None",
")",
":",
"cron_entries",
"=",
"list_tab",
"(",
"user",
")",
".",
"get",
"(",
"'crons'",
",",
"False",
")",
"for",
"cron_entry",
"in",
"cron_entries",
":",
"if",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_special | Set up a special command in the crontab.
CLI Example:
.. code-block:: bash
salt '*' cron.set_special root @hourly 'echo foobar' | salt/modules/cron.py | def set_special(user,
special,
cmd,
commented=False,
comment=None,
identifier=None):
'''
Set up a special command in the crontab.
CLI Example:
.. code-block:: bash
salt '*' cron.set_special root @hourly 'echo foob... | def set_special(user,
special,
cmd,
commented=False,
comment=None,
identifier=None):
'''
Set up a special command in the crontab.
CLI Example:
.. code-block:: bash
salt '*' cron.set_special root @hourly 'echo foob... | [
"Set",
"up",
"a",
"special",
"command",
"in",
"the",
"crontab",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cron.py#L441-L516 | [
"def",
"set_special",
"(",
"user",
",",
"special",
",",
"cmd",
",",
"commented",
"=",
"False",
",",
"comment",
"=",
"None",
",",
"identifier",
"=",
"None",
")",
":",
"lst",
"=",
"list_tab",
"(",
"user",
")",
"for",
"cron",
"in",
"lst",
"[",
"'special... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_cron_date_time | Returns a dict of date/time values to be used in a cron entry | salt/modules/cron.py | def _get_cron_date_time(**kwargs):
'''
Returns a dict of date/time values to be used in a cron entry
'''
# Define ranges (except daymonth, as it depends on the month)
range_max = {
'minute': list(list(range(60))),
'hour': list(list(range(24))),
'month': list(list(range(1, 13)... | def _get_cron_date_time(**kwargs):
'''
Returns a dict of date/time values to be used in a cron entry
'''
# Define ranges (except daymonth, as it depends on the month)
range_max = {
'minute': list(list(range(60))),
'hour': list(list(range(24))),
'month': list(list(range(1, 13)... | [
"Returns",
"a",
"dict",
"of",
"date",
"/",
"time",
"values",
"to",
"be",
"used",
"in",
"a",
"cron",
"entry"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cron.py#L519-L558 | [
"def",
"_get_cron_date_time",
"(",
"*",
"*",
"kwargs",
")",
":",
"# Define ranges (except daymonth, as it depends on the month)",
"range_max",
"=",
"{",
"'minute'",
":",
"list",
"(",
"list",
"(",
"range",
"(",
"60",
")",
")",
")",
",",
"'hour'",
":",
"list",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_job | Sets a cron job up for a specified user.
CLI Example:
.. code-block:: bash
salt '*' cron.set_job root '*' '*' '*' '*' 1 /usr/local/weekly | salt/modules/cron.py | def set_job(user,
minute,
hour,
daymonth,
month,
dayweek,
cmd,
commented=False,
comment=None,
identifier=None):
'''
Sets a cron job up for a specified user.
CLI Example:
.. code-block:: bash
... | def set_job(user,
minute,
hour,
daymonth,
month,
dayweek,
cmd,
commented=False,
comment=None,
identifier=None):
'''
Sets a cron job up for a specified user.
CLI Example:
.. code-block:: bash
... | [
"Sets",
"a",
"cron",
"job",
"up",
"for",
"a",
"specified",
"user",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cron.py#L561-L661 | [
"def",
"set_job",
"(",
"user",
",",
"minute",
",",
"hour",
",",
"daymonth",
",",
"month",
",",
"dayweek",
",",
"cmd",
",",
"commented",
"=",
"False",
",",
"comment",
"=",
"None",
",",
"identifier",
"=",
"None",
")",
":",
"# Scrub the types",
"minute",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | rm_special | Remove a special cron job for a specified user.
CLI Example:
.. code-block:: bash
salt '*' cron.rm_special root /usr/bin/foo | salt/modules/cron.py | def rm_special(user, cmd, special=None, identifier=None):
'''
Remove a special cron job for a specified user.
CLI Example:
.. code-block:: bash
salt '*' cron.rm_special root /usr/bin/foo
'''
lst = list_tab(user)
ret = 'absent'
rm_ = None
for ind in range(len(lst['special']... | def rm_special(user, cmd, special=None, identifier=None):
'''
Remove a special cron job for a specified user.
CLI Example:
.. code-block:: bash
salt '*' cron.rm_special root /usr/bin/foo
'''
lst = list_tab(user)
ret = 'absent'
rm_ = None
for ind in range(len(lst['special']... | [
"Remove",
"a",
"special",
"cron",
"job",
"for",
"a",
"specified",
"user",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cron.py#L664-L694 | [
"def",
"rm_special",
"(",
"user",
",",
"cmd",
",",
"special",
"=",
"None",
",",
"identifier",
"=",
"None",
")",
":",
"lst",
"=",
"list_tab",
"(",
"user",
")",
"ret",
"=",
"'absent'",
"rm_",
"=",
"None",
"for",
"ind",
"in",
"range",
"(",
"len",
"(",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | rm_job | Remove a cron job for a specified user. If any of the day/time params are
specified, the job will only be removed if the specified params match.
CLI Example:
.. code-block:: bash
salt '*' cron.rm_job root /usr/local/weekly
salt '*' cron.rm_job root /usr/bin/foo dayweek=1 | salt/modules/cron.py | def rm_job(user,
cmd,
minute=None,
hour=None,
daymonth=None,
month=None,
dayweek=None,
identifier=None):
'''
Remove a cron job for a specified user. If any of the day/time params are
specified, the job will only be removed if the s... | def rm_job(user,
cmd,
minute=None,
hour=None,
daymonth=None,
month=None,
dayweek=None,
identifier=None):
'''
Remove a cron job for a specified user. If any of the day/time params are
specified, the job will only be removed if the s... | [
"Remove",
"a",
"cron",
"job",
"for",
"a",
"specified",
"user",
".",
"If",
"any",
"of",
"the",
"day",
"/",
"time",
"params",
"are",
"specified",
"the",
"job",
"will",
"only",
"be",
"removed",
"if",
"the",
"specified",
"params",
"match",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cron.py#L697-L742 | [
"def",
"rm_job",
"(",
"user",
",",
"cmd",
",",
"minute",
"=",
"None",
",",
"hour",
"=",
"None",
",",
"daymonth",
"=",
"None",
",",
"month",
"=",
"None",
",",
"dayweek",
"=",
"None",
",",
"identifier",
"=",
"None",
")",
":",
"lst",
"=",
"list_tab",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_env | Set up an environment variable in the crontab.
CLI Example:
.. code-block:: bash
salt '*' cron.set_env root MAILTO user@example.com | salt/modules/cron.py | def set_env(user, name, value=None):
'''
Set up an environment variable in the crontab.
CLI Example:
.. code-block:: bash
salt '*' cron.set_env root MAILTO user@example.com
'''
lst = list_tab(user)
for env in lst['env']:
if name == env['name']:
if value != env[... | def set_env(user, name, value=None):
'''
Set up an environment variable in the crontab.
CLI Example:
.. code-block:: bash
salt '*' cron.set_env root MAILTO user@example.com
'''
lst = list_tab(user)
for env in lst['env']:
if name == env['name']:
if value != env[... | [
"Set",
"up",
"an",
"environment",
"variable",
"in",
"the",
"crontab",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cron.py#L748-L775 | [
"def",
"set_env",
"(",
"user",
",",
"name",
",",
"value",
"=",
"None",
")",
":",
"lst",
"=",
"list_tab",
"(",
"user",
")",
"for",
"env",
"in",
"lst",
"[",
"'env'",
"]",
":",
"if",
"name",
"==",
"env",
"[",
"'name'",
"]",
":",
"if",
"value",
"!=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | rm_env | Remove cron environment variable for a specified user.
CLI Example:
.. code-block:: bash
salt '*' cron.rm_env root MAILTO | salt/modules/cron.py | def rm_env(user, name):
'''
Remove cron environment variable for a specified user.
CLI Example:
.. code-block:: bash
salt '*' cron.rm_env root MAILTO
'''
lst = list_tab(user)
ret = 'absent'
rm_ = None
for ind in range(len(lst['env'])):
if name == lst['env'][ind]['n... | def rm_env(user, name):
'''
Remove cron environment variable for a specified user.
CLI Example:
.. code-block:: bash
salt '*' cron.rm_env root MAILTO
'''
lst = list_tab(user)
ret = 'absent'
rm_ = None
for ind in range(len(lst['env'])):
if name == lst['env'][ind]['n... | [
"Remove",
"cron",
"environment",
"variable",
"for",
"a",
"specified",
"user",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/cron.py#L778-L801 | [
"def",
"rm_env",
"(",
"user",
",",
"name",
")",
":",
"lst",
"=",
"list_tab",
"(",
"user",
")",
"ret",
"=",
"'absent'",
"rm_",
"=",
"None",
"for",
"ind",
"in",
"range",
"(",
"len",
"(",
"lst",
"[",
"'env'",
"]",
")",
")",
":",
"if",
"name",
"=="... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | exists | Given a bucket name, check to see if the given bucket exists.
Returns True if the given bucket exists and returns False if the given
bucket does not exist.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.exists mybucket | salt/modules/boto_s3_bucket.py | def exists(Bucket,
region=None, key=None, keyid=None, profile=None):
'''
Given a bucket name, check to see if the given bucket exists.
Returns True if the given bucket exists and returns False if the given
bucket does not exist.
CLI Example:
.. code-block:: bash
salt mymin... | def exists(Bucket,
region=None, key=None, keyid=None, profile=None):
'''
Given a bucket name, check to see if the given bucket exists.
Returns True if the given bucket exists and returns False if the given
bucket does not exist.
CLI Example:
.. code-block:: bash
salt mymin... | [
"Given",
"a",
"bucket",
"name",
"check",
"to",
"see",
"if",
"the",
"given",
"bucket",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L103-L127 | [
"def",
"exists",
"(",
"Bucket",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create | Given a valid config, create an S3 Bucket.
Returns {created: true} if the bucket was created and returns
{created: False} if the bucket was not created.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.create my_bucket \\
GrantFullControl='emailaddress=... | salt/modules/boto_s3_bucket.py | def create(Bucket,
ACL=None, LocationConstraint=None,
GrantFullControl=None,
GrantRead=None,
GrantReadACP=None,
GrantWrite=None,
GrantWriteACP=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, create an ... | def create(Bucket,
ACL=None, LocationConstraint=None,
GrantFullControl=None,
GrantRead=None,
GrantReadACP=None,
GrantWrite=None,
GrantWriteACP=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, create an ... | [
"Given",
"a",
"valid",
"config",
"create",
"an",
"S3",
"Bucket",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L130-L177 | [
"def",
"create",
"(",
"Bucket",
",",
"ACL",
"=",
"None",
",",
"LocationConstraint",
"=",
"None",
",",
"GrantFullControl",
"=",
"None",
",",
"GrantRead",
"=",
"None",
",",
"GrantReadACP",
"=",
"None",
",",
"GrantWrite",
"=",
"None",
",",
"GrantWriteACP",
"=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete | Given a bucket name, delete it, optionally emptying it first.
Returns {deleted: true} if the bucket was deleted and returns
{deleted: false} if the bucket was not deleted.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.delete mybucket | salt/modules/boto_s3_bucket.py | def delete(Bucket, MFA=None, RequestPayer=None, Force=False,
region=None, key=None, keyid=None, profile=None):
'''
Given a bucket name, delete it, optionally emptying it first.
Returns {deleted: true} if the bucket was deleted and returns
{deleted: false} if the bucket was not deleted.
... | def delete(Bucket, MFA=None, RequestPayer=None, Force=False,
region=None, key=None, keyid=None, profile=None):
'''
Given a bucket name, delete it, optionally emptying it first.
Returns {deleted: true} if the bucket was deleted and returns
{deleted: false} if the bucket was not deleted.
... | [
"Given",
"a",
"bucket",
"name",
"delete",
"it",
"optionally",
"emptying",
"it",
"first",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L180-L204 | [
"def",
"delete",
"(",
"Bucket",
",",
"MFA",
"=",
"None",
",",
"RequestPayer",
"=",
"None",
",",
"Force",
"=",
"False",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_objects | Delete objects in a given S3 bucket.
Returns {deleted: true} if all objects were deleted
and {deleted: false, failed: [key, ...]} otherwise
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.delete_objects mybucket '{Objects: [Key: myobject]}' | salt/modules/boto_s3_bucket.py | def delete_objects(Bucket, Delete, MFA=None, RequestPayer=None,
region=None, key=None, keyid=None, profile=None):
'''
Delete objects in a given S3 bucket.
Returns {deleted: true} if all objects were deleted
and {deleted: false, failed: [key, ...]} otherwise
CLI Example:
.. ... | def delete_objects(Bucket, Delete, MFA=None, RequestPayer=None,
region=None, key=None, keyid=None, profile=None):
'''
Delete objects in a given S3 bucket.
Returns {deleted: true} if all objects were deleted
and {deleted: false, failed: [key, ...]} otherwise
CLI Example:
.. ... | [
"Delete",
"objects",
"in",
"a",
"given",
"S3",
"bucket",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L207-L249 | [
"def",
"delete_objects",
"(",
"Bucket",
",",
"Delete",
",",
"MFA",
"=",
"None",
",",
"RequestPayer",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"if",
"isinstance... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | describe | Given a bucket name describe its properties.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.describe mybucket | salt/modules/boto_s3_bucket.py | def describe(Bucket,
region=None, key=None, keyid=None, profile=None):
'''
Given a bucket name describe its properties.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.describe mybucket
'''
try:
... | def describe(Bucket,
region=None, key=None, keyid=None, profile=None):
'''
Given a bucket name describe its properties.
Returns a dictionary of interesting properties.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.describe mybucket
'''
try:
... | [
"Given",
"a",
"bucket",
"name",
"describe",
"its",
"properties",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L252-L315 | [
"def",
"describe",
"(",
"Bucket",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | empty | Delete all objects in a given S3 bucket.
Returns {deleted: true} if all objects were deleted
and {deleted: false, failed: [key, ...]} otherwise
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.empty mybucket | salt/modules/boto_s3_bucket.py | def empty(Bucket, MFA=None, RequestPayer=None, region=None, key=None,
keyid=None, profile=None):
'''
Delete all objects in a given S3 bucket.
Returns {deleted: true} if all objects were deleted
and {deleted: false, failed: [key, ...]} otherwise
CLI Example:
.. code-block:: bash
... | def empty(Bucket, MFA=None, RequestPayer=None, region=None, key=None,
keyid=None, profile=None):
'''
Delete all objects in a given S3 bucket.
Returns {deleted: true} if all objects were deleted
and {deleted: false, failed: [key, ...]} otherwise
CLI Example:
.. code-block:: bash
... | [
"Delete",
"all",
"objects",
"in",
"a",
"given",
"S3",
"bucket",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L318-L345 | [
"def",
"empty",
"(",
"Bucket",
",",
"MFA",
"=",
"None",
",",
"RequestPayer",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"stuff",
"=",
"list_object_versions",
"("... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list | List all buckets owned by the authenticated sender of the request.
Returns list of buckets
CLI Example:
.. code-block:: yaml
Owner: {...}
Buckets:
- {...}
- {...} | salt/modules/boto_s3_bucket.py | def list(region=None, key=None, keyid=None, profile=None):
'''
List all buckets owned by the authenticated sender of the request.
Returns list of buckets
CLI Example:
.. code-block:: yaml
Owner: {...}
Buckets:
- {...}
- {...}
'''
try:
conn = _... | def list(region=None, key=None, keyid=None, profile=None):
'''
List all buckets owned by the authenticated sender of the request.
Returns list of buckets
CLI Example:
.. code-block:: yaml
Owner: {...}
Buckets:
- {...}
- {...}
'''
try:
conn = _... | [
"List",
"all",
"buckets",
"owned",
"by",
"the",
"authenticated",
"sender",
"of",
"the",
"request",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L348-L373 | [
"def",
"list",
"(",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"keyid",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_object_versions | List objects in a given S3 bucket.
Returns a list of objects.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.list_object_versions mybucket | salt/modules/boto_s3_bucket.py | def list_object_versions(Bucket, Delimiter=None, EncodingType=None, Prefix=None,
region=None, key=None, keyid=None, profile=None):
'''
List objects in a given S3 bucket.
Returns a list of objects.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.list_object... | def list_object_versions(Bucket, Delimiter=None, EncodingType=None, Prefix=None,
region=None, key=None, keyid=None, profile=None):
'''
List objects in a given S3 bucket.
Returns a list of objects.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.list_object... | [
"List",
"objects",
"in",
"a",
"given",
"S3",
"bucket",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L376-L410 | [
"def",
"list_object_versions",
"(",
"Bucket",
",",
"Delimiter",
"=",
"None",
",",
"EncodingType",
"=",
"None",
",",
"Prefix",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_objects | List objects in a given S3 bucket.
Returns a list of objects.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.list_objects mybucket | salt/modules/boto_s3_bucket.py | def list_objects(Bucket, Delimiter=None, EncodingType=None, Prefix=None,
FetchOwner=False, StartAfter=None, region=None, key=None,
keyid=None, profile=None):
'''
List objects in a given S3 bucket.
Returns a list of objects.
CLI Example:
.. code-block:: bash
... | def list_objects(Bucket, Delimiter=None, EncodingType=None, Prefix=None,
FetchOwner=False, StartAfter=None, region=None, key=None,
keyid=None, profile=None):
'''
List objects in a given S3 bucket.
Returns a list of objects.
CLI Example:
.. code-block:: bash
... | [
"List",
"objects",
"in",
"a",
"given",
"S3",
"bucket",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L413-L446 | [
"def",
"list_objects",
"(",
"Bucket",
",",
"Delimiter",
"=",
"None",
",",
"EncodingType",
"=",
"None",
",",
"Prefix",
"=",
"None",
",",
"FetchOwner",
"=",
"False",
",",
"StartAfter",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
","... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | put_acl | Given a valid config, update the ACL for a bucket.
Returns {updated: true} if the ACL was updated and returns
{updated: False} if the ACL was not updated.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.put_acl my_bucket 'public' \\
GrantFullControl='e... | salt/modules/boto_s3_bucket.py | def put_acl(Bucket,
ACL=None,
AccessControlPolicy=None,
GrantFullControl=None,
GrantRead=None,
GrantReadACP=None,
GrantWrite=None,
GrantWriteACP=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid confi... | def put_acl(Bucket,
ACL=None,
AccessControlPolicy=None,
GrantFullControl=None,
GrantRead=None,
GrantReadACP=None,
GrantWrite=None,
GrantWriteACP=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid confi... | [
"Given",
"a",
"valid",
"config",
"update",
"the",
"ACL",
"for",
"a",
"bucket",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L449-L491 | [
"def",
"put_acl",
"(",
"Bucket",
",",
"ACL",
"=",
"None",
",",
"AccessControlPolicy",
"=",
"None",
",",
"GrantFullControl",
"=",
"None",
",",
"GrantRead",
"=",
"None",
",",
"GrantReadACP",
"=",
"None",
",",
"GrantWrite",
"=",
"None",
",",
"GrantWriteACP",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | put_cors | Given a valid config, update the CORS rules for a bucket.
Returns {updated: true} if CORS was updated and returns
{updated: False} if CORS was not updated.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.put_cors my_bucket '[{\\
"AllowedHeaders":[],\\
... | salt/modules/boto_s3_bucket.py | def put_cors(Bucket,
CORSRules,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, update the CORS rules for a bucket.
Returns {updated: true} if CORS was updated and returns
{updated: False} if CORS was not updated.
CLI Example:
.. code-block:: ... | def put_cors(Bucket,
CORSRules,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, update the CORS rules for a bucket.
Returns {updated: true} if CORS was updated and returns
{updated: False} if CORS was not updated.
CLI Example:
.. code-block:: ... | [
"Given",
"a",
"valid",
"config",
"update",
"the",
"CORS",
"rules",
"for",
"a",
"bucket",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L494-L524 | [
"def",
"put_cors",
"(",
"Bucket",
",",
"CORSRules",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | put_lifecycle_configuration | Given a valid config, update the Lifecycle rules for a bucket.
Returns {updated: true} if Lifecycle was updated and returns
{updated: False} if Lifecycle was not updated.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.put_lifecycle_configuration my_bucket '[{\\
... | salt/modules/boto_s3_bucket.py | def put_lifecycle_configuration(Bucket,
Rules,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, update the Lifecycle rules for a bucket.
Returns {updated: true} if Lifecycle was updated and returns
{updated: False} if Lifecycle was not updated.
CLI ... | def put_lifecycle_configuration(Bucket,
Rules,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, update the Lifecycle rules for a bucket.
Returns {updated: true} if Lifecycle was updated and returns
{updated: False} if Lifecycle was not updated.
CLI ... | [
"Given",
"a",
"valid",
"config",
"update",
"the",
"Lifecycle",
"rules",
"for",
"a",
"bucket",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L527-L559 | [
"def",
"put_lifecycle_configuration",
"(",
"Bucket",
",",
"Rules",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | put_logging | Given a valid config, update the logging parameters for a bucket.
Returns {updated: true} if parameters were updated and returns
{updated: False} if parameters were not updated.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.put_logging my_bucket log_bucket '[{...}]' prefix | salt/modules/boto_s3_bucket.py | def put_logging(Bucket,
TargetBucket=None, TargetPrefix=None, TargetGrants=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, update the logging parameters for a bucket.
Returns {updated: true} if parameters were updated and returns
{updated: False} ... | def put_logging(Bucket,
TargetBucket=None, TargetPrefix=None, TargetGrants=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, update the logging parameters for a bucket.
Returns {updated: true} if parameters were updated and returns
{updated: False} ... | [
"Given",
"a",
"valid",
"config",
"update",
"the",
"logging",
"parameters",
"for",
"a",
"bucket",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L562-L597 | [
"def",
"put_logging",
"(",
"Bucket",
",",
"TargetBucket",
"=",
"None",
",",
"TargetPrefix",
"=",
"None",
",",
"TargetGrants",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | put_notification_configuration | Given a valid config, update the notification parameters for a bucket.
Returns {updated: true} if parameters were updated and returns
{updated: False} if parameters were not updated.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.put_notification_configuration my_bucket
... | salt/modules/boto_s3_bucket.py | def put_notification_configuration(Bucket,
TopicConfigurations=None, QueueConfigurations=None,
LambdaFunctionConfigurations=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, update the notification parameters for a bucket.
Returns {updated: t... | def put_notification_configuration(Bucket,
TopicConfigurations=None, QueueConfigurations=None,
LambdaFunctionConfigurations=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, update the notification parameters for a bucket.
Returns {updated: t... | [
"Given",
"a",
"valid",
"config",
"update",
"the",
"notification",
"parameters",
"for",
"a",
"bucket",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L600-L643 | [
"def",
"put_notification_configuration",
"(",
"Bucket",
",",
"TopicConfigurations",
"=",
"None",
",",
"QueueConfigurations",
"=",
"None",
",",
"LambdaFunctionConfigurations",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"N... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | put_policy | Given a valid config, update the policy for a bucket.
Returns {updated: true} if policy was updated and returns
{updated: False} if policy was not updated.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.put_policy my_bucket {...} | salt/modules/boto_s3_bucket.py | def put_policy(Bucket, Policy,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, update the policy for a bucket.
Returns {updated: true} if policy was updated and returns
{updated: False} if policy was not updated.
CLI Example:
.. code-block:: bash
... | def put_policy(Bucket, Policy,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, update the policy for a bucket.
Returns {updated: true} if policy was updated and returns
{updated: False} if policy was not updated.
CLI Example:
.. code-block:: bash
... | [
"Given",
"a",
"valid",
"config",
"update",
"the",
"policy",
"for",
"a",
"bucket",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L646-L671 | [
"def",
"put_policy",
"(",
"Bucket",
",",
"Policy",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | put_replication | Given a valid config, update the replication configuration for a bucket.
Returns {updated: true} if replication configuration was updated and returns
{updated: False} if replication configuration was not updated.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.put_replication ... | salt/modules/boto_s3_bucket.py | def put_replication(Bucket, Role, Rules,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, update the replication configuration for a bucket.
Returns {updated: true} if replication configuration was updated and returns
{updated: False} if replication configuration w... | def put_replication(Bucket, Role, Rules,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, update the replication configuration for a bucket.
Returns {updated: true} if replication configuration was updated and returns
{updated: False} if replication configuration w... | [
"Given",
"a",
"valid",
"config",
"update",
"the",
"replication",
"configuration",
"for",
"a",
"bucket",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L688-L718 | [
"def",
"put_replication",
"(",
"Bucket",
",",
"Role",
",",
"Rules",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"re... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | put_request_payment | Given a valid config, update the request payment configuration for a bucket.
Returns {updated: true} if request payment configuration was updated and returns
{updated: False} if request payment configuration was not updated.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.put_... | salt/modules/boto_s3_bucket.py | def put_request_payment(Bucket, Payer,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, update the request payment configuration for a bucket.
Returns {updated: true} if request payment configuration was updated and returns
{updated: False} if request payment confi... | def put_request_payment(Bucket, Payer,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, update the request payment configuration for a bucket.
Returns {updated: true} if request payment configuration was updated and returns
{updated: False} if request payment confi... | [
"Given",
"a",
"valid",
"config",
"update",
"the",
"request",
"payment",
"configuration",
"for",
"a",
"bucket",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L721-L744 | [
"def",
"put_request_payment",
"(",
"Bucket",
",",
"Payer",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | put_tagging | Given a valid config, update the tags for a bucket.
Returns {updated: true} if tags were updated and returns
{updated: False} if tags were not updated.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.put_tagging my_bucket my_role [...] | salt/modules/boto_s3_bucket.py | def put_tagging(Bucket,
region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Given a valid config, update the tags for a bucket.
Returns {updated: true} if tags were updated and returns
{updated: False} if tags were not updated.
CLI Example:
.. code-block:: bash
... | def put_tagging(Bucket,
region=None, key=None, keyid=None, profile=None, **kwargs):
'''
Given a valid config, update the tags for a bucket.
Returns {updated: true} if tags were updated and returns
{updated: False} if tags were not updated.
CLI Example:
.. code-block:: bash
... | [
"Given",
"a",
"valid",
"config",
"update",
"the",
"tags",
"for",
"a",
"bucket",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L747-L775 | [
"def",
"put_tagging",
"(",
"Bucket",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | put_versioning | Given a valid config, update the versioning configuration for a bucket.
Returns {updated: true} if versioning configuration was updated and returns
{updated: False} if versioning configuration was not updated.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.put_versioning my_b... | salt/modules/boto_s3_bucket.py | def put_versioning(Bucket, Status, MFADelete=None, MFA=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, update the versioning configuration for a bucket.
Returns {updated: true} if versioning configuration was updated and returns
{updated: False} if versionin... | def put_versioning(Bucket, Status, MFADelete=None, MFA=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, update the versioning configuration for a bucket.
Returns {updated: true} if versioning configuration was updated and returns
{updated: False} if versionin... | [
"Given",
"a",
"valid",
"config",
"update",
"the",
"versioning",
"configuration",
"for",
"a",
"bucket",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L778-L807 | [
"def",
"put_versioning",
"(",
"Bucket",
",",
"Status",
",",
"MFADelete",
"=",
"None",
",",
"MFA",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | put_website | Given a valid config, update the website configuration for a bucket.
Returns {updated: true} if website configuration was updated and returns
{updated: False} if website configuration was not updated.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.put_website my_bucket IndexD... | salt/modules/boto_s3_bucket.py | def put_website(Bucket, ErrorDocument=None, IndexDocument=None,
RedirectAllRequestsTo=None, RoutingRules=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, update the website configuration for a bucket.
Returns {updated: true} if website configuration wa... | def put_website(Bucket, ErrorDocument=None, IndexDocument=None,
RedirectAllRequestsTo=None, RoutingRules=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid config, update the website configuration for a bucket.
Returns {updated: true} if website configuration wa... | [
"Given",
"a",
"valid",
"config",
"update",
"the",
"website",
"configuration",
"for",
"a",
"bucket",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L810-L842 | [
"def",
"put_website",
"(",
"Bucket",
",",
"ErrorDocument",
"=",
"None",
",",
"IndexDocument",
"=",
"None",
",",
"RedirectAllRequestsTo",
"=",
"None",
",",
"RoutingRules",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_cors | Delete the CORS configuration for the given bucket
Returns {deleted: true} if CORS was deleted and returns
{deleted: False} if CORS was not deleted.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.delete_cors my_bucket | salt/modules/boto_s3_bucket.py | def delete_cors(Bucket,
region=None, key=None, keyid=None, profile=None):
'''
Delete the CORS configuration for the given bucket
Returns {deleted: true} if CORS was deleted and returns
{deleted: False} if CORS was not deleted.
CLI Example:
.. code-block:: bash
salt myminio... | def delete_cors(Bucket,
region=None, key=None, keyid=None, profile=None):
'''
Delete the CORS configuration for the given bucket
Returns {deleted: true} if CORS was deleted and returns
{deleted: False} if CORS was not deleted.
CLI Example:
.. code-block:: bash
salt myminio... | [
"Delete",
"the",
"CORS",
"configuration",
"for",
"the",
"given",
"bucket"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L845-L866 | [
"def",
"delete_cors",
"(",
"Bucket",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_lifecycle_configuration | Delete the lifecycle configuration for the given bucket
Returns {deleted: true} if Lifecycle was deleted and returns
{deleted: False} if Lifecycle was not deleted.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.delete_lifecycle_configuration my_bucket | salt/modules/boto_s3_bucket.py | def delete_lifecycle_configuration(Bucket,
region=None, key=None, keyid=None, profile=None):
'''
Delete the lifecycle configuration for the given bucket
Returns {deleted: true} if Lifecycle was deleted and returns
{deleted: False} if Lifecycle was not deleted.
CLI Example:
.. code-... | def delete_lifecycle_configuration(Bucket,
region=None, key=None, keyid=None, profile=None):
'''
Delete the lifecycle configuration for the given bucket
Returns {deleted: true} if Lifecycle was deleted and returns
{deleted: False} if Lifecycle was not deleted.
CLI Example:
.. code-... | [
"Delete",
"the",
"lifecycle",
"configuration",
"for",
"the",
"given",
"bucket"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L869-L890 | [
"def",
"delete_lifecycle_configuration",
"(",
"Bucket",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_replication | Delete the replication config from the given bucket
Returns {deleted: true} if replication configuration was deleted and returns
{deleted: False} if replication configuration was not deleted.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.delete_replication my_bucket | salt/modules/boto_s3_bucket.py | def delete_replication(Bucket,
region=None, key=None, keyid=None, profile=None):
'''
Delete the replication config from the given bucket
Returns {deleted: true} if replication configuration was deleted and returns
{deleted: False} if replication configuration was not deleted.
CLI Exampl... | def delete_replication(Bucket,
region=None, key=None, keyid=None, profile=None):
'''
Delete the replication config from the given bucket
Returns {deleted: true} if replication configuration was deleted and returns
{deleted: False} if replication configuration was not deleted.
CLI Exampl... | [
"Delete",
"the",
"replication",
"config",
"from",
"the",
"given",
"bucket"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L917-L938 | [
"def",
"delete_replication",
"(",
"Bucket",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_tagging | Delete the tags from the given bucket
Returns {deleted: true} if tags were deleted and returns
{deleted: False} if tags were not deleted.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.delete_tagging my_bucket | salt/modules/boto_s3_bucket.py | def delete_tagging(Bucket,
region=None, key=None, keyid=None, profile=None):
'''
Delete the tags from the given bucket
Returns {deleted: true} if tags were deleted and returns
{deleted: False} if tags were not deleted.
CLI Example:
.. code-block:: bash
salt myminion boto_s... | def delete_tagging(Bucket,
region=None, key=None, keyid=None, profile=None):
'''
Delete the tags from the given bucket
Returns {deleted: true} if tags were deleted and returns
{deleted: False} if tags were not deleted.
CLI Example:
.. code-block:: bash
salt myminion boto_s... | [
"Delete",
"the",
"tags",
"from",
"the",
"given",
"bucket"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L941-L962 | [
"def",
"delete_tagging",
"(",
"Bucket",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | delete_website | Remove the website configuration from the given bucket
Returns {deleted: true} if website configuration was deleted and returns
{deleted: False} if website configuration was not deleted.
CLI Example:
.. code-block:: bash
salt myminion boto_s3_bucket.delete_website my_bucket | salt/modules/boto_s3_bucket.py | def delete_website(Bucket,
region=None, key=None, keyid=None, profile=None):
'''
Remove the website configuration from the given bucket
Returns {deleted: true} if website configuration was deleted and returns
{deleted: False} if website configuration was not deleted.
CLI Example:
.... | def delete_website(Bucket,
region=None, key=None, keyid=None, profile=None):
'''
Remove the website configuration from the given bucket
Returns {deleted: true} if website configuration was deleted and returns
{deleted: False} if website configuration was not deleted.
CLI Example:
.... | [
"Remove",
"the",
"website",
"configuration",
"from",
"the",
"given",
"bucket"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_s3_bucket.py#L965-L986 | [
"def",
"delete_website",
"(",
"Bucket",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | PublisherACL.user_is_blacklisted | Takes a username as a string and returns a boolean. True indicates that
the provided user has been blacklisted | salt/acl/__init__.py | def user_is_blacklisted(self, user):
'''
Takes a username as a string and returns a boolean. True indicates that
the provided user has been blacklisted
'''
return not salt.utils.stringutils.check_whitelist_blacklist(user, blacklist=self.blacklist.get('users', [])) | def user_is_blacklisted(self, user):
'''
Takes a username as a string and returns a boolean. True indicates that
the provided user has been blacklisted
'''
return not salt.utils.stringutils.check_whitelist_blacklist(user, blacklist=self.blacklist.get('users', [])) | [
"Takes",
"a",
"username",
"as",
"a",
"string",
"and",
"returns",
"a",
"boolean",
".",
"True",
"indicates",
"that",
"the",
"provided",
"user",
"has",
"been",
"blacklisted"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/acl/__init__.py#L29-L34 | [
"def",
"user_is_blacklisted",
"(",
"self",
",",
"user",
")",
":",
"return",
"not",
"salt",
".",
"utils",
".",
"stringutils",
".",
"check_whitelist_blacklist",
"(",
"user",
",",
"blacklist",
"=",
"self",
".",
"blacklist",
".",
"get",
"(",
"'users'",
",",
"[... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensure that a pagerduty escalation policy exists. Will create or update as needed.
This method accepts as args everything defined in
https://developer.pagerduty.com/documentation/rest/escalation_policies/create.
In addition, user and schedule id's will be translated from name (or email address)
into P... | salt/states/pagerduty_escalation_policy.py | def present(profile='pagerduty', subdomain=None, api_key=None, **kwargs):
'''
Ensure that a pagerduty escalation policy exists. Will create or update as needed.
This method accepts as args everything defined in
https://developer.pagerduty.com/documentation/rest/escalation_policies/create.
In addit... | def present(profile='pagerduty', subdomain=None, api_key=None, **kwargs):
'''
Ensure that a pagerduty escalation policy exists. Will create or update as needed.
This method accepts as args everything defined in
https://developer.pagerduty.com/documentation/rest/escalation_policies/create.
In addit... | [
"Ensure",
"that",
"a",
"pagerduty",
"escalation",
"policy",
"exists",
".",
"Will",
"create",
"or",
"update",
"as",
"needed",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pagerduty_escalation_policy.py#L49-L107 | [
"def",
"present",
"(",
"profile",
"=",
"'pagerduty'",
",",
"subdomain",
"=",
"None",
",",
"api_key",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"# for convenience, we accept id, name, or email for users",
"# and we accept the id or name for schedules",
"for",
"esca... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _diff | helper method to compare salt state info with the PagerDuty API json structure,
and determine if we need to update.
returns the dict to pass to the PD API to perform the update, or empty dict if no update. | salt/states/pagerduty_escalation_policy.py | def _diff(state_data, resource_object):
'''helper method to compare salt state info with the PagerDuty API json structure,
and determine if we need to update.
returns the dict to pass to the PD API to perform the update, or empty dict if no update.
'''
objects_differ = None
for k, v in state_d... | def _diff(state_data, resource_object):
'''helper method to compare salt state info with the PagerDuty API json structure,
and determine if we need to update.
returns the dict to pass to the PD API to perform the update, or empty dict if no update.
'''
objects_differ = None
for k, v in state_d... | [
"helper",
"method",
"to",
"compare",
"salt",
"state",
"info",
"with",
"the",
"PagerDuty",
"API",
"json",
"structure",
"and",
"determine",
"if",
"we",
"need",
"to",
"update",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pagerduty_escalation_policy.py#L127-L151 | [
"def",
"_diff",
"(",
"state_data",
",",
"resource_object",
")",
":",
"objects_differ",
"=",
"None",
"for",
"k",
",",
"v",
"in",
"state_data",
".",
"items",
"(",
")",
":",
"if",
"k",
"==",
"'escalation_rules'",
":",
"v",
"=",
"_escalation_rules_to_string",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _escalation_rules_to_string | convert escalation_rules dict to a string for comparison | salt/states/pagerduty_escalation_policy.py | def _escalation_rules_to_string(escalation_rules):
'convert escalation_rules dict to a string for comparison'
result = ''
for rule in escalation_rules:
result += 'escalation_delay_in_minutes: {0} '.format(rule['escalation_delay_in_minutes'])
for target in rule['targets']:
result ... | def _escalation_rules_to_string(escalation_rules):
'convert escalation_rules dict to a string for comparison'
result = ''
for rule in escalation_rules:
result += 'escalation_delay_in_minutes: {0} '.format(rule['escalation_delay_in_minutes'])
for target in rule['targets']:
result ... | [
"convert",
"escalation_rules",
"dict",
"to",
"a",
"string",
"for",
"comparison"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/pagerduty_escalation_policy.py#L154-L161 | [
"def",
"_escalation_rules_to_string",
"(",
"escalation_rules",
")",
":",
"result",
"=",
"''",
"for",
"rule",
"in",
"escalation_rules",
":",
"result",
"+=",
"'escalation_delay_in_minutes: {0} '",
".",
"format",
"(",
"rule",
"[",
"'escalation_delay_in_minutes'",
"]",
")... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _check_perms_changes | Check whether Rabbitmq user's permissions need to be changed. | salt/states/rabbitmq_user.py | def _check_perms_changes(name, newperms, runas=None, existing=None):
'''
Check whether Rabbitmq user's permissions need to be changed.
'''
if not newperms:
return False
if existing is None:
try:
existing = __salt__['rabbitmq.list_user_permissions'](name, runas=runas)
... | def _check_perms_changes(name, newperms, runas=None, existing=None):
'''
Check whether Rabbitmq user's permissions need to be changed.
'''
if not newperms:
return False
if existing is None:
try:
existing = __salt__['rabbitmq.list_user_permissions'](name, runas=runas)
... | [
"Check",
"whether",
"Rabbitmq",
"user",
"s",
"permissions",
"need",
"to",
"be",
"changed",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rabbitmq_user.py#L44-L73 | [
"def",
"_check_perms_changes",
"(",
"name",
",",
"newperms",
",",
"runas",
"=",
"None",
",",
"existing",
"=",
"None",
")",
":",
"if",
"not",
"newperms",
":",
"return",
"False",
"if",
"existing",
"is",
"None",
":",
"try",
":",
"existing",
"=",
"__salt__",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_current_tags | Whether Rabbitmq user's tags need to be changed | salt/states/rabbitmq_user.py | def _get_current_tags(name, runas=None):
'''
Whether Rabbitmq user's tags need to be changed
'''
try:
return list(__salt__['rabbitmq.list_users'](runas=runas)[name])
except CommandExecutionError as err:
log.error('Error: %s', err)
return [] | def _get_current_tags(name, runas=None):
'''
Whether Rabbitmq user's tags need to be changed
'''
try:
return list(__salt__['rabbitmq.list_users'](runas=runas)[name])
except CommandExecutionError as err:
log.error('Error: %s', err)
return [] | [
"Whether",
"Rabbitmq",
"user",
"s",
"tags",
"need",
"to",
"be",
"changed"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rabbitmq_user.py#L76-L84 | [
"def",
"_get_current_tags",
"(",
"name",
",",
"runas",
"=",
"None",
")",
":",
"try",
":",
"return",
"list",
"(",
"__salt__",
"[",
"'rabbitmq.list_users'",
"]",
"(",
"runas",
"=",
"runas",
")",
"[",
"name",
"]",
")",
"except",
"CommandExecutionError",
"as",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | present | Ensure the RabbitMQ user exists.
name
User name
password
User's password, if one needs to be set
force
If user exists, forcibly change the password
tags
Optional list of tags for the user
perms
A list of dicts with vhost keys and 3-tuple values
runas
... | salt/states/rabbitmq_user.py | def present(name,
password=None,
force=False,
tags=None,
perms=(),
runas=None):
'''
Ensure the RabbitMQ user exists.
name
User name
password
User's password, if one needs to be set
force
If user exists, forcibly cha... | def present(name,
password=None,
force=False,
tags=None,
perms=(),
runas=None):
'''
Ensure the RabbitMQ user exists.
name
User name
password
User's password, if one needs to be set
force
If user exists, forcibly cha... | [
"Ensure",
"the",
"RabbitMQ",
"user",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rabbitmq_user.py#L87-L229 | [
"def",
"present",
"(",
"name",
",",
"password",
"=",
"None",
",",
"force",
"=",
"False",
",",
"tags",
"=",
"None",
",",
"perms",
"=",
"(",
")",
",",
"runas",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Ensure the named user is absent
name
The name of the user to remove
runas
User to run the command | salt/states/rabbitmq_user.py | def absent(name,
runas=None):
'''
Ensure the named user is absent
name
The name of the user to remove
runas
User to run the command
'''
ret = {'name': name, 'result': False, 'comment': '', 'changes': {}}
try:
user_exists = __salt__['rabbitmq.user_exists']... | def absent(name,
runas=None):
'''
Ensure the named user is absent
name
The name of the user to remove
runas
User to run the command
'''
ret = {'name': name, 'result': False, 'comment': '', 'changes': {}}
try:
user_exists = __salt__['rabbitmq.user_exists']... | [
"Ensure",
"the",
"named",
"user",
"is",
"absent"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rabbitmq_user.py#L232-L272 | [
"def",
"absent",
"(",
"name",
",",
"runas",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"try",
":",
"user_exists",
"=",
"__salt__",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | pause | Set up a state id pause, this instructs a running state to pause at a given
state id. This needs to pass in the jid of the running state and can
optionally pass in a duration in seconds. | salt/runners/state.py | def pause(jid, state_id=None, duration=None):
'''
Set up a state id pause, this instructs a running state to pause at a given
state id. This needs to pass in the jid of the running state and can
optionally pass in a duration in seconds.
'''
minion = salt.minion.MasterMinion(__opts__)
minion.... | def pause(jid, state_id=None, duration=None):
'''
Set up a state id pause, this instructs a running state to pause at a given
state id. This needs to pass in the jid of the running state and can
optionally pass in a duration in seconds.
'''
minion = salt.minion.MasterMinion(__opts__)
minion.... | [
"Set",
"up",
"a",
"state",
"id",
"pause",
"this",
"instructs",
"a",
"running",
"state",
"to",
"pause",
"at",
"a",
"given",
"state",
"id",
".",
"This",
"needs",
"to",
"pass",
"in",
"the",
"jid",
"of",
"the",
"running",
"state",
"and",
"can",
"optionally... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/state.py#L19-L26 | [
"def",
"pause",
"(",
"jid",
",",
"state_id",
"=",
"None",
",",
"duration",
"=",
"None",
")",
":",
"minion",
"=",
"salt",
".",
"minion",
".",
"MasterMinion",
"(",
"__opts__",
")",
"minion",
".",
"functions",
"[",
"'state.pause'",
"]",
"(",
"jid",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | resume | Remove a pause from a jid, allowing it to continue | salt/runners/state.py | def resume(jid, state_id=None):
'''
Remove a pause from a jid, allowing it to continue
'''
minion = salt.minion.MasterMinion(__opts__)
minion.functions['state.resume'](jid, state_id) | def resume(jid, state_id=None):
'''
Remove a pause from a jid, allowing it to continue
'''
minion = salt.minion.MasterMinion(__opts__)
minion.functions['state.resume'](jid, state_id) | [
"Remove",
"a",
"pause",
"from",
"a",
"jid",
"allowing",
"it",
"to",
"continue"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/state.py#L32-L37 | [
"def",
"resume",
"(",
"jid",
",",
"state_id",
"=",
"None",
")",
":",
"minion",
"=",
"salt",
".",
"minion",
".",
"MasterMinion",
"(",
"__opts__",
")",
"minion",
".",
"functions",
"[",
"'state.resume'",
"]",
"(",
"jid",
",",
"state_id",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | soft_kill | Set up a state run to die before executing the given state id,
this instructs a running state to safely exit at a given
state id. This needs to pass in the jid of the running state.
If a state_id is not passed then the jid referenced will be safely exited
at the beginning of the next state run. | salt/runners/state.py | def soft_kill(jid, state_id=None):
'''
Set up a state run to die before executing the given state id,
this instructs a running state to safely exit at a given
state id. This needs to pass in the jid of the running state.
If a state_id is not passed then the jid referenced will be safely exited
a... | def soft_kill(jid, state_id=None):
'''
Set up a state run to die before executing the given state id,
this instructs a running state to safely exit at a given
state id. This needs to pass in the jid of the running state.
If a state_id is not passed then the jid referenced will be safely exited
a... | [
"Set",
"up",
"a",
"state",
"run",
"to",
"die",
"before",
"executing",
"the",
"given",
"state",
"id",
"this",
"instructs",
"a",
"running",
"state",
"to",
"safely",
"exit",
"at",
"a",
"given",
"state",
"id",
".",
"This",
"needs",
"to",
"pass",
"in",
"the... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/state.py#L43-L52 | [
"def",
"soft_kill",
"(",
"jid",
",",
"state_id",
"=",
"None",
")",
":",
"minion",
"=",
"salt",
".",
"minion",
".",
"MasterMinion",
"(",
"__opts__",
")",
"minion",
".",
"functions",
"[",
"'state.soft_kill'",
"]",
"(",
"jid",
",",
"state_id",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | orchestrate | .. versionadded:: 0.17.0
Execute a state run from the master, used as a powerful orchestration
system.
.. seealso:: More Orchestrate documentation
* :ref:`Full Orchestrate Tutorial <orchestrate-runner>`
* :py:mod:`Docs for the master-side state module <salt.states.saltmod>`
CLI Examp... | salt/runners/state.py | def orchestrate(mods,
saltenv='base',
test=None,
exclude=None,
pillar=None,
pillarenv=None,
pillar_enc=None,
orchestration_jid=None):
'''
.. versionadded:: 0.17.0
Execute a state run from the mas... | def orchestrate(mods,
saltenv='base',
test=None,
exclude=None,
pillar=None,
pillarenv=None,
pillar_enc=None,
orchestration_jid=None):
'''
.. versionadded:: 0.17.0
Execute a state run from the mas... | [
"..",
"versionadded",
"::",
"0",
".",
"17",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/state.py#L55-L135 | [
"def",
"orchestrate",
"(",
"mods",
",",
"saltenv",
"=",
"'base'",
",",
"test",
"=",
"None",
",",
"exclude",
"=",
"None",
",",
"pillar",
"=",
"None",
",",
"pillarenv",
"=",
"None",
",",
"pillar_enc",
"=",
"None",
",",
"orchestration_jid",
"=",
"None",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | orchestrate_single | Execute a single state orchestration routine
.. versionadded:: 2015.5.0
CLI Example:
.. code-block:: bash
salt-run state.orchestrate_single fun=salt.wheel name=key.list_all | salt/runners/state.py | def orchestrate_single(fun, name, test=None, queue=False, pillar=None, **kwargs):
'''
Execute a single state orchestration routine
.. versionadded:: 2015.5.0
CLI Example:
.. code-block:: bash
salt-run state.orchestrate_single fun=salt.wheel name=key.list_all
'''
if pillar is not ... | def orchestrate_single(fun, name, test=None, queue=False, pillar=None, **kwargs):
'''
Execute a single state orchestration routine
.. versionadded:: 2015.5.0
CLI Example:
.. code-block:: bash
salt-run state.orchestrate_single fun=salt.wheel name=key.list_all
'''
if pillar is not ... | [
"Execute",
"a",
"single",
"state",
"orchestration",
"routine"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/state.py#L143-L170 | [
"def",
"orchestrate_single",
"(",
"fun",
",",
"name",
",",
"test",
"=",
"None",
",",
"queue",
"=",
"False",
",",
"pillar",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"pillar",
"is",
"not",
"None",
"and",
"not",
"isinstance",
"(",
"pillar",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | orchestrate_high | Execute a single state orchestration routine
.. versionadded:: 2015.5.0
CLI Example:
.. code-block:: bash
salt-run state.orchestrate_high '{
stage_one:
{salt.state: [{tgt: "db*"}, {sls: postgres_setup}]},
stage_two:
{salt.state: [{tgt: "web... | salt/runners/state.py | def orchestrate_high(data, test=None, queue=False, pillar=None, **kwargs):
'''
Execute a single state orchestration routine
.. versionadded:: 2015.5.0
CLI Example:
.. code-block:: bash
salt-run state.orchestrate_high '{
stage_one:
{salt.state: [{tgt: "db*"}, {... | def orchestrate_high(data, test=None, queue=False, pillar=None, **kwargs):
'''
Execute a single state orchestration routine
.. versionadded:: 2015.5.0
CLI Example:
.. code-block:: bash
salt-run state.orchestrate_high '{
stage_one:
{salt.state: [{tgt: "db*"}, {... | [
"Execute",
"a",
"single",
"state",
"orchestration",
"routine"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/state.py#L173-L206 | [
"def",
"orchestrate_high",
"(",
"data",
",",
"test",
"=",
"None",
",",
"queue",
"=",
"False",
",",
"pillar",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"pillar",
"is",
"not",
"None",
"and",
"not",
"isinstance",
"(",
"pillar",
",",
"dict",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | orchestrate_show_sls | Display the state data from a specific sls, or list of sls files, after
being render using the master minion.
Note, the master minion adds a "_master" suffix to it's minion id.
.. seealso:: The state.show_sls module function
CLI Example:
.. code-block:: bash
salt-run state.orch_show_sls ... | salt/runners/state.py | def orchestrate_show_sls(mods,
saltenv='base',
test=None,
queue=False,
pillar=None,
pillarenv=None,
pillar_enc=None):
'''
Display the state data from a specific s... | def orchestrate_show_sls(mods,
saltenv='base',
test=None,
queue=False,
pillar=None,
pillarenv=None,
pillar_enc=None):
'''
Display the state data from a specific s... | [
"Display",
"the",
"state",
"data",
"from",
"a",
"specific",
"sls",
"or",
"list",
"of",
"sls",
"files",
"after",
"being",
"render",
"using",
"the",
"master",
"minion",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/state.py#L209-L245 | [
"def",
"orchestrate_show_sls",
"(",
"mods",
",",
"saltenv",
"=",
"'base'",
",",
"test",
"=",
"None",
",",
"queue",
"=",
"False",
",",
"pillar",
"=",
"None",
",",
"pillarenv",
"=",
"None",
",",
"pillar_enc",
"=",
"None",
")",
":",
"if",
"pillar",
"is",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | event | r'''
Watch Salt's event bus and block until the given tag is matched
.. versionadded:: 2014.7.0
.. versionchanged:: 2019.2.0
``tagmatch`` can now be either a glob or regular expression.
This is useful for utilizing Salt's event bus from shell scripts or for
taking simple actions directly f... | salt/runners/state.py | def event(tagmatch='*',
count=-1,
quiet=False,
sock_dir=None,
pretty=False,
node='master'):
r'''
Watch Salt's event bus and block until the given tag is matched
.. versionadded:: 2014.7.0
.. versionchanged:: 2019.2.0
``tagmatch`` can now be eith... | def event(tagmatch='*',
count=-1,
quiet=False,
sock_dir=None,
pretty=False,
node='master'):
r'''
Watch Salt's event bus and block until the given tag is matched
.. versionadded:: 2014.7.0
.. versionchanged:: 2019.2.0
``tagmatch`` can now be eith... | [
"r",
"Watch",
"Salt",
"s",
"event",
"bus",
"and",
"block",
"until",
"the",
"given",
"tag",
"is",
"matched"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/state.py#L251-L313 | [
"def",
"event",
"(",
"tagmatch",
"=",
"'*'",
",",
"count",
"=",
"-",
"1",
",",
"quiet",
"=",
"False",
",",
"sock_dir",
"=",
"None",
",",
"pretty",
"=",
"False",
",",
"node",
"=",
"'master'",
")",
":",
"statemod",
"=",
"salt",
".",
"loader",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | send_msg | Send a message to an SMTP recipient. Designed for use in states.
CLI Examples:
.. code-block:: bash
salt '*' smtp.send_msg 'admin@example.com' 'This is a salt module test' profile='my-smtp-account'
salt '*' smtp.send_msg 'admin@example.com' 'This is a salt module test' username='myuser' passw... | salt/modules/smtp.py | def send_msg(recipient,
message,
subject='Message from Salt',
sender=None,
server=None,
use_ssl='True',
username=None,
password=None,
profile=None,
attachments=None):
'''
Send a message to an SMT... | def send_msg(recipient,
message,
subject='Message from Salt',
sender=None,
server=None,
use_ssl='True',
username=None,
password=None,
profile=None,
attachments=None):
'''
Send a message to an SMT... | [
"Send",
"a",
"message",
"to",
"an",
"SMTP",
"recipient",
".",
"Designed",
"for",
"use",
"in",
"states",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/smtp.py#L77-L175 | [
"def",
"send_msg",
"(",
"recipient",
",",
"message",
",",
"subject",
"=",
"'Message from Salt'",
",",
"sender",
"=",
"None",
",",
"server",
"=",
"None",
",",
"use_ssl",
"=",
"'True'",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
",",
"prof... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | add_distinguished_name | Adds a distinguished name to a distinguished name list.
list_name(str): The name of the specific policy distinguished name list to append to.
item_name(str): The distinguished name to append.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.add_distinguished_name MyDistinguishedList... | salt/modules/bluecoat_sslv.py | def add_distinguished_name(list_name, item_name):
'''
Adds a distinguished name to a distinguished name list.
list_name(str): The name of the specific policy distinguished name list to append to.
item_name(str): The distinguished name to append.
CLI Example:
.. code-block:: bash
sal... | def add_distinguished_name(list_name, item_name):
'''
Adds a distinguished name to a distinguished name list.
list_name(str): The name of the specific policy distinguished name list to append to.
item_name(str): The distinguished name to append.
CLI Example:
.. code-block:: bash
sal... | [
"Adds",
"a",
"distinguished",
"name",
"to",
"a",
"distinguished",
"name",
"list",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bluecoat_sslv.py#L76-L98 | [
"def",
"add_distinguished_name",
"(",
"list_name",
",",
"item_name",
")",
":",
"payload",
"=",
"{",
"\"jsonrpc\"",
":",
"\"2.0\"",
",",
"\"id\"",
":",
"\"ID0\"",
",",
"\"method\"",
":",
"\"add_policy_distinguished_names\"",
",",
"\"params\"",
":",
"[",
"list_name"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | add_distinguished_name_list | Add a list of policy distinguished names.
list_name(str): The name of the specific policy distinguished name list to add.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.add_distinguished_name_list MyDistinguishedList | salt/modules/bluecoat_sslv.py | def add_distinguished_name_list(list_name):
'''
Add a list of policy distinguished names.
list_name(str): The name of the specific policy distinguished name list to add.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.add_distinguished_name_list MyDistinguishedList
'''
... | def add_distinguished_name_list(list_name):
'''
Add a list of policy distinguished names.
list_name(str): The name of the specific policy distinguished name list to add.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.add_distinguished_name_list MyDistinguishedList
'''
... | [
"Add",
"a",
"list",
"of",
"policy",
"distinguished",
"names",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bluecoat_sslv.py#L101-L121 | [
"def",
"add_distinguished_name_list",
"(",
"list_name",
")",
":",
"payload",
"=",
"{",
"\"jsonrpc\"",
":",
"\"2.0\"",
",",
"\"id\"",
":",
"\"ID0\"",
",",
"\"method\"",
":",
"\"add_policy_distinguished_names_list\"",
",",
"\"params\"",
":",
"[",
"{",
"\"list_name\"",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | add_domain_name | Adds a domain name to a domain name list.
list_name(str): The name of the specific policy domain name list to append to.
item_name(str): The domain name to append.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.add_domain_name MyDomainName foo.bar.com | salt/modules/bluecoat_sslv.py | def add_domain_name(list_name, item_name):
'''
Adds a domain name to a domain name list.
list_name(str): The name of the specific policy domain name list to append to.
item_name(str): The domain name to append.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.add_domain_name... | def add_domain_name(list_name, item_name):
'''
Adds a domain name to a domain name list.
list_name(str): The name of the specific policy domain name list to append to.
item_name(str): The domain name to append.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.add_domain_name... | [
"Adds",
"a",
"domain",
"name",
"to",
"a",
"domain",
"name",
"list",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bluecoat_sslv.py#L124-L146 | [
"def",
"add_domain_name",
"(",
"list_name",
",",
"item_name",
")",
":",
"payload",
"=",
"{",
"\"jsonrpc\"",
":",
"\"2.0\"",
",",
"\"id\"",
":",
"\"ID0\"",
",",
"\"method\"",
":",
"\"add_policy_domain_names\"",
",",
"\"params\"",
":",
"[",
"list_name",
",",
"{"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | add_domain_name_list | Add a list of policy domain names.
list_name(str): The name of the specific policy domain name list to add.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.add_domain_name_list MyDomainNameList | salt/modules/bluecoat_sslv.py | def add_domain_name_list(list_name):
'''
Add a list of policy domain names.
list_name(str): The name of the specific policy domain name list to add.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.add_domain_name_list MyDomainNameList
'''
payload = {"jsonrpc": "2.0",
... | def add_domain_name_list(list_name):
'''
Add a list of policy domain names.
list_name(str): The name of the specific policy domain name list to add.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.add_domain_name_list MyDomainNameList
'''
payload = {"jsonrpc": "2.0",
... | [
"Add",
"a",
"list",
"of",
"policy",
"domain",
"names",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bluecoat_sslv.py#L149-L169 | [
"def",
"add_domain_name_list",
"(",
"list_name",
")",
":",
"payload",
"=",
"{",
"\"jsonrpc\"",
":",
"\"2.0\"",
",",
"\"id\"",
":",
"\"ID0\"",
",",
"\"method\"",
":",
"\"add_policy_domain_names_list\"",
",",
"\"params\"",
":",
"[",
"{",
"\"list_name\"",
":",
"lis... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | add_ip_address | Add an IP address to an IP address list.
list_name(str): The name of the specific policy IP address list to append to.
item_name(str): The IP address to append to the list.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.add_ip_address MyIPAddressList 10.0.0.0/24 | salt/modules/bluecoat_sslv.py | def add_ip_address(list_name, item_name):
'''
Add an IP address to an IP address list.
list_name(str): The name of the specific policy IP address list to append to.
item_name(str): The IP address to append to the list.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.add_ip_... | def add_ip_address(list_name, item_name):
'''
Add an IP address to an IP address list.
list_name(str): The name of the specific policy IP address list to append to.
item_name(str): The IP address to append to the list.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.add_ip_... | [
"Add",
"an",
"IP",
"address",
"to",
"an",
"IP",
"address",
"list",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bluecoat_sslv.py#L172-L194 | [
"def",
"add_ip_address",
"(",
"list_name",
",",
"item_name",
")",
":",
"payload",
"=",
"{",
"\"jsonrpc\"",
":",
"\"2.0\"",
",",
"\"id\"",
":",
"\"ID0\"",
",",
"\"method\"",
":",
"\"add_policy_ip_addresses\"",
",",
"\"params\"",
":",
"[",
"list_name",
",",
"{",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | add_ip_address_list | Retrieves a list of all IP address lists.
list_name(str): The name of the specific IP address list to add.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.add_ip_address_list MyIPAddressList | salt/modules/bluecoat_sslv.py | def add_ip_address_list(list_name):
'''
Retrieves a list of all IP address lists.
list_name(str): The name of the specific IP address list to add.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.add_ip_address_list MyIPAddressList
'''
payload = {"jsonrpc": "2.0",
... | def add_ip_address_list(list_name):
'''
Retrieves a list of all IP address lists.
list_name(str): The name of the specific IP address list to add.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.add_ip_address_list MyIPAddressList
'''
payload = {"jsonrpc": "2.0",
... | [
"Retrieves",
"a",
"list",
"of",
"all",
"IP",
"address",
"lists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bluecoat_sslv.py#L197-L217 | [
"def",
"add_ip_address_list",
"(",
"list_name",
")",
":",
"payload",
"=",
"{",
"\"jsonrpc\"",
":",
"\"2.0\"",
",",
"\"id\"",
":",
"\"ID0\"",
",",
"\"method\"",
":",
"\"add_policy_ip_addresses_list\"",
",",
"\"params\"",
":",
"[",
"{",
"\"list_name\"",
":",
"list... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_distinguished_name_list | Retrieves a specific policy distinguished name list.
list_name(str): The name of the specific policy distinguished name list to retrieve.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.get_distinguished_name_list MyDistinguishedList | salt/modules/bluecoat_sslv.py | def get_distinguished_name_list(list_name):
'''
Retrieves a specific policy distinguished name list.
list_name(str): The name of the specific policy distinguished name list to retrieve.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.get_distinguished_name_list MyDistinguishedLi... | def get_distinguished_name_list(list_name):
'''
Retrieves a specific policy distinguished name list.
list_name(str): The name of the specific policy distinguished name list to retrieve.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.get_distinguished_name_list MyDistinguishedLi... | [
"Retrieves",
"a",
"specific",
"policy",
"distinguished",
"name",
"list",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bluecoat_sslv.py#L220-L240 | [
"def",
"get_distinguished_name_list",
"(",
"list_name",
")",
":",
"payload",
"=",
"{",
"\"jsonrpc\"",
":",
"\"2.0\"",
",",
"\"id\"",
":",
"\"ID0\"",
",",
"\"method\"",
":",
"\"get_policy_distinguished_names\"",
",",
"\"params\"",
":",
"[",
"list_name",
",",
"0",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_domain_list | Retrieves a specific policy domain name list.
list_name(str): The name of the specific policy domain name list to retrieve.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.get_domain_list MyDomainNameList | salt/modules/bluecoat_sslv.py | def get_domain_list(list_name):
'''
Retrieves a specific policy domain name list.
list_name(str): The name of the specific policy domain name list to retrieve.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.get_domain_list MyDomainNameList
'''
payload = {"jsonrpc": "2.... | def get_domain_list(list_name):
'''
Retrieves a specific policy domain name list.
list_name(str): The name of the specific policy domain name list to retrieve.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.get_domain_list MyDomainNameList
'''
payload = {"jsonrpc": "2.... | [
"Retrieves",
"a",
"specific",
"policy",
"domain",
"name",
"list",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bluecoat_sslv.py#L264-L284 | [
"def",
"get_domain_list",
"(",
"list_name",
")",
":",
"payload",
"=",
"{",
"\"jsonrpc\"",
":",
"\"2.0\"",
",",
"\"id\"",
":",
"\"ID0\"",
",",
"\"method\"",
":",
"\"get_policy_domain_names\"",
",",
"\"params\"",
":",
"[",
"list_name",
",",
"0",
",",
"256",
"]... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_ip_address_list | Retrieves a specific IP address list.
list_name(str): The name of the specific policy IP address list to retrieve.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.get_ip_address_list MyIPAddressList | salt/modules/bluecoat_sslv.py | def get_ip_address_list(list_name):
'''
Retrieves a specific IP address list.
list_name(str): The name of the specific policy IP address list to retrieve.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.get_ip_address_list MyIPAddressList
'''
payload = {"jsonrpc": "2.0"... | def get_ip_address_list(list_name):
'''
Retrieves a specific IP address list.
list_name(str): The name of the specific policy IP address list to retrieve.
CLI Example:
.. code-block:: bash
salt '*' bluecoat_sslv.get_ip_address_list MyIPAddressList
'''
payload = {"jsonrpc": "2.0"... | [
"Retrieves",
"a",
"specific",
"IP",
"address",
"list",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bluecoat_sslv.py#L308-L328 | [
"def",
"get_ip_address_list",
"(",
"list_name",
")",
":",
"payload",
"=",
"{",
"\"jsonrpc\"",
":",
"\"2.0\"",
",",
"\"id\"",
":",
"\"ID0\"",
",",
"\"method\"",
":",
"\"get_policy_ip_addresses\"",
",",
"\"params\"",
":",
"[",
"list_name",
",",
"0",
",",
"256",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | runas | Run a command as another user. If the process is running as an admin or
system account this method does not require a password. Other non
privileged accounts need to provide a password for the user to runas.
Commands are run in with the highest level privileges possible for the
account provided. | salt/utils/win_runas.py | def runas(cmdLine, username, password=None, cwd=None):
'''
Run a command as another user. If the process is running as an admin or
system account this method does not require a password. Other non
privileged accounts need to provide a password for the user to runas.
Commands are run in with the high... | def runas(cmdLine, username, password=None, cwd=None):
'''
Run a command as another user. If the process is running as an admin or
system account this method does not require a password. Other non
privileged accounts need to provide a password for the user to runas.
Commands are run in with the high... | [
"Run",
"a",
"command",
"as",
"another",
"user",
".",
"If",
"the",
"process",
"is",
"running",
"as",
"an",
"admin",
"or",
"system",
"account",
"this",
"method",
"does",
"not",
"require",
"a",
"password",
".",
"Other",
"non",
"privileged",
"accounts",
"need"... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_runas.py#L62-L224 | [
"def",
"runas",
"(",
"cmdLine",
",",
"username",
",",
"password",
"=",
"None",
",",
"cwd",
"=",
"None",
")",
":",
"# Elevate the token from the current process",
"access",
"=",
"(",
"win32security",
".",
"TOKEN_QUERY",
"|",
"win32security",
".",
"TOKEN_ADJUST_PRIV... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | runas_unpriv | Runas that works for non-priviledged users | salt/utils/win_runas.py | def runas_unpriv(cmd, username, password, cwd=None):
'''
Runas that works for non-priviledged users
'''
# Create a pipe to set as stdout in the child. The write handle needs to be
# inheritable.
c2pread, c2pwrite = salt.platform.win.CreatePipe(
inherit_read=False, inherit_write=True,
... | def runas_unpriv(cmd, username, password, cwd=None):
'''
Runas that works for non-priviledged users
'''
# Create a pipe to set as stdout in the child. The write handle needs to be
# inheritable.
c2pread, c2pwrite = salt.platform.win.CreatePipe(
inherit_read=False, inherit_write=True,
... | [
"Runas",
"that",
"works",
"for",
"non",
"-",
"priviledged",
"users"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_runas.py#L227-L295 | [
"def",
"runas_unpriv",
"(",
"cmd",
",",
"username",
",",
"password",
",",
"cwd",
"=",
"None",
")",
":",
"# Create a pipe to set as stdout in the child. The write handle needs to be",
"# inheritable.",
"c2pread",
",",
"c2pwrite",
"=",
"salt",
".",
"platform",
".",
"win... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | match | Match based on the local data store on the minion | salt/matchers/data_match.py | def match(tgt, functions=None, opts=None):
'''
Match based on the local data store on the minion
'''
if not opts:
opts = __opts__
if functions is None:
utils = salt.loader.utils(opts)
functions = salt.loader.minion_mods(opts, utils=utils)
comps = tgt.split(':')
if len... | def match(tgt, functions=None, opts=None):
'''
Match based on the local data store on the minion
'''
if not opts:
opts = __opts__
if functions is None:
utils = salt.loader.utils(opts)
functions = salt.loader.minion_mods(opts, utils=utils)
comps = tgt.split(':')
if len... | [
"Match",
"based",
"on",
"the",
"local",
"data",
"store",
"on",
"the",
"minion"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/matchers/data_match.py#L19-L48 | [
"def",
"match",
"(",
"tgt",
",",
"functions",
"=",
"None",
",",
"opts",
"=",
"None",
")",
":",
"if",
"not",
"opts",
":",
"opts",
"=",
"__opts__",
"if",
"functions",
"is",
"None",
":",
"utils",
"=",
"salt",
".",
"loader",
".",
"utils",
"(",
"opts",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _find_image | Tries to find image with given name, returns
- image, 'Found image <name>'
- None, 'No such image found'
- False, 'Found more than one image with given name' | salt/states/glance.py | def _find_image(name):
'''
Tries to find image with given name, returns
- image, 'Found image <name>'
- None, 'No such image found'
- False, 'Found more than one image with given name'
'''
try:
images = __salt__['glance.image_list'](name=name)
except kstone_Unauthoriz... | def _find_image(name):
'''
Tries to find image with given name, returns
- image, 'Found image <name>'
- None, 'No such image found'
- False, 'Found more than one image with given name'
'''
try:
images = __salt__['glance.image_list'](name=name)
except kstone_Unauthoriz... | [
"Tries",
"to",
"find",
"image",
"with",
"given",
"name",
"returns",
"-",
"image",
"Found",
"image",
"<name",
">",
"-",
"None",
"No",
"such",
"image",
"found",
"-",
"False",
"Found",
"more",
"than",
"one",
"image",
"with",
"given",
"name"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/glance.py#L43-L70 | [
"def",
"_find_image",
"(",
"name",
")",
":",
"try",
":",
"images",
"=",
"__salt__",
"[",
"'glance.image_list'",
"]",
"(",
"name",
"=",
"name",
")",
"except",
"kstone_Unauthorized",
":",
"return",
"False",
",",
"'keystoneclient: Unauthorized'",
"except",
"glance_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | image_present | Checks if given image is present with properties
set as specified.
An image should got through the stages 'queued', 'saving'
before becoming 'active'. The attribute 'checksum' can
only be checked once the image is active.
If you don't specify 'wait_for' but 'checksum' the function
will wait for... | salt/states/glance.py | def image_present(name, visibility='public', protected=None,
checksum=None, location=None, disk_format='raw', wait_for=None,
timeout=30):
'''
Checks if given image is present with properties
set as specified.
An image should got through the stages 'queued', 'saving'
before becoming ... | def image_present(name, visibility='public', protected=None,
checksum=None, location=None, disk_format='raw', wait_for=None,
timeout=30):
'''
Checks if given image is present with properties
set as specified.
An image should got through the stages 'queued', 'saving'
before becoming ... | [
"Checks",
"if",
"given",
"image",
"is",
"present",
"with",
"properties",
"set",
"as",
"specified",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/glance.py#L73-L250 | [
"def",
"image_present",
"(",
"name",
",",
"visibility",
"=",
"'public'",
",",
"protected",
"=",
"None",
",",
"checksum",
"=",
"None",
",",
"location",
"=",
"None",
",",
"disk_format",
"=",
"'raw'",
",",
"wait_for",
"=",
"None",
",",
"timeout",
"=",
"30",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | returner | Return data to one of potentially many clustered cassandra nodes | salt/returners/cassandra_cql_return.py | def returner(ret):
'''
Return data to one of potentially many clustered cassandra nodes
'''
query = '''INSERT INTO {keyspace}.salt_returns (
jid, minion_id, fun, alter_time, full_ret, return, success
) VALUES (?, ?, ?, ?, ?, ?, ?)'''.format(keyspace=_get_keyspace())
... | def returner(ret):
'''
Return data to one of potentially many clustered cassandra nodes
'''
query = '''INSERT INTO {keyspace}.salt_returns (
jid, minion_id, fun, alter_time, full_ret, return, success
) VALUES (?, ?, ?, ?, ?, ?, ?)'''.format(keyspace=_get_keyspace())
... | [
"Return",
"data",
"to",
"one",
"of",
"potentially",
"many",
"clustered",
"cassandra",
"nodes"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/cassandra_cql_return.py#L192-L243 | [
"def",
"returner",
"(",
"ret",
")",
":",
"query",
"=",
"'''INSERT INTO {keyspace}.salt_returns (\n jid, minion_id, fun, alter_time, full_ret, return, success\n ) VALUES (?, ?, ?, ?, ?, ?, ?)'''",
".",
"format",
"(",
"keyspace",
"=",
"_get_keyspace",
"(",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | event_return | Return event to one of potentially many clustered cassandra nodes
Requires that configuration be enabled via 'event_return'
option in master config.
Cassandra does not support an auto-increment feature due to the
highly inefficient nature of creating a monotonically increasing
number across all no... | salt/returners/cassandra_cql_return.py | def event_return(events):
'''
Return event to one of potentially many clustered cassandra nodes
Requires that configuration be enabled via 'event_return'
option in master config.
Cassandra does not support an auto-increment feature due to the
highly inefficient nature of creating a monotonical... | def event_return(events):
'''
Return event to one of potentially many clustered cassandra nodes
Requires that configuration be enabled via 'event_return'
option in master config.
Cassandra does not support an auto-increment feature due to the
highly inefficient nature of creating a monotonical... | [
"Return",
"event",
"to",
"one",
"of",
"potentially",
"many",
"clustered",
"cassandra",
"nodes"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/cassandra_cql_return.py#L246-L283 | [
"def",
"event_return",
"(",
"events",
")",
":",
"for",
"event",
"in",
"events",
":",
"tag",
"=",
"event",
".",
"get",
"(",
"'tag'",
",",
"''",
")",
"data",
"=",
"event",
".",
"get",
"(",
"'data'",
",",
"''",
")",
"query",
"=",
"'''INSERT INTO {keyspa... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | save_load | Save the load to the specified jid id | salt/returners/cassandra_cql_return.py | def save_load(jid, load, minions=None):
'''
Save the load to the specified jid id
'''
# Load is being stored as a text datatype. Single quotes are used in the
# VALUES list. Therefore, all single quotes contained in the results from
# salt.utils.json.dumps(load) must be escaped Cassandra style.
... | def save_load(jid, load, minions=None):
'''
Save the load to the specified jid id
'''
# Load is being stored as a text datatype. Single quotes are used in the
# VALUES list. Therefore, all single quotes contained in the results from
# salt.utils.json.dumps(load) must be escaped Cassandra style.
... | [
"Save",
"the",
"load",
"to",
"the",
"specified",
"jid",
"id"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/cassandra_cql_return.py#L286-L312 | [
"def",
"save_load",
"(",
"jid",
",",
"load",
",",
"minions",
"=",
"None",
")",
":",
"# Load is being stored as a text datatype. Single quotes are used in the",
"# VALUES list. Therefore, all single quotes contained in the results from",
"# salt.utils.json.dumps(load) must be escaped Cass... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_jid | Return the information returned when the specified job id was executed | salt/returners/cassandra_cql_return.py | def get_jid(jid):
'''
Return the information returned when the specified job id was executed
'''
query = '''SELECT minion_id, full_ret FROM {keyspace}.salt_returns
WHERE jid = ?;'''.format(keyspace=_get_keyspace())
ret = {}
# cassandra_cql.cql_query may raise a CommandExecutionE... | def get_jid(jid):
'''
Return the information returned when the specified job id was executed
'''
query = '''SELECT minion_id, full_ret FROM {keyspace}.salt_returns
WHERE jid = ?;'''.format(keyspace=_get_keyspace())
ret = {}
# cassandra_cql.cql_query may raise a CommandExecutionE... | [
"Return",
"the",
"information",
"returned",
"when",
"the",
"specified",
"job",
"id",
"was",
"executed"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/cassandra_cql_return.py#L350-L376 | [
"def",
"get_jid",
"(",
"jid",
")",
":",
"query",
"=",
"'''SELECT minion_id, full_ret FROM {keyspace}.salt_returns\n WHERE jid = ?;'''",
".",
"format",
"(",
"keyspace",
"=",
"_get_keyspace",
"(",
")",
")",
"ret",
"=",
"{",
"}",
"# cassandra_cql.cql_query may ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_fun | Return a dict of the last function called for all minions | salt/returners/cassandra_cql_return.py | def get_fun(fun):
'''
Return a dict of the last function called for all minions
'''
query = '''SELECT minion_id, last_fun FROM {keyspace}.minions
WHERE last_fun = ?;'''.format(keyspace=_get_keyspace())
ret = {}
# cassandra_cql.cql_query may raise a CommandExecutionError
try:... | def get_fun(fun):
'''
Return a dict of the last function called for all minions
'''
query = '''SELECT minion_id, last_fun FROM {keyspace}.minions
WHERE last_fun = ?;'''.format(keyspace=_get_keyspace())
ret = {}
# cassandra_cql.cql_query may raise a CommandExecutionError
try:... | [
"Return",
"a",
"dict",
"of",
"the",
"last",
"function",
"called",
"for",
"all",
"minions"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/cassandra_cql_return.py#L380-L406 | [
"def",
"get_fun",
"(",
"fun",
")",
":",
"query",
"=",
"'''SELECT minion_id, last_fun FROM {keyspace}.minions\n WHERE last_fun = ?;'''",
".",
"format",
"(",
"keyspace",
"=",
"_get_keyspace",
"(",
")",
")",
"ret",
"=",
"{",
"}",
"# cassandra_cql.cql_query may ... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_jids | Return a list of all job ids | salt/returners/cassandra_cql_return.py | def get_jids():
'''
Return a list of all job ids
'''
query = '''SELECT jid, load FROM {keyspace}.jids;'''.format(keyspace=_get_keyspace())
ret = {}
# cassandra_cql.cql_query may raise a CommandExecutionError
try:
data = __salt__['cassandra_cql.cql_query'](query)
if data:
... | def get_jids():
'''
Return a list of all job ids
'''
query = '''SELECT jid, load FROM {keyspace}.jids;'''.format(keyspace=_get_keyspace())
ret = {}
# cassandra_cql.cql_query may raise a CommandExecutionError
try:
data = __salt__['cassandra_cql.cql_query'](query)
if data:
... | [
"Return",
"a",
"list",
"of",
"all",
"job",
"ids"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/cassandra_cql_return.py#L410-L437 | [
"def",
"get_jids",
"(",
")",
":",
"query",
"=",
"'''SELECT jid, load FROM {keyspace}.jids;'''",
".",
"format",
"(",
"keyspace",
"=",
"_get_keyspace",
"(",
")",
")",
"ret",
"=",
"{",
"}",
"# cassandra_cql.cql_query may raise a CommandExecutionError",
"try",
":",
"data"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.