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/win_system.py | join_domain | python | def join_domain(domain,
username=None,
password=None,
account_ou=None,
account_exists=False,
restart=False):
'''
Join a computer to an Active Directory domain. Requires a reboot.
Args:
domain (str):
The dom... | Join a computer to an Active Directory domain. Requires a reboot.
Args:
domain (str):
The domain to which the computer should be joined, e.g.
``example.com``
username (str):
Username of an account which is authorized to join computers to the
specifi... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L701-L785 | [
"def reboot(timeout=5, in_seconds=False, wait_for_reboot=False, # pylint: disable=redefined-outer-name\n only_on_pending_reboot=False):\n '''\n Reboot a running system.\n\n Args:\n\n timeout (int):\n The number of minutes/seconds before rebooting the system. Use of\n ... | # -*- coding: utf-8 -*-
'''
Module for managing windows systems.
:depends:
- pywintypes
- win32api
- win32con
- win32net
- wmi
Support for reboot, shutdown, etc
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import Python libs
import ctypes
import logging
import ti... |
saltstack/salt | salt/modules/win_system.py | _join_domain | python | def _join_domain(domain,
username=None,
password=None,
account_ou=None,
account_exists=False):
'''
Helper function to join the domain.
Args:
domain (str): The domain to which the computer should be joined, e.g.
``exampl... | Helper function to join the domain.
Args:
domain (str): The domain to which the computer should be joined, e.g.
``example.com``
username (str): Username of an account which is authorized to join
computers to the specified domain. Need to be either fully qualified
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L788-L846 | null | # -*- coding: utf-8 -*-
'''
Module for managing windows systems.
:depends:
- pywintypes
- win32api
- win32con
- win32net
- wmi
Support for reboot, shutdown, etc
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import Python libs
import ctypes
import logging
import ti... |
saltstack/salt | salt/modules/win_system.py | unjoin_domain | python | def unjoin_domain(username=None,
password=None,
domain=None,
workgroup='WORKGROUP',
disable=False,
restart=False):
# pylint: disable=anomalous-backslash-in-string
'''
Unjoin a computer from an Active Directory Domain. ... | Unjoin a computer from an Active Directory Domain. Requires a restart.
Args:
username (str):
Username of an account which is authorized to manage computer
accounts on the domain. Needs to be a fully qualified name like
``user@domain.tld`` or ``domain.tld\\user``. If the... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L849-L954 | [
"def reboot(timeout=5, in_seconds=False, wait_for_reboot=False, # pylint: disable=redefined-outer-name\n only_on_pending_reboot=False):\n '''\n Reboot a running system.\n\n Args:\n\n timeout (int):\n The number of minutes/seconds before rebooting the system. Use of\n ... | # -*- coding: utf-8 -*-
'''
Module for managing windows systems.
:depends:
- pywintypes
- win32api
- win32con
- win32net
- wmi
Support for reboot, shutdown, etc
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import Python libs
import ctypes
import logging
import ti... |
saltstack/salt | salt/modules/win_system.py | get_domain_workgroup | python | def get_domain_workgroup():
'''
Get the domain or workgroup the computer belongs to.
.. versionadded:: 2015.5.7
.. versionadded:: 2015.8.2
Returns:
str: The name of the domain or workgroup
CLI Example:
.. code-block:: bash
salt 'minion-id' system.get_domain_workgroup
... | Get the domain or workgroup the computer belongs to.
.. versionadded:: 2015.5.7
.. versionadded:: 2015.8.2
Returns:
str: The name of the domain or workgroup
CLI Example:
.. code-block:: bash
salt 'minion-id' system.get_domain_workgroup | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L957-L979 | null | # -*- coding: utf-8 -*-
'''
Module for managing windows systems.
:depends:
- pywintypes
- win32api
- win32con
- win32net
- wmi
Support for reboot, shutdown, etc
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import Python libs
import ctypes
import logging
import ti... |
saltstack/salt | salt/modules/win_system.py | set_domain_workgroup | python | def set_domain_workgroup(workgroup):
'''
Set the domain or workgroup the computer belongs to.
.. versionadded:: 2019.2.0
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt 'minion-id' system.set_domain_workgroup LOCAL
'''
... | Set the domain or workgroup the computer belongs to.
.. versionadded:: 2019.2.0
Returns:
bool: ``True`` if successful, otherwise ``False``
CLI Example:
.. code-block:: bash
salt 'minion-id' system.set_domain_workgroup LOCAL | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L982-L1009 | [
"def _to_unicode(instr):\n '''\n Converts from current users character encoding to unicode.\n When instr has a value of None, the return value of the function\n will also be None.\n '''\n if instr is None or isinstance(instr, six.text_type):\n return instr\n else:\n return six.tex... | # -*- coding: utf-8 -*-
'''
Module for managing windows systems.
:depends:
- pywintypes
- win32api
- win32con
- win32net
- wmi
Support for reboot, shutdown, etc
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import Python libs
import ctypes
import logging
import ti... |
saltstack/salt | salt/modules/win_system.py | _try_parse_datetime | python | def _try_parse_datetime(time_str, fmts):
'''
A helper function that attempts to parse the input time_str as a date.
Args:
time_str (str): A string representing the time
fmts (list): A list of date format strings
Returns:
datetime: Returns a datetime object if parsed properly,... | A helper function that attempts to parse the input time_str as a date.
Args:
time_str (str): A string representing the time
fmts (list): A list of date format strings
Returns:
datetime: Returns a datetime object if parsed properly, otherwise None | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1012-L1032 | null | # -*- coding: utf-8 -*-
'''
Module for managing windows systems.
:depends:
- pywintypes
- win32api
- win32con
- win32net
- wmi
Support for reboot, shutdown, etc
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import Python libs
import ctypes
import logging
import ti... |
saltstack/salt | salt/modules/win_system.py | get_system_time | python | def get_system_time():
'''
Get the system time.
Returns:
str: Returns the system time in HH:MM:SS AM/PM format.
CLI Example:
.. code-block:: bash
salt 'minion-id' system.get_system_time
'''
now = win32api.GetLocalTime()
meridian = 'AM'
hours = int(now[4])
if h... | Get the system time.
Returns:
str: Returns the system time in HH:MM:SS AM/PM format.
CLI Example:
.. code-block:: bash
salt 'minion-id' system.get_system_time | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1035-L1058 | null | # -*- coding: utf-8 -*-
'''
Module for managing windows systems.
:depends:
- pywintypes
- win32api
- win32con
- win32net
- wmi
Support for reboot, shutdown, etc
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import Python libs
import ctypes
import logging
import ti... |
saltstack/salt | salt/modules/win_system.py | set_system_date_time | python | def set_system_date_time(years=None,
months=None,
days=None,
hours=None,
minutes=None,
seconds=None):
'''
Set the system date and time. Each argument is an element of the date, but
no... | Set the system date and time. Each argument is an element of the date, but
not required. If an element is not passed, the current system value for that
element will be used. For example, if you don't pass the year, the current
system year will be used. (Used by set_system_date and set_system_time)
Args... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1096-L1179 | null | # -*- coding: utf-8 -*-
'''
Module for managing windows systems.
:depends:
- pywintypes
- win32api
- win32con
- win32net
- wmi
Support for reboot, shutdown, etc
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import Python libs
import ctypes
import logging
import ti... |
saltstack/salt | salt/modules/win_system.py | set_system_date | python | def set_system_date(newdate):
'''
Set the Windows system date. Use <mm-dd-yy> format for the date.
Args:
newdate (str):
The date to set. Can be any of the following formats
- YYYY-MM-DD
- MM-DD-YYYY
- MM-DD-YY
- MM/DD/YYYY
- M... | Set the Windows system date. Use <mm-dd-yy> format for the date.
Args:
newdate (str):
The date to set. Can be any of the following formats
- YYYY-MM-DD
- MM-DD-YYYY
- MM-DD-YY
- MM/DD/YYYY
- MM/DD/YY
- YYYY/MM/DD
Retu... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1199-L1233 | [
"def _try_parse_datetime(time_str, fmts):\n '''\n A helper function that attempts to parse the input time_str as a date.\n\n Args:\n\n time_str (str): A string representing the time\n\n fmts (list): A list of date format strings\n\n Returns:\n datetime: Returns a datetime object if ... | # -*- coding: utf-8 -*-
'''
Module for managing windows systems.
:depends:
- pywintypes
- win32api
- win32con
- win32net
- wmi
Support for reboot, shutdown, etc
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import Python libs
import ctypes
import logging
import ti... |
saltstack/salt | salt/modules/win_system.py | get_pending_component_servicing | python | def get_pending_component_servicing():
'''
Determine whether there are pending Component Based Servicing tasks that
require a reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending Component Based Servicing tasks,
otherwise ``False``
CLI Example:
... | Determine whether there are pending Component Based Servicing tasks that
require a reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending Component Based Servicing tasks,
otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' system.get_... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1268-L1294 | null | # -*- coding: utf-8 -*-
'''
Module for managing windows systems.
:depends:
- pywintypes
- win32api
- win32con
- win32net
- wmi
Support for reboot, shutdown, etc
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import Python libs
import ctypes
import logging
import ti... |
saltstack/salt | salt/modules/win_system.py | get_pending_domain_join | python | def get_pending_domain_join():
'''
Determine whether there is a pending domain join action that requires a
reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there is a pending domain join action, otherwise
``False``
CLI Example:
.. code-block:: bash
... | Determine whether there is a pending domain join action that requires a
reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there is a pending domain join action, otherwise
``False``
CLI Example:
.. code-block:: bash
salt '*' system.get_pending_domain_join | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1297-L1332 | null | # -*- coding: utf-8 -*-
'''
Module for managing windows systems.
:depends:
- pywintypes
- win32api
- win32con
- win32net
- wmi
Support for reboot, shutdown, etc
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import Python libs
import ctypes
import logging
import ti... |
saltstack/salt | salt/modules/win_system.py | get_pending_file_rename | python | def get_pending_file_rename():
'''
Determine whether there are pending file rename operations that require a
reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending file rename operations, otherwise
``False``
CLI Example:
.. code-block:: bash
... | Determine whether there are pending file rename operations that require a
reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending file rename operations, otherwise
``False``
CLI Example:
.. code-block:: bash
salt '*' system.get_pending_file_renam... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1335-L1368 | null | # -*- coding: utf-8 -*-
'''
Module for managing windows systems.
:depends:
- pywintypes
- win32api
- win32con
- win32net
- wmi
Support for reboot, shutdown, etc
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import Python libs
import ctypes
import logging
import ti... |
saltstack/salt | salt/modules/win_system.py | get_pending_servermanager | python | def get_pending_servermanager():
'''
Determine whether there are pending Server Manager tasks that require a
reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending Server Manager tasks, otherwise
``False``
CLI Example:
.. code-block:: bash
... | Determine whether there are pending Server Manager tasks that require a
reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending Server Manager tasks, otherwise
``False``
CLI Example:
.. code-block:: bash
salt '*' system.get_pending_servermanager | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1371-L1407 | null | # -*- coding: utf-8 -*-
'''
Module for managing windows systems.
:depends:
- pywintypes
- win32api
- win32con
- win32net
- wmi
Support for reboot, shutdown, etc
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import Python libs
import ctypes
import logging
import ti... |
saltstack/salt | salt/modules/win_system.py | get_pending_update | python | def get_pending_update():
'''
Determine whether there are pending updates that require a reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending updates, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' system.get_pending_update
'''... | Determine whether there are pending updates that require a reboot.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if there are pending updates, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' system.get_pending_update | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1410-L1434 | null | # -*- coding: utf-8 -*-
'''
Module for managing windows systems.
:depends:
- pywintypes
- win32api
- win32con
- win32net
- wmi
Support for reboot, shutdown, etc
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import Python libs
import ctypes
import logging
import ti... |
saltstack/salt | salt/modules/win_system.py | set_reboot_required_witnessed | python | def set_reboot_required_witnessed():
r'''
This function is used to remember that an event indicating that a reboot is
required was witnessed. This function relies on the salt-minion's ability to
create the following volatile registry key in the *HKLM* hive:
*SYSTEM\\CurrentControlSet\\Services\\... | r'''
This function is used to remember that an event indicating that a reboot is
required was witnessed. This function relies on the salt-minion's ability to
create the following volatile registry key in the *HKLM* hive:
*SYSTEM\\CurrentControlSet\\Services\\salt-minion\\Volatile-Data*
Because ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1443-L1476 | null | # -*- coding: utf-8 -*-
'''
Module for managing windows systems.
:depends:
- pywintypes
- win32api
- win32con
- win32net
- wmi
Support for reboot, shutdown, etc
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import Python libs
import ctypes
import logging
import ti... |
saltstack/salt | salt/modules/win_system.py | get_pending_reboot | python | def get_pending_reboot():
'''
Determine whether there is a reboot pending.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if the system is pending reboot, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' system.get_pending_reboot
'''
# Order the c... | Determine whether there is a reboot pending.
.. versionadded:: 2016.11.0
Returns:
bool: ``True`` if the system is pending reboot, otherwise ``False``
CLI Example:
.. code-block:: bash
salt '*' system.get_pending_reboot | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1508-L1537 | [
"def get_reboot_required_witnessed():\n '''\n Determine if at any time during the current boot session the salt minion\n witnessed an event indicating that a reboot is required.\n\n This function will return ``True`` if an install completed with exit\n code 3010 during the current boot session and ca... | # -*- coding: utf-8 -*-
'''
Module for managing windows systems.
:depends:
- pywintypes
- win32api
- win32con
- win32net
- wmi
Support for reboot, shutdown, etc
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import Python libs
import ctypes
import logging
import ti... |
saltstack/salt | salt/states/postgres_extension.py | present | python | def present(name,
if_not_exists=None,
schema=None,
ext_version=None,
from_version=None,
user=None,
maintenance_db=None,
db_user=None,
db_password=None,
db_host=None,
db_port=None):
'''
Ensure ... | Ensure that the named extension is present.
.. note::
Before you can use the state to load an extension into a database, the
extension's supporting files must be already installed.
For more information about all of these options see ``CREATE EXTENSION`` SQL
command reference in the Postgr... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/postgres_extension.py#L36-L151 | null | # -*- coding: utf-8 -*-
'''
Management of PostgreSQL extensions
===================================
A module used to install and manage PostgreSQL extensions.
.. code-block:: yaml
adminpack:
postgres_extension.present
.. versionadded:: 2014.7.0
'''
from __future__ import absolute_import, unicode_literals... |
saltstack/salt | salt/states/postgres_extension.py | absent | python | def absent(name,
if_exists=None,
restrict=None,
cascade=None,
user=None,
maintenance_db=None,
db_user=None,
db_password=None,
db_host=None,
db_port=None):
'''
Ensure that the named extension is absent.
name
... | Ensure that the named extension is absent.
name
Extension name of the extension to remove
if_exists
Add if exist slug
restrict
Add restrict slug
cascade
Drop on cascade
user
System user all operations should be performed on behalf of
maintenance_db
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/postgres_extension.py#L154-L232 | null | # -*- coding: utf-8 -*-
'''
Management of PostgreSQL extensions
===================================
A module used to install and manage PostgreSQL extensions.
.. code-block:: yaml
adminpack:
postgres_extension.present
.. versionadded:: 2014.7.0
'''
from __future__ import absolute_import, unicode_literals... |
saltstack/salt | salt/auth/file.py | _get_file_auth_config | python | def _get_file_auth_config():
'''
Setup defaults and check configuration variables for auth backends
'''
config = {
'filetype': 'text',
'hashtype': 'plaintext',
'field_separator': ':',
'username_field': 1,
'password_field': 2,
}
for opt in __opts__['exter... | Setup defaults and check configuration variables for auth backends | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/file.py#L116-L146 | null | # -*- coding: utf-8 -*-
'''
Provide authentication using local files
.. versionadded:: 2018.3.0
The `file` auth module allows simple authentication via local files. Different
filetypes are supported, including:
1. Text files, with passwords in plaintext or hashed
2. Apache-style htpasswd files
3. Apache-style ... |
saltstack/salt | salt/auth/file.py | _text | python | def _text(username, password, **kwargs):
'''
The text file function can authenticate plaintext and digest methods
that are available in the :py:func:`hashutil.digest <salt.modules.hashutil.digest>`
function.
'''
filename = kwargs['filename']
hashtype = kwargs['hashtype']
field_separator... | The text file function can authenticate plaintext and digest methods
that are available in the :py:func:`hashutil.digest <salt.modules.hashutil.digest>`
function. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/file.py#L149-L190 | null | # -*- coding: utf-8 -*-
'''
Provide authentication using local files
.. versionadded:: 2018.3.0
The `file` auth module allows simple authentication via local files. Different
filetypes are supported, including:
1. Text files, with passwords in plaintext or hashed
2. Apache-style htpasswd files
3. Apache-style ... |
saltstack/salt | salt/auth/file.py | _htpasswd | python | def _htpasswd(username, password, **kwargs):
'''
Provide authentication via Apache-style htpasswd files
'''
from passlib.apache import HtpasswdFile
pwfile = HtpasswdFile(kwargs['filename'])
# passlib below version 1.6 uses 'verify' function instead of 'check_password'
if salt.utils.versio... | Provide authentication via Apache-style htpasswd files | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/file.py#L193-L206 | null | # -*- coding: utf-8 -*-
'''
Provide authentication using local files
.. versionadded:: 2018.3.0
The `file` auth module allows simple authentication via local files. Different
filetypes are supported, including:
1. Text files, with passwords in plaintext or hashed
2. Apache-style htpasswd files
3. Apache-style ... |
saltstack/salt | salt/auth/file.py | _htdigest | python | def _htdigest(username, password, **kwargs):
'''
Provide authentication via Apache-style htdigest files
'''
realm = kwargs.get('realm', None)
if not realm:
log.error('salt.auth.file: A ^realm must be defined in '
'external_auth:file for htdigest filetype')
return F... | Provide authentication via Apache-style htdigest files | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/file.py#L209-L228 | null | # -*- coding: utf-8 -*-
'''
Provide authentication using local files
.. versionadded:: 2018.3.0
The `file` auth module allows simple authentication via local files. Different
filetypes are supported, including:
1. Text files, with passwords in plaintext or hashed
2. Apache-style htpasswd files
3. Apache-style ... |
saltstack/salt | salt/auth/file.py | _htfile | python | def _htfile(username, password, **kwargs):
'''
Gate function for _htpasswd and _htdigest authentication backends
'''
filetype = kwargs.get('filetype', 'htpasswd').lower()
try:
import passlib
kwargs['passlib_version'] = passlib.__version__
except ImportError:
log.error('... | Gate function for _htpasswd and _htdigest authentication backends | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/file.py#L231-L249 | null | # -*- coding: utf-8 -*-
'''
Provide authentication using local files
.. versionadded:: 2018.3.0
The `file` auth module allows simple authentication via local files. Different
filetypes are supported, including:
1. Text files, with passwords in plaintext or hashed
2. Apache-style htpasswd files
3. Apache-style ... |
saltstack/salt | salt/auth/file.py | auth | python | def auth(username, password):
'''
File based authentication
^filename
The path to the file to use for authentication.
^filetype
The type of file: ``text``, ``htpasswd``, ``htdigest``.
Default: ``text``
^realm
The realm required by htdigest authentication.
.. ... | File based authentication
^filename
The path to the file to use for authentication.
^filetype
The type of file: ``text``, ``htpasswd``, ``htdigest``.
Default: ``text``
^realm
The realm required by htdigest authentication.
.. note::
The following parameters ar... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/file.py#L259-L308 | [
"def _get_file_auth_config():\n '''\n Setup defaults and check configuration variables for auth backends\n '''\n\n config = {\n 'filetype': 'text',\n 'hashtype': 'plaintext',\n 'field_separator': ':',\n 'username_field': 1,\n 'password_field': 2,\n }\n\n for opt ... | # -*- coding: utf-8 -*-
'''
Provide authentication using local files
.. versionadded:: 2018.3.0
The `file` auth module allows simple authentication via local files. Different
filetypes are supported, including:
1. Text files, with passwords in plaintext or hashed
2. Apache-style htpasswd files
3. Apache-style ... |
saltstack/salt | salt/states/openvswitch_bridge.py | present | python | def present(name, parent=None, vlan=None):
'''
Ensures that the named bridge exists, eventually creates it.
Args:
name: The name of the bridge.
parent: The name of the parent bridge (if the bridge shall be created
as a fake bridge). If specified, vlan must also be specified.
... | Ensures that the named bridge exists, eventually creates it.
Args:
name: The name of the bridge.
parent: The name of the parent bridge (if the bridge shall be created
as a fake bridge). If specified, vlan must also be specified.
vlan: The VLAN ID of the bridge (if the bridge sha... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/openvswitch_bridge.py#L17-L84 | null | # -*- coding: utf-8 -*-
'''
Management of Open vSwitch bridges.
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
def __virtual__():
'''
Only make these states available if Open vSwitch module is available.
'''
return 'openvswitch.bridge_create' in __sa... |
saltstack/salt | salt/states/openvswitch_bridge.py | absent | python | def absent(name):
'''
Ensures that the named bridge does not exist, eventually deletes it.
Args:
name: The name of the bridge.
'''
ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''}
# Comment and change messages
comment_bridge_deleted = 'Bridge {0} deleted.'.form... | Ensures that the named bridge does not exist, eventually deletes it.
Args:
name: The name of the bridge. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/openvswitch_bridge.py#L87-L133 | null | # -*- coding: utf-8 -*-
'''
Management of Open vSwitch bridges.
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
def __virtual__():
'''
Only make these states available if Open vSwitch module is available.
'''
return 'openvswitch.bridge_create' in __sa... |
saltstack/salt | salt/pillar/cmd_yamlex.py | ext_pillar | python | def ext_pillar(minion_id, # pylint: disable=W0613
pillar, # pylint: disable=W0613
command):
'''
Execute a command and read the output as YAMLEX
'''
try:
command = command.replace('%s', minion_id)
return deserialize(__salt__['cmd.run']('{0}'.format(command)... | Execute a command and read the output as YAMLEX | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/cmd_yamlex.py#L19-L30 | [
"def deserialize(stream_or_string, **options):\n '''\n Deserialize any string of stream like object into a Python data structure.\n\n :param stream_or_string: stream or string to deserialize.\n :param options: options given to lower yaml module.\n '''\n\n options.setdefault('Loader', Loader)\n ... | # -*- coding: utf-8 -*-
'''
Execute a command and read the output as YAMLEX.
The YAMLEX data is then directly overlaid onto the minion's Pillar data
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
# Import salt libs
from salt.serializers.yamlex import ... |
saltstack/salt | salt/states/kubernetes.py | deployment_absent | python | def deployment_absent(name, namespace='default', **kwargs):
'''
Ensures that the named deployment is absent from the given namespace.
name
The name of the deployment
namespace
The name of the namespace
'''
ret = {'name': name,
'changes': {},
'result': Fal... | Ensures that the named deployment is absent from the given namespace.
name
The name of the deployment
namespace
The name of the namespace | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L111-L149 | null | # -*- coding: utf-8 -*-
'''
Manage kubernetes resources as salt states
==========================================
NOTE: This module requires the proper pillar values set. See
salt.modules.kubernetesmod for more information.
.. warning::
Configuration options will change in 2019.2.0.
The kubernetes module is use... |
saltstack/salt | salt/states/kubernetes.py | deployment_present | python | def deployment_present(
name,
namespace='default',
metadata=None,
spec=None,
source='',
template='',
**kwargs):
'''
Ensures that the named deployment is present inside of the specified
namespace with the given metadata and spec.
If the deployment e... | Ensures that the named deployment is present inside of the specified
namespace with the given metadata and spec.
If the deployment exists it will be replaced.
name
The name of the deployment.
namespace
The namespace holding the deployment. The 'default' one is going to be
used ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L152-L244 | [
"def _error(ret, err_msg):\n '''\n Helper function to propagate errors to\n the end user.\n '''\n ret['result'] = False\n ret['comment'] = err_msg\n return ret\n"
] | # -*- coding: utf-8 -*-
'''
Manage kubernetes resources as salt states
==========================================
NOTE: This module requires the proper pillar values set. See
salt.modules.kubernetesmod for more information.
.. warning::
Configuration options will change in 2019.2.0.
The kubernetes module is use... |
saltstack/salt | salt/states/kubernetes.py | service_present | python | def service_present(
name,
namespace='default',
metadata=None,
spec=None,
source='',
template='',
**kwargs):
'''
Ensures that the named service is present inside of the specified namespace
with the given metadata and spec.
If the deployment exists ... | Ensures that the named service is present inside of the specified namespace
with the given metadata and spec.
If the deployment exists it will be replaced.
name
The name of the service.
namespace
The namespace holding the service. The 'default' one is going to be
used unless a ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L247-L340 | [
"def _error(ret, err_msg):\n '''\n Helper function to propagate errors to\n the end user.\n '''\n ret['result'] = False\n ret['comment'] = err_msg\n return ret\n"
] | # -*- coding: utf-8 -*-
'''
Manage kubernetes resources as salt states
==========================================
NOTE: This module requires the proper pillar values set. See
salt.modules.kubernetesmod for more information.
.. warning::
Configuration options will change in 2019.2.0.
The kubernetes module is use... |
saltstack/salt | salt/states/kubernetes.py | service_absent | python | def service_absent(name, namespace='default', **kwargs):
'''
Ensures that the named service is absent from the given namespace.
name
The name of the service
namespace
The name of the namespace
'''
ret = {'name': name,
'changes': {},
'result': False,
... | Ensures that the named service is absent from the given namespace.
name
The name of the service
namespace
The name of the namespace | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L343-L381 | null | # -*- coding: utf-8 -*-
'''
Manage kubernetes resources as salt states
==========================================
NOTE: This module requires the proper pillar values set. See
salt.modules.kubernetesmod for more information.
.. warning::
Configuration options will change in 2019.2.0.
The kubernetes module is use... |
saltstack/salt | salt/states/kubernetes.py | namespace_absent | python | def namespace_absent(name, **kwargs):
'''
Ensures that the named namespace is absent.
name
The name of the namespace
'''
ret = {'name': name,
'changes': {},
'result': False,
'comment': ''}
namespace = __salt__['kubernetes.show_namespace'](name, **kwarg... | Ensures that the named namespace is absent.
name
The name of the namespace | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L384-L431 | null | # -*- coding: utf-8 -*-
'''
Manage kubernetes resources as salt states
==========================================
NOTE: This module requires the proper pillar values set. See
salt.modules.kubernetesmod for more information.
.. warning::
Configuration options will change in 2019.2.0.
The kubernetes module is use... |
saltstack/salt | salt/states/kubernetes.py | namespace_present | python | def namespace_present(name, **kwargs):
'''
Ensures that the named namespace is present.
name
The name of the namespace.
'''
ret = {'name': name,
'changes': {},
'result': False,
'comment': ''}
namespace = __salt__['kubernetes.show_namespace'](name, **kw... | Ensures that the named namespace is present.
name
The name of the namespace. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L434-L464 | null | # -*- coding: utf-8 -*-
'''
Manage kubernetes resources as salt states
==========================================
NOTE: This module requires the proper pillar values set. See
salt.modules.kubernetesmod for more information.
.. warning::
Configuration options will change in 2019.2.0.
The kubernetes module is use... |
saltstack/salt | salt/states/kubernetes.py | secret_absent | python | def secret_absent(name, namespace='default', **kwargs):
'''
Ensures that the named secret is absent from the given namespace.
name
The name of the secret
namespace
The name of the namespace
'''
ret = {'name': name,
'changes': {},
'result': False,
... | Ensures that the named secret is absent from the given namespace.
name
The name of the secret
namespace
The name of the namespace | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L467-L505 | null | # -*- coding: utf-8 -*-
'''
Manage kubernetes resources as salt states
==========================================
NOTE: This module requires the proper pillar values set. See
salt.modules.kubernetesmod for more information.
.. warning::
Configuration options will change in 2019.2.0.
The kubernetes module is use... |
saltstack/salt | salt/states/kubernetes.py | secret_present | python | def secret_present(
name,
namespace='default',
data=None,
source=None,
template=None,
**kwargs):
'''
Ensures that the named secret is present inside of the specified namespace
with the given data.
If the secret exists it will be replaced.
name
... | Ensures that the named secret is present inside of the specified namespace
with the given data.
If the secret exists it will be replaced.
name
The name of the secret.
namespace
The namespace holding the secret. The 'default' one is going to be
used unless a different one is spe... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L508-L592 | [
"def _error(ret, err_msg):\n '''\n Helper function to propagate errors to\n the end user.\n '''\n ret['result'] = False\n ret['comment'] = err_msg\n return ret\n"
] | # -*- coding: utf-8 -*-
'''
Manage kubernetes resources as salt states
==========================================
NOTE: This module requires the proper pillar values set. See
salt.modules.kubernetesmod for more information.
.. warning::
Configuration options will change in 2019.2.0.
The kubernetes module is use... |
saltstack/salt | salt/states/kubernetes.py | configmap_absent | python | def configmap_absent(name, namespace='default', **kwargs):
'''
Ensures that the named configmap is absent from the given namespace.
name
The name of the configmap
namespace
The namespace holding the configmap. The 'default' one is going to be
used unless a different one is spec... | Ensures that the named configmap is absent from the given namespace.
name
The name of the configmap
namespace
The namespace holding the configmap. The 'default' one is going to be
used unless a different one is specified. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L595-L634 | null | # -*- coding: utf-8 -*-
'''
Manage kubernetes resources as salt states
==========================================
NOTE: This module requires the proper pillar values set. See
salt.modules.kubernetesmod for more information.
.. warning::
Configuration options will change in 2019.2.0.
The kubernetes module is use... |
saltstack/salt | salt/states/kubernetes.py | configmap_present | python | def configmap_present(
name,
namespace='default',
data=None,
source=None,
template=None,
**kwargs):
'''
Ensures that the named configmap is present inside of the specified namespace
with the given data.
If the configmap exists it will be replaced.
nam... | Ensures that the named configmap is present inside of the specified namespace
with the given data.
If the configmap exists it will be replaced.
name
The name of the configmap.
namespace
The namespace holding the configmap. The 'default' one is going to be
used unless a differen... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L637-L717 | [
"def _error(ret, err_msg):\n '''\n Helper function to propagate errors to\n the end user.\n '''\n ret['result'] = False\n ret['comment'] = err_msg\n return ret\n"
] | # -*- coding: utf-8 -*-
'''
Manage kubernetes resources as salt states
==========================================
NOTE: This module requires the proper pillar values set. See
salt.modules.kubernetesmod for more information.
.. warning::
Configuration options will change in 2019.2.0.
The kubernetes module is use... |
saltstack/salt | salt/states/kubernetes.py | pod_absent | python | def pod_absent(name, namespace='default', **kwargs):
'''
Ensures that the named pod is absent from the given namespace.
name
The name of the pod
namespace
The name of the namespace
'''
ret = {'name': name,
'changes': {},
'result': False,
'comme... | Ensures that the named pod is absent from the given namespace.
name
The name of the pod
namespace
The name of the namespace | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L720-L761 | null | # -*- coding: utf-8 -*-
'''
Manage kubernetes resources as salt states
==========================================
NOTE: This module requires the proper pillar values set. See
salt.modules.kubernetesmod for more information.
.. warning::
Configuration options will change in 2019.2.0.
The kubernetes module is use... |
saltstack/salt | salt/states/kubernetes.py | pod_present | python | def pod_present(
name,
namespace='default',
metadata=None,
spec=None,
source='',
template='',
**kwargs):
'''
Ensures that the named pod is present inside of the specified
namespace with the given metadata and spec.
If the pod exists it will be repl... | Ensures that the named pod is present inside of the specified
namespace with the given metadata and spec.
If the pod exists it will be replaced.
name
The name of the pod.
namespace
The namespace holding the pod. The 'default' one is going to be
used unless a different one is sp... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L764-L850 | [
"def _error(ret, err_msg):\n '''\n Helper function to propagate errors to\n the end user.\n '''\n ret['result'] = False\n ret['comment'] = err_msg\n return ret\n"
] | # -*- coding: utf-8 -*-
'''
Manage kubernetes resources as salt states
==========================================
NOTE: This module requires the proper pillar values set. See
salt.modules.kubernetesmod for more information.
.. warning::
Configuration options will change in 2019.2.0.
The kubernetes module is use... |
saltstack/salt | salt/states/kubernetes.py | node_label_absent | python | def node_label_absent(name, node, **kwargs):
'''
Ensures that the named label is absent from the node.
name
The name of the label
node
The name of the node
'''
ret = {'name': name,
'changes': {},
'result': False,
'comment': ''}
labels = __... | Ensures that the named label is absent from the node.
name
The name of the label
node
The name of the node | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L853-L892 | null | # -*- coding: utf-8 -*-
'''
Manage kubernetes resources as salt states
==========================================
NOTE: This module requires the proper pillar values set. See
salt.modules.kubernetesmod for more information.
.. warning::
Configuration options will change in 2019.2.0.
The kubernetes module is use... |
saltstack/salt | salt/states/kubernetes.py | node_label_folder_absent | python | def node_label_folder_absent(name, node, **kwargs):
'''
Ensures the label folder doesn't exist on the specified node.
name
The name of label folder
node
The name of the node
'''
ret = {'name': name,
'changes': {},
'result': False,
'comment': ''... | Ensures the label folder doesn't exist on the specified node.
name
The name of label folder
node
The name of the node | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L895-L946 | null | # -*- coding: utf-8 -*-
'''
Manage kubernetes resources as salt states
==========================================
NOTE: This module requires the proper pillar values set. See
salt.modules.kubernetesmod for more information.
.. warning::
Configuration options will change in 2019.2.0.
The kubernetes module is use... |
saltstack/salt | salt/states/kubernetes.py | node_label_present | python | def node_label_present(
name,
node,
value,
**kwargs):
'''
Ensures that the named label is set on the named node
with the given value.
If the label exists it will be replaced.
name
The name of the label.
value
Value of the label.
node
... | Ensures that the named label is set on the named node
with the given value.
If the label exists it will be replaced.
name
The name of the label.
value
Value of the label.
node
Node to change. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L949-L1009 | null | # -*- coding: utf-8 -*-
'''
Manage kubernetes resources as salt states
==========================================
NOTE: This module requires the proper pillar values set. See
salt.modules.kubernetesmod for more information.
.. warning::
Configuration options will change in 2019.2.0.
The kubernetes module is use... |
saltstack/salt | salt/proxy/esxvm.py | init | python | def init(opts):
'''
This function gets called when the proxy starts up. For
login the protocol and port are cached.
'''
log.debug('Initting esxvm proxy module in process %s', os.getpid())
log.debug('Validating esxvm proxy input')
proxy_conf = merge(opts.get('proxy', {}), __pillar__.get('prox... | This function gets called when the proxy starts up. For
login the protocol and port are cached. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/esxvm.py#L180-L234 | [
"def merge(obj_a, obj_b, strategy='smart', renderer='yaml', merge_lists=False):\n if strategy == 'smart':\n if renderer.split('|')[-1] == 'yamlex' or renderer.startswith('yamlex_'):\n strategy = 'aggregate'\n else:\n strategy = 'recurse'\n\n if strategy == 'list':\n ... | # -*- coding: utf-8 -*-
'''
Proxy Minion interface module for managing VMWare ESXi virtual machines.
Dependencies
============
- pyVmomi
- jsonschema
Configuration
=============
To use this integration proxy module, please configure the following:
Pillar
------
Proxy minions get their configuration from Salt's Pil... |
saltstack/salt | salt/proxy/esxvm.py | find_credentials | python | def find_credentials():
'''
Cycle through all the possible credentials and return the first one that
works.
'''
# if the username and password were already found don't go through the
# connection process again
if 'username' in DETAILS and 'password' in DETAILS:
return DETAILS['usern... | Cycle through all the possible credentials and return the first one that
works. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/esxvm.py#L258-L279 | null | # -*- coding: utf-8 -*-
'''
Proxy Minion interface module for managing VMWare ESXi virtual machines.
Dependencies
============
- pyVmomi
- jsonschema
Configuration
=============
To use this integration proxy module, please configure the following:
Pillar
------
Proxy minions get their configuration from Salt's Pil... |
saltstack/salt | salt/modules/devmap.py | multipath_flush | python | def multipath_flush(device):
'''
Device-Mapper Multipath flush
CLI Example:
.. code-block:: bash
salt '*' devmap.multipath_flush mpath1
'''
if not os.path.exists(device):
return '{0} does not exist'.format(device)
cmd = 'multipath -f {0}'.format(device)
return __salt_... | Device-Mapper Multipath flush
CLI Example:
.. code-block:: bash
salt '*' devmap.multipath_flush mpath1 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/devmap.py#L23-L37 | null | # -*- coding: utf-8 -*-
'''
Device-Mapper module
'''
from __future__ import absolute_import, print_function, unicode_literals
import os.path
def multipath_list():
'''
Device-Mapper Multipath list
CLI Example:
.. code-block:: bash
salt '*' devmap.multipath_list
'''
cmd = 'multipath -... |
saltstack/salt | salt/states/debconfmod.py | set_file | python | def set_file(name, source, template=None, context=None, defaults=None, **kwargs):
'''
Set debconf selections from a file or a template
.. code-block:: yaml
<state_id>:
debconf.set_file:
- source: salt://pathto/pkg.selections
<state_id>:
debconf.set_file:
... | Set debconf selections from a file or a template
.. code-block:: yaml
<state_id>:
debconf.set_file:
- source: salt://pathto/pkg.selections
<state_id>:
debconf.set_file:
- source: salt://pathto/pkg.selections?saltenv=myenvironment
<state_id>:
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/debconfmod.py#L85-L155 | null | # -*- coding: utf-8 -*-
'''
Management of debconf selections
================================
:depends: - debconf-utils package
The debconfmod state module manages the enforcement of debconf selections,
this state can set those selections prior to package installation.
Available Functions
-------------------
The ... |
saltstack/salt | salt/states/debconfmod.py | set | python | def set(name, data, **kwargs):
'''
Set debconf selections
.. code-block:: yaml
<state_id>:
debconf.set:
- name: <name>
- data:
<question>: {'type': <type>, 'value': <value>}
<question>: {'type': <type>, 'value': <value>}
<s... | Set debconf selections
.. code-block:: yaml
<state_id>:
debconf.set:
- name: <name>
- data:
<question>: {'type': <type>, 'value': <value>}
<question>: {'type': <type>, 'value': <value>}
<state_id>:
debconf.set:
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/debconfmod.py#L158-L234 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n"
] | # -*- coding: utf-8 -*-
'''
Management of debconf selections
================================
:depends: - debconf-utils package
The debconfmod state module manages the enforcement of debconf selections,
this state can set those selections prior to package installation.
Available Functions
-------------------
The ... |
saltstack/salt | salt/engines/docker_events.py | start | python | def start(docker_url='unix://var/run/docker.sock',
timeout=CLIENT_TIMEOUT,
tag='salt/engines/docker_events',
filters=None):
'''
Scan for Docker events and fire events
Example Config
.. code-block:: yaml
engines:
- docker_events:
docker_url... | Scan for Docker events and fire events
Example Config
.. code-block:: yaml
engines:
- docker_events:
docker_url: unix://var/run/docker.sock
filters:
event:
- start
- stop
- die
- oom
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/docker_events.py#L42-L105 | [
"def get_master_event(opts, sock_dir, listen=True, io_loop=None, raise_errors=False, keep_loop=False):\n '''\n Return an event object suitable for the named transport\n '''\n # TODO: AIO core is separate from transport\n if opts['transport'] in ('zeromq', 'tcp', 'detect'):\n return MasterEvent... | # -*- coding: utf-8 -*-
'''
Send events from Docker events
:Depends: Docker API >= 1.22
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import traceback
import salt.utils.json
import salt.utils.event
# pylint: disable=import-error
try:
import do... |
saltstack/salt | salt/modules/infoblox.py | _get_config | python | def _get_config(**api_opts):
'''
Return configuration
user passed api_opts override salt config.get vars
'''
config = {
'api_sslverify': True,
'api_url': 'https://INFOBLOX/wapi/v1.2.1',
'api_user': '',
'api_key': '',
}
if '__salt__' in globals():
confi... | Return configuration
user passed api_opts override salt config.get vars | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L58-L75 | null | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | update_host | python | def update_host(name, data, **api_opts):
'''
Update host record. This is a helper call to update_object.
Find a hosts ``_ref`` then call update_object with the record data.
CLI Example:
.. code-block:: bash
salt-call infoblox.update_host name=fqdn data={}
'''
o = get_host(name=na... | Update host record. This is a helper call to update_object.
Find a hosts ``_ref`` then call update_object with the record data.
CLI Example:
.. code-block:: bash
salt-call infoblox.update_host name=fqdn data={} | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L120-L133 | [
"def get_host(name=None, ipv4addr=None, mac=None, return_fields=None, **api_opts):\n '''\n Get host information\n\n CLI Examples:\n\n .. code-block:: bash\n\n salt-call infoblox.get_host hostname.domain.ca\n salt-call infoblox.get_host ipv4addr=123.123.122.12\n salt-call infoblox.ge... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | update_object | python | def update_object(objref, data, **api_opts):
'''
Update raw infoblox object. This is a low level api call.
CLI Example:
.. code-block:: bash
salt-call infoblox.update_object objref=[ref_of_object] data={}
'''
if '__opts__' in globals() and __opts__['test']:
return {'Test': 'Wo... | Update raw infoblox object. This is a low level api call.
CLI Example:
.. code-block:: bash
salt-call infoblox.update_object objref=[ref_of_object] data={} | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L136-L149 | [
"def _get_infoblox(**api_opts):\n config = _get_config(**api_opts)\n # TODO: perhaps cache in __opts__\n cache_key = 'infoblox_session_{0},{1},{2}'.format(\n config['api_url'], config['api_user'], config['api_key'])\n if cache_key in cache:\n timedelta = int(time.time()) - cache[cache_key]... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | delete_object | python | def delete_object(objref, **api_opts):
'''
Delete infoblox object. This is a low level api call.
CLI Example:
.. code-block:: bash
salt-call infoblox.delete_object objref=[ref_of_object]
'''
if '__opts__' in globals() and __opts__['test']:
return {'Test': 'Would attempt to del... | Delete infoblox object. This is a low level api call.
CLI Example:
.. code-block:: bash
salt-call infoblox.delete_object objref=[ref_of_object] | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L152-L165 | [
"def _get_infoblox(**api_opts):\n config = _get_config(**api_opts)\n # TODO: perhaps cache in __opts__\n cache_key = 'infoblox_session_{0},{1},{2}'.format(\n config['api_url'], config['api_user'], config['api_key'])\n if cache_key in cache:\n timedelta = int(time.time()) - cache[cache_key]... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | create_object | python | def create_object(object_type, data, **api_opts):
'''
Create raw infoblox object. This is a low level api call.
CLI Example:
.. code-block:: bash
salt-call infoblox.update_object object_type=record:host data={}
'''
if '__opts__' in globals() and __opts__['test']:
return {'Tes... | Create raw infoblox object. This is a low level api call.
CLI Example:
.. code-block:: bash
salt-call infoblox.update_object object_type=record:host data={} | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L168-L181 | [
"def _get_infoblox(**api_opts):\n config = _get_config(**api_opts)\n # TODO: perhaps cache in __opts__\n cache_key = 'infoblox_session_{0},{1},{2}'.format(\n config['api_url'], config['api_user'], config['api_key'])\n if cache_key in cache:\n timedelta = int(time.time()) - cache[cache_key]... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | get_object | python | def get_object(objref, data=None, return_fields=None, max_results=None,
ensure_none_or_one_result=False, **api_opts):
'''
Get raw infoblox object. This is a low level api call.
CLI Example:
.. code-block:: bash
salt-call infoblox.get_object objref=[_ref of object]
'''
i... | Get raw infoblox object. This is a low level api call.
CLI Example:
.. code-block:: bash
salt-call infoblox.get_object objref=[_ref of object] | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L184-L199 | [
"def _get_infoblox(**api_opts):\n config = _get_config(**api_opts)\n # TODO: perhaps cache in __opts__\n cache_key = 'infoblox_session_{0},{1},{2}'.format(\n config['api_url'], config['api_user'], config['api_key'])\n if cache_key in cache:\n timedelta = int(time.time()) - cache[cache_key]... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | create_cname | python | def create_cname(data, **api_opts):
'''
Create a cname record.
CLI Example:
.. code-block:: bash
salt-call infoblox.create_cname data={ \
"comment": "cname to example server", \
"name": "example.example.com", \
"zone": "example.com", \
"view": "... | Create a cname record.
CLI Example:
.. code-block:: bash
salt-call infoblox.create_cname data={ \
"comment": "cname to example server", \
"name": "example.example.com", \
"zone": "example.com", \
"view": "Internal", \
"canonical": "example-h... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L202-L220 | [
"def _get_infoblox(**api_opts):\n config = _get_config(**api_opts)\n # TODO: perhaps cache in __opts__\n cache_key = 'infoblox_session_{0},{1},{2}'.format(\n config['api_url'], config['api_user'], config['api_key'])\n if cache_key in cache:\n timedelta = int(time.time()) - cache[cache_key]... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | get_cname | python | def get_cname(name=None, canonical=None, return_fields=None, **api_opts):
'''
Get CNAME information.
CLI Examples:
.. code-block:: bash
salt-call infoblox.get_cname name=example.example.com
salt-call infoblox.get_cname canonical=example-ha-0.example.com
'''
infoblox = _get_inf... | Get CNAME information.
CLI Examples:
.. code-block:: bash
salt-call infoblox.get_cname name=example.example.com
salt-call infoblox.get_cname canonical=example-ha-0.example.com | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L223-L236 | [
"def _get_infoblox(**api_opts):\n config = _get_config(**api_opts)\n # TODO: perhaps cache in __opts__\n cache_key = 'infoblox_session_{0},{1},{2}'.format(\n config['api_url'], config['api_user'], config['api_key'])\n if cache_key in cache:\n timedelta = int(time.time()) - cache[cache_key]... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | update_cname | python | def update_cname(name, data, **api_opts):
'''
Update CNAME. This is a helper call to update_object.
Find a CNAME ``_ref`` then call update_object with the record data.
CLI Example:
.. code-block:: bash
salt-call infoblox.update_cname name=example.example.com data="{
'cano... | Update CNAME. This is a helper call to update_object.
Find a CNAME ``_ref`` then call update_object with the record data.
CLI Example:
.. code-block:: bash
salt-call infoblox.update_cname name=example.example.com data="{
'canonical':'example-ha-0.example.com',
'us... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L239-L258 | [
"def update_object(objref, data, **api_opts):\n '''\n Update raw infoblox object. This is a low level api call.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt-call infoblox.update_object objref=[ref_of_object] data={}\n '''\n if '__opts__' in globals() and __opts__['test']:\n ret... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | delete_cname | python | def delete_cname(name=None, canonical=None, **api_opts):
'''
Delete CNAME. This is a helper call to delete_object.
If record is not found, return True
CLI Examples:
.. code-block:: bash
salt-call infoblox.delete_cname name=example.example.com
salt-call infoblox.delete_cname canon... | Delete CNAME. This is a helper call to delete_object.
If record is not found, return True
CLI Examples:
.. code-block:: bash
salt-call infoblox.delete_cname name=example.example.com
salt-call infoblox.delete_cname canonical=example-ha-0.example.com | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L261-L277 | [
"def delete_object(objref, **api_opts):\n '''\n Delete infoblox object. This is a low level api call.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt-call infoblox.delete_object objref=[ref_of_object]\n '''\n if '__opts__' in globals() and __opts__['test']:\n return {'Test': 'Woul... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | get_host | python | def get_host(name=None, ipv4addr=None, mac=None, return_fields=None, **api_opts):
'''
Get host information
CLI Examples:
.. code-block:: bash
salt-call infoblox.get_host hostname.domain.ca
salt-call infoblox.get_host ipv4addr=123.123.122.12
salt-call infoblox.get_host mac=00:5... | Get host information
CLI Examples:
.. code-block:: bash
salt-call infoblox.get_host hostname.domain.ca
salt-call infoblox.get_host ipv4addr=123.123.122.12
salt-call infoblox.get_host mac=00:50:56:84:6e:ae | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L280-L294 | [
"def _get_infoblox(**api_opts):\n config = _get_config(**api_opts)\n # TODO: perhaps cache in __opts__\n cache_key = 'infoblox_session_{0},{1},{2}'.format(\n config['api_url'], config['api_user'], config['api_key'])\n if cache_key in cache:\n timedelta = int(time.time()) - cache[cache_key]... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | get_host_advanced | python | def get_host_advanced(name=None, ipv4addr=None, mac=None, **api_opts):
'''
Get all host information
CLI Example:
.. code-block:: bash
salt-call infoblox.get_host_advanced hostname.domain.ca
'''
infoblox = _get_infoblox(**api_opts)
host = infoblox.get_host_advanced(name=name, mac=m... | Get all host information
CLI Example:
.. code-block:: bash
salt-call infoblox.get_host_advanced hostname.domain.ca | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L297-L309 | [
"def _get_infoblox(**api_opts):\n config = _get_config(**api_opts)\n # TODO: perhaps cache in __opts__\n cache_key = 'infoblox_session_{0},{1},{2}'.format(\n config['api_url'], config['api_user'], config['api_key'])\n if cache_key in cache:\n timedelta = int(time.time()) - cache[cache_key]... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | get_host_domainname | python | def get_host_domainname(name, domains=None, **api_opts):
'''
Get host domain name
If no domains are passed, the hostname is checked for a zone in infoblox,
if no zone split on first dot.
If domains are provided, the best match out of the list is returned.
If none are found the return is None
... | Get host domain name
If no domains are passed, the hostname is checked for a zone in infoblox,
if no zone split on first dot.
If domains are provided, the best match out of the list is returned.
If none are found the return is None
dots at end of names are ignored.
CLI Example:
.. code... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L312-L348 | [
"def get_host(name=None, ipv4addr=None, mac=None, return_fields=None, **api_opts):\n '''\n Get host information\n\n CLI Examples:\n\n .. code-block:: bash\n\n salt-call infoblox.get_host hostname.domain.ca\n salt-call infoblox.get_host ipv4addr=123.123.122.12\n salt-call infoblox.ge... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | get_host_hostname | python | def get_host_hostname(name, domains=None, **api_opts):
'''
Get hostname
If no domains are passed, the hostname is checked for a zone in infoblox,
if no zone split on first dot.
If domains are provided, the best match out of the list is truncated from
the fqdn leaving the hostname.
If no m... | Get hostname
If no domains are passed, the hostname is checked for a zone in infoblox,
if no zone split on first dot.
If domains are provided, the best match out of the list is truncated from
the fqdn leaving the hostname.
If no matching domains are found the fqdn is returned.
dots at end of... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L351-L382 | [
"def get_host_domainname(name, domains=None, **api_opts):\n '''\n Get host domain name\n\n If no domains are passed, the hostname is checked for a zone in infoblox,\n if no zone split on first dot.\n\n If domains are provided, the best match out of the list is returned.\n\n If none are found the r... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | get_host_mac | python | def get_host_mac(name=None, allow_array=False, **api_opts):
'''
Get mac address from host record.
Use `allow_array` to return possible multiple values.
CLI Example:
.. code-block:: bash
salt-call infoblox.get_host_mac host=localhost.domain.com
'''
data = get_host(name=name, **api... | Get mac address from host record.
Use `allow_array` to return possible multiple values.
CLI Example:
.. code-block:: bash
salt-call infoblox.get_host_mac host=localhost.domain.com | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L385-L407 | [
"def get_host(name=None, ipv4addr=None, mac=None, return_fields=None, **api_opts):\n '''\n Get host information\n\n CLI Examples:\n\n .. code-block:: bash\n\n salt-call infoblox.get_host hostname.domain.ca\n salt-call infoblox.get_host ipv4addr=123.123.122.12\n salt-call infoblox.ge... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | get_host_ipv4 | python | def get_host_ipv4(name=None, mac=None, allow_array=False, **api_opts):
'''
Get ipv4 address from host record.
Use `allow_array` to return possible multiple values.
CLI Examples:
.. code-block:: bash
salt-call infoblox.get_host_ipv4 host=localhost.domain.com
salt-call infoblox.get... | Get ipv4 address from host record.
Use `allow_array` to return possible multiple values.
CLI Examples:
.. code-block:: bash
salt-call infoblox.get_host_ipv4 host=localhost.domain.com
salt-call infoblox.get_host_ipv4 mac=00:50:56:84:6e:ae | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L410-L433 | [
"def get_host(name=None, ipv4addr=None, mac=None, return_fields=None, **api_opts):\n '''\n Get host information\n\n CLI Examples:\n\n .. code-block:: bash\n\n salt-call infoblox.get_host hostname.domain.ca\n salt-call infoblox.get_host ipv4addr=123.123.122.12\n salt-call infoblox.ge... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | get_host_ipv4addr_info | python | def get_host_ipv4addr_info(ipv4addr=None, mac=None,
discovered_data=None,
return_fields=None, **api_opts):
'''
Get host ipv4addr information
CLI Examples:
.. code-block:: bash
salt-call infoblox.get_ipv4addr ipv4a... | Get host ipv4addr information
CLI Examples:
.. code-block:: bash
salt-call infoblox.get_ipv4addr ipv4addr=123.123.122.12
salt-call infoblox.get_ipv4addr mac=00:50:56:84:6e:ae
salt-call infoblox.get_ipv4addr mac=00:50:56:84:6e:ae return_fields=host return_fields='mac,host,configure_for... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L436-L451 | [
"def _get_infoblox(**api_opts):\n config = _get_config(**api_opts)\n # TODO: perhaps cache in __opts__\n cache_key = 'infoblox_session_{0},{1},{2}'.format(\n config['api_url'], config['api_user'], config['api_key'])\n if cache_key in cache:\n timedelta = int(time.time()) - cache[cache_key]... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | get_host_ipv6addr_info | python | def get_host_ipv6addr_info(ipv6addr=None, mac=None,
discovered_data=None,
return_fields=None, **api_opts):
'''
Get host ipv6addr information
CLI Example:
.. code-block:: bash
salt-call infoblox.get_host_ipv6addr_i... | Get host ipv6addr information
CLI Example:
.. code-block:: bash
salt-call infoblox.get_host_ipv6addr_info ipv6addr=2001:db8:85a3:8d3:1349:8a2e:370:7348 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L454-L467 | [
"def _get_infoblox(**api_opts):\n config = _get_config(**api_opts)\n # TODO: perhaps cache in __opts__\n cache_key = 'infoblox_session_{0},{1},{2}'.format(\n config['api_url'], config['api_user'], config['api_key'])\n if cache_key in cache:\n timedelta = int(time.time()) - cache[cache_key]... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | get_network | python | def get_network(ipv4addr=None, network=None, return_fields=None, **api_opts):
'''
Get list of all networks. This is helpful when looking up subnets to use
with func:nextavailableip
This call is offen slow and not cached!
some return_fields
comment,network,network_view,ddns_domainname,disable,e... | Get list of all networks. This is helpful when looking up subnets to use
with func:nextavailableip
This call is offen slow and not cached!
some return_fields
comment,network,network_view,ddns_domainname,disable,enable_ddns
CLI Example:
.. code-block:: bash
salt-call infoblox.get_net... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L470-L487 | [
"def _get_infoblox(**api_opts):\n config = _get_config(**api_opts)\n # TODO: perhaps cache in __opts__\n cache_key = 'infoblox_session_{0},{1},{2}'.format(\n config['api_url'], config['api_user'], config['api_key'])\n if cache_key in cache:\n timedelta = int(time.time()) - cache[cache_key]... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | delete_host | python | def delete_host(name=None, mac=None, ipv4addr=None, **api_opts):
'''
Delete host
CLI Example:
.. code-block:: bash
salt-call infoblox.delete_host name=example.domain.com
salt-call infoblox.delete_host ipv4addr=123.123.122.12
salt-call infoblox.delete_host ipv4addr=123.123.122.... | Delete host
CLI Example:
.. code-block:: bash
salt-call infoblox.delete_host name=example.domain.com
salt-call infoblox.delete_host ipv4addr=123.123.122.12
salt-call infoblox.delete_host ipv4addr=123.123.122.12 mac=00:50:56:84:6e:ae | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L490-L505 | [
"def _get_infoblox(**api_opts):\n config = _get_config(**api_opts)\n # TODO: perhaps cache in __opts__\n cache_key = 'infoblox_session_{0},{1},{2}'.format(\n config['api_url'], config['api_user'], config['api_key'])\n if cache_key in cache:\n timedelta = int(time.time()) - cache[cache_key]... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | get_ipv4_range | python | def get_ipv4_range(start_addr=None, end_addr=None, return_fields=None, **api_opts):
'''
Get ip range
CLI Example:
.. code-block:: bash
salt-call infoblox.get_ipv4_range start_addr=123.123.122.12
'''
infoblox = _get_infoblox(**api_opts)
return infoblox.get_range(start_addr, end_add... | Get ip range
CLI Example:
.. code-block:: bash
salt-call infoblox.get_ipv4_range start_addr=123.123.122.12 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L541-L552 | [
"def _get_infoblox(**api_opts):\n config = _get_config(**api_opts)\n # TODO: perhaps cache in __opts__\n cache_key = 'infoblox_session_{0},{1},{2}'.format(\n config['api_url'], config['api_user'], config['api_key'])\n if cache_key in cache:\n timedelta = int(time.time()) - cache[cache_key]... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | delete_ipv4_range | python | def delete_ipv4_range(start_addr=None, end_addr=None, **api_opts):
'''
Delete ip range.
CLI Example:
.. code-block:: bash
salt-call infoblox.delete_ipv4_range start_addr=123.123.122.12
'''
r = get_ipv4_range(start_addr, end_addr, **api_opts)
if r:
return delete_object(r['_... | Delete ip range.
CLI Example:
.. code-block:: bash
salt-call infoblox.delete_ipv4_range start_addr=123.123.122.12 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L555-L569 | [
"def delete_object(objref, **api_opts):\n '''\n Delete infoblox object. This is a low level api call.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt-call infoblox.delete_object objref=[ref_of_object]\n '''\n if '__opts__' in globals() and __opts__['test']:\n return {'Test': 'Woul... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | get_a | python | def get_a(name=None, ipv4addr=None, allow_array=True, **api_opts):
'''
Get A record
CLI Examples:
.. code-block:: bash
salt-call infoblox.get_a name=abc.example.com
salt-call infoblox.get_a ipv4addr=192.168.3.5
'''
data = {}
if name:
data['name'] = name
if ipv4... | Get A record
CLI Examples:
.. code-block:: bash
salt-call infoblox.get_a name=abc.example.com
salt-call infoblox.get_a ipv4addr=192.168.3.5 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L610-L629 | [
"def get_object(objref, data=None, return_fields=None, max_results=None,\n ensure_none_or_one_result=False, **api_opts):\n '''\n Get raw infoblox object. This is a low level api call.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt-call infoblox.get_object objref=[_ref of object]... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/modules/infoblox.py | delete_a | python | def delete_a(name=None, ipv4addr=None, allow_array=False, **api_opts):
'''
Delete A record
If the A record is used as a round robin you can set ``allow_array=True`` to
delete all records for the hostname.
CLI Examples:
.. code-block:: bash
salt-call infoblox.delete_a name=abc.example... | Delete A record
If the A record is used as a round robin you can set ``allow_array=True`` to
delete all records for the hostname.
CLI Examples:
.. code-block:: bash
salt-call infoblox.delete_a name=abc.example.com
salt-call infoblox.delete_a ipv4addr=192.168.3.5
salt-call inf... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L632-L655 | [
"def delete_object(objref, **api_opts):\n '''\n Delete infoblox object. This is a low level api call.\n\n CLI Example:\n\n .. code-block:: bash\n\n salt-call infoblox.delete_object objref=[ref_of_object]\n '''\n if '__opts__' in globals() and __opts__['test']:\n return {'Test': 'Woul... | # -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
saltstack/salt | salt/states/infoblox_a.py | present | python | def present(name=None, ipv4addr=None, data=None, ensure_data=True, **api_opts):
'''
Ensure infoblox A record.
When you wish to update a hostname ensure `name` is set to the hostname
of the current record. You can give a new name in the `data.name`.
State example:
.. code-block:: yaml
... | Ensure infoblox A record.
When you wish to update a hostname ensure `name` is set to the hostname
of the current record. You can give a new name in the `data.name`.
State example:
.. code-block:: yaml
infoblox_a.present:
- name: example-ha-0.domain.com
- data:
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/infoblox_a.py#L17-L90 | null | # -*- coding: utf-8 -*-
'''
Infoblox A record managment.
functions accept api_opts:
api_verifyssl: verify SSL [default to True or pillar value]
api_url: server to connect to [default to pillar value]
api_username: [default to pillar value]
api_password: [default to pillar value]
'''
# Import Python... |
saltstack/salt | salt/states/infoblox_a.py | absent | python | def absent(name=None, ipv4addr=None, **api_opts):
'''
Ensure infoblox A record is removed.
State example:
.. code-block:: yaml
infoblox_a.absent:
- name: example-ha-0.domain.com
infoblox_a.absent:
- name:
- ipv4addr: 127.0.23.23
'''
ret = {... | Ensure infoblox A record is removed.
State example:
.. code-block:: yaml
infoblox_a.absent:
- name: example-ha-0.domain.com
infoblox_a.absent:
- name:
- ipv4addr: 127.0.23.23 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/infoblox_a.py#L93-L124 | null | # -*- coding: utf-8 -*-
'''
Infoblox A record managment.
functions accept api_opts:
api_verifyssl: verify SSL [default to True or pillar value]
api_url: server to connect to [default to pillar value]
api_username: [default to pillar value]
api_password: [default to pillar value]
'''
# Import Python... |
saltstack/salt | salt/modules/kapacitor.py | _get_url | python | def _get_url():
'''
Get the kapacitor URL.
'''
protocol = __salt__['config.option']('kapacitor.protocol', 'http')
host = __salt__['config.option']('kapacitor.host', 'localhost')
port = __salt__['config.option']('kapacitor.port', 9092)
return '{0}://{1}:{2}'.format(protocol, host, port) | Get the kapacitor URL. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kapacitor.py#L55-L63 | null | # -*- coding: utf-8 -*-
'''
Kapacitor execution module.
:configuration: This module accepts connection configuration details either as
parameters or as configuration settings in /etc/salt/minion on the relevant
minions::
kapacitor.host: 'localhost'
kapacitor.port: 9092
.. versionadded:: 2... |
saltstack/salt | salt/modules/kapacitor.py | get_task | python | def get_task(name):
'''
Get a dict of data on a task.
name
Name of the task to get information about.
CLI Example:
.. code-block:: bash
salt '*' kapacitor.get_task cpu
'''
url = _get_url()
if version() < '0.13':
task_url = '{0}/task?name={1}'.format(url, name... | Get a dict of data on a task.
name
Name of the task to get information about.
CLI Example:
.. code-block:: bash
salt '*' kapacitor.get_task cpu | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kapacitor.py#L66-L106 | [
"def loads(s, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.loads and prevents a traceback in the event that a bytestring is\n passed to the function. (Python < 3.6 cannot load bytestrings)\n\n You can pass an alternate json module (loaded via import_json() above)\n using the _json_... | # -*- coding: utf-8 -*-
'''
Kapacitor execution module.
:configuration: This module accepts connection configuration details either as
parameters or as configuration settings in /etc/salt/minion on the relevant
minions::
kapacitor.host: 'localhost'
kapacitor.port: 9092
.. versionadded:: 2... |
saltstack/salt | salt/modules/kapacitor.py | _run_cmd | python | def _run_cmd(cmd):
'''
Run a Kapacitor task and return a dictionary of info.
'''
ret = {}
env_vars = {
'KAPACITOR_URL': _get_url(),
'KAPACITOR_UNSAFE_SSL': __salt__['config.option']('kapacitor.unsafe_ssl', 'false'),
}
result = __salt__['cmd.run_all'](cmd, env=env_vars)
i... | Run a Kapacitor task and return a dictionary of info. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kapacitor.py#L109-L126 | [
"def _get_url():\n '''\n Get the kapacitor URL.\n '''\n protocol = __salt__['config.option']('kapacitor.protocol', 'http')\n host = __salt__['config.option']('kapacitor.host', 'localhost')\n port = __salt__['config.option']('kapacitor.port', 9092)\n\n return '{0}://{1}:{2}'.format(protocol, hos... | # -*- coding: utf-8 -*-
'''
Kapacitor execution module.
:configuration: This module accepts connection configuration details either as
parameters or as configuration settings in /etc/salt/minion on the relevant
minions::
kapacitor.host: 'localhost'
kapacitor.port: 9092
.. versionadded:: 2... |
saltstack/salt | salt/modules/kapacitor.py | define_task | python | def define_task(name,
tick_script,
task_type='stream',
database=None,
retention_policy='default',
dbrps=None):
'''
Define a task. Serves as both create/update.
name
Name of the task.
tick_script
Path to the... | Define a task. Serves as both create/update.
name
Name of the task.
tick_script
Path to the TICK script for the task. Can be a salt:// source.
task_type
Task type. Defaults to 'stream'
dbrps
A list of databases and retention policies in "dbname"."rpname" format
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kapacitor.py#L129-L194 | [
"def _run_cmd(cmd):\n '''\n Run a Kapacitor task and return a dictionary of info.\n '''\n ret = {}\n env_vars = {\n 'KAPACITOR_URL': _get_url(),\n 'KAPACITOR_UNSAFE_SSL': __salt__['config.option']('kapacitor.unsafe_ssl', 'false'),\n }\n result = __salt__['cmd.run_all'](cmd, env=en... | # -*- coding: utf-8 -*-
'''
Kapacitor execution module.
:configuration: This module accepts connection configuration details either as
parameters or as configuration settings in /etc/salt/minion on the relevant
minions::
kapacitor.host: 'localhost'
kapacitor.port: 9092
.. versionadded:: 2... |
saltstack/salt | salt/modules/linux_ip.py | _ip_ifaces | python | def _ip_ifaces():
'''
Parse output from 'ip a'
'''
tmp = {}
ret = {}
if_ = None
at_ = None
out = __salt__['cmd.run']('ip a')
for line in out.splitlines():
if not line.startswith(' '):
comps = line.split(':')
if_ = comps[1].strip()
opts_comp... | Parse output from 'ip a' | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_ip.py#L67-L103 | null | # -*- coding: utf-8 -*-
'''
The networking module for Non-RH/Deb Linux distros
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt libs
import salt.utils.files
import salt.utils.path
import salt.utils.platform
import salt.utils.stringutils
from salt.ext.six.... |
saltstack/salt | salt/modules/linux_ip.py | _parse_routes | python | def _parse_routes():
'''
Parse the contents of ``/proc/net/route``
'''
with salt.utils.files.fopen('/proc/net/route', 'r') as fp_:
out = salt.utils.stringutils.to_unicode(fp_.read())
ret = {}
for line in out.splitlines():
tmp = {}
if not line.strip():
continu... | Parse the contents of ``/proc/net/route`` | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_ip.py#L139-L168 | [
"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 -*-
'''
The networking module for Non-RH/Deb Linux distros
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt libs
import salt.utils.files
import salt.utils.path
import salt.utils.platform
import salt.utils.stringutils
from salt.ext.six.... |
saltstack/salt | salt/modules/linux_ip.py | _hex_to_octets | python | def _hex_to_octets(addr):
'''
Convert hex fields from /proc/net/route to octects
'''
return '{0}:{1}:{2}:{3}'.format(
int(addr[6:8], 16),
int(addr[4:6], 16),
int(addr[2:4], 16),
int(addr[0:2], 16),
) | Convert hex fields from /proc/net/route to octects | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_ip.py#L171-L180 | null | # -*- coding: utf-8 -*-
'''
The networking module for Non-RH/Deb Linux distros
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt libs
import salt.utils.files
import salt.utils.path
import salt.utils.platform
import salt.utils.stringutils
from salt.ext.six.... |
saltstack/salt | salt/modules/linux_ip.py | _route_flags | python | def _route_flags(rflags):
'''
https://github.com/torvalds/linux/blob/master/include/uapi/linux/route.h
https://github.com/torvalds/linux/blob/master/include/uapi/linux/ipv6_route.h
'''
flags = ''
fmap = {
0x0001: 'U', # RTF_UP, route is up
0x0002: 'G', # RTF_GATEWAY, use gatewa... | https://github.com/torvalds/linux/blob/master/include/uapi/linux/route.h
https://github.com/torvalds/linux/blob/master/include/uapi/linux/ipv6_route.h | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_ip.py#L183-L203 | null | # -*- coding: utf-8 -*-
'''
The networking module for Non-RH/Deb Linux distros
'''
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt libs
import salt.utils.files
import salt.utils.path
import salt.utils.platform
import salt.utils.stringutils
from salt.ext.six.... |
saltstack/salt | salt/modules/nilrt_ip.py | _get_state | python | def _get_state():
'''
Returns the state of connman
'''
try:
return pyconnman.ConnManager().get_property('State')
except KeyError:
return 'offline'
except dbus.DBusException as exc:
raise salt.exceptions.CommandExecutionError('Connman daemon error: {0}'.format(exc)) | Returns the state of connman | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L85-L94 | null | # -*- coding: utf-8 -*-
'''
The networking module for NI Linux Real-Time distro
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import time
import os
import re
# Import salt libs
import salt.exceptions
import salt.utils.files
import salt.utils.validate... |
saltstack/salt | salt/modules/nilrt_ip.py | _get_technologies | python | def _get_technologies():
'''
Returns the technologies of connman
'''
tech = ''
technologies = pyconnman.ConnManager().get_technologies()
for path, params in technologies:
tech += '{0}\n\tName = {1}\n\tType = {2}\n\tPowered = {3}\n\tConnected = {4}\n'.format(
path, params['Nam... | Returns the technologies of connman | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L97-L106 | null | # -*- coding: utf-8 -*-
'''
The networking module for NI Linux Real-Time distro
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import time
import os
import re
# Import salt libs
import salt.exceptions
import salt.utils.files
import salt.utils.validate... |
saltstack/salt | salt/modules/nilrt_ip.py | _get_services | python | def _get_services():
'''
Returns a list with all connman services
'''
serv = []
services = pyconnman.ConnManager().get_services()
for path, _ in services:
serv.append(six.text_type(path[len(SERVICE_PATH):]))
return serv | Returns a list with all connman services | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L109-L117 | null | # -*- coding: utf-8 -*-
'''
The networking module for NI Linux Real-Time distro
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import time
import os
import re
# Import salt libs
import salt.exceptions
import salt.utils.files
import salt.utils.validate... |
saltstack/salt | salt/modules/nilrt_ip.py | _connected | python | def _connected(service):
'''
Verify if a connman service is connected
'''
state = pyconnman.ConnService(os.path.join(SERVICE_PATH, service)).get_property('State')
return state == 'online' or state == 'ready' | Verify if a connman service is connected | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L120-L125 | null | # -*- coding: utf-8 -*-
'''
The networking module for NI Linux Real-Time distro
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import time
import os
import re
# Import salt libs
import salt.exceptions
import salt.utils.files
import salt.utils.validate... |
saltstack/salt | salt/modules/nilrt_ip.py | _space_delimited_list | python | def _space_delimited_list(value):
'''
validate that a value contains one or more space-delimited values
'''
if isinstance(value, six.string_types):
items = value.split(' ')
valid = items and all(items)
else:
valid = hasattr(value, '__iter__') and (value != [])
if valid:
... | validate that a value contains one or more space-delimited values | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L128-L140 | null | # -*- coding: utf-8 -*-
'''
The networking module for NI Linux Real-Time distro
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import time
import os
import re
# Import salt libs
import salt.exceptions
import salt.utils.files
import salt.utils.validate... |
saltstack/salt | salt/modules/nilrt_ip.py | _validate_ipv4 | python | def _validate_ipv4(value):
'''
validate ipv4 values
'''
if len(value) == 3:
if not salt.utils.validate.net.ipv4_addr(value[0].strip()):
return False, 'Invalid ip address: {0} for ipv4 option'.format(value[0])
if not salt.utils.validate.net.netmask(value[1].strip()):
... | validate ipv4 values | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L143-L156 | [
"def ipv4_addr(addr):\n '''\n Returns True if the IPv4 address (and optional subnet) are valid, otherwise\n returns False.\n '''\n return __ip_addr(addr, socket.AF_INET)\n"
] | # -*- coding: utf-8 -*-
'''
The networking module for NI Linux Real-Time distro
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import time
import os
import re
# Import salt libs
import salt.exceptions
import salt.utils.files
import salt.utils.validate... |
saltstack/salt | salt/modules/nilrt_ip.py | _interface_to_service | python | def _interface_to_service(iface):
'''
returns the coresponding service to given interface if exists, otherwise return None
'''
for _service in _get_services():
service_info = pyconnman.ConnService(os.path.join(SERVICE_PATH, _service))
if service_info.get_property('Ethernet')['Interface']... | returns the coresponding service to given interface if exists, otherwise return None | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L159-L167 | [
"def _get_services():\n '''\n Returns a list with all connman services\n '''\n serv = []\n services = pyconnman.ConnManager().get_services()\n for path, _ in services:\n serv.append(six.text_type(path[len(SERVICE_PATH):]))\n return serv\n"
] | # -*- coding: utf-8 -*-
'''
The networking module for NI Linux Real-Time distro
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import time
import os
import re
# Import salt libs
import salt.exceptions
import salt.utils.files
import salt.utils.validate... |
saltstack/salt | salt/modules/nilrt_ip.py | _get_service_info | python | def _get_service_info(service):
'''
return details about given connman service
'''
service_info = pyconnman.ConnService(os.path.join(SERVICE_PATH, service))
data = {
'label': service,
'wireless': service_info.get_property('Type') == 'wifi',
'connectionid': six.text_type(servi... | return details about given connman service | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L170-L230 | null | # -*- coding: utf-8 -*-
'''
The networking module for NI Linux Real-Time distro
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import time
import os
import re
# Import salt libs
import salt.exceptions
import salt.utils.files
import salt.utils.validate... |
saltstack/salt | salt/modules/nilrt_ip.py | _get_dns_info | python | def _get_dns_info():
'''
return dns list
'''
dns_list = []
try:
with salt.utils.files.fopen('/etc/resolv.conf', 'r+') as dns_info:
lines = dns_info.readlines()
for line in lines:
if 'nameserver' in line:
dns = line.split()[1].strip(... | return dns list | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L233-L248 | null | # -*- coding: utf-8 -*-
'''
The networking module for NI Linux Real-Time distro
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import time
import os
import re
# Import salt libs
import salt.exceptions
import salt.utils.files
import salt.utils.validate... |
saltstack/salt | salt/modules/nilrt_ip.py | _load_config | python | def _load_config(section, options, default_value='', filename=INI_FILE):
'''
Get values for some options and a given section from a config file.
:param section: Section Name
:param options: List of options
:param default_value: Default value if an option doesn't have a value. Default is empty strin... | Get values for some options and a given section from a config file.
:param section: Section Name
:param options: List of options
:param default_value: Default value if an option doesn't have a value. Default is empty string.
:param filename: config file. Default is INI_FILE.
:return: | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L261-L281 | null | # -*- coding: utf-8 -*-
'''
The networking module for NI Linux Real-Time distro
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import time
import os
import re
# Import salt libs
import salt.exceptions
import salt.utils.files
import salt.utils.validate... |
saltstack/salt | salt/modules/nilrt_ip.py | _get_request_mode_info | python | def _get_request_mode_info(interface):
'''
return requestmode for given interface
'''
settings = _load_config(interface, ['linklocalenabled', 'dhcpenabled'], -1)
link_local_enabled = int(settings['linklocalenabled'])
dhcp_enabled = int(settings['dhcpenabled'])
if dhcp_enabled == 1:
... | return requestmode for given interface | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L284-L303 | null | # -*- coding: utf-8 -*-
'''
The networking module for NI Linux Real-Time distro
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import time
import os
import re
# Import salt libs
import salt.exceptions
import salt.utils.files
import salt.utils.validate... |
saltstack/salt | salt/modules/nilrt_ip.py | _get_possible_adapter_modes | python | def _get_possible_adapter_modes(interface, blacklist):
'''
Return possible adapter modes for a given interface using a blacklist.
:param interface: interface name
:param blacklist: given blacklist
:return: list of possible adapter modes
'''
adapter_modes = []
protocols = _load_config('l... | Return possible adapter modes for a given interface using a blacklist.
:param interface: interface name
:param blacklist: given blacklist
:return: list of possible adapter modes | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L314-L345 | null | # -*- coding: utf-8 -*-
'''
The networking module for NI Linux Real-Time distro
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import time
import os
import re
# Import salt libs
import salt.exceptions
import salt.utils.files
import salt.utils.validate... |
saltstack/salt | salt/modules/nilrt_ip.py | _get_static_info | python | def _get_static_info(interface):
'''
Return information about an interface from config file.
:param interface: interface label
'''
data = {
'connectionid': interface.name,
'label': interface.name,
'hwaddr': interface.hwaddr[:-1],
'up': False,
'ipv4': {
... | Return information about an interface from config file.
:param interface: interface label | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L348-L374 | null | # -*- coding: utf-8 -*-
'''
The networking module for NI Linux Real-Time distro
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import time
import os
import re
# Import salt libs
import salt.exceptions
import salt.utils.files
import salt.utils.validate... |
saltstack/salt | salt/modules/nilrt_ip.py | _get_base_interface_info | python | def _get_base_interface_info(interface):
'''
return base details about given interface
'''
blacklist = {
'tcpip': {
'name': [],
'type': [],
'additional_protocol': False
},
'disabled': {
'name': ['eth0'],
'type': ['gadget... | return base details about given interface | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L377-L414 | null | # -*- coding: utf-8 -*-
'''
The networking module for NI Linux Real-Time distro
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import time
import os
import re
# Import salt libs
import salt.exceptions
import salt.utils.files
import salt.utils.validate... |
saltstack/salt | salt/modules/nilrt_ip.py | _get_ethercat_interface_info | python | def _get_ethercat_interface_info(interface):
'''
return details about given ethercat interface
'''
base_information = _get_base_interface_info(interface)
base_information['ethercat'] = {
'masterid': _load_config(interface.name, ['MasterID'])['MasterID']
}
return base_information | return details about given ethercat interface | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L417-L425 | null | # -*- coding: utf-8 -*-
'''
The networking module for NI Linux Real-Time distro
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import time
import os
import re
# Import salt libs
import salt.exceptions
import salt.utils.files
import salt.utils.validate... |
saltstack/salt | salt/modules/nilrt_ip.py | _get_tcpip_interface_info | python | def _get_tcpip_interface_info(interface):
'''
return details about given tcpip interface
'''
base_information = _get_base_interface_info(interface)
if base_information['ipv4']['requestmode'] == 'static':
settings = _load_config(interface.name, ['IP_Address', 'Subnet_Mask', 'Gateway', 'DNS_Ad... | return details about given tcpip interface | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L428-L452 | null | # -*- coding: utf-8 -*-
'''
The networking module for NI Linux Real-Time distro
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import time
import os
import re
# Import salt libs
import salt.exceptions
import salt.utils.files
import salt.utils.validate... |
saltstack/salt | salt/modules/nilrt_ip.py | _get_interface_info | python | def _get_interface_info(interface):
'''
return details about given interface
'''
adapter_mode = _get_adapter_mode_info(interface.name)
if adapter_mode == 'disabled':
return _get_base_interface_info(interface)
elif adapter_mode == 'ethercat':
return _get_ethercat_interface_info(in... | return details about given interface | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L455-L464 | null | # -*- coding: utf-8 -*-
'''
The networking module for NI Linux Real-Time distro
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import time
import os
import re
# Import salt libs
import salt.exceptions
import salt.utils.files
import salt.utils.validate... |
saltstack/salt | salt/modules/nilrt_ip.py | _dict_to_string | python | def _dict_to_string(dictionary):
'''
converts a dictionary object into a list of strings
'''
ret = ''
for key, val in sorted(dictionary.items()):
if isinstance(val, dict):
for line in _dict_to_string(val):
ret += six.text_type(key) + '-' + line + '\n'
elif... | converts a dictionary object into a list of strings | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L467-L481 | [
"def _dict_to_string(dictionary):\n '''\n converts a dictionary object into a list of strings\n '''\n ret = ''\n for key, val in sorted(dictionary.items()):\n if isinstance(val, dict):\n for line in _dict_to_string(val):\n ret += six.text_type(key) + '-' + line + '\\n... | # -*- coding: utf-8 -*-
'''
The networking module for NI Linux Real-Time distro
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import time
import os
import re
# Import salt libs
import salt.exceptions
import salt.utils.files
import salt.utils.validate... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.