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/transport/zeromq.py | ZeroMQReqServerChannel.zmq_device | python | def zmq_device(self):
'''
Multiprocessing target for the zmq queue device
'''
self.__setup_signals()
salt.utils.process.appendproctitle('MWorkerQueue')
self.context = zmq.Context(self.opts['worker_threads'])
# Prepare the zeromq sockets
self.uri = 'tcp://{... | Multiprocessing target for the zmq queue device | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L582-L622 | [
"def appendproctitle(name):\n '''\n Append \"name\" to the current process title\n '''\n if HAS_SETPROCTITLE:\n setproctitle.setproctitle(setproctitle.getproctitle() + ' ' + name)\n",
"def _start_zmq_monitor(self):\n '''\n Starts ZMQ monitor for debugging purposes.\n :return:\n '''\... | class ZeroMQReqServerChannel(salt.transport.mixins.auth.AESReqServerMixin,
salt.transport.server.ReqServerChannel):
def __init__(self, opts):
salt.transport.server.ReqServerChannel.__init__(self, opts)
self._closing = False
def close(self):
'''
Cle... |
saltstack/salt | salt/transport/zeromq.py | ZeroMQReqServerChannel.close | python | def close(self):
'''
Cleanly shutdown the router socket
'''
if self._closing:
return
log.info('MWorkerQueue under PID %s is closing', os.getpid())
self._closing = True
# pylint: disable=E0203
if getattr(self, '_monitor', None) is not None:
... | Cleanly shutdown the router socket | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L624-L648 | null | class ZeroMQReqServerChannel(salt.transport.mixins.auth.AESReqServerMixin,
salt.transport.server.ReqServerChannel):
def __init__(self, opts):
salt.transport.server.ReqServerChannel.__init__(self, opts)
self._closing = False
def zmq_device(self):
'''
... |
saltstack/salt | salt/transport/zeromq.py | ZeroMQReqServerChannel.pre_fork | python | def pre_fork(self, process_manager):
'''
Pre-fork we need to create the zmq router device
:param func process_manager: An instance of salt.utils.process.ProcessManager
'''
salt.transport.mixins.auth.AESReqServerMixin.pre_fork(self, process_manager)
process_manager.add_pr... | Pre-fork we need to create the zmq router device
:param func process_manager: An instance of salt.utils.process.ProcessManager | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L651-L658 | [
"def pre_fork(self, _):\n '''\n Pre-fork we need to create the zmq router device\n '''\n if 'aes' not in salt.master.SMaster.secrets:\n # TODO: This is still needed only for the unit tests\n # 'tcp_test.py' and 'zeromq_test.py'. Fix that. In normal\n # cases, 'aes' is already set in... | class ZeroMQReqServerChannel(salt.transport.mixins.auth.AESReqServerMixin,
salt.transport.server.ReqServerChannel):
def __init__(self, opts):
salt.transport.server.ReqServerChannel.__init__(self, opts)
self._closing = False
def zmq_device(self):
'''
... |
saltstack/salt | salt/transport/zeromq.py | ZeroMQReqServerChannel._start_zmq_monitor | python | def _start_zmq_monitor(self):
'''
Starts ZMQ monitor for debugging purposes.
:return:
'''
# Socket monitor shall be used the only for debug
# purposes so using threading doesn't look too bad here
if HAS_ZMQ_MONITOR and self.opts['zmq_monitor']:
log.de... | Starts ZMQ monitor for debugging purposes.
:return: | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L660-L673 | null | class ZeroMQReqServerChannel(salt.transport.mixins.auth.AESReqServerMixin,
salt.transport.server.ReqServerChannel):
def __init__(self, opts):
salt.transport.server.ReqServerChannel.__init__(self, opts)
self._closing = False
def zmq_device(self):
'''
... |
saltstack/salt | salt/transport/zeromq.py | ZeroMQReqServerChannel.post_fork | python | def post_fork(self, payload_handler, io_loop):
'''
After forking we need to create all of the local sockets to listen to the
router
:param func payload_handler: A function to called to handle incoming payloads as
they are picked up off the wire
... | After forking we need to create all of the local sockets to listen to the
router
:param func payload_handler: A function to called to handle incoming payloads as
they are picked up off the wire
:param IOLoop io_loop: An instance of a Tornado IOLoop, to handl... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L675-L705 | [
"def _start_zmq_monitor(self):\n '''\n Starts ZMQ monitor for debugging purposes.\n :return:\n '''\n # Socket monitor shall be used the only for debug\n # purposes so using threading doesn't look too bad here\n\n if HAS_ZMQ_MONITOR and self.opts['zmq_monitor']:\n log.debug('Starting ZMQ ... | class ZeroMQReqServerChannel(salt.transport.mixins.auth.AESReqServerMixin,
salt.transport.server.ReqServerChannel):
def __init__(self, opts):
salt.transport.server.ReqServerChannel.__init__(self, opts)
self._closing = False
def zmq_device(self):
'''
... |
saltstack/salt | salt/transport/zeromq.py | ZeroMQReqServerChannel.handle_message | python | def handle_message(self, stream, payload):
'''
Handle incoming messages from underlying TCP streams
:stream ZMQStream stream: A ZeroMQ stream.
See http://zeromq.github.io/pyzmq/api/generated/zmq.eventloop.zmqstream.html
:param dict payload: A payload to process
'''
... | Handle incoming messages from underlying TCP streams
:stream ZMQStream stream: A ZeroMQ stream.
See http://zeromq.github.io/pyzmq/api/generated/zmq.eventloop.zmqstream.html
:param dict payload: A payload to process | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L708-L782 | [
"def _decode_payload(self, payload):\n # we need to decrypt it\n if payload['enc'] == 'aes':\n try:\n payload['load'] = self.crypticle.loads(payload['load'])\n except salt.crypt.AuthenticationError:\n if not self._update_aes():\n raise\n payload['l... | class ZeroMQReqServerChannel(salt.transport.mixins.auth.AESReqServerMixin,
salt.transport.server.ReqServerChannel):
def __init__(self, opts):
salt.transport.server.ReqServerChannel.__init__(self, opts)
self._closing = False
def zmq_device(self):
'''
... |
saltstack/salt | salt/transport/zeromq.py | ZeroMQPubServerChannel._publish_daemon | python | def _publish_daemon(self, log_queue=None):
'''
Bind to the interface specified in the configuration file
'''
salt.utils.process.appendproctitle(self.__class__.__name__)
if log_queue:
salt.log.setup.set_multiprocessing_logging_queue(log_queue)
salt.log.setu... | Bind to the interface specified in the configuration file | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L847-L955 | null | class ZeroMQPubServerChannel(salt.transport.server.PubServerChannel):
'''
Encapsulate synchronous operations for a publisher channel
'''
_sock_data = threading.local()
def __init__(self, opts):
self.opts = opts
self.serial = salt.payload.Serial(self.opts) # TODO: in init?
... |
saltstack/salt | salt/transport/zeromq.py | ZeroMQPubServerChannel.pub_connect | python | def pub_connect(self):
'''
Create and connect this thread's zmq socket. If a publisher socket
already exists "pub_close" is called before creating and connecting a
new socket.
'''
if self.pub_sock:
self.pub_close()
ctx = zmq.Context.instance()
... | Create and connect this thread's zmq socket. If a publisher socket
already exists "pub_close" is called before creating and connecting a
new socket. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L979-L1000 | [
"def pub_close(self):\n '''\n Disconnect an existing publisher socket and remove it from the local\n thread's cache.\n '''\n if hasattr(self._sock_data, 'sock'):\n self._sock_data.sock.close()\n delattr(self._sock_data, 'sock')\n"
] | class ZeroMQPubServerChannel(salt.transport.server.PubServerChannel):
'''
Encapsulate synchronous operations for a publisher channel
'''
_sock_data = threading.local()
def __init__(self, opts):
self.opts = opts
self.serial = salt.payload.Serial(self.opts) # TODO: in init?
... |
saltstack/salt | salt/transport/zeromq.py | ZeroMQPubServerChannel.pub_close | python | def pub_close(self):
'''
Disconnect an existing publisher socket and remove it from the local
thread's cache.
'''
if hasattr(self._sock_data, 'sock'):
self._sock_data.sock.close()
delattr(self._sock_data, 'sock') | Disconnect an existing publisher socket and remove it from the local
thread's cache. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L1002-L1009 | null | class ZeroMQPubServerChannel(salt.transport.server.PubServerChannel):
'''
Encapsulate synchronous operations for a publisher channel
'''
_sock_data = threading.local()
def __init__(self, opts):
self.opts = opts
self.serial = salt.payload.Serial(self.opts) # TODO: in init?
... |
saltstack/salt | salt/transport/zeromq.py | ZeroMQPubServerChannel.publish | python | def publish(self, load):
'''
Publish "load" to minions. This send the load to the publisher daemon
process with does the actual sending to minions.
:param dict load: A load to be sent across the wire to minions
'''
payload = {'enc': 'aes'}
crypticle = salt.crypt.... | Publish "load" to minions. This send the load to the publisher daemon
process with does the actual sending to minions.
:param dict load: A load to be sent across the wire to minions | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L1011-L1050 | [
"def sign_message(privkey_path, message, passphrase=None):\n '''\n Use Crypto.Signature.PKCS1_v1_5 to sign a message. Returns the signature.\n '''\n key = get_rsa_key(privkey_path, passphrase)\n log.debug('salt.crypt.sign_message: Signing message.')\n if HAS_M2:\n md = EVP.MessageDigest('sh... | class ZeroMQPubServerChannel(salt.transport.server.PubServerChannel):
'''
Encapsulate synchronous operations for a publisher channel
'''
_sock_data = threading.local()
def __init__(self, opts):
self.opts = opts
self.serial = salt.payload.Serial(self.opts) # TODO: in init?
... |
saltstack/salt | salt/transport/zeromq.py | AsyncReqMessageClient.timeout_message | python | def timeout_message(self, message):
'''
Handle a message timeout by removing it from the sending queue
and informing the caller
:raises: SaltReqTimeoutError
'''
future = self.send_future_map.pop(message, None)
# In a race condition the message might have been sen... | Handle a message timeout by removing it from the sending queue
and informing the caller
:raises: SaltReqTimeoutError | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L1230-L1253 | [
"def send(self, message, timeout=None, tries=3, future=None, callback=None, raw=False):\n '''\n Return a future which will be completed when the message has a response\n '''\n if future is None:\n future = tornado.concurrent.Future()\n future.tries = tries\n future.attempts = 0\n ... | class AsyncReqMessageClient(object):
'''
This class wraps the underlying zeromq REQ socket and gives a future-based
interface to sending and recieving messages. This works around the primary
limitation of serialized send/recv on the underlying socket by queueing the
message sends in this class. In t... |
saltstack/salt | salt/transport/zeromq.py | AsyncReqMessageClient.send | python | def send(self, message, timeout=None, tries=3, future=None, callback=None, raw=False):
'''
Return a future which will be completed when the message has a response
'''
if future is None:
future = tornado.concurrent.Future()
future.tries = tries
future.a... | Return a future which will be completed when the message has a response | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/transport/zeromq.py#L1255-L1286 | null | class AsyncReqMessageClient(object):
'''
This class wraps the underlying zeromq REQ socket and gives a future-based
interface to sending and recieving messages. This works around the primary
limitation of serialized send/recv on the underlying socket by queueing the
message sends in this class. In t... |
saltstack/salt | salt/modules/elasticsearch.py | _get_instance | python | def _get_instance(hosts=None, profile=None):
'''
Return the elasticsearch instance
'''
es = None
proxies = None
use_ssl = False
ca_certs = None
verify_certs = True
http_auth = None
timeout = 10
if profile is None:
profile = 'elasticsearch'
if isinstance(profile,... | Return the elasticsearch instance | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L81-L153 | null | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | ping | python | def ping(allow_failure=False, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Test connection to Elasticsearch instance. This method does not fail if not explicitly specified.
allow_failure
Throw exception if ping fails
CLI example::
salt myminion elasticsearch.ping all... | .. versionadded:: 2017.7.0
Test connection to Elasticsearch instance. This method does not fail if not explicitly specified.
allow_failure
Throw exception if ping fails
CLI example::
salt myminion elasticsearch.ping allow_failure=True
salt myminion elasticsearch.ping profile=elas... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L156-L176 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | info | python | def info(hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Return Elasticsearch information.
CLI example::
salt myminion elasticsearch.info
salt myminion elasticsearch.info profile=elasticsearch-extra
'''
es = _get_instance(hosts, profile)
try:
return es.i... | .. versionadded:: 2017.7.0
Return Elasticsearch information.
CLI example::
salt myminion elasticsearch.info
salt myminion elasticsearch.info profile=elasticsearch-extra | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L179-L195 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | node_info | python | def node_info(nodes=None, flat_settings=False, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Return Elasticsearch node information.
nodes
List of cluster nodes (id or name) to display stats for. Use _local for connected node, empty for all
flat_settings
Flatten settings... | .. versionadded:: 2017.7.0
Return Elasticsearch node information.
nodes
List of cluster nodes (id or name) to display stats for. Use _local for connected node, empty for all
flat_settings
Flatten settings keys
CLI example::
salt myminion elasticsearch.node_info flat_settings=... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L198-L218 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | cluster_health | python | def cluster_health(index=None, level='cluster', local=False, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Return Elasticsearch cluster health.
index
Limit the information returned to a specific index
level
Specify the level of detail for returned information, default '... | .. versionadded:: 2017.7.0
Return Elasticsearch cluster health.
index
Limit the information returned to a specific index
level
Specify the level of detail for returned information, default 'cluster', valid choices are: 'cluster', 'indices', 'shards'
local
Return local informati... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L221-L243 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | cluster_stats | python | def cluster_stats(nodes=None, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Return Elasticsearch cluster stats.
nodes
List of cluster nodes (id or name) to display stats for. Use _local for connected node, empty for all
CLI example::
salt myminion elasticsearch.cluste... | .. versionadded:: 2017.7.0
Return Elasticsearch cluster stats.
nodes
List of cluster nodes (id or name) to display stats for. Use _local for connected node, empty for all
CLI example::
salt myminion elasticsearch.cluster_stats | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L246-L264 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | alias_create | python | def alias_create(indices, alias, hosts=None, body=None, profile=None, source=None):
'''
Create an alias for a specific index/indices
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
alias
Alias name
body
Optional defini... | Create an alias for a specific index/indices
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
alias
Alias name
body
Optional definition such as routing or filter as defined in https://www.elastic.co/guide/en/elasticsearch/refer... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L267-L296 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | alias_delete | python | def alias_delete(indices, aliases, hosts=None, body=None, profile=None, source=None):
'''
Delete an alias of an index
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
aliases
Alias names separated by comma
CLI example::
... | Delete an alias of an index
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
aliases
Alias names separated by comma
CLI example::
salt myminion elasticsearch.alias_delete testindex_v1 testindex | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L299-L327 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | alias_exists | python | def alias_exists(aliases, indices=None, hosts=None, profile=None):
'''
Return a boolean indicating whether given alias exists
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
aliases
Alias names separated by comma
CLI example:... | Return a boolean indicating whether given alias exists
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
aliases
Alias names separated by comma
CLI example::
salt myminion elasticsearch.alias_exists None testindex | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L330-L349 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | alias_get | python | def alias_get(indices=None, aliases=None, hosts=None, profile=None):
'''
Check for the existence of an alias and if it exists, return it
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
aliases
Alias names separated by comma
C... | Check for the existence of an alias and if it exists, return it
indices
Single or multiple indices separated by comma, use _all to perform the operation on all indices.
aliases
Alias names separated by comma
CLI example::
salt myminion elasticsearch.alias_get testindex | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L352-L372 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | document_create | python | def document_create(index, doc_type, body=None, id=None, hosts=None, profile=None, source=None):
'''
Create a document in a specified index
index
Index name where the document should reside
doc_type
Type of the document
body
Document to store
source
URL of file s... | Create a document in a specified index
index
Index name where the document should reside
doc_type
Type of the document
body
Document to store
source
URL of file specifying document to store. Cannot be used in combination with ``body``.
id
Optional unique docu... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L375-L405 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | document_delete | python | def document_delete(index, doc_type, id, hosts=None, profile=None):
'''
Delete a document from an index
index
Index name where the document resides
doc_type
Type of the document
id
Document identifier
CLI example::
salt myminion elasticsearch.document_delete te... | Delete a document from an index
index
Index name where the document resides
doc_type
Type of the document
id
Document identifier
CLI example::
salt myminion elasticsearch.document_delete testindex doctype1 AUx-384m0Bug_8U80wQZ | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L408-L430 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | document_exists | python | def document_exists(index, id, doc_type='_all', hosts=None, profile=None):
'''
Return a boolean indicating whether given document exists
index
Index name where the document resides
id
Document identifier
doc_type
Type of the document, use _all to fetch the first document mat... | Return a boolean indicating whether given document exists
index
Index name where the document resides
id
Document identifier
doc_type
Type of the document, use _all to fetch the first document matching the ID across all types
CLI example::
salt myminion elasticsearch.d... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L433-L455 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | index_create | python | def index_create(index, body=None, hosts=None, profile=None, source=None):
'''
Create an index
index
Index name
body
Index definition, such as settings and mappings as defined in https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html
source
... | Create an index
index
Index name
body
Index definition, such as settings and mappings as defined in https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html
source
URL to file specifying index definition. Cannot be used in combination with ``body``.
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L483-L514 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | index_delete | python | def index_delete(index, hosts=None, profile=None):
'''
Delete an index
index
Index name
CLI example::
salt myminion elasticsearch.index_delete testindex
'''
es = _get_instance(hosts, profile)
try:
result = es.indices.delete(index=index)
return result.get(... | Delete an index
index
Index name
CLI example::
salt myminion elasticsearch.index_delete testindex | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L517-L537 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | index_exists | python | def index_exists(index, hosts=None, profile=None):
'''
Return a boolean indicating whether given index exists
index
Index name
CLI example::
salt myminion elasticsearch.index_exists testindex
'''
es = _get_instance(hosts, profile)
try:
return es.indices.exists(ind... | Return a boolean indicating whether given index exists
index
Index name
CLI example::
salt myminion elasticsearch.index_exists testindex | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L540-L558 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | index_get | python | def index_get(index, hosts=None, profile=None):
'''
Check for the existence of an index and if it exists, return it
index
Index name
CLI example::
salt myminion elasticsearch.index_get testindex
'''
es = _get_instance(hosts, profile)
try:
return es.indices.get(ind... | Check for the existence of an index and if it exists, return it
index
Index name
CLI example::
salt myminion elasticsearch.index_get testindex | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L561-L579 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | index_open | python | def index_open(index, allow_no_indices=True, expand_wildcards='closed', ignore_unavailable=True, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Open specified index.
index
Index to be opened
allow_no_indices
Whether to ignore if a wildcard indices expression resolves int... | .. versionadded:: 2017.7.0
Open specified index.
index
Index to be opened
allow_no_indices
Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
expand_wildcards
Whether to expand... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L582-L608 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | mapping_create | python | def mapping_create(index, doc_type, body=None, hosts=None, profile=None, source=None):
'''
Create a mapping in a given index
index
Index for the mapping
doc_type
Name of the document type
body
Mapping definition as specified in https://www.elastic.co/guide/en/elasticsearch/r... | Create a mapping in a given index
index
Index for the mapping
doc_type
Name of the document type
body
Mapping definition as specified in https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html
source
URL to file specifying mapping definit... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L640-L670 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | mapping_delete | python | def mapping_delete(index, doc_type, hosts=None, profile=None):
'''
Delete a mapping (type) along with its data. As of Elasticsearch 5.0 this is no longer available.
index
Index for the mapping
doc_type
Name of the document type
CLI example::
salt myminion elasticsearch.map... | Delete a mapping (type) along with its data. As of Elasticsearch 5.0 this is no longer available.
index
Index for the mapping
doc_type
Name of the document type
CLI example::
salt myminion elasticsearch.mapping_delete testindex user | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L673-L696 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | mapping_get | python | def mapping_get(index, doc_type, hosts=None, profile=None):
'''
Retrieve mapping definition of index or index/type
index
Index for the mapping
doc_type
Name of the document type
CLI example::
salt myminion elasticsearch.mapping_get testindex user
'''
es = _get_inst... | Retrieve mapping definition of index or index/type
index
Index for the mapping
doc_type
Name of the document type
CLI example::
salt myminion elasticsearch.mapping_get testindex user | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L699-L719 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | index_template_create | python | def index_template_create(name, body=None, hosts=None, profile=None, source=None):
'''
Create an index template
name
Index template name
body
Template definition as specified in http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html
source
UR... | Create an index template
name
Index template name
body
Template definition as specified in http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html
source
URL to file specifying template definition. Cannot be used in combination with ``body``.
CLI... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L722-L751 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | index_template_delete | python | def index_template_delete(name, hosts=None, profile=None):
'''
Delete an index template (type) along with its data
name
Index template name
CLI example::
salt myminion elasticsearch.index_template_delete testindex_templ user
'''
es = _get_instance(hosts, profile)
try:
... | Delete an index template (type) along with its data
name
Index template name
CLI example::
salt myminion elasticsearch.index_template_delete testindex_templ user | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L754-L773 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | index_template_exists | python | def index_template_exists(name, hosts=None, profile=None):
'''
Return a boolean indicating whether given index template exists
name
Index template name
CLI example::
salt myminion elasticsearch.index_template_exists testindex_templ
'''
es = _get_instance(hosts, profile)
tr... | Return a boolean indicating whether given index template exists
name
Index template name
CLI example::
salt myminion elasticsearch.index_template_exists testindex_templ | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L776-L791 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | index_template_get | python | def index_template_get(name, hosts=None, profile=None):
'''
Retrieve template definition of index or index/type
name
Index template name
CLI example::
salt myminion elasticsearch.index_template_get testindex_templ
'''
es = _get_instance(hosts, profile)
try:
return... | Retrieve template definition of index or index/type
name
Index template name
CLI example::
salt myminion elasticsearch.index_template_get testindex_templ | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L794-L812 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | pipeline_get | python | def pipeline_get(id, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Retrieve Ingest pipeline definition. Available since Elasticsearch 5.0.
id
Pipeline id
CLI example::
salt myminion elasticsearch.pipeline_get mypipeline
'''
es = _get_instance(hosts, profile)
... | .. versionadded:: 2017.7.0
Retrieve Ingest pipeline definition. Available since Elasticsearch 5.0.
id
Pipeline id
CLI example::
salt myminion elasticsearch.pipeline_get mypipeline | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L815-L837 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | pipeline_delete | python | def pipeline_delete(id, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Delete Ingest pipeline. Available since Elasticsearch 5.0.
id
Pipeline id
CLI example::
salt myminion elasticsearch.pipeline_delete mypipeline
'''
es = _get_instance(hosts, profile)
try... | .. versionadded:: 2017.7.0
Delete Ingest pipeline. Available since Elasticsearch 5.0.
id
Pipeline id
CLI example::
salt myminion elasticsearch.pipeline_delete mypipeline | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L840-L863 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | pipeline_create | python | def pipeline_create(id, body, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Create Ingest pipeline by supplied definition. Available since Elasticsearch 5.0.
id
Pipeline id
body
Pipeline definition as specified in https://www.elastic.co/guide/en/elasticsearch/reference/... | .. versionadded:: 2017.7.0
Create Ingest pipeline by supplied definition. Available since Elasticsearch 5.0.
id
Pipeline id
body
Pipeline definition as specified in https://www.elastic.co/guide/en/elasticsearch/reference/master/pipeline.html
CLI example::
salt myminion elasti... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L866-L888 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | pipeline_simulate | python | def pipeline_simulate(id, body, verbose=False, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Simulate existing Ingest pipeline on provided data. Available since Elasticsearch 5.0.
id
Pipeline id
body
Pipeline definition as specified in https://www.elastic.co/guide/en/el... | .. versionadded:: 2017.7.0
Simulate existing Ingest pipeline on provided data. Available since Elasticsearch 5.0.
id
Pipeline id
body
Pipeline definition as specified in https://www.elastic.co/guide/en/elasticsearch/reference/master/pipeline.html
verbose
Specify if the output s... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L891-L914 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | search_template_get | python | def search_template_get(id, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Obtain existing search template definition.
id
Template ID
CLI example::
salt myminion elasticsearch.search_template_get mytemplate
'''
es = _get_instance(hosts, profile)
try:
... | .. versionadded:: 2017.7.0
Obtain existing search template definition.
id
Template ID
CLI example::
salt myminion elasticsearch.search_template_get mytemplate | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L917-L937 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | search_template_create | python | def search_template_create(id, body, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Create search template by supplied definition
id
Template ID
body
Search template definition
CLI example::
salt myminion elasticsearch.search_template_create mytemplate '{"t... | .. versionadded:: 2017.7.0
Create search template by supplied definition
id
Template ID
body
Search template definition
CLI example::
salt myminion elasticsearch.search_template_create mytemplate '{"template":{"query":{"match":{"title":"{{query_string}}"}}}}' | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L940-L962 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | search_template_delete | python | def search_template_delete(id, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Delete existing search template definition.
id
Template ID
CLI example::
salt myminion elasticsearch.search_template_delete mytemplate
'''
es = _get_instance(hosts, profile)
try:... | .. versionadded:: 2017.7.0
Delete existing search template definition.
id
Template ID
CLI example::
salt myminion elasticsearch.search_template_delete mytemplate | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L965-L987 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | repository_get | python | def repository_get(name, local=False, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Get existing repository details.
name
Repository name
local
Retrieve only local information, default is false
CLI example::
salt myminion elasticsearch.repository_get testr... | .. versionadded:: 2017.7.0
Get existing repository details.
name
Repository name
local
Retrieve only local information, default is false
CLI example::
salt myminion elasticsearch.repository_get testrepo | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L990-L1012 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | repository_create | python | def repository_create(name, body, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Create repository for storing snapshots. Note that shared repository paths have to be specified in path.repo Elasticsearch configuration option.
name
Repository name
body
Repository definiti... | .. versionadded:: 2017.7.0
Create repository for storing snapshots. Note that shared repository paths have to be specified in path.repo Elasticsearch configuration option.
name
Repository name
body
Repository definition as in https://www.elastic.co/guide/en/elasticsearch/reference/current/... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L1015-L1037 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | repository_delete | python | def repository_delete(name, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Delete existing repository.
name
Repository name
CLI example::
salt myminion elasticsearch.repository_delete testrepo
'''
es = _get_instance(hosts, profile)
try:
result = es... | .. versionadded:: 2017.7.0
Delete existing repository.
name
Repository name
CLI example::
salt myminion elasticsearch.repository_delete testrepo | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L1040-L1062 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | repository_verify | python | def repository_verify(name, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Obtain list of cluster nodes which successfully verified this repository.
name
Repository name
CLI example::
salt myminion elasticsearch.repository_verify testrepo
'''
es = _get_instance... | .. versionadded:: 2017.7.0
Obtain list of cluster nodes which successfully verified this repository.
name
Repository name
CLI example::
salt myminion elasticsearch.repository_verify testrepo | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L1065-L1085 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | snapshot_status | python | def snapshot_status(repository=None, snapshot=None, ignore_unavailable=False, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Obtain status of all currently running snapshots.
repository
Particular repository to look for snapshots
snapshot
Snapshot name
ignore_unavail... | .. versionadded:: 2017.7.0
Obtain status of all currently running snapshots.
repository
Particular repository to look for snapshots
snapshot
Snapshot name
ignore_unavailable
Ignore unavailable snapshots
CLI example::
salt myminion elasticsearch.snapshot_status ign... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L1088-L1110 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | snapshot_get | python | def snapshot_get(repository, snapshot, ignore_unavailable=False, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Obtain snapshot residing in specified repository.
repository
Repository name
snapshot
Snapshot name, use _all to obtain all snapshots in specified repository
... | .. versionadded:: 2017.7.0
Obtain snapshot residing in specified repository.
repository
Repository name
snapshot
Snapshot name, use _all to obtain all snapshots in specified repository
ignore_unavailable
Ignore unavailable snapshots
CLI example::
salt myminion ela... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L1113-L1135 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | snapshot_create | python | def snapshot_create(repository, snapshot, body=None, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Create snapshot in specified repository by supplied definition.
repository
Repository name
snapshot
Snapshot name
body
Snapshot definition as in https://www.el... | .. versionadded:: 2017.7.0
Create snapshot in specified repository by supplied definition.
repository
Repository name
snapshot
Snapshot name
body
Snapshot definition as in https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html
CLI example::
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L1138-L1162 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/modules/elasticsearch.py | snapshot_delete | python | def snapshot_delete(repository, snapshot, hosts=None, profile=None):
'''
.. versionadded:: 2017.7.0
Delete snapshot from specified repository.
repository
Repository name
snapshot
Snapshot name
CLI example::
salt myminion elasticsearch.snapshot_delete testrepo testsnap... | .. versionadded:: 2017.7.0
Delete snapshot from specified repository.
repository
Repository name
snapshot
Snapshot name
CLI example::
salt myminion elasticsearch.snapshot_delete testrepo testsnapshot | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/elasticsearch.py#L1192-L1216 | [
"def _get_instance(hosts=None, profile=None):\n '''\n Return the elasticsearch instance\n '''\n es = None\n proxies = None\n use_ssl = False\n ca_certs = None\n verify_certs = True\n http_auth = None\n timeout = 10\n\n if profile is None:\n profile = 'elasticsearch'\n\n if... | # -*- coding: utf-8 -*-
'''
Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt
(compatible with Elasticsearch version 1.5.2+)
.. versionadded:: 2015.8.0
:depends: `elasticsearch-py <http://elasticsearch-py.readthedocs.org/en/latest/>`_
:conf... |
saltstack/salt | salt/states/snap.py | installed | python | def installed(name, channel=None):
'''
Ensure that the named snap package is installed
name
The snap package
channel
Optional. The channel to install the package from.
'''
ret = {'name': name,
'changes': {},
'pchanges': {},
'result': None,
... | Ensure that the named snap package is installed
name
The snap package
channel
Optional. The channel to install the package from. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/snap.py#L19-L86 | null | # -*- coding: utf-8 -*-
'''
Management of snap packages
===============================================
'''
from __future__ import absolute_import, print_function, unicode_literals
import salt.utils.path
__virtualname__ = 'snap'
def __virtual__():
if salt.utils.path.which('snap'):
return __virtualname__
... |
saltstack/salt | salt/states/snap.py | removed | python | def removed(name):
'''
Ensure that the named snap package is not installed
name
The snap package
'''
ret = {'name': name,
'changes': {},
'pchanges': {},
'result': None,
'comment': ''}
old = __salt__['snap.versions_installed'](name)
if no... | Ensure that the named snap package is not installed
name
The snap package | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/snap.py#L89-L121 | null | # -*- coding: utf-8 -*-
'''
Management of snap packages
===============================================
'''
from __future__ import absolute_import, print_function, unicode_literals
import salt.utils.path
__virtualname__ = 'snap'
def __virtual__():
if salt.utils.path.which('snap'):
return __virtualname__
... |
saltstack/salt | salt/beacons/watchdog.py | _get_queue | python | def _get_queue(config):
'''
Check the context for the notifier and construct it if not present
'''
if 'watchdog.observer' not in __context__:
queue = collections.deque()
observer = Observer()
for path in config.get('directories', {}):
path_params = config.get('direct... | Check the context for the notifier and construct it if not present | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/watchdog.py#L80-L99 | null | # -*- coding: utf-8 -*-
'''
watchdog beacon
.. versionadded:: 2019.2.0
Watch files and translate the changes into salt events
:depends: - watchdog Python module >= 0.8.3
'''
# Import Python libs
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
im... |
saltstack/salt | salt/beacons/watchdog.py | validate | python | def validate(config):
'''
Validate the beacon configuration
'''
try:
_validate(config)
return True, 'Valid beacon configuration'
except ValidationError as error:
return False, str(error) | Validate the beacon configuration | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/watchdog.py#L106-L115 | [
"def _validate(config):\n if not isinstance(config, list):\n raise ValidationError(\n 'Configuration for watchdog beacon must be a list.')\n\n _config = {}\n for part in config:\n _config.update(part)\n\n if 'directories' not in _config:\n raise ValidationError(\n ... | # -*- coding: utf-8 -*-
'''
watchdog beacon
.. versionadded:: 2019.2.0
Watch files and translate the changes into salt events
:depends: - watchdog Python module >= 0.8.3
'''
# Import Python libs
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
im... |
saltstack/salt | salt/beacons/watchdog.py | beacon | python | def beacon(config):
'''
Watch the configured directories
Example Config
.. code-block:: yaml
beacons:
watchdog:
- directories:
/path/to/dir:
mask:
- create
- modify
- delete
... | Watch the configured directories
Example Config
.. code-block:: yaml
beacons:
watchdog:
- directories:
/path/to/dir:
mask:
- create
- modify
- delete
- move
The... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/beacons/watchdog.py#L175-L210 | [
"def _get_queue(config):\n '''\n Check the context for the notifier and construct it if not present\n '''\n\n if 'watchdog.observer' not in __context__:\n queue = collections.deque()\n observer = Observer()\n for path in config.get('directories', {}):\n path_params = conf... | # -*- coding: utf-8 -*-
'''
watchdog beacon
.. versionadded:: 2019.2.0
Watch files and translate the changes into salt events
:depends: - watchdog Python module >= 0.8.3
'''
# Import Python libs
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
im... |
saltstack/salt | salt/states/trafficserver.py | bounce_cluster | python | def bounce_cluster(name):
'''
Bounce all Traffic Server nodes in the cluster. Bouncing Traffic Server
shuts down and immediately restarts Traffic Server, node-by-node.
.. code-block:: yaml
bounce_ats_cluster:
trafficserver.bounce_cluster
'''
ret = {'name': name,
'c... | Bounce all Traffic Server nodes in the cluster. Bouncing Traffic Server
shuts down and immediately restarts Traffic Server, node-by-node.
.. code-block:: yaml
bounce_ats_cluster:
trafficserver.bounce_cluster | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/trafficserver.py#L20-L43 | null | # -*- coding: utf-8 -*-
'''
Control Apache Traffic Server
=============================
.. versionadded:: 2015.8.0
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
def __virtual__():
'''
Only load if the Traffic Server module is available in __salt__
'''
... |
saltstack/salt | salt/states/trafficserver.py | bounce_local | python | def bounce_local(name, drain=False):
'''
Bounce Traffic Server on the local node. Bouncing Traffic Server shuts down
and immediately restarts the Traffic Server node.
This option modifies the behavior of traffic_line -b and traffic_line -L
such that traffic_server is not shut down until the number ... | Bounce Traffic Server on the local node. Bouncing Traffic Server shuts down
and immediately restarts the Traffic Server node.
This option modifies the behavior of traffic_line -b and traffic_line -L
such that traffic_server is not shut down until the number of active client
connections drops to the num... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/trafficserver.py#L46-L83 | null | # -*- coding: utf-8 -*-
'''
Control Apache Traffic Server
=============================
.. versionadded:: 2015.8.0
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
def __virtual__():
'''
Only load if the Traffic Server module is available in __salt__
'''
... |
saltstack/salt | salt/states/trafficserver.py | clear_cluster | python | def clear_cluster(name):
'''
Clears accumulated statistics on all nodes in the cluster.
.. code-block:: yaml
clear_ats_cluster:
trafficserver.clear_cluster
'''
ret = {'name': name,
'changes': {},
'result': None,
'comment': ''}
if __opts__['te... | Clears accumulated statistics on all nodes in the cluster.
.. code-block:: yaml
clear_ats_cluster:
trafficserver.clear_cluster | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/trafficserver.py#L86-L108 | null | # -*- coding: utf-8 -*-
'''
Control Apache Traffic Server
=============================
.. versionadded:: 2015.8.0
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
def __virtual__():
'''
Only load if the Traffic Server module is available in __salt__
'''
... |
saltstack/salt | salt/states/trafficserver.py | clear_node | python | def clear_node(name):
'''
Clears accumulated statistics on the local node.
.. code-block:: yaml
clear_ats_node:
trafficserver.clear_node
'''
ret = {'name': name,
'changes': {},
'result': None,
'comment': ''}
if __opts__['test']:
ret['... | Clears accumulated statistics on the local node.
.. code-block:: yaml
clear_ats_node:
trafficserver.clear_node | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/trafficserver.py#L111-L133 | null | # -*- coding: utf-8 -*-
'''
Control Apache Traffic Server
=============================
.. versionadded:: 2015.8.0
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
def __virtual__():
'''
Only load if the Traffic Server module is available in __salt__
'''
... |
saltstack/salt | salt/states/trafficserver.py | restart_cluster | python | def restart_cluster(name):
'''
Restart the traffic_manager process and the traffic_server process on all
the nodes in a cluster.
.. code-block:: bash
restart_ats_cluster:
trafficserver.restart_cluster
'''
ret = {'name': name,
'changes': {},
'result': No... | Restart the traffic_manager process and the traffic_server process on all
the nodes in a cluster.
.. code-block:: bash
restart_ats_cluster:
trafficserver.restart_cluster | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/trafficserver.py#L136-L160 | null | # -*- coding: utf-8 -*-
'''
Control Apache Traffic Server
=============================
.. versionadded:: 2015.8.0
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
def __virtual__():
'''
Only load if the Traffic Server module is available in __salt__
'''
... |
saltstack/salt | salt/states/trafficserver.py | restart_local | python | def restart_local(name, drain=False):
'''
Restart the traffic_manager and traffic_server processes on the local node.
This option modifies the behavior of traffic_line -b and traffic_line -L
such that traffic_server is not shut down until the number of active client
connections drops to the number ... | Restart the traffic_manager and traffic_server processes on the local node.
This option modifies the behavior of traffic_line -b and traffic_line -L
such that traffic_server is not shut down until the number of active client
connections drops to the number given by the
proxy.config.restart.active_clien... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/trafficserver.py#L163-L199 | null | # -*- coding: utf-8 -*-
'''
Control Apache Traffic Server
=============================
.. versionadded:: 2015.8.0
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
def __virtual__():
'''
Only load if the Traffic Server module is available in __salt__
'''
... |
saltstack/salt | salt/states/trafficserver.py | config | python | def config(name, value):
'''
Set Traffic Server configuration variable values.
.. code-block:: yaml
proxy.config.proxy_name:
trafficserver.config:
- value: cdn.site.domain.tld
OR
traffic_server_setting:
trafficserver.config:
- name: pro... | Set Traffic Server configuration variable values.
.. code-block:: yaml
proxy.config.proxy_name:
trafficserver.config:
- value: cdn.site.domain.tld
OR
traffic_server_setting:
trafficserver.config:
- name: proxy.config.proxy_name
- va... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/trafficserver.py#L202-L236 | null | # -*- coding: utf-8 -*-
'''
Control Apache Traffic Server
=============================
.. versionadded:: 2015.8.0
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
def __virtual__():
'''
Only load if the Traffic Server module is available in __salt__
'''
... |
saltstack/salt | salt/states/trafficserver.py | shutdown | python | def shutdown(name):
'''
Shut down Traffic Server on the local node.
.. code-block:: yaml
shutdown_ats:
trafficserver.shutdown
'''
ret = {'name': name,
'changes': {},
'result': None,
'comment': ''}
if __opts__['test']:
ret['comment'] =... | Shut down Traffic Server on the local node.
.. code-block:: yaml
shutdown_ats:
trafficserver.shutdown | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/trafficserver.py#L239-L261 | null | # -*- coding: utf-8 -*-
'''
Control Apache Traffic Server
=============================
.. versionadded:: 2015.8.0
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
def __virtual__():
'''
Only load if the Traffic Server module is available in __salt__
'''
... |
saltstack/salt | salt/states/trafficserver.py | startup | python | def startup(name):
'''
Start Traffic Server on the local node.
.. code-block:: yaml
startup_ats:
trafficserver.startup
'''
ret = {'name': name,
'changes': {},
'result': None,
'comment': ''}
if __opts__['test']:
ret['comment'] = 'Start... | Start Traffic Server on the local node.
.. code-block:: yaml
startup_ats:
trafficserver.startup | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/trafficserver.py#L264-L286 | null | # -*- coding: utf-8 -*-
'''
Control Apache Traffic Server
=============================
.. versionadded:: 2015.8.0
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
def __virtual__():
'''
Only load if the Traffic Server module is available in __salt__
'''
... |
saltstack/salt | salt/states/trafficserver.py | refresh | python | def refresh(name):
'''
Initiate a Traffic Server configuration file reread. Use this command to
update the running configuration after any configuration file modification.
The timestamp of the last reconfiguration event (in seconds since epoch) is
published in the proxy.node.config.reconfigure_time... | Initiate a Traffic Server configuration file reread. Use this command to
update the running configuration after any configuration file modification.
The timestamp of the last reconfiguration event (in seconds since epoch) is
published in the proxy.node.config.reconfigure_time metric.
.. code-block:: y... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/trafficserver.py#L289-L315 | null | # -*- coding: utf-8 -*-
'''
Control Apache Traffic Server
=============================
.. versionadded:: 2015.8.0
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
def __virtual__():
'''
Only load if the Traffic Server module is available in __salt__
'''
... |
saltstack/salt | salt/states/trafficserver.py | zero_cluster | python | def zero_cluster(name):
'''
Reset performance statistics to zero across the cluster.
.. code-block:: yaml
zero_ats_cluster:
trafficserver.zero_cluster
'''
ret = {'name': name,
'changes': {},
'result': None,
'comment': ''}
if __opts__['test']:... | Reset performance statistics to zero across the cluster.
.. code-block:: yaml
zero_ats_cluster:
trafficserver.zero_cluster | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/trafficserver.py#L318-L340 | null | # -*- coding: utf-8 -*-
'''
Control Apache Traffic Server
=============================
.. versionadded:: 2015.8.0
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
def __virtual__():
'''
Only load if the Traffic Server module is available in __salt__
'''
... |
saltstack/salt | salt/states/trafficserver.py | zero_node | python | def zero_node(name):
'''
Reset performance statistics to zero on the local node.
.. code-block:: yaml
zero_ats_node:
trafficserver.zero_node
'''
ret = {'name': name,
'changes': {},
'result': None,
'comment': ''}
if __opts__['test']:
r... | Reset performance statistics to zero on the local node.
.. code-block:: yaml
zero_ats_node:
trafficserver.zero_node | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/trafficserver.py#L343-L365 | null | # -*- coding: utf-8 -*-
'''
Control Apache Traffic Server
=============================
.. versionadded:: 2015.8.0
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
def __virtual__():
'''
Only load if the Traffic Server module is available in __salt__
'''
... |
saltstack/salt | salt/states/trafficserver.py | offline | python | def offline(name, path):
'''
Mark a cache storage device as offline. The storage is identified by a path
which must match exactly a path specified in storage.config. This removes
the storage from the cache and redirects requests that would have used this
storage to other storage. This has exactly th... | Mark a cache storage device as offline. The storage is identified by a path
which must match exactly a path specified in storage.config. This removes
the storage from the cache and redirects requests that would have used this
storage to other storage. This has exactly the same effect as a disk
failure f... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/trafficserver.py#L368-L396 | null | # -*- coding: utf-8 -*-
'''
Control Apache Traffic Server
=============================
.. versionadded:: 2015.8.0
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals, print_function
def __virtual__():
'''
Only load if the Traffic Server module is available in __salt__
'''
... |
saltstack/salt | salt/states/grafana_datasource.py | present | python | def present(name,
type,
url,
access='proxy',
user='',
password='',
database='',
basic_auth=False,
basic_auth_user='',
basic_auth_password='',
is_default=False,
json_data=None,
... | Ensure that a data source is present.
name
Name of the data source.
type
Which type of data source it is ('graphite', 'influxdb' etc.).
url
The URL to the data source API.
user
Optional - user to authenticate with the data source
password
Optional - passw... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_datasource.py#L39-L116 | [
"def _diff(old, new):\n old_keys = old.keys()\n old = old.copy()\n new = new.copy()\n for key in old_keys:\n if key == 'id' or key == 'orgId':\n del old[key]\n elif key not in new.keys():\n del old[key]\n elif old[key] == new[key]:\n del old[key]\n ... | # -*- coding: utf-8 -*-
'''
Manage Grafana v2.0 data sources
.. versionadded:: 2016.3.0
.. code-block:: yaml
grafana:
grafana_timeout: 3
grafana_token: qwertyuiop
grafana_url: 'https://url.com'
.. code-block:: yaml
Ensure influxdb data source is present:
grafana_datasource.present:
... |
saltstack/salt | salt/states/grafana_datasource.py | absent | python | def absent(name, profile='grafana'):
'''
Ensure that a data source is present.
name
Name of the data source to remove.
'''
if isinstance(profile, string_types):
profile = __salt__['config.option'](profile)
ret = {'result': None, 'comment': None, 'changes': {}}
datasource = ... | Ensure that a data source is present.
name
Name of the data source to remove. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/grafana_datasource.py#L119-L146 | [
"def _get_headers(profile):\n return {\n 'Accept': 'application/json',\n 'Authorization': 'Bearer {0}'.format(profile['grafana_token'])\n }\n",
"def _get_url(profile, datasource_id):\n return '{0}/api/datasources/{1}'.format(\n profile['grafana_url'],\n datasource_id\n )\n"... | # -*- coding: utf-8 -*-
'''
Manage Grafana v2.0 data sources
.. versionadded:: 2016.3.0
.. code-block:: yaml
grafana:
grafana_timeout: 3
grafana_token: qwertyuiop
grafana_url: 'https://url.com'
.. code-block:: yaml
Ensure influxdb data source is present:
grafana_datasource.present:
... |
saltstack/salt | salt/modules/neutronng.py | compare_changes | python | def compare_changes(obj, **kwargs):
'''
Compare two dicts returning only keys that exist in the first dict and are
different in the second one
'''
changes = {}
for key, value in obj.items():
if key in kwargs:
if value != kwargs[key]:
changes[key] = kwargs[key]... | Compare two dicts returning only keys that exist in the first dict and are
different in the second one | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutronng.py#L51-L61 | null | # -*- coding: utf-8 -*-
'''
Neutron module for interacting with OpenStack Neutron
.. versionadded:: 2018.3.0
:depends:shade
Example configuration
.. code-block:: yaml
neutron:
cloud: default
.. code-block:: yaml
neutron:
auth:
username: admin
password: password123
user... |
saltstack/salt | salt/modules/neutronng.py | network_create | python | def network_create(auth=None, **kwargs):
'''
Create a network
name
Name of the network being created
shared : False
If ``True``, set the network as shared
admin_state_up : True
If ``True``, Set the network administrative state to "up"
external : False
Control ... | Create a network
name
Name of the network being created
shared : False
If ``True``, set the network as shared
admin_state_up : True
If ``True``, Set the network administrative state to "up"
external : False
Control whether or not this network is externally accessible
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutronng.py#L109-L147 | [
"def _clean_kwargs(keep_name=False, **kwargs):\n '''\n Sanatize the the arguments for use with shade\n '''\n if 'name' in kwargs and not keep_name:\n kwargs['name_or_id'] = kwargs.pop('name')\n\n return __utils__['args.clean_kwargs'](**kwargs)\n",
"def get_operator_cloud(auth=None):\n '''... | # -*- coding: utf-8 -*-
'''
Neutron module for interacting with OpenStack Neutron
.. versionadded:: 2018.3.0
:depends:shade
Example configuration
.. code-block:: yaml
neutron:
cloud: default
.. code-block:: yaml
neutron:
auth:
username: admin
password: password123
user... |
saltstack/salt | salt/modules/neutronng.py | network_delete | python | def network_delete(auth=None, **kwargs):
'''
Delete a network
name_or_id
Name or ID of the network being deleted
CLI Example:
.. code-block:: bash
salt '*' neutronng.network_delete name_or_id=network1
salt '*' neutronng.network_delete name_or_id=1dcac318a83b4610b7a7f7ba01... | Delete a network
name_or_id
Name or ID of the network being deleted
CLI Example:
.. code-block:: bash
salt '*' neutronng.network_delete name_or_id=network1
salt '*' neutronng.network_delete name_or_id=1dcac318a83b4610b7a7f7ba01465548 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutronng.py#L150-L167 | [
"def _clean_kwargs(keep_name=False, **kwargs):\n '''\n Sanatize the the arguments for use with shade\n '''\n if 'name' in kwargs and not keep_name:\n kwargs['name_or_id'] = kwargs.pop('name')\n\n return __utils__['args.clean_kwargs'](**kwargs)\n",
"def get_operator_cloud(auth=None):\n '''... | # -*- coding: utf-8 -*-
'''
Neutron module for interacting with OpenStack Neutron
.. versionadded:: 2018.3.0
:depends:shade
Example configuration
.. code-block:: yaml
neutron:
cloud: default
.. code-block:: yaml
neutron:
auth:
username: admin
password: password123
user... |
saltstack/salt | salt/modules/neutronng.py | list_networks | python | def list_networks(auth=None, **kwargs):
'''
List networks
filters
A Python dictionary of filter conditions to push down
CLI Example:
.. code-block:: bash
salt '*' neutronng.list_networks
salt '*' neutronng.list_networks \
filters='{"tenant_id": "1dcac318a83b4610... | List networks
filters
A Python dictionary of filter conditions to push down
CLI Example:
.. code-block:: bash
salt '*' neutronng.list_networks
salt '*' neutronng.list_networks \
filters='{"tenant_id": "1dcac318a83b4610b7a7f7ba01465548"}' | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutronng.py#L170-L188 | [
"def _clean_kwargs(keep_name=False, **kwargs):\n '''\n Sanatize the the arguments for use with shade\n '''\n if 'name' in kwargs and not keep_name:\n kwargs['name_or_id'] = kwargs.pop('name')\n\n return __utils__['args.clean_kwargs'](**kwargs)\n",
"def get_operator_cloud(auth=None):\n '''... | # -*- coding: utf-8 -*-
'''
Neutron module for interacting with OpenStack Neutron
.. versionadded:: 2018.3.0
:depends:shade
Example configuration
.. code-block:: yaml
neutron:
cloud: default
.. code-block:: yaml
neutron:
auth:
username: admin
password: password123
user... |
saltstack/salt | salt/modules/neutronng.py | network_get | python | def network_get(auth=None, **kwargs):
'''
Get a single network
filters
A Python dictionary of filter conditions to push down
CLI Example:
.. code-block:: bash
salt '*' neutronng.network_get name=XLB4
'''
cloud = get_operator_cloud(auth)
kwargs = _clean_kwargs(**kwarg... | Get a single network
filters
A Python dictionary of filter conditions to push down
CLI Example:
.. code-block:: bash
salt '*' neutronng.network_get name=XLB4 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutronng.py#L191-L207 | [
"def _clean_kwargs(keep_name=False, **kwargs):\n '''\n Sanatize the the arguments for use with shade\n '''\n if 'name' in kwargs and not keep_name:\n kwargs['name_or_id'] = kwargs.pop('name')\n\n return __utils__['args.clean_kwargs'](**kwargs)\n",
"def get_operator_cloud(auth=None):\n '''... | # -*- coding: utf-8 -*-
'''
Neutron module for interacting with OpenStack Neutron
.. versionadded:: 2018.3.0
:depends:shade
Example configuration
.. code-block:: yaml
neutron:
cloud: default
.. code-block:: yaml
neutron:
auth:
username: admin
password: password123
user... |
saltstack/salt | salt/modules/neutronng.py | subnet_create | python | def subnet_create(auth=None, **kwargs):
'''
Create a subnet
network_name_or_id
The unique name or ID of the attached network. If a non-unique name is
supplied, an exception is raised.
cidr
The CIDR
ip_version
The IP version, which is 4 or 6.
enable_dhcp : Fals... | Create a subnet
network_name_or_id
The unique name or ID of the attached network. If a non-unique name is
supplied, an exception is raised.
cidr
The CIDR
ip_version
The IP version, which is 4 or 6.
enable_dhcp : False
Set to ``True`` if DHCP is enabled and ``F... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutronng.py#L210-L285 | [
"def _clean_kwargs(keep_name=False, **kwargs):\n '''\n Sanatize the the arguments for use with shade\n '''\n if 'name' in kwargs and not keep_name:\n kwargs['name_or_id'] = kwargs.pop('name')\n\n return __utils__['args.clean_kwargs'](**kwargs)\n",
"def get_operator_cloud(auth=None):\n '''... | # -*- coding: utf-8 -*-
'''
Neutron module for interacting with OpenStack Neutron
.. versionadded:: 2018.3.0
:depends:shade
Example configuration
.. code-block:: yaml
neutron:
cloud: default
.. code-block:: yaml
neutron:
auth:
username: admin
password: password123
user... |
saltstack/salt | salt/modules/neutronng.py | subnet_update | python | def subnet_update(auth=None, **kwargs):
'''
Update a subnet
name_or_id
Name or ID of the subnet to update
subnet_name
The new name of the subnet
enable_dhcp
Set to ``True`` if DHCP is enabled and ``False`` if disabled
gateway_ip
The gateway IP address. When yo... | Update a subnet
name_or_id
Name or ID of the subnet to update
subnet_name
The new name of the subnet
enable_dhcp
Set to ``True`` if DHCP is enabled and ``False`` if disabled
gateway_ip
The gateway IP address. When you specify both allocation_pools and
gateway_... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutronng.py#L288-L328 | [
"def _clean_kwargs(keep_name=False, **kwargs):\n '''\n Sanatize the the arguments for use with shade\n '''\n if 'name' in kwargs and not keep_name:\n kwargs['name_or_id'] = kwargs.pop('name')\n\n return __utils__['args.clean_kwargs'](**kwargs)\n",
"def get_operator_cloud(auth=None):\n '''... | # -*- coding: utf-8 -*-
'''
Neutron module for interacting with OpenStack Neutron
.. versionadded:: 2018.3.0
:depends:shade
Example configuration
.. code-block:: yaml
neutron:
cloud: default
.. code-block:: yaml
neutron:
auth:
username: admin
password: password123
user... |
saltstack/salt | salt/modules/neutronng.py | subnet_delete | python | def subnet_delete(auth=None, **kwargs):
'''
Delete a subnet
name
Name or ID of the subnet to update
CLI Example:
.. code-block:: bash
salt '*' neutronng.subnet_delete name=subnet1
salt '*' neutronng.subnet_delete \
name=1dcac318a83b4610b7a7f7ba01465548
'''
... | Delete a subnet
name
Name or ID of the subnet to update
CLI Example:
.. code-block:: bash
salt '*' neutronng.subnet_delete name=subnet1
salt '*' neutronng.subnet_delete \
name=1dcac318a83b4610b7a7f7ba01465548 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutronng.py#L331-L349 | [
"def _clean_kwargs(keep_name=False, **kwargs):\n '''\n Sanatize the the arguments for use with shade\n '''\n if 'name' in kwargs and not keep_name:\n kwargs['name_or_id'] = kwargs.pop('name')\n\n return __utils__['args.clean_kwargs'](**kwargs)\n",
"def get_operator_cloud(auth=None):\n '''... | # -*- coding: utf-8 -*-
'''
Neutron module for interacting with OpenStack Neutron
.. versionadded:: 2018.3.0
:depends:shade
Example configuration
.. code-block:: yaml
neutron:
cloud: default
.. code-block:: yaml
neutron:
auth:
username: admin
password: password123
user... |
saltstack/salt | salt/modules/neutronng.py | list_subnets | python | def list_subnets(auth=None, **kwargs):
'''
List subnets
filters
A Python dictionary of filter conditions to push down
CLI Example:
.. code-block:: bash
salt '*' neutronng.list_subnets
salt '*' neutronng.list_subnets \
filters='{"tenant_id": "1dcac318a83b4610b7a7... | List subnets
filters
A Python dictionary of filter conditions to push down
CLI Example:
.. code-block:: bash
salt '*' neutronng.list_subnets
salt '*' neutronng.list_subnets \
filters='{"tenant_id": "1dcac318a83b4610b7a7f7ba01465548"}' | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutronng.py#L352-L370 | [
"def _clean_kwargs(keep_name=False, **kwargs):\n '''\n Sanatize the the arguments for use with shade\n '''\n if 'name' in kwargs and not keep_name:\n kwargs['name_or_id'] = kwargs.pop('name')\n\n return __utils__['args.clean_kwargs'](**kwargs)\n",
"def get_operator_cloud(auth=None):\n '''... | # -*- coding: utf-8 -*-
'''
Neutron module for interacting with OpenStack Neutron
.. versionadded:: 2018.3.0
:depends:shade
Example configuration
.. code-block:: yaml
neutron:
cloud: default
.. code-block:: yaml
neutron:
auth:
username: admin
password: password123
user... |
saltstack/salt | salt/modules/neutronng.py | subnet_get | python | def subnet_get(auth=None, **kwargs):
'''
Get a single subnet
filters
A Python dictionary of filter conditions to push down
CLI Example:
.. code-block:: bash
salt '*' neutronng.subnet_get name=subnet1
'''
cloud = get_operator_cloud(auth)
kwargs = _clean_kwargs(**kwarg... | Get a single subnet
filters
A Python dictionary of filter conditions to push down
CLI Example:
.. code-block:: bash
salt '*' neutronng.subnet_get name=subnet1 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutronng.py#L373-L389 | [
"def _clean_kwargs(keep_name=False, **kwargs):\n '''\n Sanatize the the arguments for use with shade\n '''\n if 'name' in kwargs and not keep_name:\n kwargs['name_or_id'] = kwargs.pop('name')\n\n return __utils__['args.clean_kwargs'](**kwargs)\n",
"def get_operator_cloud(auth=None):\n '''... | # -*- coding: utf-8 -*-
'''
Neutron module for interacting with OpenStack Neutron
.. versionadded:: 2018.3.0
:depends:shade
Example configuration
.. code-block:: yaml
neutron:
cloud: default
.. code-block:: yaml
neutron:
auth:
username: admin
password: password123
user... |
saltstack/salt | salt/modules/neutronng.py | security_group_create | python | def security_group_create(auth=None, **kwargs):
'''
Create a security group. Use security_group_get to create default.
project_id
The project ID on which this security group will be created
CLI Example:
.. code-block:: bash
salt '*' neutronng.security_group_create name=secgroup1 ... | Create a security group. Use security_group_get to create default.
project_id
The project ID on which this security group will be created
CLI Example:
.. code-block:: bash
salt '*' neutronng.security_group_create name=secgroup1 \
description="Very secure security group"
... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutronng.py#L392-L412 | [
"def _clean_kwargs(keep_name=False, **kwargs):\n '''\n Sanatize the the arguments for use with shade\n '''\n if 'name' in kwargs and not keep_name:\n kwargs['name_or_id'] = kwargs.pop('name')\n\n return __utils__['args.clean_kwargs'](**kwargs)\n",
"def get_operator_cloud(auth=None):\n '''... | # -*- coding: utf-8 -*-
'''
Neutron module for interacting with OpenStack Neutron
.. versionadded:: 2018.3.0
:depends:shade
Example configuration
.. code-block:: yaml
neutron:
cloud: default
.. code-block:: yaml
neutron:
auth:
username: admin
password: password123
user... |
saltstack/salt | salt/modules/neutronng.py | security_group_update | python | def security_group_update(secgroup=None, auth=None, **kwargs):
'''
Update a security group
secgroup
Name, ID or Raw Object of the security group to update
name
New name for the security group
description
New description for the security group
CLI Example:
.. code... | Update a security group
secgroup
Name, ID or Raw Object of the security group to update
name
New name for the security group
description
New description for the security group
CLI Example:
.. code-block:: bash
salt '*' neutronng.security_group_update secgroup=se... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutronng.py#L415-L441 | [
"def _clean_kwargs(keep_name=False, **kwargs):\n '''\n Sanatize the the arguments for use with shade\n '''\n if 'name' in kwargs and not keep_name:\n kwargs['name_or_id'] = kwargs.pop('name')\n\n return __utils__['args.clean_kwargs'](**kwargs)\n",
"def get_operator_cloud(auth=None):\n '''... | # -*- coding: utf-8 -*-
'''
Neutron module for interacting with OpenStack Neutron
.. versionadded:: 2018.3.0
:depends:shade
Example configuration
.. code-block:: yaml
neutron:
cloud: default
.. code-block:: yaml
neutron:
auth:
username: admin
password: password123
user... |
saltstack/salt | salt/modules/neutronng.py | security_group_delete | python | def security_group_delete(auth=None, **kwargs):
'''
Delete a security group
name_or_id
The name or unique ID of the security group
CLI Example:
.. code-block:: bash
salt '*' neutronng.security_group_delete name_or_id=secgroup1
'''
cloud = get_operator_cloud(auth)
kwa... | Delete a security group
name_or_id
The name or unique ID of the security group
CLI Example:
.. code-block:: bash
salt '*' neutronng.security_group_delete name_or_id=secgroup1 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutronng.py#L444-L460 | [
"def _clean_kwargs(keep_name=False, **kwargs):\n '''\n Sanatize the the arguments for use with shade\n '''\n if 'name' in kwargs and not keep_name:\n kwargs['name_or_id'] = kwargs.pop('name')\n\n return __utils__['args.clean_kwargs'](**kwargs)\n",
"def get_operator_cloud(auth=None):\n '''... | # -*- coding: utf-8 -*-
'''
Neutron module for interacting with OpenStack Neutron
.. versionadded:: 2018.3.0
:depends:shade
Example configuration
.. code-block:: yaml
neutron:
cloud: default
.. code-block:: yaml
neutron:
auth:
username: admin
password: password123
user... |
saltstack/salt | salt/modules/neutronng.py | security_group_get | python | def security_group_get(auth=None, **kwargs):
'''
Get a single security group. This will create a default security group
if one does not exist yet for a particular project id.
filters
A Python dictionary of filter conditions to push down
CLI Example:
.. code-block:: bash
salt ... | Get a single security group. This will create a default security group
if one does not exist yet for a particular project id.
filters
A Python dictionary of filter conditions to push down
CLI Example:
.. code-block:: bash
salt '*' neutronng.security_group_get \
name=1dcac31... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutronng.py#L463-L484 | [
"def _clean_kwargs(keep_name=False, **kwargs):\n '''\n Sanatize the the arguments for use with shade\n '''\n if 'name' in kwargs and not keep_name:\n kwargs['name_or_id'] = kwargs.pop('name')\n\n return __utils__['args.clean_kwargs'](**kwargs)\n",
"def get_operator_cloud(auth=None):\n '''... | # -*- coding: utf-8 -*-
'''
Neutron module for interacting with OpenStack Neutron
.. versionadded:: 2018.3.0
:depends:shade
Example configuration
.. code-block:: yaml
neutron:
cloud: default
.. code-block:: yaml
neutron:
auth:
username: admin
password: password123
user... |
saltstack/salt | salt/modules/neutronng.py | security_group_rule_create | python | def security_group_rule_create(auth=None, **kwargs):
'''
Create a rule in a security group
secgroup_name_or_id
The security group name or ID to associate with this security group
rule. If a non-unique group name is given, an exception is raised.
port_range_min
The minimum port ... | Create a rule in a security group
secgroup_name_or_id
The security group name or ID to associate with this security group
rule. If a non-unique group name is given, an exception is raised.
port_range_min
The minimum port number in the range that is matched by the security
group... | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutronng.py#L487-L552 | [
"def _clean_kwargs(keep_name=False, **kwargs):\n '''\n Sanatize the the arguments for use with shade\n '''\n if 'name' in kwargs and not keep_name:\n kwargs['name_or_id'] = kwargs.pop('name')\n\n return __utils__['args.clean_kwargs'](**kwargs)\n",
"def get_operator_cloud(auth=None):\n '''... | # -*- coding: utf-8 -*-
'''
Neutron module for interacting with OpenStack Neutron
.. versionadded:: 2018.3.0
:depends:shade
Example configuration
.. code-block:: yaml
neutron:
cloud: default
.. code-block:: yaml
neutron:
auth:
username: admin
password: password123
user... |
saltstack/salt | salt/modules/neutronng.py | security_group_rule_delete | python | def security_group_rule_delete(auth=None, **kwargs):
'''
Delete a security group
name_or_id
The unique ID of the security group rule
CLI Example:
.. code-block:: bash
salt '*' neutronng.security_group_rule_delete name_or_id=1dcac318a83b4610b7a7f7ba01465548
'''
cloud = ge... | Delete a security group
name_or_id
The unique ID of the security group rule
CLI Example:
.. code-block:: bash
salt '*' neutronng.security_group_rule_delete name_or_id=1dcac318a83b4610b7a7f7ba01465548 | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/neutronng.py#L555-L571 | [
"def _clean_kwargs(keep_name=False, **kwargs):\n '''\n Sanatize the the arguments for use with shade\n '''\n if 'name' in kwargs and not keep_name:\n kwargs['name_or_id'] = kwargs.pop('name')\n\n return __utils__['args.clean_kwargs'](**kwargs)\n",
"def get_operator_cloud(auth=None):\n '''... | # -*- coding: utf-8 -*-
'''
Neutron module for interacting with OpenStack Neutron
.. versionadded:: 2018.3.0
:depends:shade
Example configuration
.. code-block:: yaml
neutron:
cloud: default
.. code-block:: yaml
neutron:
auth:
username: admin
password: password123
user... |
saltstack/salt | salt/cloud/clouds/aliyun.py | avail_locations | python | def avail_locations(call=None):
'''
Return a dict of all available VM locations on the cloud provider with
relevant data
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_locations function must be called with '
'-f or --function, or with the --list-locat... | Return a dict of all available VM locations on the cloud provider with
relevant data | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/aliyun.py#L124-L144 | [
"def query(params=None):\n '''\n Make a web call to aliyun ECS REST API\n '''\n path = 'https://ecs-cn-hangzhou.aliyuncs.com'\n\n access_key_id = config.get_cloud_config_value(\n 'id', get_configured_provider(), __opts__, search_global=False\n )\n access_key_secret = config.get_cloud_con... | # -*- coding: utf-8 -*-
'''
AliYun ECS Cloud Module
=======================
.. versionadded:: 2014.7.0
The Aliyun cloud module is used to control access to the aliyun ECS.
http://www.aliyun.com/
Use of this module requires the ``id`` and ``key`` parameter to be set.
Set up the cloud configuration at ``/etc/salt/clou... |
saltstack/salt | salt/cloud/clouds/aliyun.py | avail_images | python | def avail_images(kwargs=None, call=None):
'''
Return a list of the images that are on the provider
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_images function must be called with '
'-f or --function, or with the --list-images option'
)
if n... | Return a list of the images that are on the provider | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/aliyun.py#L147-L179 | [
"def query(params=None):\n '''\n Make a web call to aliyun ECS REST API\n '''\n path = 'https://ecs-cn-hangzhou.aliyuncs.com'\n\n access_key_id = config.get_cloud_config_value(\n 'id', get_configured_provider(), __opts__, search_global=False\n )\n access_key_secret = config.get_cloud_con... | # -*- coding: utf-8 -*-
'''
AliYun ECS Cloud Module
=======================
.. versionadded:: 2014.7.0
The Aliyun cloud module is used to control access to the aliyun ECS.
http://www.aliyun.com/
Use of this module requires the ``id`` and ``key`` parameter to be set.
Set up the cloud configuration at ``/etc/salt/clou... |
saltstack/salt | salt/cloud/clouds/aliyun.py | avail_sizes | python | def avail_sizes(call=None):
'''
Return a list of the image sizes that are on the provider
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_sizes function must be called with '
'-f or --function, or with the --list-sizes option'
)
params = {'Acti... | Return a list of the image sizes that are on the provider | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/aliyun.py#L182-L201 | [
"def query(params=None):\n '''\n Make a web call to aliyun ECS REST API\n '''\n path = 'https://ecs-cn-hangzhou.aliyuncs.com'\n\n access_key_id = config.get_cloud_config_value(\n 'id', get_configured_provider(), __opts__, search_global=False\n )\n access_key_secret = config.get_cloud_con... | # -*- coding: utf-8 -*-
'''
AliYun ECS Cloud Module
=======================
.. versionadded:: 2014.7.0
The Aliyun cloud module is used to control access to the aliyun ECS.
http://www.aliyun.com/
Use of this module requires the ``id`` and ``key`` parameter to be set.
Set up the cloud configuration at ``/etc/salt/clou... |
saltstack/salt | salt/cloud/clouds/aliyun.py | list_availability_zones | python | def list_availability_zones(call=None):
'''
List all availability zones in the current region
'''
ret = {}
params = {'Action': 'DescribeZones',
'RegionId': get_location()}
items = query(params)
for zone in items['Zones']['Zone']:
ret[zone['ZoneId']] = {}
for i... | List all availability zones in the current region | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/aliyun.py#L223-L238 | [
"def query(params=None):\n '''\n Make a web call to aliyun ECS REST API\n '''\n path = 'https://ecs-cn-hangzhou.aliyuncs.com'\n\n access_key_id = config.get_cloud_config_value(\n 'id', get_configured_provider(), __opts__, search_global=False\n )\n access_key_secret = config.get_cloud_con... | # -*- coding: utf-8 -*-
'''
AliYun ECS Cloud Module
=======================
.. versionadded:: 2014.7.0
The Aliyun cloud module is used to control access to the aliyun ECS.
http://www.aliyun.com/
Use of this module requires the ``id`` and ``key`` parameter to be set.
Set up the cloud configuration at ``/etc/salt/clou... |
saltstack/salt | salt/cloud/clouds/aliyun.py | list_nodes_min | python | def list_nodes_min(call=None):
'''
Return a list of the VMs that are on the provider. Only a list of VM names,
and their state, is returned. This is the minimum amount of information
needed to check for existing VMs.
'''
if call == 'action':
raise SaltCloudSystemExit(
'The li... | Return a list of the VMs that are on the provider. Only a list of VM names,
and their state, is returned. This is the minimum amount of information
needed to check for existing VMs. | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/aliyun.py#L241-L272 | [
"def query(params=None):\n '''\n Make a web call to aliyun ECS REST API\n '''\n path = 'https://ecs-cn-hangzhou.aliyuncs.com'\n\n access_key_id = config.get_cloud_config_value(\n 'id', get_configured_provider(), __opts__, search_global=False\n )\n access_key_secret = config.get_cloud_con... | # -*- coding: utf-8 -*-
'''
AliYun ECS Cloud Module
=======================
.. versionadded:: 2014.7.0
The Aliyun cloud module is used to control access to the aliyun ECS.
http://www.aliyun.com/
Use of this module requires the ``id`` and ``key`` parameter to be set.
Set up the cloud configuration at ``/etc/salt/clou... |
saltstack/salt | salt/cloud/clouds/aliyun.py | list_nodes | python | def list_nodes(call=None):
'''
Return a list of the VMs that are on the provider
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes function must be called with -f or --function.'
)
nodes = list_nodes_full()
ret = {}
for instanceId in nodes:
... | Return a list of the VMs that are on the provider | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/aliyun.py#L275-L296 | [
"def list_nodes_full(call=None):\n '''\n Return a list of the VMs that are on the provider\n '''\n if call == 'action':\n raise SaltCloudSystemExit(\n 'The list_nodes_full function must be called with -f '\n 'or --function.'\n )\n\n ret = {}\n location = get_loc... | # -*- coding: utf-8 -*-
'''
AliYun ECS Cloud Module
=======================
.. versionadded:: 2014.7.0
The Aliyun cloud module is used to control access to the aliyun ECS.
http://www.aliyun.com/
Use of this module requires the ``id`` and ``key`` parameter to be set.
Set up the cloud configuration at ``/etc/salt/clou... |
saltstack/salt | salt/cloud/clouds/aliyun.py | list_nodes_full | python | def list_nodes_full(call=None):
'''
Return a list of the VMs that are on the provider
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes_full function must be called with -f '
'or --function.'
)
ret = {}
location = get_location()
para... | Return a list of the VMs that are on the provider | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/aliyun.py#L299-L375 | [
"def query(params=None):\n '''\n Make a web call to aliyun ECS REST API\n '''\n path = 'https://ecs-cn-hangzhou.aliyuncs.com'\n\n access_key_id = config.get_cloud_config_value(\n 'id', get_configured_provider(), __opts__, search_global=False\n )\n access_key_secret = config.get_cloud_con... | # -*- coding: utf-8 -*-
'''
AliYun ECS Cloud Module
=======================
.. versionadded:: 2014.7.0
The Aliyun cloud module is used to control access to the aliyun ECS.
http://www.aliyun.com/
Use of this module requires the ``id`` and ``key`` parameter to be set.
Set up the cloud configuration at ``/etc/salt/clou... |
saltstack/salt | salt/cloud/clouds/aliyun.py | list_securitygroup | python | def list_securitygroup(call=None):
'''
Return a list of security group
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes function must be called with -f or --function.'
)
params = {
'Action': 'DescribeSecurityGroups',
'RegionId': get_loc... | Return a list of security group | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/aliyun.py#L387-L412 | [
"def query(params=None):\n '''\n Make a web call to aliyun ECS REST API\n '''\n path = 'https://ecs-cn-hangzhou.aliyuncs.com'\n\n access_key_id = config.get_cloud_config_value(\n 'id', get_configured_provider(), __opts__, search_global=False\n )\n access_key_secret = config.get_cloud_con... | # -*- coding: utf-8 -*-
'''
AliYun ECS Cloud Module
=======================
.. versionadded:: 2014.7.0
The Aliyun cloud module is used to control access to the aliyun ECS.
http://www.aliyun.com/
Use of this module requires the ``id`` and ``key`` parameter to be set.
Set up the cloud configuration at ``/etc/salt/clou... |
saltstack/salt | salt/cloud/clouds/aliyun.py | get_image | python | def get_image(vm_):
'''
Return the image object to use
'''
images = avail_images()
vm_image = six.text_type(config.get_cloud_config_value(
'image', vm_, __opts__, search_global=False
))
if not vm_image:
raise SaltCloudNotFound('No image specified for this VM.')
if vm_im... | Return the image object to use | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/aliyun.py#L415-L431 | [
"def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ... | # -*- coding: utf-8 -*-
'''
AliYun ECS Cloud Module
=======================
.. versionadded:: 2014.7.0
The Aliyun cloud module is used to control access to the aliyun ECS.
http://www.aliyun.com/
Use of this module requires the ``id`` and ``key`` parameter to be set.
Set up the cloud configuration at ``/etc/salt/clou... |
saltstack/salt | salt/cloud/clouds/aliyun.py | get_securitygroup | python | def get_securitygroup(vm_):
'''
Return the security group
'''
sgs = list_securitygroup()
securitygroup = config.get_cloud_config_value(
'securitygroup', vm_, __opts__, search_global=False
)
if not securitygroup:
raise SaltCloudNotFound('No securitygroup ID specified for this... | Return the security group | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/aliyun.py#L434-L451 | [
"def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ... | # -*- coding: utf-8 -*-
'''
AliYun ECS Cloud Module
=======================
.. versionadded:: 2014.7.0
The Aliyun cloud module is used to control access to the aliyun ECS.
http://www.aliyun.com/
Use of this module requires the ``id`` and ``key`` parameter to be set.
Set up the cloud configuration at ``/etc/salt/clou... |
saltstack/salt | salt/cloud/clouds/aliyun.py | get_size | python | def get_size(vm_):
'''
Return the VM's size. Used by create_node().
'''
sizes = avail_sizes()
vm_size = six.text_type(config.get_cloud_config_value(
'size', vm_, __opts__, search_global=False
))
if not vm_size:
raise SaltCloudNotFound('No size specified for this VM.')
i... | Return the VM's size. Used by create_node(). | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/aliyun.py#L454-L471 | [
"def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):\n '''\n Search and return a setting in a known order:\n\n 1. In the virtual machine's configuration\n 2. In the virtual machine's profile configuration\n 3. In the virtual machine's provider configuration\n ... | # -*- coding: utf-8 -*-
'''
AliYun ECS Cloud Module
=======================
.. versionadded:: 2014.7.0
The Aliyun cloud module is used to control access to the aliyun ECS.
http://www.aliyun.com/
Use of this module requires the ``id`` and ``key`` parameter to be set.
Set up the cloud configuration at ``/etc/salt/clou... |
saltstack/salt | salt/cloud/clouds/aliyun.py | __get_location | python | def __get_location(vm_):
'''
Return the VM's location
'''
locations = avail_locations()
vm_location = six.text_type(config.get_cloud_config_value(
'location', vm_, __opts__, search_global=False
))
if not vm_location:
raise SaltCloudNotFound('No location specified for this VM... | Return the VM's location | train | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/aliyun.py#L474-L492 | null | # -*- coding: utf-8 -*-
'''
AliYun ECS Cloud Module
=======================
.. versionadded:: 2014.7.0
The Aliyun cloud module is used to control access to the aliyun ECS.
http://www.aliyun.com/
Use of this module requires the ``id`` and ``key`` parameter to be set.
Set up the cloud configuration at ``/etc/salt/clou... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.