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 | _smartos_zone_pkgin_data | SmartOS zone pkgsrc information | salt/grains/smartos.py | def _smartos_zone_pkgin_data():
'''
SmartOS zone pkgsrc information
'''
# Provides:
# pkgin_repositories
grains = {
'pkgin_repositories': [],
}
pkginrepo = re.compile('^(?:https|http|ftp|file)://.*$')
if os.path.isfile('/opt/local/etc/pkgin/repositories.conf'):
wi... | def _smartos_zone_pkgin_data():
'''
SmartOS zone pkgsrc information
'''
# Provides:
# pkgin_repositories
grains = {
'pkgin_repositories': [],
}
pkginrepo = re.compile('^(?:https|http|ftp|file)://.*$')
if os.path.isfile('/opt/local/etc/pkgin/repositories.conf'):
wi... | [
"SmartOS",
"zone",
"pkgsrc",
"information"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/smartos.py#L163-L182 | [
"def",
"_smartos_zone_pkgin_data",
"(",
")",
":",
"# Provides:",
"# pkgin_repositories",
"grains",
"=",
"{",
"'pkgin_repositories'",
":",
"[",
"]",
",",
"}",
"pkginrepo",
"=",
"re",
".",
"compile",
"(",
"'^(?:https|http|ftp|file)://.*$'",
")",
"if",
"os",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | smartos | Provide grains for SmartOS | salt/grains/smartos.py | def smartos():
'''
Provide grains for SmartOS
'''
grains = {}
if salt.utils.platform.is_smartos_zone():
grains = salt.utils.dictupdate.update(grains, _smartos_zone_data(), merge_lists=True)
grains = salt.utils.dictupdate.update(grains, _smartos_zone_pkgsrc_data(), merge_lists=True)
... | def smartos():
'''
Provide grains for SmartOS
'''
grains = {}
if salt.utils.platform.is_smartos_zone():
grains = salt.utils.dictupdate.update(grains, _smartos_zone_data(), merge_lists=True)
grains = salt.utils.dictupdate.update(grains, _smartos_zone_pkgsrc_data(), merge_lists=True)
... | [
"Provide",
"grains",
"for",
"SmartOS"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/smartos.py#L185-L198 | [
"def",
"smartos",
"(",
")",
":",
"grains",
"=",
"{",
"}",
"if",
"salt",
".",
"utils",
".",
"platform",
".",
"is_smartos_zone",
"(",
")",
":",
"grains",
"=",
"salt",
".",
"utils",
".",
"dictupdate",
".",
"update",
"(",
"grains",
",",
"_smartos_zone_data... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | start | Listen to salt events and forward them to Logentries | salt/engines/logentries.py | def start(endpoint='data.logentries.com',
port=10000,
token=None,
tag='salt/engines/logentries'):
'''
Listen to salt events and forward them to Logentries
'''
if __opts__.get('id').endswith('_master'):
event_bus = salt.utils.event.get_master_event(
__opt... | def start(endpoint='data.logentries.com',
port=10000,
token=None,
tag='salt/engines/logentries'):
'''
Listen to salt events and forward them to Logentries
'''
if __opts__.get('id').endswith('_master'):
event_bus = salt.utils.event.get_master_event(
__opt... | [
"Listen",
"to",
"salt",
"events",
"and",
"forward",
"them",
"to",
"Logentries"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/logentries.py#L174-L215 | [
"def",
"start",
"(",
"endpoint",
"=",
"'data.logentries.com'",
",",
"port",
"=",
"10000",
",",
"token",
"=",
"None",
",",
"tag",
"=",
"'salt/engines/logentries'",
")",
":",
"if",
"__opts__",
".",
"get",
"(",
"'id'",
")",
".",
"endswith",
"(",
"'_master'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | peered | Check if node is peered.
name
The remote host with which to peer.
.. code-block:: yaml
peer-cluster:
glusterfs.peered:
- name: two
peer-clusters:
glusterfs.peered:
- names:
- one
- two
- three
... | salt/states/glusterfs.py | def peered(name):
'''
Check if node is peered.
name
The remote host with which to peer.
.. code-block:: yaml
peer-cluster:
glusterfs.peered:
- name: two
peer-clusters:
glusterfs.peered:
- names:
- one
- t... | def peered(name):
'''
Check if node is peered.
name
The remote host with which to peer.
.. code-block:: yaml
peer-cluster:
glusterfs.peered:
- name: two
peer-clusters:
glusterfs.peered:
- names:
- one
- t... | [
"Check",
"if",
"node",
"is",
"peered",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/glusterfs.py#L40-L108 | [
"def",
"peered",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
",",
"'result'",
":",
"False",
"}",
"try",
":",
"suc",
".",
"check_name",
"(",
"name",
",",
"'a-zA-Z0-9._-... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | volume_present | Ensure that the volume exists
name
name of the volume
bricks
list of brick paths
replica
replica count for volume
arbiter
use every third brick as arbiter (metadata only)
.. versionadded:: 2019.2.0
start
ensure that the volume is also started
... | salt/states/glusterfs.py | def volume_present(name, bricks, stripe=False, replica=False, device_vg=False,
transport='tcp', start=False, force=False, arbiter=False):
'''
Ensure that the volume exists
name
name of the volume
bricks
list of brick paths
replica
replica count for volum... | def volume_present(name, bricks, stripe=False, replica=False, device_vg=False,
transport='tcp', start=False, force=False, arbiter=False):
'''
Ensure that the volume exists
name
name of the volume
bricks
list of brick paths
replica
replica count for volum... | [
"Ensure",
"that",
"the",
"volume",
"exists"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/glusterfs.py#L111-L222 | [
"def",
"volume_present",
"(",
"name",
",",
"bricks",
",",
"stripe",
"=",
"False",
",",
"replica",
"=",
"False",
",",
"device_vg",
"=",
"False",
",",
"transport",
"=",
"'tcp'",
",",
"start",
"=",
"False",
",",
"force",
"=",
"False",
",",
"arbiter",
"=",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | started | Check if volume has been started
name
name of the volume
.. code-block:: yaml
mycluster:
glusterfs.started: [] | salt/states/glusterfs.py | def started(name):
'''
Check if volume has been started
name
name of the volume
.. code-block:: yaml
mycluster:
glusterfs.started: []
'''
ret = {'name': name,
'changes': {},
'comment': '',
'result': False}
volinfo = __salt__['glu... | def started(name):
'''
Check if volume has been started
name
name of the volume
.. code-block:: yaml
mycluster:
glusterfs.started: []
'''
ret = {'name': name,
'changes': {},
'comment': '',
'result': False}
volinfo = __salt__['glu... | [
"Check",
"if",
"volume",
"has",
"been",
"started"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/glusterfs.py#L225-L266 | [
"def",
"started",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
",",
"'result'",
":",
"False",
"}",
"volinfo",
"=",
"__salt__",
"[",
"'glusterfs.info'",
"]",
"(",
")",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | add_volume_bricks | Add brick(s) to an existing volume
name
Volume name
bricks
List of bricks to add to the volume
.. code-block:: yaml
myvolume:
glusterfs.add_volume_bricks:
- bricks:
- host1:/srv/gluster/drive1
- host2:/srv/gluster/drive2
... | salt/states/glusterfs.py | def add_volume_bricks(name, bricks):
'''
Add brick(s) to an existing volume
name
Volume name
bricks
List of bricks to add to the volume
.. code-block:: yaml
myvolume:
glusterfs.add_volume_bricks:
- bricks:
- host1:/srv/gluster/drive1
... | def add_volume_bricks(name, bricks):
'''
Add brick(s) to an existing volume
name
Volume name
bricks
List of bricks to add to the volume
.. code-block:: yaml
myvolume:
glusterfs.add_volume_bricks:
- bricks:
- host1:/srv/gluster/drive1
... | [
"Add",
"brick",
"(",
"s",
")",
"to",
"an",
"existing",
"volume"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/glusterfs.py#L269-L323 | [
"def",
"add_volume_bricks",
"(",
"name",
",",
"bricks",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
",",
"'result'",
":",
"False",
"}",
"volinfo",
"=",
"__salt__",
"[",
"'glusterfs.inf... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | op_version | .. versionadded:: 2019.2.0
Add brick(s) to an existing volume
name
Volume name
version
Version to which the cluster.op-version should be set
.. code-block:: yaml
myvolume:
glusterfs.op_version:
- name: volume1
- version: 30707 | salt/states/glusterfs.py | def op_version(name, version):
'''
.. versionadded:: 2019.2.0
Add brick(s) to an existing volume
name
Volume name
version
Version to which the cluster.op-version should be set
.. code-block:: yaml
myvolume:
glusterfs.op_version:
- name: volume1
... | def op_version(name, version):
'''
.. versionadded:: 2019.2.0
Add brick(s) to an existing volume
name
Volume name
version
Version to which the cluster.op-version should be set
.. code-block:: yaml
myvolume:
glusterfs.op_version:
- name: volume1
... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/glusterfs.py#L326-L375 | [
"def",
"op_version",
"(",
"name",
",",
"version",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
",",
"'result'",
":",
"False",
"}",
"try",
":",
"current",
"=",
"int",
"(",
"__salt__"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | max_op_version | .. versionadded:: 2019.2.0
Add brick(s) to an existing volume
name
Volume name
.. code-block:: yaml
myvolume:
glusterfs.max_op_version:
- name: volume1
- version: 30707 | salt/states/glusterfs.py | def max_op_version(name):
'''
.. versionadded:: 2019.2.0
Add brick(s) to an existing volume
name
Volume name
.. code-block:: yaml
myvolume:
glusterfs.max_op_version:
- name: volume1
- version: 30707
'''
ret = {'name': name,
'ch... | def max_op_version(name):
'''
.. versionadded:: 2019.2.0
Add brick(s) to an existing volume
name
Volume name
.. code-block:: yaml
myvolume:
glusterfs.max_op_version:
- name: volume1
- version: 30707
'''
ret = {'name': name,
'ch... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/glusterfs.py#L378-L431 | [
"def",
"max_op_version",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"''",
",",
"'result'",
":",
"False",
"}",
"try",
":",
"current",
"=",
"int",
"(",
"__salt__",
"[",
"'glu... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _prepare_xml | Get the requests options from salt. | salt/returners/nagios_nrdp_return.py | def _prepare_xml(options=None, state=None):
'''
Get the requests options from salt.
'''
if state:
_state = '0'
else:
_state = '2'
xml = "<?xml version='1.0'?>\n<checkresults>\n"
# No service defined then we set the status of the hostname
if 'service' in options and opt... | def _prepare_xml(options=None, state=None):
'''
Get the requests options from salt.
'''
if state:
_state = '0'
else:
_state = '2'
xml = "<?xml version='1.0'?>\n<checkresults>\n"
# No service defined then we set the status of the hostname
if 'service' in options and opt... | [
"Get",
"the",
"requests",
"options",
"from",
"salt",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/nagios_nrdp_return.py#L108-L138 | [
"def",
"_prepare_xml",
"(",
"options",
"=",
"None",
",",
"state",
"=",
"None",
")",
":",
"if",
"state",
":",
"_state",
"=",
"'0'",
"else",
":",
"_state",
"=",
"'2'",
"xml",
"=",
"\"<?xml version='1.0'?>\\n<checkresults>\\n\"",
"# No service defined then we set the... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _getText | Simple function to return value from XML | salt/returners/nagios_nrdp_return.py | def _getText(nodelist):
'''
Simple function to return value from XML
'''
rc = []
for node in nodelist:
if node.nodeType == node.TEXT_NODE:
rc.append(node.data)
return ''.join(rc) | def _getText(nodelist):
'''
Simple function to return value from XML
'''
rc = []
for node in nodelist:
if node.nodeType == node.TEXT_NODE:
rc.append(node.data)
return ''.join(rc) | [
"Simple",
"function",
"to",
"return",
"value",
"from",
"XML"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/nagios_nrdp_return.py#L141-L149 | [
"def",
"_getText",
"(",
"nodelist",
")",
":",
"rc",
"=",
"[",
"]",
"for",
"node",
"in",
"nodelist",
":",
"if",
"node",
".",
"nodeType",
"==",
"node",
".",
"TEXT_NODE",
":",
"rc",
".",
"append",
"(",
"node",
".",
"data",
")",
"return",
"''",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _post_data | Post data to Nagios NRDP | salt/returners/nagios_nrdp_return.py | def _post_data(options=None, xml=None):
'''
Post data to Nagios NRDP
'''
params = {'token': options['token'].strip(), 'cmd': 'submitcheck', 'XMLDATA': xml}
res = salt.utils.http.query(
url=options['url'],
method='POST',
params=params,
data='',
decode=True,
... | def _post_data(options=None, xml=None):
'''
Post data to Nagios NRDP
'''
params = {'token': options['token'].strip(), 'cmd': 'submitcheck', 'XMLDATA': xml}
res = salt.utils.http.query(
url=options['url'],
method='POST',
params=params,
data='',
decode=True,
... | [
"Post",
"data",
"to",
"Nagios",
"NRDP"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/nagios_nrdp_return.py#L152-L184 | [
"def",
"_post_data",
"(",
"options",
"=",
"None",
",",
"xml",
"=",
"None",
")",
":",
"params",
"=",
"{",
"'token'",
":",
"options",
"[",
"'token'",
"]",
".",
"strip",
"(",
")",
",",
"'cmd'",
":",
"'submitcheck'",
",",
"'XMLDATA'",
":",
"xml",
"}",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | returner | Send a message to Nagios with the data | salt/returners/nagios_nrdp_return.py | def returner(ret):
'''
Send a message to Nagios with the data
'''
_options = _get_options(ret)
log.debug('_options %s', _options)
_options['hostname'] = ret.get('id')
if 'url' not in _options or _options['url'] == '':
log.error('nagios_nrdp.url not defined in salt config')
... | def returner(ret):
'''
Send a message to Nagios with the data
'''
_options = _get_options(ret)
log.debug('_options %s', _options)
_options['hostname'] = ret.get('id')
if 'url' not in _options or _options['url'] == '':
log.error('nagios_nrdp.url not defined in salt config')
... | [
"Send",
"a",
"message",
"to",
"Nagios",
"with",
"the",
"data"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/nagios_nrdp_return.py#L187-L207 | [
"def",
"returner",
"(",
"ret",
")",
":",
"_options",
"=",
"_get_options",
"(",
"ret",
")",
"log",
".",
"debug",
"(",
"'_options %s'",
",",
"_options",
")",
"_options",
"[",
"'hostname'",
"]",
"=",
"ret",
".",
"get",
"(",
"'id'",
")",
"if",
"'url'",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_serv | Return an influxdb client object | salt/returners/influxdb_return.py | def _get_serv(ret=None):
'''
Return an influxdb client object
'''
_options = _get_options(ret)
host = _options.get('host')
port = _options.get('port')
database = _options.get('db')
user = _options.get('user')
password = _options.get('password')
version = _get_version(host, port, ... | def _get_serv(ret=None):
'''
Return an influxdb client object
'''
_options = _get_options(ret)
host = _options.get('host')
port = _options.get('port')
database = _options.get('db')
user = _options.get('user')
password = _options.get('password')
version = _get_version(host, port, ... | [
"Return",
"an",
"influxdb",
"client",
"object"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/influxdb_return.py#L122-L147 | [
"def",
"_get_serv",
"(",
"ret",
"=",
"None",
")",
":",
"_options",
"=",
"_get_options",
"(",
"ret",
")",
"host",
"=",
"_options",
".",
"get",
"(",
"'host'",
")",
"port",
"=",
"_options",
".",
"get",
"(",
"'port'",
")",
"database",
"=",
"_options",
".... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | returner | Return data to a influxdb data store | salt/returners/influxdb_return.py | def returner(ret):
'''
Return data to a influxdb data store
'''
serv = _get_serv(ret)
# strip the 'return' key to avoid data duplication in the database
json_return = salt.utils.json.dumps(ret['return'])
del ret['return']
json_full_ret = salt.utils.json.dumps(ret)
# create legacy r... | def returner(ret):
'''
Return data to a influxdb data store
'''
serv = _get_serv(ret)
# strip the 'return' key to avoid data duplication in the database
json_return = salt.utils.json.dumps(ret['return'])
del ret['return']
json_full_ret = salt.utils.json.dumps(ret)
# create legacy r... | [
"Return",
"data",
"to",
"a",
"influxdb",
"data",
"store"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/influxdb_return.py#L150-L192 | [
"def",
"returner",
"(",
"ret",
")",
":",
"serv",
"=",
"_get_serv",
"(",
"ret",
")",
"# strip the 'return' key to avoid data duplication in the database",
"json_return",
"=",
"salt",
".",
"utils",
".",
"json",
".",
"dumps",
"(",
"ret",
"[",
"'return'",
"]",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | save_load | Save the load to the specified jid | salt/returners/influxdb_return.py | def save_load(jid, load, minions=None):
'''
Save the load to the specified jid
'''
serv = _get_serv(ret=None)
# create legacy request in case an InfluxDB 0.8.x version is used
if "influxdb08" in serv.__module__:
req = [
{
'name': 'jids',
'colu... | def save_load(jid, load, minions=None):
'''
Save the load to the specified jid
'''
serv = _get_serv(ret=None)
# create legacy request in case an InfluxDB 0.8.x version is used
if "influxdb08" in serv.__module__:
req = [
{
'name': 'jids',
'colu... | [
"Save",
"the",
"load",
"to",
"the",
"specified",
"jid"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/influxdb_return.py#L195-L229 | [
"def",
"save_load",
"(",
"jid",
",",
"load",
",",
"minions",
"=",
"None",
")",
":",
"serv",
"=",
"_get_serv",
"(",
"ret",
"=",
"None",
")",
"# create legacy request in case an InfluxDB 0.8.x version is used",
"if",
"\"influxdb08\"",
"in",
"serv",
".",
"__module__"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_load | Return the load data that marks a specified jid | salt/returners/influxdb_return.py | def get_load(jid):
'''
Return the load data that marks a specified jid
'''
serv = _get_serv(ret=None)
sql = "select load from jids where jid = '{0}'".format(jid)
log.debug(">> Now in get_load %s", jid)
data = serv.query(sql)
log.debug(">> Now Data: %s", data)
if data:
return... | def get_load(jid):
'''
Return the load data that marks a specified jid
'''
serv = _get_serv(ret=None)
sql = "select load from jids where jid = '{0}'".format(jid)
log.debug(">> Now in get_load %s", jid)
data = serv.query(sql)
log.debug(">> Now Data: %s", data)
if data:
return... | [
"Return",
"the",
"load",
"data",
"that",
"marks",
"a",
"specified",
"jid"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/influxdb_return.py#L239-L251 | [
"def",
"get_load",
"(",
"jid",
")",
":",
"serv",
"=",
"_get_serv",
"(",
"ret",
"=",
"None",
")",
"sql",
"=",
"\"select load from jids where jid = '{0}'\"",
".",
"format",
"(",
"jid",
")",
"log",
".",
"debug",
"(",
"\">> Now in get_load %s\"",
",",
"jid",
")"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_jid | Return the information returned when the specified job id was executed | salt/returners/influxdb_return.py | def get_jid(jid):
'''
Return the information returned when the specified job id was executed
'''
serv = _get_serv(ret=None)
sql = "select id, full_ret from returns where jid = '{0}'".format(jid)
data = serv.query(sql)
ret = {}
if data:
points = data[0]['points']
for poi... | def get_jid(jid):
'''
Return the information returned when the specified job id was executed
'''
serv = _get_serv(ret=None)
sql = "select id, full_ret from returns where jid = '{0}'".format(jid)
data = serv.query(sql)
ret = {}
if data:
points = data[0]['points']
for poi... | [
"Return",
"the",
"information",
"returned",
"when",
"the",
"specified",
"job",
"id",
"was",
"executed"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/influxdb_return.py#L254-L269 | [
"def",
"get_jid",
"(",
"jid",
")",
":",
"serv",
"=",
"_get_serv",
"(",
"ret",
"=",
"None",
")",
"sql",
"=",
"\"select id, full_ret from returns where jid = '{0}'\"",
".",
"format",
"(",
"jid",
")",
"data",
"=",
"serv",
".",
"query",
"(",
"sql",
")",
"ret",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_fun | Return a dict of the last function called for all minions | salt/returners/influxdb_return.py | def get_fun(fun):
'''
Return a dict of the last function called for all minions
'''
serv = _get_serv(ret=None)
sql = '''select first(id) as fid, first(full_ret) as fret
from returns
where fun = '{0}'
group by fun, id
'''.format(fun)
data = serv.que... | def get_fun(fun):
'''
Return a dict of the last function called for all minions
'''
serv = _get_serv(ret=None)
sql = '''select first(id) as fid, first(full_ret) as fret
from returns
where fun = '{0}'
group by fun, id
'''.format(fun)
data = serv.que... | [
"Return",
"a",
"dict",
"of",
"the",
"last",
"function",
"called",
"for",
"all",
"minions"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/influxdb_return.py#L272-L291 | [
"def",
"get_fun",
"(",
"fun",
")",
":",
"serv",
"=",
"_get_serv",
"(",
"ret",
"=",
"None",
")",
"sql",
"=",
"'''select first(id) as fid, first(full_ret) as fret\n from returns\n where fun = '{0}'\n group by fun, id\n '''",
".",
"format",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_jids | Return a list of all job ids | salt/returners/influxdb_return.py | def get_jids():
'''
Return a list of all job ids
'''
serv = _get_serv(ret=None)
sql = "select distinct(jid) from jids group by load"
# [{u'points': [[0, jid, load],
# [0, jid, load]],
# u'name': u'jids',
# u'columns': [u'time', u'distinct', u'load']}]
data = se... | def get_jids():
'''
Return a list of all job ids
'''
serv = _get_serv(ret=None)
sql = "select distinct(jid) from jids group by load"
# [{u'points': [[0, jid, load],
# [0, jid, load]],
# u'name': u'jids',
# u'columns': [u'time', u'distinct', u'load']}]
data = se... | [
"Return",
"a",
"list",
"of",
"all",
"job",
"ids"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/influxdb_return.py#L294-L310 | [
"def",
"get_jids",
"(",
")",
":",
"serv",
"=",
"_get_serv",
"(",
"ret",
"=",
"None",
")",
"sql",
"=",
"\"select distinct(jid) from jids group by load\"",
"# [{u'points': [[0, jid, load],",
"# [0, jid, load]],",
"# u'name': u'jids',",
"# u'columns': [u'time', u... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_minions | Return a list of minions | salt/returners/influxdb_return.py | def get_minions():
'''
Return a list of minions
'''
serv = _get_serv(ret=None)
sql = "select distinct(id) from returns"
data = serv.query(sql)
ret = []
if data:
for jid in data[0]['points']:
ret.append(jid[1])
return ret | def get_minions():
'''
Return a list of minions
'''
serv = _get_serv(ret=None)
sql = "select distinct(id) from returns"
data = serv.query(sql)
ret = []
if data:
for jid in data[0]['points']:
ret.append(jid[1])
return ret | [
"Return",
"a",
"list",
"of",
"minions"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/influxdb_return.py#L313-L326 | [
"def",
"get_minions",
"(",
")",
":",
"serv",
"=",
"_get_serv",
"(",
"ret",
"=",
"None",
")",
"sql",
"=",
"\"select distinct(id) from returns\"",
"data",
"=",
"serv",
".",
"query",
"(",
"sql",
")",
"ret",
"=",
"[",
"]",
"if",
"data",
":",
"for",
"jid",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_running_jobs | Return the running jobs on the master | salt/utils/master.py | def get_running_jobs(opts):
'''
Return the running jobs on the master
'''
ret = []
proc_dir = os.path.join(opts['cachedir'], 'proc')
if not os.path.isdir(proc_dir):
return ret
for fn_ in os.listdir(proc_dir):
path = os.path.join(proc_dir, fn_)
data = read_proc_file(p... | def get_running_jobs(opts):
'''
Return the running jobs on the master
'''
ret = []
proc_dir = os.path.join(opts['cachedir'], 'proc')
if not os.path.isdir(proc_dir):
return ret
for fn_ in os.listdir(proc_dir):
path = os.path.join(proc_dir, fn_)
data = read_proc_file(p... | [
"Return",
"the",
"running",
"jobs",
"on",
"the",
"master"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L48-L65 | [
"def",
"get_running_jobs",
"(",
"opts",
")",
":",
"ret",
"=",
"[",
"]",
"proc_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"opts",
"[",
"'cachedir'",
"]",
",",
"'proc'",
")",
"if",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"proc_dir",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | read_proc_file | Return a dict of JID metadata, or None | salt/utils/master.py | def read_proc_file(path, opts):
'''
Return a dict of JID metadata, or None
'''
serial = salt.payload.Serial(opts)
with salt.utils.files.fopen(path, 'rb') as fp_:
try:
data = serial.load(fp_)
except Exception as err:
# need to add serial exception here
... | def read_proc_file(path, opts):
'''
Return a dict of JID metadata, or None
'''
serial = salt.payload.Serial(opts)
with salt.utils.files.fopen(path, 'rb') as fp_:
try:
data = serial.load(fp_)
except Exception as err:
# need to add serial exception here
... | [
"Return",
"a",
"dict",
"of",
"JID",
"metadata",
"or",
"None"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L68-L93 | [
"def",
"read_proc_file",
"(",
"path",
",",
"opts",
")",
":",
"serial",
"=",
"salt",
".",
"payload",
".",
"Serial",
"(",
"opts",
")",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"path",
",",
"'rb'",
")",
"as",
"fp_",
":",
"try",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | is_pid_healthy | This is a health check that will confirm the PID is running
and executed by salt.
If pusutil is available:
* all architectures are checked
if psutil is not available:
* Linux/Solaris/etc: archs with `/proc/cmdline` available are checked
* AIX/Windows: assume PID is healhty and retu... | salt/utils/master.py | def is_pid_healthy(pid):
'''
This is a health check that will confirm the PID is running
and executed by salt.
If pusutil is available:
* all architectures are checked
if psutil is not available:
* Linux/Solaris/etc: archs with `/proc/cmdline` available are checked
* AIX/Wi... | def is_pid_healthy(pid):
'''
This is a health check that will confirm the PID is running
and executed by salt.
If pusutil is available:
* all architectures are checked
if psutil is not available:
* Linux/Solaris/etc: archs with `/proc/cmdline` available are checked
* AIX/Wi... | [
"This",
"is",
"a",
"health",
"check",
"that",
"will",
"confirm",
"the",
"PID",
"is",
"running",
"and",
"executed",
"by",
"salt",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L96-L129 | [
"def",
"is_pid_healthy",
"(",
"pid",
")",
":",
"if",
"HAS_PSUTIL",
":",
"try",
":",
"proc",
"=",
"psutil",
".",
"Process",
"(",
"pid",
")",
"except",
"psutil",
".",
"NoSuchProcess",
":",
"log",
".",
"warning",
"(",
"\"PID %s is no longer running.\"",
",",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_values_of_matching_keys | Check a whitelist and/or blacklist to see if the value matches it. | salt/utils/master.py | def get_values_of_matching_keys(pattern_dict, user_name):
'''
Check a whitelist and/or blacklist to see if the value matches it.
'''
ret = []
for expr in pattern_dict:
if salt.utils.stringutils.expr_match(user_name, expr):
ret.extend(pattern_dict[expr])
return ret | def get_values_of_matching_keys(pattern_dict, user_name):
'''
Check a whitelist and/or blacklist to see if the value matches it.
'''
ret = []
for expr in pattern_dict:
if salt.utils.stringutils.expr_match(user_name, expr):
ret.extend(pattern_dict[expr])
return ret | [
"Check",
"a",
"whitelist",
"and",
"/",
"or",
"blacklist",
"to",
"see",
"if",
"the",
"value",
"matches",
"it",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L806-L814 | [
"def",
"get_values_of_matching_keys",
"(",
"pattern_dict",
",",
"user_name",
")",
":",
"ret",
"=",
"[",
"]",
"for",
"expr",
"in",
"pattern_dict",
":",
"if",
"salt",
".",
"utils",
".",
"stringutils",
".",
"expr_match",
"(",
"user_name",
",",
"expr",
")",
":... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | MasterPillarUtil.get_minion_pillar | Get pillar data for the targeted minions, either by fetching the
cached minion data on the master, or by compiling the minion's
pillar data on the master.
For runner modules that need access minion pillar data, this
function should be used instead of getting the pillar data by
e... | salt/utils/master.py | def get_minion_pillar(self):
'''
Get pillar data for the targeted minions, either by fetching the
cached minion data on the master, or by compiling the minion's
pillar data on the master.
For runner modules that need access minion pillar data, this
function should be use... | def get_minion_pillar(self):
'''
Get pillar data for the targeted minions, either by fetching the
cached minion data on the master, or by compiling the minion's
pillar data on the master.
For runner modules that need access minion pillar data, this
function should be use... | [
"Get",
"pillar",
"data",
"for",
"the",
"targeted",
"minions",
"either",
"by",
"fetching",
"the",
"cached",
"minion",
"data",
"on",
"the",
"master",
"or",
"by",
"compiling",
"the",
"minion",
"s",
"pillar",
"data",
"on",
"the",
"master",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L332-L369 | [
"def",
"get_minion_pillar",
"(",
"self",
")",
":",
"minion_pillars",
"=",
"{",
"}",
"minion_grains",
"=",
"{",
"}",
"minion_ids",
"=",
"self",
".",
"_tgt_to_list",
"(",
")",
"if",
"any",
"(",
"arg",
"for",
"arg",
"in",
"[",
"self",
".",
"use_cached_grain... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | MasterPillarUtil.get_minion_grains | Get grains data for the targeted minions, either by fetching the
cached minion data on the master, or by fetching the grains
directly on the minion.
By default, this function tries hard to get the grains data:
- Try to get the cached minion grains if the master
has m... | salt/utils/master.py | def get_minion_grains(self):
'''
Get grains data for the targeted minions, either by fetching the
cached minion data on the master, or by fetching the grains
directly on the minion.
By default, this function tries hard to get the grains data:
- Try to get the cached ... | def get_minion_grains(self):
'''
Get grains data for the targeted minions, either by fetching the
cached minion data on the master, or by fetching the grains
directly on the minion.
By default, this function tries hard to get the grains data:
- Try to get the cached ... | [
"Get",
"grains",
"data",
"for",
"the",
"targeted",
"minions",
"either",
"by",
"fetching",
"the",
"cached",
"minion",
"data",
"on",
"the",
"master",
"or",
"by",
"fetching",
"the",
"grains",
"directly",
"on",
"the",
"minion",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L371-L397 | [
"def",
"get_minion_grains",
"(",
"self",
")",
":",
"minion_grains",
"=",
"{",
"}",
"minion_ids",
"=",
"self",
".",
"_tgt_to_list",
"(",
")",
"if",
"not",
"minion_ids",
":",
"return",
"{",
"}",
"if",
"any",
"(",
"arg",
"for",
"arg",
"in",
"[",
"self",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | MasterPillarUtil.get_cached_mine_data | Get cached mine data for the targeted minions. | salt/utils/master.py | def get_cached_mine_data(self):
'''
Get cached mine data for the targeted minions.
'''
mine_data = {}
minion_ids = self._tgt_to_list()
log.debug('Getting cached mine data for: %s', minion_ids)
mine_data = self._get_cached_mine_data(*minion_ids)
return mine... | def get_cached_mine_data(self):
'''
Get cached mine data for the targeted minions.
'''
mine_data = {}
minion_ids = self._tgt_to_list()
log.debug('Getting cached mine data for: %s', minion_ids)
mine_data = self._get_cached_mine_data(*minion_ids)
return mine... | [
"Get",
"cached",
"mine",
"data",
"for",
"the",
"targeted",
"minions",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L399-L407 | [
"def",
"get_cached_mine_data",
"(",
"self",
")",
":",
"mine_data",
"=",
"{",
"}",
"minion_ids",
"=",
"self",
".",
"_tgt_to_list",
"(",
")",
"log",
".",
"debug",
"(",
"'Getting cached mine data for: %s'",
",",
"minion_ids",
")",
"mine_data",
"=",
"self",
".",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | MasterPillarUtil.clear_cached_minion_data | Clear the cached data/files for the targeted minions. | salt/utils/master.py | def clear_cached_minion_data(self,
clear_pillar=False,
clear_grains=False,
clear_mine=False,
clear_mine_func=None):
'''
Clear the cached data/files for the targeted minions... | def clear_cached_minion_data(self,
clear_pillar=False,
clear_grains=False,
clear_mine=False,
clear_mine_func=None):
'''
Clear the cached data/files for the targeted minions... | [
"Clear",
"the",
"cached",
"data",
"/",
"files",
"for",
"the",
"targeted",
"minions",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L409-L476 | [
"def",
"clear_cached_minion_data",
"(",
"self",
",",
"clear_pillar",
"=",
"False",
",",
"clear_grains",
"=",
"False",
",",
"clear_mine",
"=",
"False",
",",
"clear_mine_func",
"=",
"None",
")",
":",
"clear_what",
"=",
"[",
"]",
"if",
"clear_pillar",
":",
"cle... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | CacheTimer.run | main loop that fires the event every second | salt/utils/master.py | def run(self):
'''
main loop that fires the event every second
'''
context = zmq.Context()
# the socket for outgoing timer events
socket = context.socket(zmq.PUB)
socket.setsockopt(zmq.LINGER, 100)
socket.bind('ipc://' + self.timer_sock)
count = 0... | def run(self):
'''
main loop that fires the event every second
'''
context = zmq.Context()
# the socket for outgoing timer events
socket = context.socket(zmq.PUB)
socket.setsockopt(zmq.LINGER, 100)
socket.bind('ipc://' + self.timer_sock)
count = 0... | [
"main",
"loop",
"that",
"fires",
"the",
"event",
"every",
"second"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L492-L509 | [
"def",
"run",
"(",
"self",
")",
":",
"context",
"=",
"zmq",
".",
"Context",
"(",
")",
"# the socket for outgoing timer events",
"socket",
"=",
"context",
".",
"socket",
"(",
"zmq",
".",
"PUB",
")",
"socket",
".",
"setsockopt",
"(",
"zmq",
".",
"LINGER",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | CacheWorker.run | Gather currently connected minions and update the cache | salt/utils/master.py | def run(self):
'''
Gather currently connected minions and update the cache
'''
new_mins = list(salt.utils.minions.CkMinions(self.opts).connected_ids())
cc = cache_cli(self.opts)
cc.get_cached()
cc.put_cache([new_mins])
log.debug('ConCache CacheWorker updat... | def run(self):
'''
Gather currently connected minions and update the cache
'''
new_mins = list(salt.utils.minions.CkMinions(self.opts).connected_ids())
cc = cache_cli(self.opts)
cc.get_cached()
cc.put_cache([new_mins])
log.debug('ConCache CacheWorker updat... | [
"Gather",
"currently",
"connected",
"minions",
"and",
"update",
"the",
"cache"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L544-L552 | [
"def",
"run",
"(",
"self",
")",
":",
"new_mins",
"=",
"list",
"(",
"salt",
".",
"utils",
".",
"minions",
".",
"CkMinions",
"(",
"self",
".",
"opts",
")",
".",
"connected_ids",
"(",
")",
")",
"cc",
"=",
"cache_cli",
"(",
"self",
".",
"opts",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ConnectedCache.cleanup | remove sockets on shutdown | salt/utils/master.py | def cleanup(self):
'''
remove sockets on shutdown
'''
log.debug('ConCache cleaning up')
if os.path.exists(self.cache_sock):
os.remove(self.cache_sock)
if os.path.exists(self.update_sock):
os.remove(self.update_sock)
if os.path.exists(self.u... | def cleanup(self):
'''
remove sockets on shutdown
'''
log.debug('ConCache cleaning up')
if os.path.exists(self.cache_sock):
os.remove(self.cache_sock)
if os.path.exists(self.update_sock):
os.remove(self.update_sock)
if os.path.exists(self.u... | [
"remove",
"sockets",
"on",
"shutdown"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L613-L623 | [
"def",
"cleanup",
"(",
"self",
")",
":",
"log",
".",
"debug",
"(",
"'ConCache cleaning up'",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"self",
".",
"cache_sock",
")",
":",
"os",
".",
"remove",
"(",
"self",
".",
"cache_sock",
")",
"if",
"os",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ConnectedCache.secure | secure the sockets for root-only access | salt/utils/master.py | def secure(self):
'''
secure the sockets for root-only access
'''
log.debug('ConCache securing sockets')
if os.path.exists(self.cache_sock):
os.chmod(self.cache_sock, 0o600)
if os.path.exists(self.update_sock):
os.chmod(self.update_sock, 0o600)
... | def secure(self):
'''
secure the sockets for root-only access
'''
log.debug('ConCache securing sockets')
if os.path.exists(self.cache_sock):
os.chmod(self.cache_sock, 0o600)
if os.path.exists(self.update_sock):
os.chmod(self.update_sock, 0o600)
... | [
"secure",
"the",
"sockets",
"for",
"root",
"-",
"only",
"access"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L625-L635 | [
"def",
"secure",
"(",
"self",
")",
":",
"log",
".",
"debug",
"(",
"'ConCache securing sockets'",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"self",
".",
"cache_sock",
")",
":",
"os",
".",
"chmod",
"(",
"self",
".",
"cache_sock",
",",
"0o600",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ConnectedCache.stop | shutdown cache process | salt/utils/master.py | def stop(self):
'''
shutdown cache process
'''
# avoid getting called twice
self.cleanup()
if self.running:
self.running = False
self.timer_stop.set()
self.timer.join() | def stop(self):
'''
shutdown cache process
'''
# avoid getting called twice
self.cleanup()
if self.running:
self.running = False
self.timer_stop.set()
self.timer.join() | [
"shutdown",
"cache",
"process"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L637-L646 | [
"def",
"stop",
"(",
"self",
")",
":",
"# avoid getting called twice",
"self",
".",
"cleanup",
"(",
")",
"if",
"self",
".",
"running",
":",
"self",
".",
"running",
"=",
"False",
"self",
".",
"timer_stop",
".",
"set",
"(",
")",
"self",
".",
"timer",
".",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | ConnectedCache.run | Main loop of the ConCache, starts updates in intervals and
answers requests from the MWorkers | salt/utils/master.py | def run(self):
'''
Main loop of the ConCache, starts updates in intervals and
answers requests from the MWorkers
'''
context = zmq.Context()
# the socket for incoming cache requests
creq_in = context.socket(zmq.REP)
creq_in.setsockopt(zmq.LINGER, 100)
... | def run(self):
'''
Main loop of the ConCache, starts updates in intervals and
answers requests from the MWorkers
'''
context = zmq.Context()
# the socket for incoming cache requests
creq_in = context.socket(zmq.REP)
creq_in.setsockopt(zmq.LINGER, 100)
... | [
"Main",
"loop",
"of",
"the",
"ConCache",
"starts",
"updates",
"in",
"intervals",
"and",
"answers",
"requests",
"from",
"the",
"MWorkers"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/master.py#L648-L767 | [
"def",
"run",
"(",
"self",
")",
":",
"context",
"=",
"zmq",
".",
"Context",
"(",
")",
"# the socket for incoming cache requests",
"creq_in",
"=",
"context",
".",
"socket",
"(",
"zmq",
".",
"REP",
")",
"creq_in",
".",
"setsockopt",
"(",
"zmq",
".",
"LINGER"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | returner | Return a response in an SMS message | salt/returners/sms_return.py | def returner(ret):
'''
Return a response in an SMS message
'''
_options = _get_options(ret)
sid = _options.get('sid', None)
token = _options.get('token', None)
sender = _options.get('from', None)
receiver = _options.get('to', None)
if sid is None or token is None:
log.error... | def returner(ret):
'''
Return a response in an SMS message
'''
_options = _get_options(ret)
sid = _options.get('sid', None)
token = _options.get('token', None)
sender = _options.get('from', None)
receiver = _options.get('to', None)
if sid is None or token is None:
log.error... | [
"Return",
"a",
"response",
"in",
"an",
"SMS",
"message"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/sms_return.py#L72-L105 | [
"def",
"returner",
"(",
"ret",
")",
":",
"_options",
"=",
"_get_options",
"(",
"ret",
")",
"sid",
"=",
"_options",
".",
"get",
"(",
"'sid'",
",",
"None",
")",
"token",
"=",
"_options",
".",
"get",
"(",
"'token'",
",",
"None",
")",
"sender",
"=",
"_... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _common | Returns: None if group wasn't found, otherwise a group object | salt/states/keystone_group.py | def _common(kwargs):
'''
Returns: None if group wasn't found, otherwise a group object
'''
search_kwargs = {'name': kwargs['name']}
if 'domain' in kwargs:
domain = __salt__['keystoneng.get_entity'](
'domain', name=kwargs.pop('domain'))
domain_id = domain.id ... | def _common(kwargs):
'''
Returns: None if group wasn't found, otherwise a group object
'''
search_kwargs = {'name': kwargs['name']}
if 'domain' in kwargs:
domain = __salt__['keystoneng.get_entity'](
'domain', name=kwargs.pop('domain'))
domain_id = domain.id ... | [
"Returns",
":",
"None",
"if",
"group",
"wasn",
"t",
"found",
"otherwise",
"a",
"group",
"object"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone_group.py#L41-L53 | [
"def",
"_common",
"(",
"kwargs",
")",
":",
"search_kwargs",
"=",
"{",
"'name'",
":",
"kwargs",
"[",
"'name'",
"]",
"}",
"if",
"'domain'",
"in",
"kwargs",
":",
"domain",
"=",
"__salt__",
"[",
"'keystoneng.get_entity'",
"]",
"(",
"'domain'",
",",
"name",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | absent | Ensure group does not exist
name
Name of the group
domain
The name or id of the domain | salt/states/keystone_group.py | def absent(name, auth=None, **kwargs):
'''
Ensure group does not exist
name
Name of the group
domain
The name or id of the domain
'''
ret = {'name': name,
'changes': {},
'result': True,
'comment': ''}
kwargs = __utils__['args.clean_kwargs']... | def absent(name, auth=None, **kwargs):
'''
Ensure group does not exist
name
Name of the group
domain
The name or id of the domain
'''
ret = {'name': name,
'changes': {},
'result': True,
'comment': ''}
kwargs = __utils__['args.clean_kwargs']... | [
"Ensure",
"group",
"does",
"not",
"exist"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone_group.py#L108-L141 | [
"def",
"absent",
"(",
"name",
",",
"auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"kwargs",
"=",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | find | Return a dict of the files located with the given path and environment | salt/wheel/pillar_roots.py | def find(path, saltenv='base'):
'''
Return a dict of the files located with the given path and environment
'''
# Return a list of paths + text or bin
ret = []
if saltenv not in __opts__['pillar_roots']:
return ret
for root in __opts__['pillar_roots'][saltenv]:
full = os.path.... | def find(path, saltenv='base'):
'''
Return a dict of the files located with the given path and environment
'''
# Return a list of paths + text or bin
ret = []
if saltenv not in __opts__['pillar_roots']:
return ret
for root in __opts__['pillar_roots'][saltenv]:
full = os.path.... | [
"Return",
"a",
"dict",
"of",
"the",
"files",
"located",
"with",
"the",
"given",
"path",
"and",
"environment"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/pillar_roots.py#L19-L36 | [
"def",
"find",
"(",
"path",
",",
"saltenv",
"=",
"'base'",
")",
":",
"# Return a list of paths + text or bin",
"ret",
"=",
"[",
"]",
"if",
"saltenv",
"not",
"in",
"__opts__",
"[",
"'pillar_roots'",
"]",
":",
"return",
"ret",
"for",
"root",
"in",
"__opts__",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_env | Return all of the file paths found in an environment | salt/wheel/pillar_roots.py | def list_env(saltenv='base'):
'''
Return all of the file paths found in an environment
'''
ret = {}
if saltenv not in __opts__['pillar_roots']:
return ret
for f_root in __opts__['pillar_roots'][saltenv]:
ret[f_root] = {}
for root, dirs, files in salt.utils.path.os_walk(f_... | def list_env(saltenv='base'):
'''
Return all of the file paths found in an environment
'''
ret = {}
if saltenv not in __opts__['pillar_roots']:
return ret
for f_root in __opts__['pillar_roots'][saltenv]:
ret[f_root] = {}
for root, dirs, files in salt.utils.path.os_walk(f_... | [
"Return",
"all",
"of",
"the",
"file",
"paths",
"found",
"in",
"an",
"environment"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/pillar_roots.py#L39-L66 | [
"def",
"list_env",
"(",
"saltenv",
"=",
"'base'",
")",
":",
"ret",
"=",
"{",
"}",
"if",
"saltenv",
"not",
"in",
"__opts__",
"[",
"'pillar_roots'",
"]",
":",
"return",
"ret",
"for",
"f_root",
"in",
"__opts__",
"[",
"'pillar_roots'",
"]",
"[",
"saltenv",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | list_roots | Return all of the files names in all available environments | salt/wheel/pillar_roots.py | def list_roots():
'''
Return all of the files names in all available environments
'''
ret = {}
for saltenv in __opts__['pillar_roots']:
ret[saltenv] = []
ret[saltenv].append(list_env(saltenv))
return ret | def list_roots():
'''
Return all of the files names in all available environments
'''
ret = {}
for saltenv in __opts__['pillar_roots']:
ret[saltenv] = []
ret[saltenv].append(list_env(saltenv))
return ret | [
"Return",
"all",
"of",
"the",
"files",
"names",
"in",
"all",
"available",
"environments"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/pillar_roots.py#L69-L77 | [
"def",
"list_roots",
"(",
")",
":",
"ret",
"=",
"{",
"}",
"for",
"saltenv",
"in",
"__opts__",
"[",
"'pillar_roots'",
"]",
":",
"ret",
"[",
"saltenv",
"]",
"=",
"[",
"]",
"ret",
"[",
"saltenv",
"]",
".",
"append",
"(",
"list_env",
"(",
"saltenv",
")... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | read | Read the contents of a text file, if the file is binary then | salt/wheel/pillar_roots.py | def read(path, saltenv='base'):
'''
Read the contents of a text file, if the file is binary then
'''
# Return a dict of paths + content
ret = []
files = find(path, saltenv)
for fn_ in files:
full = next(six.iterkeys(fn_))
form = fn_[full]
if form == 'txt':
... | def read(path, saltenv='base'):
'''
Read the contents of a text file, if the file is binary then
'''
# Return a dict of paths + content
ret = []
files = find(path, saltenv)
for fn_ in files:
full = next(six.iterkeys(fn_))
form = fn_[full]
if form == 'txt':
... | [
"Read",
"the",
"contents",
"of",
"a",
"text",
"file",
"if",
"the",
"file",
"is",
"binary",
"then"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/pillar_roots.py#L80-L95 | [
"def",
"read",
"(",
"path",
",",
"saltenv",
"=",
"'base'",
")",
":",
"# Return a dict of paths + content",
"ret",
"=",
"[",
"]",
"files",
"=",
"find",
"(",
"path",
",",
"saltenv",
")",
"for",
"fn_",
"in",
"files",
":",
"full",
"=",
"next",
"(",
"six",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | write | Write the named file, by default the first file found is written, but the
index of the file can be specified to write to a lower priority file root | salt/wheel/pillar_roots.py | def write(data, path, saltenv='base', index=0):
'''
Write the named file, by default the first file found is written, but the
index of the file can be specified to write to a lower priority file root
'''
if saltenv not in __opts__['pillar_roots']:
return 'Named environment {0} is not present... | def write(data, path, saltenv='base', index=0):
'''
Write the named file, by default the first file found is written, but the
index of the file can be specified to write to a lower priority file root
'''
if saltenv not in __opts__['pillar_roots']:
return 'Named environment {0} is not present... | [
"Write",
"the",
"named",
"file",
"by",
"default",
"the",
"first",
"file",
"found",
"is",
"written",
"but",
"the",
"index",
"of",
"the",
"file",
"can",
"be",
"specified",
"to",
"write",
"to",
"a",
"lower",
"priority",
"file",
"root"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/pillar_roots.py#L98-L117 | [
"def",
"write",
"(",
"data",
",",
"path",
",",
"saltenv",
"=",
"'base'",
",",
"index",
"=",
"0",
")",
":",
"if",
"saltenv",
"not",
"in",
"__opts__",
"[",
"'pillar_roots'",
"]",
":",
"return",
"'Named environment {0} is not present'",
".",
"format",
"(",
"s... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | resource_group_present | .. versionadded:: 2019.2.0
Ensure a resource group exists.
:param name:
Name of the resource group.
:param location:
The Azure location in which to create the resource group. This value cannot be updated once
the resource group is created.
:param managed_by:
The ID of... | salt/states/azurearm_resource.py | def resource_group_present(name, location, managed_by=None, tags=None, connection_auth=None, **kwargs):
'''
.. versionadded:: 2019.2.0
Ensure a resource group exists.
:param name:
Name of the resource group.
:param location:
The Azure location in which to create the resource group... | def resource_group_present(name, location, managed_by=None, tags=None, connection_auth=None, **kwargs):
'''
.. versionadded:: 2019.2.0
Ensure a resource group exists.
:param name:
Name of the resource group.
:param location:
The Azure location in which to create the resource group... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_resource.py#L104-L210 | [
"def",
"resource_group_present",
"(",
"name",
",",
"location",
",",
"managed_by",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"connection_auth",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | resource_group_absent | .. versionadded:: 2019.2.0
Ensure a resource group does not exist in the current subscription.
:param name:
Name of the resource group.
:param connection_auth:
A dict with subscription and authentication parameters to be used in connecting to the
Azure Resource Manager API. | salt/states/azurearm_resource.py | def resource_group_absent(name, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a resource group does not exist in the current subscription.
:param name:
Name of the resource group.
:param connection_auth:
A dict with subscription and authentication parameters to be u... | def resource_group_absent(name, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a resource group does not exist in the current subscription.
:param name:
Name of the resource group.
:param connection_auth:
A dict with subscription and authentication parameters to be u... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_resource.py#L213-L275 | [
"def",
"resource_group_absent",
"(",
"name",
",",
"connection_auth",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"if",
"not",
"isinstan... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | policy_definition_present | .. versionadded:: 2019.2.0
Ensure a security policy definition exists.
:param name:
Name of the policy definition.
:param policy_rule:
A YAML dictionary defining the policy rule. See `Azure Policy Definition documentation
<https://docs.microsoft.com/en-us/azure/azure-policy/policy... | salt/states/azurearm_resource.py | def policy_definition_present(name, policy_rule=None, policy_type=None, mode=None, display_name=None, description=None,
metadata=None, parameters=None, policy_rule_json=None, policy_rule_file=None,
template='jinja', source_hash=None, source_hash_name=None, ski... | def policy_definition_present(name, policy_rule=None, policy_type=None, mode=None, display_name=None, description=None,
metadata=None, parameters=None, policy_rule_json=None, policy_rule_file=None,
template='jinja', source_hash=None, source_hash_name=None, ski... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_resource.py#L278-L544 | [
"def",
"policy_definition_present",
"(",
"name",
",",
"policy_rule",
"=",
"None",
",",
"policy_type",
"=",
"None",
",",
"mode",
"=",
"None",
",",
"display_name",
"=",
"None",
",",
"description",
"=",
"None",
",",
"metadata",
"=",
"None",
",",
"parameters",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | policy_definition_absent | .. versionadded:: 2019.2.0
Ensure a policy definition does not exist in the current subscription.
:param name:
Name of the policy definition.
:param connection_auth:
A dict with subscription and authentication parameters to be used in connecting to the
Azure Resource Manager API. | salt/states/azurearm_resource.py | def policy_definition_absent(name, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a policy definition does not exist in the current subscription.
:param name:
Name of the policy definition.
:param connection_auth:
A dict with subscription and authentication parameter... | def policy_definition_absent(name, connection_auth=None):
'''
.. versionadded:: 2019.2.0
Ensure a policy definition does not exist in the current subscription.
:param name:
Name of the policy definition.
:param connection_auth:
A dict with subscription and authentication parameter... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_resource.py#L547-L599 | [
"def",
"policy_definition_absent",
"(",
"name",
",",
"connection_auth",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'result'",
":",
"False",
",",
"'comment'",
":",
"''",
",",
"'changes'",
":",
"{",
"}",
"}",
"if",
"not",
"isins... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | policy_assignment_present | .. versionadded:: 2019.2.0
Ensure a security policy assignment exists.
:param name:
Name of the policy assignment.
:param scope:
The scope of the policy assignment.
:param definition_name:
The name of the policy definition to assign.
:param display_name:
The disp... | salt/states/azurearm_resource.py | def policy_assignment_present(name, scope, definition_name, display_name=None, description=None, assignment_type=None,
parameters=None, connection_auth=None, **kwargs):
'''
.. versionadded:: 2019.2.0
Ensure a security policy assignment exists.
:param name:
Name of... | def policy_assignment_present(name, scope, definition_name, display_name=None, description=None, assignment_type=None,
parameters=None, connection_auth=None, **kwargs):
'''
.. versionadded:: 2019.2.0
Ensure a security policy assignment exists.
:param name:
Name of... | [
"..",
"versionadded",
"::",
"2019",
".",
"2",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/azurearm_resource.py#L602-L753 | [
"def",
"policy_assignment_present",
"(",
"name",
",",
"scope",
",",
"definition_name",
",",
"display_name",
"=",
"None",
",",
"description",
"=",
"None",
",",
"assignment_type",
"=",
"None",
",",
"parameters",
"=",
"None",
",",
"connection_auth",
"=",
"None",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | returner | Send an xmpp message with the data | salt/returners/xmpp_return.py | def returner(ret):
'''
Send an xmpp message with the data
'''
_options = _get_options(ret)
from_jid = _options.get('from_jid')
password = _options.get('password')
recipient_jid = _options.get('recipient_jid')
if not from_jid:
log.error('xmpp.jid not defined in salt config')
... | def returner(ret):
'''
Send an xmpp message with the data
'''
_options = _get_options(ret)
from_jid = _options.get('from_jid')
password = _options.get('password')
recipient_jid = _options.get('recipient_jid')
if not from_jid:
log.error('xmpp.jid not defined in salt config')
... | [
"Send",
"an",
"xmpp",
"message",
"with",
"the",
"data"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/xmpp_return.py#L157-L198 | [
"def",
"returner",
"(",
"ret",
")",
":",
"_options",
"=",
"_get_options",
"(",
"ret",
")",
"from_jid",
"=",
"_options",
".",
"get",
"(",
"'from_jid'",
")",
"password",
"=",
"_options",
".",
"get",
"(",
"'password'",
")",
"recipient_jid",
"=",
"_options",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _get_binding_info | Combine the host header, IP address, and TCP port into bindingInformation format. | salt/states/win_iis.py | def _get_binding_info(hostheader='', ipaddress='*', port=80):
'''
Combine the host header, IP address, and TCP port into bindingInformation format.
'''
ret = r'{0}:{1}:{2}'.format(ipaddress, port, hostheader.replace(' ', ''))
return ret | def _get_binding_info(hostheader='', ipaddress='*', port=80):
'''
Combine the host header, IP address, and TCP port into bindingInformation format.
'''
ret = r'{0}:{1}:{2}'.format(ipaddress, port, hostheader.replace(' ', ''))
return ret | [
"Combine",
"the",
"host",
"header",
"IP",
"address",
"and",
"TCP",
"port",
"into",
"bindingInformation",
"format",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L31-L37 | [
"def",
"_get_binding_info",
"(",
"hostheader",
"=",
"''",
",",
"ipaddress",
"=",
"'*'",
",",
"port",
"=",
"80",
")",
":",
"ret",
"=",
"r'{0}:{1}:{2}'",
".",
"format",
"(",
"ipaddress",
",",
"port",
",",
"hostheader",
".",
"replace",
"(",
"' '",
",",
"'... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | deployed | Ensure the website has been deployed.
.. note:
This function only validates against the site name, and will return True even
if the site already exists with a different configuration. It will not modify
the configuration of an existing site.
:param str name: The IIS site name.
:pa... | salt/states/win_iis.py | def deployed(name, sourcepath, apppool='', hostheader='', ipaddress='*', port=80, protocol='http', preload=''):
'''
Ensure the website has been deployed.
.. note:
This function only validates against the site name, and will return True even
if the site already exists with a different confi... | def deployed(name, sourcepath, apppool='', hostheader='', ipaddress='*', port=80, protocol='http', preload=''):
'''
Ensure the website has been deployed.
.. note:
This function only validates against the site name, and will return True even
if the site already exists with a different confi... | [
"Ensure",
"the",
"website",
"has",
"been",
"deployed",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L40-L110 | [
"def",
"deployed",
"(",
"name",
",",
"sourcepath",
",",
"apppool",
"=",
"''",
",",
"hostheader",
"=",
"''",
",",
"ipaddress",
"=",
"'*'",
",",
"port",
"=",
"80",
",",
"protocol",
"=",
"'http'",
",",
"preload",
"=",
"''",
")",
":",
"ret",
"=",
"{",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | remove_site | Delete a website from IIS.
:param str name: The IIS site name.
Usage:
.. code-block:: yaml
defaultwebsite-remove:
win_iis.remove_site:
- name: Default Web Site | salt/states/win_iis.py | def remove_site(name):
'''
Delete a website from IIS.
:param str name: The IIS site name.
Usage:
.. code-block:: yaml
defaultwebsite-remove:
win_iis.remove_site:
- name: Default Web Site
'''
ret = {'name': name,
'changes': {},
'r... | def remove_site(name):
'''
Delete a website from IIS.
:param str name: The IIS site name.
Usage:
.. code-block:: yaml
defaultwebsite-remove:
win_iis.remove_site:
- name: Default Web Site
'''
ret = {'name': name,
'changes': {},
'r... | [
"Delete",
"a",
"website",
"from",
"IIS",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L113-L147 | [
"def",
"remove_site",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
"}",
"current_sites",
"=",
"__salt__",
"[",
"'win_iis.list_sites'",
"]",
"(... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_binding | Create an IIS binding.
.. note:
This function only validates against the binding ipaddress:port:hostheader combination,
and will return True even if the binding already exists with a different configuration.
It will not modify the configuration of an existing binding.
:param str site:... | salt/states/win_iis.py | def create_binding(name, site, hostheader='', ipaddress='*', port=80, protocol='http', sslflags=0):
'''
Create an IIS binding.
.. note:
This function only validates against the binding ipaddress:port:hostheader combination,
and will return True even if the binding already exists with a dif... | def create_binding(name, site, hostheader='', ipaddress='*', port=80, protocol='http', sslflags=0):
'''
Create an IIS binding.
.. note:
This function only validates against the binding ipaddress:port:hostheader combination,
and will return True even if the binding already exists with a dif... | [
"Create",
"an",
"IIS",
"binding",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L150-L209 | [
"def",
"create_binding",
"(",
"name",
",",
"site",
",",
"hostheader",
"=",
"''",
",",
"ipaddress",
"=",
"'*'",
",",
"port",
"=",
"80",
",",
"protocol",
"=",
"'http'",
",",
"sslflags",
"=",
"0",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | remove_binding | Remove an IIS binding.
:param str site: The IIS site name.
:param str hostheader: The host header of the binding.
:param str ipaddress: The IP address of the binding.
:param str port: The TCP port of the binding.
Example of usage with only the required arguments:
.. code-block:: yaml
... | salt/states/win_iis.py | def remove_binding(name, site, hostheader='', ipaddress='*', port=80):
'''
Remove an IIS binding.
:param str site: The IIS site name.
:param str hostheader: The host header of the binding.
:param str ipaddress: The IP address of the binding.
:param str port: The TCP port of the binding.
Ex... | def remove_binding(name, site, hostheader='', ipaddress='*', port=80):
'''
Remove an IIS binding.
:param str site: The IIS site name.
:param str hostheader: The host header of the binding.
:param str ipaddress: The IP address of the binding.
:param str port: The TCP port of the binding.
Ex... | [
"Remove",
"an",
"IIS",
"binding",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L212-L261 | [
"def",
"remove_binding",
"(",
"name",
",",
"site",
",",
"hostheader",
"=",
"''",
",",
"ipaddress",
"=",
"'*'",
",",
"port",
"=",
"80",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"str",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_cert_binding | Assign a certificate to an IIS binding.
.. note:
The web binding that the certificate is being assigned to must already exist.
:param str name: The thumbprint of the certificate.
:param str site: The IIS site name.
:param str hostheader: The host header of the binding.
:param str ipaddres... | salt/states/win_iis.py | def create_cert_binding(name, site, hostheader='', ipaddress='*', port=443, sslflags=0):
'''
Assign a certificate to an IIS binding.
.. note:
The web binding that the certificate is being assigned to must already exist.
:param str name: The thumbprint of the certificate.
:param str site: ... | def create_cert_binding(name, site, hostheader='', ipaddress='*', port=443, sslflags=0):
'''
Assign a certificate to an IIS binding.
.. note:
The web binding that the certificate is being assigned to must already exist.
:param str name: The thumbprint of the certificate.
:param str site: ... | [
"Assign",
"a",
"certificate",
"to",
"an",
"IIS",
"binding",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L264-L331 | [
"def",
"create_cert_binding",
"(",
"name",
",",
"site",
",",
"hostheader",
"=",
"''",
",",
"ipaddress",
"=",
"'*'",
",",
"port",
"=",
"443",
",",
"sslflags",
"=",
"0",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | remove_cert_binding | Remove a certificate from an IIS binding.
.. note:
This function only removes the certificate from the web binding. It does
not remove the web binding itself.
:param str name: The thumbprint of the certificate.
:param str site: The IIS site name.
:param str hostheader: The host header... | salt/states/win_iis.py | def remove_cert_binding(name, site, hostheader='', ipaddress='*', port=443):
'''
Remove a certificate from an IIS binding.
.. note:
This function only removes the certificate from the web binding. It does
not remove the web binding itself.
:param str name: The thumbprint of the certif... | def remove_cert_binding(name, site, hostheader='', ipaddress='*', port=443):
'''
Remove a certificate from an IIS binding.
.. note:
This function only removes the certificate from the web binding. It does
not remove the web binding itself.
:param str name: The thumbprint of the certif... | [
"Remove",
"a",
"certificate",
"from",
"an",
"IIS",
"binding",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L334-L396 | [
"def",
"remove_cert_binding",
"(",
"name",
",",
"site",
",",
"hostheader",
"=",
"''",
",",
"ipaddress",
"=",
"'*'",
",",
"port",
"=",
"443",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_apppool | Create an IIS application pool.
.. note:
This function only validates against the application pool name, and will return
True even if the application pool already exists with a different configuration.
It will not modify the configuration of an existing application pool.
:param str na... | salt/states/win_iis.py | def create_apppool(name):
'''
Create an IIS application pool.
.. note:
This function only validates against the application pool name, and will return
True even if the application pool already exists with a different configuration.
It will not modify the configuration of an existin... | def create_apppool(name):
'''
Create an IIS application pool.
.. note:
This function only validates against the application pool name, and will return
True even if the application pool already exists with a different configuration.
It will not modify the configuration of an existin... | [
"Create",
"an",
"IIS",
"application",
"pool",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L399-L439 | [
"def",
"create_apppool",
"(",
"name",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
"}",
"current_apppools",
"=",
"__salt__",
"[",
"'win_iis.list_apppools'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | remove_apppool | Remove an IIS application pool.
:param str name: The name of the IIS application pool.
Usage:
.. code-block:: yaml
defaultapppool-remove:
win_iis.remove_apppool:
- name: DefaultAppPool | salt/states/win_iis.py | def remove_apppool(name):
# Remove IIS AppPool
'''
Remove an IIS application pool.
:param str name: The name of the IIS application pool.
Usage:
.. code-block:: yaml
defaultapppool-remove:
win_iis.remove_apppool:
- name: DefaultAppPool
'''
ret = {... | def remove_apppool(name):
# Remove IIS AppPool
'''
Remove an IIS application pool.
:param str name: The name of the IIS application pool.
Usage:
.. code-block:: yaml
defaultapppool-remove:
win_iis.remove_apppool:
- name: DefaultAppPool
'''
ret = {... | [
"Remove",
"an",
"IIS",
"application",
"pool",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L442-L477 | [
"def",
"remove_apppool",
"(",
"name",
")",
":",
"# Remove IIS AppPool",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"None",
",",
"'comment'",
":",
"''",
"}",
"current_apppools",
"=",
"__salt__",
"[",
"'w... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | container_setting | Set the value of the setting for an IIS container.
:param str name: The name of the IIS container.
:param str container: The type of IIS container. The container types are:
AppPools, Sites, SslBindings
:param str settings: A dictionary of the setting names and their values.
Example of usage... | salt/states/win_iis.py | def container_setting(name, container, settings=None):
'''
Set the value of the setting for an IIS container.
:param str name: The name of the IIS container.
:param str container: The type of IIS container. The container types are:
AppPools, Sites, SslBindings
:param str settings: A diction... | def container_setting(name, container, settings=None):
'''
Set the value of the setting for an IIS container.
:param str name: The name of the IIS container.
:param str container: The type of IIS container. The container types are:
AppPools, Sites, SslBindings
:param str settings: A diction... | [
"Set",
"the",
"value",
"of",
"the",
"setting",
"for",
"an",
"IIS",
"container",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L480-L573 | [
"def",
"container_setting",
"(",
"name",
",",
"container",
",",
"settings",
"=",
"None",
")",
":",
"identityType_map2string",
"=",
"{",
"0",
":",
"'LocalSystem'",
",",
"1",
":",
"'LocalService'",
",",
"2",
":",
"'NetworkService'",
",",
"3",
":",
"'SpecificUs... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_app | Create an IIS application.
.. note:
This function only validates against the application name, and will return True
even if the application already exists with a different configuration. It will not
modify the configuration of an existing application.
:param str name: The IIS applicat... | salt/states/win_iis.py | def create_app(name, site, sourcepath, apppool=None):
'''
Create an IIS application.
.. note:
This function only validates against the application name, and will return True
even if the application already exists with a different configuration. It will not
modify the configuration ... | def create_app(name, site, sourcepath, apppool=None):
'''
Create an IIS application.
.. note:
This function only validates against the application name, and will return True
even if the application already exists with a different configuration. It will not
modify the configuration ... | [
"Create",
"an",
"IIS",
"application",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L576-L632 | [
"def",
"create_app",
"(",
"name",
",",
"site",
",",
"sourcepath",
",",
"apppool",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"str",
"(",
")",
",",
"'result'",
":",
"None",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | remove_app | Remove an IIS application.
:param str name: The application name.
:param str site: The IIS site name.
Usage:
.. code-block:: yaml
site0-v1-app-remove:
win_iis.remove_app:
- name: v1
- site: site0 | salt/states/win_iis.py | def remove_app(name, site):
'''
Remove an IIS application.
:param str name: The application name.
:param str site: The IIS site name.
Usage:
.. code-block:: yaml
site0-v1-app-remove:
win_iis.remove_app:
- name: v1
- site: site0
'''
... | def remove_app(name, site):
'''
Remove an IIS application.
:param str name: The application name.
:param str site: The IIS site name.
Usage:
.. code-block:: yaml
site0-v1-app-remove:
win_iis.remove_app:
- name: v1
- site: site0
'''
... | [
"Remove",
"an",
"IIS",
"application",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L635-L670 | [
"def",
"remove_app",
"(",
"name",
",",
"site",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"str",
"(",
")",
",",
"'result'",
":",
"None",
"}",
"current_apps",
"=",
"__salt__",
"[",
"'win... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | create_vdir | Create an IIS virtual directory.
.. note:
This function only validates against the virtual directory name, and will return
True even if the virtual directory already exists with a different configuration.
It will not modify the configuration of an existing virtual directory.
:param st... | salt/states/win_iis.py | def create_vdir(name, site, sourcepath, app='/'):
'''
Create an IIS virtual directory.
.. note:
This function only validates against the virtual directory name, and will return
True even if the virtual directory already exists with a different configuration.
It will not modify the ... | def create_vdir(name, site, sourcepath, app='/'):
'''
Create an IIS virtual directory.
.. note:
This function only validates against the virtual directory name, and will return
True even if the virtual directory already exists with a different configuration.
It will not modify the ... | [
"Create",
"an",
"IIS",
"virtual",
"directory",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L673-L730 | [
"def",
"create_vdir",
"(",
"name",
",",
"site",
",",
"sourcepath",
",",
"app",
"=",
"'/'",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"str",
"(",
")",
",",
"'result'",
":",
"None",
"}... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | remove_vdir | Remove an IIS virtual directory.
:param str name: The virtual directory name.
:param str site: The IIS site name.
:param str app: The IIS application.
Example of usage with only the required arguments:
.. code-block:: yaml
site0-foo-vdir-remove:
win_iis.remove_vdir:
... | salt/states/win_iis.py | def remove_vdir(name, site, app='/'):
'''
Remove an IIS virtual directory.
:param str name: The virtual directory name.
:param str site: The IIS site name.
:param str app: The IIS application.
Example of usage with only the required arguments:
.. code-block:: yaml
site0-foo-vdir-... | def remove_vdir(name, site, app='/'):
'''
Remove an IIS virtual directory.
:param str name: The virtual directory name.
:param str site: The IIS site name.
:param str app: The IIS application.
Example of usage with only the required arguments:
.. code-block:: yaml
site0-foo-vdir-... | [
"Remove",
"an",
"IIS",
"virtual",
"directory",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L733-L780 | [
"def",
"remove_vdir",
"(",
"name",
",",
"site",
",",
"app",
"=",
"'/'",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"str",
"(",
")",
",",
"'result'",
":",
"None",
"}",
"current_vdirs",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | set_app | .. versionadded:: 2017.7.0
Set the value of the setting for an IIS web application.
.. note::
This function only configures existing app. Params are case sensitive.
:param str name: The IIS application.
:param str site: The IIS site name.
:param str settings: A dictionary of the setting n... | salt/states/win_iis.py | def set_app(name, site, settings=None):
# pylint: disable=anomalous-backslash-in-string
'''
.. versionadded:: 2017.7.0
Set the value of the setting for an IIS web application.
.. note::
This function only configures existing app. Params are case sensitive.
:param str name: The IIS app... | def set_app(name, site, settings=None):
# pylint: disable=anomalous-backslash-in-string
'''
.. versionadded:: 2017.7.0
Set the value of the setting for an IIS web application.
.. note::
This function only configures existing app. Params are case sensitive.
:param str name: The IIS app... | [
"..",
"versionadded",
"::",
"2017",
".",
"7",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L783-L871 | [
"def",
"set_app",
"(",
"name",
",",
"site",
",",
"settings",
"=",
"None",
")",
":",
"# pylint: disable=anomalous-backslash-in-string",
"# pylint: enable=anomalous-backslash-in-string",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | webconfiguration_settings | r'''
Set the value of webconfiguration settings.
:param str name: The name of the IIS PSPath containing the settings.
Possible PSPaths are :
MACHINE, MACHINE/WEBROOT, IIS:\, IIS:\Sites\sitename, ...
:param str location: The location of the settings.
:param dict settings: Dictionaries of... | salt/states/win_iis.py | def webconfiguration_settings(name, location='', settings=None):
r'''
Set the value of webconfiguration settings.
:param str name: The name of the IIS PSPath containing the settings.
Possible PSPaths are :
MACHINE, MACHINE/WEBROOT, IIS:\, IIS:\Sites\sitename, ...
:param str location: Th... | def webconfiguration_settings(name, location='', settings=None):
r'''
Set the value of webconfiguration settings.
:param str name: The name of the IIS PSPath containing the settings.
Possible PSPaths are :
MACHINE, MACHINE/WEBROOT, IIS:\, IIS:\Sites\sitename, ...
:param str location: Th... | [
"r",
"Set",
"the",
"value",
"of",
"webconfiguration",
"settings",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_iis.py#L874-L1006 | [
"def",
"webconfiguration_settings",
"(",
"name",
",",
"location",
"=",
"''",
",",
"settings",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'comment'",
":",
"str",
"(",
")",
",",
"'result'",
":"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _frontend_url | Tries to guess the url of zabbix frontend.
.. versionadded:: 2016.3.0 | salt/modules/zabbix.py | def _frontend_url():
'''
Tries to guess the url of zabbix frontend.
.. versionadded:: 2016.3.0
'''
hostname = socket.gethostname()
frontend_url = 'http://' + hostname + '/zabbix/api_jsonrpc.php'
try:
try:
response = salt.utils.http.query(frontend_url)
error =... | def _frontend_url():
'''
Tries to guess the url of zabbix frontend.
.. versionadded:: 2016.3.0
'''
hostname = socket.gethostname()
frontend_url = 'http://' + hostname + '/zabbix/api_jsonrpc.php'
try:
try:
response = salt.utils.http.query(frontend_url)
error =... | [
"Tries",
"to",
"guess",
"the",
"url",
"of",
"zabbix",
"frontend",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L108-L127 | [
"def",
"_frontend_url",
"(",
")",
":",
"hostname",
"=",
"socket",
".",
"gethostname",
"(",
")",
"frontend_url",
"=",
"'http://'",
"+",
"hostname",
"+",
"'/zabbix/api_jsonrpc.php'",
"try",
":",
"try",
":",
"response",
"=",
"salt",
".",
"utils",
".",
"http",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _query | JSON request to Zabbix API.
.. versionadded:: 2016.3.0
:param method: actual operation to perform via the API
:param params: parameters required for specific method
:param url: url of zabbix api
:param auth: auth token for zabbix api (only for methods with required authentication)
:return: Re... | salt/modules/zabbix.py | def _query(method, params, url, auth=None):
'''
JSON request to Zabbix API.
.. versionadded:: 2016.3.0
:param method: actual operation to perform via the API
:param params: parameters required for specific method
:param url: url of zabbix api
:param auth: auth token for zabbix api (only fo... | def _query(method, params, url, auth=None):
'''
JSON request to Zabbix API.
.. versionadded:: 2016.3.0
:param method: actual operation to perform via the API
:param params: parameters required for specific method
:param url: url of zabbix api
:param auth: auth token for zabbix api (only fo... | [
"JSON",
"request",
"to",
"Zabbix",
"API",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L130-L177 | [
"def",
"_query",
"(",
"method",
",",
"params",
",",
"url",
",",
"auth",
"=",
"None",
")",
":",
"unauthenticated_methods",
"=",
"[",
"'user.login'",
",",
"'apiinfo.version'",
",",
"]",
"header_dict",
"=",
"{",
"'Content-type'",
":",
"'application/json'",
"}",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _login | Log in to the API and generate the authentication token.
.. versionadded:: 2016.3.0
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module's docstring... | salt/modules/zabbix.py | def _login(**kwargs):
'''
Log in to the API and generate the authentication token.
.. versionadded:: 2016.3.0
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts... | def _login(**kwargs):
'''
Log in to the API and generate the authentication token.
.. versionadded:: 2016.3.0
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts... | [
"Log",
"in",
"to",
"the",
"API",
"and",
"generate",
"the",
"authentication",
"token",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L180-L240 | [
"def",
"_login",
"(",
"*",
"*",
"kwargs",
")",
":",
"connargs",
"=",
"dict",
"(",
")",
"def",
"_connarg",
"(",
"name",
",",
"key",
"=",
"None",
")",
":",
"'''\n Add key to connargs, only if name exists in our kwargs or, as zabbix.<name> in __opts__ or __pillar__\... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | _params_extend | Extends the params dictionary by values from keyword arguments.
.. versionadded:: 2016.3.0
:param params: Dictionary with parameters for zabbix API.
:param _ignore_name: Salt State module is passing first line as 'name' parameter. If API uses optional parameter
'name' (for ex. host_create, user_create... | salt/modules/zabbix.py | def _params_extend(params, _ignore_name=False, **kwargs):
'''
Extends the params dictionary by values from keyword arguments.
.. versionadded:: 2016.3.0
:param params: Dictionary with parameters for zabbix API.
:param _ignore_name: Salt State module is passing first line as 'name' parameter. If AP... | def _params_extend(params, _ignore_name=False, **kwargs):
'''
Extends the params dictionary by values from keyword arguments.
.. versionadded:: 2016.3.0
:param params: Dictionary with parameters for zabbix API.
:param _ignore_name: Salt State module is passing first line as 'name' parameter. If AP... | [
"Extends",
"the",
"params",
"dictionary",
"by",
"values",
"from",
"keyword",
"arguments",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L243-L273 | [
"def",
"_params_extend",
"(",
"params",
",",
"_ignore_name",
"=",
"False",
",",
"*",
"*",
"kwargs",
")",
":",
"# extend params value by optional zabbix API parameters",
"for",
"key",
"in",
"kwargs",
":",
"if",
"not",
"key",
".",
"startswith",
"(",
"'_'",
")",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | substitute_params | .. versionadded:: 2017.7
Go through Zabbix object params specification and if needed get given object ID from Zabbix API and put it back
as a value. Definition of the object is done via dict with keys "query_object" and "query_name".
:param input_object: Zabbix object type specified in state file
:par... | salt/modules/zabbix.py | def substitute_params(input_object, extend_params=None, filter_key='name', **kwargs):
'''
.. versionadded:: 2017.7
Go through Zabbix object params specification and if needed get given object ID from Zabbix API and put it back
as a value. Definition of the object is done via dict with keys "query_objec... | def substitute_params(input_object, extend_params=None, filter_key='name', **kwargs):
'''
.. versionadded:: 2017.7
Go through Zabbix object params specification and if needed get given object ID from Zabbix API and put it back
as a value. Definition of the object is done via dict with keys "query_objec... | [
"..",
"versionadded",
"::",
"2017",
".",
"7"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L287-L323 | [
"def",
"substitute_params",
"(",
"input_object",
",",
"extend_params",
"=",
"None",
",",
"filter_key",
"=",
"'name'",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"extend_params",
"is",
"None",
":",
"extend_params",
"=",
"{",
"}",
"if",
"isinstance",
"(",
"inp... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | compare_params | .. versionadded:: 2017.7
Compares Zabbix object definition against existing Zabbix object.
:param defined: Zabbix object definition taken from sls file.
:param existing: Existing Zabbix object taken from result of an API call.
:param return_old_value: Default False. If True, returns dict("old"=old_val... | salt/modules/zabbix.py | def compare_params(defined, existing, return_old_value=False):
'''
.. versionadded:: 2017.7
Compares Zabbix object definition against existing Zabbix object.
:param defined: Zabbix object definition taken from sls file.
:param existing: Existing Zabbix object taken from result of an API call.
... | def compare_params(defined, existing, return_old_value=False):
'''
.. versionadded:: 2017.7
Compares Zabbix object definition against existing Zabbix object.
:param defined: Zabbix object definition taken from sls file.
:param existing: Existing Zabbix object taken from result of an API call.
... | [
"..",
"versionadded",
"::",
"2017",
".",
"7"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L327-L402 | [
"def",
"compare_params",
"(",
"defined",
",",
"existing",
",",
"return_old_value",
"=",
"False",
")",
":",
"# Comparison of data types",
"if",
"not",
"isinstance",
"(",
"defined",
",",
"type",
"(",
"existing",
")",
")",
":",
"raise",
"SaltException",
"(",
"'Za... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | get_object_id_by_params | .. versionadded:: 2017.7
Get ID of single Zabbix object specified by its name.
:param obj: Zabbix object type
:param params: Parameters by which object is uniquely identified
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connect... | salt/modules/zabbix.py | def get_object_id_by_params(obj, params=None, **kwargs):
'''
.. versionadded:: 2017.7
Get ID of single Zabbix object specified by its name.
:param obj: Zabbix object type
:param params: Parameters by which object is uniquely identified
:param _connection_user: Optional - zabbix user (can also ... | def get_object_id_by_params(obj, params=None, **kwargs):
'''
.. versionadded:: 2017.7
Get ID of single Zabbix object specified by its name.
:param obj: Zabbix object type
:param params: Parameters by which object is uniquely identified
:param _connection_user: Optional - zabbix user (can also ... | [
"..",
"versionadded",
"::",
"2017",
".",
"7"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L405-L427 | [
"def",
"get_object_id_by_params",
"(",
"obj",
",",
"params",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"params",
"is",
"None",
":",
"params",
"=",
"{",
"}",
"res",
"=",
"run_query",
"(",
"obj",
"+",
"'.get'",
",",
"params",
",",
"*",
"*... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | apiinfo_version | Retrieve the version of the Zabbix API.
.. versionadded:: 2016.3.0
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module's docstring)
:param _con... | salt/modules/zabbix.py | def apiinfo_version(**kwargs):
'''
Retrieve the version of the Zabbix API.
.. versionadded:: 2016.3.0
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pill... | def apiinfo_version(**kwargs):
'''
Retrieve the version of the Zabbix API.
.. versionadded:: 2016.3.0
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pill... | [
"Retrieve",
"the",
"version",
"of",
"the",
"Zabbix",
"API",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L430-L458 | [
"def",
"apiinfo_version",
"(",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'apiinfo.version'",
"params",
"=",
"{",
"}",
"ret",
"=",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | user_create | .. versionadded:: 2016.3.0
Create new zabbix user
.. note::
This function accepts all standard user properties: keyword argument
names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documentation/2.0/manual/appendix/api/user/definitions#user
:p... | salt/modules/zabbix.py | def user_create(alias, passwd, usrgrps, **kwargs):
'''
.. versionadded:: 2016.3.0
Create new zabbix user
.. note::
This function accepts all standard user properties: keyword argument
names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/docu... | def user_create(alias, passwd, usrgrps, **kwargs):
'''
.. versionadded:: 2016.3.0
Create new zabbix user
.. note::
This function accepts all standard user properties: keyword argument
names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/docu... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L461-L509 | [
"def",
"user_create",
"(",
"alias",
",",
"passwd",
",",
"usrgrps",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'user.create'",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | user_delete | Delete zabbix users.
.. versionadded:: 2016.3.0
:param users: array of users (userids) to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see m... | salt/modules/zabbix.py | def user_delete(users, **kwargs):
'''
Delete zabbix users.
.. versionadded:: 2016.3.0
:param users: array of users (userids) to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix pass... | def user_delete(users, **kwargs):
'''
Delete zabbix users.
.. versionadded:: 2016.3.0
:param users: array of users (userids) to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix pass... | [
"Delete",
"zabbix",
"users",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L512-L545 | [
"def",
"user_delete",
"(",
"users",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'user.delete'",
"if",
"not",
"isinstance",
"(",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | user_exists | Checks if user with given alias exists.
.. versionadded:: 2016.3.0
:param alias: user alias
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module... | salt/modules/zabbix.py | def user_exists(alias, **kwargs):
'''
Checks if user with given alias exists.
.. versionadded:: 2016.3.0
:param alias: user alias
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password ... | def user_exists(alias, **kwargs):
'''
Checks if user with given alias exists.
.. versionadded:: 2016.3.0
:param alias: user alias
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password ... | [
"Checks",
"if",
"user",
"with",
"given",
"alias",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L548-L577 | [
"def",
"user_exists",
"(",
"alias",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'user.get'",
"params",
"=",
"{",
"\"output\"",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | user_get | Retrieve users according to the given parameters.
.. versionadded:: 2016.3.0
:param alias: user alias
:param userids: return only users with the given IDs
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Option... | salt/modules/zabbix.py | def user_get(alias=None, userids=None, **kwargs):
'''
Retrieve users according to the given parameters.
.. versionadded:: 2016.3.0
:param alias: user alias
:param userids: return only users with the given IDs
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, s... | def user_get(alias=None, userids=None, **kwargs):
'''
Retrieve users according to the given parameters.
.. versionadded:: 2016.3.0
:param alias: user alias
:param userids: return only users with the given IDs
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, s... | [
"Retrieve",
"users",
"according",
"to",
"the",
"given",
"parameters",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L580-L617 | [
"def",
"user_get",
"(",
"alias",
"=",
"None",
",",
"userids",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'use... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | user_update | .. versionadded:: 2016.3.0
Update existing users
.. note::
This function accepts all standard user properties: keyword argument
names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documentation/2.0/manual/appendix/api/user/definitions#user
:pa... | salt/modules/zabbix.py | def user_update(userid, **kwargs):
'''
.. versionadded:: 2016.3.0
Update existing users
.. note::
This function accepts all standard user properties: keyword argument
names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documentation/2.0/man... | def user_update(userid, **kwargs):
'''
.. versionadded:: 2016.3.0
Update existing users
.. note::
This function accepts all standard user properties: keyword argument
names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documentation/2.0/man... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L620-L656 | [
"def",
"user_update",
"(",
"userid",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'user.update'",
"params",
"=",
"{",
"\"userid\... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | user_getmedia | .. versionadded:: 2016.3.0
Retrieve media according to the given parameters
.. note::
This function accepts all standard usermedia.get properties: keyword
argument names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documentation/3.2/manual/api/ref... | salt/modules/zabbix.py | def user_getmedia(userids=None, **kwargs):
'''
.. versionadded:: 2016.3.0
Retrieve media according to the given parameters
.. note::
This function accepts all standard usermedia.get properties: keyword
argument names differ depending on your zabbix version, see here__.
.. __: ... | def user_getmedia(userids=None, **kwargs):
'''
.. versionadded:: 2016.3.0
Retrieve media according to the given parameters
.. note::
This function accepts all standard usermedia.get properties: keyword
argument names differ depending on your zabbix version, see here__.
.. __: ... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L659-L699 | [
"def",
"user_getmedia",
"(",
"userids",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'usermedia.get'",
"if",
"useri... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | user_addmedia | Add new media to multiple users.
.. versionadded:: 2016.3.0
:param userids: ID of the user that uses the media
:param active: Whether the media is enabled (0 enabled, 1 disabled)
:param mediatypeid: ID of the media type used by the media
:param period: Time when the notifications can be sent as a ... | salt/modules/zabbix.py | def user_addmedia(userids, active, mediatypeid, period, sendto, severity, **kwargs):
'''
Add new media to multiple users.
.. versionadded:: 2016.3.0
:param userids: ID of the user that uses the media
:param active: Whether the media is enabled (0 enabled, 1 disabled)
:param mediatypeid: ID of ... | def user_addmedia(userids, active, mediatypeid, period, sendto, severity, **kwargs):
'''
Add new media to multiple users.
.. versionadded:: 2016.3.0
:param userids: ID of the user that uses the media
:param active: Whether the media is enabled (0 enabled, 1 disabled)
:param mediatypeid: ID of ... | [
"Add",
"new",
"media",
"to",
"multiple",
"users",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L702-L747 | [
"def",
"user_addmedia",
"(",
"userids",
",",
"active",
",",
"mediatypeid",
",",
"period",
",",
"sendto",
",",
"severity",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | user_deletemedia | Delete media by id.
.. versionadded:: 2016.3.0
:param mediaids: IDs of the media to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module'... | salt/modules/zabbix.py | def user_deletemedia(mediaids, **kwargs):
'''
Delete media by id.
.. versionadded:: 2016.3.0
:param mediaids: IDs of the media to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix pa... | def user_deletemedia(mediaids, **kwargs):
'''
Delete media by id.
.. versionadded:: 2016.3.0
:param mediaids: IDs of the media to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix pa... | [
"Delete",
"media",
"by",
"id",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L750-L782 | [
"def",
"user_deletemedia",
"(",
"mediaids",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'user.deletemedia'",
"if",
"not",
"isinst... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | usergroup_delete | .. versionadded:: 2016.3.0
:param usergroupids: IDs of the user groups to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module's docstring)
... | salt/modules/zabbix.py | def usergroup_delete(usergroupids, **kwargs):
'''
.. versionadded:: 2016.3.0
:param usergroupids: IDs of the user groups to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (ca... | def usergroup_delete(usergroupids, **kwargs):
'''
.. versionadded:: 2016.3.0
:param usergroupids: IDs of the user groups to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (ca... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L855-L885 | [
"def",
"usergroup_delete",
"(",
"usergroupids",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'usergroup.delete'",
"if",
"not",
"is... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | usergroup_exists | Checks if at least one user group that matches the given filter criteria exists
.. versionadded:: 2016.3.0
:param name: names of the user groups
:param node: name of the node the user groups must belong to (This will override the nodeids parameter.)
:param nodeids: IDs of the nodes the user groups mus... | salt/modules/zabbix.py | def usergroup_exists(name=None, node=None, nodeids=None, **kwargs):
'''
Checks if at least one user group that matches the given filter criteria exists
.. versionadded:: 2016.3.0
:param name: names of the user groups
:param node: name of the node the user groups must belong to (This will override ... | def usergroup_exists(name=None, node=None, nodeids=None, **kwargs):
'''
Checks if at least one user group that matches the given filter criteria exists
.. versionadded:: 2016.3.0
:param name: names of the user groups
:param node: name of the node the user groups must belong to (This will override ... | [
"Checks",
"if",
"at",
"least",
"one",
"user",
"group",
"that",
"matches",
"the",
"given",
"filter",
"criteria",
"exists"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L888-L940 | [
"def",
"usergroup_exists",
"(",
"name",
"=",
"None",
",",
"node",
"=",
"None",
",",
"nodeids",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"zabbix_version",
"=",
"apiinfo_version",
"(",
"*",... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | usergroup_get | .. versionadded:: 2016.3.0
Retrieve user groups according to the given parameters
.. note::
This function accepts all usergroup_get properties: keyword argument
names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documentation/2.4/manual/api/refere... | salt/modules/zabbix.py | def usergroup_get(name=None, usrgrpids=None, userids=None, **kwargs):
'''
.. versionadded:: 2016.3.0
Retrieve user groups according to the given parameters
.. note::
This function accepts all usergroup_get properties: keyword argument
names differ depending on your zabbix version, see ... | def usergroup_get(name=None, usrgrpids=None, userids=None, **kwargs):
'''
.. versionadded:: 2016.3.0
Retrieve user groups according to the given parameters
.. note::
This function accepts all usergroup_get properties: keyword argument
names differ depending on your zabbix version, see ... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L943-L995 | [
"def",
"usergroup_get",
"(",
"name",
"=",
"None",
",",
"usrgrpids",
"=",
"None",
",",
"userids",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"zabbix_version",
"=",
"apiinfo_version",
"(",
"*... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | usergroup_update | .. versionadded:: 2016.3.0
Update existing user group
.. note::
This function accepts all standard user group properties: keyword
argument names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documentation/2.4/manual/api/reference/usergroup/object#u... | salt/modules/zabbix.py | def usergroup_update(usrgrpid, **kwargs):
'''
.. versionadded:: 2016.3.0
Update existing user group
.. note::
This function accepts all standard user group properties: keyword
argument names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/doc... | def usergroup_update(usrgrpid, **kwargs):
'''
.. versionadded:: 2016.3.0
Update existing user group
.. note::
This function accepts all standard user group properties: keyword
argument names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/doc... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L998-L1034 | [
"def",
"usergroup_update",
"(",
"usrgrpid",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'usergroup.update'",
"params",
"=",
"{",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | usergroup_list | Retrieve all enabled user groups.
.. versionadded:: 2016.3.0
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module's docstring)
:param _connectio... | salt/modules/zabbix.py | def usergroup_list(**kwargs):
'''
Retrieve all enabled user groups.
.. versionadded:: 2016.3.0
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see... | def usergroup_list(**kwargs):
'''
Retrieve all enabled user groups.
.. versionadded:: 2016.3.0
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see... | [
"Retrieve",
"all",
"enabled",
"user",
"groups",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1037-L1065 | [
"def",
"usergroup_list",
"(",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'usergroup.get'",
"params",
"=",
"{",
"\"output\"",
":",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | host_create | .. versionadded:: 2016.3.0
Create new host
.. note::
This function accepts all standard host properties: keyword argument
names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documentation/2.4/manual/api/reference/host/object#host
:param host: ... | salt/modules/zabbix.py | def host_create(host, groups, interfaces, **kwargs):
'''
.. versionadded:: 2016.3.0
Create new host
.. note::
This function accepts all standard host properties: keyword argument
names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documenta... | def host_create(host, groups, interfaces, **kwargs):
'''
.. versionadded:: 2016.3.0
Create new host
.. note::
This function accepts all standard host properties: keyword argument
names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documenta... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1068-L1123 | [
"def",
"host_create",
"(",
"host",
",",
"groups",
",",
"interfaces",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'host.create'"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | host_delete | Delete hosts.
.. versionadded:: 2016.3.0
:param hostids: Hosts (hostids) to delete.
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module's docst... | salt/modules/zabbix.py | def host_delete(hostids, **kwargs):
'''
Delete hosts.
.. versionadded:: 2016.3.0
:param hostids: Hosts (hostids) to delete.
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can a... | def host_delete(hostids, **kwargs):
'''
Delete hosts.
.. versionadded:: 2016.3.0
:param hostids: Hosts (hostids) to delete.
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can a... | [
"Delete",
"hosts",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1126-L1158 | [
"def",
"host_delete",
"(",
"hostids",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'host.delete'",
"if",
"not",
"isinstance",
"(... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | host_exists | Checks if at least one host that matches the given filter criteria exists.
.. versionadded:: 2016.3.0
:param host: technical name of the host
:param hostids: Hosts (hostids) to delete.
:param name: visible name of the host
:param node: name of the node the hosts must belong to (zabbix API < 2.4)
... | salt/modules/zabbix.py | def host_exists(host=None, hostid=None, name=None, node=None, nodeids=None, **kwargs):
'''
Checks if at least one host that matches the given filter criteria exists.
.. versionadded:: 2016.3.0
:param host: technical name of the host
:param hostids: Hosts (hostids) to delete.
:param name: visib... | def host_exists(host=None, hostid=None, name=None, node=None, nodeids=None, **kwargs):
'''
Checks if at least one host that matches the given filter criteria exists.
.. versionadded:: 2016.3.0
:param host: technical name of the host
:param hostids: Hosts (hostids) to delete.
:param name: visib... | [
"Checks",
"if",
"at",
"least",
"one",
"host",
"that",
"matches",
"the",
"given",
"filter",
"criteria",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1161-L1223 | [
"def",
"host_exists",
"(",
"host",
"=",
"None",
",",
"hostid",
"=",
"None",
",",
"name",
"=",
"None",
",",
"node",
"=",
"None",
",",
"nodeids",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | host_get | .. versionadded:: 2016.3.0
Retrieve hosts according to the given parameters
.. note::
This function accepts all optional host.get parameters: keyword
argument names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documentation/2.4/manual/api/referenc... | salt/modules/zabbix.py | def host_get(host=None, name=None, hostids=None, **kwargs):
'''
.. versionadded:: 2016.3.0
Retrieve hosts according to the given parameters
.. note::
This function accepts all optional host.get parameters: keyword
argument names differ depending on your zabbix version, see here__.
... | def host_get(host=None, name=None, hostids=None, **kwargs):
'''
.. versionadded:: 2016.3.0
Retrieve hosts according to the given parameters
.. note::
This function accepts all optional host.get parameters: keyword
argument names differ depending on your zabbix version, see here__.
... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1226-L1273 | [
"def",
"host_get",
"(",
"host",
"=",
"None",
",",
"name",
"=",
"None",
",",
"hostids",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | host_update | .. versionadded:: 2016.3.0
Update existing hosts
.. note::
This function accepts all standard host and host.update properties:
keyword argument names differ depending on your zabbix version, see the
documentation for `host objects`_ and the documentation for `updating
hosts`_.
... | salt/modules/zabbix.py | def host_update(hostid, **kwargs):
'''
.. versionadded:: 2016.3.0
Update existing hosts
.. note::
This function accepts all standard host and host.update properties:
keyword argument names differ depending on your zabbix version, see the
documentation for `host objects`_ and th... | def host_update(hostid, **kwargs):
'''
.. versionadded:: 2016.3.0
Update existing hosts
.. note::
This function accepts all standard host and host.update properties:
keyword argument names differ depending on your zabbix version, see the
documentation for `host objects`_ and th... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1276-L1318 | [
"def",
"host_update",
"(",
"hostid",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'host.update'",
"params",
"=",
"{",
"\"hostid\... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | host_inventory_get | Retrieve host inventory according to the given parameters.
See: https://www.zabbix.com/documentation/2.4/manual/api/reference/host/object#host_inventory
.. versionadded:: 2019.2.0
:param hostids: Return only host interfaces used by the given hosts.
:param _connection_user: Optional - zabbix user (can ... | salt/modules/zabbix.py | def host_inventory_get(hostids, **kwargs):
'''
Retrieve host inventory according to the given parameters.
See: https://www.zabbix.com/documentation/2.4/manual/api/reference/host/object#host_inventory
.. versionadded:: 2019.2.0
:param hostids: Return only host interfaces used by the given hosts.
... | def host_inventory_get(hostids, **kwargs):
'''
Retrieve host inventory according to the given parameters.
See: https://www.zabbix.com/documentation/2.4/manual/api/reference/host/object#host_inventory
.. versionadded:: 2019.2.0
:param hostids: Return only host interfaces used by the given hosts.
... | [
"Retrieve",
"host",
"inventory",
"according",
"to",
"the",
"given",
"parameters",
".",
"See",
":",
"https",
":",
"//",
"www",
".",
"zabbix",
".",
"com",
"/",
"documentation",
"/",
"2",
".",
"4",
"/",
"manual",
"/",
"api",
"/",
"reference",
"/",
"host",... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1321-L1354 | [
"def",
"host_inventory_get",
"(",
"hostids",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'host.get'",
"params",
"=",
"{",
"\"se... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | host_inventory_set | Update host inventory items
NOTE: This function accepts all standard host: keyword argument names for inventory
see: https://www.zabbix.com/documentation/2.4/manual/api/reference/host/object#host_inventory
.. versionadded:: 2019.2.0
:param hostid: ID of the host to update
:param clear_old: Set to ... | salt/modules/zabbix.py | def host_inventory_set(hostid, **kwargs):
'''
Update host inventory items
NOTE: This function accepts all standard host: keyword argument names for inventory
see: https://www.zabbix.com/documentation/2.4/manual/api/reference/host/object#host_inventory
.. versionadded:: 2019.2.0
:param hostid: ... | def host_inventory_set(hostid, **kwargs):
'''
Update host inventory items
NOTE: This function accepts all standard host: keyword argument names for inventory
see: https://www.zabbix.com/documentation/2.4/manual/api/reference/host/object#host_inventory
.. versionadded:: 2019.2.0
:param hostid: ... | [
"Update",
"host",
"inventory",
"items",
"NOTE",
":",
"This",
"function",
"accepts",
"all",
"standard",
"host",
":",
"keyword",
"argument",
"names",
"for",
"inventory",
"see",
":",
"https",
":",
"//",
"www",
".",
"zabbix",
".",
"com",
"/",
"documentation",
... | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1357-L1409 | [
"def",
"host_inventory_set",
"(",
"hostid",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"params",
"=",
"{",
"}",
"clear_old",
"=",
"False",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | hostgroup_create | .. versionadded:: 2016.3.0
Create a host group
.. note::
This function accepts all standard host group properties: keyword
argument names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documentation/2.4/manual/api/reference/hostgroup/object#host_gro... | salt/modules/zabbix.py | def hostgroup_create(name, **kwargs):
'''
.. versionadded:: 2016.3.0
Create a host group
.. note::
This function accepts all standard host group properties: keyword
argument names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documentation/... | def hostgroup_create(name, **kwargs):
'''
.. versionadded:: 2016.3.0
Create a host group
.. note::
This function accepts all standard host group properties: keyword
argument names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documentation/... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1443-L1479 | [
"def",
"hostgroup_create",
"(",
"name",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'hostgroup.create'",
"params",
"=",
"{",
"\... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | hostgroup_delete | Delete the host group.
.. versionadded:: 2016.3.0
:param hostgroupids: IDs of the host groups to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pillar... | salt/modules/zabbix.py | def hostgroup_delete(hostgroupids, **kwargs):
'''
Delete the host group.
.. versionadded:: 2016.3.0
:param hostgroupids: IDs of the host groups to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Opt... | def hostgroup_delete(hostgroupids, **kwargs):
'''
Delete the host group.
.. versionadded:: 2016.3.0
:param hostgroupids: IDs of the host groups to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Opt... | [
"Delete",
"the",
"host",
"group",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1482-L1514 | [
"def",
"hostgroup_delete",
"(",
"hostgroupids",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'hostgroup.delete'",
"if",
"not",
"is... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | hostgroup_exists | Checks if at least one host group that matches the given filter criteria exists.
.. versionadded:: 2016.3.0
:param name: names of the host groups
:param groupid: host group IDs
:param node: name of the node the host groups must belong to (zabbix API < 2.4)
:param nodeids: IDs of the nodes the host... | salt/modules/zabbix.py | def hostgroup_exists(name=None, groupid=None, node=None, nodeids=None, **kwargs):
'''
Checks if at least one host group that matches the given filter criteria exists.
.. versionadded:: 2016.3.0
:param name: names of the host groups
:param groupid: host group IDs
:param node: name of the node t... | def hostgroup_exists(name=None, groupid=None, node=None, nodeids=None, **kwargs):
'''
Checks if at least one host group that matches the given filter criteria exists.
.. versionadded:: 2016.3.0
:param name: names of the host groups
:param groupid: host group IDs
:param node: name of the node t... | [
"Checks",
"if",
"at",
"least",
"one",
"host",
"group",
"that",
"matches",
"the",
"given",
"filter",
"criteria",
"exists",
"."
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1517-L1574 | [
"def",
"hostgroup_exists",
"(",
"name",
"=",
"None",
",",
"groupid",
"=",
"None",
",",
"node",
"=",
"None",
",",
"nodeids",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"zabbix_version",
"=... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | hostgroup_get | .. versionadded:: 2016.3.0
Retrieve host groups according to the given parameters
.. note::
This function accepts all standard hostgroup.get properities: keyword
argument names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documentation/2.2/manual/... | salt/modules/zabbix.py | def hostgroup_get(name=None, groupids=None, hostids=None, **kwargs):
'''
.. versionadded:: 2016.3.0
Retrieve host groups according to the given parameters
.. note::
This function accepts all standard hostgroup.get properities: keyword
argument names differ depending on your zabbix vers... | def hostgroup_get(name=None, groupids=None, hostids=None, **kwargs):
'''
.. versionadded:: 2016.3.0
Retrieve host groups according to the given parameters
.. note::
This function accepts all standard hostgroup.get properities: keyword
argument names differ depending on your zabbix vers... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1577-L1627 | [
"def",
"hostgroup_get",
"(",
"name",
"=",
"None",
",",
"groupids",
"=",
"None",
",",
"hostids",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"con... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | hostgroup_update | .. versionadded:: 2016.3.0
Update existing hosts group
.. note::
This function accepts all standard host group properties: keyword
argument names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documentation/2.4/manual/api/reference/hostgroup/object#... | salt/modules/zabbix.py | def hostgroup_update(groupid, name=None, **kwargs):
'''
.. versionadded:: 2016.3.0
Update existing hosts group
.. note::
This function accepts all standard host group properties: keyword
argument names differ depending on your zabbix version, see here__.
.. __: https://www.zab... | def hostgroup_update(groupid, name=None, **kwargs):
'''
.. versionadded:: 2016.3.0
Update existing hosts group
.. note::
This function accepts all standard host group properties: keyword
argument names differ depending on your zabbix version, see here__.
.. __: https://www.zab... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1630-L1669 | [
"def",
"hostgroup_update",
"(",
"groupid",
",",
"name",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'hostgroup.upd... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | hostinterface_create | .. versionadded:: 2016.3.0
Create new host interface
.. note::
This function accepts all standard host group interface: keyword
argument names differ depending on your zabbix version, see here__.
.. __: https://www.zabbix.com/documentation/3.0/manual/api/reference/hostinterface/object... | salt/modules/zabbix.py | def hostinterface_create(hostid, ip_, dns='', main=1, if_type=1, useip=1, port=None, **kwargs):
'''
.. versionadded:: 2016.3.0
Create new host interface
.. note::
This function accepts all standard host group interface: keyword
argument names differ depending on your zabbix version, se... | def hostinterface_create(hostid, ip_, dns='', main=1, if_type=1, useip=1, port=None, **kwargs):
'''
.. versionadded:: 2016.3.0
Create new host interface
.. note::
This function accepts all standard host group interface: keyword
argument names differ depending on your zabbix version, se... | [
"..",
"versionadded",
"::",
"2016",
".",
"3",
".",
"0"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1748-L1814 | [
"def",
"hostinterface_create",
"(",
"hostid",
",",
"ip_",
",",
"dns",
"=",
"''",
",",
"main",
"=",
"1",
",",
"if_type",
"=",
"1",
",",
"useip",
"=",
"1",
",",
"port",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"("... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
train | hostinterface_delete | Delete host interface
.. versionadded:: 2016.3.0
:param interfaceids: IDs of the host interfaces to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password (can also be set in opts or pil... | salt/modules/zabbix.py | def hostinterface_delete(interfaceids, **kwargs):
'''
Delete host interface
.. versionadded:: 2016.3.0
:param interfaceids: IDs of the host interfaces to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_passwo... | def hostinterface_delete(interfaceids, **kwargs):
'''
Delete host interface
.. versionadded:: 2016.3.0
:param interfaceids: IDs of the host interfaces to delete
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_passwo... | [
"Delete",
"host",
"interface"
] | saltstack/salt | python | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1817-L1849 | [
"def",
"hostinterface_delete",
"(",
"interfaceids",
",",
"*",
"*",
"kwargs",
")",
":",
"conn_args",
"=",
"_login",
"(",
"*",
"*",
"kwargs",
")",
"ret",
"=",
"{",
"}",
"try",
":",
"if",
"conn_args",
":",
"method",
"=",
"'hostinterface.delete'",
"if",
"isi... | e8541fd6e744ab0df786c0f76102e41631f45d46 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.