repo
stringclasses
85 values
path
stringlengths
8
121
func_name
stringlengths
1
82
original_string
stringlengths
112
65.5k
language
stringclasses
1 value
code
stringlengths
112
65.5k
code_tokens
listlengths
20
4.09k
docstring
stringlengths
3
46.3k
docstring_tokens
listlengths
1
564
sha
stringclasses
85 values
url
stringlengths
93
218
partition
stringclasses
1 value
saltstack/salt
salt/modules/win_system.py
get_pending_file_rename
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 ...
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 ...
[ "def", "get_pending_file_rename", "(", ")", ":", "vnames", "=", "(", "'PendingFileRenameOperations'", ",", "'PendingFileRenameOperations2'", ")", "key", "=", "r'SYSTEM\\CurrentControlSet\\Control\\Session Manager'", "# If any of the value names exist and have value data set,", "# the...
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...
[ "Determine", "whether", "there", "are", "pending", "file", "rename", "operations", "that", "require", "a", "reboot", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1335-L1368
train
saltstack/salt
salt/modules/win_system.py
get_pending_servermanager
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 ...
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 ...
[ "def", "get_pending_servermanager", "(", ")", ":", "vname", "=", "'CurrentRebootAttempts'", "key", "=", "r'SOFTWARE\\Microsoft\\ServerManager'", "# There are situations where it's possible to have '(value not set)' as", "# the value data, and since an actual reboot won't be pending in that",...
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
[ "Determine", "whether", "there", "are", "pending", "Server", "Manager", "tasks", "that", "require", "a", "reboot", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1371-L1407
train
saltstack/salt
salt/modules/win_system.py
get_pending_update
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 '''...
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 '''...
[ "def", "get_pending_update", "(", ")", ":", "key", "=", "r'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update\\RebootRequired'", "# So long as the registry key exists, a reboot is pending.", "if", "__utils__", "[", "'reg.key_exists'", "]", "(", "'HKLM'", ",", ...
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", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1410-L1434
train
saltstack/salt
salt/modules/win_system.py
set_reboot_required_witnessed
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\\...
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\\...
[ "def", "set_reboot_required_witnessed", "(", ")", ":", "return", "__utils__", "[", "'reg.set_value'", "]", "(", "hive", "=", "'HKLM'", ",", "key", "=", "MINION_VOLATILE_KEY", ",", "volatile", "=", "True", ",", "vname", "=", "REBOOT_REQUIRED_NAME", ",", "vdata", ...
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 ...
[ "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"...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1443-L1476
train
saltstack/salt
salt/modules/win_system.py
get_pending_reboot
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...
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...
[ "def", "get_pending_reboot", "(", ")", ":", "# Order the checks for reboot pending in most to least likely.", "checks", "=", "(", "get_pending_update", ",", "get_pending_file_rename", ",", "get_pending_servermanager", ",", "get_pending_component_servicing", ",", "get_reboot_require...
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
[ "Determine", "whether", "there", "is", "a", "reboot", "pending", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_system.py#L1508-L1537
train
saltstack/salt
salt/states/postgres_extension.py
present
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 ...
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 ...
[ "def", "present", "(", "name", ",", "if_not_exists", "=", "None", ",", "schema", "=", "None", ",", "ext_version", "=", "None", ",", "from_version", "=", "None", ",", "user", "=", "None", ",", "maintenance_db", "=", "None", ",", "db_user", "=", "None", ...
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...
[ "Ensure", "that", "the", "named", "extension", "is", "present", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/postgres_extension.py#L36-L151
train
saltstack/salt
salt/states/postgres_extension.py
absent
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 ...
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 ...
[ "def", "absent", "(", "name", ",", "if_exists", "=", "None", ",", "restrict", "=", "None", ",", "cascade", "=", "None", ",", "user", "=", "None", ",", "maintenance_db", "=", "None", ",", "db_user", "=", "None", ",", "db_password", "=", "None", ",", "...
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 ...
[ "Ensure", "that", "the", "named", "extension", "is", "absent", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/postgres_extension.py#L154-L232
train
saltstack/salt
salt/auth/file.py
_get_file_auth_config
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...
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...
[ "def", "_get_file_auth_config", "(", ")", ":", "config", "=", "{", "'filetype'", ":", "'text'", ",", "'hashtype'", ":", "'plaintext'", ",", "'field_separator'", ":", "':'", ",", "'username_field'", ":", "1", ",", "'password_field'", ":", "2", ",", "}", "for"...
Setup defaults and check configuration variables for auth backends
[ "Setup", "defaults", "and", "check", "configuration", "variables", "for", "auth", "backends" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/file.py#L116-L146
train
saltstack/salt
salt/auth/file.py
_text
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...
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...
[ "def", "_text", "(", "username", ",", "password", ",", "*", "*", "kwargs", ")", ":", "filename", "=", "kwargs", "[", "'filename'", "]", "hashtype", "=", "kwargs", "[", "'hashtype'", "]", "field_separator", "=", "kwargs", "[", "'field_separator'", "]", "use...
The text file function can authenticate plaintext and digest methods that are available in the :py:func:`hashutil.digest <salt.modules.hashutil.digest>` function.
[ "The", "text", "file", "function", "can", "authenticate", "plaintext", "and", "digest", "methods", "that", "are", "available", "in", "the", ":", "py", ":", "func", ":", "hashutil", ".", "digest", "<salt", ".", "modules", ".", "hashutil", ".", "digest", ">"...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/file.py#L149-L190
train
saltstack/salt
salt/auth/file.py
_htpasswd
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...
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...
[ "def", "_htpasswd", "(", "username", ",", "password", ",", "*", "*", "kwargs", ")", ":", "from", "passlib", ".", "apache", "import", "HtpasswdFile", "pwfile", "=", "HtpasswdFile", "(", "kwargs", "[", "'filename'", "]", ")", "# passlib below version 1.6 uses 'ver...
Provide authentication via Apache-style htpasswd files
[ "Provide", "authentication", "via", "Apache", "-", "style", "htpasswd", "files" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/file.py#L193-L206
train
saltstack/salt
salt/auth/file.py
_htdigest
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...
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...
[ "def", "_htdigest", "(", "username", ",", "password", ",", "*", "*", "kwargs", ")", ":", "realm", "=", "kwargs", ".", "get", "(", "'realm'", ",", "None", ")", "if", "not", "realm", ":", "log", ".", "error", "(", "'salt.auth.file: A ^realm must be defined i...
Provide authentication via Apache-style htdigest files
[ "Provide", "authentication", "via", "Apache", "-", "style", "htdigest", "files" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/file.py#L209-L228
train
saltstack/salt
salt/auth/file.py
_htfile
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('...
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('...
[ "def", "_htfile", "(", "username", ",", "password", ",", "*", "*", "kwargs", ")", ":", "filetype", "=", "kwargs", ".", "get", "(", "'filetype'", ",", "'htpasswd'", ")", ".", "lower", "(", ")", "try", ":", "import", "passlib", "kwargs", "[", "'passlib_v...
Gate function for _htpasswd and _htdigest authentication backends
[ "Gate", "function", "for", "_htpasswd", "and", "_htdigest", "authentication", "backends" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/file.py#L231-L249
train
saltstack/salt
salt/auth/file.py
auth
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. .. ...
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. .. ...
[ "def", "auth", "(", "username", ",", "password", ")", ":", "config", "=", "_get_file_auth_config", "(", ")", "if", "not", "config", ":", "return", "False", "auth_function", "=", "FILETYPE_FUNCTION_MAP", ".", "get", "(", "config", "[", "'filetype'", "]", ",",...
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...
[ "File", "based", "authentication" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/auth/file.py#L259-L308
train
saltstack/salt
salt/states/openvswitch_bridge.py
present
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. ...
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. ...
[ "def", "present", "(", "name", ",", "parent", "=", "None", ",", "vlan", "=", "None", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", "}", "# Comment and ...
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...
[ "Ensures", "that", "the", "named", "bridge", "exists", "eventually", "creates", "it", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/openvswitch_bridge.py#L17-L84
train
saltstack/salt
salt/states/openvswitch_bridge.py
absent
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...
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...
[ "def", "absent", "(", "name", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", "}", "# Comment and change messages", "comment_bridge_deleted", "=", "'Bridge {0} del...
Ensures that the named bridge does not exist, eventually deletes it. Args: name: The name of the bridge.
[ "Ensures", "that", "the", "named", "bridge", "does", "not", "exist", "eventually", "deletes", "it", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/openvswitch_bridge.py#L87-L133
train
saltstack/salt
salt/pillar/cmd_yamlex.py
ext_pillar
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)...
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)...
[ "def", "ext_pillar", "(", "minion_id", ",", "# pylint: disable=W0613", "pillar", ",", "# pylint: disable=W0613", "command", ")", ":", "try", ":", "command", "=", "command", ".", "replace", "(", "'%s'", ",", "minion_id", ")", "return", "deserialize", "(", "__salt...
Execute a command and read the output as YAMLEX
[ "Execute", "a", "command", "and", "read", "the", "output", "as", "YAMLEX" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/pillar/cmd_yamlex.py#L19-L30
train
saltstack/salt
salt/states/kubernetes.py
deployment_absent
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...
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...
[ "def", "deployment_absent", "(", "name", ",", "namespace", "=", "'default'", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", "}", ...
Ensures that the named deployment is absent from the given namespace. name The name of the deployment namespace The name of the namespace
[ "Ensures", "that", "the", "named", "deployment", "is", "absent", "from", "the", "given", "namespace", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L111-L149
train
saltstack/salt
salt/states/kubernetes.py
deployment_present
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...
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...
[ "def", "deployment_present", "(", "name", ",", "namespace", "=", "'default'", ",", "metadata", "=", "None", ",", "spec", "=", "None", ",", "source", "=", "''", ",", "template", "=", "''", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ...
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 ...
[ "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", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L152-L244
train
saltstack/salt
salt/states/kubernetes.py
service_present
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 ...
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 ...
[ "def", "service_present", "(", "name", ",", "namespace", "=", "'default'", ",", "metadata", "=", "None", ",", "spec", "=", "None", ",", "source", "=", "''", ",", "template", "=", "''", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", "...
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 ...
[ "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", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L247-L340
train
saltstack/salt
salt/states/kubernetes.py
service_absent
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, ...
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, ...
[ "def", "service_absent", "(", "name", ",", "namespace", "=", "'default'", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", "}", "...
Ensures that the named service is absent from the given namespace. name The name of the service namespace The name of the namespace
[ "Ensures", "that", "the", "named", "service", "is", "absent", "from", "the", "given", "namespace", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L343-L381
train
saltstack/salt
salt/states/kubernetes.py
namespace_absent
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...
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...
[ "def", "namespace_absent", "(", "name", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", "}", "namespace", "=", "__salt__", "[", ...
Ensures that the named namespace is absent. name The name of the namespace
[ "Ensures", "that", "the", "named", "namespace", "is", "absent", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L384-L431
train
saltstack/salt
salt/states/kubernetes.py
namespace_present
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...
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...
[ "def", "namespace_present", "(", "name", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", "}", "namespace", "=", "__salt__", "[", ...
Ensures that the named namespace is present. name The name of the namespace.
[ "Ensures", "that", "the", "named", "namespace", "is", "present", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L434-L464
train
saltstack/salt
salt/states/kubernetes.py
secret_absent
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, ...
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, ...
[ "def", "secret_absent", "(", "name", ",", "namespace", "=", "'default'", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", "}", "s...
Ensures that the named secret is absent from the given namespace. name The name of the secret namespace The name of the namespace
[ "Ensures", "that", "the", "named", "secret", "is", "absent", "from", "the", "given", "namespace", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L467-L505
train
saltstack/salt
salt/states/kubernetes.py
secret_present
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 ...
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 ...
[ "def", "secret_present", "(", "name", ",", "namespace", "=", "'default'", ",", "data", "=", "None", ",", "source", "=", "None", ",", "template", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'",...
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...
[ "Ensures", "that", "the", "named", "secret", "is", "present", "inside", "of", "the", "specified", "namespace", "with", "the", "given", "data", ".", "If", "the", "secret", "exists", "it", "will", "be", "replaced", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L508-L592
train
saltstack/salt
salt/states/kubernetes.py
configmap_absent
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...
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...
[ "def", "configmap_absent", "(", "name", ",", "namespace", "=", "'default'", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", "}", ...
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.
[ "Ensures", "that", "the", "named", "configmap", "is", "absent", "from", "the", "given", "namespace", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L595-L634
train
saltstack/salt
salt/states/kubernetes.py
configmap_present
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...
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...
[ "def", "configmap_present", "(", "name", ",", "namespace", "=", "'default'", ",", "data", "=", "None", ",", "source", "=", "None", ",", "template", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes...
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...
[ "Ensures", "that", "the", "named", "configmap", "is", "present", "inside", "of", "the", "specified", "namespace", "with", "the", "given", "data", ".", "If", "the", "configmap", "exists", "it", "will", "be", "replaced", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L637-L717
train
saltstack/salt
salt/states/kubernetes.py
pod_absent
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...
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...
[ "def", "pod_absent", "(", "name", ",", "namespace", "=", "'default'", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", "}", "pod"...
Ensures that the named pod is absent from the given namespace. name The name of the pod namespace The name of the namespace
[ "Ensures", "that", "the", "named", "pod", "is", "absent", "from", "the", "given", "namespace", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L720-L761
train
saltstack/salt
salt/states/kubernetes.py
pod_present
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...
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...
[ "def", "pod_present", "(", "name", ",", "namespace", "=", "'default'", ",", "metadata", "=", "None", ",", "spec", "=", "None", ",", "source", "=", "''", ",", "template", "=", "''", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", ...
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...
[ "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", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L764-L850
train
saltstack/salt
salt/states/kubernetes.py
node_label_absent
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 = __...
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 = __...
[ "def", "node_label_absent", "(", "name", ",", "node", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", "}", "labels", "=", "__sal...
Ensures that the named label is absent from the node. name The name of the label node The name of the node
[ "Ensures", "that", "the", "named", "label", "is", "absent", "from", "the", "node", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L853-L892
train
saltstack/salt
salt/states/kubernetes.py
node_label_folder_absent
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': ''...
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': ''...
[ "def", "node_label_folder_absent", "(", "name", ",", "node", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", "}", "labels", "=", ...
Ensures the label folder doesn't exist on the specified node. name The name of label folder node The name of the node
[ "Ensures", "the", "label", "folder", "doesn", "t", "exist", "on", "the", "specified", "node", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L895-L946
train
saltstack/salt
salt/states/kubernetes.py
node_label_present
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 ...
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 ...
[ "def", "node_label_present", "(", "name", ",", "node", ",", "value", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", "}", "label...
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.
[ "Ensures", "that", "the", "named", "label", "is", "set", "on", "the", "named", "node", "with", "the", "given", "value", ".", "If", "the", "label", "exists", "it", "will", "be", "replaced", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/kubernetes.py#L949-L1009
train
saltstack/salt
salt/proxy/esxvm.py
init
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...
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...
[ "def", "init", "(", "opts", ")", ":", "log", ".", "debug", "(", "'Initting esxvm proxy module in process %s'", ",", "os", ".", "getpid", "(", ")", ")", "log", ".", "debug", "(", "'Validating esxvm proxy input'", ")", "proxy_conf", "=", "merge", "(", "opts", ...
This function gets called when the proxy starts up. For login the protocol and port are cached.
[ "This", "function", "gets", "called", "when", "the", "proxy", "starts", "up", ".", "For", "login", "the", "protocol", "and", "port", "are", "cached", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/esxvm.py#L180-L234
train
saltstack/salt
salt/proxy/esxvm.py
find_credentials
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...
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...
[ "def", "find_credentials", "(", ")", ":", "# 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", "[", "'username'", "]", ","...
Cycle through all the possible credentials and return the first one that works.
[ "Cycle", "through", "all", "the", "possible", "credentials", "and", "return", "the", "first", "one", "that", "works", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/esxvm.py#L258-L279
train
saltstack/salt
salt/modules/devmap.py
multipath_flush
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_...
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_...
[ "def", "multipath_flush", "(", "device", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "device", ")", ":", "return", "'{0} does not exist'", ".", "format", "(", "device", ")", "cmd", "=", "'multipath -f {0}'", ".", "format", "(", "device", ...
Device-Mapper Multipath flush CLI Example: .. code-block:: bash salt '*' devmap.multipath_flush mpath1
[ "Device", "-", "Mapper", "Multipath", "flush" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/devmap.py#L23-L37
train
saltstack/salt
salt/states/debconfmod.py
set_file
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: ...
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: ...
[ "def", "set_file", "(", "name", ",", "source", ",", "template", "=", "None", ",", "context", "=", "None", ",", "defaults", "=", "None", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",...
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>: ...
[ "Set", "debconf", "selections", "from", "a", "file", "or", "a", "template" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/debconfmod.py#L85-L155
train
saltstack/salt
salt/states/debconfmod.py
set
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...
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...
[ "def", "set", "(", "name", ",", "data", ",", "*", "*", "kwargs", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "''", "}", "current", "=", "__salt__", "[", ...
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: ...
[ "Set", "debconf", "selections" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/debconfmod.py#L158-L234
train
saltstack/salt
salt/engines/docker_events.py
start
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...
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...
[ "def", "start", "(", "docker_url", "=", "'unix://var/run/docker.sock'", ",", "timeout", "=", "CLIENT_TIMEOUT", ",", "tag", "=", "'salt/engines/docker_events'", ",", "filters", "=", "None", ")", ":", "if", "__opts__", ".", "get", "(", "'__role'", ")", "==", "'m...
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 ...
[ "Scan", "for", "Docker", "events", "and", "fire", "events" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/engines/docker_events.py#L42-L105
train
saltstack/salt
salt/modules/infoblox.py
_get_config
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...
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...
[ "def", "_get_config", "(", "*", "*", "api_opts", ")", ":", "config", "=", "{", "'api_sslverify'", ":", "True", ",", "'api_url'", ":", "'https://INFOBLOX/wapi/v1.2.1'", ",", "'api_user'", ":", "''", ",", "'api_key'", ":", "''", ",", "}", "if", "'__salt__'", ...
Return configuration user passed api_opts override salt config.get vars
[ "Return", "configuration", "user", "passed", "api_opts", "override", "salt", "config", ".", "get", "vars" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L58-L75
train
saltstack/salt
salt/modules/infoblox.py
update_host
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...
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...
[ "def", "update_host", "(", "name", ",", "data", ",", "*", "*", "api_opts", ")", ":", "o", "=", "get_host", "(", "name", "=", "name", ",", "*", "*", "api_opts", ")", "return", "update_object", "(", "objref", "=", "o", "[", "'_ref'", "]", ",", "data"...
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={}
[ "Update", "host", "record", ".", "This", "is", "a", "helper", "call", "to", "update_object", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L120-L133
train
saltstack/salt
salt/modules/infoblox.py
update_object
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...
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...
[ "def", "update_object", "(", "objref", ",", "data", ",", "*", "*", "api_opts", ")", ":", "if", "'__opts__'", "in", "globals", "(", ")", "and", "__opts__", "[", "'test'", "]", ":", "return", "{", "'Test'", ":", "'Would attempt to update object: {0}'", ".", ...
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={}
[ "Update", "raw", "infoblox", "object", ".", "This", "is", "a", "low", "level", "api", "call", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L136-L149
train
saltstack/salt
salt/modules/infoblox.py
delete_object
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...
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...
[ "def", "delete_object", "(", "objref", ",", "*", "*", "api_opts", ")", ":", "if", "'__opts__'", "in", "globals", "(", ")", "and", "__opts__", "[", "'test'", "]", ":", "return", "{", "'Test'", ":", "'Would attempt to delete object: {0}'", ".", "format", "(", ...
Delete infoblox object. This is a low level api call. CLI Example: .. code-block:: bash salt-call infoblox.delete_object objref=[ref_of_object]
[ "Delete", "infoblox", "object", ".", "This", "is", "a", "low", "level", "api", "call", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L152-L165
train
saltstack/salt
salt/modules/infoblox.py
create_object
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...
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...
[ "def", "create_object", "(", "object_type", ",", "data", ",", "*", "*", "api_opts", ")", ":", "if", "'__opts__'", "in", "globals", "(", ")", "and", "__opts__", "[", "'test'", "]", ":", "return", "{", "'Test'", ":", "'Would attempt to create object: {0}'", "....
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={}
[ "Create", "raw", "infoblox", "object", ".", "This", "is", "a", "low", "level", "api", "call", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L168-L181
train
saltstack/salt
salt/modules/infoblox.py
get_object
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...
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...
[ "def", "get_object", "(", "objref", ",", "data", "=", "None", ",", "return_fields", "=", "None", ",", "max_results", "=", "None", ",", "ensure_none_or_one_result", "=", "False", ",", "*", "*", "api_opts", ")", ":", "if", "not", "data", ":", "data", "=", ...
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]
[ "Get", "raw", "infoblox", "object", ".", "This", "is", "a", "low", "level", "api", "call", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L184-L199
train
saltstack/salt
salt/modules/infoblox.py
create_cname
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": "...
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": "...
[ "def", "create_cname", "(", "data", ",", "*", "*", "api_opts", ")", ":", "infoblox", "=", "_get_infoblox", "(", "*", "*", "api_opts", ")", "host", "=", "infoblox", ".", "create_cname", "(", "data", "=", "data", ")", "return", "host" ]
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...
[ "Create", "a", "cname", "record", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L202-L220
train
saltstack/salt
salt/modules/infoblox.py
get_cname
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...
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...
[ "def", "get_cname", "(", "name", "=", "None", ",", "canonical", "=", "None", ",", "return_fields", "=", "None", ",", "*", "*", "api_opts", ")", ":", "infoblox", "=", "_get_infoblox", "(", "*", "*", "api_opts", ")", "o", "=", "infoblox", ".", "get_cname...
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
[ "Get", "CNAME", "information", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L223-L236
train
saltstack/salt
salt/modules/infoblox.py
update_cname
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...
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...
[ "def", "update_cname", "(", "name", ",", "data", ",", "*", "*", "api_opts", ")", ":", "o", "=", "get_cname", "(", "name", "=", "name", ",", "*", "*", "api_opts", ")", "if", "not", "o", ":", "raise", "Exception", "(", "'CNAME record not found'", ")", ...
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...
[ "Update", "CNAME", ".", "This", "is", "a", "helper", "call", "to", "update_object", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L239-L258
train
saltstack/salt
salt/modules/infoblox.py
delete_cname
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...
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...
[ "def", "delete_cname", "(", "name", "=", "None", ",", "canonical", "=", "None", ",", "*", "*", "api_opts", ")", ":", "cname", "=", "get_cname", "(", "name", "=", "name", ",", "canonical", "=", "canonical", ",", "*", "*", "api_opts", ")", "if", "cname...
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
[ "Delete", "CNAME", ".", "This", "is", "a", "helper", "call", "to", "delete_object", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L261-L277
train
saltstack/salt
salt/modules/infoblox.py
get_host
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...
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...
[ "def", "get_host", "(", "name", "=", "None", ",", "ipv4addr", "=", "None", ",", "mac", "=", "None", ",", "return_fields", "=", "None", ",", "*", "*", "api_opts", ")", ":", "infoblox", "=", "_get_infoblox", "(", "*", "*", "api_opts", ")", "host", "=",...
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
[ "Get", "host", "information" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L280-L294
train
saltstack/salt
salt/modules/infoblox.py
get_host_advanced
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...
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...
[ "def", "get_host_advanced", "(", "name", "=", "None", ",", "ipv4addr", "=", "None", ",", "mac", "=", "None", ",", "*", "*", "api_opts", ")", ":", "infoblox", "=", "_get_infoblox", "(", "*", "*", "api_opts", ")", "host", "=", "infoblox", ".", "get_host_...
Get all host information CLI Example: .. code-block:: bash salt-call infoblox.get_host_advanced hostname.domain.ca
[ "Get", "all", "host", "information" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L297-L309
train
saltstack/salt
salt/modules/infoblox.py
get_host_domainname
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 ...
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 ...
[ "def", "get_host_domainname", "(", "name", ",", "domains", "=", "None", ",", "*", "*", "api_opts", ")", ":", "name", "=", "name", ".", "lower", "(", ")", ".", "rstrip", "(", "'.'", ")", "if", "not", "domains", ":", "data", "=", "get_host", "(", "na...
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...
[ "Get", "host", "domain", "name" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L312-L348
train
saltstack/salt
salt/modules/infoblox.py
get_host_hostname
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...
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...
[ "def", "get_host_hostname", "(", "name", ",", "domains", "=", "None", ",", "*", "*", "api_opts", ")", ":", "name", "=", "name", ".", "lower", "(", ")", ".", "rstrip", "(", "'.'", ")", "if", "not", "domains", ":", "return", "name", ".", "split", "("...
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...
[ "Get", "hostname" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L351-L382
train
saltstack/salt
salt/modules/infoblox.py
get_host_mac
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...
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...
[ "def", "get_host_mac", "(", "name", "=", "None", ",", "allow_array", "=", "False", ",", "*", "*", "api_opts", ")", ":", "data", "=", "get_host", "(", "name", "=", "name", ",", "*", "*", "api_opts", ")", "if", "data", "and", "'ipv4addrs'", "in", "data...
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
[ "Get", "mac", "address", "from", "host", "record", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L385-L407
train
saltstack/salt
salt/modules/infoblox.py
get_host_ipv4
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...
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...
[ "def", "get_host_ipv4", "(", "name", "=", "None", ",", "mac", "=", "None", ",", "allow_array", "=", "False", ",", "*", "*", "api_opts", ")", ":", "data", "=", "get_host", "(", "name", "=", "name", ",", "mac", "=", "mac", ",", "*", "*", "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_host_ipv4 mac=00:50:56:84:6e:ae
[ "Get", "ipv4", "address", "from", "host", "record", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L410-L433
train
saltstack/salt
salt/modules/infoblox.py
get_host_ipv4addr_info
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...
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...
[ "def", "get_host_ipv4addr_info", "(", "ipv4addr", "=", "None", ",", "mac", "=", "None", ",", "discovered_data", "=", "None", ",", "return_fields", "=", "None", ",", "*", "*", "api_opts", ")", ":", "infoblox", "=", "_get_infoblox", "(", "*", "*", "api_opts"...
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...
[ "Get", "host", "ipv4addr", "information" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L436-L451
train
saltstack/salt
salt/modules/infoblox.py
get_host_ipv6addr_info
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...
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...
[ "def", "get_host_ipv6addr_info", "(", "ipv6addr", "=", "None", ",", "mac", "=", "None", ",", "discovered_data", "=", "None", ",", "return_fields", "=", "None", ",", "*", "*", "api_opts", ")", ":", "infoblox", "=", "_get_infoblox", "(", "*", "*", "api_opts"...
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
[ "Get", "host", "ipv6addr", "information" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L454-L467
train
saltstack/salt
salt/modules/infoblox.py
get_network
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...
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...
[ "def", "get_network", "(", "ipv4addr", "=", "None", ",", "network", "=", "None", ",", "return_fields", "=", "None", ",", "*", "*", "api_opts", ")", ":", "infoblox", "=", "_get_infoblox", "(", "*", "*", "api_opts", ")", "return", "infoblox", ".", "get_net...
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...
[ "Get", "list", "of", "all", "networks", ".", "This", "is", "helpful", "when", "looking", "up", "subnets", "to", "use", "with", "func", ":", "nextavailableip" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L470-L487
train
saltstack/salt
salt/modules/infoblox.py
delete_host
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....
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....
[ "def", "delete_host", "(", "name", "=", "None", ",", "mac", "=", "None", ",", "ipv4addr", "=", "None", ",", "*", "*", "api_opts", ")", ":", "if", "'__opts__'", "in", "globals", "(", ")", "and", "__opts__", "[", "'test'", "]", ":", "return", "{", "'...
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
[ "Delete", "host" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L490-L505
train
saltstack/salt
salt/modules/infoblox.py
get_ipv4_range
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...
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...
[ "def", "get_ipv4_range", "(", "start_addr", "=", "None", ",", "end_addr", "=", "None", ",", "return_fields", "=", "None", ",", "*", "*", "api_opts", ")", ":", "infoblox", "=", "_get_infoblox", "(", "*", "*", "api_opts", ")", "return", "infoblox", ".", "g...
Get ip range CLI Example: .. code-block:: bash salt-call infoblox.get_ipv4_range start_addr=123.123.122.12
[ "Get", "ip", "range" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L541-L552
train
saltstack/salt
salt/modules/infoblox.py
delete_ipv4_range
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['_...
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['_...
[ "def", "delete_ipv4_range", "(", "start_addr", "=", "None", ",", "end_addr", "=", "None", ",", "*", "*", "api_opts", ")", ":", "r", "=", "get_ipv4_range", "(", "start_addr", ",", "end_addr", ",", "*", "*", "api_opts", ")", "if", "r", ":", "return", "de...
Delete ip range. CLI Example: .. code-block:: bash salt-call infoblox.delete_ipv4_range start_addr=123.123.122.12
[ "Delete", "ip", "range", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L555-L569
train
saltstack/salt
salt/modules/infoblox.py
get_a
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...
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...
[ "def", "get_a", "(", "name", "=", "None", ",", "ipv4addr", "=", "None", ",", "allow_array", "=", "True", ",", "*", "*", "api_opts", ")", ":", "data", "=", "{", "}", "if", "name", ":", "data", "[", "'name'", "]", "=", "name", "if", "ipv4addr", ":"...
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
[ "Get", "A", "record" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L610-L629
train
saltstack/salt
salt/modules/infoblox.py
delete_a
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...
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...
[ "def", "delete_a", "(", "name", "=", "None", ",", "ipv4addr", "=", "None", ",", "allow_array", "=", "False", ",", "*", "*", "api_opts", ")", ":", "r", "=", "get_a", "(", "name", ",", "ipv4addr", ",", "allow_array", "=", "False", ",", "*", "*", "api...
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...
[ "Delete", "A", "record" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/infoblox.py#L632-L655
train
saltstack/salt
salt/states/infoblox_a.py
present
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 ...
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 ...
[ "def", "present", "(", "name", "=", "None", ",", "ipv4addr", "=", "None", ",", "data", "=", "None", ",", "ensure_data", "=", "True", ",", "*", "*", "api_opts", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", ...
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: ...
[ "Ensure", "infoblox", "A", "record", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/infoblox_a.py#L17-L90
train
saltstack/salt
salt/states/infoblox_a.py
absent
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 = {...
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 = {...
[ "def", "absent", "(", "name", "=", "None", ",", "ipv4addr", "=", "None", ",", "*", "*", "api_opts", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'result'", ":", "False", ",", "'comment'", ":", "''", ",", "'changes'", ":", "{", "}", "}"...
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
[ "Ensure", "infoblox", "A", "record", "is", "removed", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/infoblox_a.py#L93-L124
train
saltstack/salt
salt/modules/kapacitor.py
_get_url
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)
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)
[ "def", "_get_url", "(", ")", ":", "protocol", "=", "__salt__", "[", "'config.option'", "]", "(", "'kapacitor.protocol'", ",", "'http'", ")", "host", "=", "__salt__", "[", "'config.option'", "]", "(", "'kapacitor.host'", ",", "'localhost'", ")", "port", "=", ...
Get the kapacitor URL.
[ "Get", "the", "kapacitor", "URL", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kapacitor.py#L55-L63
train
saltstack/salt
salt/modules/kapacitor.py
get_task
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...
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...
[ "def", "get_task", "(", "name", ")", ":", "url", "=", "_get_url", "(", ")", "if", "version", "(", ")", "<", "'0.13'", ":", "task_url", "=", "'{0}/task?name={1}'", ".", "format", "(", "url", ",", "name", ")", "else", ":", "task_url", "=", "'{0}/kapacito...
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
[ "Get", "a", "dict", "of", "data", "on", "a", "task", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kapacitor.py#L66-L106
train
saltstack/salt
salt/modules/kapacitor.py
_run_cmd
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...
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...
[ "def", "_run_cmd", "(", "cmd", ")", ":", "ret", "=", "{", "}", "env_vars", "=", "{", "'KAPACITOR_URL'", ":", "_get_url", "(", ")", ",", "'KAPACITOR_UNSAFE_SSL'", ":", "__salt__", "[", "'config.option'", "]", "(", "'kapacitor.unsafe_ssl'", ",", "'false'", ")"...
Run a Kapacitor task and return a dictionary of info.
[ "Run", "a", "Kapacitor", "task", "and", "return", "a", "dictionary", "of", "info", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kapacitor.py#L109-L126
train
saltstack/salt
salt/modules/kapacitor.py
define_task
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...
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...
[ "def", "define_task", "(", "name", ",", "tick_script", ",", "task_type", "=", "'stream'", ",", "database", "=", "None", ",", "retention_policy", "=", "'default'", ",", "dbrps", "=", "None", ")", ":", "if", "not", "database", "and", "not", "dbrps", ":", "...
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 ...
[ "Define", "a", "task", ".", "Serves", "as", "both", "create", "/", "update", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/kapacitor.py#L129-L194
train
saltstack/salt
salt/modules/linux_ip.py
_ip_ifaces
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...
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...
[ "def", "_ip_ifaces", "(", ")", ":", "tmp", "=", "{", "}", "ret", "=", "{", "}", "if_", "=", "None", "at_", "=", "None", "out", "=", "__salt__", "[", "'cmd.run'", "]", "(", "'ip a'", ")", "for", "line", "in", "out", ".", "splitlines", "(", ")", ...
Parse output from 'ip a'
[ "Parse", "output", "from", "ip", "a" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_ip.py#L67-L103
train
saltstack/salt
salt/modules/linux_ip.py
_parse_routes
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...
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...
[ "def", "_parse_routes", "(", ")", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "'/proc/net/route'", ",", "'r'", ")", "as", "fp_", ":", "out", "=", "salt", ".", "utils", ".", "stringutils", ".", "to_unicode", "(", "fp_", ".", "r...
Parse the contents of ``/proc/net/route``
[ "Parse", "the", "contents", "of", "/", "proc", "/", "net", "/", "route" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_ip.py#L139-L168
train
saltstack/salt
salt/modules/linux_ip.py
_hex_to_octets
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), )
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), )
[ "def", "_hex_to_octets", "(", "addr", ")", ":", "return", "'{0}:{1}:{2}:{3}'", ".", "format", "(", "int", "(", "addr", "[", "6", ":", "8", "]", ",", "16", ")", ",", "int", "(", "addr", "[", "4", ":", "6", "]", ",", "16", ")", ",", "int", "(", ...
Convert hex fields from /proc/net/route to octects
[ "Convert", "hex", "fields", "from", "/", "proc", "/", "net", "/", "route", "to", "octects" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_ip.py#L171-L180
train
saltstack/salt
salt/modules/linux_ip.py
_route_flags
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...
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...
[ "def", "_route_flags", "(", "rflags", ")", ":", "flags", "=", "''", "fmap", "=", "{", "0x0001", ":", "'U'", ",", "# RTF_UP, route is up", "0x0002", ":", "'G'", ",", "# RTF_GATEWAY, use gateway", "0x0004", ":", "'H'", ",", "# RTF_HOST, target is a host", "0x0008"...
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
[ "https", ":", "//", "github", ".", "com", "/", "torvalds", "/", "linux", "/", "blob", "/", "master", "/", "include", "/", "uapi", "/", "linux", "/", "route", ".", "h", "https", ":", "//", "github", ".", "com", "/", "torvalds", "/", "linux", "/", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/linux_ip.py#L183-L203
train
saltstack/salt
salt/modules/nilrt_ip.py
_get_state
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))
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))
[ "def", "_get_state", "(", ")", ":", "try", ":", "return", "pyconnman", ".", "ConnManager", "(", ")", ".", "get_property", "(", "'State'", ")", "except", "KeyError", ":", "return", "'offline'", "except", "dbus", ".", "DBusException", "as", "exc", ":", "rais...
Returns the state of connman
[ "Returns", "the", "state", "of", "connman" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L85-L94
train
saltstack/salt
salt/modules/nilrt_ip.py
_get_technologies
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...
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...
[ "def", "_get_technologies", "(", ")", ":", "tech", "=", "''", "technologies", "=", "pyconnman", ".", "ConnManager", "(", ")", ".", "get_technologies", "(", ")", "for", "path", ",", "params", "in", "technologies", ":", "tech", "+=", "'{0}\\n\\tName = {1}\\n\\tT...
Returns the technologies of connman
[ "Returns", "the", "technologies", "of", "connman" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L97-L106
train
saltstack/salt
salt/modules/nilrt_ip.py
_get_services
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
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
[ "def", "_get_services", "(", ")", ":", "serv", "=", "[", "]", "services", "=", "pyconnman", ".", "ConnManager", "(", ")", ".", "get_services", "(", ")", "for", "path", ",", "_", "in", "services", ":", "serv", ".", "append", "(", "six", ".", "text_typ...
Returns a list with all connman services
[ "Returns", "a", "list", "with", "all", "connman", "services" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L109-L117
train
saltstack/salt
salt/modules/nilrt_ip.py
_connected
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'
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'
[ "def", "_connected", "(", "service", ")", ":", "state", "=", "pyconnman", ".", "ConnService", "(", "os", ".", "path", ".", "join", "(", "SERVICE_PATH", ",", "service", ")", ")", ".", "get_property", "(", "'State'", ")", "return", "state", "==", "'online'...
Verify if a connman service is connected
[ "Verify", "if", "a", "connman", "service", "is", "connected" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L120-L125
train
saltstack/salt
salt/modules/nilrt_ip.py
_space_delimited_list
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: ...
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: ...
[ "def", "_space_delimited_list", "(", "value", ")", ":", "if", "isinstance", "(", "value", ",", "six", ".", "string_types", ")", ":", "items", "=", "value", ".", "split", "(", "' '", ")", "valid", "=", "items", "and", "all", "(", "items", ")", "else", ...
validate that a value contains one or more space-delimited values
[ "validate", "that", "a", "value", "contains", "one", "or", "more", "space", "-", "delimited", "values" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L128-L140
train
saltstack/salt
salt/modules/nilrt_ip.py
_validate_ipv4
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()): ...
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()): ...
[ "def", "_validate_ipv4", "(", "value", ")", ":", "if", "len", "(", "value", ")", "==", "3", ":", "if", "not", "salt", ".", "utils", ".", "validate", ".", "net", ".", "ipv4_addr", "(", "value", "[", "0", "]", ".", "strip", "(", ")", ")", ":", "r...
validate ipv4 values
[ "validate", "ipv4", "values" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L143-L156
train
saltstack/salt
salt/modules/nilrt_ip.py
_interface_to_service
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']...
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']...
[ "def", "_interface_to_service", "(", "iface", ")", ":", "for", "_service", "in", "_get_services", "(", ")", ":", "service_info", "=", "pyconnman", ".", "ConnService", "(", "os", ".", "path", ".", "join", "(", "SERVICE_PATH", ",", "_service", ")", ")", "if"...
returns the coresponding service to given interface if exists, otherwise return None
[ "returns", "the", "coresponding", "service", "to", "given", "interface", "if", "exists", "otherwise", "return", "None" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L159-L167
train
saltstack/salt
salt/modules/nilrt_ip.py
_get_service_info
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...
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...
[ "def", "_get_service_info", "(", "service", ")", ":", "service_info", "=", "pyconnman", ".", "ConnService", "(", "os", ".", "path", ".", "join", "(", "SERVICE_PATH", ",", "service", ")", ")", "data", "=", "{", "'label'", ":", "service", ",", "'wireless'", ...
return details about given connman service
[ "return", "details", "about", "given", "connman", "service" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L170-L230
train
saltstack/salt
salt/modules/nilrt_ip.py
_get_dns_info
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(...
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(...
[ "def", "_get_dns_info", "(", ")", ":", "dns_list", "=", "[", "]", "try", ":", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "'/etc/resolv.conf'", ",", "'r+'", ")", "as", "dns_info", ":", "lines", "=", "dns_info", ".", "readlines", "(",...
return dns list
[ "return", "dns", "list" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L233-L248
train
saltstack/salt
salt/modules/nilrt_ip.py
_load_config
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...
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...
[ "def", "_load_config", "(", "section", ",", "options", ",", "default_value", "=", "''", ",", "filename", "=", "INI_FILE", ")", ":", "results", "=", "{", "}", "if", "not", "options", ":", "return", "results", "with", "salt", ".", "utils", ".", "files", ...
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:
[ "Get", "values", "for", "some", "options", "and", "a", "given", "section", "from", "a", "config", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L261-L281
train
saltstack/salt
salt/modules/nilrt_ip.py
_get_request_mode_info
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: ...
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: ...
[ "def", "_get_request_mode_info", "(", "interface", ")", ":", "settings", "=", "_load_config", "(", "interface", ",", "[", "'linklocalenabled'", ",", "'dhcpenabled'", "]", ",", "-", "1", ")", "link_local_enabled", "=", "int", "(", "settings", "[", "'linklocalenab...
return requestmode for given interface
[ "return", "requestmode", "for", "given", "interface" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L284-L303
train
saltstack/salt
salt/modules/nilrt_ip.py
_get_possible_adapter_modes
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...
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...
[ "def", "_get_possible_adapter_modes", "(", "interface", ",", "blacklist", ")", ":", "adapter_modes", "=", "[", "]", "protocols", "=", "_load_config", "(", "'lvrt'", ",", "[", "'AdditionalNetworkProtocols'", "]", ")", "[", "'AdditionalNetworkProtocols'", "]", ".", ...
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
[ "Return", "possible", "adapter", "modes", "for", "a", "given", "interface", "using", "a", "blacklist", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L314-L345
train
saltstack/salt
salt/modules/nilrt_ip.py
_get_static_info
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': { ...
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': { ...
[ "def", "_get_static_info", "(", "interface", ")", ":", "data", "=", "{", "'connectionid'", ":", "interface", ".", "name", ",", "'label'", ":", "interface", ".", "name", ",", "'hwaddr'", ":", "interface", ".", "hwaddr", "[", ":", "-", "1", "]", ",", "'u...
Return information about an interface from config file. :param interface: interface label
[ "Return", "information", "about", "an", "interface", "from", "config", "file", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L348-L374
train
saltstack/salt
salt/modules/nilrt_ip.py
_get_base_interface_info
def _get_base_interface_info(interface): ''' return base details about given interface ''' blacklist = { 'tcpip': { 'name': [], 'type': [], 'additional_protocol': False }, 'disabled': { 'name': ['eth0'], 'type': ['gadget...
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...
[ "def", "_get_base_interface_info", "(", "interface", ")", ":", "blacklist", "=", "{", "'tcpip'", ":", "{", "'name'", ":", "[", "]", ",", "'type'", ":", "[", "]", ",", "'additional_protocol'", ":", "False", "}", ",", "'disabled'", ":", "{", "'name'", ":",...
return base details about given interface
[ "return", "base", "details", "about", "given", "interface" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L377-L414
train
saltstack/salt
salt/modules/nilrt_ip.py
_get_ethercat_interface_info
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
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
[ "def", "_get_ethercat_interface_info", "(", "interface", ")", ":", "base_information", "=", "_get_base_interface_info", "(", "interface", ")", "base_information", "[", "'ethercat'", "]", "=", "{", "'masterid'", ":", "_load_config", "(", "interface", ".", "name", ","...
return details about given ethercat interface
[ "return", "details", "about", "given", "ethercat", "interface" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L417-L425
train
saltstack/salt
salt/modules/nilrt_ip.py
_get_tcpip_interface_info
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...
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...
[ "def", "_get_tcpip_interface_info", "(", "interface", ")", ":", "base_information", "=", "_get_base_interface_info", "(", "interface", ")", "if", "base_information", "[", "'ipv4'", "]", "[", "'requestmode'", "]", "==", "'static'", ":", "settings", "=", "_load_config...
return details about given tcpip interface
[ "return", "details", "about", "given", "tcpip", "interface" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L428-L452
train
saltstack/salt
salt/modules/nilrt_ip.py
_get_interface_info
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...
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...
[ "def", "_get_interface_info", "(", "interface", ")", ":", "adapter_mode", "=", "_get_adapter_mode_info", "(", "interface", ".", "name", ")", "if", "adapter_mode", "==", "'disabled'", ":", "return", "_get_base_interface_info", "(", "interface", ")", "elif", "adapter_...
return details about given interface
[ "return", "details", "about", "given", "interface" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L455-L464
train
saltstack/salt
salt/modules/nilrt_ip.py
_dict_to_string
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...
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...
[ "def", "_dict_to_string", "(", "dictionary", ")", ":", "ret", "=", "''", "for", "key", ",", "val", "in", "sorted", "(", "dictionary", ".", "items", "(", ")", ")", ":", "if", "isinstance", "(", "val", ",", "dict", ")", ":", "for", "line", "in", "_di...
converts a dictionary object into a list of strings
[ "converts", "a", "dictionary", "object", "into", "a", "list", "of", "strings" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L467-L481
train
saltstack/salt
salt/modules/nilrt_ip.py
get_interfaces_details
def get_interfaces_details(): ''' Get details about all the interfaces on the minion :return: information about all interfaces omitting loopback :rtype: dictionary CLI Example: .. code-block:: bash salt '*' ip.get_interfaces_details ''' _interfaces = [interface for interface ...
python
def get_interfaces_details(): ''' Get details about all the interfaces on the minion :return: information about all interfaces omitting loopback :rtype: dictionary CLI Example: .. code-block:: bash salt '*' ip.get_interfaces_details ''' _interfaces = [interface for interface ...
[ "def", "get_interfaces_details", "(", ")", ":", "_interfaces", "=", "[", "interface", "for", "interface", "in", "pyiface", ".", "getIfaces", "(", ")", "if", "interface", ".", "flags", "&", "IFF_LOOPBACK", "==", "0", "]", "if", "__grains__", "[", "'lsb_distri...
Get details about all the interfaces on the minion :return: information about all interfaces omitting loopback :rtype: dictionary CLI Example: .. code-block:: bash salt '*' ip.get_interfaces_details
[ "Get", "details", "about", "all", "the", "interfaces", "on", "the", "minion" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L494-L512
train
saltstack/salt
salt/modules/nilrt_ip.py
_change_state_legacy
def _change_state_legacy(interface, new_state): ''' Enable or disable an interface on a legacy distro Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param interface: interface label :param new_state: up or down :return: True if the service w...
python
def _change_state_legacy(interface, new_state): ''' Enable or disable an interface on a legacy distro Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param interface: interface label :param new_state: up or down :return: True if the service w...
[ "def", "_change_state_legacy", "(", "interface", ",", "new_state", ")", ":", "initial_mode", "=", "_get_adapter_mode_info", "(", "interface", ")", "_save_config", "(", "interface", ",", "'Mode'", ",", "'TCPIP'", "if", "new_state", "==", "'up'", "else", "'Disabled'...
Enable or disable an interface on a legacy distro Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param interface: interface label :param new_state: up or down :return: True if the service was enabled, otherwise an exception will be thrown. :rtyp...
[ "Enable", "or", "disable", "an", "interface", "on", "a", "legacy", "distro" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L515-L536
train
saltstack/salt
salt/modules/nilrt_ip.py
_change_state
def _change_state(interface, new_state): ''' Enable or disable an interface Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param interface: interface label :param new_state: up or down :return: True if the service was enabled, otherwise an e...
python
def _change_state(interface, new_state): ''' Enable or disable an interface Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param interface: interface label :param new_state: up or down :return: True if the service was enabled, otherwise an e...
[ "def", "_change_state", "(", "interface", ",", "new_state", ")", ":", "if", "__grains__", "[", "'lsb_distrib_id'", "]", "==", "'nilrt'", ":", "return", "_change_state_legacy", "(", "interface", ",", "new_state", ")", "service", "=", "_interface_to_service", "(", ...
Enable or disable an interface Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param interface: interface label :param new_state: up or down :return: True if the service was enabled, otherwise an exception will be thrown. :rtype: bool
[ "Enable", "or", "disable", "an", "interface" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L539-L564
train
saltstack/salt
salt/modules/nilrt_ip.py
_save_config
def _save_config(section, token, value): ''' Helper function to persist a configuration in the ini file ''' cmd = NIRTCFG_PATH cmd += ' --set section={0},token=\'{1}\',value=\'{2}\''.format(section, token, value) if __salt__['cmd.run_all'](cmd)['retcode'] != 0: exc_msg = 'Error: could no...
python
def _save_config(section, token, value): ''' Helper function to persist a configuration in the ini file ''' cmd = NIRTCFG_PATH cmd += ' --set section={0},token=\'{1}\',value=\'{2}\''.format(section, token, value) if __salt__['cmd.run_all'](cmd)['retcode'] != 0: exc_msg = 'Error: could no...
[ "def", "_save_config", "(", "section", ",", "token", ",", "value", ")", ":", "cmd", "=", "NIRTCFG_PATH", "cmd", "+=", "' --set section={0},token=\\'{1}\\',value=\\'{2}\\''", ".", "format", "(", "section", ",", "token", ",", "value", ")", "if", "__salt__", "[", ...
Helper function to persist a configuration in the ini file
[ "Helper", "function", "to", "persist", "a", "configuration", "in", "the", "ini", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L643-L651
train
saltstack/salt
salt/modules/nilrt_ip.py
set_ethercat
def set_ethercat(interface, master_id): ''' Configure specified adapter to use EtherCAT adapter mode. If successful, the target will need reboot if it doesn't already use EtherCAT adapter mode, otherwise will return true. :param interface: interface label :param master_id: EtherCAT Master ID :r...
python
def set_ethercat(interface, master_id): ''' Configure specified adapter to use EtherCAT adapter mode. If successful, the target will need reboot if it doesn't already use EtherCAT adapter mode, otherwise will return true. :param interface: interface label :param master_id: EtherCAT Master ID :r...
[ "def", "set_ethercat", "(", "interface", ",", "master_id", ")", ":", "if", "__grains__", "[", "'lsb_distrib_id'", "]", "==", "'nilrt'", ":", "initial_mode", "=", "_get_adapter_mode_info", "(", "interface", ")", "_save_config", "(", "interface", ",", "'Mode'", ",...
Configure specified adapter to use EtherCAT adapter mode. If successful, the target will need reboot if it doesn't already use EtherCAT adapter mode, otherwise will return true. :param interface: interface label :param master_id: EtherCAT Master ID :return: True if the settings were applied, otherwise ...
[ "Configure", "specified", "adapter", "to", "use", "EtherCAT", "adapter", "mode", ".", "If", "successful", "the", "target", "will", "need", "reboot", "if", "it", "doesn", "t", "already", "use", "EtherCAT", "adapter", "mode", "otherwise", "will", "return", "true...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L654-L676
train
saltstack/salt
salt/modules/nilrt_ip.py
set_dhcp_linklocal_all
def set_dhcp_linklocal_all(interface): ''' Configure specified adapter to use DHCP with linklocal fallback Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param str interface: interface label :return: True if the settings were applied, otherwise ...
python
def set_dhcp_linklocal_all(interface): ''' Configure specified adapter to use DHCP with linklocal fallback Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param str interface: interface label :return: True if the settings were applied, otherwise ...
[ "def", "set_dhcp_linklocal_all", "(", "interface", ")", ":", "if", "__grains__", "[", "'lsb_distrib_id'", "]", "==", "'nilrt'", ":", "initial_mode", "=", "_get_adapter_mode_info", "(", "interface", ")", "_save_config", "(", "interface", ",", "'Mode'", ",", "'TCPIP...
Configure specified adapter to use DHCP with linklocal fallback Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param str interface: interface label :return: True if the settings were applied, otherwise an exception will be thrown. :rtype: bool ...
[ "Configure", "specified", "adapter", "to", "use", "DHCP", "with", "linklocal", "fallback" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L687-L728
train
saltstack/salt
salt/modules/nilrt_ip.py
set_dhcp_only_all
def set_dhcp_only_all(interface): ''' Configure specified adapter to use DHCP only Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param str interface: interface label :return: True if the settings were applied, otherwise an exception will be thr...
python
def set_dhcp_only_all(interface): ''' Configure specified adapter to use DHCP only Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param str interface: interface label :return: True if the settings were applied, otherwise an exception will be thr...
[ "def", "set_dhcp_only_all", "(", "interface", ")", ":", "if", "not", "__grains__", "[", "'lsb_distrib_id'", "]", "==", "'nilrt'", ":", "raise", "salt", ".", "exceptions", ".", "CommandExecutionError", "(", "'Not supported in this version'", ")", "initial_mode", "=",...
Configure specified adapter to use DHCP only Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param str interface: interface label :return: True if the settings were applied, otherwise an exception will be thrown. :rtype: bool CLI Example: ....
[ "Configure", "specified", "adapter", "to", "use", "DHCP", "only" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L731-L757
train
saltstack/salt
salt/modules/nilrt_ip.py
_configure_static_interface
def _configure_static_interface(interface, **settings): ''' Configure an interface that is not detected as a service by Connman (i.e. link is down) :param interface: interface label :param settings: - ip - netmask - gateway - dns - name :r...
python
def _configure_static_interface(interface, **settings): ''' Configure an interface that is not detected as a service by Connman (i.e. link is down) :param interface: interface label :param settings: - ip - netmask - gateway - dns - name :r...
[ "def", "_configure_static_interface", "(", "interface", ",", "*", "*", "settings", ")", ":", "interface", "=", "pyiface", ".", "Interface", "(", "name", "=", "interface", ")", "parser", "=", "configparser", ".", "ConfigParser", "(", ")", "if", "os", ".", "...
Configure an interface that is not detected as a service by Connman (i.e. link is down) :param interface: interface label :param settings: - ip - netmask - gateway - dns - name :return: True if settings were applied successfully. :rtype: bool
[ "Configure", "an", "interface", "that", "is", "not", "detected", "as", "a", "service", "by", "Connman", "(", "i", ".", "e", ".", "link", "is", "down", ")" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L789-L828
train
saltstack/salt
salt/modules/nilrt_ip.py
set_static_all
def set_static_all(interface, address, netmask, gateway, nameservers=None): ''' Configure specified adapter to use ipv4 manual settings Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param str interface: interface label :param str address: ipv4 ...
python
def set_static_all(interface, address, netmask, gateway, nameservers=None): ''' Configure specified adapter to use ipv4 manual settings Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param str interface: interface label :param str address: ipv4 ...
[ "def", "set_static_all", "(", "interface", ",", "address", ",", "netmask", ",", "gateway", ",", "nameservers", "=", "None", ")", ":", "validate", ",", "msg", "=", "_validate_ipv4", "(", "[", "address", ",", "netmask", ",", "gateway", "]", ")", "if", "not...
Configure specified adapter to use ipv4 manual settings Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param str interface: interface label :param str address: ipv4 address :param str netmask: ipv4 netmask :param str gateway: ipv4 gateway :p...
[ "Configure", "specified", "adapter", "to", "use", "ipv4", "manual", "settings" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L831-L895
train
saltstack/salt
salt/modules/nilrt_ip.py
get_interface
def get_interface(iface): ''' Returns details about given interface. CLI Example: .. code-block:: bash salt '*' ip.get_interface eth0 ''' _interfaces = get_interfaces_details() for _interface in _interfaces['interfaces']: if _interface['connectionid'] == iface: ...
python
def get_interface(iface): ''' Returns details about given interface. CLI Example: .. code-block:: bash salt '*' ip.get_interface eth0 ''' _interfaces = get_interfaces_details() for _interface in _interfaces['interfaces']: if _interface['connectionid'] == iface: ...
[ "def", "get_interface", "(", "iface", ")", ":", "_interfaces", "=", "get_interfaces_details", "(", ")", "for", "_interface", "in", "_interfaces", "[", "'interfaces'", "]", ":", "if", "_interface", "[", "'connectionid'", "]", "==", "iface", ":", "return", "_dic...
Returns details about given interface. CLI Example: .. code-block:: bash salt '*' ip.get_interface eth0
[ "Returns", "details", "about", "given", "interface", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L898-L912
train
saltstack/salt
salt/modules/nilrt_ip.py
build_interface
def build_interface(iface, iface_type, enabled, **settings): ''' Build an interface script for a network interface. CLI Example: .. code-block:: bash salt '*' ip.build_interface eth0 eth <settings> ''' if __grains__['lsb_distrib_id'] == 'nilrt': raise salt.exceptions.CommandEx...
python
def build_interface(iface, iface_type, enabled, **settings): ''' Build an interface script for a network interface. CLI Example: .. code-block:: bash salt '*' ip.build_interface eth0 eth <settings> ''' if __grains__['lsb_distrib_id'] == 'nilrt': raise salt.exceptions.CommandEx...
[ "def", "build_interface", "(", "iface", ",", "iface_type", ",", "enabled", ",", "*", "*", "settings", ")", ":", "if", "__grains__", "[", "'lsb_distrib_id'", "]", "==", "'nilrt'", ":", "raise", "salt", ".", "exceptions", ".", "CommandExecutionError", "(", "'N...
Build an interface script for a network interface. CLI Example: .. code-block:: bash salt '*' ip.build_interface eth0 eth <settings>
[ "Build", "an", "interface", "script", "for", "a", "network", "interface", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/nilrt_ip.py#L915-L948
train