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/bigip.py
create_virtual
python
def create_virtual(hostname, username, password, name, destination, pool=None, address_status=None, auto_lasthop=None, bwc_policy=None, cmp_enabled=None, connection_limit=None, dhcp_relay...
r''' A function to connect to a bigip device and create a virtual server. hostname The host/address of the bigip device username The iControl REST username password The iControl REST password name The name of the virtual to create destination [ [virtual_a...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bigip.py#L1237-L1523
[ "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 -*- ''' An execution module which can manipulate an f5 bigip via iControl REST :maturity: develop :platform: f5_bigip_11.6 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import salt.utils.json # Import third party libs try: i...
saltstack/salt
salt/modules/bigip.py
list_profile
python
def list_profile(hostname, username, password, profile_type, name=None, ): ''' A function to connect to a bigip device and list an existing profile. If no name is provided than all profiles of the specified type will be listed. hostname The host/address of the bigip device username ...
A function to connect to a bigip device and list an existing profile. If no name is provided than all profiles of the specified type will be listed. hostname The host/address of the bigip device username The iControl REST username password The iControl REST password profile...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bigip.py#L2004-L2038
[ "def _build_session(username, password, trans_label=None):\n '''\n Create a session to be used when connecting to iControl REST.\n '''\n\n bigip = requests.session()\n bigip.auth = (username, password)\n bigip.verify = False\n bigip.headers.update({'Content-Type': 'application/json'})\n\n if...
# -*- coding: utf-8 -*- ''' An execution module which can manipulate an f5 bigip via iControl REST :maturity: develop :platform: f5_bigip_11.6 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import salt.utils.json # Import third party libs try: i...
saltstack/salt
salt/modules/bigip.py
create_profile
python
def create_profile(hostname, username, password, profile_type, name, **kwargs): r''' A function to connect to a bigip device and create a profile. hostname The host/address of the bigip device username The iControl REST username password The iControl REST password profil...
r''' A function to connect to a bigip device and create a profile. hostname The host/address of the bigip device username The iControl REST username password The iControl REST password profile_type The type of profile to create name The name of the profil...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bigip.py#L2041-L2119
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "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 unico...
# -*- coding: utf-8 -*- ''' An execution module which can manipulate an f5 bigip via iControl REST :maturity: develop :platform: f5_bigip_11.6 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import salt.utils.json # Import third party libs try: i...
saltstack/salt
salt/modules/bigip.py
delete_profile
python
def delete_profile(hostname, username, password, profile_type, name): ''' A function to connect to a bigip device and delete an existing profile. hostname The host/address of the bigip device username The iControl REST username password The iControl REST password profile...
A function to connect to a bigip device and delete an existing profile. hostname The host/address of the bigip device username The iControl REST username password The iControl REST password profile_type The type of profile to delete name The name of the profi...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/bigip.py#L2210-L2243
[ "def _build_session(username, password, trans_label=None):\n '''\n Create a session to be used when connecting to iControl REST.\n '''\n\n bigip = requests.session()\n bigip.auth = (username, password)\n bigip.verify = False\n bigip.headers.update({'Content-Type': 'application/json'})\n\n if...
# -*- coding: utf-8 -*- ''' An execution module which can manipulate an f5 bigip via iControl REST :maturity: develop :platform: f5_bigip_11.6 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import salt.utils.json # Import third party libs try: i...
saltstack/salt
salt/modules/beacons.py
list_
python
def list_(return_yaml=True, include_pillar=True, include_opts=True, **kwargs): ''' List the beacons currently configured on the minion. Args: return_yaml (bool): Whether to return YAML formatted output, default ``True``. include_pillar (bool): ...
List the beacons currently configured on the minion. Args: return_yaml (bool): Whether to return YAML formatted output, default ``True``. include_pillar (bool): Whether to include beacons that are configured in pillar, default is ``True``. include_opts...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/beacons.py#L30-L89
[ "def get_event(\n node, sock_dir=None, transport='zeromq',\n opts=None, listen=True, io_loop=None, keep_loop=False, raise_errors=False):\n '''\n Return an event object suitable for the named transport\n\n :param IOLoop io_loop: Pass in an io_loop if you want asynchronous\n ...
# -*- coding: utf-8 -*- ''' Module for managing the Salt beacons on a minion .. versionadded:: 2015.8.0 ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import difflib import logging import os # Import Salt libs import salt.ext.six as six import salt.utils.event impor...
saltstack/salt
salt/modules/beacons.py
add
python
def add(name, beacon_data, **kwargs): ''' Add a beacon on the minion Args: name (str): Name of the beacon to configure beacon_data (dict): Dictionary or list containing configuration for beacon. Returns: dict: Boolean and status message on success or f...
Add a beacon on the minion Args: name (str): Name of the beacon to configure beacon_data (dict): Dictionary or list containing configuration for beacon. Returns: dict: Boolean and status message on success or failure of add. CLI Example: .. code-bloc...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/beacons.py#L141-L241
[ "def get_event(\n node, sock_dir=None, transport='zeromq',\n opts=None, listen=True, io_loop=None, keep_loop=False, raise_errors=False):\n '''\n Return an event object suitable for the named transport\n\n :param IOLoop io_loop: Pass in an io_loop if you want asynchronous\n ...
# -*- coding: utf-8 -*- ''' Module for managing the Salt beacons on a minion .. versionadded:: 2015.8.0 ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import difflib import logging import os # Import Salt libs import salt.ext.six as six import salt.utils.event impor...
saltstack/salt
salt/modules/beacons.py
modify
python
def modify(name, beacon_data, **kwargs): ''' Modify an existing beacon. Args: name (str): Name of the beacon to configure. beacon_data (dict): Dictionary or list containing updated configuration for beacon. Returns: dict: Boolean and status message on ...
Modify an existing beacon. Args: name (str): Name of the beacon to configure. beacon_data (dict): Dictionary or list containing updated configuration for beacon. Returns: dict: Boolean and status message on success or failure of modify. CLI Example: ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/beacons.py#L244-L361
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "def get_event(\n node, sock_dir=None, transport='zeromq',\n opts=None, listen=True, io_loop=None, keep_loop=False, raise_errors=False):\n '''\n Return an event object suitable for the named transport\n\n :param IOLoop io_loop: Pass...
# -*- coding: utf-8 -*- ''' Module for managing the Salt beacons on a minion .. versionadded:: 2015.8.0 ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import difflib import logging import os # Import Salt libs import salt.ext.six as six import salt.utils.event impor...
saltstack/salt
salt/modules/beacons.py
save
python
def save(**kwargs): ''' Save all configured beacons to the minion config. Returns: dict: Boolean and status message on success or failure of save. CLI Example: .. code-block:: bash salt '*' beacons.save ''' ret = {'comment': [], 'result': True} beacons = ...
Save all configured beacons to the minion config. Returns: dict: Boolean and status message on success or failure of save. CLI Example: .. code-block:: bash salt '*' beacons.save
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/beacons.py#L422-L459
[ "def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ...
# -*- coding: utf-8 -*- ''' Module for managing the Salt beacons on a minion .. versionadded:: 2015.8.0 ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import difflib import logging import os # Import Salt libs import salt.ext.six as six import salt.utils.event impor...
saltstack/salt
salt/modules/beacons.py
enable_beacon
python
def enable_beacon(name, **kwargs): ''' Enable a beacon on the minion. Args: name (str): Name of the beacon to enable. Returns: dict: Boolean and status message on success or failure of enable. CLI Example: .. code-block:: bash salt '*' beacons.enable_beacon ps ''...
Enable a beacon on the minion. Args: name (str): Name of the beacon to enable. Returns: dict: Boolean and status message on success or failure of enable. CLI Example: .. code-block:: bash salt '*' beacons.enable_beacon ps
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/beacons.py#L563-L634
[ "def get_event(\n node, sock_dir=None, transport='zeromq',\n opts=None, listen=True, io_loop=None, keep_loop=False, raise_errors=False):\n '''\n Return an event object suitable for the named transport\n\n :param IOLoop io_loop: Pass in an io_loop if you want asynchronous\n ...
# -*- coding: utf-8 -*- ''' Module for managing the Salt beacons on a minion .. versionadded:: 2015.8.0 ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals import difflib import logging import os # Import Salt libs import salt.ext.six as six import salt.utils.event impor...
saltstack/salt
salt/sdb/rest.py
set_
python
def set_(key, value, service=None, profile=None): # pylint: disable=W0613 ''' Set a key/value pair in the REST interface ''' return query(key, value, service, profile)
Set a key/value pair in the REST interface
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/sdb/rest.py#L83-L87
[ "def query(key, value=None, service=None, profile=None): # pylint: disable=W0613\n '''\n Get a value from the REST interface\n '''\n comps = key.split('?')\n key = comps[0]\n key_vars = {}\n for pair in comps[1].split('&'):\n pair_key, pair_val = pair.split('=')\n key_vars[pair_k...
# -*- coding: utf-8 -*- ''' Generic REST API SDB Module :maintainer: SaltStack :maturity: New :platform: all .. versionadded:: 2015.8.0 This module allows access to a REST interface using an ``sdb://`` URI. Like all REST modules, the REST module requires a configuration profile to be configured in eith...
saltstack/salt
salt/sdb/rest.py
query
python
def query(key, value=None, service=None, profile=None): # pylint: disable=W0613 ''' Get a value from the REST interface ''' comps = key.split('?') key = comps[0] key_vars = {} for pair in comps[1].split('&'): pair_key, pair_val = pair.split('=') key_vars[pair_key] = pair_val...
Get a value from the REST interface
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/sdb/rest.py#L97-L133
[ "def compile_template(template,\n renderers,\n default,\n blacklist,\n whitelist,\n saltenv='base',\n sls='',\n input_data='',\n **kwargs):\n '''\n Ta...
# -*- coding: utf-8 -*- ''' Generic REST API SDB Module :maintainer: SaltStack :maturity: New :platform: all .. versionadded:: 2015.8.0 This module allows access to a REST interface using an ``sdb://`` URI. Like all REST modules, the REST module requires a configuration profile to be configured in eith...
saltstack/salt
salt/states/event.py
send
python
def send(name, data=None, preload=None, with_env=False, with_grains=False, with_pillar=False, show_changed=True, **kwargs): ''' Send an event to the Salt Master .. versionadded:: 2014.7.0 Accepts the same arguments as the :py:func:`event.s...
Send an event to the Salt Master .. versionadded:: 2014.7.0 Accepts the same arguments as the :py:func:`event.send <salt.modules.event.send>` execution module of the same name, with the additional argument: :param show_changed: If ``True``, state will show as changed with the data argumen...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/event.py#L13-L66
null
# -*- coding: utf-8 -*- ''' Send events through Salt's event system during state runs ''' # Import Python libs from __future__ import absolute_import, print_function, unicode_literals # import salt libs import salt.utils.functools def wait(name, sfun=None): ''' Fire an event on the Salt master event bus if...
saltstack/salt
salt/states/neutron_secgroup_rule.py
_rule_compare
python
def _rule_compare(rule1, rule2): ''' Compare the common keys between security group rules against eachother ''' commonkeys = set(rule1.keys()).intersection(rule2.keys()) for key in commonkeys: if rule1[key] != rule2[key]: return False return True
Compare the common keys between security group rules against eachother
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/neutron_secgroup_rule.py#L44-L53
null
# -*- coding: utf-8 -*- ''' Management of OpenStack Neutron Security Group Rules ==================================================== .. versionadded:: 2018.3.0 :depends: shade :configuration: see :py:mod:`salt.modules.neutronng` for setup instructions Example States .. code-block:: yaml create security group ...
saltstack/salt
salt/states/neutron_secgroup_rule.py
present
python
def present(name, auth=None, **kwargs): ''' Ensure a security group rule exists defaults: port_range_min=None, port_range_max=None, protocol=None, remote_ip_prefix=None, remote_group_id=None, direction='ingress', ethertype='IPv4', project_id=None name Name of the se...
Ensure a security group rule exists defaults: port_range_min=None, port_range_max=None, protocol=None, remote_ip_prefix=None, remote_group_id=None, direction='ingress', ethertype='IPv4', project_id=None name Name of the security group to associate with this rule projec...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/neutron_secgroup_rule.py#L56-L128
[ "def _rule_compare(rule1, rule2):\n '''\n Compare the common keys between security group rules against eachother\n '''\n\n commonkeys = set(rule1.keys()).intersection(rule2.keys())\n for key in commonkeys:\n if rule1[key] != rule2[key]:\n return False\n return True\n" ]
# -*- coding: utf-8 -*- ''' Management of OpenStack Neutron Security Group Rules ==================================================== .. versionadded:: 2018.3.0 :depends: shade :configuration: see :py:mod:`salt.modules.neutronng` for setup instructions Example States .. code-block:: yaml create security group ...
saltstack/salt
salt/states/neutron_secgroup_rule.py
absent
python
def absent(name, auth=None, **kwargs): ''' Ensure a security group rule does not exist name name or id of the security group rule to delete rule_id uuid of the rule to delete project_id id of project to delete rule from ''' rule_id = kwargs['rule_id'] ret = {'n...
Ensure a security group rule does not exist name name or id of the security group rule to delete rule_id uuid of the rule to delete project_id id of project to delete rule from
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/neutron_secgroup_rule.py#L131-L180
[ "def _rule_compare(rule1, rule2):\n '''\n Compare the common keys between security group rules against eachother\n '''\n\n commonkeys = set(rule1.keys()).intersection(rule2.keys())\n for key in commonkeys:\n if rule1[key] != rule2[key]:\n return False\n return True\n" ]
# -*- coding: utf-8 -*- ''' Management of OpenStack Neutron Security Group Rules ==================================================== .. versionadded:: 2018.3.0 :depends: shade :configuration: see :py:mod:`salt.modules.neutronng` for setup instructions Example States .. code-block:: yaml create security group ...
saltstack/salt
salt/states/http.py
query
python
def query(name, match=None, match_type='string', status=None, status_type='string', wait_for=None, **kwargs): ''' Perform an HTTP query and statefully return the result Passes through all the parameters described in the :py:func:`utils.http.query function <salt.utils.http.query>`: name The...
Perform an HTTP query and statefully return the result Passes through all the parameters described in the :py:func:`utils.http.query function <salt.utils.http.query>`: name The name of the query. match Specifies a pattern to look for in the return text. By default, this will p...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/http.py#L23-L153
null
# -*- coding: utf-8 -*- ''' HTTP monitoring states Perform an HTTP query and statefully return the result .. versionadded:: 2015.5.0 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import re import time __monitor__ = [ 'query', ] log ...
saltstack/salt
salt/states/http.py
wait_for_successful_query
python
def wait_for_successful_query(name, wait_for=300, **kwargs): ''' Like query but, repeat and wait until match/match_type or status is fulfilled. State returns result from last query state in case of success or if no successful query was made within wait_for timeout. name The name of the query. ...
Like query but, repeat and wait until match/match_type or status is fulfilled. State returns result from last query state in case of success or if no successful query was made within wait_for timeout. name The name of the query. wait_for Total time to wait for requests that succeed. r...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/http.py#L156-L195
[ "def query(name, match=None, match_type='string', status=None, status_type='string', wait_for=None, **kwargs):\n '''\n Perform an HTTP query and statefully return the result\n\n Passes through all the parameters described in the\n :py:func:`utils.http.query function <salt.utils.http.query>`:\n\n name...
# -*- coding: utf-8 -*- ''' HTTP monitoring states Perform an HTTP query and statefully return the result .. versionadded:: 2015.5.0 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import re import time __monitor__ = [ 'query', ] log ...
saltstack/salt
salt/modules/dracr.py
__parse_drac
python
def __parse_drac(output): ''' Parse Dell DRAC output ''' drac = {} section = '' for i in output.splitlines(): if i.strip().endswith(':') and '=' not in i: section = i[0:-1] drac[section] = {} if i.rstrip() and '=' in i: if section in drac: ...
Parse Dell DRAC output
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L43-L64
null
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
__execute_cmd
python
def __execute_cmd(command, host=None, admin_username=None, admin_password=None, module=None): ''' Execute rac commands ''' if module: # -a takes 'server' or 'switch' to represent all servers # or all switches in a chassis. Allow # user to say ...
Execute rac commands
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L67-L101
null
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
__execute_ret
python
def __execute_ret(command, host=None, admin_username=None, admin_password=None, module=None): ''' Execute rac commands ''' if module: if module == 'ALL': modswitch = '-a ' else: modswitch = '-m {0}'.format(module) else: ...
Execute rac commands
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L104-L151
null
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
get_property
python
def get_property(host=None, admin_username=None, admin_password=None, property=None): ''' .. versionadded:: Fluorine Return specific property host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the ...
.. versionadded:: Fluorine Return specific property host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. property: The property which should be get. CLI Example: .. code-b...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L154-L183
[ "def __execute_ret(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n if module == 'ALL':\n modswitch = '-a '\n else:\n modswitch = '-m {0}'.format(module)...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
set_property
python
def set_property(host=None, admin_username=None, admin_password=None, property=None, value=None): ''' .. versionadded:: Fluorine Set specific property host The chassis host. admin_username The username used to access the chassis. admin_password The password used to ac...
.. versionadded:: Fluorine Set specific property host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. property: The property which should be set. value: The value which...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L186-L220
[ "def __execute_ret(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n if module == 'ALL':\n modswitch = '-a '\n else:\n modswitch = '-m {0}'.format(module)...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
ensure_property_set
python
def ensure_property_set(host=None, admin_username=None, admin_password=None, property=None, value=None): ''' .. versionadded:: Fluorine Ensure that property is set to specific value host The chassis host. admin_username The username used to access the chassis. admin_password ...
.. versionadded:: Fluorine Ensure that property is set to specific value host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. property: The property which should be set. value:...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L223-L255
[ "def get_property(host=None, admin_username=None, admin_password=None, property=None):\n '''\n .. versionadded:: Fluorine\n\n Return specific property\n\n host\n The chassis host.\n\n admin_username\n The username used to access the chassis.\n\n admin_password\n The password u...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
system_info
python
def system_info(host=None, admin_username=None, admin_password=None, module=None): ''' Return System information CLI Example: .. code-block:: bash salt dell dracr.system_info ''' cmd = __execute_ret('getsysinfo', host=host, admin...
Return System information CLI Example: .. code-block:: bash salt dell dracr.system_info
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L280-L301
[ "def __parse_drac(output):\n '''\n Parse Dell DRAC output\n '''\n drac = {}\n section = ''\n\n for i in output.splitlines():\n if i.strip().endswith(':') and '=' not in i:\n section = i[0:-1]\n drac[section] = {}\n if i.rstrip() and '=' in i:\n if sec...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
network_info
python
def network_info(host=None, admin_username=None, admin_password=None, module=None): ''' Return Network Configuration CLI Example: .. code-block:: bash salt dell dracr.network_info ''' inv = inventory(host=host, admin_username=admin_u...
Return Network Configuration CLI Example: .. code-block:: bash salt dell dracr.network_info
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L342-L380
[ "def inventory(host=None, admin_username=None, admin_password=None):\n def mapit(x, y):\n return {x: y}\n\n fields = {}\n fields['server'] = ['name', 'idrac_version', 'blade_type', 'gen',\n 'updateable']\n fields['switch'] = ['name', 'model_name', 'hw_version', 'fw_version'...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
nameservers
python
def nameservers(ns, host=None, admin_username=None, admin_password=None, module=None): ''' Configure the nameservers on the DRAC CLI Example: .. code-block:: bash salt dell dracr.nameservers [NAMESERVERS] salt dell dracr....
Configure the nameservers on the DRAC CLI Example: .. code-block:: bash salt dell dracr.nameservers [NAMESERVERS] salt dell dracr.nameservers ns1.example.com ns2.example.com admin_username=root admin_password=calvin module=server-1 host=192.168.1.1
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L383-L413
[ "def __execute_cmd(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n # -a takes 'server' or 'switch' to represent all servers\n # or all switches in a chassis. Allow\n ...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
syslog
python
def syslog(server, enable=True, host=None, admin_username=None, admin_password=None, module=None): ''' Configure syslog remote logging, by default syslog will automatically be enabled if a server is specified. However, if you want to disable syslog you will need to specify a server followed b...
Configure syslog remote logging, by default syslog will automatically be enabled if a server is specified. However, if you want to disable syslog you will need to specify a server followed by False CLI Example: .. code-block:: bash salt dell dracr.syslog [SYSLOG IP] [ENABLE/DISABLE] s...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L416-L447
[ "def __execute_cmd(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n # -a takes 'server' or 'switch' to represent all servers\n # or all switches in a chassis. Allow\n ...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
email_alerts
python
def email_alerts(action, host=None, admin_username=None, admin_password=None): ''' Enable/Disable email alerts CLI Example: .. code-block:: bash salt dell dracr.email_alerts True salt dell dracr.email_alerts False ''' if acti...
Enable/Disable email alerts CLI Example: .. code-block:: bash salt dell dracr.email_alerts True salt dell dracr.email_alerts False
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L450-L472
[ "def __execute_cmd(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n # -a takes 'server' or 'switch' to represent all servers\n # or all switches in a chassis. Allow\n ...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
list_users
python
def list_users(host=None, admin_username=None, admin_password=None, module=None): ''' List all DRAC users CLI Example: .. code-block:: bash salt dell dracr.list_users ''' users = {} _username = '' for idx in range(1, 17): c...
List all DRAC users CLI Example: .. code-block:: bash salt dell dracr.list_users
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L475-L517
[ "def __execute_ret(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n if module == 'ALL':\n modswitch = '-a '\n else:\n modswitch = '-m {0}'.format(module)...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
delete_user
python
def delete_user(username, uid=None, host=None, admin_username=None, admin_password=None): ''' Delete a user CLI Example: .. code-block:: bash salt dell dracr.delete_user [USERNAME] [UID - optional] salt dell dracr.delete_...
Delete a user CLI Example: .. code-block:: bash salt dell dracr.delete_user [USERNAME] [UID - optional] salt dell dracr.delete_user diana 4
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L520-L547
[ "def list_users(host=None,\n admin_username=None,\n admin_password=None,\n module=None):\n '''\n List all DRAC users\n\n CLI Example:\n\n .. code-block:: bash\n\n salt dell dracr.list_users\n '''\n users = {}\n _username = ''\n\n for idx in ra...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
change_password
python
def change_password(username, password, uid=None, host=None, admin_username=None, admin_password=None, module=None): ''' Change user's password CLI Example: .. code-block:: bash salt dell dracr.change_password [USERNAME] [PASSWORD] uid=[OPTIONAL] ...
Change user's password CLI Example: .. code-block:: bash salt dell dracr.change_password [USERNAME] [PASSWORD] uid=[OPTIONAL] host=<remote DRAC> admin_username=<DRAC user> admin_password=<DRAC PW> salt dell dracr.change_password diana secret Note that if only a us...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L550-L588
[ "def list_users(host=None,\n admin_username=None,\n admin_password=None,\n module=None):\n '''\n List all DRAC users\n\n CLI Example:\n\n .. code-block:: bash\n\n salt dell dracr.list_users\n '''\n users = {}\n _username = ''\n\n for idx in ra...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
deploy_password
python
def deploy_password(username, password, host=None, admin_username=None, admin_password=None, module=None): ''' Change the QuickDeploy password, used for switches as well CLI Example: .. code-block:: bash salt dell dracr.deploy_password [USERNAME] [PASSWORD] hos...
Change the QuickDeploy password, used for switches as well CLI Example: .. code-block:: bash salt dell dracr.deploy_password [USERNAME] [PASSWORD] host=<remote DRAC> admin_username=<DRAC user> admin_password=<DRAC PW> salt dell dracr.change_password diana secret N...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L591-L614
[ "def __execute_cmd(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n # -a takes 'server' or 'switch' to represent all servers\n # or all switches in a chassis. Allow\n ...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
deploy_snmp
python
def deploy_snmp(snmp, host=None, admin_username=None, admin_password=None, module=None): ''' Change the QuickDeploy SNMP community string, used for switches as well CLI Example: .. code-block:: bash salt dell dracr.deploy_snmp SNMP_STRING host=<remote DRAC or CMC> ...
Change the QuickDeploy SNMP community string, used for switches as well CLI Example: .. code-block:: bash salt dell dracr.deploy_snmp SNMP_STRING host=<remote DRAC or CMC> admin_username=<DRAC user> admin_password=<DRAC PW> salt dell dracr.deploy_password diana secret
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L617-L636
[ "def __execute_cmd(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n # -a takes 'server' or 'switch' to represent all servers\n # or all switches in a chassis. Allow\n ...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
set_snmp
python
def set_snmp(community, host=None, admin_username=None, admin_password=None): ''' Configure CMC or individual iDRAC SNMP community string. Use ``deploy_snmp`` for configuring chassis switch SNMP. CLI Example: .. code-block:: bash salt dell dracr.set_snmp [COMMUNITY] s...
Configure CMC or individual iDRAC SNMP community string. Use ``deploy_snmp`` for configuring chassis switch SNMP. CLI Example: .. code-block:: bash salt dell dracr.set_snmp [COMMUNITY] salt dell dracr.set_snmp public
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L763-L779
[ "def __execute_cmd(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n # -a takes 'server' or 'switch' to represent all servers\n # or all switches in a chassis. Allow\n ...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
set_network
python
def set_network(ip, netmask, gateway, host=None, admin_username=None, admin_password=None): ''' Configure Network on the CMC or individual iDRAC. Use ``set_niccfg`` for blade and switch addresses. CLI Example: .. code-block:: bash salt dell dracr.set_network [DRAC IP] [NET...
Configure Network on the CMC or individual iDRAC. Use ``set_niccfg`` for blade and switch addresses. CLI Example: .. code-block:: bash salt dell dracr.set_network [DRAC IP] [NETMASK] [GATEWAY] salt dell dracr.set_network 192.168.0.2 255.255.255.0 192.168.0.1 admin_username=roo...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L782-L799
[ "def __execute_cmd(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n # -a takes 'server' or 'switch' to represent all servers\n # or all switches in a chassis. Allow\n ...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
server_power
python
def server_power(status, host=None, admin_username=None, admin_password=None, module=None): ''' status One of 'powerup', 'powerdown', 'powercycle', 'hardreset', 'graceshutdown' host The chassis host. admin_username T...
status One of 'powerup', 'powerdown', 'powercycle', 'hardreset', 'graceshutdown' host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. module The element to reboot on the ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L802-L834
[ "def __execute_cmd(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n # -a takes 'server' or 'switch' to represent all servers\n # or all switches in a chassis. Allow\n ...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
server_reboot
python
def server_reboot(host=None, admin_username=None, admin_password=None, module=None): ''' Issues a power-cycle operation on the managed server. This action is similar to pressing the power button on the system's front panel to power down and then powe...
Issues a power-cycle operation on the managed server. This action is similar to pressing the power button on the system's front panel to power down and then power up the system. host The chassis host. admin_username The username used to access the chassis. admin_password T...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L837-L869
[ "def __execute_cmd(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n # -a takes 'server' or 'switch' to represent all servers\n # or all switches in a chassis. Allow\n ...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
server_poweroff
python
def server_poweroff(host=None, admin_username=None, admin_password=None, module=None): ''' Powers down the managed server. host The chassis host. admin_username The username used to access the chassis. admin_password ...
Powers down the managed server. host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. module The element to power off on the chassis such as a blade. If not provided, the chassis ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L872-L901
[ "def __execute_cmd(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n # -a takes 'server' or 'switch' to represent all servers\n # or all switches in a chassis. Allow\n ...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
server_poweron
python
def server_poweron(host=None, admin_username=None, admin_password=None, module=None): ''' Powers up the managed server. host The chassis host. admin_username The username used to access the chassis. admin_password Th...
Powers up the managed server. host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. module The element to power on located on the chassis such as a blade. If not provided, the cha...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L904-L933
[ "def __execute_cmd(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n # -a takes 'server' or 'switch' to represent all servers\n # or all switches in a chassis. Allow\n ...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
server_hardreset
python
def server_hardreset(host=None, admin_username=None, admin_password=None, module=None): ''' Performs a reset (reboot) operation on the managed server. host The chassis host. admin_username The username used to access the ch...
Performs a reset (reboot) operation on the managed server. host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. module The element to hard reset on the chassis such as a blade. If ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L936-L967
[ "def __execute_cmd(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n # -a takes 'server' or 'switch' to represent all servers\n # or all switches in a chassis. Allow\n ...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
server_powerstatus
python
def server_powerstatus(host=None, admin_username=None, admin_password=None, module=None): ''' return the power status for the passed module CLI Example: .. code-block:: bash salt dell drac.server_powerstatus ''' ret ...
return the power status for the passed module CLI Example: .. code-block:: bash salt dell drac.server_powerstatus
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L970-L999
[ "def __execute_ret(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n if module == 'ALL':\n modswitch = '-a '\n else:\n modswitch = '-m {0}'.format(module)...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
server_pxe
python
def server_pxe(host=None, admin_username=None, admin_password=None): ''' Configure server to PXE perform a one off PXE boot CLI Example: .. code-block:: bash salt dell dracr.server_pxe ''' if __execute_cmd('config -g cfgServerInfo -o cfgServerFirstBootDev...
Configure server to PXE perform a one off PXE boot CLI Example: .. code-block:: bash salt dell dracr.server_pxe
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1002-L1026
[ "def __execute_cmd(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n # -a takes 'server' or 'switch' to represent all servers\n # or all switches in a chassis. Allow\n ...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
list_slotnames
python
def list_slotnames(host=None, admin_username=None, admin_password=None): ''' List the names of all slots in the chassis. host The chassis host. admin_username The username used to access the chassis. admin_password The password used to...
List the names of all slots in the chassis. host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. CLI Example: .. code-block:: bash salt-call --local dracr.list_slotnames host=111.2...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1029-L1078
[ "def __execute_ret(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n if module == 'ALL':\n modswitch = '-a '\n else:\n modswitch = '-m {0}'.format(module)...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
get_slotname
python
def get_slotname(slot, host=None, admin_username=None, admin_password=None): ''' Get the name of a slot number in the chassis. slot The number of the slot for which to obtain the name. host The chassis host. admin_username The username used to access the chassis. admi...
Get the name of a slot number in the chassis. slot The number of the slot for which to obtain the name. host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. CLI Example: .. cod...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1081-L1110
[ "def list_slotnames(host=None,\n admin_username=None,\n admin_password=None):\n '''\n List the names of all slots in the chassis.\n\n host\n The chassis host.\n\n admin_username\n The username used to access the chassis.\n\n admin_password\n Th...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
set_slotname
python
def set_slotname(slot, name, host=None, admin_username=None, admin_password=None): ''' Set the name of a slot in a chassis. slot The slot number to change. name The name to set. Can only be 15 characters long. host The chassis host. admin_username ...
Set the name of a slot in a chassis. slot The slot number to change. name The name to set. Can only be 15 characters long. host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassi...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1113-L1143
[ "def __execute_cmd(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n # -a takes 'server' or 'switch' to represent all servers\n # or all switches in a chassis. Allow\n ...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
set_chassis_name
python
def set_chassis_name(name, host=None, admin_username=None, admin_password=None): ''' Set the name of the chassis. name The name to be set on the chassis. host The chassis host. admin_username The username used ...
Set the name of the chassis. name The name to be set on the chassis. host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. CLI Example: .. code-block:: bash salt '*' dr...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1146-L1175
[ "def __execute_cmd(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n # -a takes 'server' or 'switch' to represent all servers\n # or all switches in a chassis. Allow\n ...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
get_chassis_name
python
def get_chassis_name(host=None, admin_username=None, admin_password=None): ''' Get the name of a chassis. host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. CLI Example: .. code-b...
Get the name of a chassis. host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. CLI Example: .. code-block:: bash salt '*' dracr.get_chassis_name host=111.222.333.444 a...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1178-L1201
[ "def bare_rac_cmd(cmd, host=None,\n admin_username=None, admin_password=None):\n ret = __execute_ret('{0}'.format(cmd),\n host=host,\n admin_username=admin_username,\n admin_password=admin_password)\n\n if ret['retcode'] == 0:...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
set_chassis_location
python
def set_chassis_location(location, host=None, admin_username=None, admin_password=None): ''' Set the location of the chassis. location The name of the location to be set on the chassis. host The chassis host. ...
Set the location of the chassis. location The name of the location to be set on the chassis. host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. CLI Example: .. code-block:: b...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1285-L1314
[ "def __execute_cmd(command, host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Execute rac commands\n '''\n if module:\n # -a takes 'server' or 'switch' to represent all servers\n # or all switches in a chassis. Allow\n ...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
get_chassis_location
python
def get_chassis_location(host=None, admin_username=None, admin_password=None): ''' Get the location of the chassis. host The chassis host. admin_username The username used to access the chassis. admin_password The password ...
Get the location of the chassis. host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. CLI Example: .. code-block:: bash salt '*' dracr.set_chassis_location host=111.222.333.444 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1317-L1342
[ "def system_info(host=None,\n admin_username=None, admin_password=None,\n module=None):\n '''\n Return System information\n\n CLI Example:\n\n .. code-block:: bash\n\n salt dell dracr.system_info\n '''\n cmd = __execute_ret('getsysinfo', host=host,\n ...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
set_chassis_datacenter
python
def set_chassis_datacenter(location, host=None, admin_username=None, admin_password=None): ''' Set the location of the chassis. location The name of the datacenter to be set on the chassis. host The chassis host...
Set the location of the chassis. location The name of the datacenter to be set on the chassis. host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. CLI Example: .. code-block::...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1345-L1374
[ "def set_general(cfg_sec, cfg_var, val, host=None,\n admin_username=None, admin_password=None):\n return __execute_cmd('config -g {0} -o {1} {2}'.format(cfg_sec,\n cfg_var, val),\n host=host,\n ...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
get_chassis_datacenter
python
def get_chassis_datacenter(host=None, admin_username=None, admin_password=None): ''' Get the datacenter of the chassis. host The chassis host. admin_username The username used to access the chassis. admin_password The passw...
Get the datacenter of the chassis. host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. CLI Example: .. code-block:: bash salt '*' dracr.set_chassis_location host=111.222.333.444 ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1377-L1401
[ "def get_general(cfg_sec, cfg_var, host=None,\n admin_username=None, admin_password=None):\n ret = __execute_ret('getconfig -g {0} -o {1}'.format(cfg_sec, cfg_var),\n host=host,\n admin_username=admin_username,\n admin_password=a...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
idrac_general
python
def idrac_general(blade_name, command, idrac_password=None, host=None, admin_username=None, admin_password=None): ''' Run a generic racadm command against a particular blade in a chassis. Blades are usually named things like 'server-1', 'server-2', etc. If the iDRAC...
Run a generic racadm command against a particular blade in a chassis. Blades are usually named things like 'server-1', 'server-2', etc. If the iDRAC has a different password than the CMC, then you can pass it with the idrac_password kwarg. :param blade_name: Name of the blade to run the command o...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1426-L1469
[ "def network_info(host=None,\n admin_username=None,\n admin_password=None,\n module=None):\n '''\n Return Network Configuration\n\n CLI Example:\n\n .. code-block:: bash\n\n salt dell dracr.network_info\n '''\n\n inv = inventory(host=host, adm...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
update_firmware
python
def update_firmware(filename, host=None, admin_username=None, admin_password=None): ''' Updates firmware using local firmware file .. code-block:: bash salt dell dracr.update_firmware firmware.exe This executes the following command...
Updates firmware using local firmware file .. code-block:: bash salt dell dracr.update_firmware firmware.exe This executes the following command on your FX2 (using username and password stored in the pillar data) .. code-block:: bash racadm update –f firmware.exe -u user –p pass
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1506-L1532
[ "def _update_firmware(cmd,\n host=None,\n admin_username=None,\n admin_password=None):\n\n if not admin_username:\n admin_username = __pillar__['proxy']['admin_username']\n if not admin_username:\n admin_password = __pillar__['proxy']['...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/modules/dracr.py
update_firmware_nfs_or_cifs
python
def update_firmware_nfs_or_cifs(filename, share, host=None, admin_username=None, admin_password=None): ''' Executes the following for CIFS (using username and password stored in the pillar data) .. code-bloc...
Executes the following for CIFS (using username and password stored in the pillar data) .. code-block:: bash racadm update -f <updatefile> -u user –p pass -l //IP-Address/share Or for NFS (using username and password stored in the pillar data) .. code-block:: bash racadm upda...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/dracr.py#L1535-L1577
[ "def _update_firmware(cmd,\n host=None,\n admin_username=None,\n admin_password=None):\n\n if not admin_username:\n admin_username = __pillar__['proxy']['admin_username']\n if not admin_username:\n admin_password = __pillar__['proxy']['...
# -*- coding: utf-8 -*- ''' Manage Dell DRAC .. versionadded:: 2015.8.2 ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging import os import re # Import Salt libs from salt.exceptions import CommandExecutionError, SaltException import salt.utils.path # Im...
saltstack/salt
salt/states/msteams.py
post_card
python
def post_card(name, message, hook_url=None, title=None, theme_color=None): ''' Send a message to a Microsft Teams channel .. code-block:: yaml send-msteams-message: msteams.post_card: - message: 'This state was executed ...
Send a message to a Microsft Teams channel .. code-block:: yaml send-msteams-message: msteams.post_card: - message: 'This state was executed successfully.' - hook_url: https://outlook.office.com/webhook/837 The following parameters are required: message ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/msteams.py#L39-L99
null
# -*- coding: utf-8 -*- ''' Send a message card to Microsoft Teams ====================================== This state is useful for sending messages to Teams during state runs. .. versionadded:: 2017.7.0 .. code-block:: yaml teams-message: msteams.post_card: - message: 'This state was executed succ...
saltstack/salt
salt/wheel/key.py
accept_dict
python
def accept_dict(match, include_rejected=False, include_denied=False): ''' Accept keys based on a dict of keys. Returns a dictionary. match The dictionary of keys to accept. include_rejected To include rejected keys in the match along with pending keys, set this to ``True``. Def...
Accept keys based on a dict of keys. Returns a dictionary. match The dictionary of keys to accept. include_rejected To include rejected keys in the match along with pending keys, set this to ``True``. Defaults to ``False``. .. versionadded:: 2016.3.4 include_denied ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/key.py#L121-L158
[ "def get_key(opts):\n return Key(opts)\n", "def accept(self, match=None, match_dict=None, include_rejected=False, include_denied=False):\n '''\n Accept public keys. If \"match\" is passed, it is evaluated as a glob.\n Pre-gathered matches can also be passed via \"match_dict\".\n '''\n if match i...
# -*- coding: utf-8 -*- ''' Wheel system wrapper for the Salt key system to be used in interactions with the Salt Master programmatically. The key module for the wheel system is meant to provide an internal interface for other Salt systems to interact with the Salt Master. The following usage examples assume that a Wh...
saltstack/salt
salt/wheel/key.py
reject
python
def reject(match, include_accepted=False, include_denied=False): ''' Reject keys based on a glob match. Returns a dictionary. match The glob match of keys to reject. include_accepted To include accepted keys in the match along with pending keys, set this to ``True``. Defaults t...
Reject keys based on a glob match. Returns a dictionary. match The glob match of keys to reject. include_accepted To include accepted keys in the match along with pending keys, set this to ``True``. Defaults to ``False``. include_denied To include denied keys in the match ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/key.py#L200-L221
[ "def get_key(opts):\n return Key(opts)\n", "def reject(self, match=None, match_dict=None, include_accepted=False, include_denied=False):\n '''\n Reject public keys. If \"match\" is passed, it is evaluated as a glob.\n Pre-gathered matches can also be passed via \"match_dict\".\n '''\n if match i...
# -*- coding: utf-8 -*- ''' Wheel system wrapper for the Salt key system to be used in interactions with the Salt Master programmatically. The key module for the wheel system is meant to provide an internal interface for other Salt systems to interact with the Salt Master. The following usage examples assume that a Wh...
saltstack/salt
salt/wheel/key.py
finger
python
def finger(match, hash_type=None): ''' Return the matching key fingerprints. Returns a dictionary. match The key for with to retrieve the fingerprint. hash_type The hash algorithm used to calculate the fingerprint .. code-block:: python >>> wheel.cmd('key.finger', ['minio...
Return the matching key fingerprints. Returns a dictionary. match The key for with to retrieve the fingerprint. hash_type The hash algorithm used to calculate the fingerprint .. code-block:: python >>> wheel.cmd('key.finger', ['minion1']) {'minions': {'minion1': '5d:f6:79...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/key.py#L279-L299
[ "def get_key(opts):\n return Key(opts)\n", "def finger(self, match, hash_type=None):\n '''\n Return the fingerprint for a specified key\n '''\n if hash_type is None:\n hash_type = __opts__['hash_type']\n\n matches = self.name_match(match, True)\n ret = {}\n for status, keys in six.i...
# -*- coding: utf-8 -*- ''' Wheel system wrapper for the Salt key system to be used in interactions with the Salt Master programmatically. The key module for the wheel system is meant to provide an internal interface for other Salt systems to interact with the Salt Master. The following usage examples assume that a Wh...
saltstack/salt
salt/wheel/key.py
finger_master
python
def finger_master(hash_type=None): ''' Return the fingerprint of the master's public key hash_type The hash algorithm used to calculate the fingerprint .. code-block:: python >>> wheel.cmd('key.finger_master') {'local': {'master.pub': '5d:f6:79:43:5e:d4:42:3f:57:b8:45:a8:7e:a4...
Return the fingerprint of the master's public key hash_type The hash algorithm used to calculate the fingerprint .. code-block:: python >>> wheel.cmd('key.finger_master') {'local': {'master.pub': '5d:f6:79:43:5e:d4:42:3f:57:b8:45:a8:7e:a4:6e:ca'}}
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/key.py#L302-L320
[ "def pem_finger(path=None, key=None, sum_type='sha256'):\n '''\n Pass in either a raw pem string, or the path on disk to the location of a\n pem file, and the type of cryptographic hash to use. The default is SHA256.\n The fingerprint of the pem will be returned.\n\n If neither a key nor a path are p...
# -*- coding: utf-8 -*- ''' Wheel system wrapper for the Salt key system to be used in interactions with the Salt Master programmatically. The key module for the wheel system is meant to provide an internal interface for other Salt systems to interact with the Salt Master. The following usage examples assume that a Wh...
saltstack/salt
salt/wheel/key.py
gen
python
def gen(id_=None, keysize=2048): r''' Generate a key pair. No keys are stored on the master. A key pair is returned as a dict containing pub and priv keys. Returns a dictionary containing the the ``pub`` and ``priv`` keys with their generated values. id\_ Set a name to generate a key pair f...
r''' Generate a key pair. No keys are stored on the master. A key pair is returned as a dict containing pub and priv keys. Returns a dictionary containing the the ``pub`` and ``priv`` keys with their generated values. id\_ Set a name to generate a key pair for use with salt. If not specified, ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/key.py#L323-L371
[ "def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ...
# -*- coding: utf-8 -*- ''' Wheel system wrapper for the Salt key system to be used in interactions with the Salt Master programmatically. The key module for the wheel system is meant to provide an internal interface for other Salt systems to interact with the Salt Master. The following usage examples assume that a Wh...
saltstack/salt
salt/wheel/key.py
gen_accept
python
def gen_accept(id_, keysize=2048, force=False): r''' Generate a key pair then accept the public key. This function returns the key pair in a dict, only the public key is preserved on the master. Returns a dictionary. id\_ The name of the minion for which to generate a key pair. keysize...
r''' Generate a key pair then accept the public key. This function returns the key pair in a dict, only the public key is preserved on the master. Returns a dictionary. id\_ The name of the minion for which to generate a key pair. keysize The size of the key pair to generate. The s...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/key.py#L374-L421
[ "def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ...
# -*- coding: utf-8 -*- ''' Wheel system wrapper for the Salt key system to be used in interactions with the Salt Master programmatically. The key module for the wheel system is meant to provide an internal interface for other Salt systems to interact with the Salt Master. The following usage examples assume that a Wh...
saltstack/salt
salt/wheel/key.py
gen_keys
python
def gen_keys(keydir=None, keyname=None, keysize=None, user=None): ''' Generate minion RSA public keypair ''' skey = get_key(__opts__) return skey.gen_keys(keydir, keyname, keysize, user)
Generate minion RSA public keypair
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/key.py#L424-L429
[ "def get_key(opts):\n return Key(opts)\n", "def gen_keys(self, keydir=None, keyname=None, keysize=None, user=None):\n '''\n Generate minion RSA public keypair\n '''\n keydir, keyname, keysize, user = self._get_key_attrs(keydir, keyname,\n keys...
# -*- coding: utf-8 -*- ''' Wheel system wrapper for the Salt key system to be used in interactions with the Salt Master programmatically. The key module for the wheel system is meant to provide an internal interface for other Salt systems to interact with the Salt Master. The following usage examples assume that a Wh...
saltstack/salt
salt/wheel/key.py
gen_signature
python
def gen_signature(priv, pub, signature_path, auto_create=False, keysize=None): ''' Generate master public-key-signature ''' skey = get_key(__opts__) return skey.gen_keys_signature(priv, pub, signature_path, auto_create, keysize)
Generate master public-key-signature
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/wheel/key.py#L432-L437
[ "def get_key(opts):\n return Key(opts)\n", "def gen_keys_signature(self, priv, pub, signature_path, auto_create=False, keysize=None):\n '''\n Generate master public-key-signature\n '''\n # check given pub-key\n if pub:\n if not os.path.isfile(pub):\n return 'Public-key {0} does...
# -*- coding: utf-8 -*- ''' Wheel system wrapper for the Salt key system to be used in interactions with the Salt Master programmatically. The key module for the wheel system is meant to provide an internal interface for other Salt systems to interact with the Salt Master. The following usage examples assume that a Wh...
saltstack/salt
salt/modules/moosefs.py
dirinfo
python
def dirinfo(path, opts=None): ''' Return information on a directory located on the Moose CLI Example: .. code-block:: bash salt '*' moosefs.dirinfo /path/to/dir/ [-[n][h|H]] ''' cmd = 'mfsdirinfo' ret = {} if opts: cmd += ' -' + opts cmd += ' ' + path out = __s...
Return information on a directory located on the Moose CLI Example: .. code-block:: bash salt '*' moosefs.dirinfo /path/to/dir/ [-[n][h|H]]
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/moosefs.py#L20-L43
null
# -*- coding: utf-8 -*- ''' Module for gathering and managing information about MooseFS ''' from __future__ import absolute_import, print_function, unicode_literals # Import salt libs import salt.utils.path def __virtual__(): ''' Only load if the mfs commands are installed ''' if salt.utils.path.whic...
saltstack/salt
salt/modules/moosefs.py
fileinfo
python
def fileinfo(path): ''' Return information on a file located on the Moose CLI Example: .. code-block:: bash salt '*' moosefs.fileinfo /path/to/dir/ ''' cmd = 'mfsfileinfo ' + path ret = {} chunknum = '' out = __salt__['cmd.run_all'](cmd, python_shell=False) output = o...
Return information on a file located on the Moose CLI Example: .. code-block:: bash salt '*' moosefs.fileinfo /path/to/dir/
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/moosefs.py#L46-L89
null
# -*- coding: utf-8 -*- ''' Module for gathering and managing information about MooseFS ''' from __future__ import absolute_import, print_function, unicode_literals # Import salt libs import salt.utils.path def __virtual__(): ''' Only load if the mfs commands are installed ''' if salt.utils.path.whic...
saltstack/salt
salt/modules/moosefs.py
mounts
python
def mounts(): ''' Return a list of current MooseFS mounts CLI Example: .. code-block:: bash salt '*' moosefs.mounts ''' cmd = 'mount' ret = {} out = __salt__['cmd.run_all'](cmd) output = out['stdout'].splitlines() for line in output: if not line: c...
Return a list of current MooseFS mounts CLI Example: .. code-block:: bash salt '*' moosefs.mounts
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/moosefs.py#L92-L124
null
# -*- coding: utf-8 -*- ''' Module for gathering and managing information about MooseFS ''' from __future__ import absolute_import, print_function, unicode_literals # Import salt libs import salt.utils.path def __virtual__(): ''' Only load if the mfs commands are installed ''' if salt.utils.path.whic...
saltstack/salt
salt/modules/moosefs.py
getgoal
python
def getgoal(path, opts=None): ''' Return goal(s) for a file or directory CLI Example: .. code-block:: bash salt '*' moosefs.getgoal /path/to/file [-[n][h|H]] salt '*' moosefs.getgoal /path/to/dir/ [-[n][h|H][r]] ''' cmd = 'mfsgetgoal' ret = {} if opts: cmd += '...
Return goal(s) for a file or directory CLI Example: .. code-block:: bash salt '*' moosefs.getgoal /path/to/file [-[n][h|H]] salt '*' moosefs.getgoal /path/to/dir/ [-[n][h|H][r]]
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/moosefs.py#L127-L164
null
# -*- coding: utf-8 -*- ''' Module for gathering and managing information about MooseFS ''' from __future__ import absolute_import, print_function, unicode_literals # Import salt libs import salt.utils.path def __virtual__(): ''' Only load if the mfs commands are installed ''' if salt.utils.path.whic...
saltstack/salt
salt/utils/win_lgpo_auditpol.py
_auditpol_cmd
python
def _auditpol_cmd(cmd): ''' Helper function for running the auditpol command Args: cmd (str): the auditpol command to run Returns: list: A list containing each line of the return (splitlines) Raises: CommandExecutionError: If the command encounters an error ''' ret...
Helper function for running the auditpol command Args: cmd (str): the auditpol command to run Returns: list: A list containing each line of the return (splitlines) Raises: CommandExecutionError: If the command encounters an error
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_lgpo_auditpol.py#L108-L128
[ "def run_all(cmd,\n cwd=None,\n stdin=None,\n runas=None,\n group=None,\n shell=DEFAULT_SHELL,\n python_shell=None,\n env=None,\n clean_env=False,\n template=None,\n rstrip=True,\n umask=None,\n ...
# -*- coding: utf-8 -*- r''' A salt util for modifying the audit policies on the machine. This util is used by the ``win_auditpol`` and ``win_lgpo`` modules. Though this utility does not set group policy for auditing, it displays how all auditing configuration is applied on the machine, either set directly or via loca...
saltstack/salt
salt/utils/win_lgpo_auditpol.py
get_settings
python
def get_settings(category='All'): ''' Get the current configuration for all audit settings specified in the category Args: category (str): One of the nine categories to return. Can also be ``All`` to return the settings for all categories. Valid options are: ...
Get the current configuration for all audit settings specified in the category Args: category (str): One of the nine categories to return. Can also be ``All`` to return the settings for all categories. Valid options are: - Account Logon - Account Managem...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_lgpo_auditpol.py#L131-L189
[ "def _auditpol_cmd(cmd):\n '''\n Helper function for running the auditpol command\n\n Args:\n cmd (str): the auditpol command to run\n\n Returns:\n list: A list containing each line of the return (splitlines)\n\n Raises:\n CommandExecutionError: If the command encounters an error...
# -*- coding: utf-8 -*- r''' A salt util for modifying the audit policies on the machine. This util is used by the ``win_auditpol`` and ``win_lgpo`` modules. Though this utility does not set group policy for auditing, it displays how all auditing configuration is applied on the machine, either set directly or via loca...
saltstack/salt
salt/utils/win_lgpo_auditpol.py
get_setting
python
def get_setting(name): ''' Get the current configuration for the named audit setting Args: name (str): The name of the setting to retrieve Returns: str: The current configuration for the named setting Raises: KeyError: On invalid setting name CommandExecutionError:...
Get the current configuration for the named audit setting Args: name (str): The name of the setting to retrieve Returns: str: The current configuration for the named setting Raises: KeyError: On invalid setting name CommandExecutionError: If an error is encountered retriev...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_lgpo_auditpol.py#L192-L219
[ "def get_settings(category='All'):\n '''\n Get the current configuration for all audit settings specified in the\n category\n\n Args:\n category (str):\n One of the nine categories to return. Can also be ``All`` to return\n the settings for all categories. Valid options are:...
# -*- coding: utf-8 -*- r''' A salt util for modifying the audit policies on the machine. This util is used by the ``win_auditpol`` and ``win_lgpo`` modules. Though this utility does not set group policy for auditing, it displays how all auditing configuration is applied on the machine, either set directly or via loca...
saltstack/salt
salt/utils/win_lgpo_auditpol.py
set_setting
python
def set_setting(name, value): ''' Set the configuration for the named audit setting Args: name (str): The name of the setting to configure value (str): The configuration for the named value. Valid options are: - No Auditing - Success ...
Set the configuration for the named audit setting Args: name (str): The name of the setting to configure value (str): The configuration for the named value. Valid options are: - No Auditing - Success - Failure - Success and ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_lgpo_auditpol.py#L229-L280
[ "def _get_valid_names():\n if 'auditpol.valid_names' not in __context__:\n settings = get_settings(category='All')\n __context__['auditpol.valid_names'] = [k.lower() for k in settings]\n return __context__['auditpol.valid_names']\n", "def _auditpol_cmd(cmd):\n '''\n Helper function for r...
# -*- coding: utf-8 -*- r''' A salt util for modifying the audit policies on the machine. This util is used by the ``win_auditpol`` and ``win_lgpo`` modules. Though this utility does not set group policy for auditing, it displays how all auditing configuration is applied on the machine, either set directly or via loca...
saltstack/salt
salt/utils/win_lgpo_auditpol.py
get_auditpol_dump
python
def get_auditpol_dump(): ''' Gets the contents of an auditpol /backup. Used by the LGPO module to get fieldnames and GUIDs for Advanced Audit policies. Returns: list: A list of lines form the backup file Usage: .. code-block:: python import salt.utils.win_lgpo_auditpol ...
Gets the contents of an auditpol /backup. Used by the LGPO module to get fieldnames and GUIDs for Advanced Audit policies. Returns: list: A list of lines form the backup file Usage: .. code-block:: python import salt.utils.win_lgpo_auditpol dump = salt.utils.win_lgpo_auditpo...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/win_lgpo_auditpol.py#L283-L308
[ "def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ...
# -*- coding: utf-8 -*- r''' A salt util for modifying the audit policies on the machine. This util is used by the ``win_auditpol`` and ``win_lgpo`` modules. Though this utility does not set group policy for auditing, it displays how all auditing configuration is applied on the machine, either set directly or via loca...
saltstack/salt
salt/states/rbenv.py
_ruby_installed
python
def _ruby_installed(ret, ruby, user=None): ''' Check to see if given ruby is installed. ''' default = __salt__['rbenv.default'](runas=user) for version in __salt__['rbenv.versions'](user): if version == ruby: ret['result'] = True ret['comment'] = 'Requested ruby exist...
Check to see if given ruby is installed.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rbenv.py#L72-L84
null
# -*- coding: utf-8 -*- ''' Managing Ruby installations with rbenv ====================================== This module is used to install and manage ruby installations with rbenv and the ruby-build plugin. Different versions of ruby can be installed, and uninstalled. Rbenv will be installed automatically the first time...
saltstack/salt
salt/states/rbenv.py
_check_and_install_ruby
python
def _check_and_install_ruby(ret, ruby, default=False, user=None): ''' Verify that ruby is installed, install if unavailable ''' ret = _ruby_installed(ret, ruby, user=user) if not ret['result']: if __salt__['rbenv.install_ruby'](ruby, runas=user): ret['result'] = True ...
Verify that ruby is installed, install if unavailable
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rbenv.py#L87-L106
null
# -*- coding: utf-8 -*- ''' Managing Ruby installations with rbenv ====================================== This module is used to install and manage ruby installations with rbenv and the ruby-build plugin. Different versions of ruby can be installed, and uninstalled. Rbenv will be installed automatically the first time...
saltstack/salt
salt/states/rbenv.py
installed
python
def installed(name, default=False, user=None): ''' Verify that the specified ruby is installed with rbenv. Rbenv is installed if necessary. name The version of ruby to install default : False Whether to make this ruby the default. user: None The user to run rbenv as. ...
Verify that the specified ruby is installed with rbenv. Rbenv is installed if necessary. name The version of ruby to install default : False Whether to make this ruby the default. user: None The user to run rbenv as. .. versionadded:: 0.17.0 .. versionadded:: 0.1...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rbenv.py#L109-L147
[ "def _ruby_installed(ret, ruby, user=None):\n '''\n Check to see if given ruby is installed.\n '''\n default = __salt__['rbenv.default'](runas=user)\n for version in __salt__['rbenv.versions'](user):\n if version == ruby:\n ret['result'] = True\n ret['comment'] = 'Request...
# -*- coding: utf-8 -*- ''' Managing Ruby installations with rbenv ====================================== This module is used to install and manage ruby installations with rbenv and the ruby-build plugin. Different versions of ruby can be installed, and uninstalled. Rbenv will be installed automatically the first time...
saltstack/salt
salt/states/rbenv.py
_check_and_uninstall_ruby
python
def _check_and_uninstall_ruby(ret, ruby, user=None): ''' Verify that ruby is uninstalled ''' ret = _ruby_installed(ret, ruby, user=user) if ret['result']: if ret['default']: __salt__['rbenv.default']('system', runas=user) if __salt__['rbenv.uninstall_ruby'](ruby, runas=u...
Verify that ruby is uninstalled
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rbenv.py#L150-L172
null
# -*- coding: utf-8 -*- ''' Managing Ruby installations with rbenv ====================================== This module is used to install and manage ruby installations with rbenv and the ruby-build plugin. Different versions of ruby can be installed, and uninstalled. Rbenv will be installed automatically the first time...
saltstack/salt
salt/states/rbenv.py
absent
python
def absent(name, user=None): ''' Verify that the specified ruby is not installed with rbenv. Rbenv is installed if necessary. name The version of ruby to uninstall user: None The user to run rbenv as. .. versionadded:: 0.17.0 .. versionadded:: 0.16.0 ''' ret =...
Verify that the specified ruby is not installed with rbenv. Rbenv is installed if necessary. name The version of ruby to uninstall user: None The user to run rbenv as. .. versionadded:: 0.17.0 .. versionadded:: 0.16.0
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rbenv.py#L175-L211
[ "def _check_rbenv(ret, user=None):\n '''\n Check to see if rbenv is installed.\n '''\n if not __salt__['rbenv.is_installed'](user):\n ret['result'] = False\n ret['comment'] = 'Rbenv is not installed.'\n return ret\n", "def _ruby_installed(ret, ruby, user=None):\n '''\n Check to ...
# -*- coding: utf-8 -*- ''' Managing Ruby installations with rbenv ====================================== This module is used to install and manage ruby installations with rbenv and the ruby-build plugin. Different versions of ruby can be installed, and uninstalled. Rbenv will be installed automatically the first time...
saltstack/salt
salt/states/rbenv.py
_check_and_install_rbenv
python
def _check_and_install_rbenv(ret, user=None): ''' Verify that rbenv is installed, install if unavailable ''' ret = _check_rbenv(ret, user) if ret['result'] is False: if __salt__['rbenv.install'](user): ret['result'] = True ret['comment'] = 'Rbenv installed' el...
Verify that rbenv is installed, install if unavailable
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rbenv.py#L214-L230
[ "def _check_rbenv(ret, user=None):\n '''\n Check to see if rbenv is installed.\n '''\n if not __salt__['rbenv.is_installed'](user):\n ret['result'] = False\n ret['comment'] = 'Rbenv is not installed.'\n return ret\n" ]
# -*- coding: utf-8 -*- ''' Managing Ruby installations with rbenv ====================================== This module is used to install and manage ruby installations with rbenv and the ruby-build plugin. Different versions of ruby can be installed, and uninstalled. Rbenv will be installed automatically the first time...
saltstack/salt
salt/states/rbenv.py
install_rbenv
python
def install_rbenv(name, user=None): ''' Install rbenv if not installed. Allows you to require rbenv be installed prior to installing the plugins. Useful if you want to install rbenv plugins via the git or file modules and need them installed before installing any rubies. Use the rbenv.root conf...
Install rbenv if not installed. Allows you to require rbenv be installed prior to installing the plugins. Useful if you want to install rbenv plugins via the git or file modules and need them installed before installing any rubies. Use the rbenv.root configuration option to set the path for rbenv if yo...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/rbenv.py#L233-L258
[ "def _check_rbenv(ret, user=None):\n '''\n Check to see if rbenv is installed.\n '''\n if not __salt__['rbenv.is_installed'](user):\n ret['result'] = False\n ret['comment'] = 'Rbenv is not installed.'\n return ret\n", "def _check_and_install_rbenv(ret, user=None):\n '''\n Verify...
# -*- coding: utf-8 -*- ''' Managing Ruby installations with rbenv ====================================== This module is used to install and manage ruby installations with rbenv and the ruby-build plugin. Different versions of ruby can be installed, and uninstalled. Rbenv will be installed automatically the first time...
saltstack/salt
salt/modules/nftables.py
build_rule
python
def build_rule(table=None, chain=None, command=None, position='', full=None, family='ipv4', **kwargs): ''' Build a well-formatted nftables rule based on kwargs. A `table` and `chain` are not required, unless `full` is True. If `full` is `True`, then `table`, `chain` and `command` are req...
Build a well-formatted nftables rule based on kwargs. A `table` and `chain` are not required, unless `full` is True. If `full` is `True`, then `table`, `chain` and `command` are required. `command` may be specified as either insert, append, or delete. This will return the nftables command, exactly as i...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nftables.py#L86-L274
[ "def _nftables_cmd():\n '''\n Return correct command\n '''\n return 'nft'\n" ]
# -*- coding: utf-8 -*- ''' Support for nftables ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging import re # Import salt libs from salt.ext import six import salt.utils.data import salt.utils.files import salt.utils.path from salt.state import STATE_INT...
saltstack/salt
salt/modules/nftables.py
get_saved_rules
python
def get_saved_rules(conf_file=None): ''' Return a data structure of the rules in the conf file CLI Example: .. code-block:: bash salt '*' nftables.get_saved_rules ''' if _conf() and not conf_file: conf_file = _conf() with salt.utils.files.fopen(conf_file) as fp_: ...
Return a data structure of the rules in the conf file CLI Example: .. code-block:: bash salt '*' nftables.get_saved_rules
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nftables.py#L277-L301
[ "def decode(data, encoding=None, errors='strict', keep=False,\n normalize=False, preserve_dict_class=False, preserve_tuples=False,\n to_str=False):\n '''\n Generic function which will decode whichever type is passed, if necessary.\n Optionally use to_str=True to ensure strings are str t...
# -*- coding: utf-8 -*- ''' Support for nftables ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging import re # Import salt libs from salt.ext import six import salt.utils.data import salt.utils.files import salt.utils.path from salt.state import STATE_INT...
saltstack/salt
salt/modules/nftables.py
get_rules
python
def get_rules(family='ipv4'): ''' Return a data structure of the current, in-memory rules CLI Example: .. code-block:: bash salt '*' nftables.get_rules salt '*' nftables.get_rules family=ipv6 ''' nft_family = _NFTABLES_FAMILIES[family] rules = [] cmd = '{0} --numeric...
Return a data structure of the current, in-memory rules CLI Example: .. code-block:: bash salt '*' nftables.get_rules salt '*' nftables.get_rules family=ipv6
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nftables.py#L304-L334
[ "def _nftables_cmd():\n '''\n Return correct command\n '''\n return 'nft'\n" ]
# -*- coding: utf-8 -*- ''' Support for nftables ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging import re # Import salt libs from salt.ext import six import salt.utils.data import salt.utils.files import salt.utils.path from salt.state import STATE_INT...
saltstack/salt
salt/modules/nftables.py
save
python
def save(filename=None, family='ipv4'): ''' Save the current in-memory rules to disk CLI Example: .. code-block:: bash salt '*' nftables.save /etc/nftables ''' if _conf() and not filename: filename = _conf() nft_families = ['ip', 'ip6', 'arp', 'bridge'] rules = "#! nf...
Save the current in-memory rules to disk CLI Example: .. code-block:: bash salt '*' nftables.save /etc/nftables
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nftables.py#L337-L367
[ "def encode(data, encoding=None, errors='strict', keep=False,\n preserve_dict_class=False, preserve_tuples=False):\n '''\n Generic function which will encode whichever type is passed, if necessary\n\n If `strict` is True, and `keep` is False, and we fail to encode, a\n UnicodeEncodeError will ...
# -*- coding: utf-8 -*- ''' Support for nftables ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging import re # Import salt libs from salt.ext import six import salt.utils.data import salt.utils.files import salt.utils.path from salt.state import STATE_INT...
saltstack/salt
salt/modules/nftables.py
get_rule_handle
python
def get_rule_handle(table='filter', chain=None, rule=None, family='ipv4'): ''' Get the handle for a particular rule This function accepts a rule in a standard nftables command format, starting with the chain. Trying to force users to adapt to a new method of creating rules would be irritati...
Get the handle for a particular rule This function accepts a rule in a standard nftables command format, starting with the chain. Trying to force users to adapt to a new method of creating rules would be irritating at best, and we already have a parser that can handle it. CLI Example: ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nftables.py#L370-L426
[ "def check(table='filter', chain=None, rule=None, family='ipv4'):\n '''\n Check for the existence of a rule in the table and chain\n\n This function accepts a rule in a standard nftables command format,\n starting with the chain. Trying to force users to adapt to a new\n method of creating ru...
# -*- coding: utf-8 -*- ''' Support for nftables ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging import re # Import salt libs from salt.ext import six import salt.utils.data import salt.utils.files import salt.utils.path from salt.state import STATE_INT...
saltstack/salt
salt/modules/nftables.py
check
python
def check(table='filter', chain=None, rule=None, family='ipv4'): ''' Check for the existence of a rule in the table and chain This function accepts a rule in a standard nftables command format, starting with the chain. Trying to force users to adapt to a new method of creating rules would b...
Check for the existence of a rule in the table and chain This function accepts a rule in a standard nftables command format, starting with the chain. Trying to force users to adapt to a new method of creating rules would be irritating at best, and we already have a parser that can handle it...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nftables.py#L429-L482
[ "def check_chain(table='filter', chain=None, family='ipv4'):\n '''\n .. versionadded:: 2014.7.0\n\n Check for the existence of a chain in the table\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' nftables.check_chain filter input\n\n IPv6:\n salt '*' nftables.check_chain f...
# -*- coding: utf-8 -*- ''' Support for nftables ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging import re # Import salt libs from salt.ext import six import salt.utils.data import salt.utils.files import salt.utils.path from salt.state import STATE_INT...
saltstack/salt
salt/modules/nftables.py
check_table
python
def check_table(table=None, family='ipv4'): ''' Check for the existence of a table CLI Example:: salt '*' nftables.check_table nat ''' ret = {'comment': '', 'result': False} if not table: ret['comment'] = 'Table needs to be specified' return ret nft_fam...
Check for the existence of a table CLI Example:: salt '*' nftables.check_table nat
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nftables.py#L522-L548
[ "def _nftables_cmd():\n '''\n Return correct command\n '''\n return 'nft'\n" ]
# -*- coding: utf-8 -*- ''' Support for nftables ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging import re # Import salt libs from salt.ext import six import salt.utils.data import salt.utils.files import salt.utils.path from salt.state import STATE_INT...
saltstack/salt
salt/modules/nftables.py
new_chain
python
def new_chain(table='filter', chain=None, table_type=None, hook=None, priority=None, family='ipv4'): ''' .. versionadded:: 2014.7.0 Create new chain to the specified table. CLI Example: .. code-block:: bash salt '*' nftables.new_chain filter input salt '*' nftables.new_chain fil...
.. versionadded:: 2014.7.0 Create new chain to the specified table. CLI Example: .. code-block:: bash salt '*' nftables.new_chain filter input salt '*' nftables.new_chain filter input \\ table_type=filter hook=input priority=0 salt '*' nftables.new_chain filter ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nftables.py#L631-L694
[ "def check_chain(table='filter', chain=None, family='ipv4'):\n '''\n .. versionadded:: 2014.7.0\n\n Check for the existence of a chain in the table\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' nftables.check_chain filter input\n\n IPv6:\n salt '*' nftables.check_chain f...
# -*- coding: utf-8 -*- ''' Support for nftables ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging import re # Import salt libs from salt.ext import six import salt.utils.data import salt.utils.files import salt.utils.path from salt.state import STATE_INT...
saltstack/salt
salt/modules/nftables.py
flush
python
def flush(table='filter', chain='', family='ipv4'): ''' Flush the chain in the specified table, flush all chains in the specified table if chain is not specified. CLI Example: .. code-block:: bash salt '*' nftables.flush filter salt '*' nftables.flush filter input IPv6: ...
Flush the chain in the specified table, flush all chains in the specified table if chain is not specified. CLI Example: .. code-block:: bash salt '*' nftables.flush filter salt '*' nftables.flush filter input IPv6: salt '*' nftables.flush filter input family=ipv6
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nftables.py#L948-L993
[ "def check_chain(table='filter', chain=None, family='ipv4'):\n '''\n .. versionadded:: 2014.7.0\n\n Check for the existence of a chain in the table\n\n CLI Example:\n\n .. code-block:: bash\n\n salt '*' nftables.check_chain filter input\n\n IPv6:\n salt '*' nftables.check_chain f...
# -*- coding: utf-8 -*- ''' Support for nftables ''' from __future__ import absolute_import, print_function, unicode_literals # Import python libs import logging import re # Import salt libs from salt.ext import six import salt.utils.data import salt.utils.files import salt.utils.path from salt.state import STATE_INT...
saltstack/salt
salt/renderers/stateconf.py
rewrite_single_shorthand_state_decl
python
def rewrite_single_shorthand_state_decl(data): # pylint: disable=C0103 ''' Rewrite all state declarations that look like this:: state_id_decl: state.func into:: state_id_decl: state.func: [] ''' for sid, states in six.iteritems(data): if isinstance(states, six...
Rewrite all state declarations that look like this:: state_id_decl: state.func into:: state_id_decl: state.func: []
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/stateconf.py#L251-L265
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n" ]
# -*- coding: utf-8 -*- ''' A flexible renderer that takes a templating engine and a data format :maintainer: Jack Kuan <kjkuan@gmail.com> :maturity: new :platform: all ''' # See http://docs.saltstack.org/en/latest/ref/renderers/all/salt.renderers.stateconf.html # for a guide to using this module. # # FIXME: I really ...
saltstack/salt
salt/renderers/stateconf.py
_relative_to_abs_sls
python
def _relative_to_abs_sls(relative, sls): ''' Convert ``relative`` sls reference into absolute, relative to ``sls``. ''' levels, suffix = re.match(r'^(\.+)(.*)$', relative).groups() level_count = len(levels) p_comps = sls.split('.') if level_count > len(p_comps): raise SaltRenderError...
Convert ``relative`` sls reference into absolute, relative to ``sls``.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/stateconf.py#L296-L307
null
# -*- coding: utf-8 -*- ''' A flexible renderer that takes a templating engine and a data format :maintainer: Jack Kuan <kjkuan@gmail.com> :maturity: new :platform: all ''' # See http://docs.saltstack.org/en/latest/ref/renderers/all/salt.renderers.stateconf.html # for a guide to using this module. # # FIXME: I really ...
saltstack/salt
salt/renderers/stateconf.py
nvlist
python
def nvlist(thelist, names=None): ''' Given a list of items:: - whatever - name1: value1 - name2: - key: value - key: value return a generator that yields each (item, key, value) tuple, skipping items that are not name-value's(dictionaries) or those not in th...
Given a list of items:: - whatever - name1: value1 - name2: - key: value - key: value return a generator that yields each (item, key, value) tuple, skipping items that are not name-value's(dictionaries) or those not in the list of matching names. The item in the...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/stateconf.py#L310-L331
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n" ]
# -*- coding: utf-8 -*- ''' A flexible renderer that takes a templating engine and a data format :maintainer: Jack Kuan <kjkuan@gmail.com> :maturity: new :platform: all ''' # See http://docs.saltstack.org/en/latest/ref/renderers/all/salt.renderers.stateconf.html # for a guide to using this module. # # FIXME: I really ...
saltstack/salt
salt/renderers/stateconf.py
nvlist2
python
def nvlist2(thelist, names=None): ''' Like nvlist but applied one more time to each returned value. So, given a list, args, of arguments to a state like this:: - name: echo test - cwd: / - require: - file: test.sh nvlist2(args, ['require']) would yield the tuple, (dict_i...
Like nvlist but applied one more time to each returned value. So, given a list, args, of arguments to a state like this:: - name: echo test - cwd: / - require: - file: test.sh nvlist2(args, ['require']) would yield the tuple, (dict_item, 'file', 'test.sh') where dict_item is the...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/stateconf.py#L334-L351
[ "def nvlist(thelist, names=None):\n '''\n Given a list of items::\n\n - whatever\n - name1: value1\n - name2:\n - key: value\n - key: value\n\n return a generator that yields each (item, key, value) tuple, skipping\n items that are not name-value's(dictionaries) or...
# -*- coding: utf-8 -*- ''' A flexible renderer that takes a templating engine and a data format :maintainer: Jack Kuan <kjkuan@gmail.com> :maturity: new :platform: all ''' # See http://docs.saltstack.org/en/latest/ref/renderers/all/salt.renderers.stateconf.html # for a guide to using this module. # # FIXME: I really ...
saltstack/salt
salt/modules/statuspage.py
_get_api_params
python
def _get_api_params(api_url=None, page_id=None, api_key=None, api_version=None): ''' Retrieve the API params from the config file. ''' statuspage_cfg = __salt__['config.get']('statuspage') if not statuspage_cfg: statuspage_cfg = {} ...
Retrieve the API params from the config file.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/statuspage.py#L86-L101
null
# -*- coding: utf-8 -*- ''' StatusPage ========== Handle requests for the StatusPage_ API_. .. _StatusPage: https://www.statuspage.io/ .. _API: http://doers.statuspage.io/api/v1/ In the minion configuration file, the following block is required: .. code-block:: yaml statuspage: api_key: <API_KEY> page_id...
saltstack/salt
salt/modules/statuspage.py
_validate_api_params
python
def _validate_api_params(params): ''' Validate the API params as specified in the config file. ''' # page_id and API key are mandatory and they must be string/unicode return (isinstance(params['api_page_id'], (six.string_types, six.text_type)) and isinstance(params['api_key'], (six.strin...
Validate the API params as specified in the config file.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/statuspage.py#L104-L110
null
# -*- coding: utf-8 -*- ''' StatusPage ========== Handle requests for the StatusPage_ API_. .. _StatusPage: https://www.statuspage.io/ .. _API: http://doers.statuspage.io/api/v1/ In the minion configuration file, the following block is required: .. code-block:: yaml statuspage: api_key: <API_KEY> page_id...
saltstack/salt
salt/modules/statuspage.py
_http_request
python
def _http_request(url, method='GET', headers=None, data=None): ''' Make the HTTP request and return the body as python object. ''' req = requests.request(method, url, headers=headers, ...
Make the HTTP request and return the body as python object.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/statuspage.py#L122-L144
null
# -*- coding: utf-8 -*- ''' StatusPage ========== Handle requests for the StatusPage_ API_. .. _StatusPage: https://www.statuspage.io/ .. _API: http://doers.statuspage.io/api/v1/ In the minion configuration file, the following block is required: .. code-block:: yaml statuspage: api_key: <API_KEY> page_id...
saltstack/salt
salt/modules/statuspage.py
retrieve
python
def retrieve(endpoint='incidents', api_url=None, page_id=None, api_key=None, api_version=None): ''' Retrieve a specific endpoint from the Statuspage API. endpoint: incidents Request a specific endpoint. page_id Page ID. Can also be sp...
Retrieve a specific endpoint from the Statuspage API. endpoint: incidents Request a specific endpoint. page_id Page ID. Can also be specified in the config file. api_key API key. Can also be specified in the config file. api_version: 1 API version. Can also be specifi...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/statuspage.py#L246-L378
[ "def _get_api_params(api_url=None,\n page_id=None,\n api_key=None,\n api_version=None):\n '''\n Retrieve the API params from the config file.\n '''\n statuspage_cfg = __salt__['config.get']('statuspage')\n if not statuspage_cfg:\n status...
# -*- coding: utf-8 -*- ''' StatusPage ========== Handle requests for the StatusPage_ API_. .. _StatusPage: https://www.statuspage.io/ .. _API: http://doers.statuspage.io/api/v1/ In the minion configuration file, the following block is required: .. code-block:: yaml statuspage: api_key: <API_KEY> page_id...
saltstack/salt
salt/modules/statuspage.py
update
python
def update(endpoint='incidents', id=None, api_url=None, page_id=None, api_key=None, api_version=None, **kwargs): ''' Update attribute(s) of a specific endpoint. id The unique ID of the enpoint entry. endpoint: incidents ...
Update attribute(s) of a specific endpoint. id The unique ID of the enpoint entry. endpoint: incidents Endpoint name. page_id Page ID. Can also be specified in the config file. api_key API key. Can also be specified in the config file. api_version: 1 API ...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/statuspage.py#L381-L483
[ "def iteritems(d, **kw):\n return d.iteritems(**kw)\n", "def _get_headers(params):\n '''\n Return HTTP headers required.\n '''\n return {\n 'Authorization': 'OAuth {oauth}'.format(oauth=params['api_key'])\n }\n", "def _get_api_params(api_url=None,\n page_id=None,\n ...
# -*- coding: utf-8 -*- ''' StatusPage ========== Handle requests for the StatusPage_ API_. .. _StatusPage: https://www.statuspage.io/ .. _API: http://doers.statuspage.io/api/v1/ In the minion configuration file, the following block is required: .. code-block:: yaml statuspage: api_key: <API_KEY> page_id...
saltstack/salt
salt/modules/statuspage.py
delete
python
def delete(endpoint='incidents', id=None, api_url=None, page_id=None, api_key=None, api_version=None): ''' Remove an entry from an endpoint. endpoint: incidents Request a specific endpoint. page_id Page ID. Can also be specified in...
Remove an entry from an endpoint. endpoint: incidents Request a specific endpoint. page_id Page ID. Can also be specified in the config file. api_key API key. Can also be specified in the config file. api_version: 1 API version. Can also be specified in the config fil...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/statuspage.py#L486-L556
[ "def _get_headers(params):\n '''\n Return HTTP headers required.\n '''\n return {\n 'Authorization': 'OAuth {oauth}'.format(oauth=params['api_key'])\n }\n", "def _get_api_params(api_url=None,\n page_id=None,\n api_key=None,\n api_versi...
# -*- coding: utf-8 -*- ''' StatusPage ========== Handle requests for the StatusPage_ API_. .. _StatusPage: https://www.statuspage.io/ .. _API: http://doers.statuspage.io/api/v1/ In the minion configuration file, the following block is required: .. code-block:: yaml statuspage: api_key: <API_KEY> page_id...
saltstack/salt
salt/modules/freebsdpkg.py
_get_repo_options
python
def _get_repo_options(fromrepo=None, packagesite=None): ''' Return a list of tuples to seed the "env" list, which is used to set environment variables for any pkg_add commands that are spawned. If ``fromrepo`` or ``packagesite`` are None, then their corresponding config parameter will be looked up ...
Return a list of tuples to seed the "env" list, which is used to set environment variables for any pkg_add commands that are spawned. If ``fromrepo`` or ``packagesite`` are None, then their corresponding config parameter will be looked up with config.get. If both ``fromrepo`` and ``packagesite`` are N...
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdpkg.py#L113-L135
null
# -*- coding: utf-8 -*- ''' Remote package support using ``pkg_add(1)`` .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-ov...
saltstack/salt
salt/modules/freebsdpkg.py
_match
python
def _match(names): ''' Since pkg_delete requires the full "pkgname-version" string, this function will attempt to match the package name with its version. Returns a list of partial matches and package names that match the "pkgname-version" string required by pkg_delete, and a list of errors encounte...
Since pkg_delete requires the full "pkgname-version" string, this function will attempt to match the package name with its version. Returns a list of partial matches and package names that match the "pkgname-version" string required by pkg_delete, and a list of errors encountered.
train
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/freebsdpkg.py#L138-L184
null
# -*- coding: utf-8 -*- ''' Remote package support using ``pkg_add(1)`` .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-ov...