repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1 value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1 value |
|---|---|---|---|---|---|---|---|---|---|---|---|
elastic/elasticsearch-py | elasticsearch/helpers/actions.py | parallel_bulk | def parallel_bulk(
client,
actions,
thread_count=4,
chunk_size=500,
max_chunk_bytes=100 * 1024 * 1024,
queue_size=4,
expand_action_callback=expand_action,
*args,
**kwargs
):
"""
Parallel version of the bulk helper run in multiple threads at once.
:arg client: instance of :class:`~elasticsearch.Elasticsearch` to use
:arg actions: iterator containing the actions
:arg thread_count: size of the threadpool to use for the bulk requests
:arg chunk_size: number of docs in one chunk sent to es (default: 500)
:arg max_chunk_bytes: the maximum size of the request in bytes (default: 100MB)
:arg raise_on_error: raise ``BulkIndexError`` containing errors (as `.errors`)
from the execution of the last chunk when some occur. By default we raise.
:arg raise_on_exception: if ``False`` then don't propagate exceptions from
call to ``bulk`` and just report the items that failed as failed.
:arg expand_action_callback: callback executed on each action passed in,
should return a tuple containing the action line and the data line
(`None` if data line should be omitted).
:arg queue_size: size of the task queue between the main thread (producing
chunks to send) and the processing threads.
"""
# Avoid importing multiprocessing unless parallel_bulk is used
# to avoid exceptions on restricted environments like App Engine
from multiprocessing.pool import ThreadPool
actions = map(expand_action_callback, actions)
class BlockingPool(ThreadPool):
def _setup_queues(self):
super(BlockingPool, self)._setup_queues()
# The queue must be at least the size of the number of threads to
# prevent hanging when inserting sentinel values during teardown.
self._inqueue = Queue(max(queue_size, thread_count))
self._quick_put = self._inqueue.put
pool = BlockingPool(thread_count)
try:
for result in pool.imap(
lambda bulk_chunk: list(
_process_bulk_chunk(
client, bulk_chunk[1], bulk_chunk[0], *args, **kwargs
)
),
_chunk_actions(
actions, chunk_size, max_chunk_bytes, client.transport.serializer
),
):
for item in result:
yield item
finally:
pool.close()
pool.join() | python | def parallel_bulk(
client,
actions,
thread_count=4,
chunk_size=500,
max_chunk_bytes=100 * 1024 * 1024,
queue_size=4,
expand_action_callback=expand_action,
*args,
**kwargs
):
"""
Parallel version of the bulk helper run in multiple threads at once.
:arg client: instance of :class:`~elasticsearch.Elasticsearch` to use
:arg actions: iterator containing the actions
:arg thread_count: size of the threadpool to use for the bulk requests
:arg chunk_size: number of docs in one chunk sent to es (default: 500)
:arg max_chunk_bytes: the maximum size of the request in bytes (default: 100MB)
:arg raise_on_error: raise ``BulkIndexError`` containing errors (as `.errors`)
from the execution of the last chunk when some occur. By default we raise.
:arg raise_on_exception: if ``False`` then don't propagate exceptions from
call to ``bulk`` and just report the items that failed as failed.
:arg expand_action_callback: callback executed on each action passed in,
should return a tuple containing the action line and the data line
(`None` if data line should be omitted).
:arg queue_size: size of the task queue between the main thread (producing
chunks to send) and the processing threads.
"""
# Avoid importing multiprocessing unless parallel_bulk is used
# to avoid exceptions on restricted environments like App Engine
from multiprocessing.pool import ThreadPool
actions = map(expand_action_callback, actions)
class BlockingPool(ThreadPool):
def _setup_queues(self):
super(BlockingPool, self)._setup_queues()
# The queue must be at least the size of the number of threads to
# prevent hanging when inserting sentinel values during teardown.
self._inqueue = Queue(max(queue_size, thread_count))
self._quick_put = self._inqueue.put
pool = BlockingPool(thread_count)
try:
for result in pool.imap(
lambda bulk_chunk: list(
_process_bulk_chunk(
client, bulk_chunk[1], bulk_chunk[0], *args, **kwargs
)
),
_chunk_actions(
actions, chunk_size, max_chunk_bytes, client.transport.serializer
),
):
for item in result:
yield item
finally:
pool.close()
pool.join() | [
"def",
"parallel_bulk",
"(",
"client",
",",
"actions",
",",
"thread_count",
"=",
"4",
",",
"chunk_size",
"=",
"500",
",",
"max_chunk_bytes",
"=",
"100",
"*",
"1024",
"*",
"1024",
",",
"queue_size",
"=",
"4",
",",
"expand_action_callback",
"=",
"expand_action",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"# Avoid importing multiprocessing unless parallel_bulk is used",
"# to avoid exceptions on restricted environments like App Engine",
"from",
"multiprocessing",
".",
"pool",
"import",
"ThreadPool",
"actions",
"=",
"map",
"(",
"expand_action_callback",
",",
"actions",
")",
"class",
"BlockingPool",
"(",
"ThreadPool",
")",
":",
"def",
"_setup_queues",
"(",
"self",
")",
":",
"super",
"(",
"BlockingPool",
",",
"self",
")",
".",
"_setup_queues",
"(",
")",
"# The queue must be at least the size of the number of threads to ",
"# prevent hanging when inserting sentinel values during teardown.",
"self",
".",
"_inqueue",
"=",
"Queue",
"(",
"max",
"(",
"queue_size",
",",
"thread_count",
")",
")",
"self",
".",
"_quick_put",
"=",
"self",
".",
"_inqueue",
".",
"put",
"pool",
"=",
"BlockingPool",
"(",
"thread_count",
")",
"try",
":",
"for",
"result",
"in",
"pool",
".",
"imap",
"(",
"lambda",
"bulk_chunk",
":",
"list",
"(",
"_process_bulk_chunk",
"(",
"client",
",",
"bulk_chunk",
"[",
"1",
"]",
",",
"bulk_chunk",
"[",
"0",
"]",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
",",
"_chunk_actions",
"(",
"actions",
",",
"chunk_size",
",",
"max_chunk_bytes",
",",
"client",
".",
"transport",
".",
"serializer",
")",
",",
")",
":",
"for",
"item",
"in",
"result",
":",
"yield",
"item",
"finally",
":",
"pool",
".",
"close",
"(",
")",
"pool",
".",
"join",
"(",
")"
] | Parallel version of the bulk helper run in multiple threads at once.
:arg client: instance of :class:`~elasticsearch.Elasticsearch` to use
:arg actions: iterator containing the actions
:arg thread_count: size of the threadpool to use for the bulk requests
:arg chunk_size: number of docs in one chunk sent to es (default: 500)
:arg max_chunk_bytes: the maximum size of the request in bytes (default: 100MB)
:arg raise_on_error: raise ``BulkIndexError`` containing errors (as `.errors`)
from the execution of the last chunk when some occur. By default we raise.
:arg raise_on_exception: if ``False`` then don't propagate exceptions from
call to ``bulk`` and just report the items that failed as failed.
:arg expand_action_callback: callback executed on each action passed in,
should return a tuple containing the action line and the data line
(`None` if data line should be omitted).
:arg queue_size: size of the task queue between the main thread (producing
chunks to send) and the processing threads. | [
"Parallel",
"version",
"of",
"the",
"bulk",
"helper",
"run",
"in",
"multiple",
"threads",
"at",
"once",
"."
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/helpers/actions.py#L312-L373 | train |
elastic/elasticsearch-py | elasticsearch/helpers/actions.py | scan | def scan(
client,
query=None,
scroll="5m",
raise_on_error=True,
preserve_order=False,
size=1000,
request_timeout=None,
clear_scroll=True,
scroll_kwargs=None,
**kwargs
):
"""
Simple abstraction on top of the
:meth:`~elasticsearch.Elasticsearch.scroll` api - a simple iterator that
yields all hits as returned by underlining scroll requests.
By default scan does not return results in any pre-determined order. To
have a standard order in the returned documents (either by score or
explicit sort definition) when scrolling, use ``preserve_order=True``. This
may be an expensive operation and will negate the performance benefits of
using ``scan``.
:arg client: instance of :class:`~elasticsearch.Elasticsearch` to use
:arg query: body for the :meth:`~elasticsearch.Elasticsearch.search` api
:arg scroll: Specify how long a consistent view of the index should be
maintained for scrolled search
:arg raise_on_error: raises an exception (``ScanError``) if an error is
encountered (some shards fail to execute). By default we raise.
:arg preserve_order: don't set the ``search_type`` to ``scan`` - this will
cause the scroll to paginate with preserving the order. Note that this
can be an extremely expensive operation and can easily lead to
unpredictable results, use with caution.
:arg size: size (per shard) of the batch send at each iteration.
:arg request_timeout: explicit timeout for each call to ``scan``
:arg clear_scroll: explicitly calls delete on the scroll id via the clear
scroll API at the end of the method on completion or error, defaults
to true.
:arg scroll_kwargs: additional kwargs to be passed to
:meth:`~elasticsearch.Elasticsearch.scroll`
Any additional keyword arguments will be passed to the initial
:meth:`~elasticsearch.Elasticsearch.search` call::
scan(es,
query={"query": {"match": {"title": "python"}}},
index="orders-*",
doc_type="books"
)
"""
scroll_kwargs = scroll_kwargs or {}
if not preserve_order:
query = query.copy() if query else {}
query["sort"] = "_doc"
# initial search
resp = client.search(
body=query, scroll=scroll, size=size, request_timeout=request_timeout, **kwargs
)
scroll_id = resp.get("_scroll_id")
try:
while scroll_id and resp['hits']['hits']:
for hit in resp["hits"]["hits"]:
yield hit
# check if we have any errors
if resp["_shards"]["successful"] < resp["_shards"]["total"]:
logger.warning(
"Scroll request has only succeeded on %d shards out of %d.",
resp["_shards"]["successful"],
resp["_shards"]["total"],
)
if raise_on_error:
raise ScanError(
scroll_id,
"Scroll request has only succeeded on %d shards out of %d."
% (resp["_shards"]["successful"], resp["_shards"]["total"]),
)
resp = client.scroll(
scroll_id,
scroll=scroll,
request_timeout=request_timeout,
**scroll_kwargs
)
scroll_id = resp.get("_scroll_id")
finally:
if scroll_id and clear_scroll:
client.clear_scroll(body={"scroll_id": [scroll_id]}, ignore=(404,)) | python | def scan(
client,
query=None,
scroll="5m",
raise_on_error=True,
preserve_order=False,
size=1000,
request_timeout=None,
clear_scroll=True,
scroll_kwargs=None,
**kwargs
):
"""
Simple abstraction on top of the
:meth:`~elasticsearch.Elasticsearch.scroll` api - a simple iterator that
yields all hits as returned by underlining scroll requests.
By default scan does not return results in any pre-determined order. To
have a standard order in the returned documents (either by score or
explicit sort definition) when scrolling, use ``preserve_order=True``. This
may be an expensive operation and will negate the performance benefits of
using ``scan``.
:arg client: instance of :class:`~elasticsearch.Elasticsearch` to use
:arg query: body for the :meth:`~elasticsearch.Elasticsearch.search` api
:arg scroll: Specify how long a consistent view of the index should be
maintained for scrolled search
:arg raise_on_error: raises an exception (``ScanError``) if an error is
encountered (some shards fail to execute). By default we raise.
:arg preserve_order: don't set the ``search_type`` to ``scan`` - this will
cause the scroll to paginate with preserving the order. Note that this
can be an extremely expensive operation and can easily lead to
unpredictable results, use with caution.
:arg size: size (per shard) of the batch send at each iteration.
:arg request_timeout: explicit timeout for each call to ``scan``
:arg clear_scroll: explicitly calls delete on the scroll id via the clear
scroll API at the end of the method on completion or error, defaults
to true.
:arg scroll_kwargs: additional kwargs to be passed to
:meth:`~elasticsearch.Elasticsearch.scroll`
Any additional keyword arguments will be passed to the initial
:meth:`~elasticsearch.Elasticsearch.search` call::
scan(es,
query={"query": {"match": {"title": "python"}}},
index="orders-*",
doc_type="books"
)
"""
scroll_kwargs = scroll_kwargs or {}
if not preserve_order:
query = query.copy() if query else {}
query["sort"] = "_doc"
# initial search
resp = client.search(
body=query, scroll=scroll, size=size, request_timeout=request_timeout, **kwargs
)
scroll_id = resp.get("_scroll_id")
try:
while scroll_id and resp['hits']['hits']:
for hit in resp["hits"]["hits"]:
yield hit
# check if we have any errors
if resp["_shards"]["successful"] < resp["_shards"]["total"]:
logger.warning(
"Scroll request has only succeeded on %d shards out of %d.",
resp["_shards"]["successful"],
resp["_shards"]["total"],
)
if raise_on_error:
raise ScanError(
scroll_id,
"Scroll request has only succeeded on %d shards out of %d."
% (resp["_shards"]["successful"], resp["_shards"]["total"]),
)
resp = client.scroll(
scroll_id,
scroll=scroll,
request_timeout=request_timeout,
**scroll_kwargs
)
scroll_id = resp.get("_scroll_id")
finally:
if scroll_id and clear_scroll:
client.clear_scroll(body={"scroll_id": [scroll_id]}, ignore=(404,)) | [
"def",
"scan",
"(",
"client",
",",
"query",
"=",
"None",
",",
"scroll",
"=",
"\"5m\"",
",",
"raise_on_error",
"=",
"True",
",",
"preserve_order",
"=",
"False",
",",
"size",
"=",
"1000",
",",
"request_timeout",
"=",
"None",
",",
"clear_scroll",
"=",
"True",
",",
"scroll_kwargs",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"scroll_kwargs",
"=",
"scroll_kwargs",
"or",
"{",
"}",
"if",
"not",
"preserve_order",
":",
"query",
"=",
"query",
".",
"copy",
"(",
")",
"if",
"query",
"else",
"{",
"}",
"query",
"[",
"\"sort\"",
"]",
"=",
"\"_doc\"",
"# initial search",
"resp",
"=",
"client",
".",
"search",
"(",
"body",
"=",
"query",
",",
"scroll",
"=",
"scroll",
",",
"size",
"=",
"size",
",",
"request_timeout",
"=",
"request_timeout",
",",
"*",
"*",
"kwargs",
")",
"scroll_id",
"=",
"resp",
".",
"get",
"(",
"\"_scroll_id\"",
")",
"try",
":",
"while",
"scroll_id",
"and",
"resp",
"[",
"'hits'",
"]",
"[",
"'hits'",
"]",
":",
"for",
"hit",
"in",
"resp",
"[",
"\"hits\"",
"]",
"[",
"\"hits\"",
"]",
":",
"yield",
"hit",
"# check if we have any errors",
"if",
"resp",
"[",
"\"_shards\"",
"]",
"[",
"\"successful\"",
"]",
"<",
"resp",
"[",
"\"_shards\"",
"]",
"[",
"\"total\"",
"]",
":",
"logger",
".",
"warning",
"(",
"\"Scroll request has only succeeded on %d shards out of %d.\"",
",",
"resp",
"[",
"\"_shards\"",
"]",
"[",
"\"successful\"",
"]",
",",
"resp",
"[",
"\"_shards\"",
"]",
"[",
"\"total\"",
"]",
",",
")",
"if",
"raise_on_error",
":",
"raise",
"ScanError",
"(",
"scroll_id",
",",
"\"Scroll request has only succeeded on %d shards out of %d.\"",
"%",
"(",
"resp",
"[",
"\"_shards\"",
"]",
"[",
"\"successful\"",
"]",
",",
"resp",
"[",
"\"_shards\"",
"]",
"[",
"\"total\"",
"]",
")",
",",
")",
"resp",
"=",
"client",
".",
"scroll",
"(",
"scroll_id",
",",
"scroll",
"=",
"scroll",
",",
"request_timeout",
"=",
"request_timeout",
",",
"*",
"*",
"scroll_kwargs",
")",
"scroll_id",
"=",
"resp",
".",
"get",
"(",
"\"_scroll_id\"",
")",
"finally",
":",
"if",
"scroll_id",
"and",
"clear_scroll",
":",
"client",
".",
"clear_scroll",
"(",
"body",
"=",
"{",
"\"scroll_id\"",
":",
"[",
"scroll_id",
"]",
"}",
",",
"ignore",
"=",
"(",
"404",
",",
")",
")"
] | Simple abstraction on top of the
:meth:`~elasticsearch.Elasticsearch.scroll` api - a simple iterator that
yields all hits as returned by underlining scroll requests.
By default scan does not return results in any pre-determined order. To
have a standard order in the returned documents (either by score or
explicit sort definition) when scrolling, use ``preserve_order=True``. This
may be an expensive operation and will negate the performance benefits of
using ``scan``.
:arg client: instance of :class:`~elasticsearch.Elasticsearch` to use
:arg query: body for the :meth:`~elasticsearch.Elasticsearch.search` api
:arg scroll: Specify how long a consistent view of the index should be
maintained for scrolled search
:arg raise_on_error: raises an exception (``ScanError``) if an error is
encountered (some shards fail to execute). By default we raise.
:arg preserve_order: don't set the ``search_type`` to ``scan`` - this will
cause the scroll to paginate with preserving the order. Note that this
can be an extremely expensive operation and can easily lead to
unpredictable results, use with caution.
:arg size: size (per shard) of the batch send at each iteration.
:arg request_timeout: explicit timeout for each call to ``scan``
:arg clear_scroll: explicitly calls delete on the scroll id via the clear
scroll API at the end of the method on completion or error, defaults
to true.
:arg scroll_kwargs: additional kwargs to be passed to
:meth:`~elasticsearch.Elasticsearch.scroll`
Any additional keyword arguments will be passed to the initial
:meth:`~elasticsearch.Elasticsearch.search` call::
scan(es,
query={"query": {"match": {"title": "python"}}},
index="orders-*",
doc_type="books"
) | [
"Simple",
"abstraction",
"on",
"top",
"of",
"the",
":",
"meth",
":",
"~elasticsearch",
".",
"Elasticsearch",
".",
"scroll",
"api",
"-",
"a",
"simple",
"iterator",
"that",
"yields",
"all",
"hits",
"as",
"returned",
"by",
"underlining",
"scroll",
"requests",
"."
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/helpers/actions.py#L376-L468 | train |
elastic/elasticsearch-py | elasticsearch/helpers/actions.py | reindex | def reindex(
client,
source_index,
target_index,
query=None,
target_client=None,
chunk_size=500,
scroll="5m",
scan_kwargs={},
bulk_kwargs={},
):
"""
Reindex all documents from one index that satisfy a given query
to another, potentially (if `target_client` is specified) on a different cluster.
If you don't specify the query you will reindex all the documents.
Since ``2.3`` a :meth:`~elasticsearch.Elasticsearch.reindex` api is
available as part of elasticsearch itself. It is recommended to use the api
instead of this helper wherever possible. The helper is here mostly for
backwards compatibility and for situations where more flexibility is
needed.
.. note::
This helper doesn't transfer mappings, just the data.
:arg client: instance of :class:`~elasticsearch.Elasticsearch` to use (for
read if `target_client` is specified as well)
:arg source_index: index (or list of indices) to read documents from
:arg target_index: name of the index in the target cluster to populate
:arg query: body for the :meth:`~elasticsearch.Elasticsearch.search` api
:arg target_client: optional, is specified will be used for writing (thus
enabling reindex between clusters)
:arg chunk_size: number of docs in one chunk sent to es (default: 500)
:arg scroll: Specify how long a consistent view of the index should be
maintained for scrolled search
:arg scan_kwargs: additional kwargs to be passed to
:func:`~elasticsearch.helpers.scan`
:arg bulk_kwargs: additional kwargs to be passed to
:func:`~elasticsearch.helpers.bulk`
"""
target_client = client if target_client is None else target_client
docs = scan(client, query=query, index=source_index, scroll=scroll, **scan_kwargs)
def _change_doc_index(hits, index):
for h in hits:
h["_index"] = index
if "fields" in h:
h.update(h.pop("fields"))
yield h
kwargs = {"stats_only": True}
kwargs.update(bulk_kwargs)
return bulk(
target_client,
_change_doc_index(docs, target_index),
chunk_size=chunk_size,
**kwargs
) | python | def reindex(
client,
source_index,
target_index,
query=None,
target_client=None,
chunk_size=500,
scroll="5m",
scan_kwargs={},
bulk_kwargs={},
):
"""
Reindex all documents from one index that satisfy a given query
to another, potentially (if `target_client` is specified) on a different cluster.
If you don't specify the query you will reindex all the documents.
Since ``2.3`` a :meth:`~elasticsearch.Elasticsearch.reindex` api is
available as part of elasticsearch itself. It is recommended to use the api
instead of this helper wherever possible. The helper is here mostly for
backwards compatibility and for situations where more flexibility is
needed.
.. note::
This helper doesn't transfer mappings, just the data.
:arg client: instance of :class:`~elasticsearch.Elasticsearch` to use (for
read if `target_client` is specified as well)
:arg source_index: index (or list of indices) to read documents from
:arg target_index: name of the index in the target cluster to populate
:arg query: body for the :meth:`~elasticsearch.Elasticsearch.search` api
:arg target_client: optional, is specified will be used for writing (thus
enabling reindex between clusters)
:arg chunk_size: number of docs in one chunk sent to es (default: 500)
:arg scroll: Specify how long a consistent view of the index should be
maintained for scrolled search
:arg scan_kwargs: additional kwargs to be passed to
:func:`~elasticsearch.helpers.scan`
:arg bulk_kwargs: additional kwargs to be passed to
:func:`~elasticsearch.helpers.bulk`
"""
target_client = client if target_client is None else target_client
docs = scan(client, query=query, index=source_index, scroll=scroll, **scan_kwargs)
def _change_doc_index(hits, index):
for h in hits:
h["_index"] = index
if "fields" in h:
h.update(h.pop("fields"))
yield h
kwargs = {"stats_only": True}
kwargs.update(bulk_kwargs)
return bulk(
target_client,
_change_doc_index(docs, target_index),
chunk_size=chunk_size,
**kwargs
) | [
"def",
"reindex",
"(",
"client",
",",
"source_index",
",",
"target_index",
",",
"query",
"=",
"None",
",",
"target_client",
"=",
"None",
",",
"chunk_size",
"=",
"500",
",",
"scroll",
"=",
"\"5m\"",
",",
"scan_kwargs",
"=",
"{",
"}",
",",
"bulk_kwargs",
"=",
"{",
"}",
",",
")",
":",
"target_client",
"=",
"client",
"if",
"target_client",
"is",
"None",
"else",
"target_client",
"docs",
"=",
"scan",
"(",
"client",
",",
"query",
"=",
"query",
",",
"index",
"=",
"source_index",
",",
"scroll",
"=",
"scroll",
",",
"*",
"*",
"scan_kwargs",
")",
"def",
"_change_doc_index",
"(",
"hits",
",",
"index",
")",
":",
"for",
"h",
"in",
"hits",
":",
"h",
"[",
"\"_index\"",
"]",
"=",
"index",
"if",
"\"fields\"",
"in",
"h",
":",
"h",
".",
"update",
"(",
"h",
".",
"pop",
"(",
"\"fields\"",
")",
")",
"yield",
"h",
"kwargs",
"=",
"{",
"\"stats_only\"",
":",
"True",
"}",
"kwargs",
".",
"update",
"(",
"bulk_kwargs",
")",
"return",
"bulk",
"(",
"target_client",
",",
"_change_doc_index",
"(",
"docs",
",",
"target_index",
")",
",",
"chunk_size",
"=",
"chunk_size",
",",
"*",
"*",
"kwargs",
")"
] | Reindex all documents from one index that satisfy a given query
to another, potentially (if `target_client` is specified) on a different cluster.
If you don't specify the query you will reindex all the documents.
Since ``2.3`` a :meth:`~elasticsearch.Elasticsearch.reindex` api is
available as part of elasticsearch itself. It is recommended to use the api
instead of this helper wherever possible. The helper is here mostly for
backwards compatibility and for situations where more flexibility is
needed.
.. note::
This helper doesn't transfer mappings, just the data.
:arg client: instance of :class:`~elasticsearch.Elasticsearch` to use (for
read if `target_client` is specified as well)
:arg source_index: index (or list of indices) to read documents from
:arg target_index: name of the index in the target cluster to populate
:arg query: body for the :meth:`~elasticsearch.Elasticsearch.search` api
:arg target_client: optional, is specified will be used for writing (thus
enabling reindex between clusters)
:arg chunk_size: number of docs in one chunk sent to es (default: 500)
:arg scroll: Specify how long a consistent view of the index should be
maintained for scrolled search
:arg scan_kwargs: additional kwargs to be passed to
:func:`~elasticsearch.helpers.scan`
:arg bulk_kwargs: additional kwargs to be passed to
:func:`~elasticsearch.helpers.bulk` | [
"Reindex",
"all",
"documents",
"from",
"one",
"index",
"that",
"satisfy",
"a",
"given",
"query",
"to",
"another",
"potentially",
"(",
"if",
"target_client",
"is",
"specified",
")",
"on",
"a",
"different",
"cluster",
".",
"If",
"you",
"don",
"t",
"specify",
"the",
"query",
"you",
"will",
"reindex",
"all",
"the",
"documents",
"."
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/helpers/actions.py#L471-L530 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/data_frame.py | Data_FrameClient.get_data_frame_transform | def get_data_frame_transform(self, transform_id=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html>`_
:arg transform_id: The id or comma delimited list of id expressions of
the transforms to get, '_all' or '*' implies get all transforms
:arg from_: skips a number of transform configs, defaults to 0
:arg size: specifies a max number of transforms to get, defaults to 100
"""
return self.transport.perform_request(
"GET", _make_path("_data_frame", "transforms", transform_id), params=params
) | python | def get_data_frame_transform(self, transform_id=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html>`_
:arg transform_id: The id or comma delimited list of id expressions of
the transforms to get, '_all' or '*' implies get all transforms
:arg from_: skips a number of transform configs, defaults to 0
:arg size: specifies a max number of transforms to get, defaults to 100
"""
return self.transport.perform_request(
"GET", _make_path("_data_frame", "transforms", transform_id), params=params
) | [
"def",
"get_data_frame_transform",
"(",
"self",
",",
"transform_id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_data_frame\"",
",",
"\"transforms\"",
",",
"transform_id",
")",
",",
"params",
"=",
"params",
")"
] | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html>`_
:arg transform_id: The id or comma delimited list of id expressions of
the transforms to get, '_all' or '*' implies get all transforms
:arg from_: skips a number of transform configs, defaults to 0
:arg size: specifies a max number of transforms to get, defaults to 100 | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"get",
"-",
"data",
"-",
"frame",
"-",
"transform",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/data_frame.py#L23-L34 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/data_frame.py | Data_FrameClient.get_data_frame_transform_stats | def get_data_frame_transform_stats(self, transform_id=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html>`_
:arg transform_id: The id of the transform for which to get stats.
'_all' or '*' implies all transforms
"""
return self.transport.perform_request(
"GET",
_make_path("_data_frame", "transforms", transform_id, "_stats"),
params=params,
) | python | def get_data_frame_transform_stats(self, transform_id=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html>`_
:arg transform_id: The id of the transform for which to get stats.
'_all' or '*' implies all transforms
"""
return self.transport.perform_request(
"GET",
_make_path("_data_frame", "transforms", transform_id, "_stats"),
params=params,
) | [
"def",
"get_data_frame_transform_stats",
"(",
"self",
",",
"transform_id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_data_frame\"",
",",
"\"transforms\"",
",",
"transform_id",
",",
"\"_stats\"",
")",
",",
"params",
"=",
"params",
",",
")"
] | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html>`_
:arg transform_id: The id of the transform for which to get stats.
'_all' or '*' implies all transforms | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"get",
"-",
"data",
"-",
"frame",
"-",
"transform",
"-",
"stats",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/data_frame.py#L37-L48 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/data_frame.py | Data_FrameClient.preview_data_frame_transform | def preview_data_frame_transform(self, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html>`_
:arg body: The definition for the data_frame transform to preview
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
return self.transport.perform_request(
"POST", "/_data_frame/transforms/_preview", params=params, body=body
) | python | def preview_data_frame_transform(self, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html>`_
:arg body: The definition for the data_frame transform to preview
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
return self.transport.perform_request(
"POST", "/_data_frame/transforms/_preview", params=params, body=body
) | [
"def",
"preview_data_frame_transform",
"(",
"self",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"\"/_data_frame/transforms/_preview\"",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
")"
] | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html>`_
:arg body: The definition for the data_frame transform to preview | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"preview",
"-",
"data",
"-",
"frame",
"-",
"transform",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/data_frame.py#L51-L61 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/data_frame.py | Data_FrameClient.put_data_frame_transform | def put_data_frame_transform(self, transform_id, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html>`_
:arg transform_id: The id of the new transform.
:arg body: The data frame transform definition
"""
for param in (transform_id, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"PUT",
_make_path("_data_frame", "transforms", transform_id),
params=params,
body=body,
) | python | def put_data_frame_transform(self, transform_id, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html>`_
:arg transform_id: The id of the new transform.
:arg body: The data frame transform definition
"""
for param in (transform_id, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"PUT",
_make_path("_data_frame", "transforms", transform_id),
params=params,
body=body,
) | [
"def",
"put_data_frame_transform",
"(",
"self",
",",
"transform_id",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"transform_id",
",",
"body",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"PUT\"",
",",
"_make_path",
"(",
"\"_data_frame\"",
",",
"\"transforms\"",
",",
"transform_id",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
",",
")"
] | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html>`_
:arg transform_id: The id of the new transform.
:arg body: The data frame transform definition | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"put",
"-",
"data",
"-",
"frame",
"-",
"transform",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/data_frame.py#L64-L79 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/data_frame.py | Data_FrameClient.stop_data_frame_transform | def stop_data_frame_transform(self, transform_id, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html>`_
:arg transform_id: The id of the transform to stop
:arg timeout: Controls the time to wait until the transform has stopped.
Default to 30 seconds
:arg wait_for_completion: Whether to wait for the transform to fully
stop before returning or not. Default to false
"""
if transform_id in SKIP_IN_PATH:
raise ValueError(
"Empty value passed for a required argument 'transform_id'."
)
return self.transport.perform_request(
"POST",
_make_path("_data_frame", "transforms", transform_id, "_stop"),
params=params,
) | python | def stop_data_frame_transform(self, transform_id, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html>`_
:arg transform_id: The id of the transform to stop
:arg timeout: Controls the time to wait until the transform has stopped.
Default to 30 seconds
:arg wait_for_completion: Whether to wait for the transform to fully
stop before returning or not. Default to false
"""
if transform_id in SKIP_IN_PATH:
raise ValueError(
"Empty value passed for a required argument 'transform_id'."
)
return self.transport.perform_request(
"POST",
_make_path("_data_frame", "transforms", transform_id, "_stop"),
params=params,
) | [
"def",
"stop_data_frame_transform",
"(",
"self",
",",
"transform_id",
",",
"params",
"=",
"None",
")",
":",
"if",
"transform_id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'transform_id'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"\"_data_frame\"",
",",
"\"transforms\"",
",",
"transform_id",
",",
"\"_stop\"",
")",
",",
"params",
"=",
"params",
",",
")"
] | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html>`_
:arg transform_id: The id of the transform to stop
:arg timeout: Controls the time to wait until the transform has stopped.
Default to 30 seconds
:arg wait_for_completion: Whether to wait for the transform to fully
stop before returning or not. Default to false | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"stop",
"-",
"data",
"-",
"frame",
"-",
"transform",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/data_frame.py#L100-L118 | train |
elastic/elasticsearch-py | elasticsearch/client/cat.py | CatClient.allocation | def allocation(self, node_id=None, params=None):
"""
Allocation provides a snapshot of how shards have located around the
cluster and the state of disk usage.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html>`_
:arg node_id: A comma-separated list of node IDs or names to limit the
returned information
:arg bytes: The unit in which to display byte values, valid choices are:
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False
"""
return self.transport.perform_request('GET', _make_path('_cat',
'allocation', node_id), params=params) | python | def allocation(self, node_id=None, params=None):
"""
Allocation provides a snapshot of how shards have located around the
cluster and the state of disk usage.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html>`_
:arg node_id: A comma-separated list of node IDs or names to limit the
returned information
:arg bytes: The unit in which to display byte values, valid choices are:
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False
"""
return self.transport.perform_request('GET', _make_path('_cat',
'allocation', node_id), params=params) | [
"def",
"allocation",
"(",
"self",
",",
"node_id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cat'",
",",
"'allocation'",
",",
"node_id",
")",
",",
"params",
"=",
"params",
")"
] | Allocation provides a snapshot of how shards have located around the
cluster and the state of disk usage.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html>`_
:arg node_id: A comma-separated list of node IDs or names to limit the
returned information
:arg bytes: The unit in which to display byte values, valid choices are:
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False | [
"Allocation",
"provides",
"a",
"snapshot",
"of",
"how",
"shards",
"have",
"located",
"around",
"the",
"cluster",
"and",
"the",
"state",
"of",
"disk",
"usage",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cat",
"-",
"allocation",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cat.py#L27-L49 | train |
elastic/elasticsearch-py | elasticsearch/client/cat.py | CatClient.count | def count(self, index=None, params=None):
"""
Count provides quick access to the document count of the entire cluster,
or individual indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-count.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False
"""
return self.transport.perform_request('GET', _make_path('_cat', 'count',
index), params=params) | python | def count(self, index=None, params=None):
"""
Count provides quick access to the document count of the entire cluster,
or individual indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-count.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False
"""
return self.transport.perform_request('GET', _make_path('_cat', 'count',
index), params=params) | [
"def",
"count",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cat'",
",",
"'count'",
",",
"index",
")",
",",
"params",
"=",
"params",
")"
] | Count provides quick access to the document count of the entire cluster,
or individual indices.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-count.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False | [
"Count",
"provides",
"quick",
"access",
"to",
"the",
"document",
"count",
"of",
"the",
"entire",
"cluster",
"or",
"individual",
"indices",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cat",
"-",
"count",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cat.py#L52-L72 | train |
elastic/elasticsearch-py | elasticsearch/client/cat.py | CatClient.indices | def indices(self, index=None, params=None):
"""
The indices command provides a cross-section of each index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg bytes: The unit in which to display byte values, valid choices are:
'b', 'k', 'm', 'g'
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg health: A health status ("green", "yellow", or "red" to filter only
indices matching the specified health status, default None, valid
choices are: 'green', 'yellow', 'red'
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg pri: Set to true to return stats only for primary shards, default
False
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False
"""
return self.transport.perform_request('GET', _make_path('_cat',
'indices', index), params=params) | python | def indices(self, index=None, params=None):
"""
The indices command provides a cross-section of each index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg bytes: The unit in which to display byte values, valid choices are:
'b', 'k', 'm', 'g'
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg health: A health status ("green", "yellow", or "red" to filter only
indices matching the specified health status, default None, valid
choices are: 'green', 'yellow', 'red'
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg pri: Set to true to return stats only for primary shards, default
False
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False
"""
return self.transport.perform_request('GET', _make_path('_cat',
'indices', index), params=params) | [
"def",
"indices",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cat'",
",",
"'indices'",
",",
"index",
")",
",",
"params",
"=",
"params",
")"
] | The indices command provides a cross-section of each index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg bytes: The unit in which to display byte values, valid choices are:
'b', 'k', 'm', 'g'
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg health: A health status ("green", "yellow", or "red" to filter only
indices matching the specified health status, default None, valid
choices are: 'green', 'yellow', 'red'
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg pri: Set to true to return stats only for primary shards, default
False
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False | [
"The",
"indices",
"command",
"provides",
"a",
"cross",
"-",
"section",
"of",
"each",
"index",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cat",
"-",
"indices",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cat.py#L111-L137 | train |
elastic/elasticsearch-py | elasticsearch/client/cat.py | CatClient.recovery | def recovery(self, index=None, params=None):
"""
recovery is a view of shard replication.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-recovery.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg bytes: The unit in which to display byte values, valid choices are:
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False
"""
return self.transport.perform_request('GET', _make_path('_cat',
'recovery', index), params=params) | python | def recovery(self, index=None, params=None):
"""
recovery is a view of shard replication.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-recovery.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg bytes: The unit in which to display byte values, valid choices are:
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False
"""
return self.transport.perform_request('GET', _make_path('_cat',
'recovery', index), params=params) | [
"def",
"recovery",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cat'",
",",
"'recovery'",
",",
"index",
")",
",",
"params",
"=",
"params",
")"
] | recovery is a view of shard replication.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-recovery.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg bytes: The unit in which to display byte values, valid choices are:
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False | [
"recovery",
"is",
"a",
"view",
"of",
"shard",
"replication",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cat",
"-",
"recovery",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cat.py#L183-L202 | train |
elastic/elasticsearch-py | elasticsearch/client/cat.py | CatClient.shards | def shards(self, index=None, params=None):
"""
The shards command is the detailed view of what nodes contain which shards.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg bytes: The unit in which to display byte values, valid choices are:
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False
"""
return self.transport.perform_request('GET', _make_path('_cat',
'shards', index), params=params) | python | def shards(self, index=None, params=None):
"""
The shards command is the detailed view of what nodes contain which shards.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg bytes: The unit in which to display byte values, valid choices are:
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False
"""
return self.transport.perform_request('GET', _make_path('_cat',
'shards', index), params=params) | [
"def",
"shards",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cat'",
",",
"'shards'",
",",
"index",
")",
",",
"params",
"=",
"params",
")"
] | The shards command is the detailed view of what nodes contain which shards.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg bytes: The unit in which to display byte values, valid choices are:
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False | [
"The",
"shards",
"command",
"is",
"the",
"detailed",
"view",
"of",
"what",
"nodes",
"contain",
"which",
"shards",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cat",
"-",
"shards",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cat.py#L205-L226 | train |
elastic/elasticsearch-py | elasticsearch/client/cat.py | CatClient.segments | def segments(self, index=None, params=None):
"""
The segments command is the detailed view of Lucene segments per index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-segments.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg bytes: The unit in which to display byte values, valid choices are:
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False
"""
return self.transport.perform_request('GET', _make_path('_cat',
'segments', index), params=params) | python | def segments(self, index=None, params=None):
"""
The segments command is the detailed view of Lucene segments per index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-segments.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg bytes: The unit in which to display byte values, valid choices are:
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False
"""
return self.transport.perform_request('GET', _make_path('_cat',
'segments', index), params=params) | [
"def",
"segments",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cat'",
",",
"'segments'",
",",
"index",
")",
",",
"params",
"=",
"params",
")"
] | The segments command is the detailed view of Lucene segments per index.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-segments.html>`_
:arg index: A comma-separated list of index names to limit the returned
information
:arg bytes: The unit in which to display byte values, valid choices are:
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False | [
"The",
"segments",
"command",
"is",
"the",
"detailed",
"view",
"of",
"Lucene",
"segments",
"per",
"index",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cat",
"-",
"segments",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cat.py#L229-L246 | train |
elastic/elasticsearch-py | elasticsearch/client/cat.py | CatClient.thread_pool | def thread_pool(self, thread_pool_patterns=None, params=None):
"""
Get information about thread pools.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-thread-pool.html>`_
:arg thread_pool_patterns: A comma-separated list of regular-expressions
to filter the thread pools in the output
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg size: The multiplier in which to display values, valid choices are:
'', 'k', 'm', 'g', 't', 'p'
:arg v: Verbose mode. Display column headers, default False
"""
return self.transport.perform_request('GET', _make_path('_cat',
'thread_pool', thread_pool_patterns), params=params) | python | def thread_pool(self, thread_pool_patterns=None, params=None):
"""
Get information about thread pools.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-thread-pool.html>`_
:arg thread_pool_patterns: A comma-separated list of regular-expressions
to filter the thread pools in the output
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg size: The multiplier in which to display values, valid choices are:
'', 'k', 'm', 'g', 't', 'p'
:arg v: Verbose mode. Display column headers, default False
"""
return self.transport.perform_request('GET', _make_path('_cat',
'thread_pool', thread_pool_patterns), params=params) | [
"def",
"thread_pool",
"(",
"self",
",",
"thread_pool_patterns",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cat'",
",",
"'thread_pool'",
",",
"thread_pool_patterns",
")",
",",
"params",
"=",
"params",
")"
] | Get information about thread pools.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-thread-pool.html>`_
:arg thread_pool_patterns: A comma-separated list of regular-expressions
to filter the thread pools in the output
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg size: The multiplier in which to display values, valid choices are:
'', 'k', 'm', 'g', 't', 'p'
:arg v: Verbose mode. Display column headers, default False | [
"Get",
"information",
"about",
"thread",
"pools",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cat",
"-",
"thread",
"-",
"pool",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cat.py#L272-L293 | train |
elastic/elasticsearch-py | elasticsearch/client/cat.py | CatClient.fielddata | def fielddata(self, fields=None, params=None):
"""
Shows information about currently loaded fielddata on a per-node basis.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-fielddata.html>`_
:arg fields: A comma-separated list of fields to return the fielddata
size
:arg bytes: The unit in which to display byte values, valid choices are:
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False
"""
return self.transport.perform_request('GET', _make_path('_cat',
'fielddata', fields), params=params) | python | def fielddata(self, fields=None, params=None):
"""
Shows information about currently loaded fielddata on a per-node basis.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-fielddata.html>`_
:arg fields: A comma-separated list of fields to return the fielddata
size
:arg bytes: The unit in which to display byte values, valid choices are:
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False
"""
return self.transport.perform_request('GET', _make_path('_cat',
'fielddata', fields), params=params) | [
"def",
"fielddata",
"(",
"self",
",",
"fields",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cat'",
",",
"'fielddata'",
",",
"fields",
")",
",",
"params",
"=",
"params",
")"
] | Shows information about currently loaded fielddata on a per-node basis.
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-fielddata.html>`_
:arg fields: A comma-separated list of fields to return the fielddata
size
:arg bytes: The unit in which to display byte values, valid choices are:
'b', 'k', 'kb', 'm', 'mb', 'g', 'gb', 't', 'tb', 'p', 'pb'
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False | [
"Shows",
"information",
"about",
"currently",
"loaded",
"fielddata",
"on",
"a",
"per",
"-",
"node",
"basis",
".",
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cat",
"-",
"fielddata",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cat.py#L297-L318 | train |
elastic/elasticsearch-py | elasticsearch/client/cat.py | CatClient.templates | def templates(self, name=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-templates.html>`_
:arg name: A pattern that returned template names must match
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False
"""
return self.transport.perform_request('GET', _make_path('_cat',
'templates', name), params=params) | python | def templates(self, name=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-templates.html>`_
:arg name: A pattern that returned template names must match
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False
"""
return self.transport.perform_request('GET', _make_path('_cat',
'templates', name), params=params) | [
"def",
"templates",
"(",
"self",
",",
"name",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cat'",
",",
"'templates'",
",",
"name",
")",
",",
"params",
"=",
"params",
")"
] | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-templates.html>`_
:arg name: A pattern that returned template names must match
:arg format: a short version of the Accept header, e.g. json, yaml
:arg h: Comma-separated list of column names to display
:arg help: Return help information, default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg s: Comma-separated list of column names or column aliases to sort
by
:arg v: Verbose mode. Display column headers, default False | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cat",
"-",
"templates",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cat.py#L432-L449 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/watcher.py | WatcherClient.ack_watch | def ack_watch(self, watch_id, action_id=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html>`_
:arg watch_id: Watch ID
:arg action_id: A comma-separated list of the action ids to be acked
"""
if watch_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'watch_id'.")
return self.transport.perform_request(
"PUT",
_make_path("_watcher", "watch", watch_id, "_ack", action_id),
params=params,
) | python | def ack_watch(self, watch_id, action_id=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html>`_
:arg watch_id: Watch ID
:arg action_id: A comma-separated list of the action ids to be acked
"""
if watch_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'watch_id'.")
return self.transport.perform_request(
"PUT",
_make_path("_watcher", "watch", watch_id, "_ack", action_id),
params=params,
) | [
"def",
"ack_watch",
"(",
"self",
",",
"watch_id",
",",
"action_id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"watch_id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'watch_id'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"PUT\"",
",",
"_make_path",
"(",
"\"_watcher\"",
",",
"\"watch\"",
",",
"watch_id",
",",
"\"_ack\"",
",",
"action_id",
")",
",",
"params",
"=",
"params",
",",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html>`_
:arg watch_id: Watch ID
:arg action_id: A comma-separated list of the action ids to be acked | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"watcher",
"-",
"api",
"-",
"ack",
"-",
"watch",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/watcher.py#L6-L19 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/watcher.py | WatcherClient.activate_watch | def activate_watch(self, watch_id, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html>`_
:arg watch_id: Watch ID
"""
if watch_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'watch_id'.")
return self.transport.perform_request(
"PUT", _make_path("_watcher", "watch", watch_id, "_activate"), params=params
) | python | def activate_watch(self, watch_id, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html>`_
:arg watch_id: Watch ID
"""
if watch_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'watch_id'.")
return self.transport.perform_request(
"PUT", _make_path("_watcher", "watch", watch_id, "_activate"), params=params
) | [
"def",
"activate_watch",
"(",
"self",
",",
"watch_id",
",",
"params",
"=",
"None",
")",
":",
"if",
"watch_id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'watch_id'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"PUT\"",
",",
"_make_path",
"(",
"\"_watcher\"",
",",
"\"watch\"",
",",
"watch_id",
",",
"\"_activate\"",
")",
",",
"params",
"=",
"params",
")"
] | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html>`_
:arg watch_id: Watch ID | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"watcher",
"-",
"api",
"-",
"activate",
"-",
"watch",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/watcher.py#L22-L32 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/watcher.py | WatcherClient.delete_watch | def delete_watch(self, id, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html>`_
:arg id: Watch ID
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'id'.")
return self.transport.perform_request(
"DELETE", _make_path("_watcher", "watch", id), params=params
) | python | def delete_watch(self, id, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html>`_
:arg id: Watch ID
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'id'.")
return self.transport.perform_request(
"DELETE", _make_path("_watcher", "watch", id), params=params
) | [
"def",
"delete_watch",
"(",
"self",
",",
"id",
",",
"params",
"=",
"None",
")",
":",
"if",
"id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'id'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"DELETE\"",
",",
"_make_path",
"(",
"\"_watcher\"",
",",
"\"watch\"",
",",
"id",
")",
",",
"params",
"=",
"params",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html>`_
:arg id: Watch ID | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"watcher",
"-",
"api",
"-",
"delete",
"-",
"watch",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/watcher.py#L50-L60 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/watcher.py | WatcherClient.execute_watch | def execute_watch(self, id=None, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html>`_
:arg id: Watch ID
:arg body: Execution control
:arg debug: indicates whether the watch should execute in debug mode
"""
return self.transport.perform_request(
"PUT",
_make_path("_watcher", "watch", id, "_execute"),
params=params,
body=body,
) | python | def execute_watch(self, id=None, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html>`_
:arg id: Watch ID
:arg body: Execution control
:arg debug: indicates whether the watch should execute in debug mode
"""
return self.transport.perform_request(
"PUT",
_make_path("_watcher", "watch", id, "_execute"),
params=params,
body=body,
) | [
"def",
"execute_watch",
"(",
"self",
",",
"id",
"=",
"None",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"PUT\"",
",",
"_make_path",
"(",
"\"_watcher\"",
",",
"\"watch\"",
",",
"id",
",",
"\"_execute\"",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
",",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html>`_
:arg id: Watch ID
:arg body: Execution control
:arg debug: indicates whether the watch should execute in debug mode | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"watcher",
"-",
"api",
"-",
"execute",
"-",
"watch",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/watcher.py#L63-L76 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/watcher.py | WatcherClient.put_watch | def put_watch(self, id, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html>`_
:arg id: Watch ID
:arg body: The watch
:arg active: Specify whether the watch is in/active by default
:arg if_primary_term: only update the watch if the last operation that
has changed the watch has the specified primary term
:arg if_seq_no: only update the watch if the last operation that has
changed the watch has the specified sequence number
:arg version: Explicit version number for concurrency control
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'id'.")
return self.transport.perform_request(
"PUT", _make_path("_watcher", "watch", id), params=params, body=body
) | python | def put_watch(self, id, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html>`_
:arg id: Watch ID
:arg body: The watch
:arg active: Specify whether the watch is in/active by default
:arg if_primary_term: only update the watch if the last operation that
has changed the watch has the specified primary term
:arg if_seq_no: only update the watch if the last operation that has
changed the watch has the specified sequence number
:arg version: Explicit version number for concurrency control
"""
if id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'id'.")
return self.transport.perform_request(
"PUT", _make_path("_watcher", "watch", id), params=params, body=body
) | [
"def",
"put_watch",
"(",
"self",
",",
"id",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'id'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"PUT\"",
",",
"_make_path",
"(",
"\"_watcher\"",
",",
"\"watch\"",
",",
"id",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html>`_
:arg id: Watch ID
:arg body: The watch
:arg active: Specify whether the watch is in/active by default
:arg if_primary_term: only update the watch if the last operation that
has changed the watch has the specified primary term
:arg if_seq_no: only update the watch if the last operation that has
changed the watch has the specified sequence number
:arg version: Explicit version number for concurrency control | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"watcher",
"-",
"api",
"-",
"put",
"-",
"watch",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/watcher.py#L92-L109 | train |
elastic/elasticsearch-py | elasticsearch/client/cluster.py | ClusterClient.health | def health(self, index=None, params=None):
"""
Get a very simple status on the health of the cluster.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html>`_
:arg index: Limit the information returned to a specific index
:arg level: Specify the level of detail for returned information,
default 'cluster', valid choices are: 'cluster', 'indices', 'shards'
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg timeout: Explicit operation timeout
:arg wait_for_active_shards: Wait until the specified number of shards
is active
:arg wait_for_events: Wait until all currently queued events with the
given priority are processed, valid choices are: 'immediate',
'urgent', 'high', 'normal', 'low', 'languid'
:arg wait_for_no_relocating_shards: Whether to wait until there are no
relocating shards in the cluster
:arg wait_for_nodes: Wait until the specified number of nodes is
available
:arg wait_for_status: Wait until cluster is in a specific state, default
None, valid choices are: 'green', 'yellow', 'red'
"""
return self.transport.perform_request('GET', _make_path('_cluster',
'health', index), params=params) | python | def health(self, index=None, params=None):
"""
Get a very simple status on the health of the cluster.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html>`_
:arg index: Limit the information returned to a specific index
:arg level: Specify the level of detail for returned information,
default 'cluster', valid choices are: 'cluster', 'indices', 'shards'
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg timeout: Explicit operation timeout
:arg wait_for_active_shards: Wait until the specified number of shards
is active
:arg wait_for_events: Wait until all currently queued events with the
given priority are processed, valid choices are: 'immediate',
'urgent', 'high', 'normal', 'low', 'languid'
:arg wait_for_no_relocating_shards: Whether to wait until there are no
relocating shards in the cluster
:arg wait_for_nodes: Wait until the specified number of nodes is
available
:arg wait_for_status: Wait until cluster is in a specific state, default
None, valid choices are: 'green', 'yellow', 'red'
"""
return self.transport.perform_request('GET', _make_path('_cluster',
'health', index), params=params) | [
"def",
"health",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cluster'",
",",
"'health'",
",",
"index",
")",
",",
"params",
"=",
"params",
")"
] | Get a very simple status on the health of the cluster.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html>`_
:arg index: Limit the information returned to a specific index
:arg level: Specify the level of detail for returned information,
default 'cluster', valid choices are: 'cluster', 'indices', 'shards'
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg timeout: Explicit operation timeout
:arg wait_for_active_shards: Wait until the specified number of shards
is active
:arg wait_for_events: Wait until all currently queued events with the
given priority are processed, valid choices are: 'immediate',
'urgent', 'high', 'normal', 'low', 'languid'
:arg wait_for_no_relocating_shards: Whether to wait until there are no
relocating shards in the cluster
:arg wait_for_nodes: Wait until the specified number of nodes is
available
:arg wait_for_status: Wait until cluster is in a specific state, default
None, valid choices are: 'green', 'yellow', 'red' | [
"Get",
"a",
"very",
"simple",
"status",
"on",
"the",
"health",
"of",
"the",
"cluster",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cluster",
"-",
"health",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cluster.py#L8-L34 | train |
elastic/elasticsearch-py | elasticsearch/client/cluster.py | ClusterClient.state | def state(self, metric=None, index=None, params=None):
"""
Get a comprehensive state information of the whole cluster.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html>`_
:arg metric: Limit the information returned to the specified metrics
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg flat_settings: Return settings in flat format (default: false)
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Specify timeout for connection to master
"""
if index and not metric:
metric = '_all'
return self.transport.perform_request('GET', _make_path('_cluster',
'state', metric, index), params=params) | python | def state(self, metric=None, index=None, params=None):
"""
Get a comprehensive state information of the whole cluster.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html>`_
:arg metric: Limit the information returned to the specified metrics
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg flat_settings: Return settings in flat format (default: false)
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Specify timeout for connection to master
"""
if index and not metric:
metric = '_all'
return self.transport.perform_request('GET', _make_path('_cluster',
'state', metric, index), params=params) | [
"def",
"state",
"(",
"self",
",",
"metric",
"=",
"None",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"index",
"and",
"not",
"metric",
":",
"metric",
"=",
"'_all'",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_cluster'",
",",
"'state'",
",",
"metric",
",",
"index",
")",
",",
"params",
"=",
"params",
")"
] | Get a comprehensive state information of the whole cluster.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html>`_
:arg metric: Limit the information returned to the specified metrics
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg flat_settings: Return settings in flat format (default: false)
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Specify timeout for connection to master | [
"Get",
"a",
"comprehensive",
"state",
"information",
"of",
"the",
"whole",
"cluster",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cluster",
"-",
"state",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cluster.py#L53-L77 | train |
elastic/elasticsearch-py | elasticsearch/client/cluster.py | ClusterClient.stats | def stats(self, node_id=None, params=None):
"""
The Cluster Stats API allows to retrieve statistics from a cluster wide
perspective. The API returns basic index metrics and information about
the current nodes that form the cluster.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-stats.html>`_
:arg node_id: A comma-separated list of node IDs or names to limit the
returned information; use `_local` to return information from the
node you're connecting to, leave empty to get information from all
nodes
:arg flat_settings: Return settings in flat format (default: false)
:arg timeout: Explicit operation timeout
"""
url = '/_cluster/stats'
if node_id:
url = _make_path('_cluster/stats/nodes', node_id)
return self.transport.perform_request('GET', url, params=params) | python | def stats(self, node_id=None, params=None):
"""
The Cluster Stats API allows to retrieve statistics from a cluster wide
perspective. The API returns basic index metrics and information about
the current nodes that form the cluster.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-stats.html>`_
:arg node_id: A comma-separated list of node IDs or names to limit the
returned information; use `_local` to return information from the
node you're connecting to, leave empty to get information from all
nodes
:arg flat_settings: Return settings in flat format (default: false)
:arg timeout: Explicit operation timeout
"""
url = '/_cluster/stats'
if node_id:
url = _make_path('_cluster/stats/nodes', node_id)
return self.transport.perform_request('GET', url, params=params) | [
"def",
"stats",
"(",
"self",
",",
"node_id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"url",
"=",
"'/_cluster/stats'",
"if",
"node_id",
":",
"url",
"=",
"_make_path",
"(",
"'_cluster/stats/nodes'",
",",
"node_id",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"url",
",",
"params",
"=",
"params",
")"
] | The Cluster Stats API allows to retrieve statistics from a cluster wide
perspective. The API returns basic index metrics and information about
the current nodes that form the cluster.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-stats.html>`_
:arg node_id: A comma-separated list of node IDs or names to limit the
returned information; use `_local` to return information from the
node you're connecting to, leave empty to get information from all
nodes
:arg flat_settings: Return settings in flat format (default: false)
:arg timeout: Explicit operation timeout | [
"The",
"Cluster",
"Stats",
"API",
"allows",
"to",
"retrieve",
"statistics",
"from",
"a",
"cluster",
"wide",
"perspective",
".",
"The",
"API",
"returns",
"basic",
"index",
"metrics",
"and",
"information",
"about",
"the",
"current",
"nodes",
"that",
"form",
"the",
"cluster",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cluster",
"-",
"stats",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cluster.py#L80-L97 | train |
elastic/elasticsearch-py | elasticsearch/client/cluster.py | ClusterClient.reroute | def reroute(self, body=None, params=None):
"""
Explicitly execute a cluster reroute allocation command including specific commands.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html>`_
:arg body: The definition of `commands` to perform (`move`, `cancel`,
`allocate`)
:arg dry_run: Simulate the operation only and return the resulting state
:arg explain: Return an explanation of why the commands can or cannot be
executed
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg metric: Limit the information returned to the specified metrics.
Defaults to all but metadata, valid choices are: '_all', 'blocks',
'metadata', 'nodes', 'routing_table', 'master_node', 'version'
:arg retry_failed: Retries allocation of shards that are blocked due to
too many subsequent allocation failures
:arg timeout: Explicit operation timeout
"""
return self.transport.perform_request('POST', '/_cluster/reroute',
params=params, body=body) | python | def reroute(self, body=None, params=None):
"""
Explicitly execute a cluster reroute allocation command including specific commands.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html>`_
:arg body: The definition of `commands` to perform (`move`, `cancel`,
`allocate`)
:arg dry_run: Simulate the operation only and return the resulting state
:arg explain: Return an explanation of why the commands can or cannot be
executed
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg metric: Limit the information returned to the specified metrics.
Defaults to all but metadata, valid choices are: '_all', 'blocks',
'metadata', 'nodes', 'routing_table', 'master_node', 'version'
:arg retry_failed: Retries allocation of shards that are blocked due to
too many subsequent allocation failures
:arg timeout: Explicit operation timeout
"""
return self.transport.perform_request('POST', '/_cluster/reroute',
params=params, body=body) | [
"def",
"reroute",
"(",
"self",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'POST'",
",",
"'/_cluster/reroute'",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
")"
] | Explicitly execute a cluster reroute allocation command including specific commands.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html>`_
:arg body: The definition of `commands` to perform (`move`, `cancel`,
`allocate`)
:arg dry_run: Simulate the operation only and return the resulting state
:arg explain: Return an explanation of why the commands can or cannot be
executed
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg metric: Limit the information returned to the specified metrics.
Defaults to all but metadata, valid choices are: '_all', 'blocks',
'metadata', 'nodes', 'routing_table', 'master_node', 'version'
:arg retry_failed: Retries allocation of shards that are blocked due to
too many subsequent allocation failures
:arg timeout: Explicit operation timeout | [
"Explicitly",
"execute",
"a",
"cluster",
"reroute",
"allocation",
"command",
"including",
"specific",
"commands",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cluster",
"-",
"reroute",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cluster.py#L101-L121 | train |
elastic/elasticsearch-py | elasticsearch/client/cluster.py | ClusterClient.put_settings | def put_settings(self, body=None, params=None):
"""
Update cluster wide specific settings.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html>`_
:arg body: The settings to be updated. Can be either `transient` or
`persistent` (survives cluster restart).
:arg flat_settings: Return settings in flat format (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg timeout: Explicit operation timeout
"""
return self.transport.perform_request('PUT', '/_cluster/settings',
params=params, body=body) | python | def put_settings(self, body=None, params=None):
"""
Update cluster wide specific settings.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html>`_
:arg body: The settings to be updated. Can be either `transient` or
`persistent` (survives cluster restart).
:arg flat_settings: Return settings in flat format (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg timeout: Explicit operation timeout
"""
return self.transport.perform_request('PUT', '/_cluster/settings',
params=params, body=body) | [
"def",
"put_settings",
"(",
"self",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'PUT'",
",",
"'/_cluster/settings'",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
")"
] | Update cluster wide specific settings.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html>`_
:arg body: The settings to be updated. Can be either `transient` or
`persistent` (survives cluster restart).
:arg flat_settings: Return settings in flat format (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg timeout: Explicit operation timeout | [
"Update",
"cluster",
"wide",
"specific",
"settings",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cluster",
"-",
"update",
"-",
"settings",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cluster.py#L141-L154 | train |
elastic/elasticsearch-py | elasticsearch/client/cluster.py | ClusterClient.allocation_explain | def allocation_explain(self, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html>`_
:arg body: The index, shard, and primary flag to explain. Empty means
'explain the first unassigned shard'
:arg include_disk_info: Return information about disk usage and shard
sizes (default: false)
:arg include_yes_decisions: Return 'YES' decisions in explanation
(default: false)
"""
return self.transport.perform_request('GET',
'/_cluster/allocation/explain', params=params, body=body) | python | def allocation_explain(self, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html>`_
:arg body: The index, shard, and primary flag to explain. Empty means
'explain the first unassigned shard'
:arg include_disk_info: Return information about disk usage and shard
sizes (default: false)
:arg include_yes_decisions: Return 'YES' decisions in explanation
(default: false)
"""
return self.transport.perform_request('GET',
'/_cluster/allocation/explain', params=params, body=body) | [
"def",
"allocation_explain",
"(",
"self",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"'/_cluster/allocation/explain'",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html>`_
:arg body: The index, shard, and primary flag to explain. Empty means
'explain the first unassigned shard'
:arg include_disk_info: Return information about disk usage and shard
sizes (default: false)
:arg include_yes_decisions: Return 'YES' decisions in explanation
(default: false) | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"cluster",
"-",
"allocation",
"-",
"explain",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/cluster.py#L157-L169 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/migration.py | MigrationClient.deprecations | def deprecations(self, index=None, params=None):
"""
`<http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html>`_
:arg index: Index pattern
"""
return self.transport.perform_request(
"GET", _make_path(index, "_migration", "deprecations"), params=params
) | python | def deprecations(self, index=None, params=None):
"""
`<http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html>`_
:arg index: Index pattern
"""
return self.transport.perform_request(
"GET", _make_path(index, "_migration", "deprecations"), params=params
) | [
"def",
"deprecations",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"index",
",",
"\"_migration\"",
",",
"\"deprecations\"",
")",
",",
"params",
"=",
"params",
")"
] | `<http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html>`_
:arg index: Index pattern | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"migration",
"/",
"current",
"/",
"migration",
"-",
"api",
"-",
"deprecation",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/migration.py#L6-L14 | train |
elastic/elasticsearch-py | elasticsearch/connection_pool.py | ConnectionPool.get_connection | def get_connection(self):
"""
Return a connection from the pool using the `ConnectionSelector`
instance.
It tries to resurrect eligible connections, forces a resurrection when
no connections are availible and passes the list of live connections to
the selector instance to choose from.
Returns a connection instance and it's current fail count.
"""
self.resurrect()
connections = self.connections[:]
# no live nodes, resurrect one by force and return it
if not connections:
return self.resurrect(True)
# only call selector if we have a selection
if len(connections) > 1:
return self.selector.select(connections)
# only one connection, no need for a selector
return connections[0] | python | def get_connection(self):
"""
Return a connection from the pool using the `ConnectionSelector`
instance.
It tries to resurrect eligible connections, forces a resurrection when
no connections are availible and passes the list of live connections to
the selector instance to choose from.
Returns a connection instance and it's current fail count.
"""
self.resurrect()
connections = self.connections[:]
# no live nodes, resurrect one by force and return it
if not connections:
return self.resurrect(True)
# only call selector if we have a selection
if len(connections) > 1:
return self.selector.select(connections)
# only one connection, no need for a selector
return connections[0] | [
"def",
"get_connection",
"(",
"self",
")",
":",
"self",
".",
"resurrect",
"(",
")",
"connections",
"=",
"self",
".",
"connections",
"[",
":",
"]",
"# no live nodes, resurrect one by force and return it",
"if",
"not",
"connections",
":",
"return",
"self",
".",
"resurrect",
"(",
"True",
")",
"# only call selector if we have a selection",
"if",
"len",
"(",
"connections",
")",
">",
"1",
":",
"return",
"self",
".",
"selector",
".",
"select",
"(",
"connections",
")",
"# only one connection, no need for a selector",
"return",
"connections",
"[",
"0",
"]"
] | Return a connection from the pool using the `ConnectionSelector`
instance.
It tries to resurrect eligible connections, forces a resurrection when
no connections are availible and passes the list of live connections to
the selector instance to choose from.
Returns a connection instance and it's current fail count. | [
"Return",
"a",
"connection",
"from",
"the",
"pool",
"using",
"the",
"ConnectionSelector",
"instance",
"."
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/connection_pool.py#L206-L229 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ccr.py | CcrClient.follow | def follow(self, index, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html>`_
:arg index: The name of the follower index
:arg body: The name of the leader index and other optional ccr related
parameters
:arg wait_for_active_shards: Sets the number of shard copies that must
be active before returning. Defaults to 0. Set to `all` for all
shard copies, otherwise set to any non-negative value less than or
equal to the total number of copies for the shard (number of
replicas + 1), default '0'
"""
for param in (index, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"PUT", _make_path(index, "_ccr", "follow"), params=params, body=body
) | python | def follow(self, index, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html>`_
:arg index: The name of the follower index
:arg body: The name of the leader index and other optional ccr related
parameters
:arg wait_for_active_shards: Sets the number of shard copies that must
be active before returning. Defaults to 0. Set to `all` for all
shard copies, otherwise set to any non-negative value less than or
equal to the total number of copies for the shard (number of
replicas + 1), default '0'
"""
for param in (index, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"PUT", _make_path(index, "_ccr", "follow"), params=params, body=body
) | [
"def",
"follow",
"(",
"self",
",",
"index",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"index",
",",
"body",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"PUT\"",
",",
"_make_path",
"(",
"index",
",",
"\"_ccr\"",
",",
"\"follow\"",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
")"
] | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html>`_
:arg index: The name of the follower index
:arg body: The name of the leader index and other optional ccr related
parameters
:arg wait_for_active_shards: Sets the number of shard copies that must
be active before returning. Defaults to 0. Set to `all` for all
shard copies, otherwise set to any non-negative value less than or
equal to the total number of copies for the shard (number of
replicas + 1), default '0' | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ccr",
"-",
"put",
"-",
"follow",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ccr.py#L19-L37 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ccr.py | CcrClient.follow_info | def follow_info(self, index=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html>`_
:arg index: A comma-separated list of index patterns; use `_all` to
perform the operation on all indices
"""
return self.transport.perform_request(
"GET", _make_path(index, "_ccr", "info"), params=params
) | python | def follow_info(self, index=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html>`_
:arg index: A comma-separated list of index patterns; use `_all` to
perform the operation on all indices
"""
return self.transport.perform_request(
"GET", _make_path(index, "_ccr", "info"), params=params
) | [
"def",
"follow_info",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"index",
",",
"\"_ccr\"",
",",
"\"info\"",
")",
",",
"params",
"=",
"params",
")"
] | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html>`_
:arg index: A comma-separated list of index patterns; use `_all` to
perform the operation on all indices | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ccr",
"-",
"get",
"-",
"follow",
"-",
"info",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ccr.py#L40-L49 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ccr.py | CcrClient.follow_stats | def follow_stats(self, index, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html>`_
:arg index: A comma-separated list of index patterns; use `_all` to
perform the operation on all indices
"""
if index in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'index'.")
return self.transport.perform_request(
"GET", _make_path(index, "_ccr", "stats"), params=params
) | python | def follow_stats(self, index, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html>`_
:arg index: A comma-separated list of index patterns; use `_all` to
perform the operation on all indices
"""
if index in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'index'.")
return self.transport.perform_request(
"GET", _make_path(index, "_ccr", "stats"), params=params
) | [
"def",
"follow_stats",
"(",
"self",
",",
"index",
",",
"params",
"=",
"None",
")",
":",
"if",
"index",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'index'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"index",
",",
"\"_ccr\"",
",",
"\"stats\"",
")",
",",
"params",
"=",
"params",
")"
] | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html>`_
:arg index: A comma-separated list of index patterns; use `_all` to
perform the operation on all indices | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ccr",
"-",
"get",
"-",
"follow",
"-",
"stats",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ccr.py#L52-L63 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ccr.py | CcrClient.get_auto_follow_pattern | def get_auto_follow_pattern(self, name=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html>`_
:arg name: The name of the auto follow pattern.
"""
return self.transport.perform_request(
"GET", _make_path("_ccr", "auto_follow", name), params=params
) | python | def get_auto_follow_pattern(self, name=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html>`_
:arg name: The name of the auto follow pattern.
"""
return self.transport.perform_request(
"GET", _make_path("_ccr", "auto_follow", name), params=params
) | [
"def",
"get_auto_follow_pattern",
"(",
"self",
",",
"name",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_ccr\"",
",",
"\"auto_follow\"",
",",
"name",
")",
",",
"params",
"=",
"params",
")"
] | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html>`_
:arg name: The name of the auto follow pattern. | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ccr",
"-",
"get",
"-",
"auto",
"-",
"follow",
"-",
"pattern",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ccr.py#L88-L96 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ccr.py | CcrClient.put_auto_follow_pattern | def put_auto_follow_pattern(self, name, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html>`_
:arg name: The name of the auto follow pattern.
:arg body: The specification of the auto follow pattern
"""
for param in (name, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"PUT", _make_path("_ccr", "auto_follow", name), params=params, body=body
) | python | def put_auto_follow_pattern(self, name, body, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html>`_
:arg name: The name of the auto follow pattern.
:arg body: The specification of the auto follow pattern
"""
for param in (name, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"PUT", _make_path("_ccr", "auto_follow", name), params=params, body=body
) | [
"def",
"put_auto_follow_pattern",
"(",
"self",
",",
"name",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"name",
",",
"body",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"PUT\"",
",",
"_make_path",
"(",
"\"_ccr\"",
",",
"\"auto_follow\"",
",",
"name",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
")"
] | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html>`_
:arg name: The name of the auto follow pattern.
:arg body: The specification of the auto follow pattern | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ccr",
"-",
"put",
"-",
"auto",
"-",
"follow",
"-",
"pattern",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ccr.py#L113-L125 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ccr.py | CcrClient.resume_follow | def resume_follow(self, index, body=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html>`_
:arg index: The name of the follow index to resume following.
:arg body: The name of the leader index and other optional ccr related
parameters
"""
if index in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'index'.")
return self.transport.perform_request(
"POST", _make_path(index, "_ccr", "resume_follow"), params=params, body=body
) | python | def resume_follow(self, index, body=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html>`_
:arg index: The name of the follow index to resume following.
:arg body: The name of the leader index and other optional ccr related
parameters
"""
if index in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'index'.")
return self.transport.perform_request(
"POST", _make_path(index, "_ccr", "resume_follow"), params=params, body=body
) | [
"def",
"resume_follow",
"(",
"self",
",",
"index",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"index",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'index'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"index",
",",
"\"_ccr\"",
",",
"\"resume_follow\"",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
")"
] | `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html>`_
:arg index: The name of the follow index to resume following.
:arg body: The name of the leader index and other optional ccr related
parameters | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ccr",
"-",
"post",
"-",
"resume",
"-",
"follow",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ccr.py#L128-L140 | train |
elastic/elasticsearch-py | elasticsearch/client/ingest.py | IngestClient.get_pipeline | def get_pipeline(self, id=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/plugins/current/ingest.html>`_
:arg id: Comma separated list of pipeline ids. Wildcards supported
:arg master_timeout: Explicit operation timeout for connection to master
node
"""
return self.transport.perform_request('GET', _make_path('_ingest',
'pipeline', id), params=params) | python | def get_pipeline(self, id=None, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/plugins/current/ingest.html>`_
:arg id: Comma separated list of pipeline ids. Wildcards supported
:arg master_timeout: Explicit operation timeout for connection to master
node
"""
return self.transport.perform_request('GET', _make_path('_ingest',
'pipeline', id), params=params) | [
"def",
"get_pipeline",
"(",
"self",
",",
"id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_ingest'",
",",
"'pipeline'",
",",
"id",
")",
",",
"params",
"=",
"params",
")"
] | `<https://www.elastic.co/guide/en/elasticsearch/plugins/current/ingest.html>`_
:arg id: Comma separated list of pipeline ids. Wildcards supported
:arg master_timeout: Explicit operation timeout for connection to master
node | [
"<https",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"plugins",
"/",
"current",
"/",
"ingest",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/ingest.py#L5-L14 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.delete_calendar_event | def delete_calendar_event(self, calendar_id, event_id, params=None):
"""
`<>`_
:arg calendar_id: The ID of the calendar to modify
:arg event_id: The ID of the event to remove from the calendar
"""
for param in (calendar_id, event_id):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"DELETE",
_make_path("_ml", "calendars", calendar_id, "events", event_id),
params=params,
) | python | def delete_calendar_event(self, calendar_id, event_id, params=None):
"""
`<>`_
:arg calendar_id: The ID of the calendar to modify
:arg event_id: The ID of the event to remove from the calendar
"""
for param in (calendar_id, event_id):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"DELETE",
_make_path("_ml", "calendars", calendar_id, "events", event_id),
params=params,
) | [
"def",
"delete_calendar_event",
"(",
"self",
",",
"calendar_id",
",",
"event_id",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"calendar_id",
",",
"event_id",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"DELETE\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"calendars\"",
",",
"calendar_id",
",",
"\"events\"",
",",
"event_id",
")",
",",
"params",
"=",
"params",
",",
")"
] | `<>`_
:arg calendar_id: The ID of the calendar to modify
:arg event_id: The ID of the event to remove from the calendar | [
"<",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L44-L58 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.delete_filter | def delete_filter(self, filter_id, params=None):
"""
`<>`_
:arg filter_id: The ID of the filter to delete
"""
if filter_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'filter_id'.")
return self.transport.perform_request(
"DELETE", _make_path("_ml", "filters", filter_id), params=params
) | python | def delete_filter(self, filter_id, params=None):
"""
`<>`_
:arg filter_id: The ID of the filter to delete
"""
if filter_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'filter_id'.")
return self.transport.perform_request(
"DELETE", _make_path("_ml", "filters", filter_id), params=params
) | [
"def",
"delete_filter",
"(",
"self",
",",
"filter_id",
",",
"params",
"=",
"None",
")",
":",
"if",
"filter_id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'filter_id'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"DELETE\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"filters\"",
",",
"filter_id",
")",
",",
"params",
"=",
"params",
")"
] | `<>`_
:arg filter_id: The ID of the filter to delete | [
"<",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L103-L113 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.delete_forecast | def delete_forecast(self, job_id, forecast_id=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html>`_
:arg job_id: The ID of the job from which to delete forecasts
:arg forecast_id: The ID of the forecast to delete, can be comma
delimited list. Leaving blank implies `_all`
:arg allow_no_forecasts: Whether to ignore if `_all` matches no
forecasts
:arg timeout: Controls the time to wait until the forecast(s) are
deleted. Default to 30 seconds
"""
if job_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'job_id'.")
return self.transport.perform_request(
"DELETE",
_make_path("_ml", "anomaly_detectors", job_id, "_forecast", forecast_id),
params=params,
) | python | def delete_forecast(self, job_id, forecast_id=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html>`_
:arg job_id: The ID of the job from which to delete forecasts
:arg forecast_id: The ID of the forecast to delete, can be comma
delimited list. Leaving blank implies `_all`
:arg allow_no_forecasts: Whether to ignore if `_all` matches no
forecasts
:arg timeout: Controls the time to wait until the forecast(s) are
deleted. Default to 30 seconds
"""
if job_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'job_id'.")
return self.transport.perform_request(
"DELETE",
_make_path("_ml", "anomaly_detectors", job_id, "_forecast", forecast_id),
params=params,
) | [
"def",
"delete_forecast",
"(",
"self",
",",
"job_id",
",",
"forecast_id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"job_id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'job_id'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"DELETE\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"anomaly_detectors\"",
",",
"job_id",
",",
"\"_forecast\"",
",",
"forecast_id",
")",
",",
"params",
"=",
"params",
",",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html>`_
:arg job_id: The ID of the job from which to delete forecasts
:arg forecast_id: The ID of the forecast to delete, can be comma
delimited list. Leaving blank implies `_all`
:arg allow_no_forecasts: Whether to ignore if `_all` matches no
forecasts
:arg timeout: Controls the time to wait until the forecast(s) are
deleted. Default to 30 seconds | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ml",
"-",
"delete",
"-",
"forecast",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L116-L134 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.delete_job | def delete_job(self, job_id, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html>`_
:arg job_id: The ID of the job to delete
:arg force: True if the job should be forcefully deleted, default False
:arg wait_for_completion: Should this request wait until the operation
has completed before returning, default True
"""
if job_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'job_id'.")
return self.transport.perform_request(
"DELETE", _make_path("_ml", "anomaly_detectors", job_id), params=params
) | python | def delete_job(self, job_id, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html>`_
:arg job_id: The ID of the job to delete
:arg force: True if the job should be forcefully deleted, default False
:arg wait_for_completion: Should this request wait until the operation
has completed before returning, default True
"""
if job_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'job_id'.")
return self.transport.perform_request(
"DELETE", _make_path("_ml", "anomaly_detectors", job_id), params=params
) | [
"def",
"delete_job",
"(",
"self",
",",
"job_id",
",",
"params",
"=",
"None",
")",
":",
"if",
"job_id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'job_id'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"DELETE\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"anomaly_detectors\"",
",",
"job_id",
")",
",",
"params",
"=",
"params",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html>`_
:arg job_id: The ID of the job to delete
:arg force: True if the job should be forcefully deleted, default False
:arg wait_for_completion: Should this request wait until the operation
has completed before returning, default True | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ml",
"-",
"delete",
"-",
"job",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L137-L150 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.delete_model_snapshot | def delete_model_snapshot(self, job_id, snapshot_id, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html>`_
:arg job_id: The ID of the job to fetch
:arg snapshot_id: The ID of the snapshot to delete
"""
for param in (job_id, snapshot_id):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"DELETE",
_make_path(
"_ml", "anomaly_detectors", job_id, "model_snapshots", snapshot_id
),
params=params,
) | python | def delete_model_snapshot(self, job_id, snapshot_id, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html>`_
:arg job_id: The ID of the job to fetch
:arg snapshot_id: The ID of the snapshot to delete
"""
for param in (job_id, snapshot_id):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"DELETE",
_make_path(
"_ml", "anomaly_detectors", job_id, "model_snapshots", snapshot_id
),
params=params,
) | [
"def",
"delete_model_snapshot",
"(",
"self",
",",
"job_id",
",",
"snapshot_id",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"job_id",
",",
"snapshot_id",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"DELETE\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"anomaly_detectors\"",
",",
"job_id",
",",
"\"model_snapshots\"",
",",
"snapshot_id",
")",
",",
"params",
"=",
"params",
",",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html>`_
:arg job_id: The ID of the job to fetch
:arg snapshot_id: The ID of the snapshot to delete | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ml",
"-",
"delete",
"-",
"snapshot",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L153-L169 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.find_file_structure | def find_file_structure(self, body, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-file-structure.html>`_
:arg body: The contents of the file to be analyzed
:arg charset: Optional parameter to specify the character set of the
file
:arg column_names: Optional parameter containing a comma separated list
of the column names for a delimited file
:arg delimiter: Optional parameter to specify the delimiter character
for a delimited file - must be a single character
:arg explain: Whether to include a commentary on how the structure was
derived, default False
:arg format: Optional parameter to specify the high level file format,
valid choices are: 'ndjson', 'xml', 'delimited',
'semi_structured_text'
:arg grok_pattern: Optional parameter to specify the Grok pattern that
should be used to extract fields from messages in a semi-structured
text file
:arg has_header_row: Optional parameter to specify whether a delimited
file includes the column names in its first row
:arg lines_to_sample: How many lines of the file should be included in
the analysis, default 1000
:arg quote: Optional parameter to specify the quote character for a
delimited file - must be a single character
:arg should_trim_fields: Optional parameter to specify whether the
values between delimiters in a delimited file should have whitespace
trimmed from them
:arg timeout: Timeout after which the analysis will be aborted, default
'25s'
:arg timestamp_field: Optional parameter to specify the timestamp field
in the file
:arg timestamp_format: Optional parameter to specify the timestamp
format in the file - may be either a Joda or Java time format
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
return self.transport.perform_request(
"POST",
"/_ml/find_file_structure",
params=params,
body=self._bulk_body(body),
) | python | def find_file_structure(self, body, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-file-structure.html>`_
:arg body: The contents of the file to be analyzed
:arg charset: Optional parameter to specify the character set of the
file
:arg column_names: Optional parameter containing a comma separated list
of the column names for a delimited file
:arg delimiter: Optional parameter to specify the delimiter character
for a delimited file - must be a single character
:arg explain: Whether to include a commentary on how the structure was
derived, default False
:arg format: Optional parameter to specify the high level file format,
valid choices are: 'ndjson', 'xml', 'delimited',
'semi_structured_text'
:arg grok_pattern: Optional parameter to specify the Grok pattern that
should be used to extract fields from messages in a semi-structured
text file
:arg has_header_row: Optional parameter to specify whether a delimited
file includes the column names in its first row
:arg lines_to_sample: How many lines of the file should be included in
the analysis, default 1000
:arg quote: Optional parameter to specify the quote character for a
delimited file - must be a single character
:arg should_trim_fields: Optional parameter to specify whether the
values between delimiters in a delimited file should have whitespace
trimmed from them
:arg timeout: Timeout after which the analysis will be aborted, default
'25s'
:arg timestamp_field: Optional parameter to specify the timestamp field
in the file
:arg timestamp_format: Optional parameter to specify the timestamp
format in the file - may be either a Joda or Java time format
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
return self.transport.perform_request(
"POST",
"/_ml/find_file_structure",
params=params,
body=self._bulk_body(body),
) | [
"def",
"find_file_structure",
"(",
"self",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"\"/_ml/find_file_structure\"",
",",
"params",
"=",
"params",
",",
"body",
"=",
"self",
".",
"_bulk_body",
"(",
"body",
")",
",",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-file-structure.html>`_
:arg body: The contents of the file to be analyzed
:arg charset: Optional parameter to specify the character set of the
file
:arg column_names: Optional parameter containing a comma separated list
of the column names for a delimited file
:arg delimiter: Optional parameter to specify the delimiter character
for a delimited file - must be a single character
:arg explain: Whether to include a commentary on how the structure was
derived, default False
:arg format: Optional parameter to specify the high level file format,
valid choices are: 'ndjson', 'xml', 'delimited',
'semi_structured_text'
:arg grok_pattern: Optional parameter to specify the Grok pattern that
should be used to extract fields from messages in a semi-structured
text file
:arg has_header_row: Optional parameter to specify whether a delimited
file includes the column names in its first row
:arg lines_to_sample: How many lines of the file should be included in
the analysis, default 1000
:arg quote: Optional parameter to specify the quote character for a
delimited file - must be a single character
:arg should_trim_fields: Optional parameter to specify whether the
values between delimiters in a delimited file should have whitespace
trimmed from them
:arg timeout: Timeout after which the analysis will be aborted, default
'25s'
:arg timestamp_field: Optional parameter to specify the timestamp field
in the file
:arg timestamp_format: Optional parameter to specify the timestamp
format in the file - may be either a Joda or Java time format | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ml",
"-",
"file",
"-",
"structure",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L186-L228 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.flush_job | def flush_job(self, job_id, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html>`_
:arg job_id: The name of the job to flush
:arg body: Flush parameters
:arg advance_time: Advances time to the given value generating results
and updating the model for the advanced interval
:arg calc_interim: Calculates interim results for the most recent bucket
or all buckets within the latency period
:arg end: When used in conjunction with calc_interim, specifies the
range of buckets on which to calculate interim results
:arg skip_time: Skips time to the given value without generating results
or updating the model for the skipped interval
:arg start: When used in conjunction with calc_interim, specifies the
range of buckets on which to calculate interim results
"""
if job_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'job_id'.")
return self.transport.perform_request(
"POST",
_make_path("_ml", "anomaly_detectors", job_id, "_flush"),
params=params,
body=body,
) | python | def flush_job(self, job_id, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html>`_
:arg job_id: The name of the job to flush
:arg body: Flush parameters
:arg advance_time: Advances time to the given value generating results
and updating the model for the advanced interval
:arg calc_interim: Calculates interim results for the most recent bucket
or all buckets within the latency period
:arg end: When used in conjunction with calc_interim, specifies the
range of buckets on which to calculate interim results
:arg skip_time: Skips time to the given value without generating results
or updating the model for the skipped interval
:arg start: When used in conjunction with calc_interim, specifies the
range of buckets on which to calculate interim results
"""
if job_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'job_id'.")
return self.transport.perform_request(
"POST",
_make_path("_ml", "anomaly_detectors", job_id, "_flush"),
params=params,
body=body,
) | [
"def",
"flush_job",
"(",
"self",
",",
"job_id",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"job_id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'job_id'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"anomaly_detectors\"",
",",
"job_id",
",",
"\"_flush\"",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
",",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html>`_
:arg job_id: The name of the job to flush
:arg body: Flush parameters
:arg advance_time: Advances time to the given value generating results
and updating the model for the advanced interval
:arg calc_interim: Calculates interim results for the most recent bucket
or all buckets within the latency period
:arg end: When used in conjunction with calc_interim, specifies the
range of buckets on which to calculate interim results
:arg skip_time: Skips time to the given value without generating results
or updating the model for the skipped interval
:arg start: When used in conjunction with calc_interim, specifies the
range of buckets on which to calculate interim results | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ml",
"-",
"flush",
"-",
"job",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L231-L255 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.get_buckets | def get_buckets(self, job_id, timestamp=None, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html>`_
:arg job_id: ID of the job to get bucket results from
:arg timestamp: The timestamp of the desired single bucket result
:arg body: Bucket selection details if not provided in URI
:arg anomaly_score: Filter for the most anomalous buckets
:arg desc: Set the sort direction
:arg end: End time filter for buckets
:arg exclude_interim: Exclude interim results
:arg expand: Include anomaly records
:arg from_: skips a number of buckets
:arg size: specifies a max number of buckets to get
:arg sort: Sort buckets by a particular field
:arg start: Start time filter for buckets
"""
if job_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'job_id'.")
return self.transport.perform_request(
"GET",
_make_path(
"_ml", "anomaly_detectors", job_id, "results", "buckets", timestamp
),
params=params,
body=body,
) | python | def get_buckets(self, job_id, timestamp=None, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html>`_
:arg job_id: ID of the job to get bucket results from
:arg timestamp: The timestamp of the desired single bucket result
:arg body: Bucket selection details if not provided in URI
:arg anomaly_score: Filter for the most anomalous buckets
:arg desc: Set the sort direction
:arg end: End time filter for buckets
:arg exclude_interim: Exclude interim results
:arg expand: Include anomaly records
:arg from_: skips a number of buckets
:arg size: specifies a max number of buckets to get
:arg sort: Sort buckets by a particular field
:arg start: Start time filter for buckets
"""
if job_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'job_id'.")
return self.transport.perform_request(
"GET",
_make_path(
"_ml", "anomaly_detectors", job_id, "results", "buckets", timestamp
),
params=params,
body=body,
) | [
"def",
"get_buckets",
"(",
"self",
",",
"job_id",
",",
"timestamp",
"=",
"None",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"job_id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'job_id'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"anomaly_detectors\"",
",",
"job_id",
",",
"\"results\"",
",",
"\"buckets\"",
",",
"timestamp",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
",",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html>`_
:arg job_id: ID of the job to get bucket results from
:arg timestamp: The timestamp of the desired single bucket result
:arg body: Bucket selection details if not provided in URI
:arg anomaly_score: Filter for the most anomalous buckets
:arg desc: Set the sort direction
:arg end: End time filter for buckets
:arg exclude_interim: Exclude interim results
:arg expand: Include anomaly records
:arg from_: skips a number of buckets
:arg size: specifies a max number of buckets to get
:arg sort: Sort buckets by a particular field
:arg start: Start time filter for buckets | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ml",
"-",
"get",
"-",
"bucket",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L286-L312 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.get_calendar_events | def get_calendar_events(self, calendar_id, params=None):
"""
`<>`_
:arg calendar_id: The ID of the calendar containing the events
:arg end: Get events before this time
:arg from_: Skips a number of events
:arg job_id: Get events for the job. When this option is used
calendar_id must be '_all'
:arg size: Specifies a max number of events to get
:arg start: Get events after this time
"""
if calendar_id in SKIP_IN_PATH:
raise ValueError(
"Empty value passed for a required argument 'calendar_id'."
)
return self.transport.perform_request(
"GET", _make_path("_ml", "calendars", calendar_id, "events"), params=params
) | python | def get_calendar_events(self, calendar_id, params=None):
"""
`<>`_
:arg calendar_id: The ID of the calendar containing the events
:arg end: Get events before this time
:arg from_: Skips a number of events
:arg job_id: Get events for the job. When this option is used
calendar_id must be '_all'
:arg size: Specifies a max number of events to get
:arg start: Get events after this time
"""
if calendar_id in SKIP_IN_PATH:
raise ValueError(
"Empty value passed for a required argument 'calendar_id'."
)
return self.transport.perform_request(
"GET", _make_path("_ml", "calendars", calendar_id, "events"), params=params
) | [
"def",
"get_calendar_events",
"(",
"self",
",",
"calendar_id",
",",
"params",
"=",
"None",
")",
":",
"if",
"calendar_id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'calendar_id'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"calendars\"",
",",
"calendar_id",
",",
"\"events\"",
")",
",",
"params",
"=",
"params",
")"
] | `<>`_
:arg calendar_id: The ID of the calendar containing the events
:arg end: Get events before this time
:arg from_: Skips a number of events
:arg job_id: Get events for the job. When this option is used
calendar_id must be '_all'
:arg size: Specifies a max number of events to get
:arg start: Get events after this time | [
"<",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L315-L333 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.get_calendars | def get_calendars(self, calendar_id=None, body=None, params=None):
"""
`<>`_
:arg calendar_id: The ID of the calendar to fetch
:arg body: The from and size parameters optionally sent in the body
:arg from_: skips a number of calendars
:arg size: specifies a max number of calendars to get
"""
return self.transport.perform_request(
"GET", _make_path("_ml", "calendars", calendar_id), params=params, body=body
) | python | def get_calendars(self, calendar_id=None, body=None, params=None):
"""
`<>`_
:arg calendar_id: The ID of the calendar to fetch
:arg body: The from and size parameters optionally sent in the body
:arg from_: skips a number of calendars
:arg size: specifies a max number of calendars to get
"""
return self.transport.perform_request(
"GET", _make_path("_ml", "calendars", calendar_id), params=params, body=body
) | [
"def",
"get_calendars",
"(",
"self",
",",
"calendar_id",
"=",
"None",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"calendars\"",
",",
"calendar_id",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
")"
] | `<>`_
:arg calendar_id: The ID of the calendar to fetch
:arg body: The from and size parameters optionally sent in the body
:arg from_: skips a number of calendars
:arg size: specifies a max number of calendars to get | [
"<",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L336-L347 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.get_categories | def get_categories(self, job_id, category_id=None, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html>`_
:arg job_id: The name of the job
:arg category_id: The identifier of the category definition of interest
:arg body: Category selection details if not provided in URI
:arg from_: skips a number of categories
:arg size: specifies a max number of categories to get
"""
if job_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'job_id'.")
return self.transport.perform_request(
"GET",
_make_path(
"_ml", "anomaly_detectors", job_id, "results", "categories", category_id
),
params=params,
body=body,
) | python | def get_categories(self, job_id, category_id=None, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html>`_
:arg job_id: The name of the job
:arg category_id: The identifier of the category definition of interest
:arg body: Category selection details if not provided in URI
:arg from_: skips a number of categories
:arg size: specifies a max number of categories to get
"""
if job_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'job_id'.")
return self.transport.perform_request(
"GET",
_make_path(
"_ml", "anomaly_detectors", job_id, "results", "categories", category_id
),
params=params,
body=body,
) | [
"def",
"get_categories",
"(",
"self",
",",
"job_id",
",",
"category_id",
"=",
"None",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"job_id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'job_id'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"anomaly_detectors\"",
",",
"job_id",
",",
"\"results\"",
",",
"\"categories\"",
",",
"category_id",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
",",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html>`_
:arg job_id: The name of the job
:arg category_id: The identifier of the category definition of interest
:arg body: Category selection details if not provided in URI
:arg from_: skips a number of categories
:arg size: specifies a max number of categories to get | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ml",
"-",
"get",
"-",
"category",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L350-L369 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.get_datafeed_stats | def get_datafeed_stats(self, datafeed_id=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html>`_
:arg datafeed_id: The ID of the datafeeds stats to fetch
:arg allow_no_datafeeds: Whether to ignore if a wildcard expression
matches no datafeeds. (This includes `_all` string or when no
datafeeds have been specified)
"""
return self.transport.perform_request(
"GET", _make_path("_ml", "datafeeds", datafeed_id, "_stats"), params=params
) | python | def get_datafeed_stats(self, datafeed_id=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html>`_
:arg datafeed_id: The ID of the datafeeds stats to fetch
:arg allow_no_datafeeds: Whether to ignore if a wildcard expression
matches no datafeeds. (This includes `_all` string or when no
datafeeds have been specified)
"""
return self.transport.perform_request(
"GET", _make_path("_ml", "datafeeds", datafeed_id, "_stats"), params=params
) | [
"def",
"get_datafeed_stats",
"(",
"self",
",",
"datafeed_id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"datafeeds\"",
",",
"datafeed_id",
",",
"\"_stats\"",
")",
",",
"params",
"=",
"params",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html>`_
:arg datafeed_id: The ID of the datafeeds stats to fetch
:arg allow_no_datafeeds: Whether to ignore if a wildcard expression
matches no datafeeds. (This includes `_all` string or when no
datafeeds have been specified) | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ml",
"-",
"get",
"-",
"datafeed",
"-",
"stats",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L372-L383 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.get_datafeeds | def get_datafeeds(self, datafeed_id=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html>`_
:arg datafeed_id: The ID of the datafeeds to fetch
:arg allow_no_datafeeds: Whether to ignore if a wildcard expression
matches no datafeeds. (This includes `_all` string or when no
datafeeds have been specified)
"""
return self.transport.perform_request(
"GET", _make_path("_ml", "datafeeds", datafeed_id), params=params
) | python | def get_datafeeds(self, datafeed_id=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html>`_
:arg datafeed_id: The ID of the datafeeds to fetch
:arg allow_no_datafeeds: Whether to ignore if a wildcard expression
matches no datafeeds. (This includes `_all` string or when no
datafeeds have been specified)
"""
return self.transport.perform_request(
"GET", _make_path("_ml", "datafeeds", datafeed_id), params=params
) | [
"def",
"get_datafeeds",
"(",
"self",
",",
"datafeed_id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"datafeeds\"",
",",
"datafeed_id",
")",
",",
"params",
"=",
"params",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html>`_
:arg datafeed_id: The ID of the datafeeds to fetch
:arg allow_no_datafeeds: Whether to ignore if a wildcard expression
matches no datafeeds. (This includes `_all` string or when no
datafeeds have been specified) | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ml",
"-",
"get",
"-",
"datafeed",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L386-L397 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.get_filters | def get_filters(self, filter_id=None, params=None):
"""
`<>`_
:arg filter_id: The ID of the filter to fetch
:arg from_: skips a number of filters
:arg size: specifies a max number of filters to get
"""
return self.transport.perform_request(
"GET", _make_path("_ml", "filters", filter_id), params=params
) | python | def get_filters(self, filter_id=None, params=None):
"""
`<>`_
:arg filter_id: The ID of the filter to fetch
:arg from_: skips a number of filters
:arg size: specifies a max number of filters to get
"""
return self.transport.perform_request(
"GET", _make_path("_ml", "filters", filter_id), params=params
) | [
"def",
"get_filters",
"(",
"self",
",",
"filter_id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"filters\"",
",",
"filter_id",
")",
",",
"params",
"=",
"params",
")"
] | `<>`_
:arg filter_id: The ID of the filter to fetch
:arg from_: skips a number of filters
:arg size: specifies a max number of filters to get | [
"<",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L400-L410 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.get_job_stats | def get_job_stats(self, job_id=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html>`_
:arg job_id: The ID of the jobs stats to fetch
:arg allow_no_jobs: Whether to ignore if a wildcard expression matches
no jobs. (This includes `_all` string or when no jobs have been
specified)
"""
return self.transport.perform_request(
"GET",
_make_path("_ml", "anomaly_detectors", job_id, "_stats"),
params=params,
) | python | def get_job_stats(self, job_id=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html>`_
:arg job_id: The ID of the jobs stats to fetch
:arg allow_no_jobs: Whether to ignore if a wildcard expression matches
no jobs. (This includes `_all` string or when no jobs have been
specified)
"""
return self.transport.perform_request(
"GET",
_make_path("_ml", "anomaly_detectors", job_id, "_stats"),
params=params,
) | [
"def",
"get_job_stats",
"(",
"self",
",",
"job_id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"anomaly_detectors\"",
",",
"job_id",
",",
"\"_stats\"",
")",
",",
"params",
"=",
"params",
",",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html>`_
:arg job_id: The ID of the jobs stats to fetch
:arg allow_no_jobs: Whether to ignore if a wildcard expression matches
no jobs. (This includes `_all` string or when no jobs have been
specified) | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ml",
"-",
"get",
"-",
"job",
"-",
"stats",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L448-L461 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.get_jobs | def get_jobs(self, job_id=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html>`_
:arg job_id: The ID of the jobs to fetch
:arg allow_no_jobs: Whether to ignore if a wildcard expression matches
no jobs. (This includes `_all` string or when no jobs have been
specified)
"""
return self.transport.perform_request(
"GET", _make_path("_ml", "anomaly_detectors", job_id), params=params
) | python | def get_jobs(self, job_id=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html>`_
:arg job_id: The ID of the jobs to fetch
:arg allow_no_jobs: Whether to ignore if a wildcard expression matches
no jobs. (This includes `_all` string or when no jobs have been
specified)
"""
return self.transport.perform_request(
"GET", _make_path("_ml", "anomaly_detectors", job_id), params=params
) | [
"def",
"get_jobs",
"(",
"self",
",",
"job_id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"anomaly_detectors\"",
",",
"job_id",
")",
",",
"params",
"=",
"params",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html>`_
:arg job_id: The ID of the jobs to fetch
:arg allow_no_jobs: Whether to ignore if a wildcard expression matches
no jobs. (This includes `_all` string or when no jobs have been
specified) | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ml",
"-",
"get",
"-",
"job",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L464-L475 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.get_model_snapshots | def get_model_snapshots(self, job_id, snapshot_id=None, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html>`_
:arg job_id: The ID of the job to fetch
:arg snapshot_id: The ID of the snapshot to fetch
:arg body: Model snapshot selection criteria
:arg desc: True if the results should be sorted in descending order
:arg end: The filter 'end' query parameter
:arg from_: Skips a number of documents
:arg size: The default number of documents returned in queries as a
string.
:arg sort: Name of the field to sort on
:arg start: The filter 'start' query parameter
"""
if job_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'job_id'.")
return self.transport.perform_request(
"GET",
_make_path(
"_ml", "anomaly_detectors", job_id, "model_snapshots", snapshot_id
),
params=params,
body=body,
) | python | def get_model_snapshots(self, job_id, snapshot_id=None, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html>`_
:arg job_id: The ID of the job to fetch
:arg snapshot_id: The ID of the snapshot to fetch
:arg body: Model snapshot selection criteria
:arg desc: True if the results should be sorted in descending order
:arg end: The filter 'end' query parameter
:arg from_: Skips a number of documents
:arg size: The default number of documents returned in queries as a
string.
:arg sort: Name of the field to sort on
:arg start: The filter 'start' query parameter
"""
if job_id in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'job_id'.")
return self.transport.perform_request(
"GET",
_make_path(
"_ml", "anomaly_detectors", job_id, "model_snapshots", snapshot_id
),
params=params,
body=body,
) | [
"def",
"get_model_snapshots",
"(",
"self",
",",
"job_id",
",",
"snapshot_id",
"=",
"None",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"job_id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'job_id'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"anomaly_detectors\"",
",",
"job_id",
",",
"\"model_snapshots\"",
",",
"snapshot_id",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
",",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html>`_
:arg job_id: The ID of the job to fetch
:arg snapshot_id: The ID of the snapshot to fetch
:arg body: Model snapshot selection criteria
:arg desc: True if the results should be sorted in descending order
:arg end: The filter 'end' query parameter
:arg from_: Skips a number of documents
:arg size: The default number of documents returned in queries as a
string.
:arg sort: Name of the field to sort on
:arg start: The filter 'start' query parameter | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ml",
"-",
"get",
"-",
"snapshot",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L478-L502 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.post_calendar_events | def post_calendar_events(self, calendar_id, body, params=None):
"""
`<>`_
:arg calendar_id: The ID of the calendar to modify
:arg body: A list of events
"""
for param in (calendar_id, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"POST",
_make_path("_ml", "calendars", calendar_id, "events"),
params=params,
body=body,
) | python | def post_calendar_events(self, calendar_id, body, params=None):
"""
`<>`_
:arg calendar_id: The ID of the calendar to modify
:arg body: A list of events
"""
for param in (calendar_id, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"POST",
_make_path("_ml", "calendars", calendar_id, "events"),
params=params,
body=body,
) | [
"def",
"post_calendar_events",
"(",
"self",
",",
"calendar_id",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"calendar_id",
",",
"body",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"calendars\"",
",",
"calendar_id",
",",
"\"events\"",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
",",
")"
] | `<>`_
:arg calendar_id: The ID of the calendar to modify
:arg body: A list of events | [
"<",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L601-L616 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.post_data | def post_data(self, job_id, body, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html>`_
:arg job_id: The name of the job receiving the data
:arg body: The data to process
:arg reset_end: Optional parameter to specify the end of the bucket
resetting range
:arg reset_start: Optional parameter to specify the start of the bucket
resetting range
"""
for param in (job_id, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"POST",
_make_path("_ml", "anomaly_detectors", job_id, "_data"),
params=params,
body=self._bulk_body(body),
) | python | def post_data(self, job_id, body, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html>`_
:arg job_id: The name of the job receiving the data
:arg body: The data to process
:arg reset_end: Optional parameter to specify the end of the bucket
resetting range
:arg reset_start: Optional parameter to specify the start of the bucket
resetting range
"""
for param in (job_id, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"POST",
_make_path("_ml", "anomaly_detectors", job_id, "_data"),
params=params,
body=self._bulk_body(body),
) | [
"def",
"post_data",
"(",
"self",
",",
"job_id",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"job_id",
",",
"body",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"anomaly_detectors\"",
",",
"job_id",
",",
"\"_data\"",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"self",
".",
"_bulk_body",
"(",
"body",
")",
",",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html>`_
:arg job_id: The name of the job receiving the data
:arg body: The data to process
:arg reset_end: Optional parameter to specify the end of the bucket
resetting range
:arg reset_start: Optional parameter to specify the start of the bucket
resetting range | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ml",
"-",
"post",
"-",
"data",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L619-L638 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.preview_datafeed | def preview_datafeed(self, datafeed_id, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html>`_
:arg datafeed_id: The ID of the datafeed to preview
"""
if datafeed_id in SKIP_IN_PATH:
raise ValueError(
"Empty value passed for a required argument 'datafeed_id'."
)
return self.transport.perform_request(
"GET",
_make_path("_ml", "datafeeds", datafeed_id, "_preview"),
params=params,
) | python | def preview_datafeed(self, datafeed_id, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html>`_
:arg datafeed_id: The ID of the datafeed to preview
"""
if datafeed_id in SKIP_IN_PATH:
raise ValueError(
"Empty value passed for a required argument 'datafeed_id'."
)
return self.transport.perform_request(
"GET",
_make_path("_ml", "datafeeds", datafeed_id, "_preview"),
params=params,
) | [
"def",
"preview_datafeed",
"(",
"self",
",",
"datafeed_id",
",",
"params",
"=",
"None",
")",
":",
"if",
"datafeed_id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'datafeed_id'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"datafeeds\"",
",",
"datafeed_id",
",",
"\"_preview\"",
")",
",",
"params",
"=",
"params",
",",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html>`_
:arg datafeed_id: The ID of the datafeed to preview | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ml",
"-",
"preview",
"-",
"datafeed",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L641-L655 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.put_calendar | def put_calendar(self, calendar_id, body=None, params=None):
"""
`<>`_
:arg calendar_id: The ID of the calendar to create
:arg body: The calendar details
"""
if calendar_id in SKIP_IN_PATH:
raise ValueError(
"Empty value passed for a required argument 'calendar_id'."
)
return self.transport.perform_request(
"PUT", _make_path("_ml", "calendars", calendar_id), params=params, body=body
) | python | def put_calendar(self, calendar_id, body=None, params=None):
"""
`<>`_
:arg calendar_id: The ID of the calendar to create
:arg body: The calendar details
"""
if calendar_id in SKIP_IN_PATH:
raise ValueError(
"Empty value passed for a required argument 'calendar_id'."
)
return self.transport.perform_request(
"PUT", _make_path("_ml", "calendars", calendar_id), params=params, body=body
) | [
"def",
"put_calendar",
"(",
"self",
",",
"calendar_id",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"calendar_id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'calendar_id'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"PUT\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"calendars\"",
",",
"calendar_id",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
")"
] | `<>`_
:arg calendar_id: The ID of the calendar to create
:arg body: The calendar details | [
"<",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L658-L671 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.put_calendar_job | def put_calendar_job(self, calendar_id, job_id, params=None):
"""
`<>`_
:arg calendar_id: The ID of the calendar to modify
:arg job_id: The ID of the job to add to the calendar
"""
for param in (calendar_id, job_id):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"PUT",
_make_path("_ml", "calendars", calendar_id, "jobs", job_id),
params=params,
) | python | def put_calendar_job(self, calendar_id, job_id, params=None):
"""
`<>`_
:arg calendar_id: The ID of the calendar to modify
:arg job_id: The ID of the job to add to the calendar
"""
for param in (calendar_id, job_id):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"PUT",
_make_path("_ml", "calendars", calendar_id, "jobs", job_id),
params=params,
) | [
"def",
"put_calendar_job",
"(",
"self",
",",
"calendar_id",
",",
"job_id",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"calendar_id",
",",
"job_id",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"PUT\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"calendars\"",
",",
"calendar_id",
",",
"\"jobs\"",
",",
"job_id",
")",
",",
"params",
"=",
"params",
",",
")"
] | `<>`_
:arg calendar_id: The ID of the calendar to modify
:arg job_id: The ID of the job to add to the calendar | [
"<",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L674-L688 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.start_datafeed | def start_datafeed(self, datafeed_id, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html>`_
:arg datafeed_id: The ID of the datafeed to start
:arg body: The start datafeed parameters
:arg end: The end time when the datafeed should stop. When not set, the
datafeed continues in real time
:arg start: The start time from where the datafeed should begin
:arg timeout: Controls the time to wait until a datafeed has started.
Default to 20 seconds
"""
if datafeed_id in SKIP_IN_PATH:
raise ValueError(
"Empty value passed for a required argument 'datafeed_id'."
)
return self.transport.perform_request(
"POST",
_make_path("_ml", "datafeeds", datafeed_id, "_start"),
params=params,
body=body,
) | python | def start_datafeed(self, datafeed_id, body=None, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html>`_
:arg datafeed_id: The ID of the datafeed to start
:arg body: The start datafeed parameters
:arg end: The end time when the datafeed should stop. When not set, the
datafeed continues in real time
:arg start: The start time from where the datafeed should begin
:arg timeout: Controls the time to wait until a datafeed has started.
Default to 20 seconds
"""
if datafeed_id in SKIP_IN_PATH:
raise ValueError(
"Empty value passed for a required argument 'datafeed_id'."
)
return self.transport.perform_request(
"POST",
_make_path("_ml", "datafeeds", datafeed_id, "_start"),
params=params,
body=body,
) | [
"def",
"start_datafeed",
"(",
"self",
",",
"datafeed_id",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"datafeed_id",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'datafeed_id'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"datafeeds\"",
",",
"datafeed_id",
",",
"\"_start\"",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
",",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html>`_
:arg datafeed_id: The ID of the datafeed to start
:arg body: The start datafeed parameters
:arg end: The end time when the datafeed should stop. When not set, the
datafeed continues in real time
:arg start: The start time from where the datafeed should begin
:arg timeout: Controls the time to wait until a datafeed has started.
Default to 20 seconds | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ml",
"-",
"start",
"-",
"datafeed",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L781-L802 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.update_datafeed | def update_datafeed(self, datafeed_id, body, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html>`_
:arg datafeed_id: The ID of the datafeed to update
:arg body: The datafeed update settings
"""
for param in (datafeed_id, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"POST",
_make_path("_ml", "datafeeds", datafeed_id, "_update"),
params=params,
body=body,
) | python | def update_datafeed(self, datafeed_id, body, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html>`_
:arg datafeed_id: The ID of the datafeed to update
:arg body: The datafeed update settings
"""
for param in (datafeed_id, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"POST",
_make_path("_ml", "datafeeds", datafeed_id, "_update"),
params=params,
body=body,
) | [
"def",
"update_datafeed",
"(",
"self",
",",
"datafeed_id",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"datafeed_id",
",",
"body",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"datafeeds\"",
",",
"datafeed_id",
",",
"\"_update\"",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
",",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html>`_
:arg datafeed_id: The ID of the datafeed to update
:arg body: The datafeed update settings | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ml",
"-",
"update",
"-",
"datafeed",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L826-L841 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.update_filter | def update_filter(self, filter_id, body, params=None):
"""
`<>`_
:arg filter_id: The ID of the filter to update
:arg body: The filter update
"""
for param in (filter_id, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"POST",
_make_path("_ml", "filters", filter_id, "_update"),
params=params,
body=body,
) | python | def update_filter(self, filter_id, body, params=None):
"""
`<>`_
:arg filter_id: The ID of the filter to update
:arg body: The filter update
"""
for param in (filter_id, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"POST",
_make_path("_ml", "filters", filter_id, "_update"),
params=params,
body=body,
) | [
"def",
"update_filter",
"(",
"self",
",",
"filter_id",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"filter_id",
",",
"body",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"filters\"",
",",
"filter_id",
",",
"\"_update\"",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
",",
")"
] | `<>`_
:arg filter_id: The ID of the filter to update
:arg body: The filter update | [
"<",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L844-L859 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.update_model_snapshot | def update_model_snapshot(self, job_id, snapshot_id, body, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html>`_
:arg job_id: The ID of the job to fetch
:arg snapshot_id: The ID of the snapshot to update
:arg body: The model snapshot properties to update
"""
for param in (job_id, snapshot_id, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"POST",
_make_path(
"_ml",
"anomaly_detectors",
job_id,
"model_snapshots",
snapshot_id,
"_update",
),
params=params,
body=body,
) | python | def update_model_snapshot(self, job_id, snapshot_id, body, params=None):
"""
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html>`_
:arg job_id: The ID of the job to fetch
:arg snapshot_id: The ID of the snapshot to update
:arg body: The model snapshot properties to update
"""
for param in (job_id, snapshot_id, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"POST",
_make_path(
"_ml",
"anomaly_detectors",
job_id,
"model_snapshots",
snapshot_id,
"_update",
),
params=params,
body=body,
) | [
"def",
"update_model_snapshot",
"(",
"self",
",",
"job_id",
",",
"snapshot_id",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"job_id",
",",
"snapshot_id",
",",
"body",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"\"_ml\"",
",",
"\"anomaly_detectors\"",
",",
"job_id",
",",
"\"model_snapshots\"",
",",
"snapshot_id",
",",
"\"_update\"",
",",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
",",
")"
] | `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html>`_
:arg job_id: The ID of the job to fetch
:arg snapshot_id: The ID of the snapshot to update
:arg body: The model snapshot properties to update | [
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"ml",
"-",
"update",
"-",
"snapshot",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L880-L903 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.validate | def validate(self, body, params=None):
"""
`<>`_
:arg body: The job config
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
return self.transport.perform_request(
"POST", "/_ml/anomaly_detectors/_validate", params=params, body=body
) | python | def validate(self, body, params=None):
"""
`<>`_
:arg body: The job config
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
return self.transport.perform_request(
"POST", "/_ml/anomaly_detectors/_validate", params=params, body=body
) | [
"def",
"validate",
"(",
"self",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"\"/_ml/anomaly_detectors/_validate\"",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
")"
] | `<>`_
:arg body: The job config | [
"<",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L906-L916 | train |
elastic/elasticsearch-py | elasticsearch/client/xpack/ml.py | MlClient.validate_detector | def validate_detector(self, body, params=None):
"""
`<>`_
:arg body: The detector
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
return self.transport.perform_request(
"POST",
"/_ml/anomaly_detectors/_validate/detector",
params=params,
body=body,
) | python | def validate_detector(self, body, params=None):
"""
`<>`_
:arg body: The detector
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
return self.transport.perform_request(
"POST",
"/_ml/anomaly_detectors/_validate/detector",
params=params,
body=body,
) | [
"def",
"validate_detector",
"(",
"self",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"\"/_ml/anomaly_detectors/_validate/detector\"",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
",",
")"
] | `<>`_
:arg body: The detector | [
"<",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/xpack/ml.py#L919-L932 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.analyze | def analyze(self, index=None, body=None, params=None):
"""
Perform the analysis process on a text and return the tokens breakdown of the text.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-analyze.html>`_
:arg index: The name of the index to scope the operation
:arg body: Define analyzer/tokenizer parameters and the text on which
the analysis should be performed
:arg format: Format of the output, default 'detailed', valid choices
are: 'detailed', 'text'
:arg prefer_local: With `true`, specify that a local shard should be
used if available, with `false`, use a random shard (default: true)
"""
return self.transport.perform_request(
"GET", _make_path(index, "_analyze"), params=params, body=body
) | python | def analyze(self, index=None, body=None, params=None):
"""
Perform the analysis process on a text and return the tokens breakdown of the text.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-analyze.html>`_
:arg index: The name of the index to scope the operation
:arg body: Define analyzer/tokenizer parameters and the text on which
the analysis should be performed
:arg format: Format of the output, default 'detailed', valid choices
are: 'detailed', 'text'
:arg prefer_local: With `true`, specify that a local shard should be
used if available, with `false`, use a random shard (default: true)
"""
return self.transport.perform_request(
"GET", _make_path(index, "_analyze"), params=params, body=body
) | [
"def",
"analyze",
"(",
"self",
",",
"index",
"=",
"None",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"index",
",",
"\"_analyze\"",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
")"
] | Perform the analysis process on a text and return the tokens breakdown of the text.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-analyze.html>`_
:arg index: The name of the index to scope the operation
:arg body: Define analyzer/tokenizer parameters and the text on which
the analysis should be performed
:arg format: Format of the output, default 'detailed', valid choices
are: 'detailed', 'text'
:arg prefer_local: With `true`, specify that a local shard should be
used if available, with `false`, use a random shard (default: true) | [
"Perform",
"the",
"analysis",
"process",
"on",
"a",
"text",
"and",
"return",
"the",
"tokens",
"breakdown",
"of",
"the",
"text",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"analyze",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L6-L21 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.refresh | def refresh(self, index=None, params=None):
"""
Explicitly refresh one or more index, making all operations performed
since the last refresh available for search.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-refresh.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
"""
return self.transport.perform_request(
"POST", _make_path(index, "_refresh"), params=params
) | python | def refresh(self, index=None, params=None):
"""
Explicitly refresh one or more index, making all operations performed
since the last refresh available for search.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-refresh.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
"""
return self.transport.perform_request(
"POST", _make_path(index, "_refresh"), params=params
) | [
"def",
"refresh",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"index",
",",
"\"_refresh\"",
")",
",",
"params",
"=",
"params",
")"
] | Explicitly refresh one or more index, making all operations performed
since the last refresh available for search.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-refresh.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed) | [
"Explicitly",
"refresh",
"one",
"or",
"more",
"index",
"making",
"all",
"operations",
"performed",
"since",
"the",
"last",
"refresh",
"available",
"for",
"search",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"refresh",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L24-L43 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.flush | def flush(self, index=None, params=None):
"""
Explicitly flush one or more indices.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-flush.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string for all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg force: Whether a flush should be forced even if it is not
necessarily needed ie. if no changes will be committed to the index.
This is useful if transaction log IDs should be incremented even if
no uncommitted changes are present. (This setting can be considered
as internal)
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg wait_if_ongoing: If set to true the flush operation will block
until the flush can be executed if another flush operation is
already executing. The default is true. If set to false the flush
will be skipped iff if another flush operation is already running.
"""
return self.transport.perform_request(
"POST", _make_path(index, "_flush"), params=params
) | python | def flush(self, index=None, params=None):
"""
Explicitly flush one or more indices.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-flush.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string for all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg force: Whether a flush should be forced even if it is not
necessarily needed ie. if no changes will be committed to the index.
This is useful if transaction log IDs should be incremented even if
no uncommitted changes are present. (This setting can be considered
as internal)
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg wait_if_ongoing: If set to true the flush operation will block
until the flush can be executed if another flush operation is
already executing. The default is true. If set to false the flush
will be skipped iff if another flush operation is already running.
"""
return self.transport.perform_request(
"POST", _make_path(index, "_flush"), params=params
) | [
"def",
"flush",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"index",
",",
"\"_flush\"",
")",
",",
"params",
"=",
"params",
")"
] | Explicitly flush one or more indices.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-flush.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string for all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg force: Whether a flush should be forced even if it is not
necessarily needed ie. if no changes will be committed to the index.
This is useful if transaction log IDs should be incremented even if
no uncommitted changes are present. (This setting can be considered
as internal)
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg wait_if_ongoing: If set to true the flush operation will block
until the flush can be executed if another flush operation is
already executing. The default is true. If set to false the flush
will be skipped iff if another flush operation is already running. | [
"Explicitly",
"flush",
"one",
"or",
"more",
"indices",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"flush",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L52-L79 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.get | def get(self, index, feature=None, params=None):
"""
The get index API allows to retrieve information about one or more indexes.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html>`_
:arg index: A comma-separated list of index names
:arg allow_no_indices: Ignore if a wildcard expression resolves to no
concrete indices (default: false)
:arg expand_wildcards: Whether wildcard expressions should get expanded
to open or closed indices (default: open), default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg flat_settings: Return settings in flat format (default: false)
:arg ignore_unavailable: Ignore unavailable indexes (default: false)
:arg include_defaults: Whether to return all default setting for each of
the indices., default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg include_type_name: Specify whether requests and responses should include a
type name (default: depends on Elasticsearch version).
"""
if index in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'index'.")
return self.transport.perform_request(
"GET", _make_path(index, feature), params=params
) | python | def get(self, index, feature=None, params=None):
"""
The get index API allows to retrieve information about one or more indexes.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html>`_
:arg index: A comma-separated list of index names
:arg allow_no_indices: Ignore if a wildcard expression resolves to no
concrete indices (default: false)
:arg expand_wildcards: Whether wildcard expressions should get expanded
to open or closed indices (default: open), default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg flat_settings: Return settings in flat format (default: false)
:arg ignore_unavailable: Ignore unavailable indexes (default: false)
:arg include_defaults: Whether to return all default setting for each of
the indices., default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg include_type_name: Specify whether requests and responses should include a
type name (default: depends on Elasticsearch version).
"""
if index in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'index'.")
return self.transport.perform_request(
"GET", _make_path(index, feature), params=params
) | [
"def",
"get",
"(",
"self",
",",
"index",
",",
"feature",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"index",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'index'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"index",
",",
"feature",
")",
",",
"params",
"=",
"params",
")"
] | The get index API allows to retrieve information about one or more indexes.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html>`_
:arg index: A comma-separated list of index names
:arg allow_no_indices: Ignore if a wildcard expression resolves to no
concrete indices (default: false)
:arg expand_wildcards: Whether wildcard expressions should get expanded
to open or closed indices (default: open), default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg flat_settings: Return settings in flat format (default: false)
:arg ignore_unavailable: Ignore unavailable indexes (default: false)
:arg include_defaults: Whether to return all default setting for each of
the indices., default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg include_type_name: Specify whether requests and responses should include a
type name (default: depends on Elasticsearch version). | [
"The",
"get",
"index",
"API",
"allows",
"to",
"retrieve",
"information",
"about",
"one",
"or",
"more",
"indexes",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"get",
"-",
"index",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L113-L137 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.exists_type | def exists_type(self, index, doc_type, params=None):
"""
Check if a type/types exists in an index/indices.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-types-exists.html>`_
:arg index: A comma-separated list of index names; use `_all` to check
the types across all indices
:arg doc_type: A comma-separated list of document types to check
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg local: Return local information, do not retrieve the state from
master node (default: false)
"""
for param in (index, doc_type):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"HEAD", _make_path(index, "_mapping", doc_type), params=params
) | python | def exists_type(self, index, doc_type, params=None):
"""
Check if a type/types exists in an index/indices.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-types-exists.html>`_
:arg index: A comma-separated list of index names; use `_all` to check
the types across all indices
:arg doc_type: A comma-separated list of document types to check
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg local: Return local information, do not retrieve the state from
master node (default: false)
"""
for param in (index, doc_type):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"HEAD", _make_path(index, "_mapping", doc_type), params=params
) | [
"def",
"exists_type",
"(",
"self",
",",
"index",
",",
"doc_type",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"index",
",",
"doc_type",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"HEAD\"",
",",
"_make_path",
"(",
"index",
",",
"\"_mapping\"",
",",
"doc_type",
")",
",",
"params",
"=",
"params",
")"
] | Check if a type/types exists in an index/indices.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-types-exists.html>`_
:arg index: A comma-separated list of index names; use `_all` to check
the types across all indices
:arg doc_type: A comma-separated list of document types to check
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg local: Return local information, do not retrieve the state from
master node (default: false) | [
"Check",
"if",
"a",
"type",
"/",
"types",
"exists",
"in",
"an",
"index",
"/",
"indices",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"types",
"-",
"exists",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L260-L284 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.get_mapping | def get_mapping(self, index=None, doc_type=None, params=None):
"""
Retrieve mapping definition of index or index/type.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html>`_
:arg index: A comma-separated list of index names
:arg doc_type: A comma-separated list of document types
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg include_type_name: Specify whether requests and responses should include a
type name (default: depends on Elasticsearch version).
"""
return self.transport.perform_request(
"GET", _make_path(index, "_mapping", doc_type), params=params
) | python | def get_mapping(self, index=None, doc_type=None, params=None):
"""
Retrieve mapping definition of index or index/type.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html>`_
:arg index: A comma-separated list of index names
:arg doc_type: A comma-separated list of document types
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg include_type_name: Specify whether requests and responses should include a
type name (default: depends on Elasticsearch version).
"""
return self.transport.perform_request(
"GET", _make_path(index, "_mapping", doc_type), params=params
) | [
"def",
"get_mapping",
"(",
"self",
",",
"index",
"=",
"None",
",",
"doc_type",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"index",
",",
"\"_mapping\"",
",",
"doc_type",
")",
",",
"params",
"=",
"params",
")"
] | Retrieve mapping definition of index or index/type.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html>`_
:arg index: A comma-separated list of index names
:arg doc_type: A comma-separated list of document types
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg include_type_name: Specify whether requests and responses should include a
type name (default: depends on Elasticsearch version). | [
"Retrieve",
"mapping",
"definition",
"of",
"index",
"or",
"index",
"/",
"type",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"get",
"-",
"mapping",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L331-L353 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.get_field_mapping | def get_field_mapping(self, fields, index=None, doc_type=None, params=None):
"""
Retrieve mapping definition of a specific field.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-field-mapping.html>`_
:arg fields: A comma-separated list of fields
:arg index: A comma-separated list of index names
:arg doc_type: A comma-separated list of document types
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg include_defaults: Whether the default mapping values should be
returned as well
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg include_type_name: Specify whether requests and responses should include a
type name (default: depends on Elasticsearch version).
"""
if fields in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'fields'.")
return self.transport.perform_request(
"GET",
_make_path(index, "_mapping", doc_type, "field", fields),
params=params,
) | python | def get_field_mapping(self, fields, index=None, doc_type=None, params=None):
"""
Retrieve mapping definition of a specific field.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-field-mapping.html>`_
:arg fields: A comma-separated list of fields
:arg index: A comma-separated list of index names
:arg doc_type: A comma-separated list of document types
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg include_defaults: Whether the default mapping values should be
returned as well
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg include_type_name: Specify whether requests and responses should include a
type name (default: depends on Elasticsearch version).
"""
if fields in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'fields'.")
return self.transport.perform_request(
"GET",
_make_path(index, "_mapping", doc_type, "field", fields),
params=params,
) | [
"def",
"get_field_mapping",
"(",
"self",
",",
"fields",
",",
"index",
"=",
"None",
",",
"doc_type",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"fields",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'fields'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"index",
",",
"\"_mapping\"",
",",
"doc_type",
",",
"\"field\"",
",",
"fields",
")",
",",
"params",
"=",
"params",
",",
")"
] | Retrieve mapping definition of a specific field.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-field-mapping.html>`_
:arg fields: A comma-separated list of fields
:arg index: A comma-separated list of index names
:arg doc_type: A comma-separated list of document types
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg include_defaults: Whether the default mapping values should be
returned as well
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg include_type_name: Specify whether requests and responses should include a
type name (default: depends on Elasticsearch version). | [
"Retrieve",
"mapping",
"definition",
"of",
"a",
"specific",
"field",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"get",
"-",
"field",
"-",
"mapping",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L363-L392 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.put_alias | def put_alias(self, index, name, body=None, params=None):
"""
Create an alias for a specific index/indices.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_
:arg index: A comma-separated list of index names the alias should point
to (supports wildcards); use `_all` to perform the operation on all
indices.
:arg name: The name of the alias to be created or updated
:arg body: The settings for the alias, such as `routing` or `filter`
:arg master_timeout: Specify timeout for connection to master
:arg request_timeout: Explicit timeout for the operation
"""
for param in (index, name):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"PUT", _make_path(index, "_alias", name), params=params, body=body
) | python | def put_alias(self, index, name, body=None, params=None):
"""
Create an alias for a specific index/indices.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_
:arg index: A comma-separated list of index names the alias should point
to (supports wildcards); use `_all` to perform the operation on all
indices.
:arg name: The name of the alias to be created or updated
:arg body: The settings for the alias, such as `routing` or `filter`
:arg master_timeout: Specify timeout for connection to master
:arg request_timeout: Explicit timeout for the operation
"""
for param in (index, name):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"PUT", _make_path(index, "_alias", name), params=params, body=body
) | [
"def",
"put_alias",
"(",
"self",
",",
"index",
",",
"name",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"index",
",",
"name",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"PUT\"",
",",
"_make_path",
"(",
"index",
",",
"\"_alias\"",
",",
"name",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
")"
] | Create an alias for a specific index/indices.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_
:arg index: A comma-separated list of index names the alias should point
to (supports wildcards); use `_all` to perform the operation on all
indices.
:arg name: The name of the alias to be created or updated
:arg body: The settings for the alias, such as `routing` or `filter`
:arg master_timeout: Specify timeout for connection to master
:arg request_timeout: Explicit timeout for the operation | [
"Create",
"an",
"alias",
"for",
"a",
"specific",
"index",
"/",
"indices",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"aliases",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L395-L413 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.exists_alias | def exists_alias(self, index=None, name=None, params=None):
"""
Return a boolean indicating whether given alias exists.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_
:arg index: A comma-separated list of index names to filter aliases
:arg name: A comma-separated list of alias names to return
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'all', valid choices
are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg local: Return local information, do not retrieve the state from
master node (default: false)
"""
return self.transport.perform_request(
"HEAD", _make_path(index, "_alias", name), params=params
) | python | def exists_alias(self, index=None, name=None, params=None):
"""
Return a boolean indicating whether given alias exists.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_
:arg index: A comma-separated list of index names to filter aliases
:arg name: A comma-separated list of alias names to return
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'all', valid choices
are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg local: Return local information, do not retrieve the state from
master node (default: false)
"""
return self.transport.perform_request(
"HEAD", _make_path(index, "_alias", name), params=params
) | [
"def",
"exists_alias",
"(",
"self",
",",
"index",
"=",
"None",
",",
"name",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"HEAD\"",
",",
"_make_path",
"(",
"index",
",",
"\"_alias\"",
",",
"name",
")",
",",
"params",
"=",
"params",
")"
] | Return a boolean indicating whether given alias exists.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_
:arg index: A comma-separated list of index names to filter aliases
:arg name: A comma-separated list of alias names to return
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'all', valid choices
are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg local: Return local information, do not retrieve the state from
master node (default: false) | [
"Return",
"a",
"boolean",
"indicating",
"whether",
"given",
"alias",
"exists",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"aliases",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L416-L436 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.get_alias | def get_alias(self, index=None, name=None, params=None):
"""
Retrieve a specified alias.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_
:arg index: A comma-separated list of index names to filter aliases
:arg name: A comma-separated list of alias names to return
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'all', valid choices
are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg local: Return local information, do not retrieve the state from
master node (default: false)
"""
return self.transport.perform_request(
"GET", _make_path(index, "_alias", name), params=params
) | python | def get_alias(self, index=None, name=None, params=None):
"""
Retrieve a specified alias.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_
:arg index: A comma-separated list of index names to filter aliases
:arg name: A comma-separated list of alias names to return
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'all', valid choices
are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg local: Return local information, do not retrieve the state from
master node (default: false)
"""
return self.transport.perform_request(
"GET", _make_path(index, "_alias", name), params=params
) | [
"def",
"get_alias",
"(",
"self",
",",
"index",
"=",
"None",
",",
"name",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"index",
",",
"\"_alias\"",
",",
"name",
")",
",",
"params",
"=",
"params",
")"
] | Retrieve a specified alias.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_
:arg index: A comma-separated list of index names to filter aliases
:arg name: A comma-separated list of alias names to return
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'all', valid choices
are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg local: Return local information, do not retrieve the state from
master node (default: false) | [
"Retrieve",
"a",
"specified",
"alias",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"aliases",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L439-L459 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.update_aliases | def update_aliases(self, body, params=None):
"""
Update specified aliases.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_
:arg body: The definition of `actions` to perform
:arg master_timeout: Specify timeout for connection to master
:arg request_timeout: Request timeout
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
return self.transport.perform_request(
"POST", "/_aliases", params=params, body=body
) | python | def update_aliases(self, body, params=None):
"""
Update specified aliases.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_
:arg body: The definition of `actions` to perform
:arg master_timeout: Specify timeout for connection to master
:arg request_timeout: Request timeout
"""
if body in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'body'.")
return self.transport.perform_request(
"POST", "/_aliases", params=params, body=body
) | [
"def",
"update_aliases",
"(",
"self",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"if",
"body",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'body'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"\"/_aliases\"",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
")"
] | Update specified aliases.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_
:arg body: The definition of `actions` to perform
:arg master_timeout: Specify timeout for connection to master
:arg request_timeout: Request timeout | [
"Update",
"specified",
"aliases",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"aliases",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L462-L475 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.delete_alias | def delete_alias(self, index, name, params=None):
"""
Delete specific alias.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_
:arg index: A comma-separated list of index names (supports wildcards);
use `_all` for all indices
:arg name: A comma-separated list of aliases to delete (supports
wildcards); use `_all` to delete all aliases for the specified
indices.
:arg master_timeout: Specify timeout for connection to master
:arg request_timeout: Explicit timeout for the operation
"""
for param in (index, name):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"DELETE", _make_path(index, "_alias", name), params=params
) | python | def delete_alias(self, index, name, params=None):
"""
Delete specific alias.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_
:arg index: A comma-separated list of index names (supports wildcards);
use `_all` for all indices
:arg name: A comma-separated list of aliases to delete (supports
wildcards); use `_all` to delete all aliases for the specified
indices.
:arg master_timeout: Specify timeout for connection to master
:arg request_timeout: Explicit timeout for the operation
"""
for param in (index, name):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"DELETE", _make_path(index, "_alias", name), params=params
) | [
"def",
"delete_alias",
"(",
"self",
",",
"index",
",",
"name",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"index",
",",
"name",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"DELETE\"",
",",
"_make_path",
"(",
"index",
",",
"\"_alias\"",
",",
"name",
")",
",",
"params",
"=",
"params",
")"
] | Delete specific alias.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_
:arg index: A comma-separated list of index names (supports wildcards);
use `_all` for all indices
:arg name: A comma-separated list of aliases to delete (supports
wildcards); use `_all` to delete all aliases for the specified
indices.
:arg master_timeout: Specify timeout for connection to master
:arg request_timeout: Explicit timeout for the operation | [
"Delete",
"specific",
"alias",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"aliases",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L478-L496 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.get_template | def get_template(self, name=None, params=None):
"""
Retrieve an index template by its name.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html>`_
:arg name: The name of the template
:arg flat_settings: Return settings in flat format (default: false)
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg include_type_name: Specify whether requests and responses should include a
type name (default: depends on Elasticsearch version).
"""
return self.transport.perform_request(
"GET", _make_path("_template", name), params=params
) | python | def get_template(self, name=None, params=None):
"""
Retrieve an index template by its name.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html>`_
:arg name: The name of the template
:arg flat_settings: Return settings in flat format (default: false)
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg include_type_name: Specify whether requests and responses should include a
type name (default: depends on Elasticsearch version).
"""
return self.transport.perform_request(
"GET", _make_path("_template", name), params=params
) | [
"def",
"get_template",
"(",
"self",
",",
"name",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"\"_template\"",
",",
"name",
")",
",",
"params",
"=",
"params",
")"
] | Retrieve an index template by its name.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html>`_
:arg name: The name of the template
:arg flat_settings: Return settings in flat format (default: false)
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg include_type_name: Specify whether requests and responses should include a
type name (default: depends on Elasticsearch version). | [
"Retrieve",
"an",
"index",
"template",
"by",
"its",
"name",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"templates",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L551-L567 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.get_settings | def get_settings(self, index=None, name=None, params=None):
"""
Retrieve settings for one or more (or all) indices.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-settings.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg name: The name of the settings that should be included
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default ['open', 'closed'],
valid choices are: 'open', 'closed', 'none', 'all'
:arg flat_settings: Return settings in flat format (default: false)
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg include_defaults: Whether to return all default setting for each of
the indices., default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
"""
return self.transport.perform_request(
"GET", _make_path(index, "_settings", name), params=params
) | python | def get_settings(self, index=None, name=None, params=None):
"""
Retrieve settings for one or more (or all) indices.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-settings.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg name: The name of the settings that should be included
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default ['open', 'closed'],
valid choices are: 'open', 'closed', 'none', 'all'
:arg flat_settings: Return settings in flat format (default: false)
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg include_defaults: Whether to return all default setting for each of
the indices., default False
:arg local: Return local information, do not retrieve the state from
master node (default: false)
"""
return self.transport.perform_request(
"GET", _make_path(index, "_settings", name), params=params
) | [
"def",
"get_settings",
"(",
"self",
",",
"index",
"=",
"None",
",",
"name",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"index",
",",
"\"_settings\"",
",",
"name",
")",
",",
"params",
"=",
"params",
")"
] | Retrieve settings for one or more (or all) indices.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-settings.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg name: The name of the settings that should be included
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default ['open', 'closed'],
valid choices are: 'open', 'closed', 'none', 'all'
:arg flat_settings: Return settings in flat format (default: false)
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg include_defaults: Whether to return all default setting for each of
the indices., default False
:arg local: Return local information, do not retrieve the state from
master node (default: false) | [
"Retrieve",
"settings",
"for",
"one",
"or",
"more",
"(",
"or",
"all",
")",
"indices",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"get",
"-",
"settings",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L593-L617 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.stats | def stats(self, index=None, metric=None, params=None):
"""
Retrieve statistics on different operations happening on an index.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg metric: Limit the information returned the specific metrics.
:arg completion_fields: A comma-separated list of fields for `fielddata`
and `suggest` index metric (supports wildcards)
:arg fielddata_fields: A comma-separated list of fields for `fielddata`
index metric (supports wildcards)
:arg fields: A comma-separated list of fields for `fielddata` and
`completion` index metric (supports wildcards)
:arg groups: A comma-separated list of search groups for `search` index
metric
:arg include_segment_file_sizes: Whether to report the aggregated disk
usage of each one of the Lucene index files (only applies if segment
stats are requested), default False
:arg level: Return stats aggregated at cluster, index or shard level,
default 'indices', valid choices are: 'cluster', 'indices', 'shards'
:arg types: A comma-separated list of document types for the `indexing`
index metric
"""
return self.transport.perform_request(
"GET", _make_path(index, "_stats", metric), params=params
) | python | def stats(self, index=None, metric=None, params=None):
"""
Retrieve statistics on different operations happening on an index.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg metric: Limit the information returned the specific metrics.
:arg completion_fields: A comma-separated list of fields for `fielddata`
and `suggest` index metric (supports wildcards)
:arg fielddata_fields: A comma-separated list of fields for `fielddata`
index metric (supports wildcards)
:arg fields: A comma-separated list of fields for `fielddata` and
`completion` index metric (supports wildcards)
:arg groups: A comma-separated list of search groups for `search` index
metric
:arg include_segment_file_sizes: Whether to report the aggregated disk
usage of each one of the Lucene index files (only applies if segment
stats are requested), default False
:arg level: Return stats aggregated at cluster, index or shard level,
default 'indices', valid choices are: 'cluster', 'indices', 'shards'
:arg types: A comma-separated list of document types for the `indexing`
index metric
"""
return self.transport.perform_request(
"GET", _make_path(index, "_stats", metric), params=params
) | [
"def",
"stats",
"(",
"self",
",",
"index",
"=",
"None",
",",
"metric",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"index",
",",
"\"_stats\"",
",",
"metric",
")",
",",
"params",
"=",
"params",
")"
] | Retrieve statistics on different operations happening on an index.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg metric: Limit the information returned the specific metrics.
:arg completion_fields: A comma-separated list of fields for `fielddata`
and `suggest` index metric (supports wildcards)
:arg fielddata_fields: A comma-separated list of fields for `fielddata`
index metric (supports wildcards)
:arg fields: A comma-separated list of fields for `fielddata` and
`completion` index metric (supports wildcards)
:arg groups: A comma-separated list of search groups for `search` index
metric
:arg include_segment_file_sizes: Whether to report the aggregated disk
usage of each one of the Lucene index files (only applies if segment
stats are requested), default False
:arg level: Return stats aggregated at cluster, index or shard level,
default 'indices', valid choices are: 'cluster', 'indices', 'shards'
:arg types: A comma-separated list of document types for the `indexing`
index metric | [
"Retrieve",
"statistics",
"on",
"different",
"operations",
"happening",
"on",
"an",
"index",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"stats",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L664-L690 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.clear_cache | def clear_cache(self, index=None, params=None):
"""
Clear either all caches or specific cached associated with one ore more indices.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-clearcache.html>`_
:arg index: A comma-separated list of index name to limit the operation
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg field_data: Clear field data
:arg fielddata: Clear field data
:arg fields: A comma-separated list of fields to clear when using the
`field_data` parameter (default: all)
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg query: Clear query caches
:arg recycler: Clear the recycler cache
:arg request: Clear request cache
:arg request_cache: Clear request cache
"""
return self.transport.perform_request(
"POST", _make_path(index, "_cache", "clear"), params=params
) | python | def clear_cache(self, index=None, params=None):
"""
Clear either all caches or specific cached associated with one ore more indices.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-clearcache.html>`_
:arg index: A comma-separated list of index name to limit the operation
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg field_data: Clear field data
:arg fielddata: Clear field data
:arg fields: A comma-separated list of fields to clear when using the
`field_data` parameter (default: all)
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg query: Clear query caches
:arg recycler: Clear the recycler cache
:arg request: Clear request cache
:arg request_cache: Clear request cache
"""
return self.transport.perform_request(
"POST", _make_path(index, "_cache", "clear"), params=params
) | [
"def",
"clear_cache",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"index",
",",
"\"_cache\"",
",",
"\"clear\"",
")",
",",
"params",
"=",
"params",
")"
] | Clear either all caches or specific cached associated with one ore more indices.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-clearcache.html>`_
:arg index: A comma-separated list of index name to limit the operation
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg field_data: Clear field data
:arg fielddata: Clear field data
:arg fields: A comma-separated list of fields to clear when using the
`field_data` parameter (default: all)
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg query: Clear query caches
:arg recycler: Clear the recycler cache
:arg request: Clear request cache
:arg request_cache: Clear request cache | [
"Clear",
"either",
"all",
"caches",
"or",
"specific",
"cached",
"associated",
"with",
"one",
"ore",
"more",
"indices",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"clearcache",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L790-L815 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.upgrade | def upgrade(self, index=None, params=None):
"""
Upgrade one or more indices to the latest format through an API.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-upgrade.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg only_ancient_segments: If true, only ancient (an older Lucene major
release) segments will be upgraded
:arg wait_for_completion: Specify whether the request should block until
the all segments are upgraded (default: false)
"""
return self.transport.perform_request(
"POST", _make_path(index, "_upgrade"), params=params
) | python | def upgrade(self, index=None, params=None):
"""
Upgrade one or more indices to the latest format through an API.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-upgrade.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg only_ancient_segments: If true, only ancient (an older Lucene major
release) segments will be upgraded
:arg wait_for_completion: Specify whether the request should block until
the all segments are upgraded (default: false)
"""
return self.transport.perform_request(
"POST", _make_path(index, "_upgrade"), params=params
) | [
"def",
"upgrade",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"index",
",",
"\"_upgrade\"",
")",
",",
"params",
"=",
"params",
")"
] | Upgrade one or more indices to the latest format through an API.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-upgrade.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg only_ancient_segments: If true, only ancient (an older Lucene major
release) segments will be upgraded
:arg wait_for_completion: Specify whether the request should block until
the all segments are upgraded (default: false) | [
"Upgrade",
"one",
"or",
"more",
"indices",
"to",
"the",
"latest",
"format",
"through",
"an",
"API",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"upgrade",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L843-L865 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.get_upgrade | def get_upgrade(self, index=None, params=None):
"""
Monitor how much of one or more index is upgraded.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-upgrade.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
"""
return self.transport.perform_request(
"GET", _make_path(index, "_upgrade"), params=params
) | python | def get_upgrade(self, index=None, params=None):
"""
Monitor how much of one or more index is upgraded.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-upgrade.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
"""
return self.transport.perform_request(
"GET", _make_path(index, "_upgrade"), params=params
) | [
"def",
"get_upgrade",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"index",
",",
"\"_upgrade\"",
")",
",",
"params",
"=",
"params",
")"
] | Monitor how much of one or more index is upgraded.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-upgrade.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed) | [
"Monitor",
"how",
"much",
"of",
"one",
"or",
"more",
"index",
"is",
"upgraded",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"upgrade",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L868-L886 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.flush_synced | def flush_synced(self, index=None, params=None):
"""
Perform a normal flush, then add a generated unique marker (sync_id) to all shards.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-synced-flush.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string for all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
"""
return self.transport.perform_request(
"POST", _make_path(index, "_flush", "synced"), params=params
) | python | def flush_synced(self, index=None, params=None):
"""
Perform a normal flush, then add a generated unique marker (sync_id) to all shards.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-synced-flush.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string for all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
"""
return self.transport.perform_request(
"POST", _make_path(index, "_flush", "synced"), params=params
) | [
"def",
"flush_synced",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"index",
",",
"\"_flush\"",
",",
"\"synced\"",
")",
",",
"params",
"=",
"params",
")"
] | Perform a normal flush, then add a generated unique marker (sync_id) to all shards.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-synced-flush.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string for all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed) | [
"Perform",
"a",
"normal",
"flush",
"then",
"add",
"a",
"generated",
"unique",
"marker",
"(",
"sync_id",
")",
"to",
"all",
"shards",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"synced",
"-",
"flush",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L889-L907 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.shard_stores | def shard_stores(self, index=None, params=None):
"""
Provides store information for shard copies of indices. Store
information reports on which nodes shard copies exist, the shard copy
version, indicating how recent they are, and any exceptions encountered
while opening the shard index or from earlier engine failure.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-shards-stores.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg operation_threading: TODO: ?
:arg status: A comma-separated list of statuses used to filter on shards
to get store information for, valid choices are: 'green', 'yellow',
'red', 'all'
"""
return self.transport.perform_request(
"GET", _make_path(index, "_shard_stores"), params=params
) | python | def shard_stores(self, index=None, params=None):
"""
Provides store information for shard copies of indices. Store
information reports on which nodes shard copies exist, the shard copy
version, indicating how recent they are, and any exceptions encountered
while opening the shard index or from earlier engine failure.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-shards-stores.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg operation_threading: TODO: ?
:arg status: A comma-separated list of statuses used to filter on shards
to get store information for, valid choices are: 'green', 'yellow',
'red', 'all'
"""
return self.transport.perform_request(
"GET", _make_path(index, "_shard_stores"), params=params
) | [
"def",
"shard_stores",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"GET\"",
",",
"_make_path",
"(",
"index",
",",
"\"_shard_stores\"",
")",
",",
"params",
"=",
"params",
")"
] | Provides store information for shard copies of indices. Store
information reports on which nodes shard copies exist, the shard copy
version, indicating how recent they are, and any exceptions encountered
while opening the shard index or from earlier engine failure.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-shards-stores.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg operation_threading: TODO: ?
:arg status: A comma-separated list of statuses used to filter on shards
to get store information for, valid choices are: 'green', 'yellow',
'red', 'all' | [
"Provides",
"store",
"information",
"for",
"shard",
"copies",
"of",
"indices",
".",
"Store",
"information",
"reports",
"on",
"which",
"nodes",
"shard",
"copies",
"exist",
"the",
"shard",
"copy",
"version",
"indicating",
"how",
"recent",
"they",
"are",
"and",
"any",
"exceptions",
"encountered",
"while",
"opening",
"the",
"shard",
"index",
"or",
"from",
"earlier",
"engine",
"failure",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"shards",
"-",
"stores",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L916-L941 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.forcemerge | def forcemerge(self, index=None, params=None):
"""
The force merge API allows to force merging of one or more indices
through an API. The merge relates to the number of segments a Lucene
index holds within each shard. The force merge operation allows to
reduce the number of segments by merging them.
This call will block until the merge is complete. If the http
connection is lost, the request will continue in the background, and
any new requests will block until the previous force merge is complete.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg flush: Specify whether the index should be flushed after performing
the operation (default: true)
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg max_num_segments: The number of segments the index should be merged
into (default: dynamic)
:arg only_expunge_deletes: Specify whether the operation should only
expunge deleted documents
:arg operation_threading: TODO: ?
"""
return self.transport.perform_request(
"POST", _make_path(index, "_forcemerge"), params=params
) | python | def forcemerge(self, index=None, params=None):
"""
The force merge API allows to force merging of one or more indices
through an API. The merge relates to the number of segments a Lucene
index holds within each shard. The force merge operation allows to
reduce the number of segments by merging them.
This call will block until the merge is complete. If the http
connection is lost, the request will continue in the background, and
any new requests will block until the previous force merge is complete.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg flush: Specify whether the index should be flushed after performing
the operation (default: true)
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg max_num_segments: The number of segments the index should be merged
into (default: dynamic)
:arg only_expunge_deletes: Specify whether the operation should only
expunge deleted documents
:arg operation_threading: TODO: ?
"""
return self.transport.perform_request(
"POST", _make_path(index, "_forcemerge"), params=params
) | [
"def",
"forcemerge",
"(",
"self",
",",
"index",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"index",
",",
"\"_forcemerge\"",
")",
",",
"params",
"=",
"params",
")"
] | The force merge API allows to force merging of one or more indices
through an API. The merge relates to the number of segments a Lucene
index holds within each shard. The force merge operation allows to
reduce the number of segments by merging them.
This call will block until the merge is complete. If the http
connection is lost, the request will continue in the background, and
any new requests will block until the previous force merge is complete.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html>`_
:arg index: A comma-separated list of index names; use `_all` or empty
string to perform the operation on all indices
:arg 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)
:arg expand_wildcards: Whether to expand wildcard expression to concrete
indices that are open, closed or both., default 'open', valid
choices are: 'open', 'closed', 'none', 'all'
:arg flush: Specify whether the index should be flushed after performing
the operation (default: true)
:arg ignore_unavailable: Whether specified concrete indices should be
ignored when unavailable (missing or closed)
:arg max_num_segments: The number of segments the index should be merged
into (default: dynamic)
:arg only_expunge_deletes: Specify whether the operation should only
expunge deleted documents
:arg operation_threading: TODO: ? | [
"The",
"force",
"merge",
"API",
"allows",
"to",
"force",
"merging",
"of",
"one",
"or",
"more",
"indices",
"through",
"an",
"API",
".",
"The",
"merge",
"relates",
"to",
"the",
"number",
"of",
"segments",
"a",
"Lucene",
"index",
"holds",
"within",
"each",
"shard",
".",
"The",
"force",
"merge",
"operation",
"allows",
"to",
"reduce",
"the",
"number",
"of",
"segments",
"by",
"merging",
"them",
"."
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L953-L985 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.shrink | def shrink(self, index, target, body=None, params=None):
"""
The shrink index API allows you to shrink an existing index into a new
index with fewer primary shards. The number of primary shards in the
target index must be a factor of the shards in the source index. For
example an index with 8 primary shards can be shrunk into 4, 2 or 1
primary shards or an index with 15 primary shards can be shrunk into 5,
3 or 1. If the number of shards in the index is a prime number it can
only be shrunk into a single primary shard. Before shrinking, a
(primary or replica) copy of every shard in the index must be present
on the same node.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-shrink-index.html>`_
:arg index: The name of the source index to shrink
:arg target: The name of the target index to shrink into
:arg body: The configuration for the target index (`settings` and
`aliases`)
:arg master_timeout: Specify timeout for connection to master
:arg request_timeout: Explicit operation timeout
:arg wait_for_active_shards: Set the number of active shards to wait for
on the shrunken index before the operation returns.
"""
for param in (index, target):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"PUT", _make_path(index, "_shrink", target), params=params, body=body
) | python | def shrink(self, index, target, body=None, params=None):
"""
The shrink index API allows you to shrink an existing index into a new
index with fewer primary shards. The number of primary shards in the
target index must be a factor of the shards in the source index. For
example an index with 8 primary shards can be shrunk into 4, 2 or 1
primary shards or an index with 15 primary shards can be shrunk into 5,
3 or 1. If the number of shards in the index is a prime number it can
only be shrunk into a single primary shard. Before shrinking, a
(primary or replica) copy of every shard in the index must be present
on the same node.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-shrink-index.html>`_
:arg index: The name of the source index to shrink
:arg target: The name of the target index to shrink into
:arg body: The configuration for the target index (`settings` and
`aliases`)
:arg master_timeout: Specify timeout for connection to master
:arg request_timeout: Explicit operation timeout
:arg wait_for_active_shards: Set the number of active shards to wait for
on the shrunken index before the operation returns.
"""
for param in (index, target):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request(
"PUT", _make_path(index, "_shrink", target), params=params, body=body
) | [
"def",
"shrink",
"(",
"self",
",",
"index",
",",
"target",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"index",
",",
"target",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"PUT\"",
",",
"_make_path",
"(",
"index",
",",
"\"_shrink\"",
",",
"target",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
")"
] | The shrink index API allows you to shrink an existing index into a new
index with fewer primary shards. The number of primary shards in the
target index must be a factor of the shards in the source index. For
example an index with 8 primary shards can be shrunk into 4, 2 or 1
primary shards or an index with 15 primary shards can be shrunk into 5,
3 or 1. If the number of shards in the index is a prime number it can
only be shrunk into a single primary shard. Before shrinking, a
(primary or replica) copy of every shard in the index must be present
on the same node.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-shrink-index.html>`_
:arg index: The name of the source index to shrink
:arg target: The name of the target index to shrink into
:arg body: The configuration for the target index (`settings` and
`aliases`)
:arg master_timeout: Specify timeout for connection to master
:arg request_timeout: Explicit operation timeout
:arg wait_for_active_shards: Set the number of active shards to wait for
on the shrunken index before the operation returns. | [
"The",
"shrink",
"index",
"API",
"allows",
"you",
"to",
"shrink",
"an",
"existing",
"index",
"into",
"a",
"new",
"index",
"with",
"fewer",
"primary",
"shards",
".",
"The",
"number",
"of",
"primary",
"shards",
"in",
"the",
"target",
"index",
"must",
"be",
"a",
"factor",
"of",
"the",
"shards",
"in",
"the",
"source",
"index",
".",
"For",
"example",
"an",
"index",
"with",
"8",
"primary",
"shards",
"can",
"be",
"shrunk",
"into",
"4",
"2",
"or",
"1",
"primary",
"shards",
"or",
"an",
"index",
"with",
"15",
"primary",
"shards",
"can",
"be",
"shrunk",
"into",
"5",
"3",
"or",
"1",
".",
"If",
"the",
"number",
"of",
"shards",
"in",
"the",
"index",
"is",
"a",
"prime",
"number",
"it",
"can",
"only",
"be",
"shrunk",
"into",
"a",
"single",
"primary",
"shard",
".",
"Before",
"shrinking",
"a",
"(",
"primary",
"or",
"replica",
")",
"copy",
"of",
"every",
"shard",
"in",
"the",
"index",
"must",
"be",
"present",
"on",
"the",
"same",
"node",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"indices",
"-",
"shrink",
"-",
"index",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L988-L1015 | train |
elastic/elasticsearch-py | elasticsearch/client/indices.py | IndicesClient.rollover | def rollover(self, alias, new_index=None, body=None, params=None):
"""
The rollover index API rolls an alias over to a new index when the
existing index is considered to be too large or too old.
The API accepts a single alias name and a list of conditions. The alias
must point to a single index only. If the index satisfies the specified
conditions then a new index is created and the alias is switched to
point to the new alias.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-rollover-index.html>`_
:arg alias: The name of the alias to rollover
:arg new_index: The name of the rollover index
:arg body: The conditions that needs to be met for executing rollover
:arg dry_run: If set to true the rollover action will only be validated
but not actually performed even if a condition matches. The default
is false
:arg master_timeout: Specify timeout for connection to master
:arg request_timeout: Explicit operation timeout
:arg wait_for_active_shards: Set the number of active shards to wait for
on the newly created rollover index before the operation returns.
:arg include_type_name: Specify whether requests and responses should include a
type name (default: depends on Elasticsearch version).
"""
if alias in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'alias'.")
return self.transport.perform_request(
"POST", _make_path(alias, "_rollover", new_index), params=params, body=body
) | python | def rollover(self, alias, new_index=None, body=None, params=None):
"""
The rollover index API rolls an alias over to a new index when the
existing index is considered to be too large or too old.
The API accepts a single alias name and a list of conditions. The alias
must point to a single index only. If the index satisfies the specified
conditions then a new index is created and the alias is switched to
point to the new alias.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-rollover-index.html>`_
:arg alias: The name of the alias to rollover
:arg new_index: The name of the rollover index
:arg body: The conditions that needs to be met for executing rollover
:arg dry_run: If set to true the rollover action will only be validated
but not actually performed even if a condition matches. The default
is false
:arg master_timeout: Specify timeout for connection to master
:arg request_timeout: Explicit operation timeout
:arg wait_for_active_shards: Set the number of active shards to wait for
on the newly created rollover index before the operation returns.
:arg include_type_name: Specify whether requests and responses should include a
type name (default: depends on Elasticsearch version).
"""
if alias in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'alias'.")
return self.transport.perform_request(
"POST", _make_path(alias, "_rollover", new_index), params=params, body=body
) | [
"def",
"rollover",
"(",
"self",
",",
"alias",
",",
"new_index",
"=",
"None",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"if",
"alias",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'alias'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"\"POST\"",
",",
"_make_path",
"(",
"alias",
",",
"\"_rollover\"",
",",
"new_index",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
")"
] | The rollover index API rolls an alias over to a new index when the
existing index is considered to be too large or too old.
The API accepts a single alias name and a list of conditions. The alias
must point to a single index only. If the index satisfies the specified
conditions then a new index is created and the alias is switched to
point to the new alias.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-rollover-index.html>`_
:arg alias: The name of the alias to rollover
:arg new_index: The name of the rollover index
:arg body: The conditions that needs to be met for executing rollover
:arg dry_run: If set to true the rollover action will only be validated
but not actually performed even if a condition matches. The default
is false
:arg master_timeout: Specify timeout for connection to master
:arg request_timeout: Explicit operation timeout
:arg wait_for_active_shards: Set the number of active shards to wait for
on the newly created rollover index before the operation returns.
:arg include_type_name: Specify whether requests and responses should include a
type name (default: depends on Elasticsearch version). | [
"The",
"rollover",
"index",
"API",
"rolls",
"an",
"alias",
"over",
"to",
"a",
"new",
"index",
"when",
"the",
"existing",
"index",
"is",
"considered",
"to",
"be",
"too",
"large",
"or",
"too",
"old",
"."
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/indices.py#L1024-L1052 | train |
elastic/elasticsearch-py | elasticsearch/client/snapshot.py | SnapshotClient.get | def get(self, repository, snapshot, params=None):
"""
Retrieve information about a snapshot.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: A comma-separated list of snapshot names
:arg ignore_unavailable: Whether to ignore unavailable snapshots,
defaults to false which means a NotFoundError `snapshot_missing_exception` is thrown
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg verbose: Whether to show verbose snapshot info or only show the
basic info found in the repository index blob
"""
for param in (repository, snapshot):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request('GET', _make_path('_snapshot',
repository, snapshot), params=params) | python | def get(self, repository, snapshot, params=None):
"""
Retrieve information about a snapshot.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: A comma-separated list of snapshot names
:arg ignore_unavailable: Whether to ignore unavailable snapshots,
defaults to false which means a NotFoundError `snapshot_missing_exception` is thrown
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg verbose: Whether to show verbose snapshot info or only show the
basic info found in the repository index blob
"""
for param in (repository, snapshot):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request('GET', _make_path('_snapshot',
repository, snapshot), params=params) | [
"def",
"get",
"(",
"self",
",",
"repository",
",",
"snapshot",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"repository",
",",
"snapshot",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_snapshot'",
",",
"repository",
",",
"snapshot",
")",
",",
"params",
"=",
"params",
")"
] | Retrieve information about a snapshot.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: A comma-separated list of snapshot names
:arg ignore_unavailable: Whether to ignore unavailable snapshots,
defaults to false which means a NotFoundError `snapshot_missing_exception` is thrown
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg verbose: Whether to show verbose snapshot info or only show the
basic info found in the repository index blob | [
"Retrieve",
"information",
"about",
"a",
"snapshot",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"modules",
"-",
"snapshots",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/snapshot.py#L42-L60 | train |
elastic/elasticsearch-py | elasticsearch/client/snapshot.py | SnapshotClient.delete_repository | def delete_repository(self, repository, params=None):
"""
Removes a shared file system repository.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A comma-separated list of repository names
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg timeout: Explicit operation timeout
"""
if repository in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'repository'.")
return self.transport.perform_request('DELETE',
_make_path('_snapshot', repository), params=params) | python | def delete_repository(self, repository, params=None):
"""
Removes a shared file system repository.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A comma-separated list of repository names
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg timeout: Explicit operation timeout
"""
if repository in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument 'repository'.")
return self.transport.perform_request('DELETE',
_make_path('_snapshot', repository), params=params) | [
"def",
"delete_repository",
"(",
"self",
",",
"repository",
",",
"params",
"=",
"None",
")",
":",
"if",
"repository",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument 'repository'.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'DELETE'",
",",
"_make_path",
"(",
"'_snapshot'",
",",
"repository",
")",
",",
"params",
"=",
"params",
")"
] | Removes a shared file system repository.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A comma-separated list of repository names
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg timeout: Explicit operation timeout | [
"Removes",
"a",
"shared",
"file",
"system",
"repository",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"modules",
"-",
"snapshots",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/snapshot.py#L63-L76 | train |
elastic/elasticsearch-py | elasticsearch/client/snapshot.py | SnapshotClient.get_repository | def get_repository(self, repository=None, params=None):
"""
Return information about registered repositories.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A comma-separated list of repository names
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
"""
return self.transport.perform_request('GET', _make_path('_snapshot',
repository), params=params) | python | def get_repository(self, repository=None, params=None):
"""
Return information about registered repositories.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A comma-separated list of repository names
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node
"""
return self.transport.perform_request('GET', _make_path('_snapshot',
repository), params=params) | [
"def",
"get_repository",
"(",
"self",
",",
"repository",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_snapshot'",
",",
"repository",
")",
",",
"params",
"=",
"params",
")"
] | Return information about registered repositories.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A comma-separated list of repository names
:arg local: Return local information, do not retrieve the state from
master node (default: false)
:arg master_timeout: Explicit operation timeout for connection to master
node | [
"Return",
"information",
"about",
"registered",
"repositories",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"modules",
"-",
"snapshots",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/snapshot.py#L79-L91 | train |
elastic/elasticsearch-py | elasticsearch/client/snapshot.py | SnapshotClient.create_repository | def create_repository(self, repository, body, params=None):
"""
Registers a shared file system repository.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A repository name
:arg body: The repository definition
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg timeout: Explicit operation timeout
:arg verify: Whether to verify the repository after creation
"""
for param in (repository, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request('PUT', _make_path('_snapshot',
repository), params=params, body=body) | python | def create_repository(self, repository, body, params=None):
"""
Registers a shared file system repository.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A repository name
:arg body: The repository definition
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg timeout: Explicit operation timeout
:arg verify: Whether to verify the repository after creation
"""
for param in (repository, body):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request('PUT', _make_path('_snapshot',
repository), params=params, body=body) | [
"def",
"create_repository",
"(",
"self",
",",
"repository",
",",
"body",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"repository",
",",
"body",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'PUT'",
",",
"_make_path",
"(",
"'_snapshot'",
",",
"repository",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
")"
] | Registers a shared file system repository.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A repository name
:arg body: The repository definition
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg timeout: Explicit operation timeout
:arg verify: Whether to verify the repository after creation | [
"Registers",
"a",
"shared",
"file",
"system",
"repository",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"modules",
"-",
"snapshots",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/snapshot.py#L94-L110 | train |
elastic/elasticsearch-py | elasticsearch/client/snapshot.py | SnapshotClient.restore | def restore(self, repository, snapshot, body=None, params=None):
"""
Restore a snapshot.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: A snapshot name
:arg body: Details of what to restore
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg wait_for_completion: Should this request wait until the operation
has completed before returning, default False
"""
for param in (repository, snapshot):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request('POST', _make_path('_snapshot',
repository, snapshot, '_restore'), params=params, body=body) | python | def restore(self, repository, snapshot, body=None, params=None):
"""
Restore a snapshot.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: A snapshot name
:arg body: Details of what to restore
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg wait_for_completion: Should this request wait until the operation
has completed before returning, default False
"""
for param in (repository, snapshot):
if param in SKIP_IN_PATH:
raise ValueError("Empty value passed for a required argument.")
return self.transport.perform_request('POST', _make_path('_snapshot',
repository, snapshot, '_restore'), params=params, body=body) | [
"def",
"restore",
"(",
"self",
",",
"repository",
",",
"snapshot",
",",
"body",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"for",
"param",
"in",
"(",
"repository",
",",
"snapshot",
")",
":",
"if",
"param",
"in",
"SKIP_IN_PATH",
":",
"raise",
"ValueError",
"(",
"\"Empty value passed for a required argument.\"",
")",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'POST'",
",",
"_make_path",
"(",
"'_snapshot'",
",",
"repository",
",",
"snapshot",
",",
"'_restore'",
")",
",",
"params",
"=",
"params",
",",
"body",
"=",
"body",
")"
] | Restore a snapshot.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: A snapshot name
:arg body: Details of what to restore
:arg master_timeout: Explicit operation timeout for connection to master
node
:arg wait_for_completion: Should this request wait until the operation
has completed before returning, default False | [
"Restore",
"a",
"snapshot",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"modules",
"-",
"snapshots",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/snapshot.py#L113-L130 | train |
elastic/elasticsearch-py | elasticsearch/client/snapshot.py | SnapshotClient.status | def status(self, repository=None, snapshot=None, params=None):
"""
Return information about all currently running snapshots. By specifying
a repository name, it's possible to limit the results to a particular
repository.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: A comma-separated list of snapshot names
:arg ignore_unavailable: Whether to ignore unavailable snapshots,
defaults to false which means a NotFoundError `snapshot_missing_exception` is thrown
:arg master_timeout: Explicit operation timeout for connection to master
node
"""
return self.transport.perform_request('GET', _make_path('_snapshot',
repository, snapshot, '_status'), params=params) | python | def status(self, repository=None, snapshot=None, params=None):
"""
Return information about all currently running snapshots. By specifying
a repository name, it's possible to limit the results to a particular
repository.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: A comma-separated list of snapshot names
:arg ignore_unavailable: Whether to ignore unavailable snapshots,
defaults to false which means a NotFoundError `snapshot_missing_exception` is thrown
:arg master_timeout: Explicit operation timeout for connection to master
node
"""
return self.transport.perform_request('GET', _make_path('_snapshot',
repository, snapshot, '_status'), params=params) | [
"def",
"status",
"(",
"self",
",",
"repository",
"=",
"None",
",",
"snapshot",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_snapshot'",
",",
"repository",
",",
"snapshot",
",",
"'_status'",
")",
",",
"params",
"=",
"params",
")"
] | Return information about all currently running snapshots. By specifying
a repository name, it's possible to limit the results to a particular
repository.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html>`_
:arg repository: A repository name
:arg snapshot: A comma-separated list of snapshot names
:arg ignore_unavailable: Whether to ignore unavailable snapshots,
defaults to false which means a NotFoundError `snapshot_missing_exception` is thrown
:arg master_timeout: Explicit operation timeout for connection to master
node | [
"Return",
"information",
"about",
"all",
"currently",
"running",
"snapshots",
".",
"By",
"specifying",
"a",
"repository",
"name",
"it",
"s",
"possible",
"to",
"limit",
"the",
"results",
"to",
"a",
"particular",
"repository",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"modules",
"-",
"snapshots",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/snapshot.py#L133-L148 | train |
elastic/elasticsearch-py | elasticsearch/client/utils.py | _escape | def _escape(value):
"""
Escape a single value of a URL string or a query parameter. If it is a list
or tuple, turn it into a comma-separated string first.
"""
# make sequences into comma-separated stings
if isinstance(value, (list, tuple)):
value = ",".join(value)
# dates and datetimes into isoformat
elif isinstance(value, (date, datetime)):
value = value.isoformat()
# make bools into true/false strings
elif isinstance(value, bool):
value = str(value).lower()
# don't decode bytestrings
elif isinstance(value, bytes):
return value
# encode strings to utf-8
if isinstance(value, string_types):
if PY2 and isinstance(value, unicode):
return value.encode("utf-8")
if not PY2 and isinstance(value, str):
return value.encode("utf-8")
return str(value) | python | def _escape(value):
"""
Escape a single value of a URL string or a query parameter. If it is a list
or tuple, turn it into a comma-separated string first.
"""
# make sequences into comma-separated stings
if isinstance(value, (list, tuple)):
value = ",".join(value)
# dates and datetimes into isoformat
elif isinstance(value, (date, datetime)):
value = value.isoformat()
# make bools into true/false strings
elif isinstance(value, bool):
value = str(value).lower()
# don't decode bytestrings
elif isinstance(value, bytes):
return value
# encode strings to utf-8
if isinstance(value, string_types):
if PY2 and isinstance(value, unicode):
return value.encode("utf-8")
if not PY2 and isinstance(value, str):
return value.encode("utf-8")
return str(value) | [
"def",
"_escape",
"(",
"value",
")",
":",
"# make sequences into comma-separated stings",
"if",
"isinstance",
"(",
"value",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"value",
"=",
"\",\"",
".",
"join",
"(",
"value",
")",
"# dates and datetimes into isoformat",
"elif",
"isinstance",
"(",
"value",
",",
"(",
"date",
",",
"datetime",
")",
")",
":",
"value",
"=",
"value",
".",
"isoformat",
"(",
")",
"# make bools into true/false strings",
"elif",
"isinstance",
"(",
"value",
",",
"bool",
")",
":",
"value",
"=",
"str",
"(",
"value",
")",
".",
"lower",
"(",
")",
"# don't decode bytestrings",
"elif",
"isinstance",
"(",
"value",
",",
"bytes",
")",
":",
"return",
"value",
"# encode strings to utf-8",
"if",
"isinstance",
"(",
"value",
",",
"string_types",
")",
":",
"if",
"PY2",
"and",
"isinstance",
"(",
"value",
",",
"unicode",
")",
":",
"return",
"value",
".",
"encode",
"(",
"\"utf-8\"",
")",
"if",
"not",
"PY2",
"and",
"isinstance",
"(",
"value",
",",
"str",
")",
":",
"return",
"value",
".",
"encode",
"(",
"\"utf-8\"",
")",
"return",
"str",
"(",
"value",
")"
] | Escape a single value of a URL string or a query parameter. If it is a list
or tuple, turn it into a comma-separated string first. | [
"Escape",
"a",
"single",
"value",
"of",
"a",
"URL",
"string",
"or",
"a",
"query",
"parameter",
".",
"If",
"it",
"is",
"a",
"list",
"or",
"tuple",
"turn",
"it",
"into",
"a",
"comma",
"-",
"separated",
"string",
"first",
"."
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/utils.py#L12-L41 | train |
elastic/elasticsearch-py | elasticsearch/client/utils.py | _make_path | def _make_path(*parts):
"""
Create a URL string from parts, omit all `None` values and empty strings.
Convert lists and tuples to comma separated values.
"""
# TODO: maybe only allow some parts to be lists/tuples ?
return "/" + "/".join(
# preserve ',' and '*' in url for nicer URLs in logs
quote_plus(_escape(p), b",*")
for p in parts
if p not in SKIP_IN_PATH
) | python | def _make_path(*parts):
"""
Create a URL string from parts, omit all `None` values and empty strings.
Convert lists and tuples to comma separated values.
"""
# TODO: maybe only allow some parts to be lists/tuples ?
return "/" + "/".join(
# preserve ',' and '*' in url for nicer URLs in logs
quote_plus(_escape(p), b",*")
for p in parts
if p not in SKIP_IN_PATH
) | [
"def",
"_make_path",
"(",
"*",
"parts",
")",
":",
"# TODO: maybe only allow some parts to be lists/tuples ?",
"return",
"\"/\"",
"+",
"\"/\"",
".",
"join",
"(",
"# preserve ',' and '*' in url for nicer URLs in logs",
"quote_plus",
"(",
"_escape",
"(",
"p",
")",
",",
"b\",*\"",
")",
"for",
"p",
"in",
"parts",
"if",
"p",
"not",
"in",
"SKIP_IN_PATH",
")"
] | Create a URL string from parts, omit all `None` values and empty strings.
Convert lists and tuples to comma separated values. | [
"Create",
"a",
"URL",
"string",
"from",
"parts",
"omit",
"all",
"None",
"values",
"and",
"empty",
"strings",
".",
"Convert",
"lists",
"and",
"tuples",
"to",
"comma",
"separated",
"values",
"."
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/utils.py#L44-L55 | train |
elastic/elasticsearch-py | elasticsearch/client/utils.py | query_params | def query_params(*es_query_params):
"""
Decorator that pops all accepted parameters from method's kwargs and puts
them in the params argument.
"""
def _wrapper(func):
@wraps(func)
def _wrapped(*args, **kwargs):
params = {}
if "params" in kwargs:
params = kwargs.pop("params").copy()
for p in es_query_params + GLOBAL_PARAMS:
if p in kwargs:
v = kwargs.pop(p)
if v is not None:
params[p] = _escape(v)
# don't treat ignore and request_timeout as other params to avoid escaping
for p in ("ignore", "request_timeout"):
if p in kwargs:
params[p] = kwargs.pop(p)
return func(*args, params=params, **kwargs)
return _wrapped
return _wrapper | python | def query_params(*es_query_params):
"""
Decorator that pops all accepted parameters from method's kwargs and puts
them in the params argument.
"""
def _wrapper(func):
@wraps(func)
def _wrapped(*args, **kwargs):
params = {}
if "params" in kwargs:
params = kwargs.pop("params").copy()
for p in es_query_params + GLOBAL_PARAMS:
if p in kwargs:
v = kwargs.pop(p)
if v is not None:
params[p] = _escape(v)
# don't treat ignore and request_timeout as other params to avoid escaping
for p in ("ignore", "request_timeout"):
if p in kwargs:
params[p] = kwargs.pop(p)
return func(*args, params=params, **kwargs)
return _wrapped
return _wrapper | [
"def",
"query_params",
"(",
"*",
"es_query_params",
")",
":",
"def",
"_wrapper",
"(",
"func",
")",
":",
"@",
"wraps",
"(",
"func",
")",
"def",
"_wrapped",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"params",
"=",
"{",
"}",
"if",
"\"params\"",
"in",
"kwargs",
":",
"params",
"=",
"kwargs",
".",
"pop",
"(",
"\"params\"",
")",
".",
"copy",
"(",
")",
"for",
"p",
"in",
"es_query_params",
"+",
"GLOBAL_PARAMS",
":",
"if",
"p",
"in",
"kwargs",
":",
"v",
"=",
"kwargs",
".",
"pop",
"(",
"p",
")",
"if",
"v",
"is",
"not",
"None",
":",
"params",
"[",
"p",
"]",
"=",
"_escape",
"(",
"v",
")",
"# don't treat ignore and request_timeout as other params to avoid escaping",
"for",
"p",
"in",
"(",
"\"ignore\"",
",",
"\"request_timeout\"",
")",
":",
"if",
"p",
"in",
"kwargs",
":",
"params",
"[",
"p",
"]",
"=",
"kwargs",
".",
"pop",
"(",
"p",
")",
"return",
"func",
"(",
"*",
"args",
",",
"params",
"=",
"params",
",",
"*",
"*",
"kwargs",
")",
"return",
"_wrapped",
"return",
"_wrapper"
] | Decorator that pops all accepted parameters from method's kwargs and puts
them in the params argument. | [
"Decorator",
"that",
"pops",
"all",
"accepted",
"parameters",
"from",
"method",
"s",
"kwargs",
"and",
"puts",
"them",
"in",
"the",
"params",
"argument",
"."
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/utils.py#L62-L88 | train |
elastic/elasticsearch-py | elasticsearch/client/tasks.py | TasksClient.get | def get(self, task_id=None, params=None):
"""
Retrieve information for a particular task.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html>`_
:arg task_id: Return the task with specified id (node_id:task_number)
:arg wait_for_completion: Wait for the matching tasks to complete
(default: false)
:arg timeout: Maximum waiting time for `wait_for_completion`
"""
return self.transport.perform_request('GET', _make_path('_tasks',
task_id), params=params) | python | def get(self, task_id=None, params=None):
"""
Retrieve information for a particular task.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html>`_
:arg task_id: Return the task with specified id (node_id:task_number)
:arg wait_for_completion: Wait for the matching tasks to complete
(default: false)
:arg timeout: Maximum waiting time for `wait_for_completion`
"""
return self.transport.perform_request('GET', _make_path('_tasks',
task_id), params=params) | [
"def",
"get",
"(",
"self",
",",
"task_id",
"=",
"None",
",",
"params",
"=",
"None",
")",
":",
"return",
"self",
".",
"transport",
".",
"perform_request",
"(",
"'GET'",
",",
"_make_path",
"(",
"'_tasks'",
",",
"task_id",
")",
",",
"params",
"=",
"params",
")"
] | Retrieve information for a particular task.
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html>`_
:arg task_id: Return the task with specified id (node_id:task_number)
:arg wait_for_completion: Wait for the matching tasks to complete
(default: false)
:arg timeout: Maximum waiting time for `wait_for_completion` | [
"Retrieve",
"information",
"for",
"a",
"particular",
"task",
".",
"<http",
":",
"//",
"www",
".",
"elastic",
".",
"co",
"/",
"guide",
"/",
"en",
"/",
"elasticsearch",
"/",
"reference",
"/",
"current",
"/",
"tasks",
".",
"html",
">",
"_"
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/elasticsearch/client/tasks.py#L48-L59 | train |
elastic/elasticsearch-py | example/queries.py | print_hits | def print_hits(results):
" Simple utility function to print results of a search query. "
print_search_stats(results)
for hit in results['hits']['hits']:
# get created date for a repo and fallback to authored_date for a commit
created_at = parse_date(hit['_source'].get('created_at', hit['_source']['authored_date']))
print('/%s/%s/%s (%s): %s' % (
hit['_index'], hit['_type'], hit['_id'],
created_at.strftime('%Y-%m-%d'),
hit['_source']['description'].split('\n')[0]))
print('=' * 80)
print() | python | def print_hits(results):
" Simple utility function to print results of a search query. "
print_search_stats(results)
for hit in results['hits']['hits']:
# get created date for a repo and fallback to authored_date for a commit
created_at = parse_date(hit['_source'].get('created_at', hit['_source']['authored_date']))
print('/%s/%s/%s (%s): %s' % (
hit['_index'], hit['_type'], hit['_id'],
created_at.strftime('%Y-%m-%d'),
hit['_source']['description'].split('\n')[0]))
print('=' * 80)
print() | [
"def",
"print_hits",
"(",
"results",
")",
":",
"print_search_stats",
"(",
"results",
")",
"for",
"hit",
"in",
"results",
"[",
"'hits'",
"]",
"[",
"'hits'",
"]",
":",
"# get created date for a repo and fallback to authored_date for a commit",
"created_at",
"=",
"parse_date",
"(",
"hit",
"[",
"'_source'",
"]",
".",
"get",
"(",
"'created_at'",
",",
"hit",
"[",
"'_source'",
"]",
"[",
"'authored_date'",
"]",
")",
")",
"print",
"(",
"'/%s/%s/%s (%s): %s'",
"%",
"(",
"hit",
"[",
"'_index'",
"]",
",",
"hit",
"[",
"'_type'",
"]",
",",
"hit",
"[",
"'_id'",
"]",
",",
"created_at",
".",
"strftime",
"(",
"'%Y-%m-%d'",
")",
",",
"hit",
"[",
"'_source'",
"]",
"[",
"'description'",
"]",
".",
"split",
"(",
"'\\n'",
")",
"[",
"0",
"]",
")",
")",
"print",
"(",
"'='",
"*",
"80",
")",
"print",
"(",
")"
] | Simple utility function to print results of a search query. | [
"Simple",
"utility",
"function",
"to",
"print",
"results",
"of",
"a",
"search",
"query",
"."
] | 2aab285c8f506f3863cbdaba3c90a685c510ba00 | https://github.com/elastic/elasticsearch-py/blob/2aab285c8f506f3863cbdaba3c90a685c510ba00/example/queries.py#L14-L26 | train |
fmfn/BayesianOptimization | examples/async_optimization.py | BayesianOptimizationHandler.post | def post(self):
"""Deal with incoming requests."""
body = tornado.escape.json_decode(self.request.body)
try:
self._bo.register(
params=body["params"],
target=body["target"],
)
print("BO has registered: {} points.".format(len(self._bo.space)), end="\n\n")
except KeyError:
pass
finally:
suggested_params = self._bo.suggest(self._uf)
self.write(json.dumps(suggested_params)) | python | def post(self):
"""Deal with incoming requests."""
body = tornado.escape.json_decode(self.request.body)
try:
self._bo.register(
params=body["params"],
target=body["target"],
)
print("BO has registered: {} points.".format(len(self._bo.space)), end="\n\n")
except KeyError:
pass
finally:
suggested_params = self._bo.suggest(self._uf)
self.write(json.dumps(suggested_params)) | [
"def",
"post",
"(",
"self",
")",
":",
"body",
"=",
"tornado",
".",
"escape",
".",
"json_decode",
"(",
"self",
".",
"request",
".",
"body",
")",
"try",
":",
"self",
".",
"_bo",
".",
"register",
"(",
"params",
"=",
"body",
"[",
"\"params\"",
"]",
",",
"target",
"=",
"body",
"[",
"\"target\"",
"]",
",",
")",
"print",
"(",
"\"BO has registered: {} points.\"",
".",
"format",
"(",
"len",
"(",
"self",
".",
"_bo",
".",
"space",
")",
")",
",",
"end",
"=",
"\"\\n\\n\"",
")",
"except",
"KeyError",
":",
"pass",
"finally",
":",
"suggested_params",
"=",
"self",
".",
"_bo",
".",
"suggest",
"(",
"self",
".",
"_uf",
")",
"self",
".",
"write",
"(",
"json",
".",
"dumps",
"(",
"suggested_params",
")",
")"
] | Deal with incoming requests. | [
"Deal",
"with",
"incoming",
"requests",
"."
] | 8ce2292895137477963cf1bafa4e71fa20b2ce49 | https://github.com/fmfn/BayesianOptimization/blob/8ce2292895137477963cf1bafa4e71fa20b2ce49/examples/async_optimization.py#L42-L57 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.