repository_name stringclasses 316
values | func_path_in_repository stringlengths 6 223 | func_name stringlengths 1 134 | language stringclasses 1
value | func_code_string stringlengths 57 65.5k | func_documentation_string stringlengths 1 46.3k | split_name stringclasses 1
value | func_code_url stringlengths 91 315 | called_functions listlengths 1 156 β | enclosing_scope stringlengths 2 1.48M |
|---|---|---|---|---|---|---|---|---|---|
saltstack/salt | salt/beacons/diskusage.py | beacon | python | def beacon(config):
r'''
Monitor the disk usage of the minion
Specify thresholds for each disk and only emit a beacon if any of them are
exceeded.
.. code-block:: yaml
beacons:
diskusage:
- /: 63%
- /mnt/nfs: 50%
Windows drives must be quoted to avoi... | r'''
Monitor the disk usage of the minion
Specify thresholds for each disk and only emit a beacon if any of them are
exceeded.
.. code-block:: yaml
beacons:
diskusage:
- /: 63%
- /mnt/nfs: 50%
Windows drives must be quoted to avoid yaml syntax errors
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/diskusage.py#L47-L125 | null | # -*- coding: utf-8 -*-
'''
Beacon to monitor disk usage.
.. versionadded:: 2015.5.0
:depends: python-psutil
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals
import logging
import re
import salt.utils.platform
# Import Third Party Libs
try:
import psutil
HAS_PSUTIL = True
e... |
saltstack/salt | salt/tops/saltclass.py | top | python | def top(**kwargs):
'''
Compile tops
'''
# Node definitions path will be retrieved from args (or set to default),
# then added to 'salt_data' dict that is passed to the 'get_pillars'
# function. The dictionary contains:
# - __opts__
# - __salt__
# - __grains__
# - ... | Compile tops | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/tops/saltclass.py#L229-L270 | [
"def get_tops(minion_id, salt_data):\n # Get 2 dicts and 2 lists\n # expanded_classes: Full list of expanded dicts\n # pillars_dict: dict containing merged pillars in order\n # classes_list: All classes processed in order\n # states_list: All states listed in order\n (expanded_classes,\n pilla... | # -*- coding: utf-8 -*-
r'''
Saltclass Configuration
=======================
.. code-block:: yaml
master_tops:
saltclass:
path: /srv/saltclass
Description
===========
This module clones the behaviour of reclass (http://reclass.pantsfullofunix.net/),
without the need of an external app, and add sev... |
saltstack/salt | salt/proxy/cisconso.py | ping | python | def ping():
'''
Check to see if the host is responding. Returns False if the host didn't
respond, True otherwise.
CLI Example:
.. code-block:: bash
salt cisco-nso test.ping
'''
try:
client = _get_client()
client.info()
except SaltSystemExit as err:
log.... | Check to see if the host is responding. Returns False if the host didn't
respond, True otherwise.
CLI Example:
.. code-block:: bash
salt cisco-nso test.ping | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/cisconso.py#L235-L253 | [
"def _get_client():\n return NSOClient(\n host=DETAILS['host'],\n username=DETAILS['username'],\n password=DETAILS['password'],\n port=DETAILS['port'],\n ssl=DETAILS['use_ssl'])\n"
] | # -*- coding: utf-8 -*-
'''
Proxy Minion interface module for managing (practically) any network device with
Cisco Network Services Orchestrator (Cisco NSO). Cisco NSO uses a series of
remote polling
agents, APIs and SSH commands to fetch network configuration and represent
it in a data model.
PyNSO, the Python module ... |
saltstack/salt | salt/proxy/cisconso.py | set_data_value | python | def set_data_value(datastore, path, data):
'''
Get a data entry in a datastore
:param datastore: The datastore, e.g. running, operational.
One of the NETCONF store IETF types
:type datastore: :class:`DatastoreType` (``str`` enum).
:param path: The device path to set the value at,
... | Get a data entry in a datastore
:param datastore: The datastore, e.g. running, operational.
One of the NETCONF store IETF types
:type datastore: :class:`DatastoreType` (``str`` enum).
:param path: The device path to set the value at,
a list of element names in order, comma separated
:... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/cisconso.py#L287-L306 | [
"def _get_client():\n return NSOClient(\n host=DETAILS['host'],\n username=DETAILS['username'],\n password=DETAILS['password'],\n port=DETAILS['port'],\n ssl=DETAILS['use_ssl'])\n"
] | # -*- coding: utf-8 -*-
'''
Proxy Minion interface module for managing (practically) any network device with
Cisco Network Services Orchestrator (Cisco NSO). Cisco NSO uses a series of
remote polling
agents, APIs and SSH commands to fetch network configuration and represent
it in a data model.
PyNSO, the Python module ... |
saltstack/salt | salt/proxy/cisconso.py | _grains | python | def _grains():
'''
Helper function to the grains from the proxied devices.
'''
client = _get_client()
# This is a collection of the configuration of all running devices under NSO
ret = client.get_datastore(DatastoreType.RUNNING)
GRAINS_CACHE.update(ret)
return GRAINS_CACHE | Helper function to the grains from the proxied devices. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/proxy/cisconso.py#L343-L351 | [
"def _get_client():\n return NSOClient(\n host=DETAILS['host'],\n username=DETAILS['username'],\n password=DETAILS['password'],\n port=DETAILS['port'],\n ssl=DETAILS['use_ssl'])\n"
] | # -*- coding: utf-8 -*-
'''
Proxy Minion interface module for managing (practically) any network device with
Cisco Network Services Orchestrator (Cisco NSO). Cisco NSO uses a series of
remote polling
agents, APIs and SSH commands to fetch network configuration and represent
it in a data model.
PyNSO, the Python module ... |
saltstack/salt | salt/modules/mac_softwareupdate.py | _get_available | python | def _get_available(recommended=False, restart=False):
'''
Utility function to get all available update packages.
Sample return date:
{ 'updatename': '1.2.3-45', ... }
'''
cmd = ['softwareupdate', '--list']
out = salt.utils.mac_utils.execute_return_result(cmd)
# rexp parses lines that l... | Utility function to get all available update packages.
Sample return date:
{ 'updatename': '1.2.3-45', ... } | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L34-L85 | [
"def is_true(value=None):\n '''\n Returns a boolean value representing the \"truth\" of the value passed. The\n rules for what is a \"True\" value are:\n\n 1. Integer/float values greater than 0\n 2. The string values \"True\" and \"true\"\n 3. Any object for which bool(obj) returns Tr... | # -*- coding: utf-8 -*-
'''
Support for the softwareupdate command on MacOS.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import os
# import salt libs
import salt.utils.data
import salt.utils.files
import salt.utils.path
import salt.utils.mac_utils
impor... |
saltstack/salt | salt/modules/mac_softwareupdate.py | ignore | python | def ignore(name):
'''
Ignore a specific program update. When an update is ignored the '-' and
version number at the end will be omitted, so "SecUpd2014-001-1.0" becomes
"SecUpd2014-001". It will be removed automatically if present. An update
is successfully ignored when it no longer shows up after l... | Ignore a specific program update. When an update is ignored the '-' and
version number at the end will be omitted, so "SecUpd2014-001-1.0" becomes
"SecUpd2014-001". It will be removed automatically if present. An update
is successfully ignored when it no longer shows up after list_updates.
:param name:... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L108-L133 | [
"def execute_return_success(cmd):\n '''\n Executes the passed command. Returns True if successful\n\n :param str cmd: The command to run\n\n :return: True if successful, otherwise False\n :rtype: bool\n\n :raises: Error if command fails or is not supported\n '''\n\n ret = _run_all(cmd)\n\n ... | # -*- coding: utf-8 -*-
'''
Support for the softwareupdate command on MacOS.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import os
# import salt libs
import salt.utils.data
import salt.utils.files
import salt.utils.path
import salt.utils.mac_utils
impor... |
saltstack/salt | salt/modules/mac_softwareupdate.py | list_ignored | python | def list_ignored():
'''
List all updates that have been ignored. Ignored updates are shown
without the '-' and version number at the end, this is how the
softwareupdate command works.
:return: The list of ignored updates
:rtype: list
CLI Example:
.. code-block:: bash
salt '*' ... | List all updates that have been ignored. Ignored updates are shown
without the '-' and version number at the end, this is how the
softwareupdate command works.
:return: The list of ignored updates
:rtype: list
CLI Example:
.. code-block:: bash
salt '*' softwareupdate.list_ignored | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L136-L161 | [
"def execute_return_result(cmd):\n '''\n Executes the passed command. Returns the standard out if successful\n\n :param str cmd: The command to run\n\n :return: The standard out of the command if successful, otherwise returns\n an error\n :rtype: str\n\n :raises: Error if command fails or is no... | # -*- coding: utf-8 -*-
'''
Support for the softwareupdate command on MacOS.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import os
# import salt libs
import salt.utils.data
import salt.utils.files
import salt.utils.path
import salt.utils.mac_utils
impor... |
saltstack/salt | salt/modules/mac_softwareupdate.py | schedule_enabled | python | def schedule_enabled():
'''
Check the status of automatic update scheduling.
:return: True if scheduling is enabled, False if disabled
:rtype: bool
CLI Example:
.. code-block:: bash
salt '*' softwareupdate.schedule_enabled
'''
cmd = ['softwareupdate', '--schedule']
ret = ... | Check the status of automatic update scheduling.
:return: True if scheduling is enabled, False if disabled
:rtype: bool
CLI Example:
.. code-block:: bash
salt '*' softwareupdate.schedule_enabled | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L184-L203 | [
"def execute_return_result(cmd):\n '''\n Executes the passed command. Returns the standard out if successful\n\n :param str cmd: The command to run\n\n :return: The standard out of the command if successful, otherwise returns\n an error\n :rtype: str\n\n :raises: Error if command fails or is no... | # -*- coding: utf-8 -*-
'''
Support for the softwareupdate command on MacOS.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import os
# import salt libs
import salt.utils.data
import salt.utils.files
import salt.utils.path
import salt.utils.mac_utils
impor... |
saltstack/salt | salt/modules/mac_softwareupdate.py | schedule_enable | python | def schedule_enable(enable):
'''
Enable/disable automatic update scheduling.
:param enable: True/On/Yes/1 to turn on automatic updates. False/No/Off/0
to turn off automatic updates. If this value is empty, the current
status will be returned.
:type: bool str
:return: True if sched... | Enable/disable automatic update scheduling.
:param enable: True/On/Yes/1 to turn on automatic updates. False/No/Off/0
to turn off automatic updates. If this value is empty, the current
status will be returned.
:type: bool str
:return: True if scheduling is enabled, False if disabled
:... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L206-L232 | [
"def execute_return_success(cmd):\n '''\n Executes the passed command. Returns True if successful\n\n :param str cmd: The command to run\n\n :return: True if successful, otherwise False\n :rtype: bool\n\n :raises: Error if command fails or is not supported\n '''\n\n ret = _run_all(cmd)\n\n ... | # -*- coding: utf-8 -*-
'''
Support for the softwareupdate command on MacOS.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import os
# import salt libs
import salt.utils.data
import salt.utils.files
import salt.utils.path
import salt.utils.mac_utils
impor... |
saltstack/salt | salt/modules/mac_softwareupdate.py | update_all | python | def update_all(recommended=False, restart=True):
'''
Install all available updates. Returns a dictionary containing the name
of the update and the status of its installation.
:param bool recommended: If set to True, only install the recommended
updates. If set to False (default) all updates are... | Install all available updates. Returns a dictionary containing the name
of the update and the status of its installation.
:param bool recommended: If set to True, only install the recommended
updates. If set to False (default) all updates are installed.
:param bool restart: Set this to False if yo... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L235-L273 | [
"def execute_return_success(cmd):\n '''\n Executes the passed command. Returns True if successful\n\n :param str cmd: The command to run\n\n :return: True if successful, otherwise False\n :rtype: bool\n\n :raises: Error if command fails or is not supported\n '''\n\n ret = _run_all(cmd)\n\n ... | # -*- coding: utf-8 -*-
'''
Support for the softwareupdate command on MacOS.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import os
# import salt libs
import salt.utils.data
import salt.utils.files
import salt.utils.path
import salt.utils.mac_utils
impor... |
saltstack/salt | salt/modules/mac_softwareupdate.py | update | python | def update(name):
'''
Install a named update.
:param str name: The name of the of the update to install.
:return: True if successfully updated, otherwise False
:rtype: bool
CLI Example:
.. code-block:: bash
salt '*' softwareupdate.update <update-name>
'''
if not update_av... | Install a named update.
:param str name: The name of the of the update to install.
:return: True if successfully updated, otherwise False
:rtype: bool
CLI Example:
.. code-block:: bash
salt '*' softwareupdate.update <update-name> | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L276-L297 | [
"def execute_return_success(cmd):\n '''\n Executes the passed command. Returns True if successful\n\n :param str cmd: The command to run\n\n :return: True if successful, otherwise False\n :rtype: bool\n\n :raises: Error if command fails or is not supported\n '''\n\n ret = _run_all(cmd)\n\n ... | # -*- coding: utf-8 -*-
'''
Support for the softwareupdate command on MacOS.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import os
# import salt libs
import salt.utils.data
import salt.utils.files
import salt.utils.path
import salt.utils.mac_utils
impor... |
saltstack/salt | salt/modules/mac_softwareupdate.py | list_downloads | python | def list_downloads():
'''
Return a list of all updates that have been downloaded locally.
:return: A list of updates that have been downloaded
:rtype: list
CLI Example:
.. code-block:: bash
salt '*' softwareupdate.list_downloads
'''
outfiles = []
for root, subFolder, files... | Return a list of all updates that have been downloaded locally.
:return: A list of updates that have been downloaded
:rtype: list
CLI Example:
.. code-block:: bash
salt '*' softwareupdate.list_downloads | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L319-L349 | [
"def fopen(*args, **kwargs):\n '''\n Wrapper around open() built-in to set CLOEXEC on the fd.\n\n This flag specifies that the file descriptor should be closed when an exec\n function is invoked;\n\n When a file descriptor is allocated (as with open or dup), this bit is\n initially cleared on the ... | # -*- coding: utf-8 -*-
'''
Support for the softwareupdate command on MacOS.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import os
# import salt libs
import salt.utils.data
import salt.utils.files
import salt.utils.path
import salt.utils.mac_utils
impor... |
saltstack/salt | salt/modules/mac_softwareupdate.py | download | python | def download(name):
'''
Download a named update so that it can be installed later with the
``update`` or ``update_all`` functions
:param str name: The update to download.
:return: True if successful, otherwise False
:rtype: bool
CLI Example:
.. code-block:: bash
salt '*' soft... | Download a named update so that it can be installed later with the
``update`` or ``update_all`` functions
:param str name: The update to download.
:return: True if successful, otherwise False
:rtype: bool
CLI Example:
.. code-block:: bash
salt '*' softwareupdate.download <update name... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L352-L377 | [
"def execute_return_success(cmd):\n '''\n Executes the passed command. Returns True if successful\n\n :param str cmd: The command to run\n\n :return: True if successful, otherwise False\n :rtype: bool\n\n :raises: Error if command fails or is not supported\n '''\n\n ret = _run_all(cmd)\n\n ... | # -*- coding: utf-8 -*-
'''
Support for the softwareupdate command on MacOS.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import os
# import salt libs
import salt.utils.data
import salt.utils.files
import salt.utils.path
import salt.utils.mac_utils
impor... |
saltstack/salt | salt/modules/mac_softwareupdate.py | download_all | python | def download_all(recommended=False, restart=True):
'''
Download all available updates so that they can be installed later with the
``update`` or ``update_all`` functions. It returns a list of updates that
are now downloaded.
:param bool recommended: If set to True, only install the recommended
... | Download all available updates so that they can be installed later with the
``update`` or ``update_all`` functions. It returns a list of updates that
are now downloaded.
:param bool recommended: If set to True, only install the recommended
updates. If set to False (default) all updates are installe... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L380-L406 | [
"def download(name):\n '''\n Download a named update so that it can be installed later with the\n ``update`` or ``update_all`` functions\n\n :param str name: The update to download.\n\n :return: True if successful, otherwise False\n :rtype: bool\n\n CLI Example:\n\n .. code-block:: bash\n\n ... | # -*- coding: utf-8 -*-
'''
Support for the softwareupdate command on MacOS.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import os
# import salt libs
import salt.utils.data
import salt.utils.files
import salt.utils.path
import salt.utils.mac_utils
impor... |
saltstack/salt | salt/modules/mac_softwareupdate.py | get_catalog | python | def get_catalog():
'''
.. versionadded:: 2016.3.0
Get the current catalog being used for update lookups. Will return a url if
a custom catalog has been specified. Otherwise the word 'Default' will be
returned
:return: The catalog being used for update lookups
:rtype: str
CLI Example:
... | .. versionadded:: 2016.3.0
Get the current catalog being used for update lookups. Will return a url if
a custom catalog has been specified. Otherwise the word 'Default' will be
returned
:return: The catalog being used for update lookups
:rtype: str
CLI Example:
.. code-block:: bash
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L409-L440 | [
"def execute_return_result(cmd):\n '''\n Executes the passed command. Returns the standard out if successful\n\n :param str cmd: The command to run\n\n :return: The standard out of the command if successful, otherwise returns\n an error\n :rtype: str\n\n :raises: Error if command fails or is no... | # -*- coding: utf-8 -*-
'''
Support for the softwareupdate command on MacOS.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import os
# import salt libs
import salt.utils.data
import salt.utils.files
import salt.utils.path
import salt.utils.mac_utils
impor... |
saltstack/salt | salt/modules/mac_softwareupdate.py | set_catalog | python | def set_catalog(url):
'''
.. versionadded:: 2016.3.0
Set the Software Update Catalog to the URL specified
:param str url: The url to the update catalog
:return: True if successful, False if not
:rtype: bool
CLI Example:
.. code-block:: bash
salt '*' softwareupdates.set_cata... | .. versionadded:: 2016.3.0
Set the Software Update Catalog to the URL specified
:param str url: The url to the update catalog
:return: True if successful, False if not
:rtype: bool
CLI Example:
.. code-block:: bash
salt '*' softwareupdates.set_catalog http://swupd.local:8888/index.... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L443-L470 | [
"def execute_return_success(cmd):\n '''\n Executes the passed command. Returns True if successful\n\n :param str cmd: The command to run\n\n :return: True if successful, otherwise False\n :rtype: bool\n\n :raises: Error if command fails or is not supported\n '''\n\n ret = _run_all(cmd)\n\n ... | # -*- coding: utf-8 -*-
'''
Support for the softwareupdate command on MacOS.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import os
# import salt libs
import salt.utils.data
import salt.utils.files
import salt.utils.path
import salt.utils.mac_utils
impor... |
saltstack/salt | salt/modules/mac_softwareupdate.py | reset_catalog | python | def reset_catalog():
'''
.. versionadded:: 2016.3.0
Reset the Software Update Catalog to the default.
:return: True if successful, False if not
:rtype: bool
CLI Example:
.. code-block:: bash
salt '*' softwareupdates.reset_catalog
'''
# This command always returns an erro... | .. versionadded:: 2016.3.0
Reset the Software Update Catalog to the default.
:return: True if successful, False if not
:rtype: bool
CLI Example:
.. code-block:: bash
salt '*' softwareupdates.reset_catalog | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/mac_softwareupdate.py#L473-L498 | [
"def execute_return_success(cmd):\n '''\n Executes the passed command. Returns True if successful\n\n :param str cmd: The command to run\n\n :return: True if successful, otherwise False\n :rtype: bool\n\n :raises: Error if command fails or is not supported\n '''\n\n ret = _run_all(cmd)\n\n ... | # -*- coding: utf-8 -*-
'''
Support for the softwareupdate command on MacOS.
'''
from __future__ import absolute_import, unicode_literals, print_function
# Import python libs
import re
import os
# import salt libs
import salt.utils.data
import salt.utils.files
import salt.utils.path
import salt.utils.mac_utils
impor... |
saltstack/salt | salt/modules/etcd_mod.py | get_ | python | def get_(key, recurse=False, profile=None, **kwargs):
'''
.. versionadded:: 2014.7.0
Get a value from etcd, by direct path. Returns None on failure.
CLI Examples:
.. code-block:: bash
salt myminion etcd.get /path/to/key
salt myminion etcd.get /path/to/key profile=my_etcd_config
... | .. versionadded:: 2014.7.0
Get a value from etcd, by direct path. Returns None on failure.
CLI Examples:
.. code-block:: bash
salt myminion etcd.get /path/to/key
salt myminion etcd.get /path/to/key profile=my_etcd_config
salt myminion etcd.get /path/to/key recurse=True profile=m... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/etcd_mod.py#L76-L95 | null | # -*- coding: utf-8 -*-
'''
Execution module to work with etcd
:depends: - python-etcd
Configuration
-------------
To work with an etcd server you must configure an etcd profile. The etcd config
can be set in either the Salt Minion configuration file or in pillar:
.. code-block:: yaml
my_etd_config:
etc... |
saltstack/salt | salt/modules/etcd_mod.py | set_ | python | def set_(key, value, profile=None, ttl=None, directory=False, **kwargs):
'''
.. versionadded:: 2014.7.0
Set a key in etcd by direct path. Optionally, create a directory
or set a TTL on the key. Returns None on failure.
CLI Example:
.. code-block:: bash
salt myminion etcd.set /path/t... | .. versionadded:: 2014.7.0
Set a key in etcd by direct path. Optionally, create a directory
or set a TTL on the key. Returns None on failure.
CLI Example:
.. code-block:: bash
salt myminion etcd.set /path/to/key value
salt myminion etcd.set /path/to/key value profile=my_etcd_config
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/etcd_mod.py#L98-L117 | null | # -*- coding: utf-8 -*-
'''
Execution module to work with etcd
:depends: - python-etcd
Configuration
-------------
To work with an etcd server you must configure an etcd profile. The etcd config
can be set in either the Salt Minion configuration file or in pillar:
.. code-block:: yaml
my_etd_config:
etc... |
saltstack/salt | salt/modules/etcd_mod.py | update | python | def update(fields, path='', profile=None, **kwargs):
'''
.. versionadded:: 2016.3.0
Sets a dictionary of values in one call. Useful for large updates
in syndic environments. The dictionary can contain a mix of formats
such as:
.. code-block:: python
{
'/some/example/key': ... | .. versionadded:: 2016.3.0
Sets a dictionary of values in one call. Useful for large updates
in syndic environments. The dictionary can contain a mix of formats
such as:
.. code-block:: python
{
'/some/example/key': 'bar',
'/another/example/key': 'baz'
}
Or ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/etcd_mod.py#L120-L171 | null | # -*- coding: utf-8 -*-
'''
Execution module to work with etcd
:depends: - python-etcd
Configuration
-------------
To work with an etcd server you must configure an etcd profile. The etcd config
can be set in either the Salt Minion configuration file or in pillar:
.. code-block:: yaml
my_etd_config:
etc... |
saltstack/salt | salt/modules/etcd_mod.py | watch | python | def watch(key, recurse=False, profile=None, timeout=0, index=None, **kwargs):
'''
.. versionadded:: 2016.3.0
Makes a best effort to watch for a key or tree change in etcd.
Returns a dict containing the new key value ( or None if the key was
deleted ), the modifiedIndex of the key, whether the key c... | .. versionadded:: 2016.3.0
Makes a best effort to watch for a key or tree change in etcd.
Returns a dict containing the new key value ( or None if the key was
deleted ), the modifiedIndex of the key, whether the key changed or
not, the path to the key that changed and whether it is a directory or not.
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/etcd_mod.py#L174-L196 | null | # -*- coding: utf-8 -*-
'''
Execution module to work with etcd
:depends: - python-etcd
Configuration
-------------
To work with an etcd server you must configure an etcd profile. The etcd config
can be set in either the Salt Minion configuration file or in pillar:
.. code-block:: yaml
my_etd_config:
etc... |
saltstack/salt | salt/modules/etcd_mod.py | ls_ | python | def ls_(path='/', profile=None, **kwargs):
'''
.. versionadded:: 2014.7.0
Return all keys and dirs inside a specific path. Returns an empty dict on
failure.
CLI Example:
.. code-block:: bash
salt myminion etcd.ls /path/to/dir/
salt myminion etcd.ls /path/to/dir/ profile=my_e... | .. versionadded:: 2014.7.0
Return all keys and dirs inside a specific path. Returns an empty dict on
failure.
CLI Example:
.. code-block:: bash
salt myminion etcd.ls /path/to/dir/
salt myminion etcd.ls /path/to/dir/ profile=my_etcd_config
salt myminion etcd.ls /path/to/dir/ ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/etcd_mod.py#L199-L216 | null | # -*- coding: utf-8 -*-
'''
Execution module to work with etcd
:depends: - python-etcd
Configuration
-------------
To work with an etcd server you must configure an etcd profile. The etcd config
can be set in either the Salt Minion configuration file or in pillar:
.. code-block:: yaml
my_etd_config:
etc... |
saltstack/salt | salt/modules/etcd_mod.py | rm_ | python | def rm_(key, recurse=False, profile=None, **kwargs):
'''
.. versionadded:: 2014.7.0
Delete a key from etcd. Returns True if the key was deleted, False if it was
not and None if there was a failure.
CLI Example:
.. code-block:: bash
salt myminion etcd.rm /path/to/key
salt my... | .. versionadded:: 2014.7.0
Delete a key from etcd. Returns True if the key was deleted, False if it was
not and None if there was a failure.
CLI Example:
.. code-block:: bash
salt myminion etcd.rm /path/to/key
salt myminion etcd.rm /path/to/key profile=my_etcd_config
salt m... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/etcd_mod.py#L219-L237 | null | # -*- coding: utf-8 -*-
'''
Execution module to work with etcd
:depends: - python-etcd
Configuration
-------------
To work with an etcd server you must configure an etcd profile. The etcd config
can be set in either the Salt Minion configuration file or in pillar:
.. code-block:: yaml
my_etd_config:
etc... |
saltstack/salt | salt/modules/etcd_mod.py | tree | python | def tree(path='/', profile=None, **kwargs):
'''
.. versionadded:: 2014.7.0
Recurse through etcd and return all values. Returns None on failure.
CLI Example:
.. code-block:: bash
salt myminion etcd.tree
salt myminion etcd.tree profile=my_etcd_config
salt myminion etcd.tr... | .. versionadded:: 2014.7.0
Recurse through etcd and return all values. Returns None on failure.
CLI Example:
.. code-block:: bash
salt myminion etcd.tree
salt myminion etcd.tree profile=my_etcd_config
salt myminion etcd.tree host=127.0.0.1 port=2379
salt myminion etcd.t... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/etcd_mod.py#L240-L257 | null | # -*- coding: utf-8 -*-
'''
Execution module to work with etcd
:depends: - python-etcd
Configuration
-------------
To work with an etcd server you must configure an etcd profile. The etcd config
can be set in either the Salt Minion configuration file or in pillar:
.. code-block:: yaml
my_etd_config:
etc... |
saltstack/salt | salt/utils/aws.py | creds | python | def creds(provider):
'''
Return the credentials for AWS signing. This could be just the id and key
specified in the provider configuration, or if the id or key is set to the
literal string 'use-instance-role-credentials' creds will pull the instance
role credentials from the meta data, cache them, ... | Return the credentials for AWS signing. This could be just the id and key
specified in the provider configuration, or if the id or key is set to the
literal string 'use-instance-role-credentials' creds will pull the instance
role credentials from the meta data, cache them, and provide them instead. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/aws.py#L81-L141 | [
"def assumed_creds(prov_dict, role_arn, location=None):\n valid_session_name_re = re.compile(\"[^a-z0-9A-Z+=,.@-]\")\n\n # current time in epoch seconds\n now = time.mktime(datetime.utcnow().timetuple())\n\n for key, creds in __AssumeCache__.items():\n if (creds[\"Expiration\"] - now) <= 120:\n ... | # -*- coding: utf-8 -*-
'''
Connection library for AWS
.. versionadded:: 2015.5.0
This is a base library used by a number of AWS services.
:depends: requests
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import Python libs
import sys
import time
import binascii
from datetime import ... |
saltstack/salt | salt/utils/aws.py | sig2 | python | def sig2(method, endpoint, params, provider, aws_api_version):
'''
Sign a query against AWS services using Signature Version 2 Signing
Process. This is documented at:
http://docs.aws.amazon.com/general/latest/gr/signature-version-2.html
'''
timenow = datetime.utcnow()
timestamp = timenow.st... | Sign a query against AWS services using Signature Version 2 Signing
Process. This is documented at:
http://docs.aws.amazon.com/general/latest/gr/signature-version-2.html | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/aws.py#L144-L181 | [
"def creds(provider):\n '''\n Return the credentials for AWS signing. This could be just the id and key\n specified in the provider configuration, or if the id or key is set to the\n literal string 'use-instance-role-credentials' creds will pull the instance\n role credentials from the meta data, ca... | # -*- coding: utf-8 -*-
'''
Connection library for AWS
.. versionadded:: 2015.5.0
This is a base library used by a number of AWS services.
:depends: requests
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import Python libs
import sys
import time
import binascii
from datetime import ... |
saltstack/salt | salt/utils/aws.py | sig4 | python | def sig4(method, endpoint, params, prov_dict,
aws_api_version=DEFAULT_AWS_API_VERSION, location=None,
product='ec2', uri='/', requesturl=None, data='', headers=None,
role_arn=None, payload_hash=None):
'''
Sign a query against AWS services using Signature Version 4 Signing
Process.... | Sign a query against AWS services using Signature Version 4 Signing
Process. This is documented at:
http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html
http://docs.aws.amazon.com/general/latest/gr/sigv4-signed-request-examples.html
http://docs.aws.amazon.com/general/latest/gr/sigv4-create-c... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/aws.py#L235-L343 | [
"def creds(provider):\n '''\n Return the credentials for AWS signing. This could be just the id and key\n specified in the provider configuration, or if the id or key is set to the\n literal string 'use-instance-role-credentials' creds will pull the instance\n role credentials from the meta data, ca... | # -*- coding: utf-8 -*-
'''
Connection library for AWS
.. versionadded:: 2015.5.0
This is a base library used by a number of AWS services.
:depends: requests
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import Python libs
import sys
import time
import binascii
from datetime import ... |
saltstack/salt | salt/utils/aws.py | _sig_key | python | def _sig_key(key, date_stamp, regionName, serviceName):
'''
Get a signature key. See:
http://docs.aws.amazon.com/general/latest/gr/signature-v4-examples.html#signature-v4-examples-python
'''
kDate = _sign(('AWS4' + key).encode('utf-8'), date_stamp)
if regionName:
kRegion = _sign(kDate, ... | Get a signature key. See:
http://docs.aws.amazon.com/general/latest/gr/signature-v4-examples.html#signature-v4-examples-python | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/aws.py#L355-L368 | null | # -*- coding: utf-8 -*-
'''
Connection library for AWS
.. versionadded:: 2015.5.0
This is a base library used by a number of AWS services.
:depends: requests
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import Python libs
import sys
import time
import binascii
from datetime import ... |
saltstack/salt | salt/utils/aws.py | query | python | def query(params=None, setname=None, requesturl=None, location=None,
return_url=False, return_root=False, opts=None, provider=None,
endpoint=None, product='ec2', sigver='2'):
'''
Perform a query against AWS services using Signature Version 2 Signing
Process. This is documented at:
h... | Perform a query against AWS services using Signature Version 2 Signing
Process. This is documented at:
http://docs.aws.amazon.com/general/latest/gr/signature-version-2.html
Regions and endpoints are documented at:
http://docs.aws.amazon.com/general/latest/gr/rande.html
Default ``product`` is ``e... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/aws.py#L371-L540 | [
"def get_location(opts=None, provider=None):\n '''\n Return the region to use, in this order:\n opts['location']\n provider['location']\n get_region_from_metadata()\n DEFAULT_LOCATION\n '''\n if opts is None:\n opts = {}\n ret = opts.get('location')\n if ret is N... | # -*- coding: utf-8 -*-
'''
Connection library for AWS
.. versionadded:: 2015.5.0
This is a base library used by a number of AWS services.
:depends: requests
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import Python libs
import sys
import time
import binascii
from datetime import ... |
saltstack/salt | salt/utils/aws.py | get_region_from_metadata | python | def get_region_from_metadata():
'''
Try to get region from instance identity document and cache it
.. versionadded:: 2015.5.6
'''
global __Location__
if __Location__ == 'do-not-get-from-metadata':
log.debug('Previously failed to get AWS region from metadata. Not trying again.')
... | Try to get region from instance identity document and cache it
.. versionadded:: 2015.5.6 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/aws.py#L543-L579 | null | # -*- coding: utf-8 -*-
'''
Connection library for AWS
.. versionadded:: 2015.5.0
This is a base library used by a number of AWS services.
:depends: requests
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import Python libs
import sys
import time
import binascii
from datetime import ... |
saltstack/salt | salt/utils/aws.py | get_location | python | def get_location(opts=None, provider=None):
'''
Return the region to use, in this order:
opts['location']
provider['location']
get_region_from_metadata()
DEFAULT_LOCATION
'''
if opts is None:
opts = {}
ret = opts.get('location')
if ret is None and provider... | Return the region to use, in this order:
opts['location']
provider['location']
get_region_from_metadata()
DEFAULT_LOCATION | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/aws.py#L582-L599 | [
"def get_region_from_metadata():\n '''\n Try to get region from instance identity document and cache it\n\n .. versionadded:: 2015.5.6\n '''\n global __Location__\n\n if __Location__ == 'do-not-get-from-metadata':\n log.debug('Previously failed to get AWS region from metadata. Not trying ag... | # -*- coding: utf-8 -*-
'''
Connection library for AWS
.. versionadded:: 2015.5.0
This is a base library used by a number of AWS services.
:depends: requests
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import Python libs
import sys
import time
import binascii
from datetime import ... |
saltstack/salt | salt/daemons/__init__.py | extract_masters | python | def extract_masters(opts, masters='master', port=None, raise_if_empty=True):
'''
Parses opts and generates a list of master (host,port) addresses.
By default looks for list of masters in opts['master'] and uses
opts['master_port'] as the default port when otherwise not provided.
Use the opts key gi... | Parses opts and generates a list of master (host,port) addresses.
By default looks for list of masters in opts['master'] and uses
opts['master_port'] as the default port when otherwise not provided.
Use the opts key given by masters for the masters list, default is 'master'
If parameter port is not Non... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/daemons/__init__.py#L48-L197 | [
"def is_non_string_sequence(obj):\n \"\"\"\n Returns True if obj is non-string sequence, False otherwise\n\n Future proof way that is compatible with both Python3 and Python2 to check\n for non string sequences.\n Assumes in Python3 that, basestring = (str, bytes)\n \"\"\"\n return not isinstan... | # -*- coding: utf-8 -*-
'''
The daemons package is used to store implementations of the Salt Master and
Minion enabling different transports.
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import Python Libs
import sys
try:
from collections.abc import Iterable, Sequence, Mapping
exc... |
saltstack/salt | salt/daemons/__init__.py | parse_hostname | python | def parse_hostname(hostname, default_port):
'''
Parse hostname string and return a tuple of (host, port)
If port missing in hostname string then use default_port
If anything is not a valid then return None
hostname should contain a host and an option space delimited port
host port
As an at... | Parse hostname string and return a tuple of (host, port)
If port missing in hostname string then use default_port
If anything is not a valid then return None
hostname should contain a host and an option space delimited port
host port
As an attempt to prevent foolish mistakes the parser also tries ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/daemons/__init__.py#L200-L240 | null | # -*- coding: utf-8 -*-
'''
The daemons package is used to store implementations of the Salt Master and
Minion enabling different transports.
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import Python Libs
import sys
try:
from collections.abc import Iterable, Sequence, Mapping
exc... |
saltstack/salt | salt/modules/ciscoconfparse_mod.py | find_objects | python | def find_objects(config=None, config_path=None, regex=None, saltenv='base'):
'''
Return all the line objects that match the expression in the ``regex``
argument.
.. warning::
This function is mostly valuable when invoked from other Salt
components (i.e., execution modules, states, templ... | Return all the line objects that match the expression in the ``regex``
argument.
.. warning::
This function is mostly valuable when invoked from other Salt
components (i.e., execution modules, states, templates etc.). For CLI
usage, please consider using
:py:func:`ciscoconfparse... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ciscoconfparse_mod.py#L71-L111 | [
"def _get_ccp(config=None, config_path=None, saltenv='base'):\n '''\n '''\n if config_path:\n config = __salt__['cp.get_file_str'](config_path, saltenv=saltenv)\n if config is False:\n raise SaltException('{} is not available'.format(config_path))\n if isinstance(config, six.str... | # -*- coding: utf-8 -*-
'''
Execution module for `ciscoconfparse <http://www.pennington.net/py/ciscoconfparse/index.html>`_
.. versionadded:: 2019.2.0
This module can be used for basic configuration parsing, audit or validation
for a variety of network platforms having Cisco IOS style configuration (one
space indenta... |
saltstack/salt | salt/modules/ciscoconfparse_mod.py | find_lines | python | def find_lines(config=None, config_path=None, regex=None, saltenv='base'):
'''
Return all the lines (as text) that match the expression in the ``regex``
argument.
config
The configuration sent as text.
.. note::
This argument is ignored when ``config_path`` is specified.
... | Return all the lines (as text) that match the expression in the ``regex``
argument.
config
The configuration sent as text.
.. note::
This argument is ignored when ``config_path`` is specified.
config_path
The absolute or remote path to the file with the configuration t... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ciscoconfparse_mod.py#L114-L156 | [
"def find_objects(config=None, config_path=None, regex=None, saltenv='base'):\n '''\n Return all the line objects that match the expression in the ``regex``\n argument.\n\n .. warning::\n This function is mostly valuable when invoked from other Salt\n components (i.e., execution modules, s... | # -*- coding: utf-8 -*-
'''
Execution module for `ciscoconfparse <http://www.pennington.net/py/ciscoconfparse/index.html>`_
.. versionadded:: 2019.2.0
This module can be used for basic configuration parsing, audit or validation
for a variety of network platforms having Cisco IOS style configuration (one
space indenta... |
saltstack/salt | salt/modules/ciscoconfparse_mod.py | find_lines_w_child | python | def find_lines_w_child(config=None,
config_path=None,
parent_regex=None,
child_regex=None,
ignore_ws=False,
saltenv='base'):
r'''
Return a list of parent lines (as text) matching the regular expre... | r'''
Return a list of parent lines (as text) matching the regular expression
``parent_regex`` that have children lines matching ``child_regex``.
config
The configuration sent as text.
.. note::
This argument is ignored when ``config_path`` is specified.
config_path
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ciscoconfparse_mod.py#L214-L261 | [
"def find_objects_w_child(config=None,\n config_path=None,\n parent_regex=None,\n child_regex=None,\n ignore_ws=False,\n saltenv='base'):\n '''\n Parse through the children of all parent lin... | # -*- coding: utf-8 -*-
'''
Execution module for `ciscoconfparse <http://www.pennington.net/py/ciscoconfparse/index.html>`_
.. versionadded:: 2019.2.0
This module can be used for basic configuration parsing, audit or validation
for a variety of network platforms having Cisco IOS style configuration (one
space indenta... |
saltstack/salt | salt/modules/ciscoconfparse_mod.py | find_objects_wo_child | python | def find_objects_wo_child(config=None,
config_path=None,
parent_regex=None,
child_regex=None,
ignore_ws=False,
saltenv='base'):
'''
Return a list of parent ``ciscoconfparse.IOSCfgLin... | Return a list of parent ``ciscoconfparse.IOSCfgLine`` objects, which matched
the ``parent_regex`` and whose children did *not* match ``child_regex``.
Only the parent ``ciscoconfparse.IOSCfgLine`` objects will be returned. For
simplicity, this method only finds oldest ancestors without immediate
children... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ciscoconfparse_mod.py#L264-L319 | [
"def _get_ccp(config=None, config_path=None, saltenv='base'):\n '''\n '''\n if config_path:\n config = __salt__['cp.get_file_str'](config_path, saltenv=saltenv)\n if config is False:\n raise SaltException('{} is not available'.format(config_path))\n if isinstance(config, six.str... | # -*- coding: utf-8 -*-
'''
Execution module for `ciscoconfparse <http://www.pennington.net/py/ciscoconfparse/index.html>`_
.. versionadded:: 2019.2.0
This module can be used for basic configuration parsing, audit or validation
for a variety of network platforms having Cisco IOS style configuration (one
space indenta... |
saltstack/salt | salt/modules/ciscoconfparse_mod.py | find_lines_wo_child | python | def find_lines_wo_child(config=None,
config_path=None,
parent_regex=None,
child_regex=None,
ignore_ws=False,
saltenv='base'):
'''
Return a list of parent ``ciscoconfparse.IOSCfgLine`` lines as... | Return a list of parent ``ciscoconfparse.IOSCfgLine`` lines as text, which
matched the ``parent_regex`` and whose children did *not* match ``child_regex``.
Only the parent ``ciscoconfparse.IOSCfgLine`` text lines will be returned.
For simplicity, this method only finds oldest ancestors without immediate
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ciscoconfparse_mod.py#L322-L371 | [
"def find_objects_wo_child(config=None,\n config_path=None,\n parent_regex=None,\n child_regex=None,\n ignore_ws=False,\n saltenv='base'):\n '''\n Return a list of parent ``ciscoconfpar... | # -*- coding: utf-8 -*-
'''
Execution module for `ciscoconfparse <http://www.pennington.net/py/ciscoconfparse/index.html>`_
.. versionadded:: 2019.2.0
This module can be used for basic configuration parsing, audit or validation
for a variety of network platforms having Cisco IOS style configuration (one
space indenta... |
saltstack/salt | salt/modules/ciscoconfparse_mod.py | filter_lines | python | def filter_lines(config=None,
config_path=None,
parent_regex=None,
child_regex=None,
saltenv='base'):
'''
Return a list of detailed matches, for the configuration blocks (parent-child
relationship) whose parent respects the regular expressi... | Return a list of detailed matches, for the configuration blocks (parent-child
relationship) whose parent respects the regular expressions configured via
the ``parent_regex`` argument, and the child matches the ``child_regex``
regular expression. The result is a list of dictionaries with the following
ke... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/ciscoconfparse_mod.py#L374-L443 | [
"def _get_ccp(config=None, config_path=None, saltenv='base'):\n '''\n '''\n if config_path:\n config = __salt__['cp.get_file_str'](config_path, saltenv=saltenv)\n if config is False:\n raise SaltException('{} is not available'.format(config_path))\n if isinstance(config, six.str... | # -*- coding: utf-8 -*-
'''
Execution module for `ciscoconfparse <http://www.pennington.net/py/ciscoconfparse/index.html>`_
.. versionadded:: 2019.2.0
This module can be used for basic configuration parsing, audit or validation
for a variety of network platforms having Cisco IOS style configuration (one
space indenta... |
saltstack/salt | salt/states/tuned.py | profile | python | def profile(name):
'''
This state module allows you to modify system tuned parameters
Example tuned.sls file to set profile to virtual-guest
tuned:
tuned:
- profile
- name: virtual-guest
name
tuned profile name to set the system to
To see a valid list of states ... | This state module allows you to modify system tuned parameters
Example tuned.sls file to set profile to virtual-guest
tuned:
tuned:
- profile
- name: virtual-guest
name
tuned profile name to set the system to
To see a valid list of states call execution module:
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/tuned.py#L18-L86 | null | # -*- coding: utf-8 -*-
'''
Interface to Red Hat tuned-adm module
:maintainer: Syed Ali <alicsyed@gmail.com>
:maturity: new
:depends: cmd.run
:platform: Linux
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
# Import Salt libs
import salt.exceptions... |
saltstack/salt | salt/modules/napalm_probes.py | delete_probes | python | def delete_probes(probes, test=False, commit=True, **kwargs): # pylint: disable=unused-argument
'''
Removes RPM/SLA probes from the network device.
Calls the configuration template 'delete_probes' from the NAPALM library,
providing as input a rich formatted dictionary with the configuration details of... | Removes RPM/SLA probes from the network device.
Calls the configuration template 'delete_probes' from the NAPALM library,
providing as input a rich formatted dictionary with the configuration details of the probes to be removed
from the configuration of the device.
:param probes: Dictionary with a simi... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/napalm_probes.py#L273-L320 | null | # -*- coding: utf-8 -*-
'''
NAPALM Probes
=============
Manages RPM/SLA probes on the network device.
:codeauthor: Mircea Ulinic <mircea@cloudflare.com> & Jerome Fleury <jf@cloudflare.com>
:maturity: new
:depends: napalm
:platform: unix
Dependencies
------------
- :mod:`napalm proxy minion <salt.proxy.napalm... |
saltstack/salt | salt/returners/couchbase_return.py | _get_connection | python | def _get_connection():
'''
Global function to access the couchbase connection (and make it if its closed)
'''
global COUCHBASE_CONN
if COUCHBASE_CONN is None:
opts = _get_options()
if opts['password']:
COUCHBASE_CONN = couchbase.Couchbase.connect(host=opts['host'],
... | Global function to access the couchbase connection (and make it if its closed) | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchbase_return.py#L106-L123 | null | # -*- coding: utf-8 -*-
'''
Simple returner for Couchbase. Optional configuration
settings are listed below, along with sane defaults.
.. code-block:: yaml
couchbase.host: 'salt'
couchbase.port: 8091
couchbase.bucket: 'salt'
couchbase.ttl: 24
couchbase.password: 'password'
couchbase.skip_v... |
saltstack/salt | salt/returners/couchbase_return.py | _verify_views | python | def _verify_views():
'''
Verify that you have the views you need. This can be disabled by
adding couchbase.skip_verify_views: True in config
'''
global VERIFIED_VIEWS
if VERIFIED_VIEWS or __opts__.get('couchbase.skip_verify_views', False):
return
cb_ = _get_connection()
ddoc = {... | Verify that you have the views you need. This can be disabled by
adding couchbase.skip_verify_views: True in config | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchbase_return.py#L126-L150 | null | # -*- coding: utf-8 -*-
'''
Simple returner for Couchbase. Optional configuration
settings are listed below, along with sane defaults.
.. code-block:: yaml
couchbase.host: 'salt'
couchbase.port: 8091
couchbase.bucket: 'salt'
couchbase.ttl: 24
couchbase.password: 'password'
couchbase.skip_v... |
saltstack/salt | salt/returners/couchbase_return.py | prep_jid | python | def prep_jid(nocache=False, passed_jid=None):
'''
Return a job id and prepare the job id directory
This is the function responsible for making sure jids don't collide (unless
its passed a jid)
So do what you have to do to make sure that stays the case
'''
if passed_jid is None:
jid =... | Return a job id and prepare the job id directory
This is the function responsible for making sure jids don't collide (unless
its passed a jid)
So do what you have to do to make sure that stays the case | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchbase_return.py#L161-L185 | [
"def gen_jid(opts=None):\n '''\n Generate a jid\n '''\n if opts is None:\n salt.utils.versions.warn_until(\n 'Sodium',\n 'The `opts` argument was not passed into salt.utils.jid.gen_jid(). '\n 'This will be required starting in {version}.'\n )\n opts ... | # -*- coding: utf-8 -*-
'''
Simple returner for Couchbase. Optional configuration
settings are listed below, along with sane defaults.
.. code-block:: yaml
couchbase.host: 'salt'
couchbase.port: 8091
couchbase.bucket: 'salt'
couchbase.ttl: 24
couchbase.password: 'password'
couchbase.skip_v... |
saltstack/salt | salt/returners/couchbase_return.py | returner | python | def returner(load):
'''
Return data to couchbase bucket
'''
cb_ = _get_connection()
hn_key = '{0}/{1}'.format(load['jid'], load['id'])
try:
ret_doc = {'return': load['return'],
'full_ret': salt.utils.json.dumps(load)}
cb_.add(hn_key,
ret_doc,
... | Return data to couchbase bucket | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchbase_return.py#L188-L208 | [
"def dumps(obj, **kwargs):\n '''\n .. versionadded:: 2018.3.0\n\n Wraps json.dumps, and assumes that ensure_ascii is False (unless explicitly\n passed as True) for unicode compatibility. Note that setting it to True\n will mess up any unicode characters, as they will be dumped as the string\n lite... | # -*- coding: utf-8 -*-
'''
Simple returner for Couchbase. Optional configuration
settings are listed below, along with sane defaults.
.. code-block:: yaml
couchbase.host: 'salt'
couchbase.port: 8091
couchbase.bucket: 'salt'
couchbase.ttl: 24
couchbase.password: 'password'
couchbase.skip_v... |
saltstack/salt | salt/returners/couchbase_return.py | save_load | python | def save_load(jid, clear_load, minion=None):
'''
Save the load to the specified jid
'''
cb_ = _get_connection()
try:
jid_doc = cb_.get(six.text_type(jid))
except couchbase.exceptions.NotFoundError:
cb_.add(six.text_type(jid), {}, ttl=_get_ttl())
jid_doc = cb_.get(six.tex... | Save the load to the specified jid | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchbase_return.py#L211-L235 | [
"def save_minions(jid, minions, syndic_id=None): # pylint: disable=unused-argument\n '''\n Save/update the minion list for a given jid. The syndic_id argument is\n included for API compatibility only.\n '''\n cb_ = _get_connection()\n\n try:\n jid_doc = cb_.get(six.text_type(jid))\n exc... | # -*- coding: utf-8 -*-
'''
Simple returner for Couchbase. Optional configuration
settings are listed below, along with sane defaults.
.. code-block:: yaml
couchbase.host: 'salt'
couchbase.port: 8091
couchbase.bucket: 'salt'
couchbase.ttl: 24
couchbase.password: 'password'
couchbase.skip_v... |
saltstack/salt | salt/returners/couchbase_return.py | save_minions | python | def save_minions(jid, minions, syndic_id=None): # pylint: disable=unused-argument
'''
Save/update the minion list for a given jid. The syndic_id argument is
included for API compatibility only.
'''
cb_ = _get_connection()
try:
jid_doc = cb_.get(six.text_type(jid))
except couchbase.... | Save/update the minion list for a given jid. The syndic_id argument is
included for API compatibility only. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchbase_return.py#L238-L258 | [
"def _get_connection():\n '''\n Global function to access the couchbase connection (and make it if its closed)\n '''\n global COUCHBASE_CONN\n if COUCHBASE_CONN is None:\n opts = _get_options()\n if opts['password']:\n COUCHBASE_CONN = couchbase.Couchbase.connect(host=opts['h... | # -*- coding: utf-8 -*-
'''
Simple returner for Couchbase. Optional configuration
settings are listed below, along with sane defaults.
.. code-block:: yaml
couchbase.host: 'salt'
couchbase.port: 8091
couchbase.bucket: 'salt'
couchbase.ttl: 24
couchbase.password: 'password'
couchbase.skip_v... |
saltstack/salt | salt/returners/couchbase_return.py | get_load | python | def get_load(jid):
'''
Return the load data that marks a specified jid
'''
cb_ = _get_connection()
try:
jid_doc = cb_.get(six.text_type(jid))
except couchbase.exceptions.NotFoundError:
return {}
ret = {}
try:
ret = jid_doc.value['load']
ret['Minions'] = ... | Return the load data that marks a specified jid | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchbase_return.py#L261-L279 | [
"def _get_connection():\n '''\n Global function to access the couchbase connection (and make it if its closed)\n '''\n global COUCHBASE_CONN\n if COUCHBASE_CONN is None:\n opts = _get_options()\n if opts['password']:\n COUCHBASE_CONN = couchbase.Couchbase.connect(host=opts['h... | # -*- coding: utf-8 -*-
'''
Simple returner for Couchbase. Optional configuration
settings are listed below, along with sane defaults.
.. code-block:: yaml
couchbase.host: 'salt'
couchbase.port: 8091
couchbase.bucket: 'salt'
couchbase.ttl: 24
couchbase.password: 'password'
couchbase.skip_v... |
saltstack/salt | salt/returners/couchbase_return.py | get_jid | python | def get_jid(jid):
'''
Return the information returned when the specified job id was executed
'''
cb_ = _get_connection()
_verify_views()
ret = {}
for result in cb_.query(DESIGN_NAME, 'jid_returns', key=six.text_type(jid), include_docs=True):
ret[result.value] = result.doc.value
... | Return the information returned when the specified job id was executed | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchbase_return.py#L282-L294 | [
"def _get_connection():\n '''\n Global function to access the couchbase connection (and make it if its closed)\n '''\n global COUCHBASE_CONN\n if COUCHBASE_CONN is None:\n opts = _get_options()\n if opts['password']:\n COUCHBASE_CONN = couchbase.Couchbase.connect(host=opts['h... | # -*- coding: utf-8 -*-
'''
Simple returner for Couchbase. Optional configuration
settings are listed below, along with sane defaults.
.. code-block:: yaml
couchbase.host: 'salt'
couchbase.port: 8091
couchbase.bucket: 'salt'
couchbase.ttl: 24
couchbase.password: 'password'
couchbase.skip_v... |
saltstack/salt | salt/returners/couchbase_return.py | get_jids | python | def get_jids():
'''
Return a list of all job ids
'''
cb_ = _get_connection()
_verify_views()
ret = {}
for result in cb_.query(DESIGN_NAME, 'jids', include_docs=True):
ret[result.key] = _format_jid_instance(result.key, result.doc.value['load'])
return ret | Return a list of all job ids | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchbase_return.py#L297-L309 | [
"def _get_connection():\n '''\n Global function to access the couchbase connection (and make it if its closed)\n '''\n global COUCHBASE_CONN\n if COUCHBASE_CONN is None:\n opts = _get_options()\n if opts['password']:\n COUCHBASE_CONN = couchbase.Couchbase.connect(host=opts['h... | # -*- coding: utf-8 -*-
'''
Simple returner for Couchbase. Optional configuration
settings are listed below, along with sane defaults.
.. code-block:: yaml
couchbase.host: 'salt'
couchbase.port: 8091
couchbase.bucket: 'salt'
couchbase.ttl: 24
couchbase.password: 'password'
couchbase.skip_v... |
saltstack/salt | salt/returners/couchbase_return.py | _format_jid_instance | python | def _format_jid_instance(jid, job):
'''
Return a properly formatted jid dict
'''
ret = _format_job_instance(job)
ret.update({'StartTime': salt.utils.jid.jid_to_time(jid)})
return ret | Return a properly formatted jid dict | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/returners/couchbase_return.py#L332-L338 | [
"def _format_job_instance(job):\n '''\n Return a properly formatted job dict\n '''\n ret = {'Function': job.get('fun', 'unknown-function'),\n 'Arguments': list(job.get('arg', [])),\n # unlikely but safeguard from invalid returns\n 'Target': job.get('tgt', 'unknown-target'),... | # -*- coding: utf-8 -*-
'''
Simple returner for Couchbase. Optional configuration
settings are listed below, along with sane defaults.
.. code-block:: yaml
couchbase.host: 'salt'
couchbase.port: 8091
couchbase.bucket: 'salt'
couchbase.ttl: 24
couchbase.password: 'password'
couchbase.skip_v... |
saltstack/salt | salt/cache/redis_cache.py | _get_redis_cache_opts | python | def _get_redis_cache_opts():
'''
Return the Redis server connection details from the __opts__.
'''
return {
'host': __opts__.get('cache.redis.host', 'localhost'),
'port': __opts__.get('cache.redis.port', 6379),
'unix_socket_path': __opts__.get('cache.redis.unix_socket_path', None... | Return the Redis server connection details from the __opts__. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/redis_cache.py#L205-L218 | null | # -*- coding: utf-8 -*-
'''
Redis
=====
Redis plugin for the Salt caching subsystem.
.. versionadded:: 2017.7.0
As Redis provides a simple mechanism for very fast key-value store, in order to
privde the necessary features for the Salt caching subsystem, the following
conventions are used:
- A Redis key consists of ... |
saltstack/salt | salt/cache/redis_cache.py | _get_redis_server | python | def _get_redis_server(opts=None):
'''
Return the Redis server instance.
Caching the object instance.
'''
global REDIS_SERVER
if REDIS_SERVER:
return REDIS_SERVER
if not opts:
opts = _get_redis_cache_opts()
if opts['cluster_mode']:
REDIS_SERVER = StrictRedisCluste... | Return the Redis server instance.
Caching the object instance. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/redis_cache.py#L221-L241 | [
"def _get_redis_cache_opts():\n '''\n Return the Redis server connection details from the __opts__.\n '''\n return {\n 'host': __opts__.get('cache.redis.host', 'localhost'),\n 'port': __opts__.get('cache.redis.port', 6379),\n 'unix_socket_path': __opts__.get('cache.redis.unix_socket... | # -*- coding: utf-8 -*-
'''
Redis
=====
Redis plugin for the Salt caching subsystem.
.. versionadded:: 2017.7.0
As Redis provides a simple mechanism for very fast key-value store, in order to
privde the necessary features for the Salt caching subsystem, the following
conventions are used:
- A Redis key consists of ... |
saltstack/salt | salt/cache/redis_cache.py | _get_redis_keys_opts | python | def _get_redis_keys_opts():
'''
Build the key opts based on the user options.
'''
return {
'bank_prefix': __opts__.get('cache.redis.bank_prefix', _BANK_PREFIX),
'bank_keys_prefix': __opts__.get('cache.redis.bank_keys_prefix', _BANK_KEYS_PREFIX),
'key_prefix': __opts__.get('cache.... | Build the key opts based on the user options. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/redis_cache.py#L244-L253 | null | # -*- coding: utf-8 -*-
'''
Redis
=====
Redis plugin for the Salt caching subsystem.
.. versionadded:: 2017.7.0
As Redis provides a simple mechanism for very fast key-value store, in order to
privde the necessary features for the Salt caching subsystem, the following
conventions are used:
- A Redis key consists of ... |
saltstack/salt | salt/cache/redis_cache.py | _get_bank_redis_key | python | def _get_bank_redis_key(bank):
'''
Return the Redis key for the bank given the name.
'''
opts = _get_redis_keys_opts()
return '{prefix}{separator}{bank}'.format(
prefix=opts['bank_prefix'],
separator=opts['separator'],
bank=bank
) | Return the Redis key for the bank given the name. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/redis_cache.py#L256-L265 | [
"def _get_redis_keys_opts():\n '''\n Build the key opts based on the user options.\n '''\n return {\n 'bank_prefix': __opts__.get('cache.redis.bank_prefix', _BANK_PREFIX),\n 'bank_keys_prefix': __opts__.get('cache.redis.bank_keys_prefix', _BANK_KEYS_PREFIX),\n 'key_prefix': __opts__... | # -*- coding: utf-8 -*-
'''
Redis
=====
Redis plugin for the Salt caching subsystem.
.. versionadded:: 2017.7.0
As Redis provides a simple mechanism for very fast key-value store, in order to
privde the necessary features for the Salt caching subsystem, the following
conventions are used:
- A Redis key consists of ... |
saltstack/salt | salt/cache/redis_cache.py | _get_key_redis_key | python | def _get_key_redis_key(bank, key):
'''
Return the Redis key given the bank name and the key name.
'''
opts = _get_redis_keys_opts()
return '{prefix}{separator}{bank}/{key}'.format(
prefix=opts['key_prefix'],
separator=opts['separator'],
bank=bank,
key=key
) | Return the Redis key given the bank name and the key name. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/redis_cache.py#L268-L278 | [
"def _get_redis_keys_opts():\n '''\n Build the key opts based on the user options.\n '''\n return {\n 'bank_prefix': __opts__.get('cache.redis.bank_prefix', _BANK_PREFIX),\n 'bank_keys_prefix': __opts__.get('cache.redis.bank_keys_prefix', _BANK_KEYS_PREFIX),\n 'key_prefix': __opts__... | # -*- coding: utf-8 -*-
'''
Redis
=====
Redis plugin for the Salt caching subsystem.
.. versionadded:: 2017.7.0
As Redis provides a simple mechanism for very fast key-value store, in order to
privde the necessary features for the Salt caching subsystem, the following
conventions are used:
- A Redis key consists of ... |
saltstack/salt | salt/cache/redis_cache.py | _get_bank_keys_redis_key | python | def _get_bank_keys_redis_key(bank):
'''
Return the Redis key for the SET of keys under a certain bank, given the bank name.
'''
opts = _get_redis_keys_opts()
return '{prefix}{separator}{bank}'.format(
prefix=opts['bank_keys_prefix'],
separator=opts['separator'],
bank=bank
... | Return the Redis key for the SET of keys under a certain bank, given the bank name. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/redis_cache.py#L281-L290 | null | # -*- coding: utf-8 -*-
'''
Redis
=====
Redis plugin for the Salt caching subsystem.
.. versionadded:: 2017.7.0
As Redis provides a simple mechanism for very fast key-value store, in order to
privde the necessary features for the Salt caching subsystem, the following
conventions are used:
- A Redis key consists of ... |
saltstack/salt | salt/cache/redis_cache.py | _build_bank_hier | python | def _build_bank_hier(bank, redis_pipe):
'''
Build the bank hierarchy from the root of the tree.
If already exists, it won't rewrite.
It's using the Redis pipeline,
so there will be only one interaction with the remote server.
'''
bank_list = bank.split('/')
parent_bank_path = bank_list[0... | Build the bank hierarchy from the root of the tree.
If already exists, it won't rewrite.
It's using the Redis pipeline,
so there will be only one interaction with the remote server. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/redis_cache.py#L293-L310 | null | # -*- coding: utf-8 -*-
'''
Redis
=====
Redis plugin for the Salt caching subsystem.
.. versionadded:: 2017.7.0
As Redis provides a simple mechanism for very fast key-value store, in order to
privde the necessary features for the Salt caching subsystem, the following
conventions are used:
- A Redis key consists of ... |
saltstack/salt | salt/cache/redis_cache.py | _get_banks_to_remove | python | def _get_banks_to_remove(redis_server, bank, path=''):
'''
A simple tree tarversal algorithm that builds the list of banks to remove,
starting from an arbitrary node in the tree.
'''
current_path = bank if not path else '{path}/{bank}'.format(path=path, bank=bank)
bank_paths_to_remove = [current... | A simple tree tarversal algorithm that builds the list of banks to remove,
starting from an arbitrary node in the tree. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/redis_cache.py#L313-L330 | null | # -*- coding: utf-8 -*-
'''
Redis
=====
Redis plugin for the Salt caching subsystem.
.. versionadded:: 2017.7.0
As Redis provides a simple mechanism for very fast key-value store, in order to
privde the necessary features for the Salt caching subsystem, the following
conventions are used:
- A Redis key consists of ... |
saltstack/salt | salt/cache/redis_cache.py | store | python | def store(bank, key, data):
'''
Store the data in a Redis key.
'''
redis_server = _get_redis_server()
redis_pipe = redis_server.pipeline()
redis_key = _get_key_redis_key(bank, key)
redis_bank_keys = _get_bank_keys_redis_key(bank)
try:
_build_bank_hier(bank, redis_pipe)
va... | Store the data in a Redis key. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/redis_cache.py#L337-L357 | [
"def _get_redis_server(opts=None):\n '''\n Return the Redis server instance.\n Caching the object instance.\n '''\n global REDIS_SERVER\n if REDIS_SERVER:\n return REDIS_SERVER\n if not opts:\n opts = _get_redis_cache_opts()\n\n if opts['cluster_mode']:\n REDIS_SERVER = ... | # -*- coding: utf-8 -*-
'''
Redis
=====
Redis plugin for the Salt caching subsystem.
.. versionadded:: 2017.7.0
As Redis provides a simple mechanism for very fast key-value store, in order to
privde the necessary features for the Salt caching subsystem, the following
conventions are used:
- A Redis key consists of ... |
saltstack/salt | salt/cache/redis_cache.py | fetch | python | def fetch(bank, key):
'''
Fetch data from the Redis cache.
'''
redis_server = _get_redis_server()
redis_key = _get_key_redis_key(bank, key)
redis_value = None
try:
redis_value = redis_server.get(redis_key)
except (RedisConnectionError, RedisResponseError) as rerr:
mesg = ... | Fetch data from the Redis cache. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/redis_cache.py#L360-L376 | [
"def _get_redis_server(opts=None):\n '''\n Return the Redis server instance.\n Caching the object instance.\n '''\n global REDIS_SERVER\n if REDIS_SERVER:\n return REDIS_SERVER\n if not opts:\n opts = _get_redis_cache_opts()\n\n if opts['cluster_mode']:\n REDIS_SERVER = ... | # -*- coding: utf-8 -*-
'''
Redis
=====
Redis plugin for the Salt caching subsystem.
.. versionadded:: 2017.7.0
As Redis provides a simple mechanism for very fast key-value store, in order to
privde the necessary features for the Salt caching subsystem, the following
conventions are used:
- A Redis key consists of ... |
saltstack/salt | salt/cache/redis_cache.py | flush | python | def flush(bank, key=None):
'''
Remove the key from the cache bank with all the key content. If no key is specified, remove
the entire bank with all keys and sub-banks inside.
This function is using the Redis pipelining for best performance.
However, when removing a whole bank,
in order to re-cre... | Remove the key from the cache bank with all the key content. If no key is specified, remove
the entire bank with all keys and sub-banks inside.
This function is using the Redis pipelining for best performance.
However, when removing a whole bank,
in order to re-create the tree, there are a couple of req... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/redis_cache.py#L379-L471 | [
"def _get_redis_server(opts=None):\n '''\n Return the Redis server instance.\n Caching the object instance.\n '''\n global REDIS_SERVER\n if REDIS_SERVER:\n return REDIS_SERVER\n if not opts:\n opts = _get_redis_cache_opts()\n\n if opts['cluster_mode']:\n REDIS_SERVER = ... | # -*- coding: utf-8 -*-
'''
Redis
=====
Redis plugin for the Salt caching subsystem.
.. versionadded:: 2017.7.0
As Redis provides a simple mechanism for very fast key-value store, in order to
privde the necessary features for the Salt caching subsystem, the following
conventions are used:
- A Redis key consists of ... |
saltstack/salt | salt/cache/redis_cache.py | list_ | python | def list_(bank):
'''
Lists entries stored in the specified bank.
'''
redis_server = _get_redis_server()
bank_redis_key = _get_bank_redis_key(bank)
try:
banks = redis_server.smembers(bank_redis_key)
except (RedisConnectionError, RedisResponseError) as rerr:
mesg = 'Cannot list... | Lists entries stored in the specified bank. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/redis_cache.py#L474-L489 | [
"def _get_redis_server(opts=None):\n '''\n Return the Redis server instance.\n Caching the object instance.\n '''\n global REDIS_SERVER\n if REDIS_SERVER:\n return REDIS_SERVER\n if not opts:\n opts = _get_redis_cache_opts()\n\n if opts['cluster_mode']:\n REDIS_SERVER = ... | # -*- coding: utf-8 -*-
'''
Redis
=====
Redis plugin for the Salt caching subsystem.
.. versionadded:: 2017.7.0
As Redis provides a simple mechanism for very fast key-value store, in order to
privde the necessary features for the Salt caching subsystem, the following
conventions are used:
- A Redis key consists of ... |
saltstack/salt | salt/cache/redis_cache.py | contains | python | def contains(bank, key):
'''
Checks if the specified bank contains the specified key.
'''
redis_server = _get_redis_server()
bank_redis_key = _get_bank_redis_key(bank)
try:
return redis_server.sismember(bank_redis_key, key)
except (RedisConnectionError, RedisResponseError) as rerr:
... | Checks if the specified bank contains the specified key. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cache/redis_cache.py#L492-L504 | [
"def _get_redis_server(opts=None):\n '''\n Return the Redis server instance.\n Caching the object instance.\n '''\n global REDIS_SERVER\n if REDIS_SERVER:\n return REDIS_SERVER\n if not opts:\n opts = _get_redis_cache_opts()\n\n if opts['cluster_mode']:\n REDIS_SERVER = ... | # -*- coding: utf-8 -*-
'''
Redis
=====
Redis plugin for the Salt caching subsystem.
.. versionadded:: 2017.7.0
As Redis provides a simple mechanism for very fast key-value store, in order to
privde the necessary features for the Salt caching subsystem, the following
conventions are used:
- A Redis key consists of ... |
saltstack/salt | salt/modules/boto_vpc.py | check_vpc | python | def check_vpc(vpc_id=None, vpc_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Check whether a VPC with the given name or id exists.
Returns the vpc_id or None. Raises SaltInvocationError if
both vpc_id and vpc_name are None. Optionally raise a
CommandExecutionError if... | Check whether a VPC with the given name or id exists.
Returns the vpc_id or None. Raises SaltInvocationError if
both vpc_id and vpc_name are None. Optionally raise a
CommandExecutionError if the VPC does not exist.
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt mym... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L201-L228 | null | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | _create_resource | python | def _create_resource(resource, name=None, tags=None, region=None, key=None,
keyid=None, profile=None, **kwargs):
'''
Create a VPC resource. Returns the resource id if created, or False
if not created.
'''
try:
try:
conn = _get_conn(region=region, key=key, ke... | Create a VPC resource. Returns the resource id if created, or False
if not created. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L231-L278 | [
"def _get_resource_id(resource, name, region=None, key=None,\n keyid=None, profile=None):\n '''\n Get an AWS id for a VPC resource by type and name.\n '''\n\n _id = _cache_id(name, sub_resource=resource,\n region=region, key=key,\n keyid=keyid, p... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | _delete_resource | python | def _delete_resource(resource, name=None, resource_id=None, region=None,
key=None, keyid=None, profile=None, **kwargs):
'''
Delete a VPC resource. Returns True if successful, otherwise False.
'''
if not _exactly_one((name, resource_id)):
raise SaltInvocationError('One (but ... | Delete a VPC resource. Returns True if successful, otherwise False. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L281-L322 | null | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | _get_resource | python | def _get_resource(resource, name=None, resource_id=None, region=None,
key=None, keyid=None, profile=None):
'''
Get a VPC resource based on resource type and name or id.
Cache the id if name was provided.
'''
if not _exactly_one((name, resource_id)):
raise SaltInvocationErr... | Get a VPC resource based on resource type and name or id.
Cache the id if name was provided. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L325-L370 | null | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | _find_resources | python | def _find_resources(resource, name=None, resource_id=None, tags=None,
region=None, key=None, keyid=None, profile=None):
'''
Get VPC resources based on resource type and name, id, or tags.
'''
if all((resource_id, name)):
raise SaltInvocationError('Only one of name or id may ... | Get VPC resources based on resource type and name, id, or tags. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L373-L409 | null | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | _get_resource_id | python | def _get_resource_id(resource, name, region=None, key=None,
keyid=None, profile=None):
'''
Get an AWS id for a VPC resource by type and name.
'''
_id = _cache_id(name, sub_resource=resource,
region=region, key=key,
keyid=keyid, profile=profil... | Get an AWS id for a VPC resource by type and name. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L412-L428 | [
"def _get_resource(resource, name=None, resource_id=None, region=None,\n key=None, keyid=None, profile=None):\n '''\n Get a VPC resource based on resource type and name or id.\n Cache the id if name was provided.\n '''\n\n if not _exactly_one((name, resource_id)):\n raise Salt... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | get_resource_id | python | def get_resource_id(resource, name=None, resource_id=None, region=None,
key=None, keyid=None, profile=None):
'''
Get an AWS id for a VPC resource by type and name.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.get_resource_id inte... | Get an AWS id for a VPC resource by type and name.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.get_resource_id internet_gateway myigw | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L431-L450 | [
"def _get_resource_id(resource, name, region=None, key=None,\n keyid=None, profile=None):\n '''\n Get an AWS id for a VPC resource by type and name.\n '''\n\n _id = _cache_id(name, sub_resource=resource,\n region=region, key=key,\n keyid=keyid, p... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | resource_exists | python | def resource_exists(resource, name=None, resource_id=None, tags=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a resource type and name, return {exists: true} if it exists,
{exists: false} if it does not exist, or {error: {message: error text}
on error.
.. ver... | Given a resource type and name, return {exists: true} if it exists,
{exists: false} if it does not exist, or {error: {message: error text}
on error.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.resource_exists internet_gateway myigw | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L453-L477 | [
"def _find_resources(resource, name=None, resource_id=None, tags=None,\n region=None, key=None, keyid=None, profile=None):\n '''\n Get VPC resources based on resource type and name, id, or tags.\n '''\n\n if all((resource_id, name)):\n raise SaltInvocationError('Only one of nam... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | _get_id | python | def _get_id(vpc_name=None, cidr=None, tags=None, region=None, key=None,
keyid=None, profile=None):
'''
Given VPC properties, return the VPC id if a match is found.
'''
if vpc_name and not any((cidr, tags)):
vpc_id = _cache_id(vpc_name, region=region,
key=k... | Given VPC properties, return the VPC id if a match is found. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L521-L549 | [
"def _find_vpcs(vpc_id=None, vpc_name=None, cidr=None, tags=None,\n region=None, key=None, keyid=None, profile=None):\n\n '''\n Given VPC properties, find and return matching VPC ids.\n '''\n\n if all((vpc_id, vpc_name)):\n raise SaltInvocationError('Only one of vpc_name or vpc_id m... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | get_id | python | def get_id(name=None, cidr=None, tags=None, region=None, key=None, keyid=None,
profile=None):
'''
Given VPC properties, return the VPC id if a match is found.
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.get_id myvpc
'''
try:
return {'id': _get_id(vpc_... | Given VPC properties, return the VPC id if a match is found.
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.get_id myvpc | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L552-L569 | [
"def _get_id(vpc_name=None, cidr=None, tags=None, region=None, key=None,\n keyid=None, profile=None):\n '''\n Given VPC properties, return the VPC id if a match is found.\n '''\n\n if vpc_name and not any((cidr, tags)):\n vpc_id = _cache_id(vpc_name, region=region,\n ... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | exists | python | def exists(vpc_id=None, name=None, cidr=None, tags=None, region=None, key=None,
keyid=None, profile=None):
'''
Given a VPC ID, check to see if the given VPC ID exists.
Returns True if the given VPC ID exists and returns False if the given
VPC ID does not exist.
CLI Example:
.. code... | Given a VPC ID, check to see if the given VPC ID exists.
Returns True if the given VPC ID exists and returns False if the given
VPC ID does not exist.
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.exists myvpc | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L572-L598 | [
"def _find_vpcs(vpc_id=None, vpc_name=None, cidr=None, tags=None,\n region=None, key=None, keyid=None, profile=None):\n\n '''\n Given VPC properties, find and return matching VPC ids.\n '''\n\n if all((vpc_id, vpc_name)):\n raise SaltInvocationError('Only one of vpc_name or vpc_id m... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | create | python | def create(cidr_block, instance_tenancy=None, vpc_name=None,
enable_dns_support=None, enable_dns_hostnames=None, tags=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid CIDR block, create a VPC.
An optional instance_tenancy argument can be provided. If provided,... | Given a valid CIDR block, create a VPC.
An optional instance_tenancy argument can be provided. If provided, the
valid values are 'default' or 'dedicated'
An optional vpc_name argument can be provided.
Returns {created: true} if the VPC was created and returns
{created: False} if the VPC was not c... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L601-L642 | [
"def _maybe_set_name_tag(name, obj):\n if name:\n obj.add_tag(\"Name\", name)\n log.debug('%s is now named as %s', obj, name)\n",
"def _maybe_set_tags(tags, obj):\n if tags:\n # Not all objects in Boto have an 'add_tags()' method.\n try:\n obj.add_tags(tags)\n\n ... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | delete | python | def delete(vpc_id=None, name=None, vpc_name=None, tags=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a VPC ID or VPC name, delete the VPC.
Returns {deleted: true} if the VPC was deleted and returns
{deleted: false} if the VPC was not deleted.
CLI Example:
.. cod... | Given a VPC ID or VPC name, delete the VPC.
Returns {deleted: true} if the VPC was deleted and returns
{deleted: false} if the VPC was not deleted.
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.delete vpc_id='vpc-6b1fe402'
salt myminion boto_vpc.delete name='myvpc' | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L645-L692 | null | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | describe | python | def describe(vpc_id=None, vpc_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Given a VPC ID describe its properties.
Returns a dictionary of interesting properties.
.. versionchanged:: 2015.8.0
Added vpc_name argument
CLI Example:
.. code-block:: bash
... | Given a VPC ID describe its properties.
Returns a dictionary of interesting properties.
.. versionchanged:: 2015.8.0
Added vpc_name argument
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.describe vpc_id=vpc-123456
salt myminion boto_vpc.describe vpc_name=myvpc | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L695-L747 | [
"def check_vpc(vpc_id=None, vpc_name=None, region=None, key=None,\n keyid=None, profile=None):\n '''\n Check whether a VPC with the given name or id exists.\n Returns the vpc_id or None. Raises SaltInvocationError if\n both vpc_id and vpc_name are None. Optionally raise a\n CommandExecut... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | describe_vpcs | python | def describe_vpcs(vpc_id=None, name=None, cidr=None, tags=None,
region=None, key=None, keyid=None, profile=None):
'''
Describe all VPCs, matching the filter criteria if provided.
Returns a list of dictionaries with interesting properties.
.. versionadded:: 2015.8.0
CLI Example:
... | Describe all VPCs, matching the filter criteria if provided.
Returns a list of dictionaries with interesting properties.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.describe_vpcs | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L750-L805 | [
"def iteritems(d, **kw):\n return d.iteritems(**kw)\n"
] | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | _find_subnets | python | def _find_subnets(subnet_name=None, vpc_id=None, cidr=None, tags=None, conn=None):
'''
Given subnet properties, find and return matching subnet ids
'''
if not any([subnet_name, tags, cidr]):
raise SaltInvocationError('At least one of the following must be '
'sp... | Given subnet properties, find and return matching subnet ids | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L808-L839 | null | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | create_subnet | python | def create_subnet(vpc_id=None, cidr_block=None, vpc_name=None,
availability_zone=None, subnet_name=None, tags=None,
region=None, key=None, keyid=None, profile=None, auto_assign_public_ipv4=False):
'''
Given a valid VPC ID or Name and a CIDR block, create a subnet for the VPC.... | Given a valid VPC ID or Name and a CIDR block, create a subnet for the VPC.
An optional availability zone argument can be provided.
Returns True if the VPC subnet was created and returns False if the VPC subnet was not created.
.. versionchanged:: 2015.8.0
Added vpc_name argument
CLI Example... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L842-L880 | [
"def _create_resource(resource, name=None, tags=None, region=None, key=None,\n keyid=None, profile=None, **kwargs):\n '''\n Create a VPC resource. Returns the resource id if created, or False\n if not created.\n '''\n\n try:\n try:\n conn = _get_conn(region=regio... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | delete_subnet | python | def delete_subnet(subnet_id=None, subnet_name=None, region=None, key=None,
keyid=None, profile=None):
'''
Given a subnet ID or name, delete the subnet.
Returns True if the subnet was deleted and returns False if the subnet was not deleted.
.. versionchanged:: 2015.8.0
Added s... | Given a subnet ID or name, delete the subnet.
Returns True if the subnet was deleted and returns False if the subnet was not deleted.
.. versionchanged:: 2015.8.0
Added subnet_name argument
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.delete_subnet 'subnet-6a1fe403' | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L883-L903 | [
"def _delete_resource(resource, name=None, resource_id=None, region=None,\n key=None, keyid=None, profile=None, **kwargs):\n '''\n Delete a VPC resource. Returns True if successful, otherwise False.\n '''\n\n if not _exactly_one((name, resource_id)):\n raise SaltInvocationErro... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | subnet_exists | python | def subnet_exists(subnet_id=None, name=None, subnet_name=None, cidr=None,
tags=None, zones=None, region=None, key=None, keyid=None,
profile=None):
'''
Check if a subnet exists.
Returns True if the subnet exists, otherwise returns False.
.. versionchanged:: 2015.8.0
... | Check if a subnet exists.
Returns True if the subnet exists, otherwise returns False.
.. versionchanged:: 2015.8.0
Added subnet_name argument
Deprecated name argument
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.subnet_exists subnet_id='subnet-6a1fe403' | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L906-L969 | null | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | get_subnet_association | python | def get_subnet_association(subnets, region=None, key=None, keyid=None,
profile=None):
'''
Given a subnet (aka: a vpc zone identifier) or list of subnets, returns
vpc association.
Returns a VPC ID if the given subnets are associated with the same VPC ID.
Returns False on a... | Given a subnet (aka: a vpc zone identifier) or list of subnets, returns
vpc association.
Returns a VPC ID if the given subnets are associated with the same VPC ID.
Returns False on an error or if the given subnets are associated with
different VPC IDs.
CLI Examples:
.. code-block:: bash
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L972-L1015 | null | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | describe_subnet | python | def describe_subnet(subnet_id=None, subnet_name=None, region=None,
key=None, keyid=None, profile=None):
'''
Given a subnet id or name, describe its properties.
Returns a dictionary of interesting properties.
.. versionadded:: 2015.8.0
CLI Examples:
.. code-block:: bash
... | Given a subnet id or name, describe its properties.
Returns a dictionary of interesting properties.
.. versionadded:: 2015.8.0
CLI Examples:
.. code-block:: bash
salt myminion boto_vpc.describe_subnet subnet_id=subnet-123456
salt myminion boto_vpc.describe_subnet subnet_name=mysubne... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L1018-L1053 | [
"def _get_resource(resource, name=None, resource_id=None, region=None,\n key=None, keyid=None, profile=None):\n '''\n Get a VPC resource based on resource type and name or id.\n Cache the id if name was provided.\n '''\n\n if not _exactly_one((name, resource_id)):\n raise Salt... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | describe_subnets | python | def describe_subnets(subnet_ids=None, subnet_names=None, vpc_id=None, cidr=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a VPC ID or subnet CIDR, returns a list of associated subnets and
their details. Return all subnets if VPC ID or CIDR are not provided.
If a s... | Given a VPC ID or subnet CIDR, returns a list of associated subnets and
their details. Return all subnets if VPC ID or CIDR are not provided.
If a subnet id or CIDR is provided, only its associated subnet details will be
returned.
.. versionadded:: 2015.8.0
CLI Examples:
.. code-block:: bash
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L1056-L1120 | [
"def _get_subnet_explicit_route_table(subnet_id, vpc_id, conn=None, region=None, key=None, keyid=None, profile=None):\n '''\n helper function to find subnet explicit route table associations\n\n .. versionadded:: 2016.11.0\n '''\n if not conn:\n conn = _get_conn(region=region, key=key, keyid=k... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | create_internet_gateway | python | def create_internet_gateway(internet_gateway_name=None, vpc_id=None,
vpc_name=None, tags=None, region=None, key=None,
keyid=None, profile=None):
'''
Create an Internet Gateway, optionally attaching it to an existing VPC.
Returns the internet gateway i... | Create an Internet Gateway, optionally attaching it to an existing VPC.
Returns the internet gateway id if the internet gateway was created and
returns False if the internet gateways was not created.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.cre... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L1123-L1162 | [
"def _create_resource(resource, name=None, tags=None, region=None, key=None,\n keyid=None, profile=None, **kwargs):\n '''\n Create a VPC resource. Returns the resource id if created, or False\n if not created.\n '''\n\n try:\n try:\n conn = _get_conn(region=regio... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | delete_internet_gateway | python | def delete_internet_gateway(internet_gateway_id=None,
internet_gateway_name=None,
detach=False, region=None,
key=None, keyid=None, profile=None):
'''
Delete an internet gateway (by name or id).
Returns True if the internet ... | Delete an internet gateway (by name or id).
Returns True if the internet gateway was deleted and otherwise False.
.. versionadded:: 2015.8.0
CLI Examples:
.. code-block:: bash
salt myminion boto_vpc.delete_internet_gateway internet_gateway_id=igw-1a2b3c
salt myminion boto_vpc.delete... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L1165-L1216 | [
"def _delete_resource(resource, name=None, resource_id=None, region=None,\n key=None, keyid=None, profile=None, **kwargs):\n '''\n Delete a VPC resource. Returns True if successful, otherwise False.\n '''\n\n if not _exactly_one((name, resource_id)):\n raise SaltInvocationErro... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | _find_nat_gateways | python | def _find_nat_gateways(nat_gateway_id=None, subnet_id=None, subnet_name=None, vpc_id=None, vpc_name=None,
states=('pending', 'available'),
region=None, key=None, keyid=None, profile=None):
'''
Given gateway properties, find and return matching nat gateways
'''
... | Given gateway properties, find and return matching nat gateways | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L1219-L1269 | null | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | nat_gateway_exists | python | def nat_gateway_exists(nat_gateway_id=None, subnet_id=None, subnet_name=None,
vpc_id=None, vpc_name=None,
states=('pending', 'available'),
region=None, key=None, keyid=None, profile=None):
'''
Checks if a nat gateway exists.
This function... | Checks if a nat gateway exists.
This function requires boto3 to be installed.
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.nat_gateway_exists nat_gateway_id='nat-03b02643b43216fe7'
salt myminion boto_vpc.nat_gateway_exists subnet_id='subnet-5b... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L1272-L1299 | [
"def _find_nat_gateways(nat_gateway_id=None, subnet_id=None, subnet_name=None, vpc_id=None, vpc_name=None,\n states=('pending', 'available'),\n region=None, key=None, keyid=None, profile=None):\n '''\n Given gateway properties, find and return matching nat gateways\... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | describe_nat_gateways | python | def describe_nat_gateways(nat_gateway_id=None, subnet_id=None, subnet_name=None,
vpc_id=None, vpc_name=None,
states=('pending', 'available'),
region=None, key=None, keyid=None, profile=None):
'''
Return a description of nat gateways matching t... | Return a description of nat gateways matching the selection criteria
This function requires boto3 to be installed.
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.describe_nat_gateways nat_gateway_id='nat-03b02643b43216fe7'
salt myminion boto_vpc.describe_nat_gateways subnet_id=... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L1302-L1327 | [
"def _find_nat_gateways(nat_gateway_id=None, subnet_id=None, subnet_name=None, vpc_id=None, vpc_name=None,\n states=('pending', 'available'),\n region=None, key=None, keyid=None, profile=None):\n '''\n Given gateway properties, find and return matching nat gateways\... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | create_nat_gateway | python | def create_nat_gateway(subnet_id=None,
subnet_name=None, allocation_id=None,
region=None, key=None, keyid=None, profile=None):
'''
Create a NAT Gateway within an existing subnet. If allocation_id is
specified, the elastic IP address it references is associated w... | Create a NAT Gateway within an existing subnet. If allocation_id is
specified, the elastic IP address it references is associated with the
gateway. Otherwise, a new allocation_id is created and used.
This function requires boto3 to be installed.
Returns the nat gateway id if the nat gateway was create... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L1330-L1380 | null | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | delete_nat_gateway | python | def delete_nat_gateway(nat_gateway_id,
release_eips=False, region=None,
key=None, keyid=None, profile=None,
wait_for_delete=False, wait_for_delete_retries=5):
'''
Delete a nat gateway (by id).
Returns True if the internet gateway was dele... | Delete a nat gateway (by id).
Returns True if the internet gateway was deleted and otherwise False.
This function requires boto3 to be installed.
.. versionadded:: 2016.11.0
nat_gateway_id
Id of the NAT Gateway
releaes_eips
whether to release the elastic IPs associated with the ... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L1383-L1456 | null | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | create_customer_gateway | python | def create_customer_gateway(vpn_connection_type, ip_address, bgp_asn,
customer_gateway_name=None, tags=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a valid VPN connection type, a static IP address and a customer
gatewayβs Border Ga... | Given a valid VPN connection type, a static IP address and a customer
gatewayβs Border Gateway Protocol (BGP) Autonomous System Number,
create a customer gateway.
Returns the customer gateway id if the customer gateway was created and
returns False if the customer gateway was not created.
CLI Exam... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L1459-L1482 | [
"def _create_resource(resource, name=None, tags=None, region=None, key=None,\n keyid=None, profile=None, **kwargs):\n '''\n Create a VPC resource. Returns the resource id if created, or False\n if not created.\n '''\n\n try:\n try:\n conn = _get_conn(region=regio... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | delete_customer_gateway | python | def delete_customer_gateway(customer_gateway_id=None, customer_gateway_name=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a customer gateway ID or name, delete the customer gateway.
Returns True if the customer gateway was deleted and returns False if the cus... | Given a customer gateway ID or name, delete the customer gateway.
Returns True if the customer gateway was deleted and returns False if the customer gateway was not deleted.
.. versionchanged:: 2015.8.0
Added customer_gateway_name argument
CLI Example:
.. code-block:: bash
salt mymi... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L1485-L1507 | [
"def _delete_resource(resource, name=None, resource_id=None, region=None,\n key=None, keyid=None, profile=None, **kwargs):\n '''\n Delete a VPC resource. Returns True if successful, otherwise False.\n '''\n\n if not _exactly_one((name, resource_id)):\n raise SaltInvocationErro... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | customer_gateway_exists | python | def customer_gateway_exists(customer_gateway_id=None, customer_gateway_name=None,
region=None, key=None, keyid=None, profile=None):
'''
Given a customer gateway ID, check if the customer gateway ID exists.
Returns True if the customer gateway ID exists; Returns False otherwise.
... | Given a customer gateway ID, check if the customer gateway ID exists.
Returns True if the customer gateway ID exists; Returns False otherwise.
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.customer_gateway_exists cgw-b6a247df
salt myminion boto_vpc.customer_gateway_exists cust... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L1510-L1528 | [
"def resource_exists(resource, name=None, resource_id=None, tags=None,\n region=None, key=None, keyid=None, profile=None):\n '''\n Given a resource type and name, return {exists: true} if it exists,\n {exists: false} if it does not exist, or {error: {message: error text}\n on error.\n... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | create_dhcp_options | python | def create_dhcp_options(domain_name=None, domain_name_servers=None, ntp_servers=None,
netbios_name_servers=None, netbios_node_type=None,
dhcp_options_name=None, tags=None, vpc_id=None, vpc_name=None,
region=None, key=None, keyid=None, profile=None)... | Given valid DHCP options, create a DHCP options record, optionally associating it with
an existing VPC.
Returns True if the DHCP options record was created and returns False if the DHCP options record was not deleted.
.. versionchanged:: 2015.8.0
Added vpc_name and vpc_id arguments
CLI Exampl... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L1531-L1577 | [
"def _create_resource(resource, name=None, tags=None, region=None, key=None,\n keyid=None, profile=None, **kwargs):\n '''\n Create a VPC resource. Returns the resource id if created, or False\n if not created.\n '''\n\n try:\n try:\n conn = _get_conn(region=regio... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | get_dhcp_options | python | def get_dhcp_options(dhcp_options_name=None, dhcp_options_id=None,
region=None, key=None, keyid=None, profile=None):
'''
Return a dict with the current values of the requested DHCP options set
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.get_dhcp_options 'myfu... | Return a dict with the current values of the requested DHCP options set
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.get_dhcp_options 'myfunnydhcpoptionsname'
.. versionadded:: 2016.3.0 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L1580-L1616 | null | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
saltstack/salt | salt/modules/boto_vpc.py | delete_dhcp_options | python | def delete_dhcp_options(dhcp_options_id=None, dhcp_options_name=None,
region=None, key=None, keyid=None, profile=None):
'''
Delete dhcp options by id or name.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.delete_dhcp_options '... | Delete dhcp options by id or name.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt myminion boto_vpc.delete_dhcp_options 'dopt-b6a247df' | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_vpc.py#L1619-L1638 | [
"def _delete_resource(resource, name=None, resource_id=None, region=None,\n key=None, keyid=None, profile=None, **kwargs):\n '''\n Delete a VPC resource. Returns True if successful, otherwise False.\n '''\n\n if not _exactly_one((name, resource_id)):\n raise SaltInvocationErro... | # -*- coding: utf-8 -*-
'''
Connection module for Amazon VPC
.. versionadded:: 2014.7.0
:depends:
- boto >= 2.8.0
- boto3 >= 1.2.6
:configuration: This module accepts explicit VPC credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles.
Dynamic credentials are then auto... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.