repository_name
stringclasses
316 values
func_path_in_repository
stringlengths
6
223
func_name
stringlengths
1
134
language
stringclasses
1 value
func_code_string
stringlengths
57
65.5k
func_documentation_string
stringlengths
1
46.3k
split_name
stringclasses
1 value
func_code_url
stringlengths
91
315
called_functions
listlengths
1
156
enclosing_scope
stringlengths
2
1.48M
saltstack/salt
salt/modules/zabbix.py
_frontend_url
python
def _frontend_url(): ''' Tries to guess the url of zabbix frontend. .. versionadded:: 2016.3.0 ''' hostname = socket.gethostname() frontend_url = 'http://' + hostname + '/zabbix/api_jsonrpc.php' try: try: response = salt.utils.http.query(frontend_url) error =...
Tries to guess the url of zabbix frontend. .. versionadded:: 2016.3.0
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L108-L127
null
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
_query
python
def _query(method, params, url, auth=None): ''' JSON request to Zabbix API. .. versionadded:: 2016.3.0 :param method: actual operation to perform via the API :param params: parameters required for specific method :param url: url of zabbix api :param auth: auth token for zabbix api (only fo...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L130-L177
[ "def dumps(obj, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.dumps, and assumes that ensure_ascii is False (unless explicitly\n passed as True) for unicode compatibility. Note that setting it to True\n will mess up any unicode characters, as they will be dumped as the string\n lite...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
_login
python
def _login(**kwargs): ''' Log in to the API and generate the authentication token. .. versionadded:: 2016.3.0 :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbix password (can also be set in opts...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L180-L240
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
_params_extend
python
def _params_extend(params, _ignore_name=False, **kwargs): ''' Extends the params dictionary by values from keyword arguments. .. versionadded:: 2016.3.0 :param params: Dictionary with parameters for zabbix API. :param _ignore_name: Salt State module is passing first line as 'name' parameter. If AP...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L243-L273
null
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
substitute_params
python
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 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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L287-L323
[ "def get_object_id_by_params(obj, params=None, **kwargs):\n '''\n .. versionadded:: 2017.7\n\n Get ID of single Zabbix object specified by its name.\n\n :param obj: Zabbix object type\n :param params: Parameters by which object is uniquely identified\n :param _connection_user: Optional - zabbix us...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
compare_params
python
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 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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L327-L402
null
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
get_object_id_by_params
python
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 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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L405-L427
[ "def run_query(method, params, **kwargs):\n '''\n Send Zabbix API call\n\n Args:\n method: actual operation to perform via the API\n params: parameters required for specific method\n\n optional kwargs:\n _connection_user: zabbix user (can also be set in opts or pillar, s...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
apiinfo_version
python
def apiinfo_version(**kwargs): ''' Retrieve the version of the Zabbix API. .. versionadded:: 2016.3.0 :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbix password (can also be set in opts or pill...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L430-L458
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
user_create
python
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 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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L461-L509
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
user_delete
python
def user_delete(users, **kwargs): ''' Delete zabbix users. .. versionadded:: 2016.3.0 :param users: array of users (userids) to delete :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbix pass...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L512-L545
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
user_exists
python
def user_exists(alias, **kwargs): ''' Checks if user with given alias exists. .. versionadded:: 2016.3.0 :param alias: user alias :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbix password ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L548-L577
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
user_get
python
def user_get(alias=None, userids=None, **kwargs): ''' Retrieve users according to the given parameters. .. versionadded:: 2016.3.0 :param alias: user alias :param userids: return only users with the given IDs :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, s...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L580-L617
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
user_update
python
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 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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L620-L656
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
user_getmedia
python
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 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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L659-L699
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
user_addmedia
python
def user_addmedia(userids, active, mediatypeid, period, sendto, severity, **kwargs): ''' Add new media to multiple users. .. versionadded:: 2016.3.0 :param userids: ID of the user that uses the media :param active: Whether the media is enabled (0 enabled, 1 disabled) :param mediatypeid: ID of ...
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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L702-L747
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
user_deletemedia
python
def user_deletemedia(mediaids, **kwargs): ''' Delete media by id. .. versionadded:: 2016.3.0 :param mediaids: IDs of the media to delete :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbix pa...
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'...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L750-L782
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
usergroup_delete
python
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 :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) ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L855-L885
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
usergroup_exists
python
def usergroup_exists(name=None, node=None, nodeids=None, **kwargs): ''' Checks if at least one user group that matches the given filter criteria exists .. versionadded:: 2016.3.0 :param name: names of the user groups :param node: name of the node the user groups must belong to (This will override ...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L888-L940
[ "def _login(**kwargs):\n '''\n Log in to the API and generate the authentication token.\n\n .. versionadded:: 2016.3.0\n\n :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)\n :param _connection_password: Optional - zabbix password (can also be...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
usergroup_get
python
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 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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L943-L995
[ "def _login(**kwargs):\n '''\n Log in to the API and generate the authentication token.\n\n .. versionadded:: 2016.3.0\n\n :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)\n :param _connection_password: Optional - zabbix password (can also be...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
usergroup_update
python
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 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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L998-L1034
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
usergroup_list
python
def usergroup_list(**kwargs): ''' Retrieve all enabled user groups. .. versionadded:: 2016.3.0 :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1037-L1065
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
host_create
python
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 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: ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1068-L1123
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
host_delete
python
def host_delete(hostids, **kwargs): ''' Delete hosts. .. versionadded:: 2016.3.0 :param hostids: Hosts (hostids) to delete. :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbix password (can a...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1126-L1158
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
host_exists
python
def host_exists(host=None, hostid=None, name=None, node=None, nodeids=None, **kwargs): ''' Checks if at least one host that matches the given filter criteria exists. .. versionadded:: 2016.3.0 :param host: technical name of the host :param hostids: Hosts (hostids) to delete. :param name: visib...
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) ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1161-L1223
[ "def _login(**kwargs):\n '''\n Log in to the API and generate the authentication token.\n\n .. versionadded:: 2016.3.0\n\n :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)\n :param _connection_password: Optional - zabbix password (can also be...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
host_get
python
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 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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1226-L1273
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
host_update
python
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 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`_. ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1276-L1318
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
host_inventory_get
python
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/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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1321-L1354
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
host_inventory_set
python
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/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 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1357-L1409
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
hostgroup_create
python
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 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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1443-L1479
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
hostgroup_delete
python
def hostgroup_delete(hostgroupids, **kwargs): ''' Delete the host group. .. versionadded:: 2016.3.0 :param hostgroupids: IDs of the host groups to delete :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Opt...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1482-L1514
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
hostgroup_exists
python
def hostgroup_exists(name=None, groupid=None, node=None, nodeids=None, **kwargs): ''' Checks if at least one host group that matches the given filter criteria exists. .. versionadded:: 2016.3.0 :param name: names of the host groups :param groupid: host group IDs :param node: name of the node t...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1517-L1574
[ "def _login(**kwargs):\n '''\n Log in to the API and generate the authentication token.\n\n .. versionadded:: 2016.3.0\n\n :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring)\n :param _connection_password: Optional - zabbix password (can also be...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
hostgroup_get
python
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 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/...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1577-L1627
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
hostgroup_update
python
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 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#...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1630-L1669
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
hostinterface_create
python
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 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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1748-L1814
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
hostinterface_delete
python
def hostinterface_delete(interfaceids, **kwargs): ''' Delete host interface .. versionadded:: 2016.3.0 :param interfaceids: IDs of the host interfaces to delete :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_passwo...
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...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1817-L1849
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
hostinterface_update
python
def hostinterface_update(interfaceid, **kwargs): ''' .. versionadded:: 2016.3.0 Update host interface .. note:: This function accepts all standard hostinterface: keyword argument names differ depending on your zabbix version, see here__. .. __: https://www.zabbix.com/documenta...
.. versionadded:: 2016.3.0 Update host interface .. note:: This function accepts all standard hostinterface: keyword argument names differ depending on your zabbix version, see here__. .. __: https://www.zabbix.com/documentation/2.4/manual/api/reference/hostinterface/object#host_inter...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1852-L1891
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
usermacro_get
python
def usermacro_get(macro=None, hostids=None, templateids=None, hostmacroids=None, globalmacroids=None, globalmacro=False, **kwargs): ''' Retrieve user macros according to the given parameters. Args: macro: name of the usermacro hostids: Return macros for the...
Retrieve user macros according to the given parameters. Args: macro: name of the usermacro hostids: Return macros for the given hostids templateids: Return macros for the given templateids hostmacroids: Return macros with the given hostmacroids globalmac...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1894-L1951
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
usermacro_create
python
def usermacro_create(macro, value, hostid, **kwargs): ''' Create new host usermacro. :param macro: name of the host usermacro :param value: value of the host usermacro :param hostid: hostid or templateid :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see mod...
Create new host usermacro. :param macro: name of the host usermacro :param value: value of the host usermacro :param hostid: hostid or templateid :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbi...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L1954-L1994
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
usermacro_delete
python
def usermacro_delete(macroids, **kwargs): ''' Delete host usermacros. :param macroids: macroids of the host usermacros :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbix password (can also be se...
Delete host usermacros. :param macroids: macroids of the host usermacros :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbix password (can also be set in opts or pillar, see module's docstring) :para...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2038-L2070
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
usermacro_update
python
def usermacro_update(hostmacroid, value, **kwargs): ''' Update existing host usermacro. :param hostmacroid: id of the host usermacro :param value: new value of the host usermacro :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _...
Update existing host usermacro. :param hostmacroid: id of the host usermacro :param value: new value of the host usermacro :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbix password (can also be set...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2108-L2140
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
usermacro_updateglobal
python
def usermacro_updateglobal(globalmacroid, value, **kwargs): ''' Update existing global usermacro. :param globalmacroid: id of the host usermacro :param value: new value of the host usermacro :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) ...
Update existing global usermacro. :param globalmacroid: id of the host usermacro :param value: new value of the host usermacro :param _connection_user: Optional - zabbix user (can also be set in opts or pillar, see module's docstring) :param _connection_password: Optional - zabbix password (can also be...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2143-L2175
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
mediatype_get
python
def mediatype_get(name=None, mediatypeids=None, **kwargs): ''' Retrieve mediatypes according to the given parameters. Args: name: Name or description of the mediatype mediatypeids: ids of the mediatypes optional kwargs: _connection_user: zabbix user (can als...
Retrieve mediatypes according to the given parameters. Args: name: Name or description of the mediatype mediatypeids: ids of the mediatypes optional kwargs: _connection_user: zabbix user (can also be set in opts or pillar, see module's docstring) _co...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2178-L2220
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
mediatype_create
python
def mediatype_create(name, mediatype, **kwargs): ''' Create new mediatype .. note:: This function accepts all standard mediatype properties: keyword argument names differ depending on your zabbix version, see here__. .. __: https://www.zabbix.com/documentation/3.0/manual/api/refere...
Create new mediatype .. note:: This function accepts all standard mediatype properties: keyword argument names differ depending on your zabbix version, see here__. .. __: https://www.zabbix.com/documentation/3.0/manual/api/reference/mediatype/object :param mediatype: media type - 0: e...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2223-L2268
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
mediatype_delete
python
def mediatype_delete(mediatypeids, **kwargs): ''' Delete mediatype :param interfaceids: IDs of the mediatypes 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 s...
Delete mediatype :param interfaceids: IDs of the mediatypes 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) :param _...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2271-L2302
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
mediatype_update
python
def mediatype_update(mediatypeid, name=False, mediatype=False, **kwargs): ''' Update existing mediatype .. note:: This function accepts all standard mediatype properties: keyword argument names differ depending on your zabbix version, see here__. .. __: https://www.zabbix.com/docum...
Update existing mediatype .. note:: This function accepts all standard mediatype properties: keyword argument names differ depending on your zabbix version, see here__. .. __: https://www.zabbix.com/documentation/3.0/manual/api/reference/mediatype/object :param mediatypeid: ID of the ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2305-L2343
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
template_get
python
def template_get(name=None, host=None, templateids=None, **kwargs): ''' Retrieve templates according to the given parameters. Args: host: technical name of the template name: visible name of the template hostids: ids of the templates optional kwargs: _connec...
Retrieve templates according to the given parameters. Args: host: technical name of the template name: visible name of the template hostids: ids of the templates optional kwargs: _connection_user: zabbix user (can also be set in opts or pillar, see module's docstrin...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2346-L2391
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
run_query
python
def run_query(method, params, **kwargs): ''' Send Zabbix API call Args: method: actual operation to perform via the API params: parameters required for specific method optional kwargs: _connection_user: zabbix user (can also be set in opts or pillar, see module's do...
Send Zabbix API call Args: method: actual operation to perform via the API params: parameters required for specific method optional kwargs: _connection_user: zabbix user (can also be set in opts or pillar, see module's docstring) _connection_password: zabbix...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2394-L2433
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
configuration_import
python
def configuration_import(config_file, rules=None, file_format='xml', **kwargs): ''' .. versionadded:: 2017.7 Imports Zabbix configuration specified in file to Zabbix server. :param config_file: File with Zabbix config (local or remote) :param rules: Optional - Rules that have to be different from ...
.. versionadded:: 2017.7 Imports Zabbix configuration specified in file to Zabbix server. :param config_file: File with Zabbix config (local or remote) :param rules: Optional - Rules that have to be different from default (defaults are the same as in Zabbix web UI.) :param file_format: Config file for...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2436-L2505
[ "def mkstemp(*args, **kwargs):\n '''\n Helper function which does exactly what ``tempfile.mkstemp()`` does but\n accepts another argument, ``close_fd``, which, by default, is true and closes\n the fd before returning the file path. Something commonly done throughout\n Salt's code.\n '''\n if 'p...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
triggerid_get
python
def triggerid_get(hostid=None, trigger_desc=None, priority=4, **kwargs): ''' .. versionadded:: Fluorine Retrieve trigger ID and description based in host ID and trigger description. .. note:: https://www.zabbix.com/documentation/3.4/manual/api/reference/trigger/get :param hostid: ID of th...
.. versionadded:: Fluorine Retrieve trigger ID and description based in host ID and trigger description. .. note:: https://www.zabbix.com/documentation/3.4/manual/api/reference/trigger/get :param hostid: ID of the host whose trigger we want to find :param trigger_desc: Description of trigger ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2508-L2554
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
service_add
python
def service_add(service_rootid=None, service_name=None, triggerid=None, **kwargs): ''' .. versionadded:: Fluorine Create service under service with id specified as parameter. .. note:: https://www.zabbix.com/documentation/3.4/manual/api/reference/service/create :param service_rootid: Serv...
.. versionadded:: Fluorine Create service under service with id specified as parameter. .. note:: https://www.zabbix.com/documentation/3.4/manual/api/reference/service/create :param service_rootid: Service id under which service should be added :param service_name: Name of new service :pa...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2557-L2603
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
service_get
python
def service_get(service_name=None, service_rootid=None, **kwargs): ''' .. versionadded:: Fluorine Get service according to name and parent service ID. .. note:: https://www.zabbix.com/documentation/3.4/manual/api/reference/service/get :param service_name: Name of the service :param se...
.. versionadded:: Fluorine Get service according to name and parent service ID. .. note:: https://www.zabbix.com/documentation/3.4/manual/api/reference/service/get :param service_name: Name of the service :param service_rootid: ID of service parent :param _connection_user: Optional - zab...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2606-L2647
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/modules/zabbix.py
service_delete
python
def service_delete(service_id=None, **kwargs): ''' .. versionadded:: Fluorine Delete service specified by id. .. note:: https://www.zabbix.com/documentation/3.4/manual/api/reference/service/delete :param service_id: ID of service which should be deleted .. note:: Service can'...
.. versionadded:: Fluorine Delete service specified by id. .. note:: https://www.zabbix.com/documentation/3.4/manual/api/reference/service/delete :param service_id: ID of service which should be deleted .. note:: Service can't be deleted if it has any children. :param _connectio...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/zabbix.py#L2650-L2689
[ "def _query(method, params, url, auth=None):\n '''\n JSON request to Zabbix API.\n\n .. versionadded:: 2016.3.0\n\n :param method: actual operation to perform via the API\n :param params: parameters required for specific method\n :param url: url of zabbix api\n :param auth: auth token for zabbi...
# -*- coding: utf-8 -*- ''' Support for Zabbix :optdepends: - zabbix server :configuration: This module is not usable until the zabbix user and zabbix password are specified either in a pillar or in the minion's config file. Zabbix url should be also specified. .. code-block:: yaml zabbix.user: A...
saltstack/salt
salt/states/lxd_container.py
present
python
def present(name, running=None, source=None, profiles=None, config=None, devices=None, architecture='x86_64', ephemeral=False, restart_on_change=False, remote_addr=None, cert=None, key=Non...
Create the named container if it does not exist name The name of the container to be created running : None * If ``True``, ensure that the container is running * If ``False``, ensure that the container is stopped * If ``None``, do nothing with regards to the running state of th...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lxd_container.py#L57-L360
[ "def _error(ret, err_msg):\n ret['result'] = False\n ret['comment'] = err_msg\n if 'changes' not in ret:\n ret['changes'] = {}\n return ret\n", "def _unchanged(ret, msg):\n ret['result'] = None\n ret['comment'] = msg\n if 'changes' not in ret:\n ret['changes'] = {}\n return r...
# -*- coding: utf-8 -*- ''' Manage LXD containers. .. versionadded:: 2019.2.0 .. note: - `pylxd`_ version 2 is required to let this work, currently only available via pip. To install on Ubuntu: $ apt-get install libssl-dev python-pip $ pip install -U pylxd - you need lxd inst...
saltstack/salt
salt/states/lxd_container.py
absent
python
def absent(name, stop=False, remote_addr=None, cert=None, key=None, verify_cert=True): ''' Ensure a LXD container is not present, destroying it if present name : The name of the container to destroy stop : stop before destroying ...
Ensure a LXD container is not present, destroying it if present name : The name of the container to destroy stop : stop before destroying default: false remote_addr : An URL to a remote Server, you also have to give cert and key if you provide remote_addr! ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lxd_container.py#L363-L440
[ "def _error(ret, err_msg):\n ret['result'] = False\n ret['comment'] = err_msg\n if 'changes' not in ret:\n ret['changes'] = {}\n return ret\n", "def _unchanged(ret, msg):\n ret['result'] = None\n ret['comment'] = msg\n if 'changes' not in ret:\n ret['changes'] = {}\n return r...
# -*- coding: utf-8 -*- ''' Manage LXD containers. .. versionadded:: 2019.2.0 .. note: - `pylxd`_ version 2 is required to let this work, currently only available via pip. To install on Ubuntu: $ apt-get install libssl-dev python-pip $ pip install -U pylxd - you need lxd inst...
saltstack/salt
salt/states/lxd_container.py
running
python
def running(name, restart=False, remote_addr=None, cert=None, key=None, verify_cert=True): ''' Ensure a LXD container is running and restart it if restart is True name : The name of the container to start/restart. restart : re...
Ensure a LXD container is running and restart it if restart is True name : The name of the container to start/restart. restart : restart the container if it is already started. remote_addr : An URL to a remote Server, you also have to give cert and key if you provide remot...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lxd_container.py#L443-L536
[ "def _error(ret, err_msg):\n ret['result'] = False\n ret['comment'] = err_msg\n if 'changes' not in ret:\n ret['changes'] = {}\n return ret\n", "def _unchanged(ret, msg):\n ret['result'] = None\n ret['comment'] = msg\n if 'changes' not in ret:\n ret['changes'] = {}\n return r...
# -*- coding: utf-8 -*- ''' Manage LXD containers. .. versionadded:: 2019.2.0 .. note: - `pylxd`_ version 2 is required to let this work, currently only available via pip. To install on Ubuntu: $ apt-get install libssl-dev python-pip $ pip install -U pylxd - you need lxd inst...
saltstack/salt
salt/states/lxd_container.py
stopped
python
def stopped(name, kill=False, remote_addr=None, cert=None, key=None, verify_cert=True): ''' Ensure a LXD container is stopped, kill it if kill is true else stop it name : The name of the container to stop kill : kill if true ...
Ensure a LXD container is stopped, kill it if kill is true else stop it name : The name of the container to stop kill : kill if true remote_addr : An URL to a remote Server, you also have to give cert and key if you provide remote_addr! Examples: https...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lxd_container.py#L640-L713
[ "def _error(ret, err_msg):\n ret['result'] = False\n ret['comment'] = err_msg\n if 'changes' not in ret:\n ret['changes'] = {}\n return ret\n", "def _unchanged(ret, msg):\n ret['result'] = None\n ret['comment'] = msg\n if 'changes' not in ret:\n ret['changes'] = {}\n return r...
# -*- coding: utf-8 -*- ''' Manage LXD containers. .. versionadded:: 2019.2.0 .. note: - `pylxd`_ version 2 is required to let this work, currently only available via pip. To install on Ubuntu: $ apt-get install libssl-dev python-pip $ pip install -U pylxd - you need lxd inst...
saltstack/salt
salt/states/lxd_container.py
migrated
python
def migrated(name, remote_addr, cert, key, verify_cert, src_remote_addr, stop_and_start=False, src_cert=None, src_key=None, src_verify_cert=None): ''' Ensure a container is migrated to another host ...
Ensure a container is migrated to another host If the container is running, it either must be shut down first (use stop_and_start=True) or criu must be installed on the source and destination machines. For this operation both certs need to be authenticated, use :mod:`lxd.authenticate <salt.states....
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lxd_container.py#L716-L852
[ "def _error(ret, err_msg):\n ret['result'] = False\n ret['comment'] = err_msg\n if 'changes' not in ret:\n ret['changes'] = {}\n return ret\n", "def _unchanged(ret, msg):\n ret['result'] = None\n ret['comment'] = msg\n if 'changes' not in ret:\n ret['changes'] = {}\n return r...
# -*- coding: utf-8 -*- ''' Manage LXD containers. .. versionadded:: 2019.2.0 .. note: - `pylxd`_ version 2 is required to let this work, currently only available via pip. To install on Ubuntu: $ apt-get install libssl-dev python-pip $ pip install -U pylxd - you need lxd inst...
saltstack/salt
salt/modules/bcache.py
uuid
python
def uuid(dev=None): ''' Return the bcache UUID of a block device. If no device is given, the Cache UUID is returned. CLI example: .. code-block:: bash salt '*' bcache.uuid salt '*' bcache.uuid /dev/sda salt '*' bcache.uuid bcache0 ''' try: if dev is None: ...
Return the bcache UUID of a block device. If no device is given, the Cache UUID is returned. CLI example: .. code-block:: bash salt '*' bcache.uuid salt '*' bcache.uuid /dev/sda salt '*' bcache.uuid bcache0
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L57-L79
[ "def os_walk(top, *args, **kwargs):\n '''\n This is a helper than ensures that all paths returned from os.walk are\n unicode.\n '''\n if six.PY2 and salt.utils.platform.is_windows():\n top_query = top\n else:\n top_query = salt.utils.stringutils.to_str(top)\n for item in os.walk(t...
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
attach_
python
def attach_(dev=None): ''' Attach a backing devices to a cache set If no dev is given, all backing devices will be attached. CLI example: .. code-block:: bash salt '*' bcache.attach sdc salt '*' bcache.attach /dev/bcache1 :return: bool or None if nuttin' happened ''' ...
Attach a backing devices to a cache set If no dev is given, all backing devices will be attached. CLI example: .. code-block:: bash salt '*' bcache.attach sdc salt '*' bcache.attach /dev/bcache1 :return: bool or None if nuttin' happened
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L82-L125
[ "def detach(dev=None):\n '''\n Detach a backing device(s) from a cache set\n If no dev is given, all backing devices will be attached.\n\n Detaching a backing device will flush it's write cache.\n This should leave the underlying device in a consistent state, but might take a while.\n\n CLI exampl...
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
detach
python
def detach(dev=None): ''' Detach a backing device(s) from a cache set If no dev is given, all backing devices will be attached. Detaching a backing device will flush it's write cache. This should leave the underlying device in a consistent state, but might take a while. CLI example: .. co...
Detach a backing device(s) from a cache set If no dev is given, all backing devices will be attached. Detaching a backing device will flush it's write cache. This should leave the underlying device in a consistent state, but might take a while. CLI example: .. code-block:: bash salt '*' ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L128-L155
[ "def detach(dev=None):\n '''\n Detach a backing device(s) from a cache set\n If no dev is given, all backing devices will be attached.\n\n Detaching a backing device will flush it's write cache.\n This should leave the underlying device in a consistent state, but might take a while.\n\n CLI exampl...
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
stop
python
def stop(dev=None): ''' Stop a bcache device If no device is given, all backing devices will be detached from the cache, which will subsequently be stopped. .. warning:: 'Stop' on an individual backing device means hard-stop; no attempt at flushing will be done and the bcache device wil...
Stop a bcache device If no device is given, all backing devices will be detached from the cache, which will subsequently be stopped. .. warning:: 'Stop' on an individual backing device means hard-stop; no attempt at flushing will be done and the bcache device will seemingly 'disappear' from the...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L176-L208
[ "def detach(dev=None):\n '''\n Detach a backing device(s) from a cache set\n If no dev is given, all backing devices will be attached.\n\n Detaching a backing device will flush it's write cache.\n This should leave the underlying device in a consistent state, but might take a while.\n\n CLI exampl...
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
back_make
python
def back_make(dev, cache_mode='writeback', force=False, attach=True, bucket_size=None): ''' Create a backing device for attachment to a set. Because the block size must be the same, a cache set already needs to exist. CLI example: .. code-block:: bash salt '*' bcache.back_make sdc cache_m...
Create a backing device for attachment to a set. Because the block size must be the same, a cache set already needs to exist. CLI example: .. code-block:: bash salt '*' bcache.back_make sdc cache_mode=writeback attach=True :param cache_mode: writethrough, writeback, writearound or none. ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L211-L264
[ "def uuid(dev=None):\n '''\n Return the bcache UUID of a block device.\n If no device is given, the Cache UUID is returned.\n\n CLI example:\n\n .. code-block:: bash\n\n salt '*' bcache.uuid\n salt '*' bcache.uuid /dev/sda\n salt '*' bcache.uuid bcache0\n\n '''\n try:\n ...
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
cache_make
python
def cache_make(dev, reserved=None, force=False, block_size=None, bucket_size=None, attach=True): ''' Create BCache cache on a block device. If blkdiscard is available the entire device will be properly cleared in advance. CLI example: .. code-block:: bash salt '*' bcache.cache_make sdb re...
Create BCache cache on a block device. If blkdiscard is available the entire device will be properly cleared in advance. CLI example: .. code-block:: bash salt '*' bcache.cache_make sdb reserved=10% block_size=4096 :param reserved: if dev is a full device, create a partition table with this...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L267-L357
[ "def stop(dev=None):\n '''\n Stop a bcache device\n If no device is given, all backing devices will be detached from the cache, which will subsequently be stopped.\n\n .. warning::\n 'Stop' on an individual backing device means hard-stop;\n no attempt at flushing will be done and the bcach...
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
config_
python
def config_(dev=None, **kwargs): ''' Show or update config of a bcache device. If no device is given, operate on the cache set itself. CLI example: .. code-block:: bash salt '*' bcache.config salt '*' bcache.config bcache1 salt '*' bcache.config errors=panic journal_delay...
Show or update config of a bcache device. If no device is given, operate on the cache set itself. CLI example: .. code-block:: bash salt '*' bcache.config salt '*' bcache.config bcache1 salt '*' bcache.config errors=panic journal_delay_ms=150 salt '*' bcache.config bcache...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L360-L401
[ "def _sysfs_attr(name, value=None, log_lvl=None, log_msg=None):\n '''\n Simple wrapper with logging around sysfs.attr\n '''\n if isinstance(name, six.string_types):\n name = [name]\n res = __salt__['sysfs.attr'](os.path.join(*name), value)\n if not res and log_lvl is not None and log_msg is...
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
status
python
def status(stats=False, config=False, internals=False, superblock=False, alldevs=False): ''' Show the full status of the BCache system and optionally all it's involved devices CLI example: .. code-block:: bash salt '*' bcache.status salt '*' bcache.status stats=True salt '*' b...
Show the full status of the BCache system and optionally all it's involved devices CLI example: .. code-block:: bash salt '*' bcache.status salt '*' bcache.status stats=True salt '*' bcache.status internals=True alldevs=True :param stats: include statistics :param config: inc...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L404-L448
[ "def os_walk(top, *args, **kwargs):\n '''\n This is a helper than ensures that all paths returned from os.walk are\n unicode.\n '''\n if six.PY2 and salt.utils.platform.is_windows():\n top_query = top\n else:\n top_query = salt.utils.stringutils.to_str(top)\n for item in os.walk(t...
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
device
python
def device(dev, stats=False, config=False, internals=False, superblock=False): ''' Check the state of a single bcache device CLI example: .. code-block:: bash salt '*' bcache.device bcache0 salt '*' bcache.device /dev/sdc stats=True :param stats: include statistics :param set...
Check the state of a single bcache device CLI example: .. code-block:: bash salt '*' bcache.device bcache0 salt '*' bcache.device /dev/sdc stats=True :param stats: include statistics :param settings: include all settings :param internals: include all internals :param superblo...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L451-L561
[ "def uuid(dev=None):\n '''\n Return the bcache UUID of a block device.\n If no device is given, the Cache UUID is returned.\n\n CLI example:\n\n .. code-block:: bash\n\n salt '*' bcache.uuid\n salt '*' bcache.uuid /dev/sda\n salt '*' bcache.uuid bcache0\n\n '''\n try:\n ...
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
super_
python
def super_(dev): ''' Read out BCache SuperBlock CLI example: .. code-block:: bash salt '*' bcache.device bcache0 salt '*' bcache.device /dev/sdc ''' dev = _devpath(dev) ret = {} res = _run_all('bcache-super-show {0}'.format(dev), 'error', 'Error reading superblock on...
Read out BCache SuperBlock CLI example: .. code-block:: bash salt '*' bcache.device bcache0 salt '*' bcache.device /dev/sdc
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L564-L619
[ "def _run_all(cmd, log_lvl=None, log_msg=None, exitcode=0):\n '''\n Simple wrapper around cmd.run_all\n log_msg can contain {0} for stderr\n :return: True or stdout, False if retcode wasn't exitcode\n '''\n res = __salt__['cmd.run_all'](cmd)\n if res['retcode'] == exitcode:\n if res['std...
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
_devbase
python
def _devbase(dev): ''' Basename of just about any dev ''' dev = os.path.realpath(os.path.expandvars(dev)) dev = os.path.basename(dev) return dev
Basename of just about any dev
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L624-L630
null
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
_syspath
python
def _syspath(dev): ''' Full SysFS path of a device ''' dev = _devbase(dev) dev = re.sub(r'^([vhs][a-z]+)([0-9]+)', r'\1/\1\2', dev) # name = re.sub(r'^([a-z]+)(?<!(bcache|md|dm))([0-9]+)', r'\1/\1\2', name) return os.path.join('/sys/block/', dev)
Full SysFS path of a device
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L641-L649
[ "def _devbase(dev):\n '''\n Basename of just about any dev\n '''\n dev = os.path.realpath(os.path.expandvars(dev))\n dev = os.path.basename(dev)\n return dev\n" ]
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
_bdev
python
def _bdev(dev=None): ''' Resolve a bcacheX or cache to a real dev :return: basename of bcache dev ''' if dev is None: dev = _fssys('cache0') else: dev = _bcpath(dev) if not dev: return False else: return _devbase(os.path.dirname(dev))
Resolve a bcacheX or cache to a real dev :return: basename of bcache dev
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L652-L665
[ "def _fssys(name, value=None, log_lvl=None, log_msg=None):\n '''\n Simple wrapper to interface with bcache SysFS\n '''\n fspath = _fspath()\n if not fspath:\n return False\n else:\n return _sysfs_attr([fspath, name], value, log_lvl, log_msg)\n", "def _devbase(dev):\n '''\n Ba...
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
_fssys
python
def _fssys(name, value=None, log_lvl=None, log_msg=None): ''' Simple wrapper to interface with bcache SysFS ''' fspath = _fspath() if not fspath: return False else: return _sysfs_attr([fspath, name], value, log_lvl, log_msg)
Simple wrapper to interface with bcache SysFS
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L686-L694
[ "def _sysfs_attr(name, value=None, log_lvl=None, log_msg=None):\n '''\n Simple wrapper with logging around sysfs.attr\n '''\n if isinstance(name, six.string_types):\n name = [name]\n res = __salt__['sysfs.attr'](os.path.join(*name), value)\n if not res and log_lvl is not None and log_msg is...
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
_bcsys
python
def _bcsys(dev, name, value=None, log_lvl=None, log_msg=None): ''' Simple wrapper to interface with backing devs SysFS ''' return _sysfs_attr([_bcpath(dev), name], value, log_lvl, log_msg)
Simple wrapper to interface with backing devs SysFS
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L697-L701
[ "def _sysfs_attr(name, value=None, log_lvl=None, log_msg=None):\n '''\n Simple wrapper with logging around sysfs.attr\n '''\n if isinstance(name, six.string_types):\n name = [name]\n res = __salt__['sysfs.attr'](os.path.join(*name), value)\n if not res and log_lvl is not None and log_msg is...
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
_sysfs_attr
python
def _sysfs_attr(name, value=None, log_lvl=None, log_msg=None): ''' Simple wrapper with logging around sysfs.attr ''' if isinstance(name, six.string_types): name = [name] res = __salt__['sysfs.attr'](os.path.join(*name), value) if not res and log_lvl is not None and log_msg is not None: ...
Simple wrapper with logging around sysfs.attr
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L704-L713
null
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
_sysfs_parse
python
def _sysfs_parse(path, base_attr=None, stats=False, config=False, internals=False, options=False): ''' Helper function for parsing BCache's SysFS interface ''' result = {} # ---------------- Parse through the interfaces list ---------------- intfs = __salt__['sysfs.interfaces'](path) # Act...
Helper function for parsing BCache's SysFS interface
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L716-L826
null
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
_size_map
python
def _size_map(size): ''' Map Bcache's size strings to real bytes ''' try: # I know, I know, EAFP. # But everything else is reason for None if not isinstance(size, int): if re.search(r'[Kk]', size): size = 1024 * float(re.sub(r'[Kk]', '', size)) ...
Map Bcache's size strings to real bytes
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L829-L844
null
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
_sizes
python
def _sizes(dev): ''' Return neigh useless sizing info about a blockdev :return: (total size in blocks, blocksize, maximum discard size in bytes) ''' dev = _devbase(dev) # standarization yay block_sizes = ('hw_sector_size', 'minimum_io_size', 'physical_block_size', 'logical_block_size') ...
Return neigh useless sizing info about a blockdev :return: (total size in blocks, blocksize, maximum discard size in bytes)
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L847-L878
[ "def _devbase(dev):\n '''\n Basename of just about any dev\n '''\n dev = os.path.realpath(os.path.expandvars(dev))\n dev = os.path.basename(dev)\n return dev\n", "def _syspath(dev):\n '''\n Full SysFS path of a device\n '''\n dev = _devbase(dev)\n dev = re.sub(r'^([vhs][a-z]+)([0-...
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
_wipe
python
def _wipe(dev): ''' REALLY DESTRUCTIVE STUFF RIGHT AHEAD ''' endres = 0 dev = _devbase(dev) size, block, discard = _sizes(dev) if discard is None: log.error('Unable to read SysFS props for %s', dev) return None elif not discard: log.warning('%s seems unable to d...
REALLY DESTRUCTIVE STUFF RIGHT AHEAD
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L881-L918
[ "def _sizes(dev):\n '''\n Return neigh useless sizing info about a blockdev\n :return: (total size in blocks, blocksize, maximum discard size in bytes)\n '''\n dev = _devbase(dev)\n\n # standarization yay\n block_sizes = ('hw_sector_size', 'minimum_io_size', 'physical_block_size', 'logical_bloc...
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
_wait
python
def _wait(lfunc, log_lvl=None, log_msg=None, tries=10): ''' Wait for lfunc to be True :return: True if lfunc succeeded within tries, False if it didn't ''' i = 0 while i < tries: time.sleep(1) if lfunc(): return True else: i += 1 if log_lvl is...
Wait for lfunc to be True :return: True if lfunc succeeded within tries, False if it didn't
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L921-L936
[ "return _wait(lambda: uuid(dev) == cache,\n", "return _wait(lambda: uuid(dev) is False, 'error', '{0} received detach, but did not comply'.format(dev), 300)\n", "elif not _wait(lambda: uuid() is not False, 'warn', 'Bcache system started, but no active cache set found.'):\n", "elif not _wait(lambda: _sysfs_att...
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/bcache.py
_run_all
python
def _run_all(cmd, log_lvl=None, log_msg=None, exitcode=0): ''' Simple wrapper around cmd.run_all log_msg can contain {0} for stderr :return: True or stdout, False if retcode wasn't exitcode ''' res = __salt__['cmd.run_all'](cmd) if res['retcode'] == exitcode: if res['stdout']: ...
Simple wrapper around cmd.run_all log_msg can contain {0} for stderr :return: True or stdout, False if retcode wasn't exitcode
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bcache.py#L939-L954
null
# -*- coding: utf-8 -*- ''' Module for managing BCache sets BCache is a block-level caching mechanism similar to ZFS L2ARC/ZIL, dm-cache and fscache. It works by formatting one block device as a cache set, then adding backend devices (which need to be formatted as such) to the set and activating them. It's available ...
saltstack/salt
salt/modules/salt_version.py
get_release_number
python
def get_release_number(name): ''' Returns the release number of a given release code name in a ``<year>.<month>`` context. If the release name has not been given an assigned release number, the function returns a string. If the release cannot be found, it returns ``None``. name The...
Returns the release number of a given release code name in a ``<year>.<month>`` context. If the release name has not been given an assigned release number, the function returns a string. If the release cannot be found, it returns ``None``. name The release codename for which to find a rele...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/salt_version.py#L56-L85
null
# -*- coding: utf-8 -*- ''' Access Salt's elemental release code-names. .. versionadded:: Neon Salt's feature release schedule is based on the Periodic Table, as described in the :ref:`Version Numbers <version-numbers>` documentation. Since deprecation notices often use the elemental release code-name when warning u...
saltstack/salt
salt/modules/salt_version.py
_check_release_cmp
python
def _check_release_cmp(name): ''' Helper function to compare release codename versions to the minion's current Salt version. If release codename isn't found, the function returns None. Otherwise, it returns the results of the version comparison as documented by the ``versions_cmp`` function in ...
Helper function to compare release codename versions to the minion's current Salt version. If release codename isn't found, the function returns None. Otherwise, it returns the results of the version comparison as documented by the ``versions_cmp`` function in ``salt.utils.versions.py``.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/salt_version.py#L151-L170
[ "def version_cmp(pkg1, pkg2, ignore_epoch=False):\n '''\n Compares two version strings using salt.utils.versions.LooseVersion. This\n is a fallback for providers which don't have a version comparison utility\n built into them. Return -1 if version1 < version2, 0 if version1 ==\n version2, and 1 if v...
# -*- coding: utf-8 -*- ''' Access Salt's elemental release code-names. .. versionadded:: Neon Salt's feature release schedule is based on the Periodic Table, as described in the :ref:`Version Numbers <version-numbers>` documentation. Since deprecation notices often use the elemental release code-name when warning u...
saltstack/salt
salt/modules/rbenv.py
install
python
def install(runas=None, path=None): ''' Install rbenv systemwide CLI Example: .. code-block:: bash salt '*' rbenv.install ''' path = path or _rbenv_path(runas) path = os.path.expanduser(path) return _install_rbenv(path, runas) and _install_ruby_build(path, runas)
Install rbenv systemwide CLI Example: .. code-block:: bash salt '*' rbenv.install
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbenv.py#L159-L171
[ "def _rbenv_path(runas=None):\n path = None\n if runas in (None, 'root'):\n path = __salt__['config.option']('rbenv.root') or '/usr/local/rbenv'\n else:\n path = __salt__['config.option']('rbenv.root') \\\n or '~{0}/.rbenv'.format(runas)\n\n return os.path.expanduser(path)\n", ...
# -*- coding: utf-8 -*- ''' Manage ruby installations with rbenv. rbenv is supported on Linux and macOS. rbenv doesn't work on Windows (and isn't really necessary on Windows as there is no system Ruby on Windows). On Windows, the RubyInstaller and/or Pik are both good alternatives to work with multiple versions of Ruby...
saltstack/salt
salt/modules/rbenv.py
update
python
def update(runas=None, path=None): ''' Updates the current versions of rbenv and ruby-build runas The user under which to run rbenv. If not specified, then rbenv will be run as the user under which Salt is running. CLI Example: .. code-block:: bash salt '*' rbenv.update ...
Updates the current versions of rbenv and ruby-build runas The user under which to run rbenv. If not specified, then rbenv will be run as the user under which Salt is running. CLI Example: .. code-block:: bash salt '*' rbenv.update
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbenv.py#L174-L191
[ "def _rbenv_path(runas=None):\n path = None\n if runas in (None, 'root'):\n path = __salt__['config.option']('rbenv.root') or '/usr/local/rbenv'\n else:\n path = __salt__['config.option']('rbenv.root') \\\n or '~{0}/.rbenv'.format(runas)\n\n return os.path.expanduser(path)\n", ...
# -*- coding: utf-8 -*- ''' Manage ruby installations with rbenv. rbenv is supported on Linux and macOS. rbenv doesn't work on Windows (and isn't really necessary on Windows as there is no system Ruby on Windows). On Windows, the RubyInstaller and/or Pik are both good alternatives to work with multiple versions of Ruby...
saltstack/salt
salt/modules/rbenv.py
install_ruby
python
def install_ruby(ruby, runas=None): ''' Install a ruby implementation. ruby The version of Ruby to install, should match one of the versions listed by :py:func:`rbenv.list <salt.modules.rbenv.list>` runas The user under which to run rbenv. If not specified, then rbenv will be ...
Install a ruby implementation. ruby The version of Ruby to install, should match one of the versions listed by :py:func:`rbenv.list <salt.modules.rbenv.list>` runas The user under which to run rbenv. If not specified, then rbenv will be run as the user under which Salt is runni...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbenv.py#L207-L257
[ "def rehash(runas=None):\n '''\n Run ``rbenv rehash`` to update the installed shims\n\n runas\n The user under which to run rbenv. If not specified, then rbenv will be\n run as the user under which Salt is running.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' rbenv.reha...
# -*- coding: utf-8 -*- ''' Manage ruby installations with rbenv. rbenv is supported on Linux and macOS. rbenv doesn't work on Windows (and isn't really necessary on Windows as there is no system Ruby on Windows). On Windows, the RubyInstaller and/or Pik are both good alternatives to work with multiple versions of Ruby...
saltstack/salt
salt/modules/rbenv.py
uninstall_ruby
python
def uninstall_ruby(ruby, runas=None): ''' Uninstall a ruby implementation. ruby The version of ruby to uninstall. Should match one of the versions listed by :py:func:`rbenv.versions <salt.modules.rbenv.versions>`. runas The user under which to run rbenv. If not specified, then ...
Uninstall a ruby implementation. ruby The version of ruby to uninstall. Should match one of the versions listed by :py:func:`rbenv.versions <salt.modules.rbenv.versions>`. runas The user under which to run rbenv. If not specified, then rbenv will be run as the user under which ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbenv.py#L260-L280
[ "def _rbenv_exec(command, env=None, runas=None, ret=None):\n if not is_installed(runas):\n return False\n\n binary = _rbenv_bin(runas)\n path = _rbenv_path(runas)\n\n environ = _parse_env(env)\n environ['RBENV_ROOT'] = path\n\n result = __salt__['cmd.run_all'](\n [binary] + command,\...
# -*- coding: utf-8 -*- ''' Manage ruby installations with rbenv. rbenv is supported on Linux and macOS. rbenv doesn't work on Windows (and isn't really necessary on Windows as there is no system Ruby on Windows). On Windows, the RubyInstaller and/or Pik are both good alternatives to work with multiple versions of Ruby...
saltstack/salt
salt/modules/rbenv.py
versions
python
def versions(runas=None): ''' List the installed versions of ruby CLI Example: .. code-block:: bash salt '*' rbenv.versions ''' ret = _rbenv_exec(['versions', '--bare'], runas=runas) return [] if ret is False else ret.splitlines()
List the installed versions of ruby CLI Example: .. code-block:: bash salt '*' rbenv.versions
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbenv.py#L283-L294
[ "def _rbenv_exec(command, env=None, runas=None, ret=None):\n if not is_installed(runas):\n return False\n\n binary = _rbenv_bin(runas)\n path = _rbenv_path(runas)\n\n environ = _parse_env(env)\n environ['RBENV_ROOT'] = path\n\n result = __salt__['cmd.run_all'](\n [binary] + command,\...
# -*- coding: utf-8 -*- ''' Manage ruby installations with rbenv. rbenv is supported on Linux and macOS. rbenv doesn't work on Windows (and isn't really necessary on Windows as there is no system Ruby on Windows). On Windows, the RubyInstaller and/or Pik are both good alternatives to work with multiple versions of Ruby...
saltstack/salt
salt/modules/rbenv.py
default
python
def default(ruby=None, runas=None): ''' Returns or sets the currently defined default ruby ruby The version to set as the default. Should match one of the versions listed by :py:func:`rbenv.versions <salt.modules.rbenv.versions>`. Leave blank to return the current default. CLI ...
Returns or sets the currently defined default ruby ruby The version to set as the default. Should match one of the versions listed by :py:func:`rbenv.versions <salt.modules.rbenv.versions>`. Leave blank to return the current default. CLI Example: .. code-block:: bash salt...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbenv.py#L297-L318
[ "def _rbenv_exec(command, env=None, runas=None, ret=None):\n if not is_installed(runas):\n return False\n\n binary = _rbenv_bin(runas)\n path = _rbenv_path(runas)\n\n environ = _parse_env(env)\n environ['RBENV_ROOT'] = path\n\n result = __salt__['cmd.run_all'](\n [binary] + command,\...
# -*- coding: utf-8 -*- ''' Manage ruby installations with rbenv. rbenv is supported on Linux and macOS. rbenv doesn't work on Windows (and isn't really necessary on Windows as there is no system Ruby on Windows). On Windows, the RubyInstaller and/or Pik are both good alternatives to work with multiple versions of Ruby...
saltstack/salt
salt/modules/rbenv.py
list_
python
def list_(runas=None): ''' List the installable versions of ruby runas The user under which to run rbenv. If not specified, then rbenv will be run as the user under which Salt is running. CLI Example: .. code-block:: bash salt '*' rbenv.list ''' ret = [] outpu...
List the installable versions of ruby runas The user under which to run rbenv. If not specified, then rbenv will be run as the user under which Salt is running. CLI Example: .. code-block:: bash salt '*' rbenv.list
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbenv.py#L321-L342
[ "def _rbenv_exec(command, env=None, runas=None, ret=None):\n if not is_installed(runas):\n return False\n\n binary = _rbenv_bin(runas)\n path = _rbenv_path(runas)\n\n environ = _parse_env(env)\n environ['RBENV_ROOT'] = path\n\n result = __salt__['cmd.run_all'](\n [binary] + command,\...
# -*- coding: utf-8 -*- ''' Manage ruby installations with rbenv. rbenv is supported on Linux and macOS. rbenv doesn't work on Windows (and isn't really necessary on Windows as there is no system Ruby on Windows). On Windows, the RubyInstaller and/or Pik are both good alternatives to work with multiple versions of Ruby...
saltstack/salt
salt/modules/rbenv.py
do
python
def do(cmdline, runas=None, env=None): ''' Execute a ruby command with rbenv's shims from the user or the system CLI Example: .. code-block:: bash salt '*' rbenv.do 'gem list bundler' salt '*' rbenv.do 'gem list bundler' deploy ''' if not cmdline: # This is a positiona...
Execute a ruby command with rbenv's shims from the user or the system CLI Example: .. code-block:: bash salt '*' rbenv.do 'gem list bundler' salt '*' rbenv.do 'gem list bundler' deploy
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbenv.py#L363-L410
[ "def to_unicode(s, encoding=None, errors='strict', normalize=False):\n '''\n Given str or unicode, return unicode (str for python 3)\n '''\n def _normalize(s):\n return unicodedata.normalize('NFC', s) if normalize else s\n\n if encoding is None:\n # Try utf-8 first, and fall back to det...
# -*- coding: utf-8 -*- ''' Manage ruby installations with rbenv. rbenv is supported on Linux and macOS. rbenv doesn't work on Windows (and isn't really necessary on Windows as there is no system Ruby on Windows). On Windows, the RubyInstaller and/or Pik are both good alternatives to work with multiple versions of Ruby...
saltstack/salt
salt/modules/rbenv.py
do_with_ruby
python
def do_with_ruby(ruby, cmdline, runas=None): ''' Execute a ruby command with rbenv's shims using a specific ruby version CLI Example: .. code-block:: bash salt '*' rbenv.do_with_ruby 2.0.0-p0 'gem list bundler' salt '*' rbenv.do_with_ruby 2.0.0-p0 'gem list bundler' runas=deploy '...
Execute a ruby command with rbenv's shims using a specific ruby version CLI Example: .. code-block:: bash salt '*' rbenv.do_with_ruby 2.0.0-p0 'gem list bundler' salt '*' rbenv.do_with_ruby 2.0.0-p0 'gem list bundler' runas=deploy
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rbenv.py#L413-L442
[ "def do(cmdline, runas=None, env=None):\n '''\n Execute a ruby command with rbenv's shims from the user or the system\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' rbenv.do 'gem list bundler'\n salt '*' rbenv.do 'gem list bundler' deploy\n '''\n if not cmdline:\n # Th...
# -*- coding: utf-8 -*- ''' Manage ruby installations with rbenv. rbenv is supported on Linux and macOS. rbenv doesn't work on Windows (and isn't really necessary on Windows as there is no system Ruby on Windows). On Windows, the RubyInstaller and/or Pik are both good alternatives to work with multiple versions of Ruby...
saltstack/salt
salt/states/mac_assistive.py
installed
python
def installed(name, enabled=True): ''' Make sure that we have the given bundle ID or path to command installed in the assistive access panel. name The bundle ID or path to command enable Should assistive access be enabled on this application? ''' ret = {'name': name, ...
Make sure that we have the given bundle ID or path to command installed in the assistive access panel. name The bundle ID or path to command enable Should assistive access be enabled on this application?
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/mac_assistive.py#L38-L70
null
# -*- coding: utf-8 -*- ''' Allows you to manage assistive access on macOS minions with 10.9+ ================================================================= Install, enable and disable assistive access on macOS minions .. code-block:: yaml /usr/bin/osacript: assistive.installed: - enabled: True ...
saltstack/salt
salt/states/service.py
_enable
python
def _enable(name, started, result=True, skip_verify=False, **kwargs): ''' Enable the service ''' ret = {} if not skip_verify: # is service available? try: if not _available(name, ret): return ret except CommandExecutionError as exc: re...
Enable the service
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/service.py#L123-L223
[ "def _available(name, ret):\n '''\n Check if the service is available\n '''\n avail = False\n if 'service.available' in __salt__:\n avail = __salt__['service.available'](name)\n elif 'service.get_all' in __salt__:\n avail = name in __salt__['service.get_all']()\n if not avail:\n ...
# -*- coding: utf-8 -*- ''' Starting or restarting of services and daemons ============================================== Services are defined as system daemons and are typically launched using system init or rc scripts. This service state uses whichever service module is loaded on the minion with the virtualname of `...
saltstack/salt
salt/states/service.py
_disable
python
def _disable(name, started, result=True, skip_verify=False, **kwargs): ''' Disable the service ''' ret = {} if not skip_verify: # is service available? try: if not _available(name, ret): ret['result'] = True return ret except Comma...
Disable the service
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/service.py#L226-L320
[ "def _available(name, ret):\n '''\n Check if the service is available\n '''\n avail = False\n if 'service.available' in __salt__:\n avail = __salt__['service.available'](name)\n elif 'service.get_all' in __salt__:\n avail = name in __salt__['service.get_all']()\n if not avail:\n ...
# -*- coding: utf-8 -*- ''' Starting or restarting of services and daemons ============================================== Services are defined as system daemons and are typically launched using system init or rc scripts. This service state uses whichever service module is loaded on the minion with the virtualname of `...
saltstack/salt
salt/states/service.py
_available
python
def _available(name, ret): ''' Check if the service is available ''' avail = False if 'service.available' in __salt__: avail = __salt__['service.available'](name) elif 'service.get_all' in __salt__: avail = name in __salt__['service.get_all']() if not avail: ret['resu...
Check if the service is available
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/service.py#L323-L335
null
# -*- coding: utf-8 -*- ''' Starting or restarting of services and daemons ============================================== Services are defined as system daemons and are typically launched using system init or rc scripts. This service state uses whichever service module is loaded on the minion with the virtualname of `...
saltstack/salt
salt/states/service.py
running
python
def running(name, enable=None, sig=None, init_delay=None, no_block=False, unmask=False, unmask_runtime=False, **kwargs): ''' Ensure that the service is running name The name of the init or rc script used to manage t...
Ensure that the service is running name The name of the init or rc script used to manage the service enable Set the service to be enabled at boot time, ``True`` sets the service to be enabled, ``False`` sets the named service to be disabled. The default is ``None``, which does ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/service.py#L338-L514
[ "def _disable(name, started, result=True, skip_verify=False, **kwargs):\n '''\n Disable the service\n '''\n ret = {}\n\n if not skip_verify:\n # is service available?\n try:\n if not _available(name, ret):\n ret['result'] = True\n return ret\n ...
# -*- coding: utf-8 -*- ''' Starting or restarting of services and daemons ============================================== Services are defined as system daemons and are typically launched using system init or rc scripts. This service state uses whichever service module is loaded on the minion with the virtualname of `...
saltstack/salt
salt/states/service.py
dead
python
def dead(name, enable=None, sig=None, init_delay=None, **kwargs): ''' Ensure that the named service is dead by stopping the service if it is running name The name of the init or rc script used to manage the service enable Set the service to be enable...
Ensure that the named service is dead by stopping the service if it is running name The name of the init or rc script used to manage the service enable Set the service to be enabled at boot time, ``True`` sets the service to be enabled, ``False`` sets the named service to be disabled. ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/service.py#L517-L651
[ "def _disable(name, started, result=True, skip_verify=False, **kwargs):\n '''\n Disable the service\n '''\n ret = {}\n\n if not skip_verify:\n # is service available?\n try:\n if not _available(name, ret):\n ret['result'] = True\n return ret\n ...
# -*- coding: utf-8 -*- ''' Starting or restarting of services and daemons ============================================== Services are defined as system daemons and are typically launched using system init or rc scripts. This service state uses whichever service module is loaded on the minion with the virtualname of `...
saltstack/salt
salt/states/service.py
enabled
python
def enabled(name, skip_verify=False, **kwargs): ''' Ensure that the service is enabled on boot, only use this state if you don't want to manage the running process, remember that if you want to enable a running service to use the enable: True option for the running or dead fu...
Ensure that the service is enabled on boot, only use this state if you don't want to manage the running process, remember that if you want to enable a running service to use the enable: True option for the running or dead function. name The name of the init or rc script used to manage the servi...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/service.py#L654-L677
[ "def _enable(name, started, result=True, skip_verify=False, **kwargs):\n '''\n Enable the service\n '''\n ret = {}\n\n if not skip_verify:\n # is service available?\n try:\n if not _available(name, ret):\n return ret\n except CommandExecutionError as exc...
# -*- coding: utf-8 -*- ''' Starting or restarting of services and daemons ============================================== Services are defined as system daemons and are typically launched using system init or rc scripts. This service state uses whichever service module is loaded on the minion with the virtualname of `...
saltstack/salt
salt/states/service.py
disabled
python
def disabled(name, skip_verify=False, **kwargs): ''' Ensure that the service is disabled on boot, only use this state if you don't want to manage the running process, remember that if you want to disable a service to use the enable: False option for the running or dead funct...
Ensure that the service is disabled on boot, only use this state if you don't want to manage the running process, remember that if you want to disable a service to use the enable: False option for the running or dead function. name The name of the init or rc script used to manage the service ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/service.py#L680-L703
[ "def _disable(name, started, result=True, skip_verify=False, **kwargs):\n '''\n Disable the service\n '''\n ret = {}\n\n if not skip_verify:\n # is service available?\n try:\n if not _available(name, ret):\n ret['result'] = True\n return ret\n ...
# -*- coding: utf-8 -*- ''' Starting or restarting of services and daemons ============================================== Services are defined as system daemons and are typically launched using system init or rc scripts. This service state uses whichever service module is loaded on the minion with the virtualname of `...
saltstack/salt
salt/states/service.py
masked
python
def masked(name, runtime=False): ''' .. versionadded:: 2017.7.0 .. note:: This state is only available on minions which use systemd_. Ensures that the named service is masked (i.e. prevented from being started). name Name of the service to mask runtime : False By ...
.. versionadded:: 2017.7.0 .. note:: This state is only available on minions which use systemd_. Ensures that the named service is masked (i.e. prevented from being started). name Name of the service to mask runtime : False By default, this state will manage an indefinite...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/service.py#L706-L788
null
# -*- coding: utf-8 -*- ''' Starting or restarting of services and daemons ============================================== Services are defined as system daemons and are typically launched using system init or rc scripts. This service state uses whichever service module is loaded on the minion with the virtualname of `...
saltstack/salt
salt/states/service.py
mod_watch
python
def mod_watch(name, sfun=None, sig=None, full_restart=False, init_delay=None, force=False, **kwargs): ''' The service watcher, called to invoke the watch command. When called, it will restart or reload the named service. ...
The service watcher, called to invoke the watch command. When called, it will restart or reload the named service. .. note:: This state exists to support special handling of the ``watch`` :ref:`requisite <requisites>`. It should not be called directly. Parameters for this function shou...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/service.py#L858-L1002
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "def _gen_tag(low):\n '''\n Generate the running dict tag string from the low data structure\n '''\n return '{0[state]}_|-{0[__id__]}_|-{0[name]}_|-{0[fun]}'.format(low)\n", "def _get_systemd_only(func, kwargs):\n ret = {}\n warnings =...
# -*- coding: utf-8 -*- ''' Starting or restarting of services and daemons ============================================== Services are defined as system daemons and are typically launched using system init or rc scripts. This service state uses whichever service module is loaded on the minion with the virtualname of `...