Release 7.7.0a1
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
ELASTICSEARCH_VERSION:
|
ELASTICSEARCH_VERSION:
|
||||||
- 7.6-SNAPSHOT
|
- 7.7-SNAPSHOT
|
||||||
|
|
||||||
TEST_SUITE:
|
TEST_SUITE:
|
||||||
- oss
|
- oss
|
||||||
|
|||||||
@@ -3,6 +3,21 @@
|
|||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
7.7.0a1 (2020-03-31)
|
||||||
|
--------------------
|
||||||
|
* Added support for ES 7.7 APIs (See `#1812`_)
|
||||||
|
* Added ``ElasticsearchDeprecationWarning`` which is raised when a ``Warning``
|
||||||
|
HTTP header is sent by Elasticsearch. (See `#1179`_)
|
||||||
|
* Added support for serializing ``numpy`` and ``pandas``.
|
||||||
|
data types to ``JSONSerializer``. (See `#1180`_)
|
||||||
|
* Added ``certifi`` as a dependency so HTTPS connections work automatically.
|
||||||
|
* Fixed duplicated parameters in some API docstrings (See `#1169`_, thanks to `Morten Hauberg <https://github.com/mortenhauberg>`_!)
|
||||||
|
|
||||||
|
.. _#1169: https://github.com/elastic/elasticsearch-py/pull/1169
|
||||||
|
.. _#1179: https://github.com/elastic/elasticsearch-py/pull/1179
|
||||||
|
.. _#1180: https://github.com/elastic/elasticsearch-py/pull/1180
|
||||||
|
.. _#1812: https://github.com/elastic/elasticsearch-py/pull/1182
|
||||||
|
|
||||||
7.6.0 (2020-03-19)
|
7.6.0 (2020-03-19)
|
||||||
------------------
|
------------------
|
||||||
* Added support for ES 7.6 APIs
|
* Added support for ES 7.6 APIs
|
||||||
|
|||||||
@@ -21,6 +21,44 @@ provides general info about the installed X-Pack.
|
|||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
|
||||||
|
Async Search APIs
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
`Async Search API <https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html>`_
|
||||||
|
lets you asynchronously execute a search request, monitor its progress,
|
||||||
|
and retrieve partial results as they become available.
|
||||||
|
|
||||||
|
.. py:module:: elasticsearch.client.async_search
|
||||||
|
|
||||||
|
.. autoclass:: AsyncSearchClient
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
||||||
|
Autoscaling APIs
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
`Autoscaling API <https://www.elastic.co/guide/en/elasticsearch/reference/master/autoscaling-apis.html>`_
|
||||||
|
gets the current autoscaling decision based on the configured autoscaling policy.
|
||||||
|
|
||||||
|
.. py:module:: elasticsearch.client.autoscaling
|
||||||
|
|
||||||
|
.. autoclass:: AutoscalingClient
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
||||||
|
EQL APIs
|
||||||
|
--------
|
||||||
|
|
||||||
|
`EQL API <https://www.elastic.co/guide/en/elasticsearch/reference/current/eql.html>`_
|
||||||
|
allows querying with Event Query Language (EQL) to search logs and events and match
|
||||||
|
them with shared properties.
|
||||||
|
|
||||||
|
.. py:module:: elasticsearch.client.eql
|
||||||
|
|
||||||
|
.. autoclass:: EqlClient
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
||||||
Graph Explore APIs
|
Graph Explore APIs
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
# flake8: noqa
|
# flake8: noqa
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
VERSION = (7, 6, 0)
|
VERSION = (7, 7, 0)
|
||||||
__version__ = VERSION
|
__version__ = VERSION
|
||||||
__versionstr__ = ".".join(map(str, VERSION))
|
__versionstr__ = "7.7.0a1"
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import warnings
|
import warnings
|
||||||
|
|||||||
@@ -17,9 +17,12 @@ from .xpack import XPackClient
|
|||||||
from .utils import query_params, _make_path, SKIP_IN_PATH, _bulk_body
|
from .utils import query_params, _make_path, SKIP_IN_PATH, _bulk_body
|
||||||
|
|
||||||
# xpack APIs
|
# xpack APIs
|
||||||
|
from .async_search import AsyncSearchClient
|
||||||
|
from .autoscaling import AutoscalingClient
|
||||||
from .ccr import CcrClient
|
from .ccr import CcrClient
|
||||||
from .data_frame import Data_FrameClient
|
from .data_frame import Data_FrameClient
|
||||||
from .deprecation import DeprecationClient
|
from .deprecation import DeprecationClient
|
||||||
|
from .eql import EqlClient
|
||||||
from .graph import GraphClient
|
from .graph import GraphClient
|
||||||
from .ilm import IlmClient
|
from .ilm import IlmClient
|
||||||
from .license import LicenseClient
|
from .license import LicenseClient
|
||||||
@@ -237,9 +240,12 @@ class Elasticsearch(object):
|
|||||||
self.tasks = TasksClient(self)
|
self.tasks = TasksClient(self)
|
||||||
|
|
||||||
self.xpack = XPackClient(self)
|
self.xpack = XPackClient(self)
|
||||||
|
self.async_search = AsyncSearchClient(self)
|
||||||
|
self.autoscaling = AutoscalingClient(self)
|
||||||
self.ccr = CcrClient(self)
|
self.ccr = CcrClient(self)
|
||||||
self.data_frame = Data_FrameClient(self)
|
self.data_frame = Data_FrameClient(self)
|
||||||
self.deprecation = DeprecationClient(self)
|
self.deprecation = DeprecationClient(self)
|
||||||
|
self.eql = EqlClient(self)
|
||||||
self.graph = GraphClient(self)
|
self.graph = GraphClient(self)
|
||||||
self.ilm = IlmClient(self)
|
self.ilm = IlmClient(self)
|
||||||
self.indices = IndicesClient(self)
|
self.indices = IndicesClient(self)
|
||||||
@@ -520,7 +526,7 @@ class Elasticsearch(object):
|
|||||||
given in the query string
|
given in the query string
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg ignore_throttled: Whether specified concrete, expanded or
|
:arg ignore_throttled: Whether specified concrete, expanded or
|
||||||
aliased indices should be ignored when throttled
|
aliased indices should be ignored when throttled
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
@@ -659,7 +665,7 @@ class Elasticsearch(object):
|
|||||||
given in the query string
|
given in the query string
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg from_: Starting offset (default: 0)
|
:arg from_: Starting offset (default: 0)
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
should be ignored when unavailable (missing or closed)
|
should be ignored when unavailable (missing or closed)
|
||||||
@@ -686,8 +692,8 @@ class Elasticsearch(object):
|
|||||||
query_then_fetch, dfs_query_then_fetch
|
query_then_fetch, dfs_query_then_fetch
|
||||||
:arg size: Deprecated, please use `max_docs` instead
|
:arg size: Deprecated, please use `max_docs` instead
|
||||||
:arg slices: The number of slices this task should be divided
|
:arg slices: The number of slices this task should be divided
|
||||||
into. Defaults to 1 meaning the task isn't sliced into subtasks.
|
into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be
|
||||||
Default: 1
|
set to `auto`. Default: 1
|
||||||
:arg sort: A comma-separated list of <field>:<direction> pairs
|
:arg sort: A comma-separated list of <field>:<direction> pairs
|
||||||
:arg stats: Specific 'tag' of the request for logging and
|
:arg stats: Specific 'tag' of the request for logging and
|
||||||
statistical purposes
|
statistical purposes
|
||||||
@@ -940,7 +946,7 @@ class Elasticsearch(object):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg fields: A comma-separated list of field names
|
:arg fields: A comma-separated list of field names
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
should be ignored when unavailable (missing or closed)
|
should be ignored when unavailable (missing or closed)
|
||||||
@@ -1150,8 +1156,8 @@ class Elasticsearch(object):
|
|||||||
the number of shards the search request expands to exceeds the
|
the number of shards the search request expands to exceeds the
|
||||||
threshold. This filter roundtrip can limit the number of shards
|
threshold. This filter roundtrip can limit the number of shards
|
||||||
significantly if for instance a shard can not match any documents based
|
significantly if for instance a shard can not match any documents based
|
||||||
on it's rewrite method ie. if date filters are mandatory to match but
|
on its rewrite method ie. if date filters are mandatory to match but the
|
||||||
the shard bounds and the query are disjoint. Default: 128
|
shard bounds and the query are disjoint.
|
||||||
:arg rest_total_hits_as_int: Indicates whether hits.total should
|
:arg rest_total_hits_as_int: Indicates whether hits.total should
|
||||||
be rendered as an integer or an object in the rest search response
|
be rendered as an integer or an object in the rest search response
|
||||||
:arg search_type: Search operation type Valid choices:
|
:arg search_type: Search operation type Valid choices:
|
||||||
@@ -1325,7 +1331,7 @@ class Elasticsearch(object):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
should be ignored when unavailable (missing or closed)
|
should be ignored when unavailable (missing or closed)
|
||||||
:arg search_type: Search operation type Valid choices:
|
:arg search_type: Search operation type Valid choices:
|
||||||
@@ -1369,8 +1375,8 @@ class Elasticsearch(object):
|
|||||||
:arg scroll: Control how long to keep the search context alive
|
:arg scroll: Control how long to keep the search context alive
|
||||||
Default: 5m
|
Default: 5m
|
||||||
:arg slices: The number of slices this task should be divided
|
:arg slices: The number of slices this task should be divided
|
||||||
into. Defaults to 1 meaning the task isn't sliced into subtasks.
|
into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be
|
||||||
Default: 1
|
set to `auto`. Default: 1
|
||||||
:arg timeout: Time each individual bulk request should wait for
|
:arg timeout: Time each individual bulk request should wait for
|
||||||
shards that are unavailable. Default: 1m
|
shards that are unavailable. Default: 1m
|
||||||
:arg wait_for_active_shards: Sets the number of shard copies
|
:arg wait_for_active_shards: Sets the number of shard copies
|
||||||
@@ -1551,7 +1557,7 @@ class Elasticsearch(object):
|
|||||||
as the docvalue representation of a field for each hit
|
as the docvalue representation of a field for each hit
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg explain: Specify whether to return detailed information
|
:arg explain: Specify whether to return detailed information
|
||||||
about score computation as part of a hit
|
about score computation as part of a hit
|
||||||
:arg from_: Starting offset (default: 0)
|
:arg from_: Starting offset (default: 0)
|
||||||
@@ -1570,8 +1576,8 @@ class Elasticsearch(object):
|
|||||||
the number of shards the search request expands to exceeds the
|
the number of shards the search request expands to exceeds the
|
||||||
threshold. This filter roundtrip can limit the number of shards
|
threshold. This filter roundtrip can limit the number of shards
|
||||||
significantly if for instance a shard can not match any documents based
|
significantly if for instance a shard can not match any documents based
|
||||||
on it's rewrite method ie. if date filters are mandatory to match but
|
on its rewrite method ie. if date filters are mandatory to match but the
|
||||||
the shard bounds and the query are disjoint. Default: 128
|
shard bounds and the query are disjoint.
|
||||||
:arg preference: Specify the node or shard the operation should
|
:arg preference: Specify the node or shard the operation should
|
||||||
be performed on (default: random)
|
be performed on (default: random)
|
||||||
:arg q: Query in the Lucene query string syntax
|
:arg q: Query in the Lucene query string syntax
|
||||||
@@ -1644,7 +1650,7 @@ class Elasticsearch(object):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
should be ignored when unavailable (missing or closed)
|
should be ignored when unavailable (missing or closed)
|
||||||
:arg local: Return local information, do not retrieve the state
|
:arg local: Return local information, do not retrieve the state
|
||||||
@@ -1692,7 +1698,7 @@ class Elasticsearch(object):
|
|||||||
execution Default: true
|
execution Default: true
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg explain: Specify whether to return detailed information
|
:arg explain: Specify whether to return detailed information
|
||||||
about score computation as part of a hit
|
about score computation as part of a hit
|
||||||
:arg ignore_throttled: Whether specified concrete, expanded or
|
:arg ignore_throttled: Whether specified concrete, expanded or
|
||||||
@@ -1921,7 +1927,7 @@ class Elasticsearch(object):
|
|||||||
given in the query string
|
given in the query string
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg from_: Starting offset (default: 0)
|
:arg from_: Starting offset (default: 0)
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
should be ignored when unavailable (missing or closed)
|
should be ignored when unavailable (missing or closed)
|
||||||
@@ -1950,8 +1956,8 @@ class Elasticsearch(object):
|
|||||||
query_then_fetch, dfs_query_then_fetch
|
query_then_fetch, dfs_query_then_fetch
|
||||||
:arg size: Deprecated, please use `max_docs` instead
|
:arg size: Deprecated, please use `max_docs` instead
|
||||||
:arg slices: The number of slices this task should be divided
|
:arg slices: The number of slices this task should be divided
|
||||||
into. Defaults to 1 meaning the task isn't sliced into subtasks.
|
into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be
|
||||||
Default: 1
|
set to `auto`. Default: 1
|
||||||
:arg sort: A comma-separated list of <field>:<direction> pairs
|
:arg sort: A comma-separated list of <field>:<direction> pairs
|
||||||
:arg stats: Specific 'tag' of the request for logging and
|
:arg stats: Specific 'tag' of the request for logging and
|
||||||
statistical purposes
|
statistical purposes
|
||||||
|
|||||||
@@ -0,0 +1,182 @@
|
|||||||
|
from .utils import NamespacedClient, SKIP_IN_PATH, query_params, _make_path
|
||||||
|
|
||||||
|
|
||||||
|
class AsyncSearchClient(NamespacedClient):
|
||||||
|
@query_params()
|
||||||
|
def delete(self, id, params=None, headers=None):
|
||||||
|
"""
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html>`_
|
||||||
|
|
||||||
|
:arg id: The async search 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("_async_search", id), params=params, headers=headers
|
||||||
|
)
|
||||||
|
|
||||||
|
@query_params("keep_alive", "typed_keys", "wait_for_completion_timeout")
|
||||||
|
def get(self, id, params=None, headers=None):
|
||||||
|
"""
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html>`_
|
||||||
|
|
||||||
|
:arg id: The async search ID
|
||||||
|
:arg keep_alive: Specify the time interval in which the results
|
||||||
|
(partial or final) for this search will be available
|
||||||
|
:arg typed_keys: Specify whether aggregation and suggester names
|
||||||
|
should be prefixed by their respective types in the response
|
||||||
|
:arg wait_for_completion_timeout: Specify the time that the
|
||||||
|
request should block waiting for the final response
|
||||||
|
"""
|
||||||
|
if id in SKIP_IN_PATH:
|
||||||
|
raise ValueError("Empty value passed for a required argument 'id'.")
|
||||||
|
|
||||||
|
return self.transport.perform_request(
|
||||||
|
"GET", _make_path("_async_search", id), params=params, headers=headers
|
||||||
|
)
|
||||||
|
|
||||||
|
@query_params(
|
||||||
|
"_source",
|
||||||
|
"_source_excludes",
|
||||||
|
"_source_includes",
|
||||||
|
"allow_no_indices",
|
||||||
|
"allow_partial_search_results",
|
||||||
|
"analyze_wildcard",
|
||||||
|
"analyzer",
|
||||||
|
"batched_reduce_size",
|
||||||
|
"default_operator",
|
||||||
|
"df",
|
||||||
|
"docvalue_fields",
|
||||||
|
"expand_wildcards",
|
||||||
|
"explain",
|
||||||
|
"from_",
|
||||||
|
"ignore_throttled",
|
||||||
|
"ignore_unavailable",
|
||||||
|
"keep_alive",
|
||||||
|
"keep_on_completion",
|
||||||
|
"lenient",
|
||||||
|
"max_concurrent_shard_requests",
|
||||||
|
"preference",
|
||||||
|
"q",
|
||||||
|
"request_cache",
|
||||||
|
"routing",
|
||||||
|
"search_type",
|
||||||
|
"seq_no_primary_term",
|
||||||
|
"size",
|
||||||
|
"sort",
|
||||||
|
"stats",
|
||||||
|
"stored_fields",
|
||||||
|
"suggest_field",
|
||||||
|
"suggest_mode",
|
||||||
|
"suggest_size",
|
||||||
|
"suggest_text",
|
||||||
|
"terminate_after",
|
||||||
|
"timeout",
|
||||||
|
"track_scores",
|
||||||
|
"track_total_hits",
|
||||||
|
"typed_keys",
|
||||||
|
"version",
|
||||||
|
"wait_for_completion_timeout",
|
||||||
|
)
|
||||||
|
def submit(self, body=None, index=None, params=None, headers=None):
|
||||||
|
"""
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html>`_
|
||||||
|
|
||||||
|
:arg body: The search definition using the Query DSL
|
||||||
|
:arg index: A comma-separated list of index names to search; use
|
||||||
|
`_all` or empty string to perform the operation on all indices
|
||||||
|
:arg _source: True or false to return the _source field or not,
|
||||||
|
or a list of fields to return
|
||||||
|
:arg _source_excludes: A list of fields to exclude from the
|
||||||
|
returned _source field
|
||||||
|
:arg _source_includes: A list of fields to extract and return
|
||||||
|
from the _source field
|
||||||
|
: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 allow_partial_search_results: Indicate if an error should
|
||||||
|
be returned if there is a partial search failure or timeout Default:
|
||||||
|
True
|
||||||
|
:arg analyze_wildcard: Specify whether wildcard and prefix
|
||||||
|
queries should be analyzed (default: false)
|
||||||
|
:arg analyzer: The analyzer to use for the query string
|
||||||
|
:arg batched_reduce_size: The number of shard results that
|
||||||
|
should be reduced at once on the coordinating node. This value should be
|
||||||
|
used as the granularity at which progress results will be made
|
||||||
|
available. Default: 5
|
||||||
|
:arg default_operator: The default operator for query string
|
||||||
|
query (AND or OR) Valid choices: AND, OR Default: OR
|
||||||
|
:arg df: The field to use as default where no field prefix is
|
||||||
|
given in the query string
|
||||||
|
:arg docvalue_fields: A comma-separated list of fields to return
|
||||||
|
as the docvalue representation of a field for each hit
|
||||||
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
|
closed, none, all Default: open
|
||||||
|
:arg explain: Specify whether to return detailed information
|
||||||
|
about score computation as part of a hit
|
||||||
|
:arg from_: Starting offset (default: 0)
|
||||||
|
:arg ignore_throttled: Whether specified concrete, expanded or
|
||||||
|
aliased indices should be ignored when throttled
|
||||||
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
|
should be ignored when unavailable (missing or closed)
|
||||||
|
:arg keep_alive: Update the time interval in which the results
|
||||||
|
(partial or final) for this search will be available Default: 5d
|
||||||
|
:arg keep_on_completion: Control whether the response should be
|
||||||
|
stored in the cluster if it completed within the provided
|
||||||
|
[wait_for_completion] time (default: false)
|
||||||
|
:arg lenient: Specify whether format-based query failures (such
|
||||||
|
as providing text to a numeric field) should be ignored
|
||||||
|
:arg max_concurrent_shard_requests: The number of concurrent
|
||||||
|
shard requests per node this search executes concurrently. This value
|
||||||
|
should be used to limit the impact of the search on the cluster in order
|
||||||
|
to limit the number of concurrent shard requests Default: 5
|
||||||
|
:arg preference: Specify the node or shard the operation should
|
||||||
|
be performed on (default: random)
|
||||||
|
:arg q: Query in the Lucene query string syntax
|
||||||
|
:arg request_cache: Specify if request cache should be used for
|
||||||
|
this request or not, defaults to true
|
||||||
|
:arg routing: A comma-separated list of specific routing values
|
||||||
|
:arg search_type: Search operation type Valid choices:
|
||||||
|
query_then_fetch, dfs_query_then_fetch
|
||||||
|
:arg seq_no_primary_term: Specify whether to return sequence
|
||||||
|
number and primary term of the last modification of each hit
|
||||||
|
:arg size: Number of hits to return (default: 10)
|
||||||
|
:arg sort: A comma-separated list of <field>:<direction> pairs
|
||||||
|
:arg stats: Specific 'tag' of the request for logging and
|
||||||
|
statistical purposes
|
||||||
|
:arg stored_fields: A comma-separated list of stored fields to
|
||||||
|
return as part of a hit
|
||||||
|
:arg suggest_field: Specify which field to use for suggestions
|
||||||
|
:arg suggest_mode: Specify suggest mode Valid choices: missing,
|
||||||
|
popular, always Default: missing
|
||||||
|
:arg suggest_size: How many suggestions to return in response
|
||||||
|
:arg suggest_text: The source text for which the suggestions
|
||||||
|
should be returned
|
||||||
|
:arg terminate_after: The maximum number of documents to collect
|
||||||
|
for each shard, upon reaching which the query execution will terminate
|
||||||
|
early.
|
||||||
|
:arg timeout: Explicit operation timeout
|
||||||
|
:arg track_scores: Whether to calculate and return scores even
|
||||||
|
if they are not used for sorting
|
||||||
|
:arg track_total_hits: Indicate if the number of documents that
|
||||||
|
match the query should be tracked
|
||||||
|
:arg typed_keys: Specify whether aggregation and suggester names
|
||||||
|
should be prefixed by their respective types in the response
|
||||||
|
:arg version: Specify whether to return document version as part
|
||||||
|
of a hit
|
||||||
|
:arg wait_for_completion_timeout: Specify the time that the
|
||||||
|
request should block waiting for the final response Default: 1s
|
||||||
|
"""
|
||||||
|
# from is a reserved word so it cannot be used, use from_ instead
|
||||||
|
if "from_" in params:
|
||||||
|
params["from"] = params.pop("from_")
|
||||||
|
|
||||||
|
return self.transport.perform_request(
|
||||||
|
"POST",
|
||||||
|
_make_path(index, "_async_search"),
|
||||||
|
params=params,
|
||||||
|
headers=headers,
|
||||||
|
body=body,
|
||||||
|
)
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
from .utils import NamespacedClient, query_params
|
||||||
|
|
||||||
|
|
||||||
|
class AutoscalingClient(NamespacedClient):
|
||||||
|
@query_params()
|
||||||
|
def get_autoscaling_decision(self, params=None, headers=None):
|
||||||
|
"""
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-decision.html>`_
|
||||||
|
|
||||||
|
"""
|
||||||
|
return self.transport.perform_request(
|
||||||
|
"GET", "/_autoscaling/decision", params=params, headers=headers
|
||||||
|
)
|
||||||
+184
-15
@@ -2,7 +2,7 @@ from .utils import NamespacedClient, query_params, _make_path
|
|||||||
|
|
||||||
|
|
||||||
class CatClient(NamespacedClient):
|
class CatClient(NamespacedClient):
|
||||||
@query_params("format", "h", "help", "local", "s", "v")
|
@query_params("expand_wildcards", "format", "h", "help", "local", "s", "v")
|
||||||
def aliases(self, name=None, params=None, headers=None):
|
def aliases(self, name=None, params=None, headers=None):
|
||||||
"""
|
"""
|
||||||
Shows information about currently configured aliases to indices including
|
Shows information about currently configured aliases to indices including
|
||||||
@@ -10,6 +10,9 @@ class CatClient(NamespacedClient):
|
|||||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html>`_
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html>`_
|
||||||
|
|
||||||
:arg name: A comma-separated list of alias names to return
|
:arg name: A comma-separated list of alias names to return
|
||||||
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
|
closed, hidden, none, all Default: ['all']
|
||||||
:arg format: a short version of the Accept header, e.g. json,
|
:arg format: a short version of the Accept header, e.g. json,
|
||||||
yaml
|
yaml
|
||||||
:arg h: Comma-separated list of column names to display
|
:arg h: Comma-separated list of column names to display
|
||||||
@@ -113,6 +116,7 @@ class CatClient(NamespacedClient):
|
|||||||
|
|
||||||
@query_params(
|
@query_params(
|
||||||
"bytes",
|
"bytes",
|
||||||
|
"expand_wildcards",
|
||||||
"format",
|
"format",
|
||||||
"h",
|
"h",
|
||||||
"health",
|
"health",
|
||||||
@@ -135,6 +139,9 @@ class CatClient(NamespacedClient):
|
|||||||
returned information
|
returned information
|
||||||
:arg bytes: The unit in which to display byte values Valid
|
:arg bytes: The unit in which to display byte values Valid
|
||||||
choices: b, k, kb, m, mb, g, gb, t, tb, p, pb
|
choices: b, k, kb, m, mb, g, gb, t, tb, p, pb
|
||||||
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
|
closed, hidden, none, all Default: all
|
||||||
:arg format: a short version of the Accept header, e.g. json,
|
:arg format: a short version of the Accept header, e.g. json,
|
||||||
yaml
|
yaml
|
||||||
:arg h: Comma-separated list of column names to display
|
:arg h: Comma-separated list of column names to display
|
||||||
@@ -153,8 +160,7 @@ class CatClient(NamespacedClient):
|
|||||||
:arg s: Comma-separated list of column names or column aliases
|
:arg s: Comma-separated list of column names or column aliases
|
||||||
to sort by
|
to sort by
|
||||||
:arg time: The unit in which to display time values Valid
|
:arg time: The unit in which to display time values Valid
|
||||||
choices: d (Days), h (Hours), m (Minutes), s (Seconds), ms
|
choices: d, h, m, s, ms, micros, nanos
|
||||||
(Milliseconds), micros (Microseconds), nanos (Nanoseconds)
|
|
||||||
:arg v: Verbose mode. Display column headers
|
:arg v: Verbose mode. Display column headers
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
@@ -215,8 +221,7 @@ class CatClient(NamespacedClient):
|
|||||||
:arg s: Comma-separated list of column names or column aliases
|
:arg s: Comma-separated list of column names or column aliases
|
||||||
to sort by
|
to sort by
|
||||||
:arg time: The unit in which to display time values Valid
|
:arg time: The unit in which to display time values Valid
|
||||||
choices: d (Days), h (Hours), m (Minutes), s (Seconds), ms
|
choices: d, h, m, s, ms, micros, nanos
|
||||||
(Milliseconds), micros (Microseconds), nanos (Nanoseconds)
|
|
||||||
:arg v: Verbose mode. Display column headers
|
:arg v: Verbose mode. Display column headers
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
@@ -246,8 +251,7 @@ class CatClient(NamespacedClient):
|
|||||||
:arg s: Comma-separated list of column names or column aliases
|
:arg s: Comma-separated list of column names or column aliases
|
||||||
to sort by
|
to sort by
|
||||||
:arg time: The unit in which to display time values Valid
|
:arg time: The unit in which to display time values Valid
|
||||||
choices: d (Days), h (Hours), m (Minutes), s (Seconds), ms
|
choices: d, h, m, s, ms, micros, nanos
|
||||||
(Milliseconds), micros (Microseconds), nanos (Nanoseconds)
|
|
||||||
:arg v: Verbose mode. Display column headers
|
:arg v: Verbose mode. Display column headers
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
@@ -277,8 +281,7 @@ class CatClient(NamespacedClient):
|
|||||||
:arg s: Comma-separated list of column names or column aliases
|
:arg s: Comma-separated list of column names or column aliases
|
||||||
to sort by
|
to sort by
|
||||||
:arg time: The unit in which to display time values Valid
|
:arg time: The unit in which to display time values Valid
|
||||||
choices: d (Days), h (Hours), m (Minutes), s (Seconds), ms
|
choices: d, h, m, s, ms, micros, nanos
|
||||||
(Milliseconds), micros (Microseconds), nanos (Nanoseconds)
|
|
||||||
:arg v: Verbose mode. Display column headers
|
:arg v: Verbose mode. Display column headers
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
@@ -324,8 +327,7 @@ class CatClient(NamespacedClient):
|
|||||||
:arg s: Comma-separated list of column names or column aliases
|
:arg s: Comma-separated list of column names or column aliases
|
||||||
to sort by
|
to sort by
|
||||||
:arg time: The unit in which to display time values Valid
|
:arg time: The unit in which to display time values Valid
|
||||||
choices: d (Days), h (Hours), m (Minutes), s (Seconds), ms
|
choices: d, h, m, s, ms, micros, nanos
|
||||||
(Milliseconds), micros (Microseconds), nanos (Nanoseconds)
|
|
||||||
:arg v: Verbose mode. Display column headers
|
:arg v: Verbose mode. Display column headers
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
@@ -475,8 +477,7 @@ class CatClient(NamespacedClient):
|
|||||||
:arg s: Comma-separated list of column names or column aliases
|
:arg s: Comma-separated list of column names or column aliases
|
||||||
to sort by
|
to sort by
|
||||||
:arg time: The unit in which to display time values Valid
|
:arg time: The unit in which to display time values Valid
|
||||||
choices: d (Days), h (Hours), m (Minutes), s (Seconds), ms
|
choices: d, h, m, s, ms, micros, nanos
|
||||||
(Milliseconds), micros (Microseconds), nanos (Nanoseconds)
|
|
||||||
:arg v: Verbose mode. Display column headers
|
:arg v: Verbose mode. Display column headers
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
@@ -520,8 +521,7 @@ class CatClient(NamespacedClient):
|
|||||||
:arg s: Comma-separated list of column names or column aliases
|
:arg s: Comma-separated list of column names or column aliases
|
||||||
to sort by
|
to sort by
|
||||||
:arg time: The unit in which to display time values Valid
|
:arg time: The unit in which to display time values Valid
|
||||||
choices: d (Days), h (Hours), m (Minutes), s (Seconds), ms
|
choices: d, h, m, s, ms, micros, nanos
|
||||||
(Milliseconds), micros (Microseconds), nanos (Nanoseconds)
|
|
||||||
:arg v: Verbose mode. Display column headers
|
:arg v: Verbose mode. Display column headers
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
@@ -550,3 +550,172 @@ class CatClient(NamespacedClient):
|
|||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
"GET", _make_path("_cat", "templates", name), params=params, headers=headers
|
"GET", _make_path("_cat", "templates", name), params=params, headers=headers
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@query_params("allow_no_match", "bytes", "format", "h", "help", "s", "time", "v")
|
||||||
|
def ml_data_frame_analytics(self, id=None, params=None, headers=None):
|
||||||
|
"""
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-dfanalytics.html>`_
|
||||||
|
|
||||||
|
:arg id: The ID of the data frame analytics to fetch
|
||||||
|
:arg allow_no_match: Whether to ignore if a wildcard expression
|
||||||
|
matches no configs. (This includes `_all` string or when no configs have
|
||||||
|
been specified)
|
||||||
|
:arg bytes: The unit in which to display byte values Valid
|
||||||
|
choices: 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
|
||||||
|
:arg s: Comma-separated list of column names or column aliases
|
||||||
|
to sort by
|
||||||
|
:arg time: The unit in which to display time values Valid
|
||||||
|
choices: d (Days), h (Hours), m (Minutes), s (Seconds), ms
|
||||||
|
(Milliseconds), micros (Microseconds), nanos (Nanoseconds)
|
||||||
|
:arg v: Verbose mode. Display column headers
|
||||||
|
"""
|
||||||
|
return self.transport.perform_request(
|
||||||
|
"GET",
|
||||||
|
_make_path("_cat", "ml", "data_frame", "analytics", id),
|
||||||
|
params=params,
|
||||||
|
headers=headers,
|
||||||
|
)
|
||||||
|
|
||||||
|
@query_params("allow_no_datafeeds", "format", "h", "help", "s", "time", "v")
|
||||||
|
def ml_datafeeds(self, datafeed_id=None, params=None, headers=None):
|
||||||
|
"""
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-datafeeds.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)
|
||||||
|
: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
|
||||||
|
:arg s: Comma-separated list of column names or column aliases
|
||||||
|
to sort by
|
||||||
|
:arg time: The unit in which to display time values Valid
|
||||||
|
choices: d (Days), h (Hours), m (Minutes), s (Seconds), ms
|
||||||
|
(Milliseconds), micros (Microseconds), nanos (Nanoseconds)
|
||||||
|
:arg v: Verbose mode. Display column headers
|
||||||
|
"""
|
||||||
|
return self.transport.perform_request(
|
||||||
|
"GET",
|
||||||
|
_make_path("_cat", "ml", "datafeeds", datafeed_id),
|
||||||
|
params=params,
|
||||||
|
headers=headers,
|
||||||
|
)
|
||||||
|
|
||||||
|
@query_params("allow_no_jobs", "bytes", "format", "h", "help", "s", "time", "v")
|
||||||
|
def ml_jobs(self, job_id=None, params=None, headers=None):
|
||||||
|
"""
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-anomaly-detectors.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)
|
||||||
|
:arg bytes: The unit in which to display byte values Valid
|
||||||
|
choices: 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
|
||||||
|
:arg s: Comma-separated list of column names or column aliases
|
||||||
|
to sort by
|
||||||
|
:arg time: The unit in which to display time values Valid
|
||||||
|
choices: d (Days), h (Hours), m (Minutes), s (Seconds), ms
|
||||||
|
(Milliseconds), micros (Microseconds), nanos (Nanoseconds)
|
||||||
|
:arg v: Verbose mode. Display column headers
|
||||||
|
"""
|
||||||
|
return self.transport.perform_request(
|
||||||
|
"GET",
|
||||||
|
_make_path("_cat", "ml", "anomaly_detectors", job_id),
|
||||||
|
params=params,
|
||||||
|
headers=headers,
|
||||||
|
)
|
||||||
|
|
||||||
|
@query_params(
|
||||||
|
"allow_no_match",
|
||||||
|
"bytes",
|
||||||
|
"format",
|
||||||
|
"from_",
|
||||||
|
"h",
|
||||||
|
"help",
|
||||||
|
"s",
|
||||||
|
"size",
|
||||||
|
"time",
|
||||||
|
"v",
|
||||||
|
)
|
||||||
|
def ml_trained_models(self, model_id=None, params=None, headers=None):
|
||||||
|
"""
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-trained-model.html>`_
|
||||||
|
|
||||||
|
:arg model_id: The ID of the trained models stats to fetch
|
||||||
|
:arg allow_no_match: Whether to ignore if a wildcard expression
|
||||||
|
matches no trained models. (This includes `_all` string or when no
|
||||||
|
trained models have been specified) Default: True
|
||||||
|
:arg bytes: The unit in which to display byte values Valid
|
||||||
|
choices: 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 from_: skips a number of trained models
|
||||||
|
:arg h: Comma-separated list of column names to display
|
||||||
|
:arg help: Return help information
|
||||||
|
:arg s: Comma-separated list of column names or column aliases
|
||||||
|
to sort by
|
||||||
|
:arg size: specifies a max number of trained models to get
|
||||||
|
Default: 100
|
||||||
|
:arg time: The unit in which to display time values Valid
|
||||||
|
choices: d (Days), h (Hours), m (Minutes), s (Seconds), ms
|
||||||
|
(Milliseconds), micros (Microseconds), nanos (Nanoseconds)
|
||||||
|
:arg v: Verbose mode. Display column headers
|
||||||
|
"""
|
||||||
|
# from is a reserved word so it cannot be used, use from_ instead
|
||||||
|
if "from_" in params:
|
||||||
|
params["from"] = params.pop("from_")
|
||||||
|
|
||||||
|
return self.transport.perform_request(
|
||||||
|
"GET",
|
||||||
|
_make_path("_cat", "ml", "trained_models", model_id),
|
||||||
|
params=params,
|
||||||
|
headers=headers,
|
||||||
|
)
|
||||||
|
|
||||||
|
@query_params(
|
||||||
|
"allow_no_match", "format", "from_", "h", "help", "s", "size", "time", "v"
|
||||||
|
)
|
||||||
|
def transform(self, transform_id=None, params=None, headers=None):
|
||||||
|
"""
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-transforms.html>`_
|
||||||
|
|
||||||
|
:arg transform_id: The id of the transform for which to get
|
||||||
|
stats. '_all' or '*' implies all transforms
|
||||||
|
:arg allow_no_match: Whether to ignore if a wildcard expression
|
||||||
|
matches no transforms. (This includes `_all` string or when no
|
||||||
|
transforms have been specified)
|
||||||
|
:arg format: a short version of the Accept header, e.g. json,
|
||||||
|
yaml
|
||||||
|
:arg from_: skips a number of transform configs, defaults to 0
|
||||||
|
:arg h: Comma-separated list of column names to display
|
||||||
|
:arg help: Return help information
|
||||||
|
:arg s: Comma-separated list of column names or column aliases
|
||||||
|
to sort by
|
||||||
|
:arg size: specifies a max number of transforms to get, defaults
|
||||||
|
to 100
|
||||||
|
:arg time: The unit in which to display time values Valid
|
||||||
|
choices: d (Days), h (Hours), m (Minutes), s (Seconds), ms
|
||||||
|
(Milliseconds), micros (Microseconds), nanos (Nanoseconds)
|
||||||
|
:arg v: Verbose mode. Display column headers
|
||||||
|
"""
|
||||||
|
# from is a reserved word so it cannot be used, use from_ instead
|
||||||
|
if "from_" in params:
|
||||||
|
params["from"] = params.pop("from_")
|
||||||
|
|
||||||
|
return self.transport.perform_request(
|
||||||
|
"GET",
|
||||||
|
_make_path("_cat", "transforms", transform_id),
|
||||||
|
params=params,
|
||||||
|
headers=headers,
|
||||||
|
)
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class CcrClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def forget_follower(self, index, body, params=None, headers=None):
|
def forget_follower(self, index, body, params=None, headers=None):
|
||||||
"""
|
"""
|
||||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/current>`_
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-forget-follower.html>`_
|
||||||
|
|
||||||
:arg index: the name of the leader index for which specified
|
:arg index: the name of the leader index for which specified
|
||||||
follower retention leases should be removed
|
follower retention leases should be removed
|
||||||
@@ -184,7 +184,7 @@ class CcrClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def unfollow(self, index, params=None, headers=None):
|
def unfollow(self, index, params=None, headers=None):
|
||||||
"""
|
"""
|
||||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/current>`_
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-unfollow.html>`_
|
||||||
|
|
||||||
:arg index: The name of the follower index that should be turned
|
:arg index: The name of the follower index that should be turned
|
||||||
into a regular index.
|
into a regular index.
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class ClusterClient(NamespacedClient):
|
|||||||
:arg index: Limit the information returned to a specific index
|
:arg index: Limit the information returned to a specific index
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: all
|
closed, hidden, none, all Default: all
|
||||||
:arg level: Specify the level of detail for returned information
|
:arg level: Specify the level of detail for returned information
|
||||||
Valid choices: cluster, indices, shards Default: cluster
|
Valid choices: cluster, indices, shards Default: cluster
|
||||||
:arg local: Return local information, do not retrieve the state
|
:arg local: Return local information, do not retrieve the state
|
||||||
@@ -92,7 +92,7 @@ class ClusterClient(NamespacedClient):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg flat_settings: Return settings in flat format (default:
|
:arg flat_settings: Return settings in flat format (default:
|
||||||
false)
|
false)
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
@@ -235,3 +235,67 @@ class ClusterClient(NamespacedClient):
|
|||||||
headers=headers,
|
headers=headers,
|
||||||
body=body,
|
body=body,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@query_params("master_timeout", "timeout")
|
||||||
|
def delete_component_template(self, name, params=None, headers=None):
|
||||||
|
"""
|
||||||
|
Deletes a component template
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-templates.html>`_
|
||||||
|
|
||||||
|
:arg name: The name of the template
|
||||||
|
:arg master_timeout: Specify timeout for connection to master
|
||||||
|
:arg timeout: Explicit operation timeout
|
||||||
|
"""
|
||||||
|
if name in SKIP_IN_PATH:
|
||||||
|
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||||
|
|
||||||
|
return self.transport.perform_request(
|
||||||
|
"DELETE",
|
||||||
|
_make_path("_component_template", name),
|
||||||
|
params=params,
|
||||||
|
headers=headers,
|
||||||
|
)
|
||||||
|
|
||||||
|
@query_params("local", "master_timeout")
|
||||||
|
def get_component_template(self, name=None, params=None, headers=None):
|
||||||
|
"""
|
||||||
|
Returns one or more component templates
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-templates.html>`_
|
||||||
|
|
||||||
|
:arg name: The comma separated names of the component templates
|
||||||
|
: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("_component_template", name),
|
||||||
|
params=params,
|
||||||
|
headers=headers,
|
||||||
|
)
|
||||||
|
|
||||||
|
@query_params("create", "master_timeout", "timeout")
|
||||||
|
def put_component_template(self, name, body, params=None, headers=None):
|
||||||
|
"""
|
||||||
|
Creates or updates a component template
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-templates.html>`_
|
||||||
|
|
||||||
|
:arg name: The name of the template
|
||||||
|
:arg body: The template definition
|
||||||
|
:arg create: Whether the index template should only be added if
|
||||||
|
new or can also replace an existing one
|
||||||
|
:arg master_timeout: Specify timeout for connection to master
|
||||||
|
:arg timeout: Explicit operation timeout
|
||||||
|
"""
|
||||||
|
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("_component_template", name),
|
||||||
|
params=params,
|
||||||
|
headers=headers,
|
||||||
|
body=body,
|
||||||
|
)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ class EnrichClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def delete_policy(self, name, params=None, headers=None):
|
def delete_policy(self, name, params=None, headers=None):
|
||||||
"""
|
"""
|
||||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-delete-policy.html>`_
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-enrich-policy-api.html>`_
|
||||||
|
|
||||||
:arg name: The name of the enrich policy
|
:arg name: The name of the enrich policy
|
||||||
"""
|
"""
|
||||||
@@ -22,7 +22,7 @@ class EnrichClient(NamespacedClient):
|
|||||||
@query_params("wait_for_completion")
|
@query_params("wait_for_completion")
|
||||||
def execute_policy(self, name, params=None, headers=None):
|
def execute_policy(self, name, params=None, headers=None):
|
||||||
"""
|
"""
|
||||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-execute-policy.html>`_
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/execute-enrich-policy-api.html>`_
|
||||||
|
|
||||||
:arg name: The name of the enrich policy
|
:arg name: The name of the enrich policy
|
||||||
:arg wait_for_completion: Should the request should block until
|
:arg wait_for_completion: Should the request should block until
|
||||||
@@ -41,7 +41,7 @@ class EnrichClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def get_policy(self, name=None, params=None, headers=None):
|
def get_policy(self, name=None, params=None, headers=None):
|
||||||
"""
|
"""
|
||||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-get-policy.html>`_
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html>`_
|
||||||
|
|
||||||
:arg name: A comma-separated list of enrich policy names
|
:arg name: A comma-separated list of enrich policy names
|
||||||
"""
|
"""
|
||||||
@@ -52,7 +52,7 @@ class EnrichClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def put_policy(self, name, body, params=None, headers=None):
|
def put_policy(self, name, body, params=None, headers=None):
|
||||||
"""
|
"""
|
||||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-put-policy.html>`_
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/put-enrich-policy-api.html>`_
|
||||||
|
|
||||||
:arg name: The name of the enrich policy
|
:arg name: The name of the enrich policy
|
||||||
:arg body: The enrich policy to register
|
:arg body: The enrich policy to register
|
||||||
@@ -72,7 +72,7 @@ class EnrichClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def stats(self, params=None, headers=None):
|
def stats(self, params=None, headers=None):
|
||||||
"""
|
"""
|
||||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats.html>`_
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats-api.html>`_
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
from .utils import NamespacedClient, SKIP_IN_PATH, query_params, _make_path
|
||||||
|
|
||||||
|
|
||||||
|
class EqlClient(NamespacedClient):
|
||||||
|
@query_params()
|
||||||
|
def search(self, index, body, params=None, headers=None):
|
||||||
|
"""
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/eql.html>`_
|
||||||
|
|
||||||
|
:arg index: The name of the index to scope the operation
|
||||||
|
:arg body: Eql request body. Use the `query` to limit the query
|
||||||
|
scope.
|
||||||
|
"""
|
||||||
|
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(
|
||||||
|
"POST",
|
||||||
|
_make_path(index, "_eql", "search"),
|
||||||
|
params=params,
|
||||||
|
headers=headers,
|
||||||
|
body=body,
|
||||||
|
)
|
||||||
@@ -34,7 +34,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
should be ignored when unavailable (missing or closed)
|
should be ignored when unavailable (missing or closed)
|
||||||
"""
|
"""
|
||||||
@@ -61,7 +61,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg force: Whether a flush should be forced even if it is not
|
: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.
|
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
|
This is useful if transaction log IDs should be incremented even if no
|
||||||
@@ -150,7 +150,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
to no concrete indices (default: false)
|
to no concrete indices (default: false)
|
||||||
:arg expand_wildcards: Whether wildcard expressions should get
|
:arg expand_wildcards: Whether wildcard expressions should get
|
||||||
expanded to open or closed indices (default: open) Valid choices: open,
|
expanded to open or closed indices (default: open) Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg flat_settings: Return settings in flat format (default:
|
:arg flat_settings: Return settings in flat format (default:
|
||||||
false)
|
false)
|
||||||
:arg ignore_unavailable: Ignore unavailable indexes (default:
|
:arg ignore_unavailable: Ignore unavailable indexes (default:
|
||||||
@@ -189,7 +189,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: closed
|
closed, hidden, none, all Default: closed
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
should be ignored when unavailable (missing or closed)
|
should be ignored when unavailable (missing or closed)
|
||||||
:arg master_timeout: Specify timeout for connection to master
|
:arg master_timeout: Specify timeout for connection to master
|
||||||
@@ -223,7 +223,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
should be ignored when unavailable (missing or closed)
|
should be ignored when unavailable (missing or closed)
|
||||||
:arg master_timeout: Specify timeout for connection to master
|
:arg master_timeout: Specify timeout for connection to master
|
||||||
@@ -256,7 +256,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
to no concrete indices (default: false)
|
to no concrete indices (default: false)
|
||||||
:arg expand_wildcards: Whether wildcard expressions should get
|
:arg expand_wildcards: Whether wildcard expressions should get
|
||||||
expanded to open or closed indices (default: open) Valid choices: open,
|
expanded to open or closed indices (default: open) Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg ignore_unavailable: Ignore unavailable indexes (default:
|
:arg ignore_unavailable: Ignore unavailable indexes (default:
|
||||||
false)
|
false)
|
||||||
:arg master_timeout: Specify timeout for connection to master
|
:arg master_timeout: Specify timeout for connection to master
|
||||||
@@ -287,7 +287,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
to no concrete indices (default: false)
|
to no concrete indices (default: false)
|
||||||
:arg expand_wildcards: Whether wildcard expressions should get
|
:arg expand_wildcards: Whether wildcard expressions should get
|
||||||
expanded to open or closed indices (default: open) Valid choices: open,
|
expanded to open or closed indices (default: open) Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg flat_settings: Return settings in flat format (default:
|
:arg flat_settings: Return settings in flat format (default:
|
||||||
false)
|
false)
|
||||||
:arg ignore_unavailable: Ignore unavailable indexes (default:
|
:arg ignore_unavailable: Ignore unavailable indexes (default:
|
||||||
@@ -319,7 +319,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
should be ignored when unavailable (missing or closed)
|
should be ignored when unavailable (missing or closed)
|
||||||
:arg local: Return local information, do not retrieve the state
|
:arg local: Return local information, do not retrieve the state
|
||||||
@@ -359,7 +359,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
should be ignored when unavailable (missing or closed)
|
should be ignored when unavailable (missing or closed)
|
||||||
:arg include_type_name: Whether a type should be expected in the
|
:arg include_type_name: Whether a type should be expected in the
|
||||||
@@ -401,7 +401,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
should be ignored when unavailable (missing or closed)
|
should be ignored when unavailable (missing or closed)
|
||||||
:arg include_type_name: Whether to add the type name to the
|
:arg include_type_name: Whether to add the type name to the
|
||||||
@@ -440,7 +440,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
should be ignored when unavailable (missing or closed)
|
should be ignored when unavailable (missing or closed)
|
||||||
:arg include_defaults: Whether the default mapping values should
|
:arg include_defaults: Whether the default mapping values should
|
||||||
@@ -501,7 +501,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: all
|
closed, hidden, none, all Default: all
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
should be ignored when unavailable (missing or closed)
|
should be ignored when unavailable (missing or closed)
|
||||||
:arg local: Return local information, do not retrieve the state
|
:arg local: Return local information, do not retrieve the state
|
||||||
@@ -528,7 +528,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: all
|
closed, hidden, none, all Default: ['all']
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
should be ignored when unavailable (missing or closed)
|
should be ignored when unavailable (missing or closed)
|
||||||
:arg local: Return local information, do not retrieve the state
|
:arg local: Return local information, do not retrieve the state
|
||||||
@@ -576,14 +576,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
"DELETE", _make_path(index, "_alias", name), params=params, headers=headers
|
"DELETE", _make_path(index, "_alias", name), params=params, headers=headers
|
||||||
)
|
)
|
||||||
|
|
||||||
@query_params(
|
@query_params("create", "include_type_name", "master_timeout", "order")
|
||||||
"create",
|
|
||||||
"flat_settings",
|
|
||||||
"include_type_name",
|
|
||||||
"master_timeout",
|
|
||||||
"order",
|
|
||||||
"timeout",
|
|
||||||
)
|
|
||||||
def put_template(self, name, body, params=None, headers=None):
|
def put_template(self, name, body, params=None, headers=None):
|
||||||
"""
|
"""
|
||||||
Creates or updates an index template.
|
Creates or updates an index template.
|
||||||
@@ -593,15 +586,12 @@ class IndicesClient(NamespacedClient):
|
|||||||
:arg body: The template definition
|
:arg body: The template definition
|
||||||
:arg create: Whether the index template should only be added if
|
:arg create: Whether the index template should only be added if
|
||||||
new or can also replace an existing one
|
new or can also replace an existing one
|
||||||
:arg flat_settings: Return settings in flat format (default:
|
|
||||||
false)
|
|
||||||
:arg include_type_name: Whether a type should be returned in the
|
:arg include_type_name: Whether a type should be returned in the
|
||||||
body of the mappings.
|
body of the mappings.
|
||||||
:arg master_timeout: Specify timeout for connection to master
|
:arg master_timeout: Specify timeout for connection to master
|
||||||
:arg order: The order for this template when merging multiple
|
:arg order: The order for this template when merging multiple
|
||||||
matching ones (higher numbers are merged later, overriding the lower
|
matching ones (higher numbers are merged later, overriding the lower
|
||||||
numbers)
|
numbers)
|
||||||
:arg timeout: Explicit operation timeout
|
|
||||||
"""
|
"""
|
||||||
for param in (name, body):
|
for param in (name, body):
|
||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
@@ -695,7 +685,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: ['open', 'closed']
|
closed, hidden, none, all Default: ['open', 'closed']
|
||||||
:arg flat_settings: Return settings in flat format (default:
|
:arg flat_settings: Return settings in flat format (default:
|
||||||
false)
|
false)
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
@@ -732,7 +722,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg flat_settings: Return settings in flat format (default:
|
:arg flat_settings: Return settings in flat format (default:
|
||||||
false)
|
false)
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
@@ -781,7 +771,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
`fielddata` and `suggest` index metric (supports wildcards)
|
`fielddata` and `suggest` index metric (supports wildcards)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg fielddata_fields: A comma-separated list of fields for
|
:arg fielddata_fields: A comma-separated list of fields for
|
||||||
`fielddata` index metric (supports wildcards)
|
`fielddata` index metric (supports wildcards)
|
||||||
:arg fields: A comma-separated list of fields for `fielddata`
|
:arg fields: A comma-separated list of fields for `fielddata`
|
||||||
@@ -821,7 +811,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
should be ignored when unavailable (missing or closed)
|
should be ignored when unavailable (missing or closed)
|
||||||
:arg verbose: Includes detailed memory usage by Lucene.
|
:arg verbose: Includes detailed memory usage by Lucene.
|
||||||
@@ -872,7 +862,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
given in the query string
|
given in the query string
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg explain: Return detailed information about the error
|
:arg explain: Return detailed information about the error
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
should be ignored when unavailable (missing or closed)
|
should be ignored when unavailable (missing or closed)
|
||||||
@@ -911,7 +901,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg fielddata: Clear field data
|
:arg fielddata: Clear field data
|
||||||
:arg fields: A comma-separated list of fields to clear when
|
:arg fields: A comma-separated list of fields to clear when
|
||||||
using the `fielddata` parameter (default: all)
|
using the `fielddata` parameter (default: all)
|
||||||
@@ -960,7 +950,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
should be ignored when unavailable (missing or closed)
|
should be ignored when unavailable (missing or closed)
|
||||||
:arg only_ancient_segments: If true, only ancient (an older
|
:arg only_ancient_segments: If true, only ancient (an older
|
||||||
@@ -985,7 +975,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
should be ignored when unavailable (missing or closed)
|
should be ignored when unavailable (missing or closed)
|
||||||
"""
|
"""
|
||||||
@@ -1033,7 +1023,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
should be ignored when unavailable (missing or closed)
|
should be ignored when unavailable (missing or closed)
|
||||||
:arg status: A comma-separated list of statuses used to filter
|
:arg status: A comma-separated list of statuses used to filter
|
||||||
@@ -1064,7 +1054,7 @@ class IndicesClient(NamespacedClient):
|
|||||||
string or when no indices have been specified)
|
string or when no indices have been specified)
|
||||||
:arg expand_wildcards: Whether to expand wildcard expression to
|
:arg expand_wildcards: Whether to expand wildcard expression to
|
||||||
concrete indices that are open, closed or both. Valid choices: open,
|
concrete indices that are open, closed or both. Valid choices: open,
|
||||||
closed, none, all Default: open
|
closed, hidden, none, all Default: open
|
||||||
:arg flush: Specify whether the index should be flushed after
|
:arg flush: Specify whether the index should be flushed after
|
||||||
performing the operation (default: true)
|
performing the operation (default: true)
|
||||||
:arg ignore_unavailable: Whether specified concrete indices
|
:arg ignore_unavailable: Whether specified concrete indices
|
||||||
@@ -1271,3 +1261,51 @@ class IndicesClient(NamespacedClient):
|
|||||||
params=params,
|
params=params,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@query_params()
|
||||||
|
def create_data_stream(self, name, body, params=None, headers=None):
|
||||||
|
"""
|
||||||
|
Creates or updates a data stream
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html>`_
|
||||||
|
|
||||||
|
:arg name: The name of the data stream
|
||||||
|
:arg body: The data stream definition
|
||||||
|
"""
|
||||||
|
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("_data_stream", name),
|
||||||
|
params=params,
|
||||||
|
headers=headers,
|
||||||
|
body=body,
|
||||||
|
)
|
||||||
|
|
||||||
|
@query_params()
|
||||||
|
def delete_data_stream(self, name, params=None, headers=None):
|
||||||
|
"""
|
||||||
|
Deletes a data stream.
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html>`_
|
||||||
|
|
||||||
|
:arg name: The name of the data stream
|
||||||
|
"""
|
||||||
|
if name in SKIP_IN_PATH:
|
||||||
|
raise ValueError("Empty value passed for a required argument 'name'.")
|
||||||
|
|
||||||
|
return self.transport.perform_request(
|
||||||
|
"DELETE", _make_path("_data_stream", name), params=params, headers=headers
|
||||||
|
)
|
||||||
|
|
||||||
|
@query_params()
|
||||||
|
def get_data_streams(self, name=None, params=None, headers=None):
|
||||||
|
"""
|
||||||
|
Returns data streams.
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html>`_
|
||||||
|
|
||||||
|
:arg name: The comma separated names of data streams
|
||||||
|
"""
|
||||||
|
return self.transport.perform_request(
|
||||||
|
"GET", _make_path("_data_streams", name), params=params, headers=headers
|
||||||
|
)
|
||||||
|
|||||||
@@ -808,13 +808,24 @@ class MlClient(NamespacedClient):
|
|||||||
headers=headers,
|
headers=headers,
|
||||||
)
|
)
|
||||||
|
|
||||||
@query_params()
|
@query_params(
|
||||||
|
"allow_no_indices", "expand_wildcards", "ignore_throttled", "ignore_unavailable"
|
||||||
|
)
|
||||||
def put_datafeed(self, datafeed_id, body, params=None, headers=None):
|
def put_datafeed(self, datafeed_id, body, params=None, headers=None):
|
||||||
"""
|
"""
|
||||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html>`_
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html>`_
|
||||||
|
|
||||||
:arg datafeed_id: The ID of the datafeed to create
|
:arg datafeed_id: The ID of the datafeed to create
|
||||||
:arg body: The datafeed config
|
:arg body: The datafeed config
|
||||||
|
:arg allow_no_indices: Ignore if the source indices expressions
|
||||||
|
resolves to no concrete indices (default: true)
|
||||||
|
:arg expand_wildcards: Whether source index expressions should
|
||||||
|
get expanded to open or closed indices (default: open) Valid choices:
|
||||||
|
open, closed, hidden, none, all
|
||||||
|
:arg ignore_throttled: Ignore indices that are marked as
|
||||||
|
throttled (default: true)
|
||||||
|
:arg ignore_unavailable: Ignore unavailable indexes (default:
|
||||||
|
false)
|
||||||
"""
|
"""
|
||||||
for param in (datafeed_id, body):
|
for param in (datafeed_id, body):
|
||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
@@ -964,13 +975,24 @@ class MlClient(NamespacedClient):
|
|||||||
headers=headers,
|
headers=headers,
|
||||||
)
|
)
|
||||||
|
|
||||||
@query_params()
|
@query_params(
|
||||||
|
"allow_no_indices", "expand_wildcards", "ignore_throttled", "ignore_unavailable"
|
||||||
|
)
|
||||||
def update_datafeed(self, datafeed_id, body, params=None, headers=None):
|
def update_datafeed(self, datafeed_id, body, params=None, headers=None):
|
||||||
"""
|
"""
|
||||||
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html>`_
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html>`_
|
||||||
|
|
||||||
:arg datafeed_id: The ID of the datafeed to update
|
:arg datafeed_id: The ID of the datafeed to update
|
||||||
:arg body: The datafeed update settings
|
:arg body: The datafeed update settings
|
||||||
|
:arg allow_no_indices: Ignore if the source indices expressions
|
||||||
|
resolves to no concrete indices (default: true)
|
||||||
|
:arg expand_wildcards: Whether source index expressions should
|
||||||
|
get expanded to open or closed indices (default: open) Valid choices:
|
||||||
|
open, closed, hidden, none, all
|
||||||
|
:arg ignore_throttled: Ignore indices that are marked as
|
||||||
|
throttled (default: true)
|
||||||
|
:arg ignore_unavailable: Ignore unavailable indexes (default:
|
||||||
|
false)
|
||||||
"""
|
"""
|
||||||
for param in (datafeed_id, body):
|
for param in (datafeed_id, body):
|
||||||
if param in SKIP_IN_PATH:
|
if param in SKIP_IN_PATH:
|
||||||
@@ -1279,6 +1301,7 @@ class MlClient(NamespacedClient):
|
|||||||
"from_",
|
"from_",
|
||||||
"include_model_definition",
|
"include_model_definition",
|
||||||
"size",
|
"size",
|
||||||
|
"tags",
|
||||||
)
|
)
|
||||||
def get_trained_models(self, model_id=None, params=None, headers=None):
|
def get_trained_models(self, model_id=None, params=None, headers=None):
|
||||||
"""
|
"""
|
||||||
@@ -1297,6 +1320,8 @@ class MlClient(NamespacedClient):
|
|||||||
cautious when including them. Defaults to false.
|
cautious when including them. Defaults to false.
|
||||||
:arg size: specifies a max number of trained models to get
|
:arg size: specifies a max number of trained models to get
|
||||||
Default: 100
|
Default: 100
|
||||||
|
:arg tags: A comma-separated list of tags that the model must
|
||||||
|
have.
|
||||||
"""
|
"""
|
||||||
# from is a reserved word so it cannot be used, use from_ instead
|
# from is a reserved word so it cannot be used, use from_ instead
|
||||||
if "from_" in params:
|
if "from_" in params:
|
||||||
@@ -1351,3 +1376,21 @@ class MlClient(NamespacedClient):
|
|||||||
headers=headers,
|
headers=headers,
|
||||||
body=body,
|
body=body,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@query_params()
|
||||||
|
def estimate_model_memory(self, body, params=None, headers=None):
|
||||||
|
"""
|
||||||
|
|
||||||
|
:arg body: The analysis config, plus cardinality estimates for
|
||||||
|
fields it references
|
||||||
|
"""
|
||||||
|
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/_estimate_model_memory",
|
||||||
|
params=params,
|
||||||
|
headers=headers,
|
||||||
|
body=body,
|
||||||
|
)
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
@query_params("refresh")
|
@query_params("refresh")
|
||||||
def delete_privileges(self, application, name, params=None, headers=None):
|
def delete_privileges(self, application, name, params=None, headers=None):
|
||||||
"""
|
"""
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html>`_
|
||||||
|
|
||||||
:arg application: Application name
|
:arg application: Application name
|
||||||
:arg name: Privilege name
|
:arg name: Privilege name
|
||||||
@@ -367,6 +368,7 @@ class SecurityClient(NamespacedClient):
|
|||||||
@query_params("refresh")
|
@query_params("refresh")
|
||||||
def put_privileges(self, body, params=None, headers=None):
|
def put_privileges(self, body, params=None, headers=None):
|
||||||
"""
|
"""
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html>`_
|
||||||
|
|
||||||
:arg body: The privilege(s) to add
|
:arg body: The privilege(s) to add
|
||||||
:arg refresh: If `true` (the default) then refresh the affected
|
:arg refresh: If `true` (the default) then refresh the affected
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ class SqlClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def clear_cursor(self, body, params=None, headers=None):
|
def clear_cursor(self, body, params=None, headers=None):
|
||||||
"""
|
"""
|
||||||
|
Clears the SQL cursor
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-pagination.html>`_
|
||||||
|
|
||||||
:arg body: Specify the cursor value in the `cursor` element to
|
:arg body: Specify the cursor value in the `cursor` element to
|
||||||
clean the cursor.
|
clean the cursor.
|
||||||
@@ -19,6 +21,8 @@ class SqlClient(NamespacedClient):
|
|||||||
@query_params("format")
|
@query_params("format")
|
||||||
def query(self, body, params=None, headers=None):
|
def query(self, body, params=None, headers=None):
|
||||||
"""
|
"""
|
||||||
|
Executes an SQL request
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-rest-overview.html>`_
|
||||||
|
|
||||||
:arg body: Use the `query` element to start a query. Use the
|
:arg body: Use the `query` element to start a query. Use the
|
||||||
`cursor` element to continue a query.
|
`cursor` element to continue a query.
|
||||||
@@ -35,6 +39,8 @@ class SqlClient(NamespacedClient):
|
|||||||
@query_params()
|
@query_params()
|
||||||
def translate(self, body, params=None, headers=None):
|
def translate(self, body, params=None, headers=None):
|
||||||
"""
|
"""
|
||||||
|
Translates SQL into Elasticsearch queries
|
||||||
|
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate.html>`_
|
||||||
|
|
||||||
:arg body: Specify the query in the `query` element.
|
:arg body: Specify the query in the `query` element.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -74,7 +74,8 @@ class TasksClient(NamespacedClient):
|
|||||||
warnings.warn(
|
warnings.warn(
|
||||||
"Calling client.tasks.get() without a task_id is deprecated "
|
"Calling client.tasks.get() without a task_id is deprecated "
|
||||||
"and will be removed in v8.0. Use client.tasks.list() instead.",
|
"and will be removed in v8.0. Use client.tasks.list() instead.",
|
||||||
DeprecationWarning,
|
category=DeprecationWarning,
|
||||||
|
stacklevel=3,
|
||||||
)
|
)
|
||||||
|
|
||||||
return self.transport.perform_request(
|
return self.transport.perform_request(
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ class ElasticsearchTestCase(TestCase):
|
|||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
super(ElasticsearchTestCase, self).tearDown()
|
super(ElasticsearchTestCase, self).tearDown()
|
||||||
|
|
||||||
# Hidden indices expanded in wildcards in ES 7.7
|
# Hidden indices expanded in wildcards in ES 7.7
|
||||||
expand_wildcards = ["open", "closed"]
|
expand_wildcards = ["open", "closed"]
|
||||||
if self.es_version >= (7, 7):
|
if self.es_version >= (7, 7):
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ from os.path import join, dirname
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
VERSION = (7, 6, 0)
|
VERSION = (7, 7, 0)
|
||||||
__version__ = VERSION
|
__version__ = VERSION
|
||||||
__versionstr__ = "7.6.0"
|
__versionstr__ = "7.7.0a1"
|
||||||
|
|
||||||
with open(join(dirname(__file__), "README")) as f:
|
with open(join(dirname(__file__), "README")) as f:
|
||||||
long_description = f.read().strip()
|
long_description = f.read().strip()
|
||||||
|
|
||||||
install_requires = ["urllib3>=1.21.1"]
|
install_requires = ["urllib3>=1.21.1", "certifi"]
|
||||||
tests_require = [
|
tests_require = [
|
||||||
"requests>=2.0.0, <3.0.0",
|
"requests>=2.0.0, <3.0.0",
|
||||||
"nose",
|
"nose",
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
warnings.warn(
|
warnings.warn(
|
||||||
"Calling client.tasks.get() without a task_id is deprecated "
|
"Calling client.tasks.get() without a task_id is deprecated "
|
||||||
"and will be removed in v8.0. Use client.tasks.list() instead.",
|
"and will be removed in v8.0. Use client.tasks.list() instead.",
|
||||||
DeprecationWarning,
|
category=DeprecationWarning,
|
||||||
|
stacklevel=3,
|
||||||
)
|
)
|
||||||
|
|
||||||
{{ super()|trim }}
|
{{ super()|trim }}
|
||||||
|
|||||||
Reference in New Issue
Block a user