INSTRUCTION stringlengths 1 8.43k | RESPONSE stringlengths 75 104k |
|---|---|
SmartOS zone pkgsrc information | 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... |
Provide grains for SmartOS | def smartos():
'''
Provide grains for SmartOS
'''
grains = {}
if salt.utils.platform.is_smartos_zone():
grains = salt.utils.dictupdate.update(grains, _smartos_zone_data(), merge_lists=True)
grains = salt.utils.dictupdate.update(grains, _smartos_zone_pkgsrc_data(), merge_lists=True)
... |
Listen to salt events and forward them to Logentries | 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... |
Check if node is peered. | def peered(name):
'''
Check if node is peered.
name
The remote host with which to peer.
.. code-block:: yaml
peer-cluster:
glusterfs.peered:
- name: two
peer-clusters:
glusterfs.peered:
- names:
- one
- t... |
Ensure that the volume exists | 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... |
Check if volume has been started | def started(name):
'''
Check if volume has been started
name
name of the volume
.. code-block:: yaml
mycluster:
glusterfs.started: []
'''
ret = {'name': name,
'changes': {},
'comment': '',
'result': False}
volinfo = __salt__['glu... |
Add brick ( s ) to an existing volume | 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
... |
.. versionadded:: 2019. 2. 0 | 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 | 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... |
Get the requests options from salt. | 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... |
Simple function to return value from XML | 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) |
Post data to Nagios NRDP | 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,
... |
Send a message to Nagios with the data | 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')
... |
Return an influxdb client object | 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 data to a influxdb data store | 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... |
Save the load to the specified jid | 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... |
Return the load data that marks a specified jid | 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 information returned when the specified job id was executed | 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 a dict of the last function called for all minions | 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 list of all job ids | 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 minions | 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 the running jobs on the master | 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 a dict of JID metadata or None | 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
... |
This is a health check that will confirm the PID is running and executed by salt. | 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... |
Check a whitelist and/ or blacklist to see if the value matches it. | 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 |
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. | 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 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. | 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 cached mine data for the targeted minions. | 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... |
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... |
main loop that fires the event every second | 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... |
Gather currently connected minions and update the cache | 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... |
remove sockets on shutdown | 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... |
secure the sockets for root - only access | 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)
... |
shutdown cache process | 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() |
Main loop of the ConCache starts updates in intervals and answers requests from the MWorkers | 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)
... |
Return a response in an SMS message | 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... |
Returns: None if group wasn t found otherwise a group object | 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 ... |
Ensure group does not exist | 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']... |
Return a dict of the files located with the given path and environment | 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 all of the file paths found in an environment | 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 files names in all available environments | 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 |
Read the contents of a text file if the file is binary then | 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':
... |
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 | 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... |
.. versionadded:: 2019. 2. 0 | 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 | 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 | 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 | 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 | 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... |
Send an xmpp message with the data | 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')
... |
Combine the host header IP address and TCP port into bindingInformation format. | 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 |
Ensure the website has been deployed. | def deployed(name, sourcepath, apppool='', hostheader='', ipaddress='*', port=80, protocol='http', preload=''):
'''
Ensure the website has been deployed.
.. note:
This function only validates against the site name, and will return True even
if the site already exists with a different confi... |
Delete a website from IIS. | 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... |
Create an IIS binding. | def create_binding(name, site, hostheader='', ipaddress='*', port=80, protocol='http', sslflags=0):
'''
Create an IIS binding.
.. note:
This function only validates against the binding ipaddress:port:hostheader combination,
and will return True even if the binding already exists with a dif... |
Remove an IIS binding. | 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... |
Assign a certificate to an IIS binding. | def create_cert_binding(name, site, hostheader='', ipaddress='*', port=443, sslflags=0):
'''
Assign a certificate to an IIS binding.
.. note:
The web binding that the certificate is being assigned to must already exist.
:param str name: The thumbprint of the certificate.
:param str site: ... |
Remove a certificate from an IIS binding. | def remove_cert_binding(name, site, hostheader='', ipaddress='*', port=443):
'''
Remove a certificate from an IIS binding.
.. note:
This function only removes the certificate from the web binding. It does
not remove the web binding itself.
:param str name: The thumbprint of the certif... |
Create an IIS application pool. | 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... |
Remove an IIS application pool. | 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 = {... |
Set the value of the setting for an IIS container. | 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... |
Create an IIS application. | 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 ... |
Remove an IIS application. | 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
'''
... |
Create an IIS virtual directory. | 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 ... |
Remove an IIS virtual directory. | 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-... |
.. versionadded:: 2017. 7. 0 | 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... |
r Set the value of webconfiguration settings. | 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... |
Tries to guess the url of zabbix frontend. | 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 =... |
JSON request to Zabbix API. | 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... |
Log in to the API and generate the authentication token. | 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... |
Extends the params dictionary by values from keyword arguments. | 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... |
.. versionadded:: 2017. 7 | 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 | 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 | 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 ... |
Retrieve the version of the Zabbix API. | 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... |
.. versionadded:: 2016. 3. 0 | 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... |
Delete zabbix users. | 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... |
Checks if user with given alias exists. | def user_exists(alias, **kwargs):
'''
Checks if user with given alias exists.
.. versionadded:: 2016.3.0
:param alias: user alias
:param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)
:param _connection_password: Optional - zabbix password ... |
Retrieve users according to the given parameters. | 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... |
.. versionadded:: 2016. 3. 0 | 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 | 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__.
.. __: ... |
Add new media to multiple users. | 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 ... |
Delete media by id. | 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... |
.. versionadded:: 2016. 3. 0 | 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... |
Checks if at least one user group that matches the given filter criteria exists | def usergroup_exists(name=None, node=None, nodeids=None, **kwargs):
'''
Checks if at least one user group that matches the given filter criteria exists
.. versionadded:: 2016.3.0
:param name: names of the user groups
:param node: name of the node the user groups must belong to (This will override ... |
.. versionadded:: 2016. 3. 0 | 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 | 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... |
Retrieve all enabled user groups. | 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... |
.. versionadded:: 2016. 3. 0 | 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... |
Delete hosts. | 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... |
Checks if at least one host that matches the given filter criteria exists. | def host_exists(host=None, hostid=None, name=None, node=None, nodeids=None, **kwargs):
'''
Checks if at least one host that matches the given filter criteria exists.
.. versionadded:: 2016.3.0
:param host: technical name of the host
:param hostids: Hosts (hostids) to delete.
:param name: visib... |
.. versionadded:: 2016. 3. 0 | 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 | 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... |
Retrieve host inventory according to the given parameters. See: https:// www. zabbix. com/ documentation/ 2. 4/ manual/ api/ reference/ host/ object#host_inventory | 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.
... |
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 | 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: ... |
.. versionadded:: 2016. 3. 0 | 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/... |
Delete the host group. | 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... |
Checks if at least one host group that matches the given filter criteria exists. | def hostgroup_exists(name=None, groupid=None, node=None, nodeids=None, **kwargs):
'''
Checks if at least one host group that matches the given filter criteria exists.
.. versionadded:: 2016.3.0
:param name: names of the host groups
:param groupid: host group IDs
:param node: name of the node t... |
.. versionadded:: 2016. 3. 0 | 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 | 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 | 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... |
Delete host interface | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.