From a96608d9b8ef2c01d6b526713297b2a55f6ff950 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Thu, 21 Sep 2023 09:51:52 +0400 Subject: [PATCH] [8.10] Add Synonyms and Query rules APIs (#2300) --- docs/sphinx/api.rst | 12 + elasticsearch/_async/client/__init__.py | 325 ++--- elasticsearch/_async/client/async_search.py | 8 +- elasticsearch/_async/client/autoscaling.py | 8 +- elasticsearch/_async/client/cat.py | 141 ++- elasticsearch/_async/client/ccr.py | 26 +- elasticsearch/_async/client/cluster.py | 155 ++- .../_async/client/dangling_indices.py | 6 +- elasticsearch/_async/client/enrich.py | 31 +- elasticsearch/_async/client/eql.py | 12 +- elasticsearch/_async/client/features.py | 4 +- elasticsearch/_async/client/fleet.py | 2 +- elasticsearch/_async/client/graph.py | 22 +- elasticsearch/_async/client/ilm.py | 22 +- elasticsearch/_async/client/indices.py | 1055 ++++++++++------- elasticsearch/_async/client/ingest.py | 42 +- elasticsearch/_async/client/license.py | 14 +- elasticsearch/_async/client/logstash.py | 12 +- elasticsearch/_async/client/migration.py | 6 +- elasticsearch/_async/client/ml.py | 159 ++- elasticsearch/_async/client/monitoring.py | 2 +- elasticsearch/_async/client/nodes.py | 14 +- elasticsearch/_async/client/query_ruleset.py | 187 +++ elasticsearch/_async/client/rollup.py | 16 +- .../_async/client/search_application.py | 16 +- .../_async/client/searchable_snapshots.py | 8 +- elasticsearch/_async/client/security.py | 181 +-- elasticsearch/_async/client/slm.py | 18 +- elasticsearch/_async/client/snapshot.py | 22 +- elasticsearch/_async/client/sql.py | 12 +- elasticsearch/_async/client/ssl.py | 2 +- elasticsearch/_async/client/synonyms.py | 325 +++++ elasticsearch/_async/client/tasks.py | 6 +- elasticsearch/_async/client/text_structure.py | 2 +- elasticsearch/_async/client/transform.py | 22 +- elasticsearch/_async/client/watcher.py | 22 +- elasticsearch/_async/client/xpack.py | 4 +- elasticsearch/_sync/client/__init__.py | 325 ++--- elasticsearch/_sync/client/async_search.py | 8 +- elasticsearch/_sync/client/autoscaling.py | 8 +- elasticsearch/_sync/client/cat.py | 141 ++- elasticsearch/_sync/client/ccr.py | 26 +- elasticsearch/_sync/client/cluster.py | 155 ++- .../_sync/client/dangling_indices.py | 6 +- elasticsearch/_sync/client/enrich.py | 31 +- elasticsearch/_sync/client/eql.py | 12 +- elasticsearch/_sync/client/features.py | 4 +- elasticsearch/_sync/client/fleet.py | 2 +- elasticsearch/_sync/client/graph.py | 22 +- elasticsearch/_sync/client/ilm.py | 22 +- elasticsearch/_sync/client/indices.py | 1055 ++++++++++------- elasticsearch/_sync/client/ingest.py | 42 +- elasticsearch/_sync/client/license.py | 14 +- elasticsearch/_sync/client/logstash.py | 12 +- elasticsearch/_sync/client/migration.py | 6 +- elasticsearch/_sync/client/ml.py | 159 ++- elasticsearch/_sync/client/monitoring.py | 2 +- elasticsearch/_sync/client/nodes.py | 14 +- elasticsearch/_sync/client/query_ruleset.py | 187 +++ elasticsearch/_sync/client/rollup.py | 16 +- .../_sync/client/search_application.py | 16 +- .../_sync/client/searchable_snapshots.py | 8 +- elasticsearch/_sync/client/security.py | 181 +-- elasticsearch/_sync/client/slm.py | 18 +- elasticsearch/_sync/client/snapshot.py | 22 +- elasticsearch/_sync/client/sql.py | 12 +- elasticsearch/_sync/client/ssl.py | 2 +- elasticsearch/_sync/client/synonyms.py | 325 +++++ elasticsearch/_sync/client/tasks.py | 6 +- elasticsearch/_sync/client/text_structure.py | 2 +- elasticsearch/_sync/client/transform.py | 22 +- elasticsearch/_sync/client/watcher.py | 22 +- elasticsearch/_sync/client/xpack.py | 4 +- elasticsearch/client.py | 4 + 74 files changed, 3846 insertions(+), 1988 deletions(-) create mode 100644 elasticsearch/_async/client/query_ruleset.py create mode 100644 elasticsearch/_async/client/synonyms.py create mode 100644 elasticsearch/_sync/client/query_ruleset.py create mode 100644 elasticsearch/_sync/client/synonyms.py diff --git a/docs/sphinx/api.rst b/docs/sphinx/api.rst index 72977c161..b79067909 100644 --- a/docs/sphinx/api.rst +++ b/docs/sphinx/api.rst @@ -144,6 +144,12 @@ Nodes .. autoclass:: NodesClient :members: +Query rules +----------- + +.. autoclass:: QueryRulesetClient + :members: + Rollup Indices -------------- @@ -192,6 +198,12 @@ SQL .. autoclass:: SqlClient :members: +Synonyms +-------- + +.. autoclass:: SynonymsClient + :members: + TLS/SSL ------- diff --git a/elasticsearch/_async/client/__init__.py b/elasticsearch/_async/client/__init__.py index 75fd301bb..f045677be 100644 --- a/elasticsearch/_async/client/__init__.py +++ b/elasticsearch/_async/client/__init__.py @@ -61,6 +61,7 @@ from .ml import MlClient from .monitoring import MonitoringClient from .nodes import NodesClient +from .query_ruleset import QueryRulesetClient from .rollup import RollupClient from .search_application import SearchApplicationClient from .searchable_snapshots import SearchableSnapshotsClient @@ -70,6 +71,7 @@ from .snapshot import SnapshotClient from .sql import SqlClient from .ssl import SslClient +from .synonyms import SynonymsClient from .tasks import TasksClient from .text_structure import TextStructureClient from .transform import TransformClient @@ -449,6 +451,7 @@ def __init__( self.migration = MigrationClient(self) self.ml = MlClient(self) self.monitoring = MonitoringClient(self) + self.query_ruleset = QueryRulesetClient(self) self.rollup = RollupClient(self) self.search_application = SearchApplicationClient(self) self.searchable_snapshots = SearchableSnapshotsClient(self) @@ -457,6 +460,7 @@ def __init__( self.shutdown = ShutdownClient(self) self.sql = SqlClient(self) self.ssl = SslClient(self) + self.synonyms = SynonymsClient(self) self.text_structure = TextStructureClient(self) self.transform = TransformClient(self) self.watcher = WatcherClient(self) @@ -641,7 +645,7 @@ async def bulk( """ Allows to perform multiple index/update/delete operations in a single request. - ``_ + ``_ :param operations: :param index: Default index for items which don't provide one @@ -726,7 +730,7 @@ async def clear_scroll( """ Explicitly clears the search context for a scroll. - ``_ + ``_ :param scroll_id: """ @@ -769,7 +773,7 @@ async def close_point_in_time( """ Close a point in time - ``_ + ``_ :param id: """ @@ -846,7 +850,7 @@ async def count( """ Returns number of documents matching a query. - ``_ + ``_ :param index: A comma-separated list of indices to restrict the results :param allow_no_indices: Whether to ignore if a wildcard indices expression resolves @@ -963,7 +967,7 @@ async def create( Creates a new document in the index. Returns a 409 response when a document with a same ID already exists in the index. - ``_ + ``_ :param index: The name of the index :param id: Document ID @@ -1048,7 +1052,7 @@ async def delete( """ Removes a document from the index. - ``_ + ``_ :param index: The name of the index :param id: The document ID @@ -1176,7 +1180,7 @@ async def delete_by_query( """ Deletes documents matching the provided query. - ``_ + ``_ :param index: A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -1340,7 +1344,7 @@ async def delete_by_query_rethrottle( """ Changes the number of requests per second for a particular Delete By Query operation. - ``_ + ``_ :param task_id: The task id to rethrottle :param requests_per_second: The throttle to set on this request in floating sub-requests @@ -1384,7 +1388,7 @@ async def delete_script( """ Deletes a script. - ``_ + ``_ :param id: Script ID :param master_timeout: Specify timeout for connection to master @@ -1453,7 +1457,7 @@ async def exists( """ Returns information about whether a document exists in an index. - ``_ + ``_ :param index: The name of the index :param id: The document ID @@ -1553,7 +1557,7 @@ async def exists_source( """ Returns information about whether a document source exists in an index. - ``_ + ``_ :param index: The name of the index :param id: The document ID @@ -1654,7 +1658,7 @@ async def explain( """ Returns information about why a specific matches (or doesn't match) a query. - ``_ + ``_ :param index: The name of the index :param id: The document ID @@ -1775,7 +1779,7 @@ async def field_caps( """ Returns the information about the capabilities of fields among multiple indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams @@ -1887,7 +1891,7 @@ async def get( """ Returns a document. - ``_ + ``_ :param index: Name of the index that contains the document. :param id: Unique identifier of the document. @@ -1967,7 +1971,7 @@ async def get_script( """ Returns a script. - ``_ + ``_ :param id: Script ID :param master_timeout: Specify timeout for connection to master @@ -2005,7 +2009,7 @@ async def get_script_context( """ Returns all script contexts. - ``_ + ``_ """ __path = "/_script_context" __query: t.Dict[str, t.Any] = {} @@ -2036,7 +2040,7 @@ async def get_script_languages( """ Returns available script types, languages and contexts - ``_ + ``_ """ __path = "/_script_language" __query: t.Dict[str, t.Any] = {} @@ -2095,7 +2099,7 @@ async def get_source( """ Returns the source of a document. - ``_ + ``_ :param index: Name of the index that contains the document. :param id: Unique identifier of the document. @@ -2176,7 +2180,7 @@ async def health_report( """ Returns the health of the cluster. - ``_ + ``_ :param feature: A feature of the cluster, as returned by the top-level health report API. @@ -2244,7 +2248,7 @@ async def index( """ Creates or updates a document in an index. - ``_ + ``_ :param index: The name of the index :param document: @@ -2335,7 +2339,7 @@ async def info( """ Returns basic information about the cluster. - ``_ + ``_ """ __path = "/" __query: t.Dict[str, t.Any] = {} @@ -2390,7 +2394,7 @@ async def knn_search( """ Performs a kNN search. - ``_ + ``_ :param index: A comma-separated list of index names to search; use `_all` or to perform the operation on all indices @@ -2493,7 +2497,7 @@ async def mget( """ Allows to get multiple documents in one request. - ``_ + ``_ :param index: Name of the index to retrieve documents from when `ids` are specified, or when a document in the `docs` array does not specify an index. @@ -2610,7 +2614,7 @@ async def msearch( """ Allows to execute several search operations in one request. - ``_ + ``_ :param searches: :param index: Comma-separated list of data streams, indices, and index aliases @@ -2723,7 +2727,7 @@ async def msearch_template( """ Allows to execute several search template operations in one request. - ``_ + ``_ :param search_templates: :param index: A comma-separated list of index names to use as default @@ -2807,7 +2811,7 @@ async def mtermvectors( """ Returns multiple termvectors in one request. - ``_ + ``_ :param index: The index in which the document resides. :param docs: @@ -2922,7 +2926,7 @@ async def open_point_in_time( """ Open a point in time that can be used in subsequent searches - ``_ + ``_ :param index: A comma-separated list of index names to open point in time; use `_all` or empty string to perform the operation on all indices @@ -2987,7 +2991,7 @@ async def put_script( """ Creates or updates a script. - ``_ + ``_ :param id: Script ID :param script: @@ -3069,7 +3073,7 @@ async def rank_eval( Allows to evaluate the quality of ranked search results over a set of typical search queries - ``_ + ``_ :param requests: A set of typical search requests, together with their provided ratings. @@ -3156,7 +3160,7 @@ async def reindex( source documents by a query, changing the destination index settings, or fetching the documents from a remote cluster. - ``_ + ``_ :param dest: :param source: @@ -3245,7 +3249,7 @@ async def reindex_rethrottle( """ Changes the number of requests per second for a particular Reindex operation. - ``_ + ``_ :param task_id: The task id to rethrottle :param requests_per_second: The throttle to set on this request in floating sub-requests @@ -3291,7 +3295,7 @@ async def render_search_template( """ Allows to use the Mustache language to pre-render a search definition. - ``_ + ``_ :param id: The id of the stored search template :param file: @@ -3346,7 +3350,7 @@ async def scripts_painless_execute( """ Allows an arbitrary script to be executed and a result to be returned - ``_ + ``_ :param context: :param context_setup: @@ -3397,7 +3401,7 @@ async def scroll( """ Allows to retrieve a large numbers of results from a single search request. - ``_ + ``_ :param scroll_id: Scroll ID of the search. :param rest_total_hits_as_int: If true, the API response’s hit.total property @@ -3579,131 +3583,188 @@ async def search( """ Returns results matching a query. - ``_ + ``_ - :param index: A comma-separated list of index names to search; use `_all` or - empty string to perform the operation on all indices - :param aggregations: - :param aggs: - :param 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) - :param allow_partial_search_results: Indicate if an error should be returned - if there is a partial search failure or timeout - :param analyze_wildcard: Specify whether wildcard and prefix queries should be - analyzed (default: false) - :param analyzer: The analyzer to use for the query string + :param index: Comma-separated list of data streams, indices, and aliases to search. + Supports wildcards (`*`). To search all data streams and indices, omit this + parameter or use `*` or `_all`. + :param aggregations: Defines the aggregations that are run as part of the search + request. + :param aggs: Defines the aggregations that are run as part of the search request. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. For + example, a request targeting `foo*,bar*` returns an error if an index starts + with `foo` but no index starts with `bar`. + :param allow_partial_search_results: If true, returns partial results if there + are shard request timeouts or shard failures. If false, returns an error + with no partial results. + :param analyze_wildcard: If true, wildcard and prefix queries are analyzed. This + parameter can only be used when the q query string parameter is specified. + :param analyzer: Analyzer to use for the query string. This parameter can only + be used when the q query string parameter is specified. :param batched_reduce_size: The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. - :param ccs_minimize_roundtrips: Indicates whether network round-trips should - be minimized as part of cross-cluster search requests execution - :param collapse: - :param default_operator: The default operator for query string query (AND or - OR) - :param df: The field to use as default where no field prefix is given in the - query string - :param docvalue_fields: Array of wildcard (*) patterns. The request returns doc - values for field names matching these patterns in the hits.fields property + :param ccs_minimize_roundtrips: If true, network round-trips between the coordinating + node and the remote clusters are minimized when executing cross-cluster search + (CCS) requests. + :param collapse: Collapses search results the values of the specified field. + :param default_operator: The default operator for query string query: AND or + OR. This parameter can only be used when the `q` query string parameter is + specified. + :param df: Field to use as default where no field prefix is given in the query + string. This parameter can only be used when the q query string parameter + is specified. + :param docvalue_fields: Array of wildcard (`*`) patterns. The request returns + doc values for field names matching these patterns in the `hits.fields` property of the response. - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. :param explain: If true, returns detailed information about score computation as part of a hit. :param ext: Configuration of search extensions defined by Elasticsearch plugins. - :param fields: Array of wildcard (*) patterns. The request returns values for - field names matching these patterns in the hits.fields property of the response. - :param from_: Starting document offset. By default, you cannot page through more - than 10,000 hits using the from and size parameters. To page through more - hits, use the search_after parameter. - :param highlight: - :param ignore_throttled: Whether specified concrete, expanded or aliased indices - should be ignored when throttled - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) + :param fields: Array of wildcard (`*`) patterns. The request returns values for + field names matching these patterns in the `hits.fields` property of the + response. + :param from_: Starting document offset. Needs to be non-negative. By default, + you cannot page through more than 10,000 hits using the `from` and `size` + parameters. To page through more hits, use the `search_after` parameter. + :param highlight: Specifies the highlighter to use for retrieving highlighted + snippets from one or more fields in your search results. + :param ignore_throttled: If `true`, concrete, expanded or aliased indices will + be ignored when frozen. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. :param indices_boost: Boosts the _score of documents from specified indices. :param knn: Defines the approximate kNN search to run. - :param lenient: Specify whether format-based query failures (such as providing - text to a numeric field) should be ignored - :param 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 - :param min_compatible_shard_node: The minimum compatible version that all shards - involved in search should have for this request to be successful - :param min_score: Minimum _score for matching documents. Documents with a lower - _score are not included in the search results. + :param lenient: If `true`, format-based query failures (such as providing text + to a numeric field) in the query string will be ignored. This parameter can + only be used when the `q` query string parameter is specified. + :param max_concurrent_shard_requests: Defines 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. + :param min_compatible_shard_node: The minimum version of the node that can handle + the request Any handling node with a lower version will fail the request. + :param min_score: Minimum `_score` for matching documents. Documents with a lower + `_score` are not included in the search results. :param pit: Limits the search to a point in time (PIT). If you provide a PIT, - you cannot specify an in the request path. - :param post_filter: - :param pre_filter_shard_size: A threshold that enforces a pre-filter roundtrip - to prefilter search shards based on query rewriting if the number of shards - the search request expands to exceeds the threshold. This filter roundtrip - can limit the number of shards significantly if for instance a shard can - not match any documents based on its rewrite method ie. if date filters are - mandatory to match but the shard bounds and the query are disjoint. - :param preference: Specify the node or shard the operation should be performed - on (default: random) - :param profile: - :param q: Query in the Lucene query string syntax + you cannot specify an `` in the request path. + :param post_filter: Use the `post_filter` parameter to filter search results. + The search hits are filtered after the aggregations are calculated. A post + filter has no impact on the aggregation results. + :param pre_filter_shard_size: Defines a threshold that enforces a pre-filter + roundtrip to prefilter search shards based on query rewriting if the number + of shards the search request expands to exceeds the threshold. This filter + roundtrip can limit the number of shards significantly if for instance a + shard can not match any documents based on its rewrite method (if date filters + are mandatory to match but the shard bounds and the query are disjoint). + When unspecified, the pre-filter phase is executed if any of these conditions + is met: the request targets more than 128 shards; the request targets one + or more read-only index; the primary sort of the query targets an indexed + field. + :param preference: Nodes and shards used for the search. By default, Elasticsearch + selects from eligible nodes and shards using adaptive replica selection, + accounting for allocation awareness. Valid values are: `_only_local` to run + the search only on shards on the local node; `_local` to, if possible, run + the search on shards on the local node, or if not, select shards using the + default method; `_only_nodes:,` to run the search on only + the specified nodes IDs, where, if suitable shards exist on more than one + selected node, use shards on those nodes using the default method, or if + none of the specified nodes are available, select shards from any available + node using the default method; `_prefer_nodes:,` to if + possible, run the search on the specified nodes IDs, or if not, select shards + using the default method; `_shards:,` to run the search only + on the specified shards; `` (any string that does not start + with `_`) to route searches with the same `` to the same shards + in the same order. + :param profile: Set to `true` to return detailed timing information about the + execution of individual components in a search request. NOTE: This is a debugging + tool and adds significant overhead to search execution. + :param q: Query in the Lucene query string syntax using query parameter search. + Query parameter searches do not support the full Elasticsearch Query DSL + but are handy for testing. :param query: Defines the search definition using the Query DSL. - :param rank: Defines the Reciprocal Rank Fusion (RRF) to use - :param request_cache: Specify if request cache should be used for this request - or not, defaults to index level setting - :param rescore: - :param rest_total_hits_as_int: Indicates whether hits.total should be rendered - as an integer or an object in the rest search response - :param routing: A comma-separated list of specific routing values + :param rank: Defines the Reciprocal Rank Fusion (RRF) to use. + :param request_cache: If `true`, the caching of search results is enabled for + requests where `size` is `0`. Defaults to index level settings. + :param rescore: Can be used to improve precision by reordering just the top (for + example 100 - 500) documents returned by the `query` and `post_filter` phases. + :param rest_total_hits_as_int: Indicates whether `hits.total` should be rendered + as an integer or an object in the rest search response. + :param routing: Custom value used to route operations to a specific shard. :param runtime_mappings: Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name. :param script_fields: Retrieve a script evaluation (based on different fields) for each hit. - :param scroll: Specify how long a consistent view of the index should be maintained - for scrolled search - :param search_after: - :param search_type: Search operation type - :param seq_no_primary_term: If true, returns sequence number and primary term - of the last modification of each hit. See Optimistic concurrency control. + :param scroll: Period to retain the search context for scrolling. See Scroll + search results. By default, this value cannot exceed `1d` (24 hours). You + can change this limit using the `search.max_keep_alive` cluster-level setting. + :param search_after: Used to retrieve the next page of hits using a set of sort + values from the previous page. + :param search_type: How distributed term frequencies are calculated for relevance + scoring. + :param seq_no_primary_term: If `true`, returns sequence number and primary term + of the last modification of each hit. :param size: The number of hits to return. By default, you cannot page through - more than 10,000 hits using the from and size parameters. To page through - more hits, use the search_after parameter. - :param slice: - :param sort: + more than 10,000 hits using the `from` and `size` parameters. To page through + more hits, use the `search_after` parameter. + :param slice: Can be used to split a scrolled search into multiple slices that + can be consumed independently. + :param sort: A comma-separated list of : pairs. :param source: Indicates which source fields are returned for matching documents. These fields are returned in the hits._source property of the search response. - :param source_excludes: A list of fields to exclude from the returned _source - field - :param source_includes: A list of fields to extract and return from the _source - field + :param source_excludes: A comma-separated list of source fields to exclude from + the response. You can also use this parameter to exclude fields from the + subset specified in `_source_includes` query parameter. If the `_source` + parameter is `false`, this parameter is ignored. + :param source_includes: A comma-separated list of source fields to include in + the response. If this parameter is specified, only these source fields are + returned. You can exclude fields from this subset using the `_source_excludes` + query parameter. If the `_source` parameter is `false`, this parameter is + ignored. :param stats: Stats groups to associate with the search. Each group maintains a statistics aggregation for its associated searches. You can retrieve these stats using the indices stats API. :param stored_fields: List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this - field is specified, the _source parameter defaults to false. You can pass - _source: true to return both source fields and stored fields in the search - response. - :param suggest: + field is specified, the `_source` parameter defaults to `false`. You can + pass `_source: true` to return both source fields and stored fields in the + search response. + :param suggest: Defines a suggester that provides similar looking terms based + on a provided text. :param suggest_field: Specifies which field to use for suggestions. - :param suggest_mode: Specify suggest mode - :param suggest_size: How many suggestions to return in response + :param suggest_mode: Specifies the suggest mode. This parameter can only be used + when the `suggest_field` and `suggest_text` query string parameters are specified. + :param suggest_size: Number of suggestions to return. This parameter can only + be used when the `suggest_field` and `suggest_text` query string parameters + are specified. :param suggest_text: The source text for which the suggestions should be returned. + This parameter can only be used when the `suggest_field` and `suggest_text` + query string parameters are specified. :param terminate_after: Maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. - Elasticsearch collects documents before sorting. Defaults to 0, which does - not terminate query execution early. + Elasticsearch collects documents before sorting. Use with caution. Elasticsearch + applies this parameter to each shard handling the request. When possible, + let Elasticsearch perform early termination automatically. Avoid specifying + this parameter for requests that target data streams with backing indices + across multiple data tiers. If set to `0` (default), the query does not terminate + early. :param timeout: Specifies the period of time to wait for a response from each shard. If no response is received before the timeout expires, the request fails and returns an error. Defaults to no timeout. :param track_scores: If true, calculate and return document scores, even if the scores are not used for sorting. :param track_total_hits: Number of hits matching the query to count accurately. - If true, the exact number of hits is returned at the cost of some performance. - If false, the response does not include the total number of hits matching - the query. Defaults to 10,000 hits. - :param typed_keys: Specify whether aggregation and suggester names should be - prefixed by their respective types in the response + If `true`, the exact number of hits is returned at the cost of some performance. + If `false`, the response does not include the total number of hits matching + the query. + :param typed_keys: If `true`, aggregation and suggester names are be prefixed + by their respective types in the response. :param version: If true, returns document version as part of a hit. """ if index not in SKIP_IN_PATH: @@ -3914,7 +3975,7 @@ async def search_mvt( Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, or aliases to search :param field: Field containing geospatial data to return @@ -4067,7 +4128,7 @@ async def search_shards( Returns information about the indices and shards that a search request would be executed against. - ``_ + ``_ :param index: A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -4167,7 +4228,7 @@ async def search_template( """ Allows to use the Mustache language to pre-render a search definition. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (*). @@ -4278,7 +4339,7 @@ async def terms_enum( the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and index aliases to search. Wildcard (*) expressions are supported. @@ -4372,7 +4433,7 @@ async def termvectors( Returns information and statistics about terms in the fields of a particular document. - ``_ + ``_ :param index: The index in which the document resides. :param id: The id of the document, when not specified a doc param should be supplied. @@ -4499,7 +4560,7 @@ async def update( """ Updates a document with a script or partial document. - ``_ + ``_ :param index: The name of the index :param id: Document ID @@ -4668,7 +4729,7 @@ async def update_by_query( Performs an update on every document in the index without changing the source, for example to pick up a mapping change. - ``_ + ``_ :param index: A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -4844,7 +4905,7 @@ async def update_by_query_rethrottle( """ Changes the number of requests per second for a particular Update By Query operation. - ``_ + ``_ :param task_id: The task id to rethrottle :param requests_per_second: The throttle to set on this request in floating sub-requests diff --git a/elasticsearch/_async/client/async_search.py b/elasticsearch/_async/client/async_search.py index 1351d3ea7..d9504fb79 100644 --- a/elasticsearch/_async/client/async_search.py +++ b/elasticsearch/_async/client/async_search.py @@ -40,7 +40,7 @@ async def delete( Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - ``_ + ``_ :param id: A unique identifier for the async search. """ @@ -82,7 +82,7 @@ async def get( Retrieves the results of a previously submitted async search request given its ID. - ``_ + ``_ :param id: A unique identifier for the async search. :param keep_alive: Specifies how long the async search should be available in @@ -139,7 +139,7 @@ async def status( Retrieves the status of a previously submitted async search request given its ID. - ``_ + ``_ :param id: A unique identifier for the async search. """ @@ -310,7 +310,7 @@ async def submit( """ Executes a search request asynchronously. - ``_ + ``_ :param index: A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices diff --git a/elasticsearch/_async/client/autoscaling.py b/elasticsearch/_async/client/autoscaling.py index 939bcdf16..72d8489dd 100644 --- a/elasticsearch/_async/client/autoscaling.py +++ b/elasticsearch/_async/client/autoscaling.py @@ -40,7 +40,7 @@ async def delete_autoscaling_policy( Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - ``_ + ``_ :param name: the name of the autoscaling policy """ @@ -76,7 +76,7 @@ async def get_autoscaling_capacity( Gets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - ``_ + ``_ """ __path = "/_autoscaling/capacity" __query: t.Dict[str, t.Any] = {} @@ -109,7 +109,7 @@ async def get_autoscaling_policy( Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - ``_ + ``_ :param name: the name of the autoscaling policy """ @@ -149,7 +149,7 @@ async def put_autoscaling_policy( Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - ``_ + ``_ :param name: the name of the autoscaling policy :param policy: diff --git a/elasticsearch/_async/client/cat.py b/elasticsearch/_async/client/cat.py index f45c87a06..32e27ff11 100644 --- a/elasticsearch/_async/client/cat.py +++ b/elasticsearch/_async/client/cat.py @@ -67,7 +67,7 @@ async def aliases( Shows information about currently configured aliases to indices including filter and routing infos. - ``_ + ``_ :param name: A comma-separated list of aliases to retrieve. Supports wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`. @@ -152,7 +152,7 @@ async def allocation( Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. - ``_ + ``_ :param node_id: Comma-separated list of node identifiers or names used to limit the returned information. @@ -230,7 +230,7 @@ async def component_templates( """ Returns information about existing component_templates templates. - ``_ + ``_ :param name: The name of the component template. Accepts wildcard expressions. If omitted, all component templates are returned. @@ -306,7 +306,7 @@ async def count( Provides quick access to the document count of the entire cluster, or individual indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -388,7 +388,7 @@ async def fielddata( Shows how much heap memory is currently being used by fielddata on every data node in the cluster. - ``_ + ``_ :param fields: Comma-separated list of fields used to limit returned information. To retrieve all fields, omit this parameter. @@ -469,7 +469,7 @@ async def health( """ Returns a concise representation of the cluster health. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -544,7 +544,7 @@ async def help( """ Returns help for the Cat APIs. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -642,7 +642,7 @@ async def indices( Returns information about indices: number of primaries and replicas, document counts, disk size, ... - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -737,7 +737,7 @@ async def master( """ Returns information about the master node. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -856,7 +856,7 @@ async def ml_data_frame_analytics( """ Gets configuration and usage information about data frame analytics jobs. - ``_ + ``_ :param id: The ID of the data frame analytics to fetch :param allow_no_match: Whether to ignore if a wildcard expression matches no @@ -987,7 +987,7 @@ async def ml_datafeeds( """ Gets configuration and usage information about datafeeds. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. @@ -1124,7 +1124,7 @@ async def ml_jobs( """ Gets configuration and usage information about anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param allow_no_match: Specifies what to do when the request: * Contains wildcard @@ -1264,17 +1264,21 @@ async def ml_trained_models( """ Gets configuration and usage information about inference trained models. - ``_ + ``_ - :param model_id: The ID of the trained models stats to fetch - :param 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) - :param bytes: The unit in which to display byte values + :param model_id: A unique identifier for the trained model. + :param allow_no_match: Specifies what to do when the request: contains wildcard + expressions and there are no models that match; contains the `_all` string + or no identifiers and there are no matches; contains wildcard expressions + and there are only partial matches. If `true`, the API returns an empty array + when there are no matches and the subset of results when there are partial + matches. If `false`, the API returns a 404 status code when there are no + matches or only partial matches. + :param bytes: The unit used to display byte values. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. - :param from_: skips a number of trained models - :param h: Comma-separated list of column names to display + :param from_: Skips the specified number of transforms. + :param h: A comma-separated list of column names to display. :param help: When set to `true` will output available columns. This option can't be combined with any other query string option. :param local: If `true`, the request computes the list of selected nodes from @@ -1282,8 +1286,9 @@ async def ml_trained_models( from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node. :param master_timeout: Period to wait for a connection to the master node. - :param s: Comma-separated list of column names or column aliases to sort by - :param size: specifies a max number of trained models to get + :param s: A comma-separated list of column names or aliases used to sort the + response. + :param size: The maximum number of transforms to display. :param v: When set to `true` will enable verbose output. """ if model_id not in SKIP_IN_PATH: @@ -1349,7 +1354,7 @@ async def nodeattrs( """ Returns information about custom node attributes. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -1423,7 +1428,7 @@ async def nodes( """ Returns basic statistics about performance of cluster nodes. - ``_ + ``_ :param bytes: The unit used to display byte values. :param format: Specifies the format to return the columnar data in, can be set @@ -1503,7 +1508,7 @@ async def pending_tasks( """ Returns a concise representation of the cluster pending tasks. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -1572,7 +1577,7 @@ async def plugins( """ Returns information about installed plugins across nodes node. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -1647,7 +1652,7 @@ async def recovery( """ Returns information about index shard recoveries, both on-going completed. - ``_ + ``_ :param index: A comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -1732,7 +1737,7 @@ async def repositories( """ Returns information about snapshot repositories registered in the cluster. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -1805,10 +1810,12 @@ async def segments( """ Provides low-level information about the segments in the shards of an index. - ``_ + ``_ - :param index: A comma-separated list of index names to limit the returned information - :param bytes: The unit in which to display byte values + :param index: A comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param bytes: The unit used to display byte values. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -1885,10 +1892,12 @@ async def shards( """ Provides a detailed view of shard allocation on nodes. - ``_ + ``_ - :param index: A comma-separated list of index names to limit the returned information - :param bytes: The unit in which to display byte values + :param index: A comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param bytes: The unit used to display byte values. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -1965,15 +1974,18 @@ async def snapshots( """ Returns all snapshots in a specific repository. - ``_ + ``_ - :param repository: Name of repository from which to fetch the snapshot information + :param repository: A comma-separated list of snapshot repositories used to limit + the request. Accepts wildcard expressions. `_all` returns all repositories. + If any repository fails during the request, Elasticsearch returns an error. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. :param help: When set to `true` will output available columns. This option can't be combined with any other query string option. - :param ignore_unavailable: Set to true to ignore unavailable snapshots + :param ignore_unavailable: If `true`, the response does not include information + from unavailable snapshots. :param local: If `true`, the request computes the list of selected nodes from the local cluster state. If `false` the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating @@ -2037,7 +2049,7 @@ async def tasks( t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, node_id: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, - parent_task: t.Optional[int] = None, + parent_task_id: t.Optional[str] = None, pretty: t.Optional[bool] = None, s: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, v: t.Optional[bool] = None, @@ -2046,11 +2058,11 @@ async def tasks( Returns information about the tasks currently executing on one or more nodes in the cluster. - ``_ + ``_ - :param actions: A comma-separated list of actions that should be returned. Leave - empty to return all. - :param detailed: Return detailed task information (default: false) + :param actions: The task action names, which are used to limit the response. + :param detailed: If `true`, the response includes detailed information about + shard recoveries. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -2061,8 +2073,9 @@ async def tasks( from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node. :param master_timeout: Period to wait for a connection to the master node. - :param node_id: - :param parent_task: + :param node_id: Unique node identifiers, which are used to limit the response. + :param parent_task_id: The parent task identifier, which is used to limit the + response. :param s: List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting `:asc` or `:desc` as a suffix to the column name. @@ -2092,8 +2105,8 @@ async def tasks( __query["master_timeout"] = master_timeout if node_id is not None: __query["node_id"] = node_id - if parent_task is not None: - __query["parent_task"] = parent_task + if parent_task_id is not None: + __query["parent_task_id"] = parent_task_id if pretty is not None: __query["pretty"] = pretty if s is not None: @@ -2129,9 +2142,10 @@ async def templates( """ Returns information about existing templates. - ``_ + ``_ - :param name: A pattern that returned template names must match + :param name: The name of the template to return. Accepts wildcard expressions. + If omitted, all templates are returned. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -2209,10 +2223,10 @@ async def thread_pool( Returns cluster-wide thread pool statistics per node. By default the active, queue and rejected statistics are returned for all thread pools. - ``_ + ``_ - :param thread_pool_patterns: List of thread pool names used to limit the request. - Accepts wildcard expressions. + :param thread_pool_patterns: A comma-separated list of thread pool names used + to limit the request. Accepts wildcard expressions. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -2226,7 +2240,7 @@ async def thread_pool( :param s: List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting `:asc` or `:desc` as a suffix to the column name. - :param time: Unit used to display time values. + :param time: The unit used to display time values. :param v: When set to `true` will enable verbose output. """ if thread_pool_patterns not in SKIP_IN_PATH: @@ -2339,16 +2353,21 @@ async def transforms( """ Gets configuration and usage information about transforms. - ``_ + ``_ - :param transform_id: The id of the transform for which to get stats. '_all' or - '*' implies all transforms - :param allow_no_match: Whether to ignore if a wildcard expression matches no - transforms. (This includes `_all` string or when no transforms have been - specified) + :param transform_id: A transform identifier or a wildcard expression. If you + do not specify one of these options, the API returns information for all + transforms. + :param allow_no_match: Specifies what to do when the request: contains wildcard + expressions and there are no transforms that match; contains the `_all` string + or no identifiers and there are no matches; contains wildcard expressions + and there are only partial matches. If `true`, it returns an empty transforms + array when there are no matches and the subset of results when there are + partial matches. If `false`, the request returns a 404 status code when there + are no matches or only partial matches. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. - :param from_: skips a number of transform configs, defaults to 0 + :param from_: Skips the specified number of transforms. :param h: Comma-separated list of column names to display. :param help: When set to `true` will output available columns. This option can't be combined with any other query string option. @@ -2359,8 +2378,8 @@ async def transforms( :param master_timeout: Period to wait for a connection to the master node. :param s: Comma-separated list of column names or column aliases used to sort the response. - :param size: specifies a max number of transforms to get, defaults to 100 - :param time: Unit used to display time values. + :param size: The maximum number of transforms to obtain. + :param time: The unit used to display time values. :param v: When set to `true` will enable verbose output. """ if transform_id not in SKIP_IN_PATH: diff --git a/elasticsearch/_async/client/ccr.py b/elasticsearch/_async/client/ccr.py index 4ebda28a9..0f8abe6af 100644 --- a/elasticsearch/_async/client/ccr.py +++ b/elasticsearch/_async/client/ccr.py @@ -39,7 +39,7 @@ async def delete_auto_follow_pattern( """ Deletes auto-follow patterns. - ``_ + ``_ :param name: The name of the auto follow pattern. """ @@ -96,7 +96,7 @@ async def follow( """ Creates a new follower index configured to follow the referenced leader index. - ``_ + ``_ :param index: The name of the follower index :param leader_index: @@ -180,7 +180,7 @@ async def follow_info( Retrieves information about all follower indices, including parameters and status for each follower index - ``_ + ``_ :param index: A comma-separated list of index patterns; use `_all` to perform the operation on all indices @@ -218,7 +218,7 @@ async def follow_stats( Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. - ``_ + ``_ :param index: A comma-separated list of index patterns; use `_all` to perform the operation on all indices @@ -261,7 +261,7 @@ async def forget_follower( """ Removes the follower retention leases from the leader. - ``_ + ``_ :param index: the name of the leader index for which specified follower retention leases should be removed @@ -312,7 +312,7 @@ async def get_auto_follow_pattern( Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. - ``_ + ``_ :param name: Specifies the auto-follow pattern collection that you want to retrieve. If you do not specify a name, the API returns information for all collections. @@ -350,7 +350,7 @@ async def pause_auto_follow_pattern( """ Pauses an auto-follow pattern - ``_ + ``_ :param name: The name of the auto follow pattern that should pause discovering new indices to follow. @@ -388,7 +388,7 @@ async def pause_follow( Pauses a follower index. The follower index will not fetch any additional operations from the leader index. - ``_ + ``_ :param index: The name of the follower index that should pause following its leader index. @@ -452,7 +452,7 @@ async def put_auto_follow_pattern( cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. - ``_ + ``_ :param name: The name of the collection of auto-follow patterns. :param remote_cluster: The remote cluster containing the leader indices to match @@ -566,7 +566,7 @@ async def resume_auto_follow_pattern( """ Resumes an auto-follow pattern that has been paused - ``_ + ``_ :param name: The name of the auto follow pattern to resume discovering new indices to follow. @@ -619,7 +619,7 @@ async def resume_follow( """ Resumes a follower index that has been paused - ``_ + ``_ :param index: The name of the follow index to resume following. :param max_outstanding_read_requests: @@ -693,7 +693,7 @@ async def stats( """ Gets all stats related to cross-cluster replication. - ``_ + ``_ """ __path = "/_ccr/stats" __query: t.Dict[str, t.Any] = {} @@ -726,7 +726,7 @@ async def unfollow( Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. - ``_ + ``_ :param index: The name of the follower index that should be turned into a regular index. diff --git a/elasticsearch/_async/client/cluster.py b/elasticsearch/_async/client/cluster.py index 50527b8e8..ee937ca7f 100644 --- a/elasticsearch/_async/client/cluster.py +++ b/elasticsearch/_async/client/cluster.py @@ -46,7 +46,7 @@ async def allocation_explain( """ Provides explanations for shard allocations in the cluster. - ``_ + ``_ :param current_node: Specifies the node ID or the name of the node to only explain a shard that is currently located on the specified node. @@ -111,12 +111,15 @@ async def delete_component_template( """ Deletes a component template - ``_ + ``_ :param name: Comma-separated list or wildcard expression of component template names used to limit the request. - :param master_timeout: Specify timeout for connection to master - :param timeout: Explicit operation timeout + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -154,7 +157,7 @@ async def delete_voting_config_exclusions( """ Clears cluster voting config exclusions. - ``_ + ``_ :param wait_for_removal: Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions @@ -199,7 +202,7 @@ async def exists_component_template( """ Returns information about whether a particular component template exist - ``_ + ``_ :param name: Comma-separated list of component template names used to limit the request. Wildcard (*) expressions are supported. @@ -252,15 +255,18 @@ async def get_component_template( """ Returns one or more component templates - ``_ + ``_ - :param name: The comma separated names of the component templates - :param flat_settings: + :param name: Comma-separated list of component template names used to limit the + request. Wildcard (`*`) expressions are supported. + :param flat_settings: If `true`, returns settings in flat format. :param include_defaults: Return all default configurations for the component template (default: false) - :param local: Return local information, do not retrieve the state from master - node (default: false) - :param master_timeout: Explicit operation timeout for connection to master node + :param local: If `true`, the request retrieves information from the local node + only. If `false`, information is retrieved from the master node. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. """ if name not in SKIP_IN_PATH: __path = f"/_component_template/{_quote(name)}" @@ -308,12 +314,16 @@ async def get_settings( """ Returns cluster settings. - ``_ + ``_ - :param flat_settings: Return settings in flat format (default: false) - :param include_defaults: Whether to return all default clusters setting. - :param master_timeout: Explicit operation timeout for connection to master node - :param timeout: Explicit operation timeout + :param flat_settings: If `true`, returns settings in flat format. + :param include_defaults: If `true`, returns default cluster settings from the + local node. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ __path = "/_cluster/settings" __query: t.Dict[str, t.Any] = {} @@ -394,7 +404,7 @@ async def health( """ Returns basic information about the health of the cluster. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. To target @@ -470,6 +480,62 @@ async def health( "GET", __path, params=__query, headers=__headers ) + @_rewrite_parameters() + async def info( + self, + *, + target: t.Union[ + t.Union[ + "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", str + ], + t.Union[ + t.List[ + t.Union[ + "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", + str, + ] + ], + t.Tuple[ + t.Union[ + "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", + str, + ], + ..., + ], + ], + ], + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Returns different information about the cluster. + + ``_ + + :param target: Limits the information returned to the specific target. Supports + a comma-separated list, such as http,ingest. + """ + if target in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'target'") + __path = f"/_info/{_quote(target)}" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json"} + return await self.perform_request( # type: ignore[return-value] + "GET", __path, params=__query, headers=__headers + ) + @_rewrite_parameters() async def pending_tasks( self, @@ -489,11 +555,13 @@ async def pending_tasks( Returns a list of any cluster-level changes (e.g. create index, update mapping, allocate or fail shard) which have not yet been executed. - ``_ + ``_ - :param local: Return local information, do not retrieve the state from master - node (default: false) - :param master_timeout: Specify timeout for connection to master + :param local: If `true`, the request retrieves information from the local node + only. If `false`, information is retrieved from the master node. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. """ __path = "/_cluster/pending_tasks" __query: t.Dict[str, t.Any] = {} @@ -535,7 +603,7 @@ async def post_voting_config_exclusions( """ Updates the cluster voting config exclusions by node ids or node names. - ``_ + ``_ :param node_ids: A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify @@ -594,9 +662,17 @@ async def put_component_template( """ Creates or updates a component template - ``_ + ``_ - :param name: The name of the template + :param name: Name of the component template to create. Elasticsearch includes + the following built-in component templates: `logs-mappings`; 'logs-settings`; + `metrics-mappings`; `metrics-settings`;`synthetics-mapping`; `synthetics-settings`. + Elastic Agent uses these templates to configure backing indices for its data + streams. If you use Elastic Agent and want to overwrite one of these templates, + set the `version` for your replacement template higher than the current version. + If you don’t use Elastic Agent and want to disable all built-in component + and index templates, set `stack.templates.enabled` to `false` using the cluster + update settings API. :param template: The template to be applied which includes mappings, settings, or aliases configuration. :param allow_auto_create: This setting overrides the value of the `action.auto_create_index` @@ -604,13 +680,18 @@ async def put_component_template( created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`. If set to `false` then data streams matching the template must always be explicitly created. - :param create: Whether the index template should only be added if new or can - also replace an existing one - :param master_timeout: Specify timeout for connection to master + :param create: If `true`, this request cannot replace or update existing component + templates. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. :param meta: Optional user metadata about the component template. May have any - contents. This map is not automatically generated by Elasticsearch. + contents. This map is not automatically generated by Elasticsearch. This + information is stored in the cluster state, so keeping it short is preferable. + To unset `_meta`, replace the template without specifying this information. :param version: Version number used to manage component templates externally. This number isn't automatically generated or incremented by Elasticsearch. + To unset a version, replace the template without specifying a version. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -667,7 +748,7 @@ async def put_settings( """ Updates the cluster settings. - ``_ + ``_ :param flat_settings: Return settings in flat format (default: false) :param master_timeout: Explicit operation timeout for connection to master node @@ -715,7 +796,7 @@ async def remote_info( """ Returns the information about configured remote clusters. - ``_ + ``_ """ __path = "/_remote/info" __query: t.Dict[str, t.Any] = {} @@ -761,7 +842,7 @@ async def reroute( """ Allows to manually change the allocation of individual shards in the cluster. - ``_ + ``_ :param commands: Defines the commands to perform. :param dry_run: If true, then the request simulates the operation only and returns @@ -858,7 +939,7 @@ async def state( """ Returns a comprehensive information about the state of the cluster. - ``_ + ``_ :param metric: Limit the information returned to the specified metrics :param index: A comma-separated list of index names; use `_all` or empty string @@ -936,15 +1017,15 @@ async def stats( """ Returns high-level overview of cluster statistics. - ``_ + ``_ :param node_id: Comma-separated list of node filters used to limit returned information. Defaults to all nodes in the cluster. - :param flat_settings: Return settings in flat format (default: false) + :param flat_settings: If `true`, returns settings in flat format. :param timeout: Period to wait for each node to respond. If a node does not respond before its timeout expires, the response does not include its stats. However, - timed out nodes are included in the response’s _nodes.failed property. Defaults - to no timeout. + timed out nodes are included in the response’s `_nodes.failed` property. + Defaults to no timeout. """ if node_id not in SKIP_IN_PATH: __path = f"/_cluster/stats/nodes/{_quote(node_id)}" diff --git a/elasticsearch/_async/client/dangling_indices.py b/elasticsearch/_async/client/dangling_indices.py index fecaa9948..955458147 100644 --- a/elasticsearch/_async/client/dangling_indices.py +++ b/elasticsearch/_async/client/dangling_indices.py @@ -44,7 +44,7 @@ async def delete_dangling_index( """ Deletes the specified dangling index - ``_ + ``_ :param index_uuid: The UUID of the dangling index :param accept_data_loss: Must be set to true in order to delete the dangling @@ -97,7 +97,7 @@ async def import_dangling_index( """ Imports the specified dangling index - ``_ + ``_ :param index_uuid: The UUID of the dangling index :param accept_data_loss: Must be set to true in order to import the dangling @@ -144,7 +144,7 @@ async def list_dangling_indices( """ Returns all dangling indices. - ``_ + ``_ """ __path = "/_dangling" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_async/client/enrich.py b/elasticsearch/_async/client/enrich.py index 088ec6812..19d828dea 100644 --- a/elasticsearch/_async/client/enrich.py +++ b/elasticsearch/_async/client/enrich.py @@ -39,9 +39,9 @@ async def delete_policy( """ Deletes an existing enrich policy and its enrich index. - ``_ + ``_ - :param name: The name of the enrich policy + :param name: Enrich policy to delete. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -76,11 +76,11 @@ async def execute_policy( """ Creates the enrich index for an existing enrich policy. - ``_ + ``_ - :param name: The name of the enrich policy - :param wait_for_completion: Should the request should block until the execution - is complete. + :param name: Enrich policy to execute. + :param wait_for_completion: If `true`, the request blocks other enrich policy + execution requests until complete. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -116,9 +116,10 @@ async def get_policy( """ Gets information about an enrich policy. - ``_ + ``_ - :param name: A comma-separated list of enrich policy names + :param name: Comma-separated list of enrich policy names used to limit the request. + To return information for all enrich policies, omit this parameter. """ if name not in SKIP_IN_PATH: __path = f"/_enrich/policy/{_quote(name)}" @@ -158,12 +159,14 @@ async def put_policy( """ Creates a new enrich policy. - ``_ + ``_ - :param name: The name of the enrich policy - :param geo_match: - :param match: - :param range: + :param name: Name of the enrich policy to create or update. + :param geo_match: Matches enrich data to incoming documents based on a `geo_shape` + query. + :param match: Matches enrich data to incoming documents based on a `term` query. + :param range: Matches a number, date, or IP address in incoming documents to + a range in the enrich index based on a `term` query. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -204,7 +207,7 @@ async def stats( Gets enrich coordinator statistics and information about enrich policies that are currently executing. - ``_ + ``_ """ __path = "/_enrich/_stats" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_async/client/eql.py b/elasticsearch/_async/client/eql.py index 99ec0d9b1..839afe6d8 100644 --- a/elasticsearch/_async/client/eql.py +++ b/elasticsearch/_async/client/eql.py @@ -40,9 +40,11 @@ async def delete( Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - ``_ + ``_ - :param id: Identifier for the search to delete. + :param id: Identifier for the search to delete. A search ID is provided in the + EQL search API's response for an async search. A search ID is also provided + if the request’s `keep_on_completion` parameter is `true`. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") @@ -80,7 +82,7 @@ async def get( """ Returns async results from previously executed Event Query Language (EQL) search - ``_ + `< https://www.elastic.co/guide/en/elasticsearch/reference/8.10/get-async-eql-search-api.html>`_ :param id: Identifier for the search. :param keep_alive: Period for which the search and its results are stored on @@ -127,7 +129,7 @@ async def get_status( Returns the status of a previously submitted async or stored Event Query Language (EQL) search - ``_ + `< https://www.elastic.co/guide/en/elasticsearch/reference/8.10/get-async-eql-status-api.html>`_ :param id: Identifier for the search. """ @@ -215,7 +217,7 @@ async def search( """ Returns results matching a query expressed in Event Query Language (EQL) - ``_ + ``_ :param index: The name of the index to scope the operation :param query: EQL query you wish to run. diff --git a/elasticsearch/_async/client/features.py b/elasticsearch/_async/client/features.py index fe75e9180..beb47fd75 100644 --- a/elasticsearch/_async/client/features.py +++ b/elasticsearch/_async/client/features.py @@ -39,7 +39,7 @@ async def get_features( Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot - ``_ + ``_ """ __path = "/_features" __query: t.Dict[str, t.Any] = {} @@ -70,7 +70,7 @@ async def reset_features( """ Resets the internal state of features, usually by deleting system indices - ``_ + ``_ """ __path = "/_features/_reset" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_async/client/fleet.py b/elasticsearch/_async/client/fleet.py index 8b2cd7abf..ebf1ff014 100644 --- a/elasticsearch/_async/client/fleet.py +++ b/elasticsearch/_async/client/fleet.py @@ -44,7 +44,7 @@ async def global_checkpoints( Returns the current global checkpoints for an index. This API is design for internal use by the fleet server project. - ``_ + ``_ :param index: A single index or index alias that resolves to a single index. :param checkpoints: A comma separated list of previous global checkpoints. When diff --git a/elasticsearch/_async/client/graph.py b/elasticsearch/_async/client/graph.py index e1f21fe26..872341249 100644 --- a/elasticsearch/_async/client/graph.py +++ b/elasticsearch/_async/client/graph.py @@ -50,16 +50,20 @@ async def explore( Explore extracted and summarized information about the documents and terms in an index. - ``_ + ``_ - :param index: A comma-separated list of index names to search; use `_all` or - empty string to perform the operation on all indices - :param connections: - :param controls: - :param query: - :param routing: Specific routing value - :param timeout: Explicit operation timeout - :param vertices: + :param index: Name of the index. + :param connections: Specifies or more fields from which you want to extract terms + that are associated with the specified vertices. + :param controls: Direct the Graph API how to build the graph. + :param query: A seed query that identifies the documents of interest. Can be + any valid Elasticsearch query. + :param routing: Custom value used to route operations to a specific shard. + :param timeout: Specifies the period of time to wait for a response from each + shard. If no response is received before the timeout expires, the request + fails and returns an error. Defaults to no timeout. + :param vertices: Specifies one or more fields that contain the terms you want + to include in the graph as vertices. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") diff --git a/elasticsearch/_async/client/ilm.py b/elasticsearch/_async/client/ilm.py index cf25b495d..6b9f6484f 100644 --- a/elasticsearch/_async/client/ilm.py +++ b/elasticsearch/_async/client/ilm.py @@ -44,7 +44,7 @@ async def delete_lifecycle( Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. - ``_ + ``_ :param name: Identifier for the policy. :param master_timeout: Period to wait for a connection to the master node. If @@ -96,7 +96,7 @@ async def explain_lifecycle( Retrieves information about the index's current lifecycle state, such as the currently executing phase, action, and step. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to target. Supports wildcards (`*`). To target all data streams and indices, use `*` @@ -157,7 +157,7 @@ async def get_lifecycle( Returns the specified policy definition. Includes the policy version and last modified date. - ``_ + ``_ :param name: Identifier for the policy. :param master_timeout: Period to wait for a connection to the master node. If @@ -202,7 +202,7 @@ async def get_status( """ Retrieves the current index lifecycle management (ILM) status. - ``_ + ``_ """ __path = "/_ilm/status" __query: t.Dict[str, t.Any] = {} @@ -239,7 +239,7 @@ async def migrate_to_data_tiers( Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing - ``_ + ``_ :param dry_run: If true, simulates the migration from node attributes based allocation filters to data tiers, but does not perform the migration. This provides @@ -292,7 +292,7 @@ async def move_to_step( """ Manually moves an index into the specified step and executes that step. - ``_ + ``_ :param index: The name of the index whose lifecycle step is to change :param current_step: @@ -346,7 +346,7 @@ async def put_lifecycle( """ Creates a lifecycle policy - ``_ + ``_ :param name: Identifier for the policy. :param master_timeout: Period to wait for a connection to the master node. If @@ -399,7 +399,7 @@ async def remove_policy( """ Removes the assigned lifecycle policy and stops managing the specified index - ``_ + ``_ :param index: The name of the index to remove policy on """ @@ -435,7 +435,7 @@ async def retry( """ Retries executing the policy for an index that is in the ERROR step. - ``_ + ``_ :param index: The name of the indices (comma-separated) whose failed lifecycle step is to be retry @@ -475,7 +475,7 @@ async def start( """ Start the index lifecycle management (ILM) plugin. - ``_ + ``_ :param master_timeout: :param timeout: @@ -518,7 +518,7 @@ async def stop( Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin - ``_ + ``_ :param master_timeout: :param timeout: diff --git a/elasticsearch/_async/client/indices.py b/elasticsearch/_async/client/indices.py index a01b46244..c07a6cd87 100644 --- a/elasticsearch/_async/client/indices.py +++ b/elasticsearch/_async/client/indices.py @@ -64,7 +64,7 @@ async def add_block( """ Adds a block to an index. - ``_ + ``_ :param index: A comma separated list of indices to add a block to :param block: The block to add (one of read, write, read_only or metadata) @@ -144,18 +144,28 @@ async def analyze( Performs the analysis process on a text and return the tokens breakdown of the text. - ``_ - - :param index: The name of the index to scope the operation - :param analyzer: - :param attributes: - :param char_filter: - :param explain: - :param field: - :param filter: - :param normalizer: - :param text: - :param tokenizer: + ``_ + + :param index: Index used to derive the analyzer. If specified, the `analyzer` + or field parameter overrides this value. If no index is specified or the + index does not have a default analyzer, the analyze API uses the standard + analyzer. + :param analyzer: The name of the analyzer that should be applied to the provided + `text`. This could be a built-in analyzer, or an analyzer that’s been configured + in the index. + :param attributes: Array of token attributes used to filter the output of the + `explain` parameter. + :param char_filter: Array of character filters used to preprocess characters + before the tokenizer. + :param explain: If `true`, the response includes token attributes and additional + details. + :param field: Field used to derive the analyzer. To use this parameter, you must + specify an index. If specified, the `analyzer` parameter overrides this value. + :param filter: Array of token filters used to apply after the tokenizer. + :param normalizer: Normalizer to use to convert text into a single token. + :param text: Text to analyze. If an array of strings is provided, it is analyzed + as a multi-value field. + :param tokenizer: Tokenizer to use to convert text into tokens. """ if index not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_analyze" @@ -239,21 +249,26 @@ async def clear_cache( """ Clears all or specific caches for one or more indices. - ``_ + ``_ - :param index: A comma-separated list of index name to limit the operation - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param fielddata: Clear field data - :param fields: A comma-separated list of fields to clear when using the `fielddata` - parameter (default: all) - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param query: Clear query caches - :param request: Clear request cache + :param index: Comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param fielddata: If `true`, clears the fields cache. Use the `fields` parameter + to clear the cache of specific fields only. + :param fields: Comma-separated list of field names used to limit the `fielddata` + parameter. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param query: If `true`, clears the query cache. + :param request: If `true`, clears the request cache. """ if index not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_cache/clear" @@ -314,16 +329,20 @@ async def clone( """ Clones an index - ``_ + ``_ - :param index: The name of the source index to clone - :param target: The name of the target index to clone into - :param aliases: - :param master_timeout: Specify timeout for connection to master - :param settings: - :param timeout: Explicit operation timeout - :param wait_for_active_shards: Set the number of active shards to wait for on - the cloned index before the operation returns. + :param index: Name of the source index to clone. + :param target: Name of the target index to create. + :param aliases: Aliases for the resulting index. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param settings: Configuration options for the target index. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. + :param wait_for_active_shards: The number of shard copies that must be active + before proceeding with the operation. Set to `all` or any positive integer + up to the total number of shards in the index (`number_of_replicas+1`). """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -401,20 +420,27 @@ async def close( """ Closes an index. - ``_ + ``_ - :param index: A comma separated list of indices to close - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param master_timeout: Specify timeout for connection to master - :param timeout: Explicit operation timeout - :param wait_for_active_shards: Sets the number of active shards to wait for before - the operation returns. + :param index: Comma-separated list or wildcard expression of index names used + to limit the request. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. + :param wait_for_active_shards: The number of shard copies that must be active + before proceeding with the operation. Set to `all` or any positive integer + up to the total number of shards in the index (`number_of_replicas+1`). """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -472,17 +498,21 @@ async def create( """ Creates an index with optional settings and mappings. - ``_ + ``_ - :param index: The name of the index - :param aliases: + :param index: Name of the index you wish to create. + :param aliases: Aliases for the index. :param mappings: Mapping for fields in the index. If specified, this mapping can include: - Field names - Field data types - Mapping parameters - :param master_timeout: Specify timeout for connection to master - :param settings: - :param timeout: Explicit operation timeout - :param wait_for_active_shards: Set the number of active shards to wait for before - the operation returns. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param settings: Configuration options for the index. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. + :param wait_for_active_shards: The number of shard copies that must be active + before proceeding with the operation. Set to `all` or any positive integer + up to the total number of shards in the index (`number_of_replicas+1`). """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -533,9 +563,13 @@ async def create_data_stream( """ Creates a data stream - ``_ + ``_ - :param name: The name of the data stream + :param name: Name of the data stream, which must meet the following criteria: + Lowercase only; Cannot include `\\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, `,`, + `#`, `:`, or a space character; Cannot start with `-`, `_`, `+`, or `.ds-`; + Cannot be `.` or `..`; Cannot be longer than 255 bytes. Multi-byte characters + count towards this limit faster. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -587,11 +621,13 @@ async def data_streams_stats( """ Provides statistics on operations happening in a data stream. - ``_ + ``_ - :param name: A comma-separated list of data stream names; use `_all` or empty - string to perform the operation on all data streams - :param expand_wildcards: + :param name: Comma-separated list of data streams used to limit the request. + Wildcard expressions (`*`) are supported. To target all data streams in a + cluster, omit this parameter or use `*`. + :param expand_wildcards: Type of data stream that wildcard patterns can match. + Supports comma-separated values, such as `open,hidden`. """ if name not in SKIP_IN_PATH: __path = f"/_data_stream/{_quote(name)}/_stats" @@ -652,17 +688,26 @@ async def delete( """ Deletes an index. - ``_ + ``_ - :param index: A comma-separated list of indices to delete; use `_all` or `*` - string to delete all indices - :param allow_no_indices: Ignore if a wildcard expression resolves to no concrete - indices (default: false) - :param expand_wildcards: Whether wildcard expressions should get expanded to - open, closed, or hidden indices - :param ignore_unavailable: Ignore unavailable indexes (default: false) - :param master_timeout: Specify timeout for connection to master - :param timeout: Explicit operation timeout + :param index: Comma-separated list of indices to delete. You cannot specify index + aliases. By default, this parameter does not support wildcards (`*`) or `_all`. + To use wildcards or `_all`, set the `action.destructive_requires_name` cluster + setting to `false`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -711,14 +756,17 @@ async def delete_alias( """ Deletes an alias. - ``_ + ``_ - :param index: A comma-separated list of index names (supports wildcards); use - `_all` for all indices - :param name: A comma-separated list of aliases to delete (supports wildcards); - use `_all` to delete all aliases for the specified indices. - :param master_timeout: Specify timeout for connection to master - :param timeout: Explicit timestamp for the document + :param index: Comma-separated list of data streams or indices used to limit the + request. Supports wildcards (`*`). + :param name: Comma-separated list of aliases to remove. Supports wildcards (`*`). + To remove all aliases, use `*` or `_all`. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -780,7 +828,7 @@ async def delete_data_lifecycle( """ Deletes the data lifecycle of the selected data streams. - ``_ + ``_ :param name: A comma-separated list of data streams of which the data lifecycle will be deleted; use `*` to get all data streams @@ -845,12 +893,12 @@ async def delete_data_stream( """ Deletes a data stream. - ``_ + ``_ - :param name: A comma-separated list of data streams to delete; use `*` to delete - all data streams - :param expand_wildcards: Whether wildcard expressions should get expanded to - open or closed indices (default: open) + :param name: Comma-separated list of data streams to delete. Wildcard (`*`) expressions + are supported. + :param expand_wildcards: Type of data stream that wildcard patterns can match. + Supports comma-separated values,such as `open,hidden`. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -890,7 +938,7 @@ async def delete_index_template( """ Deletes an index template. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. @@ -940,11 +988,15 @@ async def delete_template( """ Deletes an index template. - ``_ + ``_ - :param name: The name of the template - :param master_timeout: Specify timeout for connection to master - :param timeout: Explicit operation timeout + :param name: The name of the legacy index template to delete. Wildcard (`*`) + expressions are supported. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -1004,27 +1056,27 @@ async def disk_usage( """ Analyzes the disk usage of each field of an index or data stream - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. It’s recommended to execute this API with a single index (or the latest backing index of a data stream) as the API consumes resources significantly. :param allow_no_indices: If false, the request returns an error if any wildcard - expression, index alias, or _all value targets only missing or closed indices. + expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For - example, a request targeting foo*,bar* returns an error if an index starts - with foo but no index starts with bar. + example, a request targeting `foo*,bar*` returns an error if an index starts + with `foo` but no index starts with `bar`. :param expand_wildcards: Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such - as open,hidden. - :param flush: If true, the API performs a flush before analysis. If false, the - response may not include uncommitted data. - :param ignore_unavailable: If true, missing or closed indices are not included + as `open,hidden`. + :param flush: If `true`, the API performs a flush before analysis. If `false`, + the response may not include uncommitted data. + :param ignore_unavailable: If `true`, missing or closed indices are not included in the response. :param run_expensive_tasks: Analyzing field disk usage is resource-intensive. - To use the API, this parameter must be set to true. + To use the API, this parameter must be set to `true`. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -1072,10 +1124,10 @@ async def downsample( """ Downsample an index - ``_ + ``_ - :param index: The index to downsample - :param target_index: The name of the target index to store downsampled data + :param index: Name of the time series index to downsample. + :param target_index: Name of the index to create. :param config: """ if index in SKIP_IN_PATH: @@ -1138,19 +1190,23 @@ async def exists( """ Returns information about whether a particular index exists. - ``_ + ``_ - :param index: A comma-separated list of index names - :param allow_no_indices: Ignore if a wildcard expression resolves to no concrete - indices (default: false) - :param expand_wildcards: Whether wildcard expressions should get expanded to - open or closed indices (default: open) - :param flat_settings: Return settings in flat format (default: false) - :param ignore_unavailable: Ignore unavailable indexes (default: false) - :param include_defaults: Whether to return all default setting for each of the - indices. - :param local: Return local information, do not retrieve the state from master - node (default: false) + :param index: Comma-separated list of data streams, indices, and aliases. Supports + wildcards (`*`). + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param flat_settings: If `true`, returns settings in flat format. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param include_defaults: If `true`, return all default settings in the response. + :param local: If `true`, the request retrieves information from the local node + only. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -1218,19 +1274,23 @@ async def exists_alias( """ Returns information about whether a particular alias exists. - ``_ + ``_ - :param name: A comma-separated list of alias names to return - :param index: A comma-separated list of index names to filter aliases - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param local: Return local information, do not retrieve the state from master - node (default: false) + :param name: Comma-separated list of aliases to check. Supports wildcards (`*`). + :param index: Comma-separated list of data streams or indices used to limit the + request. Supports wildcards (`*`). To target all data streams and indices, + omit this parameter or use `*` or `_all`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, requests that include a missing data stream + or index in the target indices or data streams return an error. + :param local: If `true`, the request retrieves information from the local node + only. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -1280,7 +1340,7 @@ async def exists_index_template( """ Returns information about whether a particular index template exists. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. @@ -1327,7 +1387,7 @@ async def exists_template( """ Returns information about whether a particular index template exists. - ``_ + ``_ :param name: The comma separated names of the index templates :param flat_settings: Return settings in flat format (default: false) @@ -1378,7 +1438,7 @@ async def explain_data_lifecycle( Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc. - ``_ + ``_ :param index: The name of the index to explain :param include_defaults: indicates if the API should return the default values @@ -1451,12 +1511,12 @@ async def field_usage_stats( """ Returns the field usage stats for each field of an index - ``_ + ``_ :param index: Comma-separated list or wildcard expression of index names used to limit the request. - :param allow_no_indices: If false, the request returns an error if any wildcard - expression, index alias, or _all value targets only missing or closed indices. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. @@ -1466,7 +1526,7 @@ async def field_usage_stats( as `open,hidden`. :param fields: Comma-separated list or wildcard expressions of fields to include in the statistics. - :param ignore_unavailable: If true, missing or closed indices are not included + :param ignore_unavailable: If `true`, missing or closed indices are not included in the response. :param master_timeout: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and @@ -1545,25 +1605,25 @@ async def flush( """ Performs the flush operation on one or more indices. - ``_ + ``_ - :param index: A comma-separated list of index names; use `_all` or empty string - for all indices - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param 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) - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param 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. + :param index: Comma-separated list of data streams, indices, and aliases to flush. + Supports wildcards (`*`). To flush all data streams and indices, omit this + parameter or use `*` or `_all`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param force: If `true`, the request forces a flush even if there are no changes + to commit to the index. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param wait_if_ongoing: If `true`, the flush operation blocks until execution + when another flush operation is running. If `false`, Elasticsearch returns + an error if you request a flush when another flush operation is running. """ if index not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_flush" @@ -1632,7 +1692,7 @@ async def forcemerge( """ Performs the force merge operation on one or more indices. - ``_ + ``_ :param index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -1739,7 +1799,7 @@ async def get( """ Returns information about one or more indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. @@ -1834,19 +1894,24 @@ async def get_alias( """ Returns an alias. - ``_ + ``_ - :param index: A comma-separated list of index names to filter aliases - :param name: A comma-separated list of alias names to return - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param local: Return local information, do not retrieve the state from master - node (default: false) + :param index: Comma-separated list of data streams or indices used to limit the + request. Supports wildcards (`*`). To target all data streams and indices, + omit this parameter or use `*` or `_all`. + :param name: Comma-separated list of aliases to retrieve. Supports wildcards + (`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param local: If `true`, the request retrieves information from the local node + only. """ if index not in SKIP_IN_PATH and name not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_alias/{_quote(name)}" @@ -1912,14 +1977,15 @@ async def get_data_lifecycle( """ Returns the data lifecycle of the selected data streams. - ``_ + ``_ - :param name: A comma-separated list of data streams to get; use `*` to get all - data streams - :param expand_wildcards: Whether wildcard expressions should get expanded to - open or closed indices (default: open) - :param include_defaults: Return all relevant default configurations for the data - stream (default: false) + :param name: Comma-separated list of data streams to limit the request. Supports + wildcards (`*`). To target all data streams, omit this parameter or use `*` + or `_all`. + :param expand_wildcards: Type of data stream that wildcard patterns can match. + Supports comma-separated values, such as `open,hidden`. Valid values are: + `all`, `open`, `closed`, `hidden`, `none`. + :param include_defaults: If `true`, return all default settings in the response. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -1976,12 +2042,13 @@ async def get_data_stream( """ Returns data streams. - ``_ + ``_ - :param name: A comma-separated list of data streams to get; use `*` to get all - data streams - :param expand_wildcards: Whether wildcard expressions should get expanded to - open or closed indices (default: open) + :param name: Comma-separated list of data stream names used to limit the request. + Wildcard (`*`) expressions are supported. If omitted, all data streams are + returned. + :param expand_wildcards: Type of data stream that wildcard patterns can match. + Supports comma-separated values, such as `open,hidden`. :param include_defaults: If true, returns all relevant default configurations for the index template. """ @@ -2045,21 +2112,25 @@ async def get_field_mapping( """ Returns mapping for one or more fields. - ``_ + ``_ - :param fields: A comma-separated list of fields - :param index: A comma-separated list of index names - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param include_defaults: Whether the default mapping values should be returned - as well - :param local: Return local information, do not retrieve the state from master - node (default: false) + :param fields: Comma-separated list or wildcard expression of fields used to + limit returned information. + :param index: Comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param include_defaults: If `true`, return all default settings in the response. + :param local: If `true`, the request retrieves information from the local node + only. """ if fields in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'fields'") @@ -2114,7 +2185,7 @@ async def get_index_template( """ Returns an index template. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. @@ -2193,19 +2264,25 @@ async def get_mapping( """ Returns mappings for one or more indices. - ``_ + ``_ - :param index: A comma-separated list of index names - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param local: Return local information, do not retrieve the state from master - node (default: false) - :param master_timeout: Specify timeout for connection to master + :param index: Comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param local: If `true`, the request retrieves information from the local node + only. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. """ if index not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_mapping" @@ -2277,24 +2354,30 @@ async def get_settings( """ Returns settings for one or more indices. - ``_ + ``_ - :param index: A comma-separated list of index names; use `_all` or empty string - to perform the operation on all indices - :param name: The name of the settings that should be included - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param flat_settings: Return settings in flat format (default: false) - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param include_defaults: Whether to return all default setting for each of the - indices. - :param local: Return local information, do not retrieve the state from master - node (default: false) - :param master_timeout: Specify timeout for connection to master + :param index: Comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param name: Comma-separated list or wildcard expression of settings to retrieve. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. For + example, a request targeting `foo*,bar*` returns an error if an index starts + with foo but no index starts with `bar`. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. + :param flat_settings: If `true`, returns settings in flat format. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param include_defaults: If `true`, return all default settings in the response. + :param local: If `true`, the request retrieves information from the local node + only. If `false`, information is retrieved from the master node. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. """ if index not in SKIP_IN_PATH and name not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_settings/{_quote(name)}" @@ -2352,13 +2435,17 @@ async def get_template( """ Returns an index template. - ``_ + ``_ - :param name: The comma separated names of the index templates - :param flat_settings: Return settings in flat format (default: false) - :param local: Return local information, do not retrieve the state from master - node (default: false) - :param master_timeout: Explicit operation timeout for connection to master node + :param name: Comma-separated list of index template names used to limit the request. + Wildcard (`*`) expressions are supported. To return all index templates, + omit this parameter or use a value of `_all` or `*`. + :param flat_settings: If `true`, returns settings in flat format. + :param local: If `true`, the request retrieves information from the local node + only. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. """ if name not in SKIP_IN_PATH: __path = f"/_template/{_quote(name)}" @@ -2399,9 +2486,9 @@ async def migrate_to_data_stream( """ Migrates an alias to a data stream - ``_ + ``_ - :param name: The name of the alias to migrate + :param name: Name of the index alias to convert to a data stream. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -2439,7 +2526,7 @@ async def modify_data_stream( """ Modifies a data stream - ``_ + ``_ :param actions: Actions to perform. """ @@ -2505,20 +2592,31 @@ async def open( """ Opens an index. - ``_ + ``_ - :param index: A comma separated list of indices to open - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param master_timeout: Specify timeout for connection to master - :param timeout: Explicit operation timeout - :param wait_for_active_shards: Sets the number of active shards to wait for before - the operation returns. + :param index: Comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). By default, you must explicitly + name the indices you using to limit the request. To limit a request using + `_all`, `*`, or other wildcard expressions, change the `action.destructive_requires_name` + setting to false. You can update this setting in the `elasticsearch.yml` + file or using the cluster update settings API. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. + :param wait_for_active_shards: The number of shard copies that must be active + before proceeding with the operation. Set to `all` or any positive integer + up to the total number of shards in the index (`number_of_replicas+1`). """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -2565,7 +2663,7 @@ async def promote_data_stream( Promotes a data stream from a replicated data stream managed by CCR to a regular data stream - ``_ + ``_ :param name: The name of the data stream """ @@ -2613,18 +2711,33 @@ async def put_alias( """ Creates or updates an alias. - ``_ - - :param index: A comma-separated list of index names the alias should point to - (supports wildcards); use `_all` to perform the operation on all indices. - :param name: The name of the alias to be created or updated - :param filter: - :param index_routing: - :param is_write_index: - :param master_timeout: Specify timeout for connection to master - :param routing: - :param search_routing: - :param timeout: Explicit timestamp for the document + ``_ + + :param index: Comma-separated list of data streams or indices to add. Supports + wildcards (`*`). Wildcard patterns that match both data streams and indices + return an error. + :param name: Alias to update. If the alias doesn’t exist, the request creates + it. Index alias names support date math. + :param filter: Query used to limit documents the alias can access. + :param index_routing: Value used to route indexing operations to a specific shard. + If specified, this overwrites the `routing` value for indexing operations. + Data stream aliases don’t support this parameter. + :param is_write_index: If `true`, sets the write index or data stream for the + alias. If an alias points to multiple indices or data streams and `is_write_index` + isn’t set, the alias rejects write requests. If an index alias points to + one index and `is_write_index` isn’t set, the index automatically acts as + the write index. Data stream aliases don’t automatically set a write data + stream, even if the alias points to one data stream. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param routing: Value used to route indexing and search operations to a specific + shard. Data stream aliases don’t support this parameter. + :param search_routing: Value used to route search operations to a specific shard. + If specified, this overwrites the `routing` value for search operations. + Data stream aliases don’t support this parameter. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -2706,15 +2819,22 @@ async def put_data_lifecycle( """ Updates the data lifecycle of the selected data streams. - ``_ - - :param name: A comma-separated list of data streams whose lifecycle will be updated; - use `*` to set the lifecycle to all data streams - :param data_retention: - :param expand_wildcards: Whether wildcard expressions should get expanded to - open or closed indices (default: open) - :param master_timeout: Specify timeout for connection to master - :param timeout: Explicit timestamp for the document + ``_ + + :param name: Comma-separated list of data streams used to limit the request. + Supports wildcards (`*`). To target all data streams use `*` or `_all`. + :param data_retention: If defined, every document added to this data stream will + be stored at least for this time frame. Any time after this duration the + document could be deleted. When empty, every document in this data stream + will be stored indefinitely. + :param expand_wildcards: Type of data stream that wildcard patterns can match. + Supports comma-separated values, such as `open,hidden`. Valid values are: + `all`, `hidden`, `open`, `closed`, `none`. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -2774,18 +2894,29 @@ async def put_index_template( """ Creates or updates an index template. - ``_ + ``_ :param name: Index or template name - :param composed_of: - :param create: Whether the index template should only be added if new or can - also replace an existing one - :param data_stream: - :param index_patterns: - :param meta: - :param priority: - :param template: - :param version: + :param composed_of: An ordered list of component template names. Component templates + are merged in the order specified, meaning that the last component template + specified has the highest precedence. + :param create: If `true`, this request cannot replace or update existing index + templates. + :param data_stream: If this object is included, the template is used to create + data streams and their backing indices. Supports an empty object. Data streams + require a matching index template with a `data_stream` object. + :param index_patterns: Name of the index template to create. + :param meta: Optional user metadata about the index template. May have any contents. + This map is not automatically generated by Elasticsearch. + :param priority: Priority to determine index template precedence when a new data + stream or index is created. The index template with the highest priority + is chosen. If no priority is specified the template is treated as though + it is of priority 0 (lowest priority). This number is not automatically generated + by Elasticsearch. + :param template: Template to be applied. It may optionally include an `aliases`, + `mappings`, or `settings` configuration. + :param version: Version number used to manage index templates externally. This + number is not automatically generated by Elasticsearch. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -2892,25 +3023,29 @@ async def put_mapping( """ Updates the index mappings. - ``_ + ``_ :param index: A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. - :param 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) + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. :param date_detection: Controls whether dynamic date detection is enabled. :param dynamic: Controls whether new fields are added dynamically. :param dynamic_date_formats: If date detection is enabled then new string fields are checked against 'dynamic_date_formats' and if the value matches then a new date field is added instead of string. :param dynamic_templates: Specify dynamic templates for the mapping. - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. :param field_names: Control whether field names are enabled for the index. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param master_timeout: Specify timeout for connection to master + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. :param meta: A mapping type can have custom meta data associated with it. These are not used at all by Elasticsearch, but can be used to store application-specific metadata. @@ -2921,9 +3056,10 @@ async def put_mapping( :param routing: Enable making a routing value required on indexed documents. :param runtime: Mapping of runtime fields for the index. :param source: Control whether the _source field is enabled on the index. - :param timeout: Explicit operation timeout - :param write_index_only: When true, applies mappings only to the write index - of an alias or data stream + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. + :param write_index_only: If `true`, the mappings are applied only to the current + write index for the target. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -3021,23 +3157,29 @@ async def put_settings( """ Updates the index settings. - ``_ + ``_ :param settings: - :param index: A comma-separated list of index names; use `_all` or empty string - to perform the operation on all indices - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param flat_settings: Return settings in flat format (default: false) - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param master_timeout: Specify timeout for connection to master - :param preserve_existing: Whether to update existing settings. If set to `true` - existing settings on an index remain unchanged, the default is `false` - :param timeout: Explicit operation timeout + :param index: Comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. For + example, a request targeting `foo*,bar*` returns an error if an index starts + with `foo` but no index starts with `bar`. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. + :param flat_settings: If `true`, returns settings in flat format. + :param ignore_unavailable: If `true`, returns settings in flat format. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param preserve_existing: If `true`, existing index settings remain unchanged. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ if settings is None: raise ValueError("Empty value passed for parameter 'settings'") @@ -3105,13 +3247,13 @@ async def put_template( """ Creates or updates an index template. - ``_ + ``_ :param name: The name of the template :param aliases: Aliases for the index. :param create: If true, this request cannot replace or update existing index templates. - :param flat_settings: + :param flat_settings: If `true`, returns settings in flat format. :param index_patterns: Array of wildcard expressions used to match the names of indices during creation. :param mappings: Mapping for fields in the index. @@ -3123,7 +3265,8 @@ async def put_template( Templates with higher 'order' values are merged later, overriding templates with lower values. :param settings: Configuration options for the index. - :param timeout: + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. :param version: Version number used to manage index templates externally. This number is not automatically generated by Elasticsearch. """ @@ -3182,12 +3325,14 @@ async def recovery( """ Returns information about ongoing index shard recoveries. - ``_ + ``_ - :param index: A comma-separated list of index names; use `_all` or empty string - to perform the operation on all indices - :param active_only: Display only those recoveries that are currently on-going - :param detailed: Whether to display detailed information about shard recovery + :param index: Comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param active_only: If `true`, the response only includes ongoing shard recoveries. + :param detailed: If `true`, the response includes detailed information about + shard recoveries. """ if index not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_recovery" @@ -3246,17 +3391,20 @@ async def refresh( """ Performs the refresh operation in one or more indices. - ``_ + ``_ - :param index: A comma-separated list of index names; use `_all` or empty string - to perform the operation on all indices - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) + :param index: Comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. """ if index not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_refresh" @@ -3317,7 +3465,7 @@ async def reload_search_analyzers( """ Reloads an index's search analyzers and their resources. - ``_ + ``_ :param index: A comma-separated list of index names to reload analyzers for :param allow_no_indices: Whether to ignore if a wildcard indices expression resolves @@ -3384,11 +3532,15 @@ async def resolve_index( """ Returns information about any matching indices, aliases, and data streams - ``_ + ``_ - :param name: A comma-separated list of names or wildcard expressions - :param expand_wildcards: Whether wildcard expressions should get expanded to - open or closed indices (default: open) + :param name: Comma-separated name(s) or index pattern(s) of the indices, aliases, + and data streams to resolve. Resources on remote clusters can be specified + using the ``:`` syntax. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -3440,20 +3592,33 @@ async def rollover( Updates an alias to point to a new index when the existing index is considered to be too large or too old. - ``_ - - :param alias: The name of the alias to rollover - :param new_index: The name of the rollover index - :param aliases: - :param conditions: - :param 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 - :param mappings: - :param master_timeout: Specify timeout for connection to master - :param settings: - :param timeout: Explicit operation timeout - :param wait_for_active_shards: Set the number of active shards to wait for on - the newly created rollover index before the operation returns. + ``_ + + :param alias: Name of the data stream or index alias to roll over. + :param new_index: Name of the index to create. Supports date math. Data streams + do not support this parameter. + :param aliases: Aliases for the target index. Data streams do not support this + parameter. + :param conditions: Conditions for the rollover. If specified, Elasticsearch only + performs the rollover if the current index satisfies these conditions. If + this parameter is not specified, Elasticsearch performs the rollover unconditionally. + If conditions are specified, at least one of them must be a `max_*` condition. + The index will rollover if any `max_*` condition is satisfied and all `min_*` + conditions are satisfied. + :param dry_run: If `true`, checks whether the current index satisfies the specified + conditions but does not perform a rollover. + :param mappings: Mapping for fields in the index. If specified, this mapping + can include field names, field data types, and mapping paramaters. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param settings: Configuration options for the index. Data streams do not support + this parameter. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. + :param wait_for_active_shards: The number of shard copies that must be active + before proceeding with the operation. Set to all or any positive integer + up to the total number of shards in the index (`number_of_replicas+1`). """ if alias in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'alias'") @@ -3534,18 +3699,21 @@ async def segments( """ Provides low-level information about segments in a Lucene index. - ``_ + ``_ - :param index: A comma-separated list of index names; use `_all` or empty string - to perform the operation on all indices - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param verbose: Includes detailed memory usage by Lucene. + :param index: Comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param verbose: If `true`, the request returns a verbose response. """ if index not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_segments" @@ -3619,7 +3787,7 @@ async def shard_stores( """ Provides store information for shard copies of indices. - ``_ + ``_ :param index: List of data streams, indices, and aliases used to limit the request. :param allow_no_indices: If false, the request returns an error if any wildcard @@ -3685,16 +3853,20 @@ async def shrink( """ Allow to shrink an existing index into a new index with fewer primary shards. - ``_ + ``_ - :param index: The name of the source index to shrink - :param target: The name of the target index to shrink into - :param aliases: - :param master_timeout: Specify timeout for connection to master - :param settings: - :param timeout: Explicit operation timeout - :param wait_for_active_shards: Set the number of active shards to wait for on - the shrunken index before the operation returns. + :param index: Name of the source index to shrink. + :param target: Name of the target index to create. + :param aliases: The key is the alias name. Index alias names support date math. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param settings: Configuration options for the target index. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. + :param wait_for_active_shards: The number of shard copies that must be active + before proceeding with the operation. Set to `all` or any positive integer + up to the total number of shards in the index (`number_of_replicas+1`). """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -3763,26 +3935,43 @@ async def simulate_index_template( """ Simulate matching the given index name against the index templates in the system - ``_ + ``_ :param name: Index or template name to simulate - :param allow_auto_create: - :param composed_of: + :param allow_auto_create: This setting overrides the value of the `action.auto_create_index` + cluster setting. If set to `true` in a template, then indices can be automatically + created using that template even if auto-creation of indices is disabled + via `actions.auto_create_index`. If set to `false`, then indices or data + streams matching the template must always be explicitly created, and may + never be automatically created. + :param composed_of: An ordered list of component template names. Component templates + are merged in the order specified, meaning that the last component template + specified has the highest precedence. :param create: If `true`, the template passed in the body is only used if no existing templates match the same index patterns. If `false`, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation. - :param data_stream: + :param data_stream: If this object is included, the template is used to create + data streams and their backing indices. Supports an empty object. Data streams + require a matching index template with a `data_stream` object. :param include_defaults: If true, returns all relevant default configurations for the index template. - :param index_patterns: + :param index_patterns: Array of wildcard (`*`) expressions used to match the + names of data streams and indices during creation. :param master_timeout: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. - :param meta: - :param priority: - :param template: - :param version: + :param meta: Optional user metadata about the index template. May have any contents. + This map is not automatically generated by Elasticsearch. + :param priority: Priority to determine index template precedence when a new data + stream or index is created. The index template with the highest priority + is chosen. If no priority is specified the template is treated as though + it is of priority 0 (lowest priority). This number is not automatically generated + by Elasticsearch. + :param template: Template to be applied. It may optionally include an `aliases`, + `mappings`, or `settings` configuration. + :param version: Version number used to manage index templates externally. This + number is not automatically generated by Elasticsearch. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -3851,7 +4040,7 @@ async def simulate_template( """ Simulate resolving the given template name or body - ``_ + ``_ :param name: Name of the index template to simulate. To test a template configuration before you add it to the cluster, omit this parameter and specify the template @@ -3923,16 +4112,20 @@ async def split( """ Allows you to split an existing index into a new index with more primary shards. - ``_ + ``_ - :param index: The name of the source index to split - :param target: The name of the target index to split into - :param aliases: - :param master_timeout: Specify timeout for connection to master - :param settings: - :param timeout: Explicit operation timeout - :param wait_for_active_shards: Set the number of active shards to wait for on - the shrunken index before the operation returns. + :param index: Name of the source index to split. + :param target: Name of the target index to create. + :param aliases: Aliases for the resulting index. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param settings: Configuration options for the target index. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. + :param wait_for_active_shards: The number of shard copies that must be active + before proceeding with the operation. Set to `all` or any positive integer + up to the total number of shards in the index (`number_of_replicas+1`). """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -4022,7 +4215,7 @@ async def stats( """ Provides statistics on operations happening in an index. - ``_ + ``_ :param index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -4130,20 +4323,26 @@ async def unfreeze( Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again. - ``_ + ``_ - :param index: The name of the index to unfreeze - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param master_timeout: Specify timeout for connection to master - :param timeout: Explicit operation timeout - :param wait_for_active_shards: Sets the number of active shards to wait for before - the operation returns. + :param index: Identifier for the index. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. + :param wait_for_active_shards: The number of shard copies that must be active + before proceeding with the operation. Set to `all` or any positive integer + up to the total number of shards in the index (`number_of_replicas+1`). """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -4197,11 +4396,14 @@ async def update_aliases( """ Updates index aliases. - ``_ + ``_ - :param actions: - :param master_timeout: Specify timeout for connection to master - :param timeout: Request timeout + :param actions: Actions to perform. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ __path = "/_aliases" __body: t.Dict[str, t.Any] = {} @@ -4272,33 +4474,38 @@ async def validate_query( """ Allows a user to validate a potentially expensive query without executing it. - ``_ + ``_ - :param index: A comma-separated list of index names to restrict the operation; - use `_all` or empty string to perform the operation on all indices - :param all_shards: Execute validation on all shards instead of one random shard - per index - :param 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) - :param analyze_wildcard: Specify whether wildcard and prefix queries should be - analyzed (default: false) - :param analyzer: The analyzer to use for the query string - :param default_operator: The default operator for query string query (AND or - OR) - :param df: The field to use as default where no field prefix is given in the - query string - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param explain: Return detailed information about the error - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param lenient: Specify whether format-based query failures (such as providing - text to a numeric field) should be ignored - :param q: Query in the Lucene query string syntax - :param query: - :param rewrite: Provide a more detailed explanation showing the actual Lucene - query that will be executed. + :param index: Comma-separated list of data streams, indices, and aliases to search. + Supports wildcards (`*`). To search all data streams or indices, omit this + parameter or use `*` or `_all`. + :param all_shards: If `true`, the validation is executed on all shards instead + of one random shard per index. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param analyze_wildcard: If `true`, wildcard and prefix queries are analyzed. + :param analyzer: Analyzer to use for the query string. This parameter can only + be used when the `q` query string parameter is specified. + :param default_operator: The default operator for query string query: `AND` or + `OR`. + :param df: Field to use as default where no field prefix is given in the query + string. This parameter can only be used when the `q` query string parameter + is specified. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param explain: If `true`, the response returns detailed information if an error + has occurred. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param lenient: If `true`, format-based query failures (such as providing text + to a numeric field) in the query string will be ignored. + :param q: Query in the Lucene query string syntax. + :param query: Query in the Lucene query string syntax. + :param rewrite: If `true`, returns a more detailed explanation showing the actual + Lucene query that will be executed. """ if index not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_validate/query" diff --git a/elasticsearch/_async/client/ingest.py b/elasticsearch/_async/client/ingest.py index d3cbebe90..6479bfaaa 100644 --- a/elasticsearch/_async/client/ingest.py +++ b/elasticsearch/_async/client/ingest.py @@ -43,11 +43,15 @@ async def delete_pipeline( """ Deletes a pipeline. - ``_ + ``_ - :param id: Pipeline ID - :param master_timeout: Explicit operation timeout for connection to master node - :param timeout: Explicit operation timeout + :param id: Pipeline ID or wildcard expression of pipeline IDs used to limit the + request. To delete all ingest pipelines in a cluster, use a value of `*`. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") @@ -84,7 +88,7 @@ async def geo_ip_stats( """ Returns statistical information about geoip databases - ``_ + ``_ """ __path = "/_ingest/geoip/stats" __query: t.Dict[str, t.Any] = {} @@ -120,10 +124,13 @@ async def get_pipeline( """ Returns a pipeline. - ``_ + ``_ - :param id: Comma separated list of pipeline ids. Wildcards supported - :param master_timeout: Explicit operation timeout for connection to master node + :param id: Comma-separated list of pipeline IDs to retrieve. Wildcard (`*`) expressions + are supported. To get all ingest pipelines, omit this parameter or use `*`. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. :param summary: Return pipelines without their definitions (default: false) """ if id not in SKIP_IN_PATH: @@ -162,7 +169,7 @@ async def processor_grok( """ Returns a list of the built-in patterns. - ``_ + ``_ """ __path = "/_ingest/processor/grok" __query: t.Dict[str, t.Any] = {} @@ -211,7 +218,7 @@ async def put_pipeline( """ Creates or updates a pipeline. - ``_ + ``_ :param id: ID of the ingest pipeline to create or update. :param description: Description of the ingest pipeline. @@ -292,13 +299,16 @@ async def simulate( """ Allows to simulate a pipeline with example documents. - ``_ + ``_ - :param id: Pipeline ID - :param docs: - :param pipeline: - :param verbose: Verbose mode. Display data output for each processor in executed - pipeline + :param id: Pipeline to test. If you don’t specify a `pipeline` in the request + body, this parameter is required. + :param docs: Sample documents to test in the pipeline. + :param pipeline: Pipeline to test. If you don’t specify the `pipeline` request + path parameter, this parameter is required. If you specify both this and + the request path parameter, the API only uses the request path parameter. + :param verbose: If `true`, the response includes output data for each processor + in the executed pipeline. """ if id not in SKIP_IN_PATH: __path = f"/_ingest/pipeline/{_quote(id)}/_simulate" diff --git a/elasticsearch/_async/client/license.py b/elasticsearch/_async/client/license.py index b8f9ec57e..64de833d0 100644 --- a/elasticsearch/_async/client/license.py +++ b/elasticsearch/_async/client/license.py @@ -38,7 +38,7 @@ async def delete( """ Deletes licensing information for the cluster - ``_ + ``_ """ __path = "/_license" __query: t.Dict[str, t.Any] = {} @@ -71,7 +71,7 @@ async def get( """ Retrieves licensing information for the cluster - ``_ + ``_ :param accept_enterprise: If `true`, this parameter returns enterprise for Enterprise license types. If `false`, this parameter returns platinum for both platinum @@ -113,7 +113,7 @@ async def get_basic_status( """ Retrieves information about the status of the basic license. - ``_ + ``_ """ __path = "/_license/basic_status" __query: t.Dict[str, t.Any] = {} @@ -144,7 +144,7 @@ async def get_trial_status( """ Retrieves information about the status of the trial license. - ``_ + ``_ """ __path = "/_license/trial_status" __query: t.Dict[str, t.Any] = {} @@ -182,7 +182,7 @@ async def post( """ Updates the license for the cluster. - ``_ + ``_ :param acknowledge: Specifies whether you acknowledge the license changes. :param license: @@ -230,7 +230,7 @@ async def post_start_basic( """ Starts an indefinite basic license. - ``_ + ``_ :param acknowledge: whether the user has acknowledged acknowledge messages (default: false) @@ -268,7 +268,7 @@ async def post_start_trial( """ starts a limited time trial license. - ``_ + ``_ :param acknowledge: whether the user has acknowledged acknowledge messages (default: false) diff --git a/elasticsearch/_async/client/logstash.py b/elasticsearch/_async/client/logstash.py index db2206418..472828411 100644 --- a/elasticsearch/_async/client/logstash.py +++ b/elasticsearch/_async/client/logstash.py @@ -39,9 +39,9 @@ async def delete_pipeline( """ Deletes Logstash Pipelines used by Central Management - ``_ + ``_ - :param id: The ID of the Pipeline + :param id: Identifier for the pipeline. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") @@ -75,9 +75,9 @@ async def get_pipeline( """ Retrieves Logstash Pipelines used by Central Management - ``_ + ``_ - :param id: A comma-separated list of Pipeline IDs + :param id: Comma-separated list of pipeline identifiers. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") @@ -117,9 +117,9 @@ async def put_pipeline( """ Adds and updates Logstash Pipelines used for Central Management - ``_ + ``_ - :param id: The ID of the Pipeline + :param id: Identifier for the pipeline. :param pipeline: """ if id in SKIP_IN_PATH: diff --git a/elasticsearch/_async/client/migration.py b/elasticsearch/_async/client/migration.py index 57e83483a..2f0249792 100644 --- a/elasticsearch/_async/client/migration.py +++ b/elasticsearch/_async/client/migration.py @@ -41,7 +41,7 @@ async def deprecations( that use deprecated features that will be removed or changed in the next major version. - ``_ + ``_ :param index: Comma-separate list of data streams or indices to check. Wildcard (*) expressions are supported. @@ -78,7 +78,7 @@ async def get_feature_upgrade_status( """ Find out whether system features need to be upgraded or not - ``_ + ``_ """ __path = "/_migration/system_features" __query: t.Dict[str, t.Any] = {} @@ -109,7 +109,7 @@ async def post_feature_upgrade( """ Begin upgrades for system features - ``_ + ``_ """ __path = "/_migration/system_features" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_async/client/ml.py b/elasticsearch/_async/client/ml.py index 262240b69..1de627e89 100644 --- a/elasticsearch/_async/client/ml.py +++ b/elasticsearch/_async/client/ml.py @@ -39,7 +39,7 @@ async def clear_trained_model_deployment_cache( """ Clear the cached results from a trained model deployment - ``_ + ``_ :param model_id: The unique identifier of the trained model. """ @@ -81,7 +81,7 @@ async def close_job( Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. You can close multiple anomaly detection @@ -136,7 +136,7 @@ async def delete_calendar( """ Deletes a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. """ @@ -173,7 +173,7 @@ async def delete_calendar_event( """ Deletes scheduled events from a calendar. - ``_ + ``_ :param calendar_id: The ID of the calendar to modify :param event_id: The ID of the event to remove from the calendar @@ -213,7 +213,7 @@ async def delete_calendar_job( """ Deletes anomaly detection jobs from a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. :param job_id: An identifier for the anomaly detection jobs. It can be a job @@ -255,7 +255,7 @@ async def delete_data_frame_analytics( """ Deletes an existing data frame analytics job. - ``_ + ``_ :param id: Identifier for the data frame analytics job. :param force: If `true`, it deletes a job that is not stopped; this method is @@ -299,7 +299,7 @@ async def delete_datafeed( """ Deletes an existing datafeed. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -346,7 +346,7 @@ async def delete_expired_data( """ Deletes expired and unused machine learning data. - ``_ + ``_ :param job_id: Identifier for an anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. @@ -397,7 +397,7 @@ async def delete_filter( """ Deletes a filter. - ``_ + ``_ :param filter_id: A string that uniquely identifies a filter. """ @@ -436,7 +436,7 @@ async def delete_forecast( """ Deletes forecasts from a machine learning job. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param forecast_id: A comma-separated list of forecast identifiers. If you do @@ -494,7 +494,7 @@ async def delete_job( """ Deletes an existing anomaly detection job. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param delete_user_annotations: Specifies whether annotations that have been @@ -544,7 +544,7 @@ async def delete_model_snapshot( """ Deletes an existing model snapshot. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: Identifier for the model snapshot. @@ -585,7 +585,7 @@ async def delete_trained_model( Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param force: Forcefully deletes a trained model that is referenced by ingest @@ -626,7 +626,7 @@ async def delete_trained_model_alias( """ Deletes a model alias that refers to the trained model - ``_ + ``_ :param model_id: The trained model ID to which the model alias refers. :param model_alias: The model alias to delete. @@ -669,7 +669,7 @@ async def estimate_model_memory( """ Estimates the model memory - ``_ + ``_ :param analysis_config: For a list of the properties that you can specify in the `analysis_config` component of the body of this API. @@ -727,7 +727,7 @@ async def evaluate_data_frame( """ Evaluates the data frame analytics for an annotated index. - ``_ + ``_ :param evaluation: Defines the type of evaluation you want to perform. :param index: Defines the `index` in which the evaluation will be performed. @@ -785,7 +785,7 @@ async def explain_data_frame_analytics( """ Explains a data frame analytics config. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -876,7 +876,7 @@ async def flush_job( """ Forces any buffered data to be processed by the job. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param advance_time: Refer to the description for the `advance_time` query parameter. @@ -937,7 +937,7 @@ async def forecast( """ Predicts the future behavior of a time series by using its historical behavior. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. The job must be open when you create a forecast; otherwise, an error occurs. @@ -1003,7 +1003,7 @@ async def get_buckets( """ Retrieves anomaly detection job results for one or more buckets. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param timestamp: The timestamp of a single bucket result. If you do not specify @@ -1090,7 +1090,7 @@ async def get_calendar_events( """ Retrieves information about the scheduled events in calendars. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. You can get information for multiple calendars by using a comma-separated list of ids @@ -1151,7 +1151,7 @@ async def get_calendars( """ Retrieves configuration information for calendars. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. You can get information for multiple calendars by using a comma-separated list of ids @@ -1215,7 +1215,7 @@ async def get_categories( """ Retrieves anomaly detection job results for one or more categories. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param category_id: Identifier for the category, which is unique in the job. @@ -1283,7 +1283,7 @@ async def get_data_frame_analytics( """ Retrieves configuration information for data frame analytics jobs. - ``_ + ``_ :param id: Identifier for the data frame analytics job. If you do not specify this option, the API returns information for the first hundred data frame @@ -1349,7 +1349,7 @@ async def get_data_frame_analytics_stats( """ Retrieves usage information for data frame analytics jobs. - ``_ + ``_ :param id: Identifier for the data frame analytics job. If you do not specify this option, the API returns information for the first hundred data frame @@ -1410,7 +1410,7 @@ async def get_datafeed_stats( """ Retrieves usage information for datafeeds. - ``_ + ``_ :param datafeed_id: Identifier for the datafeed. It can be a datafeed identifier or a wildcard expression. If you do not specify one of these options, the @@ -1462,7 +1462,7 @@ async def get_datafeeds( """ Retrieves configuration information for datafeeds. - ``_ + ``_ :param datafeed_id: Identifier for the datafeed. It can be a datafeed identifier or a wildcard expression. If you do not specify one of these options, the @@ -1521,7 +1521,7 @@ async def get_filters( """ Retrieves filters. - ``_ + ``_ :param filter_id: A string that uniquely identifies a filter. :param from_: Skips the specified number of filters. @@ -1576,7 +1576,7 @@ async def get_influencers( """ Retrieves anomaly detection job results for one or more influencers. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param desc: If true, the results are sorted in descending order. @@ -1650,7 +1650,7 @@ async def get_job_stats( """ Retrieves usage information for anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. It can be a job identifier, a group name, a comma-separated list of jobs, or a wildcard expression. If @@ -1703,7 +1703,7 @@ async def get_jobs( """ Retrieves configuration information for anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. If you do not specify one of these @@ -1760,7 +1760,7 @@ async def get_memory_stats( """ Returns information on how ML is using memory. - ``_ + ``_ :param node_id: The names of particular nodes in the cluster to target. For example, `nodeId1,nodeId2` or `ml:true` @@ -1809,7 +1809,7 @@ async def get_model_snapshot_upgrade_stats( """ Gets stats for anomaly detection job model snapshot upgrades that are in progress. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: A numerical character string that uniquely identifies the @@ -1872,7 +1872,7 @@ async def get_model_snapshots( """ Retrieves information about model snapshots. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: A numerical character string that uniquely identifies the @@ -1954,7 +1954,7 @@ async def get_overall_buckets( Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. It can be a job identifier, a group name, a comma-separated list of jobs or groups, or a wildcard expression. @@ -2034,7 +2034,7 @@ async def get_records( """ Retrieves anomaly records for an anomaly detection job. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param desc: Refer to the description for the `desc` query parameter. @@ -2117,7 +2117,7 @@ async def get_trained_models( """ Retrieves configuration information for a trained inference model. - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param allow_no_match: Specifies what to do when the request: - Contains wildcard @@ -2193,7 +2193,7 @@ async def get_trained_models_stats( """ Retrieves usage information for trained inference models. - ``_ + ``_ :param model_id: The unique identifier of the trained model or a model alias. It can be a comma-separated list or a wildcard expression. @@ -2251,7 +2251,7 @@ async def infer_trained_model( """ Evaluate a trained model. - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param docs: An array of objects to pass to the model for inference. The objects @@ -2302,7 +2302,7 @@ async def info( """ Returns defaults and limits used by machine learning. - ``_ + ``_ """ __path = "/_ml/info" __query: t.Dict[str, t.Any] = {} @@ -2337,7 +2337,7 @@ async def open_job( """ Opens one or more anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param timeout: Refer to the description for the `timeout` query parameter. @@ -2386,7 +2386,7 @@ async def post_calendar_events( """ Posts scheduled events in a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. :param events: A list of one of more scheduled events. The event’s start and @@ -2435,7 +2435,7 @@ async def post_data( """ Sends data to an anomaly detection job for analysis. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. The job must have a state of open to receive and process the data. @@ -2488,7 +2488,7 @@ async def preview_data_frame_analytics( """ Previews that will be analyzed given a data frame analytics config. - ``_ + ``_ :param id: Identifier for the data frame analytics job. :param config: A data frame analytics config as described in create data frame @@ -2541,7 +2541,7 @@ async def preview_datafeed( """ Previews a datafeed. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -2608,7 +2608,7 @@ async def put_calendar( """ Instantiates a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. :param description: A description of the calendar. @@ -2656,7 +2656,7 @@ async def put_calendar_job( """ Adds an anomaly detection job to a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. :param job_id: An identifier for the anomaly detection jobs. It can be a job @@ -2711,7 +2711,7 @@ async def put_data_frame_analytics( """ Instantiates a data frame analytics job. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -2872,7 +2872,7 @@ async def put_datafeed( """ Instantiates a datafeed. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -3018,7 +3018,7 @@ async def put_filter( """ Instantiates a filter. - ``_ + ``_ :param filter_id: A string that uniquely identifies a filter. :param description: A description of the filter. @@ -3081,7 +3081,7 @@ async def put_job( """ Instantiates an anomaly detection job. - ``_ + ``_ :param job_id: The identifier for the anomaly detection job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and @@ -3217,7 +3217,6 @@ async def put_trained_model( self, *, model_id: str, - inference_config: t.Mapping[str, t.Any], compressed_definition: t.Optional[str] = None, defer_definition_decompression: t.Optional[bool] = None, definition: t.Optional[t.Mapping[str, t.Any]] = None, @@ -3227,6 +3226,7 @@ async def put_trained_model( t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] ] = None, human: t.Optional[bool] = None, + inference_config: t.Optional[t.Mapping[str, t.Any]] = None, input: t.Optional[t.Mapping[str, t.Any]] = None, metadata: t.Optional[t.Any] = None, model_size_bytes: t.Optional[int] = None, @@ -3239,12 +3239,9 @@ async def put_trained_model( """ Creates an inference trained model. - ``_ + ``_ :param model_id: The unique identifier of the trained model. - :param inference_config: The default configuration for inference. This can be - either a regression or classification configuration. It must match the underlying - definition.trained_model's target_type. :param compressed_definition: The compressed (GZipped and Base64 encoded) inference definition of the model. If compressed_definition is specified, then definition cannot be specified. @@ -3254,6 +3251,10 @@ async def put_trained_model( :param definition: The inference definition for the model. If definition is specified, then compressed_definition cannot be specified. :param description: A human-readable description of the inference trained model. + :param inference_config: The default configuration for inference. This can be + either a regression or classification configuration. It must match the underlying + definition.trained_model's target_type. For pre-packaged models such as ELSER + the config is not required. :param input: The input field names for the model definition. :param metadata: An object map that contains metadata about the model. :param model_size_bytes: The estimated memory usage in bytes to keep the trained @@ -3264,13 +3265,9 @@ async def put_trained_model( """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") - if inference_config is None: - raise ValueError("Empty value passed for parameter 'inference_config'") __path = f"/_ml/trained_models/{_quote(model_id)}" __body: t.Dict[str, t.Any] = {} __query: t.Dict[str, t.Any] = {} - if inference_config is not None: - __body["inference_config"] = inference_config if compressed_definition is not None: __body["compressed_definition"] = compressed_definition if defer_definition_decompression is not None: @@ -3285,6 +3282,8 @@ async def put_trained_model( __query["filter_path"] = filter_path if human is not None: __query["human"] = human + if inference_config is not None: + __body["inference_config"] = inference_config if input is not None: __body["input"] = input if metadata is not None: @@ -3320,7 +3319,7 @@ async def put_trained_model_alias( Creates a new model alias (or reassigns an existing one) to refer to the trained model - ``_ + ``_ :param model_id: The identifier for the trained model that the alias refers to. :param model_alias: The alias to create or update. This value cannot end in numbers. @@ -3370,7 +3369,7 @@ async def put_trained_model_definition_part( """ Creates part of a trained model definition - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param part: The definition part number. When the definition is loaded for inference @@ -3436,7 +3435,7 @@ async def put_trained_model_vocabulary( """ Creates a trained model vocabulary - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param vocabulary: The model vocabulary, which must not be empty. @@ -3483,7 +3482,7 @@ async def reset_job( """ Resets an existing anomaly detection job. - ``_ + ``_ :param job_id: The ID of the job to reset. :param delete_user_annotations: Specifies whether annotations that have been @@ -3532,7 +3531,7 @@ async def revert_model_snapshot( """ Reverts to a specific snapshot. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: You can specify `empty` as the . Reverting to @@ -3584,7 +3583,7 @@ async def set_upgrade_mode( Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. - ``_ + ``_ :param enabled: When `true`, it enables `upgrade_mode` which temporarily halts all job and datafeed tasks and prohibits new job and datafeed tasks from @@ -3626,7 +3625,7 @@ async def start_data_frame_analytics( """ Starts a data frame analytics job. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -3673,7 +3672,7 @@ async def start_datafeed( """ Starts one or more datafeeds. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -3735,7 +3734,7 @@ async def start_trained_model_deployment( """ Start a trained model deployment. - ``_ + ``_ :param model_id: The unique identifier of the trained model. Currently, only PyTorch models are supported. @@ -3811,7 +3810,7 @@ async def stop_data_frame_analytics( """ Stops one or more data frame analytics jobs. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -3871,7 +3870,7 @@ async def stop_datafeed( """ Stops one or more datafeeds. - ``_ + ``_ :param datafeed_id: Identifier for the datafeed. You can stop multiple datafeeds in a single API request by using a comma-separated list of datafeeds or a @@ -3927,7 +3926,7 @@ async def stop_trained_model_deployment( """ Stop a trained model deployment. - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param allow_no_match: Specifies what to do when the request: contains wildcard @@ -3982,7 +3981,7 @@ async def update_data_frame_analytics( """ Updates certain properties of a data frame analytics job. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -4078,7 +4077,7 @@ async def update_datafeed( """ Updates certain properties of a datafeed. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -4234,7 +4233,7 @@ async def update_filter( """ Updates the description of a filter, adds items, or removes items. - ``_ + ``_ :param filter_id: A string that uniquely identifies a filter. :param add_items: The items to add to the filter. @@ -4305,7 +4304,7 @@ async def update_job( """ Updates certain properties of an anomaly detection job. - ``_ + ``_ :param job_id: Identifier for the job. :param allow_lazy_open: Advanced configuration option. Specifies whether this @@ -4426,7 +4425,7 @@ async def update_model_snapshot( """ Updates certain properties of a snapshot. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: Identifier for the model snapshot. @@ -4477,7 +4476,7 @@ async def upgrade_job_snapshot( """ Upgrades a given job snapshot to the current major version. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: A numerical character string that uniquely identifies the @@ -4535,7 +4534,7 @@ async def validate( """ Validates an anomaly detection job. - ``_ + ``_ :param analysis_config: :param analysis_limits: @@ -4598,7 +4597,7 @@ async def validate_detector( """ Validates an anomaly detection detector. - ``_ + ``_ :param detector: """ diff --git a/elasticsearch/_async/client/monitoring.py b/elasticsearch/_async/client/monitoring.py index 3fd1425ad..42b5c9dd5 100644 --- a/elasticsearch/_async/client/monitoring.py +++ b/elasticsearch/_async/client/monitoring.py @@ -46,7 +46,7 @@ async def bulk( """ Used by the monitoring features to send monitoring data. - ``_ + ``_ :param interval: Collection interval (e.g., '10s' or '10000ms') of the payload :param operations: diff --git a/elasticsearch/_async/client/nodes.py b/elasticsearch/_async/client/nodes.py index 9f0272e99..5576b1183 100644 --- a/elasticsearch/_async/client/nodes.py +++ b/elasticsearch/_async/client/nodes.py @@ -40,7 +40,7 @@ async def clear_repositories_metering_archive( """ Removes the archived repositories metering information present in the cluster. - ``_ + ``_ :param node_id: Comma-separated list of node IDs or names used to limit returned information. All the nodes selective options are explained [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster.html#cluster-nodes). @@ -81,7 +81,7 @@ async def get_repositories_metering_info( """ Returns cluster repositories metering information. - ``_ + ``_ :param node_id: Comma-separated list of node IDs or names used to limit returned information. All the nodes selective options are explained [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster.html#cluster-nodes). @@ -134,7 +134,7 @@ async def hot_threads( """ Returns information about hot threads on each node in the cluster. - ``_ + ``_ :param node_id: List of node IDs or names used to limit returned information. :param ignore_idle_threads: If true, known idle threads (e.g. waiting in a socket @@ -209,7 +209,7 @@ async def info( """ Returns information about nodes in the cluster. - ``_ + ``_ :param node_id: Comma-separated list of node IDs or names used to limit returned information. @@ -271,7 +271,7 @@ async def reload_secure_settings( """ Reloads secure settings. - ``_ + ``_ :param node_id: A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes. @@ -348,7 +348,7 @@ async def stats( """ Returns statistical information about nodes in the cluster. - ``_ + ``_ :param node_id: Comma-separated list of node IDs or names used to limit returned information. @@ -450,7 +450,7 @@ async def usage( """ Returns low-level information about REST actions usage on nodes. - ``_ + ``_ :param 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 diff --git a/elasticsearch/_async/client/query_ruleset.py b/elasticsearch/_async/client/query_ruleset.py new file mode 100644 index 000000000..d01b07f6e --- /dev/null +++ b/elasticsearch/_async/client/query_ruleset.py @@ -0,0 +1,187 @@ +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import typing as t + +from elastic_transport import ObjectApiResponse + +from ._base import NamespacedClient +from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters + + +class QueryRulesetClient(NamespacedClient): + @_rewrite_parameters() + async def delete( + self, + *, + ruleset_id: str, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Deletes a query ruleset. + + ``_ + + :param ruleset_id: The unique identifier of the query ruleset to delete + """ + if ruleset_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'ruleset_id'") + __path = f"/_query_rules/{_quote(ruleset_id)}" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json"} + return await self.perform_request( # type: ignore[return-value] + "DELETE", __path, params=__query, headers=__headers + ) + + @_rewrite_parameters() + async def get( + self, + *, + ruleset_id: str, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Returns the details about a query ruleset. + + ``_ + + :param ruleset_id: The unique identifier of the query ruleset + """ + if ruleset_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'ruleset_id'") + __path = f"/_query_rules/{_quote(ruleset_id)}" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json"} + return await self.perform_request( # type: ignore[return-value] + "GET", __path, params=__query, headers=__headers + ) + + @_rewrite_parameters( + parameter_aliases={"from": "from_"}, + ) + async def list( + self, + *, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + from_: t.Optional[int] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + size: t.Optional[int] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Lists query rulesets. + + ``_ + + :param from_: Starting offset (default: 0) + :param size: specifies a max number of results to get + """ + __path = "/_query_rules" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if from_ is not None: + __query["from"] = from_ + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + if size is not None: + __query["size"] = size + __headers = {"accept": "application/json"} + return await self.perform_request( # type: ignore[return-value] + "GET", __path, params=__query, headers=__headers + ) + + @_rewrite_parameters( + body_fields=True, + ) + async def put( + self, + *, + ruleset_id: str, + rules: t.Union[ + t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] + ], + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Creates or updates a query ruleset. + + ``_ + + :param ruleset_id: The unique identifier of the query ruleset to be created or + updated + :param rules: + """ + if ruleset_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'ruleset_id'") + if rules is None: + raise ValueError("Empty value passed for parameter 'rules'") + __path = f"/_query_rules/{_quote(ruleset_id)}" + __body: t.Dict[str, t.Any] = {} + __query: t.Dict[str, t.Any] = {} + if rules is not None: + __body["rules"] = rules + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json", "content-type": "application/json"} + return await self.perform_request( # type: ignore[return-value] + "PUT", __path, params=__query, headers=__headers, body=__body + ) diff --git a/elasticsearch/_async/client/rollup.py b/elasticsearch/_async/client/rollup.py index 3c1a4d74a..9635420ad 100644 --- a/elasticsearch/_async/client/rollup.py +++ b/elasticsearch/_async/client/rollup.py @@ -39,7 +39,7 @@ async def delete_job( """ Deletes an existing rollup job. - ``_ + ``_ :param id: The ID of the job to delete """ @@ -75,7 +75,7 @@ async def get_jobs( """ Retrieves the configuration, stats, and status of rollup jobs. - ``_ + ``_ :param id: The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs @@ -114,7 +114,7 @@ async def get_rollup_caps( Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. - ``_ + ``_ :param id: The ID of the index to check rollup capabilities on, or left blank for all jobs @@ -153,7 +153,7 @@ async def get_rollup_index_caps( Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). - ``_ + ``_ :param index: The rollup index or index pattern to obtain rollup capabilities from. @@ -205,7 +205,7 @@ async def put_job( """ Creates a rollup job. - ``_ + ``_ :param id: Identifier for the rollup job. This can be any alphanumeric string and uniquely identifies the data that is associated with the rollup job. @@ -314,7 +314,7 @@ async def rollup_search( """ Enables searching rolled-up data using the standard query DSL. - ``_ + ``_ :param index: The indices or index-pattern(s) (containing rollup or regular data) that should be searched @@ -372,7 +372,7 @@ async def start_job( """ Starts an existing, stopped rollup job. - ``_ + ``_ :param id: The ID of the job to start """ @@ -410,7 +410,7 @@ async def stop_job( """ Stops an existing, started rollup job. - ``_ + ``_ :param id: The ID of the job to stop :param timeout: Block for (at maximum) the specified duration while waiting for diff --git a/elasticsearch/_async/client/search_application.py b/elasticsearch/_async/client/search_application.py index 9b927a363..283453fc2 100644 --- a/elasticsearch/_async/client/search_application.py +++ b/elasticsearch/_async/client/search_application.py @@ -39,7 +39,7 @@ async def delete( """ Deletes a search application. - ``_ + ``_ :param name: The name of the search application to delete """ @@ -75,7 +75,7 @@ async def delete_behavioral_analytics( """ Delete a behavioral analytics collection. - ``_ + ``_ :param name: The name of the analytics collection to be deleted """ @@ -111,7 +111,7 @@ async def get( """ Returns the details about a search application. - ``_ + ``_ :param name: The name of the search application """ @@ -147,7 +147,7 @@ async def get_behavioral_analytics( """ Returns the existing behavioral analytics collections. - ``_ + ``_ :param name: A list of analytics collections to limit the returned information """ @@ -188,7 +188,7 @@ async def list( """ Returns the existing search applications. - ``_ + ``_ :param from_: Starting offset (default: 0) :param q: Query in the Lucene query string syntax" @@ -234,7 +234,7 @@ async def put( """ Creates or updates a search application. - ``_ + ``_ :param name: The name of the search application to be created or updated :param search_application: @@ -278,7 +278,7 @@ async def put_behavioral_analytics( """ Creates a behavioral analytics collection. - ``_ + ``_ :param name: The name of the analytics collection to be created or updated """ @@ -318,7 +318,7 @@ async def search( """ Perform a search against a search application - ``_ + ``_ :param name: The name of the search application to be searched :param params: diff --git a/elasticsearch/_async/client/searchable_snapshots.py b/elasticsearch/_async/client/searchable_snapshots.py index 5bce0114c..10efe4a07 100644 --- a/elasticsearch/_async/client/searchable_snapshots.py +++ b/elasticsearch/_async/client/searchable_snapshots.py @@ -44,7 +44,7 @@ async def cache_stats( """ Retrieve node-level cache statistics about searchable snapshots. - ``_ + ``_ :param 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 @@ -106,7 +106,7 @@ async def clear_cache( """ Clear the cache of searchable snapshots. - ``_ + ``_ :param index: A comma-separated list of index names :param allow_no_indices: Whether to ignore if a wildcard indices expression resolves @@ -170,7 +170,7 @@ async def mount( """ Mount a snapshot as a searchable index. - ``_ + ``_ :param repository: The name of the repository containing the snapshot of the index to mount @@ -239,7 +239,7 @@ async def stats( """ Retrieve shard-level statistics about searchable snapshots. - ``_ + ``_ :param index: A comma-separated list of index names :param level: Return stats aggregated at cluster, index or shard level diff --git a/elasticsearch/_async/client/security.py b/elasticsearch/_async/client/security.py index b983651b7..3ca9ba622 100644 --- a/elasticsearch/_async/client/security.py +++ b/elasticsearch/_async/client/security.py @@ -44,7 +44,7 @@ async def activate_user_profile( """ Creates or updates the user profile on behalf of another user. - ``_ + ``_ :param grant_type: :param access_token: @@ -92,7 +92,7 @@ async def authenticate( Enables authentication as a user and retrieve information about the authenticated user. - ``_ + ``_ """ __path = "/_security/_authenticate" __query: t.Dict[str, t.Any] = {} @@ -131,7 +131,7 @@ async def change_password( """ Changes the passwords of users in the native realm and built-in users. - ``_ + ``_ :param username: The user whose password you want to change. If you do not specify this parameter, the password is changed for the current user. @@ -185,9 +185,10 @@ async def clear_api_key_cache( """ Clear a subset or all entries from the API key cache. - ``_ + ``_ - :param ids: A comma-separated list of IDs of API keys to clear from the cache + :param ids: Comma-separated list of API key IDs to evict from the API key cache. + To evict all API keys, use `*`. Does not support other wildcard patterns. """ if ids in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'ids'") @@ -221,7 +222,7 @@ async def clear_cached_privileges( """ Evicts application privileges from the native application privileges cache. - ``_ + ``_ :param application: A comma-separated list of application names """ @@ -259,7 +260,7 @@ async def clear_cached_realms( Evicts users from the user cache. Can completely clear the cache or evict specific users. - ``_ + ``_ :param realms: Comma-separated list of realms to clear :param usernames: Comma-separated list of usernames to clear from the cache @@ -298,7 +299,7 @@ async def clear_cached_roles( """ Evicts roles from the native role cache. - ``_ + ``_ :param name: Role name """ @@ -336,7 +337,7 @@ async def clear_cached_service_tokens( """ Evicts tokens from the service account token caches. - ``_ + ``_ :param namespace: An identifier for the namespace :param service: An identifier for the service name @@ -386,13 +387,13 @@ async def create_api_key( """ Creates an API key for access without requiring basic authentication. - ``_ + ``_ :param expiration: Expiration time for the API key. By default, API keys never expire. :param metadata: Arbitrary metadata that you want to associate with the API key. It supports nested data structure. Within the metadata object, keys beginning - with _ are reserved for system usage. + with `_` are reserved for system usage. :param name: Specifies the name for this API key. :param refresh: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to @@ -452,7 +453,7 @@ async def create_service_token( """ Creates a service account token for access without requiring basic authentication. - ``_ + ``_ :param namespace: An identifier for the namespace :param service: An identifier for the service name @@ -512,7 +513,7 @@ async def delete_privileges( """ Removes application privileges. - ``_ + ``_ :param application: Application name :param name: Privilege name @@ -559,7 +560,7 @@ async def delete_role( """ Removes roles in the native realm. - ``_ + ``_ :param name: Role name :param refresh: If `true` (the default) then refresh the affected shards to make @@ -603,7 +604,7 @@ async def delete_role_mapping( """ Removes role mappings. - ``_ + ``_ :param name: Role-mapping name :param refresh: If `true` (the default) then refresh the affected shards to make @@ -649,7 +650,7 @@ async def delete_service_token( """ Deletes a service account token. - ``_ + ``_ :param namespace: An identifier for the namespace :param service: An identifier for the service name @@ -699,7 +700,7 @@ async def delete_user( """ Deletes users from the native realm. - ``_ + ``_ :param username: username :param refresh: If `true` (the default) then refresh the affected shards to make @@ -743,7 +744,7 @@ async def disable_user( """ Disables users in the native realm. - ``_ + ``_ :param username: The username of the user to disable :param refresh: If `true` (the default) then refresh the affected shards to make @@ -787,7 +788,7 @@ async def disable_user_profile( """ Disables a user profile so it's not visible in user profile searches. - ``_ + ``_ :param uid: Unique identifier for the user profile. :param refresh: If 'true', Elasticsearch refreshes the affected shards to make @@ -831,7 +832,7 @@ async def enable_user( """ Enables users in the native realm. - ``_ + ``_ :param username: The username of the user to enable :param refresh: If `true` (the default) then refresh the affected shards to make @@ -875,7 +876,7 @@ async def enable_user_profile( """ Enables a user profile so it's visible in user profile searches. - ``_ + ``_ :param uid: Unique identifier for the user profile. :param refresh: If 'true', Elasticsearch refreshes the affected shards to make @@ -916,7 +917,7 @@ async def enroll_kibana( Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster. - ``_ + ``_ """ __path = "/_security/enroll/kibana" __query: t.Dict[str, t.Any] = {} @@ -947,7 +948,7 @@ async def enroll_node( """ Allows a new node to enroll to an existing cluster with security enabled. - ``_ + ``_ """ __path = "/_security/enroll/node" __query: t.Dict[str, t.Any] = {} @@ -984,13 +985,20 @@ async def get_api_key( """ Retrieves information for one or more API keys. - ``_ - - :param id: API key id of the API key to be retrieved - :param name: API key name of the API key to be retrieved - :param owner: flag to query API keys owned by the currently authenticated user - :param realm_name: realm name of the user who created this API key to be retrieved - :param username: user name of the user who created this API key to be retrieved + ``_ + + :param id: An API key id. This parameter cannot be used with any of `name`, `realm_name` + or `username`. + :param name: An API key name. This parameter cannot be used with any of `id`, + `realm_name` or `username`. It supports prefix search with wildcard. + :param owner: A boolean flag that can be used to query API keys owned by the + currently authenticated user. The `realm_name` or `username` parameters cannot + be specified when this parameter is set to `true` as they are assumed to + be the currently authenticated ones. + :param realm_name: The name of an authentication realm. This parameter cannot + be used with either `id` or `name` or when `owner` flag is set to `true`. + :param username: The username of a user. This parameter cannot be used with either + `id` or `name` or when `owner` flag is set to `true`. :param with_limited_by: Return the snapshot of the owner user's role descriptors associated with the API key. An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors. @@ -1037,7 +1045,7 @@ async def get_builtin_privileges( Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch. - ``_ + ``_ """ __path = "/_security/privilege/_builtin" __query: t.Dict[str, t.Any] = {} @@ -1070,7 +1078,7 @@ async def get_privileges( """ Retrieves application privileges. - ``_ + ``_ :param application: Application name :param name: Privilege name @@ -1110,7 +1118,7 @@ async def get_role( """ Retrieves roles in the native realm. - ``_ + ``_ :param name: The name of the role. You can specify multiple roles as a comma-separated list. If you do not specify this parameter, the API returns information about @@ -1149,7 +1157,7 @@ async def get_role_mapping( """ Retrieves role mappings. - ``_ + ``_ :param name: The distinct name that identifies the role mapping. The name is used solely as an identifier to facilitate interaction via the API; it does @@ -1191,7 +1199,7 @@ async def get_service_accounts( """ Retrieves information about service accounts. - ``_ + ``_ :param namespace: Name of the namespace. Omit this parameter to retrieve information about all service accounts. If you omit this parameter, you must also omit @@ -1235,7 +1243,7 @@ async def get_service_credentials( """ Retrieves information of all service credentials for a service account. - ``_ + ``_ :param namespace: Name of the namespace. :param service: Name of the service name. @@ -1286,7 +1294,7 @@ async def get_token( """ Creates a bearer token for access without requiring basic authentication. - ``_ + ``_ :param grant_type: :param kerberos_ticket: @@ -1341,7 +1349,7 @@ async def get_user( """ Retrieves information about users in the native realm and built-in users. - ``_ + ``_ :param username: An identifier for the user. You can specify multiple usernames as a comma-separated list. If you omit this parameter, the API retrieves @@ -1386,7 +1394,7 @@ async def get_user_privileges( """ Retrieves security privileges for the logged in user. - ``_ + ``_ :param application: The name of the application. Application privileges are always associated with exactly one application. If you do not specify this parameter, @@ -1432,7 +1440,7 @@ async def get_user_profile( """ Retrieves user profiles for the given unique ID(s). - ``_ + ``_ :param uid: A unique identifier for the user profile. :param data: List of filters for the `data` field of the profile document. To @@ -1482,14 +1490,20 @@ async def grant_api_key( """ Creates an API key on behalf of another user. - ``_ - - :param api_key: - :param grant_type: - :param access_token: - :param password: - :param run_as: - :param username: + ``_ + + :param api_key: Defines the API key. + :param grant_type: The type of grant. Supported grant types are: `access_token`, + `password`. + :param access_token: The user’s access token. If you specify the `access_token` + grant type, this parameter is required. It is not valid with other grant + types. + :param password: The user’s password. If you specify the `password` grant type, + this parameter is required. It is not valid with other grant types. + :param run_as: The name of the user to be impersonated. + :param username: The user name that identifies the user. If you specify the `password` + grant type, this parameter is required. It is not valid with other grant + types. """ if api_key is None: raise ValueError("Empty value passed for parameter 'api_key'") @@ -1563,7 +1577,7 @@ async def has_privileges( """ Determines whether the specified user has a specified list of privileges. - ``_ + ``_ :param user: Username :param application: @@ -1614,7 +1628,7 @@ async def has_privileges_user_profile( Determines whether the users associated with the specified profile IDs have all the requested privileges. - ``_ + ``_ :param privileges: :param uids: A list of profile IDs. The privileges are checked for associated @@ -1666,14 +1680,21 @@ async def invalidate_api_key( """ Invalidates one or more API keys. - ``_ + ``_ :param id: - :param ids: - :param name: - :param owner: - :param realm_name: - :param username: + :param ids: A list of API key ids. This parameter cannot be used with any of + `name`, `realm_name`, or `username`. + :param name: An API key name. This parameter cannot be used with any of `ids`, + `realm_name` or `username`. + :param owner: Can be used to query API keys owned by the currently authenticated + user. The `realm_name` or `username` parameters cannot be specified when + this parameter is set to `true` as they are assumed to be the currently authenticated + ones. + :param realm_name: The name of an authentication realm. This parameter cannot + be used with either `ids` or `name`, or when `owner` flag is set to `true`. + :param username: The username of a user. This parameter cannot be used with either + `ids` or `name`, or when `owner` flag is set to `true`. """ __path = "/_security/api_key" __query: t.Dict[str, t.Any] = {} @@ -1723,7 +1744,7 @@ async def invalidate_token( """ Invalidates one or more access tokens or refresh tokens. - ``_ + ``_ :param realm_name: :param refresh_token: @@ -1774,7 +1795,7 @@ async def put_privileges( """ Adds or updates application privileges. - ``_ + ``_ :param privileges: :param refresh: If `true` (the default) then refresh the affected shards to make @@ -1849,7 +1870,7 @@ async def put_role( """ Adds and updates roles in the native realm. - ``_ + ``_ :param name: The name of the role. :param applications: A list of application privilege entries. @@ -1931,7 +1952,7 @@ async def put_role_mapping( """ Creates and updates role mappings. - ``_ + ``_ :param name: Role-mapping name :param enabled: @@ -2001,7 +2022,7 @@ async def put_user( Adds and updates users in the native realm. These users are commonly referred to as native users. - ``_ + ``_ :param username: The username of the User :param email: @@ -2085,20 +2106,22 @@ async def query_api_keys( """ Retrieves information for API keys using a subset of query DSL - ``_ + ``_ :param from_: Starting document offset. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more - hits, use the search_after parameter. + hits, use the `search_after` parameter. :param query: A query to filter which API keys to return. The query supports - a subset of query types, including match_all, bool, term, terms, ids, prefix, - wildcard, and range. You can query all public information associated with - an API key - :param search_after: + a subset of query types, including `match_all`, `bool`, `term`, `terms`, + `ids`, `prefix`, `wildcard`, and `range`. You can query all public information + associated with an API key. + :param search_after: Search after definition :param size: The number of hits to return. By default, you cannot page through - more than 10,000 hits using the from and size parameters. To page through - more hits, use the search_after parameter. - :param sort: + more than 10,000 hits using the `from` and `size` parameters. To page through + more hits, use the `search_after` parameter. + :param sort: Other than `id`, all public fields of an API key are eligible for + sorting. In addition, sort can also be applied to the `_doc` field to sort + by index order. :param with_limited_by: Return the snapshot of the owner user's role descriptors associated with the API key. An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors. @@ -2166,7 +2189,7 @@ async def saml_authenticate( Exchanges a SAML Response message for an Elasticsearch access token and refresh token pair - ``_ + ``_ :param content: The SAML response as it was sent by the user’s browser, usually a Base64 encoded XML document. @@ -2221,7 +2244,7 @@ async def saml_complete_logout( """ Verifies the logout response sent from the SAML IdP - ``_ + ``_ :param ids: A json array with all the valid SAML Request Ids that the caller of the API has for the current user. @@ -2280,7 +2303,7 @@ async def saml_invalidate( """ Consumes a SAML LogoutRequest - ``_ + ``_ :param query_string: The query part of the URL that the user was redirected to by the SAML IdP to initiate the Single Logout. This query should include @@ -2341,7 +2364,7 @@ async def saml_logout( Invalidates an access token and a refresh token that were generated via the SAML Authenticate API - ``_ + ``_ :param token: The access token that was returned as a response to calling the SAML authenticate API. Alternatively, the most recent token that was received @@ -2391,7 +2414,7 @@ async def saml_prepare_authentication( """ Creates a SAML authentication request - ``_ + ``_ :param acs: The Assertion Consumer Service URL that matches the one of the SAML realms in Elasticsearch. The realm is used to generate the authentication @@ -2440,7 +2463,7 @@ async def saml_service_provider_metadata( """ Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider - ``_ + ``_ :param realm_name: The name of the SAML realm in Elasticsearch. """ @@ -2481,7 +2504,7 @@ async def suggest_user_profiles( """ Get suggestions for user profiles that match specified search criteria. - ``_ + ``_ :param data: List of filters for the `data` field of the profile document. To return all content use `data=*`. To return a subset of content use `data=` @@ -2542,7 +2565,7 @@ async def update_api_key( """ Updates attributes of an existing API key. - ``_ + ``_ :param id: The ID of the API key to update. :param metadata: Arbitrary metadata that you want to associate with the API key. @@ -2607,7 +2630,7 @@ async def update_user_profile_data( """ Update application specific data for the user profile of the given unique ID. - ``_ + ``_ :param uid: A unique identifier for the user profile. :param data: Non-searchable data that you want to associate with the user profile. diff --git a/elasticsearch/_async/client/slm.py b/elasticsearch/_async/client/slm.py index 438ac239f..6b77bf250 100644 --- a/elasticsearch/_async/client/slm.py +++ b/elasticsearch/_async/client/slm.py @@ -39,7 +39,7 @@ async def delete_lifecycle( """ Deletes an existing snapshot lifecycle policy. - ``_ + ``_ :param policy_id: The id of the snapshot lifecycle policy to remove """ @@ -76,7 +76,7 @@ async def execute_lifecycle( Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. - ``_ + ``_ :param policy_id: The id of the snapshot lifecycle policy to be executed """ @@ -111,7 +111,7 @@ async def execute_retention( """ Deletes any snapshots that are expired according to the policy's retention rules. - ``_ + ``_ """ __path = "/_slm/_execute_retention" __query: t.Dict[str, t.Any] = {} @@ -146,7 +146,7 @@ async def get_lifecycle( Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. - ``_ + ``_ :param policy_id: Comma-separated list of snapshot lifecycle policies to retrieve """ @@ -183,7 +183,7 @@ async def get_stats( Returns global and policy-level statistics about actions taken by snapshot lifecycle management. - ``_ + ``_ """ __path = "/_slm/stats" __query: t.Dict[str, t.Any] = {} @@ -214,7 +214,7 @@ async def get_status( """ Retrieves the status of snapshot lifecycle management (SLM). - ``_ + ``_ """ __path = "/_slm/status" __query: t.Dict[str, t.Any] = {} @@ -257,7 +257,7 @@ async def put_lifecycle( """ Creates or updates a snapshot lifecycle policy. - ``_ + ``_ :param policy_id: ID for the snapshot lifecycle policy you want to create or update. @@ -328,7 +328,7 @@ async def start( """ Turns on snapshot lifecycle management (SLM). - ``_ + ``_ """ __path = "/_slm/start" __query: t.Dict[str, t.Any] = {} @@ -359,7 +359,7 @@ async def stop( """ Turns off snapshot lifecycle management (SLM). - ``_ + ``_ """ __path = "/_slm/stop" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_async/client/snapshot.py b/elasticsearch/_async/client/snapshot.py index 732ee7d60..fc2cd82bd 100644 --- a/elasticsearch/_async/client/snapshot.py +++ b/elasticsearch/_async/client/snapshot.py @@ -43,7 +43,7 @@ async def cleanup_repository( """ Removes stale data from repository. - ``_ + ``_ :param name: Snapshot repository to clean up. :param master_timeout: Period to wait for a connection to the master node. @@ -94,7 +94,7 @@ async def clone( """ Clones indices from one snapshot into another snapshot in the same repository. - ``_ + ``_ :param repository: A repository name :param snapshot: The name of the snapshot to clone from @@ -163,7 +163,7 @@ async def create( """ Creates a snapshot in a repository. - ``_ + ``_ :param repository: Repository for the snapshot. :param snapshot: Name of the snapshot. Must be unique in the repository. @@ -261,7 +261,7 @@ async def create_repository( """ Creates a repository. - ``_ + ``_ :param name: A repository name :param settings: @@ -324,7 +324,7 @@ async def delete( """ Deletes one or more snapshots. - ``_ + ``_ :param repository: A repository name :param snapshot: A comma-separated list of snapshot names @@ -370,7 +370,7 @@ async def delete_repository( """ Deletes a repository. - ``_ + ``_ :param name: Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported. @@ -434,7 +434,7 @@ async def get( """ Returns information about a snapshot. - ``_ + ``_ :param repository: Comma-separated list of snapshot repository names used to limit the request. Wildcard (*) expressions are supported. @@ -541,7 +541,7 @@ async def get_repository( """ Returns information about a repository. - ``_ + ``_ :param name: A comma-separated list of repository names :param local: Return local information, do not retrieve the state from master @@ -606,7 +606,7 @@ async def restore( """ Restores a snapshot. - ``_ + ``_ :param repository: A repository name :param snapshot: A snapshot name @@ -694,7 +694,7 @@ async def status( """ Returns information about the status of a snapshot. - ``_ + ``_ :param repository: A repository name :param snapshot: A comma-separated list of snapshot names @@ -745,7 +745,7 @@ async def verify_repository( """ Verifies a repository. - ``_ + ``_ :param name: A repository name :param master_timeout: Explicit operation timeout for connection to master node diff --git a/elasticsearch/_async/client/sql.py b/elasticsearch/_async/client/sql.py index a84171f3d..58175d267 100644 --- a/elasticsearch/_async/client/sql.py +++ b/elasticsearch/_async/client/sql.py @@ -41,7 +41,7 @@ async def clear_cursor( """ Clears the SQL cursor - ``_ + ``_ :param cursor: """ @@ -81,7 +81,7 @@ async def delete_async( Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. - ``_ + ``_ :param id: The async search ID """ @@ -124,7 +124,7 @@ async def get_async( Returns the current status and available results for an async SQL search or stored synchronous SQL search - ``_ + ``_ :param id: The async search ID :param delimiter: Separator for CSV results. The API only supports this parameter @@ -178,7 +178,7 @@ async def get_async_status( Returns the current status of an async SQL search or a stored synchronous SQL search - ``_ + ``_ :param id: The async search ID """ @@ -237,7 +237,7 @@ async def query( """ Executes a SQL request - ``_ + ``_ :param catalog: Default catalog (cluster) for queries. If unspecified, the queries execute on the data in the local cluster only. @@ -339,7 +339,7 @@ async def translate( """ Translates SQL into Elasticsearch queries - ``_ + ``_ :param query: :param fetch_size: diff --git a/elasticsearch/_async/client/ssl.py b/elasticsearch/_async/client/ssl.py index e3fb585f1..98457eb29 100644 --- a/elasticsearch/_async/client/ssl.py +++ b/elasticsearch/_async/client/ssl.py @@ -39,7 +39,7 @@ async def certificates( Retrieves information about the X.509 certificates used to encrypt communications in the cluster. - ``_ + ``_ """ __path = "/_ssl/certificates" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_async/client/synonyms.py b/elasticsearch/_async/client/synonyms.py new file mode 100644 index 000000000..5b7841592 --- /dev/null +++ b/elasticsearch/_async/client/synonyms.py @@ -0,0 +1,325 @@ +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import typing as t + +from elastic_transport import ObjectApiResponse + +from ._base import NamespacedClient +from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters + + +class SynonymsClient(NamespacedClient): + @_rewrite_parameters() + async def delete_synonym( + self, + *, + id: str, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Deletes a synonym set + + ``_ + + :param id: The id of the synonyms set to be deleted + """ + if id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'id'") + __path = f"/_synonyms/{_quote(id)}" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json"} + return await self.perform_request( # type: ignore[return-value] + "DELETE", __path, params=__query, headers=__headers + ) + + @_rewrite_parameters() + async def delete_synonym_rule( + self, + *, + set_id: str, + rule_id: str, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Deletes a synonym rule in a synonym set + + ``_ + + :param set_id: The id of the synonym set to be updated + :param rule_id: The id of the synonym rule to be deleted + """ + if set_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'set_id'") + if rule_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'rule_id'") + __path = f"/_synonyms/{_quote(set_id)}/{_quote(rule_id)}" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json"} + return await self.perform_request( # type: ignore[return-value] + "DELETE", __path, params=__query, headers=__headers + ) + + @_rewrite_parameters( + parameter_aliases={"from": "from_"}, + ) + async def get_synonym( + self, + *, + id: str, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + from_: t.Optional[int] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + size: t.Optional[int] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Retrieves a synonym set + + ``_ + + :param id: "The id of the synonyms set to be retrieved + :param from_: Starting offset for query rules to be retrieved + :param size: specifies a max number of query rules to retrieve + """ + if id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'id'") + __path = f"/_synonyms/{_quote(id)}" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if from_ is not None: + __query["from"] = from_ + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + if size is not None: + __query["size"] = size + __headers = {"accept": "application/json"} + return await self.perform_request( # type: ignore[return-value] + "GET", __path, params=__query, headers=__headers + ) + + @_rewrite_parameters() + async def get_synonym_rule( + self, + *, + set_id: str, + rule_id: str, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Retrieves a synonym rule from a synonym set + + ``_ + + :param set_id: The id of the synonym set to retrieve the synonym rule from + :param rule_id: The id of the synonym rule to retrieve + """ + if set_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'set_id'") + if rule_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'rule_id'") + __path = f"/_synonyms/{_quote(set_id)}/{_quote(rule_id)}" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json"} + return await self.perform_request( # type: ignore[return-value] + "GET", __path, params=__query, headers=__headers + ) + + @_rewrite_parameters( + parameter_aliases={"from": "from_"}, + ) + async def get_synonyms_sets( + self, + *, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + from_: t.Optional[int] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + size: t.Optional[int] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Retrieves a summary of all defined synonym sets + + ``_ + + :param from_: Starting offset + :param size: specifies a max number of results to get + """ + __path = "/_synonyms" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if from_ is not None: + __query["from"] = from_ + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + if size is not None: + __query["size"] = size + __headers = {"accept": "application/json"} + return await self.perform_request( # type: ignore[return-value] + "GET", __path, params=__query, headers=__headers + ) + + @_rewrite_parameters( + body_fields=True, + ) + async def put_synonym( + self, + *, + id: str, + synonyms_set: t.Union[ + t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] + ], + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Creates or updates a synonyms set + + ``_ + + :param id: The id of the synonyms set to be created or updated + :param synonyms_set: The synonym set information to update + """ + if id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'id'") + if synonyms_set is None: + raise ValueError("Empty value passed for parameter 'synonyms_set'") + __path = f"/_synonyms/{_quote(id)}" + __body: t.Dict[str, t.Any] = {} + __query: t.Dict[str, t.Any] = {} + if synonyms_set is not None: + __body["synonyms_set"] = synonyms_set + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json", "content-type": "application/json"} + return await self.perform_request( # type: ignore[return-value] + "PUT", __path, params=__query, headers=__headers, body=__body + ) + + @_rewrite_parameters( + body_fields=True, + ) + async def put_synonym_rule( + self, + *, + set_id: str, + rule_id: str, + synonyms: t.Union[t.List[str], t.Tuple[str, ...]], + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Creates or updates a synonym rule in a synonym set + + ``_ + + :param set_id: The id of the synonym set to be updated with the synonym rule + :param rule_id: The id of the synonym rule to be updated or created + :param synonyms: + """ + if set_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'set_id'") + if rule_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'rule_id'") + if synonyms is None: + raise ValueError("Empty value passed for parameter 'synonyms'") + __path = f"/_synonyms/{_quote(set_id)}/{_quote(rule_id)}" + __body: t.Dict[str, t.Any] = {} + __query: t.Dict[str, t.Any] = {} + if synonyms is not None: + __body["synonyms"] = synonyms + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json", "content-type": "application/json"} + return await self.perform_request( # type: ignore[return-value] + "PUT", __path, params=__query, headers=__headers, body=__body + ) diff --git a/elasticsearch/_async/client/tasks.py b/elasticsearch/_async/client/tasks.py index fc75f5b0c..9b34b7b5d 100644 --- a/elasticsearch/_async/client/tasks.py +++ b/elasticsearch/_async/client/tasks.py @@ -45,7 +45,7 @@ async def cancel( """ Cancels a task, if it can be cancelled through an API. - ``_ + ``_ :param task_id: Cancel the task with specified task id (node_id:task_number) :param actions: A comma-separated list of actions that should be cancelled. Leave @@ -101,7 +101,7 @@ async def get( """ Returns information about a task. - ``_ + ``_ :param task_id: Return the task with specified id (node_id:task_number) :param timeout: Explicit operation timeout @@ -157,7 +157,7 @@ async def list( """ Returns a list of tasks. - ``_ + ``_ :param actions: Comma-separated list or wildcard expression of actions used to limit the request. diff --git a/elasticsearch/_async/client/text_structure.py b/elasticsearch/_async/client/text_structure.py index a4c2349b1..686ab8dac 100644 --- a/elasticsearch/_async/client/text_structure.py +++ b/elasticsearch/_async/client/text_structure.py @@ -50,7 +50,7 @@ async def find_structure( Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch. - ``_ + ``_ :param text_files: :param charset: The text’s character set. It must be a character set that is diff --git a/elasticsearch/_async/client/transform.py b/elasticsearch/_async/client/transform.py index 4cf829b6d..06fda989e 100644 --- a/elasticsearch/_async/client/transform.py +++ b/elasticsearch/_async/client/transform.py @@ -41,7 +41,7 @@ async def delete_transform( """ Deletes an existing transform. - ``_ + ``_ :param transform_id: Identifier for the transform. :param force: If this value is false, the transform must be stopped before it @@ -94,7 +94,7 @@ async def get_transform( """ Retrieves configuration information for transforms. - ``_ + ``_ :param transform_id: Identifier for the transform. It can be a transform identifier or a wildcard expression. You can get information for all transforms by using @@ -157,7 +157,7 @@ async def get_transform_stats( """ Retrieves usage information for transforms. - ``_ + ``_ :param transform_id: Identifier for the transform. It can be a transform identifier or a wildcard expression. You can get information for all transforms by using @@ -223,7 +223,7 @@ async def preview_transform( """ Previews a transform. - ``_ + ``_ :param transform_id: Identifier for the transform to preview. If you specify this path parameter, you cannot provide transform configuration details in @@ -320,7 +320,7 @@ async def put_transform( """ Instantiates a transform. - ``_ + ``_ :param transform_id: Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -414,7 +414,7 @@ async def reset_transform( """ Resets an existing transform. - ``_ + ``_ :param transform_id: Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -458,7 +458,7 @@ async def schedule_now_transform( """ Schedules now a transform. - ``_ + ``_ :param transform_id: Identifier for the transform. :param timeout: Controls the time to wait for the scheduling to take place @@ -501,7 +501,7 @@ async def start_transform( """ Starts one or more transforms. - ``_ + ``_ :param transform_id: Identifier for the transform. :param from_: Restricts the set of transformed entities to those changed after @@ -551,7 +551,7 @@ async def stop_transform( """ Stops one or more transforms. - ``_ + ``_ :param transform_id: Identifier for the transform. To stop multiple transforms, use a comma-separated list or a wildcard expression. To stop all transforms, @@ -630,7 +630,7 @@ async def update_transform( """ Updates certain properties of a transform. - ``_ + ``_ :param transform_id: Identifier for the transform. :param defer_validation: When true, deferrable validations are not run. This @@ -705,7 +705,7 @@ async def upgrade_transforms( """ Upgrades all transforms. - ``_ + ``_ :param dry_run: When true, the request checks for updates but does not run them. :param timeout: Period to wait for a response. If no response is received before diff --git a/elasticsearch/_async/client/watcher.py b/elasticsearch/_async/client/watcher.py index decb2e5a6..a7d6f331d 100644 --- a/elasticsearch/_async/client/watcher.py +++ b/elasticsearch/_async/client/watcher.py @@ -42,7 +42,7 @@ async def ack_watch( """ Acknowledges a watch, manually throttling the execution of the watch's actions. - ``_ + ``_ :param watch_id: Watch ID :param action_id: A comma-separated list of the action ids to be acked @@ -84,7 +84,7 @@ async def activate_watch( """ Activates a currently inactive watch. - ``_ + ``_ :param watch_id: Watch ID """ @@ -120,7 +120,7 @@ async def deactivate_watch( """ Deactivates a currently active watch. - ``_ + ``_ :param watch_id: Watch ID """ @@ -156,7 +156,7 @@ async def delete_watch( """ Removes a watch from Watcher. - ``_ + ``_ :param id: Watch ID """ @@ -210,7 +210,7 @@ async def execute_watch( """ Forces the execution of a stored watch. - ``_ + ``_ :param id: Identifier for the watch. :param action_modes: Determines how to handle the watch actions as part of the @@ -285,7 +285,7 @@ async def get_watch( """ Retrieves a watch by its ID. - ``_ + ``_ :param id: Watch ID """ @@ -334,7 +334,7 @@ async def put_watch( """ Creates a new watch, or updates an existing one. - ``_ + ``_ :param id: Watch ID :param actions: @@ -430,7 +430,7 @@ async def query_watches( """ Retrieves stored watches. - ``_ + ``_ :param from_: The offset from the first result to fetch. Needs to be non-negative. :param query: Optional, query filter watches to be returned. @@ -494,7 +494,7 @@ async def start( """ Starts Watcher if it is not already running. - ``_ + ``_ """ __path = "/_watcher/_start" __query: t.Dict[str, t.Any] = {} @@ -549,7 +549,7 @@ async def stats( """ Retrieves the current Watcher metrics. - ``_ + ``_ :param metric: Defines which additional metrics are included in the response. :param emit_stacktraces: Defines whether stack traces are generated for each @@ -589,7 +589,7 @@ async def stop( """ Stops Watcher if it is running. - ``_ + ``_ """ __path = "/_watcher/_stop" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_async/client/xpack.py b/elasticsearch/_async/client/xpack.py index 5e121da13..e36ab5ceb 100644 --- a/elasticsearch/_async/client/xpack.py +++ b/elasticsearch/_async/client/xpack.py @@ -45,7 +45,7 @@ async def info( """ Retrieves information about the installed X-Pack features. - ``_ + ``_ :param accept_enterprise: If this param is used it must be set to true :param categories: A comma-separated list of the information categories to include @@ -87,7 +87,7 @@ async def usage( """ Retrieves usage information about the installed X-Pack features. - ``_ + ``_ :param master_timeout: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and diff --git a/elasticsearch/_sync/client/__init__.py b/elasticsearch/_sync/client/__init__.py index a572580be..1b82f5c92 100644 --- a/elasticsearch/_sync/client/__init__.py +++ b/elasticsearch/_sync/client/__init__.py @@ -61,6 +61,7 @@ from .ml import MlClient from .monitoring import MonitoringClient from .nodes import NodesClient +from .query_ruleset import QueryRulesetClient from .rollup import RollupClient from .search_application import SearchApplicationClient from .searchable_snapshots import SearchableSnapshotsClient @@ -70,6 +71,7 @@ from .snapshot import SnapshotClient from .sql import SqlClient from .ssl import SslClient +from .synonyms import SynonymsClient from .tasks import TasksClient from .text_structure import TextStructureClient from .transform import TransformClient @@ -449,12 +451,14 @@ def __init__( self.migration = MigrationClient(self) self.ml = MlClient(self) self.monitoring = MonitoringClient(self) + self.query_ruleset = QueryRulesetClient(self) self.rollup = RollupClient(self) self.search_application = SearchApplicationClient(self) self.searchable_snapshots = SearchableSnapshotsClient(self) self.security = SecurityClient(self) self.slm = SlmClient(self) self.shutdown = ShutdownClient(self) + self.synonyms = SynonymsClient(self) self.sql = SqlClient(self) self.ssl = SslClient(self) self.text_structure = TextStructureClient(self) @@ -639,7 +643,7 @@ def bulk( """ Allows to perform multiple index/update/delete operations in a single request. - ``_ + ``_ :param operations: :param index: Default index for items which don't provide one @@ -724,7 +728,7 @@ def clear_scroll( """ Explicitly clears the search context for a scroll. - ``_ + ``_ :param scroll_id: """ @@ -767,7 +771,7 @@ def close_point_in_time( """ Close a point in time - ``_ + ``_ :param id: """ @@ -844,7 +848,7 @@ def count( """ Returns number of documents matching a query. - ``_ + ``_ :param index: A comma-separated list of indices to restrict the results :param allow_no_indices: Whether to ignore if a wildcard indices expression resolves @@ -961,7 +965,7 @@ def create( Creates a new document in the index. Returns a 409 response when a document with a same ID already exists in the index. - ``_ + ``_ :param index: The name of the index :param id: Document ID @@ -1046,7 +1050,7 @@ def delete( """ Removes a document from the index. - ``_ + ``_ :param index: The name of the index :param id: The document ID @@ -1174,7 +1178,7 @@ def delete_by_query( """ Deletes documents matching the provided query. - ``_ + ``_ :param index: A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -1338,7 +1342,7 @@ def delete_by_query_rethrottle( """ Changes the number of requests per second for a particular Delete By Query operation. - ``_ + ``_ :param task_id: The task id to rethrottle :param requests_per_second: The throttle to set on this request in floating sub-requests @@ -1382,7 +1386,7 @@ def delete_script( """ Deletes a script. - ``_ + ``_ :param id: Script ID :param master_timeout: Specify timeout for connection to master @@ -1451,7 +1455,7 @@ def exists( """ Returns information about whether a document exists in an index. - ``_ + ``_ :param index: The name of the index :param id: The document ID @@ -1551,7 +1555,7 @@ def exists_source( """ Returns information about whether a document source exists in an index. - ``_ + ``_ :param index: The name of the index :param id: The document ID @@ -1652,7 +1656,7 @@ def explain( """ Returns information about why a specific matches (or doesn't match) a query. - ``_ + ``_ :param index: The name of the index :param id: The document ID @@ -1773,7 +1777,7 @@ def field_caps( """ Returns the information about the capabilities of fields among multiple indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams @@ -1885,7 +1889,7 @@ def get( """ Returns a document. - ``_ + ``_ :param index: Name of the index that contains the document. :param id: Unique identifier of the document. @@ -1965,7 +1969,7 @@ def get_script( """ Returns a script. - ``_ + ``_ :param id: Script ID :param master_timeout: Specify timeout for connection to master @@ -2003,7 +2007,7 @@ def get_script_context( """ Returns all script contexts. - ``_ + ``_ """ __path = "/_script_context" __query: t.Dict[str, t.Any] = {} @@ -2034,7 +2038,7 @@ def get_script_languages( """ Returns available script types, languages and contexts - ``_ + ``_ """ __path = "/_script_language" __query: t.Dict[str, t.Any] = {} @@ -2093,7 +2097,7 @@ def get_source( """ Returns the source of a document. - ``_ + ``_ :param index: Name of the index that contains the document. :param id: Unique identifier of the document. @@ -2174,7 +2178,7 @@ def health_report( """ Returns the health of the cluster. - ``_ + ``_ :param feature: A feature of the cluster, as returned by the top-level health report API. @@ -2242,7 +2246,7 @@ def index( """ Creates or updates a document in an index. - ``_ + ``_ :param index: The name of the index :param document: @@ -2333,7 +2337,7 @@ def info( """ Returns basic information about the cluster. - ``_ + ``_ """ __path = "/" __query: t.Dict[str, t.Any] = {} @@ -2388,7 +2392,7 @@ def knn_search( """ Performs a kNN search. - ``_ + ``_ :param index: A comma-separated list of index names to search; use `_all` or to perform the operation on all indices @@ -2491,7 +2495,7 @@ def mget( """ Allows to get multiple documents in one request. - ``_ + ``_ :param index: Name of the index to retrieve documents from when `ids` are specified, or when a document in the `docs` array does not specify an index. @@ -2608,7 +2612,7 @@ def msearch( """ Allows to execute several search operations in one request. - ``_ + ``_ :param searches: :param index: Comma-separated list of data streams, indices, and index aliases @@ -2721,7 +2725,7 @@ def msearch_template( """ Allows to execute several search template operations in one request. - ``_ + ``_ :param search_templates: :param index: A comma-separated list of index names to use as default @@ -2805,7 +2809,7 @@ def mtermvectors( """ Returns multiple termvectors in one request. - ``_ + ``_ :param index: The index in which the document resides. :param docs: @@ -2920,7 +2924,7 @@ def open_point_in_time( """ Open a point in time that can be used in subsequent searches - ``_ + ``_ :param index: A comma-separated list of index names to open point in time; use `_all` or empty string to perform the operation on all indices @@ -2985,7 +2989,7 @@ def put_script( """ Creates or updates a script. - ``_ + ``_ :param id: Script ID :param script: @@ -3067,7 +3071,7 @@ def rank_eval( Allows to evaluate the quality of ranked search results over a set of typical search queries - ``_ + ``_ :param requests: A set of typical search requests, together with their provided ratings. @@ -3154,7 +3158,7 @@ def reindex( source documents by a query, changing the destination index settings, or fetching the documents from a remote cluster. - ``_ + ``_ :param dest: :param source: @@ -3243,7 +3247,7 @@ def reindex_rethrottle( """ Changes the number of requests per second for a particular Reindex operation. - ``_ + ``_ :param task_id: The task id to rethrottle :param requests_per_second: The throttle to set on this request in floating sub-requests @@ -3289,7 +3293,7 @@ def render_search_template( """ Allows to use the Mustache language to pre-render a search definition. - ``_ + ``_ :param id: The id of the stored search template :param file: @@ -3344,7 +3348,7 @@ def scripts_painless_execute( """ Allows an arbitrary script to be executed and a result to be returned - ``_ + ``_ :param context: :param context_setup: @@ -3395,7 +3399,7 @@ def scroll( """ Allows to retrieve a large numbers of results from a single search request. - ``_ + ``_ :param scroll_id: Scroll ID of the search. :param rest_total_hits_as_int: If true, the API response’s hit.total property @@ -3577,131 +3581,188 @@ def search( """ Returns results matching a query. - ``_ + ``_ - :param index: A comma-separated list of index names to search; use `_all` or - empty string to perform the operation on all indices - :param aggregations: - :param aggs: - :param 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) - :param allow_partial_search_results: Indicate if an error should be returned - if there is a partial search failure or timeout - :param analyze_wildcard: Specify whether wildcard and prefix queries should be - analyzed (default: false) - :param analyzer: The analyzer to use for the query string + :param index: Comma-separated list of data streams, indices, and aliases to search. + Supports wildcards (`*`). To search all data streams and indices, omit this + parameter or use `*` or `_all`. + :param aggregations: Defines the aggregations that are run as part of the search + request. + :param aggs: Defines the aggregations that are run as part of the search request. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. For + example, a request targeting `foo*,bar*` returns an error if an index starts + with `foo` but no index starts with `bar`. + :param allow_partial_search_results: If true, returns partial results if there + are shard request timeouts or shard failures. If false, returns an error + with no partial results. + :param analyze_wildcard: If true, wildcard and prefix queries are analyzed. This + parameter can only be used when the q query string parameter is specified. + :param analyzer: Analyzer to use for the query string. This parameter can only + be used when the q query string parameter is specified. :param batched_reduce_size: The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. - :param ccs_minimize_roundtrips: Indicates whether network round-trips should - be minimized as part of cross-cluster search requests execution - :param collapse: - :param default_operator: The default operator for query string query (AND or - OR) - :param df: The field to use as default where no field prefix is given in the - query string - :param docvalue_fields: Array of wildcard (*) patterns. The request returns doc - values for field names matching these patterns in the hits.fields property + :param ccs_minimize_roundtrips: If true, network round-trips between the coordinating + node and the remote clusters are minimized when executing cross-cluster search + (CCS) requests. + :param collapse: Collapses search results the values of the specified field. + :param default_operator: The default operator for query string query: AND or + OR. This parameter can only be used when the `q` query string parameter is + specified. + :param df: Field to use as default where no field prefix is given in the query + string. This parameter can only be used when the q query string parameter + is specified. + :param docvalue_fields: Array of wildcard (`*`) patterns. The request returns + doc values for field names matching these patterns in the `hits.fields` property of the response. - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. :param explain: If true, returns detailed information about score computation as part of a hit. :param ext: Configuration of search extensions defined by Elasticsearch plugins. - :param fields: Array of wildcard (*) patterns. The request returns values for - field names matching these patterns in the hits.fields property of the response. - :param from_: Starting document offset. By default, you cannot page through more - than 10,000 hits using the from and size parameters. To page through more - hits, use the search_after parameter. - :param highlight: - :param ignore_throttled: Whether specified concrete, expanded or aliased indices - should be ignored when throttled - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) + :param fields: Array of wildcard (`*`) patterns. The request returns values for + field names matching these patterns in the `hits.fields` property of the + response. + :param from_: Starting document offset. Needs to be non-negative. By default, + you cannot page through more than 10,000 hits using the `from` and `size` + parameters. To page through more hits, use the `search_after` parameter. + :param highlight: Specifies the highlighter to use for retrieving highlighted + snippets from one or more fields in your search results. + :param ignore_throttled: If `true`, concrete, expanded or aliased indices will + be ignored when frozen. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. :param indices_boost: Boosts the _score of documents from specified indices. :param knn: Defines the approximate kNN search to run. - :param lenient: Specify whether format-based query failures (such as providing - text to a numeric field) should be ignored - :param 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 - :param min_compatible_shard_node: The minimum compatible version that all shards - involved in search should have for this request to be successful - :param min_score: Minimum _score for matching documents. Documents with a lower - _score are not included in the search results. + :param lenient: If `true`, format-based query failures (such as providing text + to a numeric field) in the query string will be ignored. This parameter can + only be used when the `q` query string parameter is specified. + :param max_concurrent_shard_requests: Defines 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. + :param min_compatible_shard_node: The minimum version of the node that can handle + the request Any handling node with a lower version will fail the request. + :param min_score: Minimum `_score` for matching documents. Documents with a lower + `_score` are not included in the search results. :param pit: Limits the search to a point in time (PIT). If you provide a PIT, - you cannot specify an in the request path. - :param post_filter: - :param pre_filter_shard_size: A threshold that enforces a pre-filter roundtrip - to prefilter search shards based on query rewriting if the number of shards - the search request expands to exceeds the threshold. This filter roundtrip - can limit the number of shards significantly if for instance a shard can - not match any documents based on its rewrite method ie. if date filters are - mandatory to match but the shard bounds and the query are disjoint. - :param preference: Specify the node or shard the operation should be performed - on (default: random) - :param profile: - :param q: Query in the Lucene query string syntax + you cannot specify an `` in the request path. + :param post_filter: Use the `post_filter` parameter to filter search results. + The search hits are filtered after the aggregations are calculated. A post + filter has no impact on the aggregation results. + :param pre_filter_shard_size: Defines a threshold that enforces a pre-filter + roundtrip to prefilter search shards based on query rewriting if the number + of shards the search request expands to exceeds the threshold. This filter + roundtrip can limit the number of shards significantly if for instance a + shard can not match any documents based on its rewrite method (if date filters + are mandatory to match but the shard bounds and the query are disjoint). + When unspecified, the pre-filter phase is executed if any of these conditions + is met: the request targets more than 128 shards; the request targets one + or more read-only index; the primary sort of the query targets an indexed + field. + :param preference: Nodes and shards used for the search. By default, Elasticsearch + selects from eligible nodes and shards using adaptive replica selection, + accounting for allocation awareness. Valid values are: `_only_local` to run + the search only on shards on the local node; `_local` to, if possible, run + the search on shards on the local node, or if not, select shards using the + default method; `_only_nodes:,` to run the search on only + the specified nodes IDs, where, if suitable shards exist on more than one + selected node, use shards on those nodes using the default method, or if + none of the specified nodes are available, select shards from any available + node using the default method; `_prefer_nodes:,` to if + possible, run the search on the specified nodes IDs, or if not, select shards + using the default method; `_shards:,` to run the search only + on the specified shards; `` (any string that does not start + with `_`) to route searches with the same `` to the same shards + in the same order. + :param profile: Set to `true` to return detailed timing information about the + execution of individual components in a search request. NOTE: This is a debugging + tool and adds significant overhead to search execution. + :param q: Query in the Lucene query string syntax using query parameter search. + Query parameter searches do not support the full Elasticsearch Query DSL + but are handy for testing. :param query: Defines the search definition using the Query DSL. - :param rank: Defines the Reciprocal Rank Fusion (RRF) to use - :param request_cache: Specify if request cache should be used for this request - or not, defaults to index level setting - :param rescore: - :param rest_total_hits_as_int: Indicates whether hits.total should be rendered - as an integer or an object in the rest search response - :param routing: A comma-separated list of specific routing values + :param rank: Defines the Reciprocal Rank Fusion (RRF) to use. + :param request_cache: If `true`, the caching of search results is enabled for + requests where `size` is `0`. Defaults to index level settings. + :param rescore: Can be used to improve precision by reordering just the top (for + example 100 - 500) documents returned by the `query` and `post_filter` phases. + :param rest_total_hits_as_int: Indicates whether `hits.total` should be rendered + as an integer or an object in the rest search response. + :param routing: Custom value used to route operations to a specific shard. :param runtime_mappings: Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name. :param script_fields: Retrieve a script evaluation (based on different fields) for each hit. - :param scroll: Specify how long a consistent view of the index should be maintained - for scrolled search - :param search_after: - :param search_type: Search operation type - :param seq_no_primary_term: If true, returns sequence number and primary term - of the last modification of each hit. See Optimistic concurrency control. + :param scroll: Period to retain the search context for scrolling. See Scroll + search results. By default, this value cannot exceed `1d` (24 hours). You + can change this limit using the `search.max_keep_alive` cluster-level setting. + :param search_after: Used to retrieve the next page of hits using a set of sort + values from the previous page. + :param search_type: How distributed term frequencies are calculated for relevance + scoring. + :param seq_no_primary_term: If `true`, returns sequence number and primary term + of the last modification of each hit. :param size: The number of hits to return. By default, you cannot page through - more than 10,000 hits using the from and size parameters. To page through - more hits, use the search_after parameter. - :param slice: - :param sort: + more than 10,000 hits using the `from` and `size` parameters. To page through + more hits, use the `search_after` parameter. + :param slice: Can be used to split a scrolled search into multiple slices that + can be consumed independently. + :param sort: A comma-separated list of : pairs. :param source: Indicates which source fields are returned for matching documents. These fields are returned in the hits._source property of the search response. - :param source_excludes: A list of fields to exclude from the returned _source - field - :param source_includes: A list of fields to extract and return from the _source - field + :param source_excludes: A comma-separated list of source fields to exclude from + the response. You can also use this parameter to exclude fields from the + subset specified in `_source_includes` query parameter. If the `_source` + parameter is `false`, this parameter is ignored. + :param source_includes: A comma-separated list of source fields to include in + the response. If this parameter is specified, only these source fields are + returned. You can exclude fields from this subset using the `_source_excludes` + query parameter. If the `_source` parameter is `false`, this parameter is + ignored. :param stats: Stats groups to associate with the search. Each group maintains a statistics aggregation for its associated searches. You can retrieve these stats using the indices stats API. :param stored_fields: List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this - field is specified, the _source parameter defaults to false. You can pass - _source: true to return both source fields and stored fields in the search - response. - :param suggest: + field is specified, the `_source` parameter defaults to `false`. You can + pass `_source: true` to return both source fields and stored fields in the + search response. + :param suggest: Defines a suggester that provides similar looking terms based + on a provided text. :param suggest_field: Specifies which field to use for suggestions. - :param suggest_mode: Specify suggest mode - :param suggest_size: How many suggestions to return in response + :param suggest_mode: Specifies the suggest mode. This parameter can only be used + when the `suggest_field` and `suggest_text` query string parameters are specified. + :param suggest_size: Number of suggestions to return. This parameter can only + be used when the `suggest_field` and `suggest_text` query string parameters + are specified. :param suggest_text: The source text for which the suggestions should be returned. + This parameter can only be used when the `suggest_field` and `suggest_text` + query string parameters are specified. :param terminate_after: Maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. - Elasticsearch collects documents before sorting. Defaults to 0, which does - not terminate query execution early. + Elasticsearch collects documents before sorting. Use with caution. Elasticsearch + applies this parameter to each shard handling the request. When possible, + let Elasticsearch perform early termination automatically. Avoid specifying + this parameter for requests that target data streams with backing indices + across multiple data tiers. If set to `0` (default), the query does not terminate + early. :param timeout: Specifies the period of time to wait for a response from each shard. If no response is received before the timeout expires, the request fails and returns an error. Defaults to no timeout. :param track_scores: If true, calculate and return document scores, even if the scores are not used for sorting. :param track_total_hits: Number of hits matching the query to count accurately. - If true, the exact number of hits is returned at the cost of some performance. - If false, the response does not include the total number of hits matching - the query. Defaults to 10,000 hits. - :param typed_keys: Specify whether aggregation and suggester names should be - prefixed by their respective types in the response + If `true`, the exact number of hits is returned at the cost of some performance. + If `false`, the response does not include the total number of hits matching + the query. + :param typed_keys: If `true`, aggregation and suggester names are be prefixed + by their respective types in the response. :param version: If true, returns document version as part of a hit. """ if index not in SKIP_IN_PATH: @@ -3912,7 +3973,7 @@ def search_mvt( Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, or aliases to search :param field: Field containing geospatial data to return @@ -4065,7 +4126,7 @@ def search_shards( Returns information about the indices and shards that a search request would be executed against. - ``_ + ``_ :param index: A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -4165,7 +4226,7 @@ def search_template( """ Allows to use the Mustache language to pre-render a search definition. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (*). @@ -4276,7 +4337,7 @@ def terms_enum( the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and index aliases to search. Wildcard (*) expressions are supported. @@ -4370,7 +4431,7 @@ def termvectors( Returns information and statistics about terms in the fields of a particular document. - ``_ + ``_ :param index: The index in which the document resides. :param id: The id of the document, when not specified a doc param should be supplied. @@ -4497,7 +4558,7 @@ def update( """ Updates a document with a script or partial document. - ``_ + ``_ :param index: The name of the index :param id: Document ID @@ -4666,7 +4727,7 @@ def update_by_query( Performs an update on every document in the index without changing the source, for example to pick up a mapping change. - ``_ + ``_ :param index: A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices @@ -4842,7 +4903,7 @@ def update_by_query_rethrottle( """ Changes the number of requests per second for a particular Update By Query operation. - ``_ + ``_ :param task_id: The task id to rethrottle :param requests_per_second: The throttle to set on this request in floating sub-requests diff --git a/elasticsearch/_sync/client/async_search.py b/elasticsearch/_sync/client/async_search.py index 6934e6a25..e08164db4 100644 --- a/elasticsearch/_sync/client/async_search.py +++ b/elasticsearch/_sync/client/async_search.py @@ -40,7 +40,7 @@ def delete( Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - ``_ + ``_ :param id: A unique identifier for the async search. """ @@ -82,7 +82,7 @@ def get( Retrieves the results of a previously submitted async search request given its ID. - ``_ + ``_ :param id: A unique identifier for the async search. :param keep_alive: Specifies how long the async search should be available in @@ -139,7 +139,7 @@ def status( Retrieves the status of a previously submitted async search request given its ID. - ``_ + ``_ :param id: A unique identifier for the async search. """ @@ -310,7 +310,7 @@ def submit( """ Executes a search request asynchronously. - ``_ + ``_ :param index: A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices diff --git a/elasticsearch/_sync/client/autoscaling.py b/elasticsearch/_sync/client/autoscaling.py index bf78751a8..b05c8a396 100644 --- a/elasticsearch/_sync/client/autoscaling.py +++ b/elasticsearch/_sync/client/autoscaling.py @@ -40,7 +40,7 @@ def delete_autoscaling_policy( Deletes an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - ``_ + ``_ :param name: the name of the autoscaling policy """ @@ -76,7 +76,7 @@ def get_autoscaling_capacity( Gets the current autoscaling capacity based on the configured autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - ``_ + ``_ """ __path = "/_autoscaling/capacity" __query: t.Dict[str, t.Any] = {} @@ -109,7 +109,7 @@ def get_autoscaling_policy( Retrieves an autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - ``_ + ``_ :param name: the name of the autoscaling policy """ @@ -149,7 +149,7 @@ def put_autoscaling_policy( Creates a new autoscaling policy. Designed for indirect use by ECE/ESS and ECK. Direct use is not supported. - ``_ + ``_ :param name: the name of the autoscaling policy :param policy: diff --git a/elasticsearch/_sync/client/cat.py b/elasticsearch/_sync/client/cat.py index 3d83e09e1..dbe51382f 100644 --- a/elasticsearch/_sync/client/cat.py +++ b/elasticsearch/_sync/client/cat.py @@ -67,7 +67,7 @@ def aliases( Shows information about currently configured aliases to indices including filter and routing infos. - ``_ + ``_ :param name: A comma-separated list of aliases to retrieve. Supports wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`. @@ -152,7 +152,7 @@ def allocation( Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. - ``_ + ``_ :param node_id: Comma-separated list of node identifiers or names used to limit the returned information. @@ -230,7 +230,7 @@ def component_templates( """ Returns information about existing component_templates templates. - ``_ + ``_ :param name: The name of the component template. Accepts wildcard expressions. If omitted, all component templates are returned. @@ -306,7 +306,7 @@ def count( Provides quick access to the document count of the entire cluster, or individual indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -388,7 +388,7 @@ def fielddata( Shows how much heap memory is currently being used by fielddata on every data node in the cluster. - ``_ + ``_ :param fields: Comma-separated list of fields used to limit returned information. To retrieve all fields, omit this parameter. @@ -469,7 +469,7 @@ def health( """ Returns a concise representation of the cluster health. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -544,7 +544,7 @@ def help( """ Returns help for the Cat APIs. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -642,7 +642,7 @@ def indices( Returns information about indices: number of primaries and replicas, document counts, disk size, ... - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -737,7 +737,7 @@ def master( """ Returns information about the master node. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -856,7 +856,7 @@ def ml_data_frame_analytics( """ Gets configuration and usage information about data frame analytics jobs. - ``_ + ``_ :param id: The ID of the data frame analytics to fetch :param allow_no_match: Whether to ignore if a wildcard expression matches no @@ -987,7 +987,7 @@ def ml_datafeeds( """ Gets configuration and usage information about datafeeds. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. @@ -1124,7 +1124,7 @@ def ml_jobs( """ Gets configuration and usage information about anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param allow_no_match: Specifies what to do when the request: * Contains wildcard @@ -1264,17 +1264,21 @@ def ml_trained_models( """ Gets configuration and usage information about inference trained models. - ``_ + ``_ - :param model_id: The ID of the trained models stats to fetch - :param 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) - :param bytes: The unit in which to display byte values + :param model_id: A unique identifier for the trained model. + :param allow_no_match: Specifies what to do when the request: contains wildcard + expressions and there are no models that match; contains the `_all` string + or no identifiers and there are no matches; contains wildcard expressions + and there are only partial matches. If `true`, the API returns an empty array + when there are no matches and the subset of results when there are partial + matches. If `false`, the API returns a 404 status code when there are no + matches or only partial matches. + :param bytes: The unit used to display byte values. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. - :param from_: skips a number of trained models - :param h: Comma-separated list of column names to display + :param from_: Skips the specified number of transforms. + :param h: A comma-separated list of column names to display. :param help: When set to `true` will output available columns. This option can't be combined with any other query string option. :param local: If `true`, the request computes the list of selected nodes from @@ -1282,8 +1286,9 @@ def ml_trained_models( from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node. :param master_timeout: Period to wait for a connection to the master node. - :param s: Comma-separated list of column names or column aliases to sort by - :param size: specifies a max number of trained models to get + :param s: A comma-separated list of column names or aliases used to sort the + response. + :param size: The maximum number of transforms to display. :param v: When set to `true` will enable verbose output. """ if model_id not in SKIP_IN_PATH: @@ -1349,7 +1354,7 @@ def nodeattrs( """ Returns information about custom node attributes. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -1423,7 +1428,7 @@ def nodes( """ Returns basic statistics about performance of cluster nodes. - ``_ + ``_ :param bytes: The unit used to display byte values. :param format: Specifies the format to return the columnar data in, can be set @@ -1503,7 +1508,7 @@ def pending_tasks( """ Returns a concise representation of the cluster pending tasks. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -1572,7 +1577,7 @@ def plugins( """ Returns information about installed plugins across nodes node. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -1647,7 +1652,7 @@ def recovery( """ Returns information about index shard recoveries, both on-going completed. - ``_ + ``_ :param index: A comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams @@ -1732,7 +1737,7 @@ def repositories( """ Returns information about snapshot repositories registered in the cluster. - ``_ + ``_ :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. @@ -1805,10 +1810,12 @@ def segments( """ Provides low-level information about the segments in the shards of an index. - ``_ + ``_ - :param index: A comma-separated list of index names to limit the returned information - :param bytes: The unit in which to display byte values + :param index: A comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param bytes: The unit used to display byte values. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -1885,10 +1892,12 @@ def shards( """ Provides a detailed view of shard allocation on nodes. - ``_ + ``_ - :param index: A comma-separated list of index names to limit the returned information - :param bytes: The unit in which to display byte values + :param index: A comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param bytes: The unit used to display byte values. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -1965,15 +1974,18 @@ def snapshots( """ Returns all snapshots in a specific repository. - ``_ + ``_ - :param repository: Name of repository from which to fetch the snapshot information + :param repository: A comma-separated list of snapshot repositories used to limit + the request. Accepts wildcard expressions. `_all` returns all repositories. + If any repository fails during the request, Elasticsearch returns an error. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. :param help: When set to `true` will output available columns. This option can't be combined with any other query string option. - :param ignore_unavailable: Set to true to ignore unavailable snapshots + :param ignore_unavailable: If `true`, the response does not include information + from unavailable snapshots. :param local: If `true`, the request computes the list of selected nodes from the local cluster state. If `false` the list of selected nodes are computed from the cluster state of the master node. In both cases the coordinating @@ -2037,7 +2049,7 @@ def tasks( t.Union["t.Literal[-1]", "t.Literal[0]", str] ] = None, node_id: t.Optional[t.Union[t.List[str], t.Tuple[str, ...]]] = None, - parent_task: t.Optional[int] = None, + parent_task_id: t.Optional[str] = None, pretty: t.Optional[bool] = None, s: t.Optional[t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]] = None, v: t.Optional[bool] = None, @@ -2046,11 +2058,11 @@ def tasks( Returns information about the tasks currently executing on one or more nodes in the cluster. - ``_ + ``_ - :param actions: A comma-separated list of actions that should be returned. Leave - empty to return all. - :param detailed: Return detailed task information (default: false) + :param actions: The task action names, which are used to limit the response. + :param detailed: If `true`, the response includes detailed information about + shard recoveries. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -2061,8 +2073,9 @@ def tasks( from the cluster state of the master node. In both cases the coordinating node will send requests for further information to each selected node. :param master_timeout: Period to wait for a connection to the master node. - :param node_id: - :param parent_task: + :param node_id: Unique node identifiers, which are used to limit the response. + :param parent_task_id: The parent task identifier, which is used to limit the + response. :param s: List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting `:asc` or `:desc` as a suffix to the column name. @@ -2092,8 +2105,8 @@ def tasks( __query["master_timeout"] = master_timeout if node_id is not None: __query["node_id"] = node_id - if parent_task is not None: - __query["parent_task"] = parent_task + if parent_task_id is not None: + __query["parent_task_id"] = parent_task_id if pretty is not None: __query["pretty"] = pretty if s is not None: @@ -2129,9 +2142,10 @@ def templates( """ Returns information about existing templates. - ``_ + ``_ - :param name: A pattern that returned template names must match + :param name: The name of the template to return. Accepts wildcard expressions. + If omitted, all templates are returned. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -2209,10 +2223,10 @@ def thread_pool( Returns cluster-wide thread pool statistics per node. By default the active, queue and rejected statistics are returned for all thread pools. - ``_ + ``_ - :param thread_pool_patterns: List of thread pool names used to limit the request. - Accepts wildcard expressions. + :param thread_pool_patterns: A comma-separated list of thread pool names used + to limit the request. Accepts wildcard expressions. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. :param h: List of columns to appear in the response. Supports simple wildcards. @@ -2226,7 +2240,7 @@ def thread_pool( :param s: List of columns that determine how the table should be sorted. Sorting defaults to ascending and can be changed by setting `:asc` or `:desc` as a suffix to the column name. - :param time: Unit used to display time values. + :param time: The unit used to display time values. :param v: When set to `true` will enable verbose output. """ if thread_pool_patterns not in SKIP_IN_PATH: @@ -2339,16 +2353,21 @@ def transforms( """ Gets configuration and usage information about transforms. - ``_ + ``_ - :param transform_id: The id of the transform for which to get stats. '_all' or - '*' implies all transforms - :param allow_no_match: Whether to ignore if a wildcard expression matches no - transforms. (This includes `_all` string or when no transforms have been - specified) + :param transform_id: A transform identifier or a wildcard expression. If you + do not specify one of these options, the API returns information for all + transforms. + :param allow_no_match: Specifies what to do when the request: contains wildcard + expressions and there are no transforms that match; contains the `_all` string + or no identifiers and there are no matches; contains wildcard expressions + and there are only partial matches. If `true`, it returns an empty transforms + array when there are no matches and the subset of results when there are + partial matches. If `false`, the request returns a 404 status code when there + are no matches or only partial matches. :param format: Specifies the format to return the columnar data in, can be set to `text`, `json`, `cbor`, `yaml`, or `smile`. - :param from_: skips a number of transform configs, defaults to 0 + :param from_: Skips the specified number of transforms. :param h: Comma-separated list of column names to display. :param help: When set to `true` will output available columns. This option can't be combined with any other query string option. @@ -2359,8 +2378,8 @@ def transforms( :param master_timeout: Period to wait for a connection to the master node. :param s: Comma-separated list of column names or column aliases used to sort the response. - :param size: specifies a max number of transforms to get, defaults to 100 - :param time: Unit used to display time values. + :param size: The maximum number of transforms to obtain. + :param time: The unit used to display time values. :param v: When set to `true` will enable verbose output. """ if transform_id not in SKIP_IN_PATH: diff --git a/elasticsearch/_sync/client/ccr.py b/elasticsearch/_sync/client/ccr.py index 300bf5fb2..395ae3ec3 100644 --- a/elasticsearch/_sync/client/ccr.py +++ b/elasticsearch/_sync/client/ccr.py @@ -39,7 +39,7 @@ def delete_auto_follow_pattern( """ Deletes auto-follow patterns. - ``_ + ``_ :param name: The name of the auto follow pattern. """ @@ -96,7 +96,7 @@ def follow( """ Creates a new follower index configured to follow the referenced leader index. - ``_ + ``_ :param index: The name of the follower index :param leader_index: @@ -180,7 +180,7 @@ def follow_info( Retrieves information about all follower indices, including parameters and status for each follower index - ``_ + ``_ :param index: A comma-separated list of index patterns; use `_all` to perform the operation on all indices @@ -218,7 +218,7 @@ def follow_stats( Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. - ``_ + ``_ :param index: A comma-separated list of index patterns; use `_all` to perform the operation on all indices @@ -261,7 +261,7 @@ def forget_follower( """ Removes the follower retention leases from the leader. - ``_ + ``_ :param index: the name of the leader index for which specified follower retention leases should be removed @@ -312,7 +312,7 @@ def get_auto_follow_pattern( Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. - ``_ + ``_ :param name: Specifies the auto-follow pattern collection that you want to retrieve. If you do not specify a name, the API returns information for all collections. @@ -350,7 +350,7 @@ def pause_auto_follow_pattern( """ Pauses an auto-follow pattern - ``_ + ``_ :param name: The name of the auto follow pattern that should pause discovering new indices to follow. @@ -388,7 +388,7 @@ def pause_follow( Pauses a follower index. The follower index will not fetch any additional operations from the leader index. - ``_ + ``_ :param index: The name of the follower index that should pause following its leader index. @@ -452,7 +452,7 @@ def put_auto_follow_pattern( cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. - ``_ + ``_ :param name: The name of the collection of auto-follow patterns. :param remote_cluster: The remote cluster containing the leader indices to match @@ -566,7 +566,7 @@ def resume_auto_follow_pattern( """ Resumes an auto-follow pattern that has been paused - ``_ + ``_ :param name: The name of the auto follow pattern to resume discovering new indices to follow. @@ -619,7 +619,7 @@ def resume_follow( """ Resumes a follower index that has been paused - ``_ + ``_ :param index: The name of the follow index to resume following. :param max_outstanding_read_requests: @@ -693,7 +693,7 @@ def stats( """ Gets all stats related to cross-cluster replication. - ``_ + ``_ """ __path = "/_ccr/stats" __query: t.Dict[str, t.Any] = {} @@ -726,7 +726,7 @@ def unfollow( Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. - ``_ + ``_ :param index: The name of the follower index that should be turned into a regular index. diff --git a/elasticsearch/_sync/client/cluster.py b/elasticsearch/_sync/client/cluster.py index a245debd6..dc054d7ba 100644 --- a/elasticsearch/_sync/client/cluster.py +++ b/elasticsearch/_sync/client/cluster.py @@ -46,7 +46,7 @@ def allocation_explain( """ Provides explanations for shard allocations in the cluster. - ``_ + ``_ :param current_node: Specifies the node ID or the name of the node to only explain a shard that is currently located on the specified node. @@ -111,12 +111,15 @@ def delete_component_template( """ Deletes a component template - ``_ + ``_ :param name: Comma-separated list or wildcard expression of component template names used to limit the request. - :param master_timeout: Specify timeout for connection to master - :param timeout: Explicit operation timeout + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -154,7 +157,7 @@ def delete_voting_config_exclusions( """ Clears cluster voting config exclusions. - ``_ + ``_ :param wait_for_removal: Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions @@ -199,7 +202,7 @@ def exists_component_template( """ Returns information about whether a particular component template exist - ``_ + ``_ :param name: Comma-separated list of component template names used to limit the request. Wildcard (*) expressions are supported. @@ -252,15 +255,18 @@ def get_component_template( """ Returns one or more component templates - ``_ + ``_ - :param name: The comma separated names of the component templates - :param flat_settings: + :param name: Comma-separated list of component template names used to limit the + request. Wildcard (`*`) expressions are supported. + :param flat_settings: If `true`, returns settings in flat format. :param include_defaults: Return all default configurations for the component template (default: false) - :param local: Return local information, do not retrieve the state from master - node (default: false) - :param master_timeout: Explicit operation timeout for connection to master node + :param local: If `true`, the request retrieves information from the local node + only. If `false`, information is retrieved from the master node. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. """ if name not in SKIP_IN_PATH: __path = f"/_component_template/{_quote(name)}" @@ -308,12 +314,16 @@ def get_settings( """ Returns cluster settings. - ``_ + ``_ - :param flat_settings: Return settings in flat format (default: false) - :param include_defaults: Whether to return all default clusters setting. - :param master_timeout: Explicit operation timeout for connection to master node - :param timeout: Explicit operation timeout + :param flat_settings: If `true`, returns settings in flat format. + :param include_defaults: If `true`, returns default cluster settings from the + local node. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ __path = "/_cluster/settings" __query: t.Dict[str, t.Any] = {} @@ -394,7 +404,7 @@ def health( """ Returns basic information about the health of the cluster. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. To target @@ -470,6 +480,62 @@ def health( "GET", __path, params=__query, headers=__headers ) + @_rewrite_parameters() + def info( + self, + *, + target: t.Union[ + t.Union[ + "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", str + ], + t.Union[ + t.List[ + t.Union[ + "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", + str, + ] + ], + t.Tuple[ + t.Union[ + "t.Literal['_all', 'http', 'ingest', 'script', 'thread_pool']", + str, + ], + ..., + ], + ], + ], + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Returns different information about the cluster. + + ``_ + + :param target: Limits the information returned to the specific target. Supports + a comma-separated list, such as http,ingest. + """ + if target in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'target'") + __path = f"/_info/{_quote(target)}" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json"} + return self.perform_request( # type: ignore[return-value] + "GET", __path, params=__query, headers=__headers + ) + @_rewrite_parameters() def pending_tasks( self, @@ -489,11 +555,13 @@ def pending_tasks( Returns a list of any cluster-level changes (e.g. create index, update mapping, allocate or fail shard) which have not yet been executed. - ``_ + ``_ - :param local: Return local information, do not retrieve the state from master - node (default: false) - :param master_timeout: Specify timeout for connection to master + :param local: If `true`, the request retrieves information from the local node + only. If `false`, information is retrieved from the master node. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. """ __path = "/_cluster/pending_tasks" __query: t.Dict[str, t.Any] = {} @@ -535,7 +603,7 @@ def post_voting_config_exclusions( """ Updates the cluster voting config exclusions by node ids or node names. - ``_ + ``_ :param node_ids: A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify @@ -594,9 +662,17 @@ def put_component_template( """ Creates or updates a component template - ``_ + ``_ - :param name: The name of the template + :param name: Name of the component template to create. Elasticsearch includes + the following built-in component templates: `logs-mappings`; 'logs-settings`; + `metrics-mappings`; `metrics-settings`;`synthetics-mapping`; `synthetics-settings`. + Elastic Agent uses these templates to configure backing indices for its data + streams. If you use Elastic Agent and want to overwrite one of these templates, + set the `version` for your replacement template higher than the current version. + If you don’t use Elastic Agent and want to disable all built-in component + and index templates, set `stack.templates.enabled` to `false` using the cluster + update settings API. :param template: The template to be applied which includes mappings, settings, or aliases configuration. :param allow_auto_create: This setting overrides the value of the `action.auto_create_index` @@ -604,13 +680,18 @@ def put_component_template( created using that template even if auto-creation of indices is disabled via `actions.auto_create_index`. If set to `false` then data streams matching the template must always be explicitly created. - :param create: Whether the index template should only be added if new or can - also replace an existing one - :param master_timeout: Specify timeout for connection to master + :param create: If `true`, this request cannot replace or update existing component + templates. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. :param meta: Optional user metadata about the component template. May have any - contents. This map is not automatically generated by Elasticsearch. + contents. This map is not automatically generated by Elasticsearch. This + information is stored in the cluster state, so keeping it short is preferable. + To unset `_meta`, replace the template without specifying this information. :param version: Version number used to manage component templates externally. This number isn't automatically generated or incremented by Elasticsearch. + To unset a version, replace the template without specifying a version. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -667,7 +748,7 @@ def put_settings( """ Updates the cluster settings. - ``_ + ``_ :param flat_settings: Return settings in flat format (default: false) :param master_timeout: Explicit operation timeout for connection to master node @@ -715,7 +796,7 @@ def remote_info( """ Returns the information about configured remote clusters. - ``_ + ``_ """ __path = "/_remote/info" __query: t.Dict[str, t.Any] = {} @@ -761,7 +842,7 @@ def reroute( """ Allows to manually change the allocation of individual shards in the cluster. - ``_ + ``_ :param commands: Defines the commands to perform. :param dry_run: If true, then the request simulates the operation only and returns @@ -858,7 +939,7 @@ def state( """ Returns a comprehensive information about the state of the cluster. - ``_ + ``_ :param metric: Limit the information returned to the specified metrics :param index: A comma-separated list of index names; use `_all` or empty string @@ -936,15 +1017,15 @@ def stats( """ Returns high-level overview of cluster statistics. - ``_ + ``_ :param node_id: Comma-separated list of node filters used to limit returned information. Defaults to all nodes in the cluster. - :param flat_settings: Return settings in flat format (default: false) + :param flat_settings: If `true`, returns settings in flat format. :param timeout: Period to wait for each node to respond. If a node does not respond before its timeout expires, the response does not include its stats. However, - timed out nodes are included in the response’s _nodes.failed property. Defaults - to no timeout. + timed out nodes are included in the response’s `_nodes.failed` property. + Defaults to no timeout. """ if node_id not in SKIP_IN_PATH: __path = f"/_cluster/stats/nodes/{_quote(node_id)}" diff --git a/elasticsearch/_sync/client/dangling_indices.py b/elasticsearch/_sync/client/dangling_indices.py index 9ae7146bd..7cf1b0724 100644 --- a/elasticsearch/_sync/client/dangling_indices.py +++ b/elasticsearch/_sync/client/dangling_indices.py @@ -44,7 +44,7 @@ def delete_dangling_index( """ Deletes the specified dangling index - ``_ + ``_ :param index_uuid: The UUID of the dangling index :param accept_data_loss: Must be set to true in order to delete the dangling @@ -97,7 +97,7 @@ def import_dangling_index( """ Imports the specified dangling index - ``_ + ``_ :param index_uuid: The UUID of the dangling index :param accept_data_loss: Must be set to true in order to import the dangling @@ -144,7 +144,7 @@ def list_dangling_indices( """ Returns all dangling indices. - ``_ + ``_ """ __path = "/_dangling" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_sync/client/enrich.py b/elasticsearch/_sync/client/enrich.py index 0702daa0d..684d900af 100644 --- a/elasticsearch/_sync/client/enrich.py +++ b/elasticsearch/_sync/client/enrich.py @@ -39,9 +39,9 @@ def delete_policy( """ Deletes an existing enrich policy and its enrich index. - ``_ + ``_ - :param name: The name of the enrich policy + :param name: Enrich policy to delete. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -76,11 +76,11 @@ def execute_policy( """ Creates the enrich index for an existing enrich policy. - ``_ + ``_ - :param name: The name of the enrich policy - :param wait_for_completion: Should the request should block until the execution - is complete. + :param name: Enrich policy to execute. + :param wait_for_completion: If `true`, the request blocks other enrich policy + execution requests until complete. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -116,9 +116,10 @@ def get_policy( """ Gets information about an enrich policy. - ``_ + ``_ - :param name: A comma-separated list of enrich policy names + :param name: Comma-separated list of enrich policy names used to limit the request. + To return information for all enrich policies, omit this parameter. """ if name not in SKIP_IN_PATH: __path = f"/_enrich/policy/{_quote(name)}" @@ -158,12 +159,14 @@ def put_policy( """ Creates a new enrich policy. - ``_ + ``_ - :param name: The name of the enrich policy - :param geo_match: - :param match: - :param range: + :param name: Name of the enrich policy to create or update. + :param geo_match: Matches enrich data to incoming documents based on a `geo_shape` + query. + :param match: Matches enrich data to incoming documents based on a `term` query. + :param range: Matches a number, date, or IP address in incoming documents to + a range in the enrich index based on a `term` query. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -204,7 +207,7 @@ def stats( Gets enrich coordinator statistics and information about enrich policies that are currently executing. - ``_ + ``_ """ __path = "/_enrich/_stats" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_sync/client/eql.py b/elasticsearch/_sync/client/eql.py index e299f4ec9..ed09ca866 100644 --- a/elasticsearch/_sync/client/eql.py +++ b/elasticsearch/_sync/client/eql.py @@ -40,9 +40,11 @@ def delete( Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. - ``_ + ``_ - :param id: Identifier for the search to delete. + :param id: Identifier for the search to delete. A search ID is provided in the + EQL search API's response for an async search. A search ID is also provided + if the request’s `keep_on_completion` parameter is `true`. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") @@ -80,7 +82,7 @@ def get( """ Returns async results from previously executed Event Query Language (EQL) search - ``_ + `< https://www.elastic.co/guide/en/elasticsearch/reference/8.10/get-async-eql-search-api.html>`_ :param id: Identifier for the search. :param keep_alive: Period for which the search and its results are stored on @@ -127,7 +129,7 @@ def get_status( Returns the status of a previously submitted async or stored Event Query Language (EQL) search - ``_ + `< https://www.elastic.co/guide/en/elasticsearch/reference/8.10/get-async-eql-status-api.html>`_ :param id: Identifier for the search. """ @@ -215,7 +217,7 @@ def search( """ Returns results matching a query expressed in Event Query Language (EQL) - ``_ + ``_ :param index: The name of the index to scope the operation :param query: EQL query you wish to run. diff --git a/elasticsearch/_sync/client/features.py b/elasticsearch/_sync/client/features.py index 3afabb326..54da0c289 100644 --- a/elasticsearch/_sync/client/features.py +++ b/elasticsearch/_sync/client/features.py @@ -39,7 +39,7 @@ def get_features( Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot - ``_ + ``_ """ __path = "/_features" __query: t.Dict[str, t.Any] = {} @@ -70,7 +70,7 @@ def reset_features( """ Resets the internal state of features, usually by deleting system indices - ``_ + ``_ """ __path = "/_features/_reset" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_sync/client/fleet.py b/elasticsearch/_sync/client/fleet.py index 65a4b7a18..fda5110a2 100644 --- a/elasticsearch/_sync/client/fleet.py +++ b/elasticsearch/_sync/client/fleet.py @@ -44,7 +44,7 @@ def global_checkpoints( Returns the current global checkpoints for an index. This API is design for internal use by the fleet server project. - ``_ + ``_ :param index: A single index or index alias that resolves to a single index. :param checkpoints: A comma separated list of previous global checkpoints. When diff --git a/elasticsearch/_sync/client/graph.py b/elasticsearch/_sync/client/graph.py index faec2c57c..77b140be9 100644 --- a/elasticsearch/_sync/client/graph.py +++ b/elasticsearch/_sync/client/graph.py @@ -50,16 +50,20 @@ def explore( Explore extracted and summarized information about the documents and terms in an index. - ``_ + ``_ - :param index: A comma-separated list of index names to search; use `_all` or - empty string to perform the operation on all indices - :param connections: - :param controls: - :param query: - :param routing: Specific routing value - :param timeout: Explicit operation timeout - :param vertices: + :param index: Name of the index. + :param connections: Specifies or more fields from which you want to extract terms + that are associated with the specified vertices. + :param controls: Direct the Graph API how to build the graph. + :param query: A seed query that identifies the documents of interest. Can be + any valid Elasticsearch query. + :param routing: Custom value used to route operations to a specific shard. + :param timeout: Specifies the period of time to wait for a response from each + shard. If no response is received before the timeout expires, the request + fails and returns an error. Defaults to no timeout. + :param vertices: Specifies one or more fields that contain the terms you want + to include in the graph as vertices. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") diff --git a/elasticsearch/_sync/client/ilm.py b/elasticsearch/_sync/client/ilm.py index fba7f8be2..468569a51 100644 --- a/elasticsearch/_sync/client/ilm.py +++ b/elasticsearch/_sync/client/ilm.py @@ -44,7 +44,7 @@ def delete_lifecycle( Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. - ``_ + ``_ :param name: Identifier for the policy. :param master_timeout: Period to wait for a connection to the master node. If @@ -96,7 +96,7 @@ def explain_lifecycle( Retrieves information about the index's current lifecycle state, such as the currently executing phase, action, and step. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases to target. Supports wildcards (`*`). To target all data streams and indices, use `*` @@ -157,7 +157,7 @@ def get_lifecycle( Returns the specified policy definition. Includes the policy version and last modified date. - ``_ + ``_ :param name: Identifier for the policy. :param master_timeout: Period to wait for a connection to the master node. If @@ -202,7 +202,7 @@ def get_status( """ Retrieves the current index lifecycle management (ILM) status. - ``_ + ``_ """ __path = "/_ilm/status" __query: t.Dict[str, t.Any] = {} @@ -239,7 +239,7 @@ def migrate_to_data_tiers( Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing - ``_ + ``_ :param dry_run: If true, simulates the migration from node attributes based allocation filters to data tiers, but does not perform the migration. This provides @@ -292,7 +292,7 @@ def move_to_step( """ Manually moves an index into the specified step and executes that step. - ``_ + ``_ :param index: The name of the index whose lifecycle step is to change :param current_step: @@ -346,7 +346,7 @@ def put_lifecycle( """ Creates a lifecycle policy - ``_ + ``_ :param name: Identifier for the policy. :param master_timeout: Period to wait for a connection to the master node. If @@ -399,7 +399,7 @@ def remove_policy( """ Removes the assigned lifecycle policy and stops managing the specified index - ``_ + ``_ :param index: The name of the index to remove policy on """ @@ -435,7 +435,7 @@ def retry( """ Retries executing the policy for an index that is in the ERROR step. - ``_ + ``_ :param index: The name of the indices (comma-separated) whose failed lifecycle step is to be retry @@ -475,7 +475,7 @@ def start( """ Start the index lifecycle management (ILM) plugin. - ``_ + ``_ :param master_timeout: :param timeout: @@ -518,7 +518,7 @@ def stop( Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin - ``_ + ``_ :param master_timeout: :param timeout: diff --git a/elasticsearch/_sync/client/indices.py b/elasticsearch/_sync/client/indices.py index 55b4bd8b5..2ca1ca9ba 100644 --- a/elasticsearch/_sync/client/indices.py +++ b/elasticsearch/_sync/client/indices.py @@ -64,7 +64,7 @@ def add_block( """ Adds a block to an index. - ``_ + ``_ :param index: A comma separated list of indices to add a block to :param block: The block to add (one of read, write, read_only or metadata) @@ -144,18 +144,28 @@ def analyze( Performs the analysis process on a text and return the tokens breakdown of the text. - ``_ - - :param index: The name of the index to scope the operation - :param analyzer: - :param attributes: - :param char_filter: - :param explain: - :param field: - :param filter: - :param normalizer: - :param text: - :param tokenizer: + ``_ + + :param index: Index used to derive the analyzer. If specified, the `analyzer` + or field parameter overrides this value. If no index is specified or the + index does not have a default analyzer, the analyze API uses the standard + analyzer. + :param analyzer: The name of the analyzer that should be applied to the provided + `text`. This could be a built-in analyzer, or an analyzer that’s been configured + in the index. + :param attributes: Array of token attributes used to filter the output of the + `explain` parameter. + :param char_filter: Array of character filters used to preprocess characters + before the tokenizer. + :param explain: If `true`, the response includes token attributes and additional + details. + :param field: Field used to derive the analyzer. To use this parameter, you must + specify an index. If specified, the `analyzer` parameter overrides this value. + :param filter: Array of token filters used to apply after the tokenizer. + :param normalizer: Normalizer to use to convert text into a single token. + :param text: Text to analyze. If an array of strings is provided, it is analyzed + as a multi-value field. + :param tokenizer: Tokenizer to use to convert text into tokens. """ if index not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_analyze" @@ -239,21 +249,26 @@ def clear_cache( """ Clears all or specific caches for one or more indices. - ``_ + ``_ - :param index: A comma-separated list of index name to limit the operation - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param fielddata: Clear field data - :param fields: A comma-separated list of fields to clear when using the `fielddata` - parameter (default: all) - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param query: Clear query caches - :param request: Clear request cache + :param index: Comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param fielddata: If `true`, clears the fields cache. Use the `fields` parameter + to clear the cache of specific fields only. + :param fields: Comma-separated list of field names used to limit the `fielddata` + parameter. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param query: If `true`, clears the query cache. + :param request: If `true`, clears the request cache. """ if index not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_cache/clear" @@ -314,16 +329,20 @@ def clone( """ Clones an index - ``_ + ``_ - :param index: The name of the source index to clone - :param target: The name of the target index to clone into - :param aliases: - :param master_timeout: Specify timeout for connection to master - :param settings: - :param timeout: Explicit operation timeout - :param wait_for_active_shards: Set the number of active shards to wait for on - the cloned index before the operation returns. + :param index: Name of the source index to clone. + :param target: Name of the target index to create. + :param aliases: Aliases for the resulting index. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param settings: Configuration options for the target index. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. + :param wait_for_active_shards: The number of shard copies that must be active + before proceeding with the operation. Set to `all` or any positive integer + up to the total number of shards in the index (`number_of_replicas+1`). """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -401,20 +420,27 @@ def close( """ Closes an index. - ``_ + ``_ - :param index: A comma separated list of indices to close - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param master_timeout: Specify timeout for connection to master - :param timeout: Explicit operation timeout - :param wait_for_active_shards: Sets the number of active shards to wait for before - the operation returns. + :param index: Comma-separated list or wildcard expression of index names used + to limit the request. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. + :param wait_for_active_shards: The number of shard copies that must be active + before proceeding with the operation. Set to `all` or any positive integer + up to the total number of shards in the index (`number_of_replicas+1`). """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -472,17 +498,21 @@ def create( """ Creates an index with optional settings and mappings. - ``_ + ``_ - :param index: The name of the index - :param aliases: + :param index: Name of the index you wish to create. + :param aliases: Aliases for the index. :param mappings: Mapping for fields in the index. If specified, this mapping can include: - Field names - Field data types - Mapping parameters - :param master_timeout: Specify timeout for connection to master - :param settings: - :param timeout: Explicit operation timeout - :param wait_for_active_shards: Set the number of active shards to wait for before - the operation returns. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param settings: Configuration options for the index. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. + :param wait_for_active_shards: The number of shard copies that must be active + before proceeding with the operation. Set to `all` or any positive integer + up to the total number of shards in the index (`number_of_replicas+1`). """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -533,9 +563,13 @@ def create_data_stream( """ Creates a data stream - ``_ + ``_ - :param name: The name of the data stream + :param name: Name of the data stream, which must meet the following criteria: + Lowercase only; Cannot include `\\`, `/`, `*`, `?`, `"`, `<`, `>`, `|`, `,`, + `#`, `:`, or a space character; Cannot start with `-`, `_`, `+`, or `.ds-`; + Cannot be `.` or `..`; Cannot be longer than 255 bytes. Multi-byte characters + count towards this limit faster. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -587,11 +621,13 @@ def data_streams_stats( """ Provides statistics on operations happening in a data stream. - ``_ + ``_ - :param name: A comma-separated list of data stream names; use `_all` or empty - string to perform the operation on all data streams - :param expand_wildcards: + :param name: Comma-separated list of data streams used to limit the request. + Wildcard expressions (`*`) are supported. To target all data streams in a + cluster, omit this parameter or use `*`. + :param expand_wildcards: Type of data stream that wildcard patterns can match. + Supports comma-separated values, such as `open,hidden`. """ if name not in SKIP_IN_PATH: __path = f"/_data_stream/{_quote(name)}/_stats" @@ -652,17 +688,26 @@ def delete( """ Deletes an index. - ``_ + ``_ - :param index: A comma-separated list of indices to delete; use `_all` or `*` - string to delete all indices - :param allow_no_indices: Ignore if a wildcard expression resolves to no concrete - indices (default: false) - :param expand_wildcards: Whether wildcard expressions should get expanded to - open, closed, or hidden indices - :param ignore_unavailable: Ignore unavailable indexes (default: false) - :param master_timeout: Specify timeout for connection to master - :param timeout: Explicit operation timeout + :param index: Comma-separated list of indices to delete. You cannot specify index + aliases. By default, this parameter does not support wildcards (`*`) or `_all`. + To use wildcards or `_all`, set the `action.destructive_requires_name` cluster + setting to `false`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -711,14 +756,17 @@ def delete_alias( """ Deletes an alias. - ``_ + ``_ - :param index: A comma-separated list of index names (supports wildcards); use - `_all` for all indices - :param name: A comma-separated list of aliases to delete (supports wildcards); - use `_all` to delete all aliases for the specified indices. - :param master_timeout: Specify timeout for connection to master - :param timeout: Explicit timestamp for the document + :param index: Comma-separated list of data streams or indices used to limit the + request. Supports wildcards (`*`). + :param name: Comma-separated list of aliases to remove. Supports wildcards (`*`). + To remove all aliases, use `*` or `_all`. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -780,7 +828,7 @@ def delete_data_lifecycle( """ Deletes the data lifecycle of the selected data streams. - ``_ + ``_ :param name: A comma-separated list of data streams of which the data lifecycle will be deleted; use `*` to get all data streams @@ -845,12 +893,12 @@ def delete_data_stream( """ Deletes a data stream. - ``_ + ``_ - :param name: A comma-separated list of data streams to delete; use `*` to delete - all data streams - :param expand_wildcards: Whether wildcard expressions should get expanded to - open or closed indices (default: open) + :param name: Comma-separated list of data streams to delete. Wildcard (`*`) expressions + are supported. + :param expand_wildcards: Type of data stream that wildcard patterns can match. + Supports comma-separated values,such as `open,hidden`. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -890,7 +938,7 @@ def delete_index_template( """ Deletes an index template. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. @@ -940,11 +988,15 @@ def delete_template( """ Deletes an index template. - ``_ + ``_ - :param name: The name of the template - :param master_timeout: Specify timeout for connection to master - :param timeout: Explicit operation timeout + :param name: The name of the legacy index template to delete. Wildcard (`*`) + expressions are supported. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -1004,27 +1056,27 @@ def disk_usage( """ Analyzes the disk usage of each field of an index or data stream - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and aliases used to limit the request. It’s recommended to execute this API with a single index (or the latest backing index of a data stream) as the API consumes resources significantly. :param allow_no_indices: If false, the request returns an error if any wildcard - expression, index alias, or _all value targets only missing or closed indices. + expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For - example, a request targeting foo*,bar* returns an error if an index starts - with foo but no index starts with bar. + example, a request targeting `foo*,bar*` returns an error if an index starts + with `foo` but no index starts with `bar`. :param expand_wildcards: Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such - as open,hidden. - :param flush: If true, the API performs a flush before analysis. If false, the - response may not include uncommitted data. - :param ignore_unavailable: If true, missing or closed indices are not included + as `open,hidden`. + :param flush: If `true`, the API performs a flush before analysis. If `false`, + the response may not include uncommitted data. + :param ignore_unavailable: If `true`, missing or closed indices are not included in the response. :param run_expensive_tasks: Analyzing field disk usage is resource-intensive. - To use the API, this parameter must be set to true. + To use the API, this parameter must be set to `true`. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -1072,10 +1124,10 @@ def downsample( """ Downsample an index - ``_ + ``_ - :param index: The index to downsample - :param target_index: The name of the target index to store downsampled data + :param index: Name of the time series index to downsample. + :param target_index: Name of the index to create. :param config: """ if index in SKIP_IN_PATH: @@ -1138,19 +1190,23 @@ def exists( """ Returns information about whether a particular index exists. - ``_ + ``_ - :param index: A comma-separated list of index names - :param allow_no_indices: Ignore if a wildcard expression resolves to no concrete - indices (default: false) - :param expand_wildcards: Whether wildcard expressions should get expanded to - open or closed indices (default: open) - :param flat_settings: Return settings in flat format (default: false) - :param ignore_unavailable: Ignore unavailable indexes (default: false) - :param include_defaults: Whether to return all default setting for each of the - indices. - :param local: Return local information, do not retrieve the state from master - node (default: false) + :param index: Comma-separated list of data streams, indices, and aliases. Supports + wildcards (`*`). + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param flat_settings: If `true`, returns settings in flat format. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param include_defaults: If `true`, return all default settings in the response. + :param local: If `true`, the request retrieves information from the local node + only. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -1218,19 +1274,23 @@ def exists_alias( """ Returns information about whether a particular alias exists. - ``_ + ``_ - :param name: A comma-separated list of alias names to return - :param index: A comma-separated list of index names to filter aliases - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param local: Return local information, do not retrieve the state from master - node (default: false) + :param name: Comma-separated list of aliases to check. Supports wildcards (`*`). + :param index: Comma-separated list of data streams or indices used to limit the + request. Supports wildcards (`*`). To target all data streams and indices, + omit this parameter or use `*` or `_all`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, requests that include a missing data stream + or index in the target indices or data streams return an error. + :param local: If `true`, the request retrieves information from the local node + only. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -1280,7 +1340,7 @@ def exists_index_template( """ Returns information about whether a particular index template exists. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. @@ -1327,7 +1387,7 @@ def exists_template( """ Returns information about whether a particular index template exists. - ``_ + ``_ :param name: The comma separated names of the index templates :param flat_settings: Return settings in flat format (default: false) @@ -1378,7 +1438,7 @@ def explain_data_lifecycle( Retrieves information about the index's current DLM lifecycle, such as any potential encountered error, time since creation etc. - ``_ + ``_ :param index: The name of the index to explain :param include_defaults: indicates if the API should return the default values @@ -1451,12 +1511,12 @@ def field_usage_stats( """ Returns the field usage stats for each field of an index - ``_ + ``_ :param index: Comma-separated list or wildcard expression of index names used to limit the request. - :param allow_no_indices: If false, the request returns an error if any wildcard - expression, index alias, or _all value targets only missing or closed indices. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting `foo*,bar*` returns an error if an index starts with `foo` but no index starts with `bar`. @@ -1466,7 +1526,7 @@ def field_usage_stats( as `open,hidden`. :param fields: Comma-separated list or wildcard expressions of fields to include in the statistics. - :param ignore_unavailable: If true, missing or closed indices are not included + :param ignore_unavailable: If `true`, missing or closed indices are not included in the response. :param master_timeout: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and @@ -1545,25 +1605,25 @@ def flush( """ Performs the flush operation on one or more indices. - ``_ + ``_ - :param index: A comma-separated list of index names; use `_all` or empty string - for all indices - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param 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) - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param 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. + :param index: Comma-separated list of data streams, indices, and aliases to flush. + Supports wildcards (`*`). To flush all data streams and indices, omit this + parameter or use `*` or `_all`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param force: If `true`, the request forces a flush even if there are no changes + to commit to the index. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param wait_if_ongoing: If `true`, the flush operation blocks until execution + when another flush operation is running. If `false`, Elasticsearch returns + an error if you request a flush when another flush operation is running. """ if index not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_flush" @@ -1632,7 +1692,7 @@ def forcemerge( """ Performs the force merge operation on one or more indices. - ``_ + ``_ :param index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -1739,7 +1799,7 @@ def get( """ Returns information about one or more indices. - ``_ + ``_ :param index: Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (*) are supported. @@ -1834,19 +1894,24 @@ def get_alias( """ Returns an alias. - ``_ + ``_ - :param index: A comma-separated list of index names to filter aliases - :param name: A comma-separated list of alias names to return - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param local: Return local information, do not retrieve the state from master - node (default: false) + :param index: Comma-separated list of data streams or indices used to limit the + request. Supports wildcards (`*`). To target all data streams and indices, + omit this parameter or use `*` or `_all`. + :param name: Comma-separated list of aliases to retrieve. Supports wildcards + (`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param local: If `true`, the request retrieves information from the local node + only. """ if index not in SKIP_IN_PATH and name not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_alias/{_quote(name)}" @@ -1912,14 +1977,15 @@ def get_data_lifecycle( """ Returns the data lifecycle of the selected data streams. - ``_ + ``_ - :param name: A comma-separated list of data streams to get; use `*` to get all - data streams - :param expand_wildcards: Whether wildcard expressions should get expanded to - open or closed indices (default: open) - :param include_defaults: Return all relevant default configurations for the data - stream (default: false) + :param name: Comma-separated list of data streams to limit the request. Supports + wildcards (`*`). To target all data streams, omit this parameter or use `*` + or `_all`. + :param expand_wildcards: Type of data stream that wildcard patterns can match. + Supports comma-separated values, such as `open,hidden`. Valid values are: + `all`, `open`, `closed`, `hidden`, `none`. + :param include_defaults: If `true`, return all default settings in the response. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -1976,12 +2042,13 @@ def get_data_stream( """ Returns data streams. - ``_ + ``_ - :param name: A comma-separated list of data streams to get; use `*` to get all - data streams - :param expand_wildcards: Whether wildcard expressions should get expanded to - open or closed indices (default: open) + :param name: Comma-separated list of data stream names used to limit the request. + Wildcard (`*`) expressions are supported. If omitted, all data streams are + returned. + :param expand_wildcards: Type of data stream that wildcard patterns can match. + Supports comma-separated values, such as `open,hidden`. :param include_defaults: If true, returns all relevant default configurations for the index template. """ @@ -2045,21 +2112,25 @@ def get_field_mapping( """ Returns mapping for one or more fields. - ``_ + ``_ - :param fields: A comma-separated list of fields - :param index: A comma-separated list of index names - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param include_defaults: Whether the default mapping values should be returned - as well - :param local: Return local information, do not retrieve the state from master - node (default: false) + :param fields: Comma-separated list or wildcard expression of fields used to + limit returned information. + :param index: Comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param include_defaults: If `true`, return all default settings in the response. + :param local: If `true`, the request retrieves information from the local node + only. """ if fields in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'fields'") @@ -2114,7 +2185,7 @@ def get_index_template( """ Returns an index template. - ``_ + ``_ :param name: Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. @@ -2193,19 +2264,25 @@ def get_mapping( """ Returns mappings for one or more indices. - ``_ + ``_ - :param index: A comma-separated list of index names - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param local: Return local information, do not retrieve the state from master - node (default: false) - :param master_timeout: Specify timeout for connection to master + :param index: Comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param local: If `true`, the request retrieves information from the local node + only. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. """ if index not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_mapping" @@ -2277,24 +2354,30 @@ def get_settings( """ Returns settings for one or more indices. - ``_ + ``_ - :param index: A comma-separated list of index names; use `_all` or empty string - to perform the operation on all indices - :param name: The name of the settings that should be included - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param flat_settings: Return settings in flat format (default: false) - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param include_defaults: Whether to return all default setting for each of the - indices. - :param local: Return local information, do not retrieve the state from master - node (default: false) - :param master_timeout: Specify timeout for connection to master + :param index: Comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param name: Comma-separated list or wildcard expression of settings to retrieve. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. For + example, a request targeting `foo*,bar*` returns an error if an index starts + with foo but no index starts with `bar`. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. + :param flat_settings: If `true`, returns settings in flat format. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param include_defaults: If `true`, return all default settings in the response. + :param local: If `true`, the request retrieves information from the local node + only. If `false`, information is retrieved from the master node. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. """ if index not in SKIP_IN_PATH and name not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_settings/{_quote(name)}" @@ -2352,13 +2435,17 @@ def get_template( """ Returns an index template. - ``_ + ``_ - :param name: The comma separated names of the index templates - :param flat_settings: Return settings in flat format (default: false) - :param local: Return local information, do not retrieve the state from master - node (default: false) - :param master_timeout: Explicit operation timeout for connection to master node + :param name: Comma-separated list of index template names used to limit the request. + Wildcard (`*`) expressions are supported. To return all index templates, + omit this parameter or use a value of `_all` or `*`. + :param flat_settings: If `true`, returns settings in flat format. + :param local: If `true`, the request retrieves information from the local node + only. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. """ if name not in SKIP_IN_PATH: __path = f"/_template/{_quote(name)}" @@ -2399,9 +2486,9 @@ def migrate_to_data_stream( """ Migrates an alias to a data stream - ``_ + ``_ - :param name: The name of the alias to migrate + :param name: Name of the index alias to convert to a data stream. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -2439,7 +2526,7 @@ def modify_data_stream( """ Modifies a data stream - ``_ + ``_ :param actions: Actions to perform. """ @@ -2505,20 +2592,31 @@ def open( """ Opens an index. - ``_ + ``_ - :param index: A comma separated list of indices to open - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param master_timeout: Specify timeout for connection to master - :param timeout: Explicit operation timeout - :param wait_for_active_shards: Sets the number of active shards to wait for before - the operation returns. + :param index: Comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). By default, you must explicitly + name the indices you using to limit the request. To limit a request using + `_all`, `*`, or other wildcard expressions, change the `action.destructive_requires_name` + setting to false. You can update this setting in the `elasticsearch.yml` + file or using the cluster update settings API. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. + :param wait_for_active_shards: The number of shard copies that must be active + before proceeding with the operation. Set to `all` or any positive integer + up to the total number of shards in the index (`number_of_replicas+1`). """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -2565,7 +2663,7 @@ def promote_data_stream( Promotes a data stream from a replicated data stream managed by CCR to a regular data stream - ``_ + ``_ :param name: The name of the data stream """ @@ -2613,18 +2711,33 @@ def put_alias( """ Creates or updates an alias. - ``_ - - :param index: A comma-separated list of index names the alias should point to - (supports wildcards); use `_all` to perform the operation on all indices. - :param name: The name of the alias to be created or updated - :param filter: - :param index_routing: - :param is_write_index: - :param master_timeout: Specify timeout for connection to master - :param routing: - :param search_routing: - :param timeout: Explicit timestamp for the document + ``_ + + :param index: Comma-separated list of data streams or indices to add. Supports + wildcards (`*`). Wildcard patterns that match both data streams and indices + return an error. + :param name: Alias to update. If the alias doesn’t exist, the request creates + it. Index alias names support date math. + :param filter: Query used to limit documents the alias can access. + :param index_routing: Value used to route indexing operations to a specific shard. + If specified, this overwrites the `routing` value for indexing operations. + Data stream aliases don’t support this parameter. + :param is_write_index: If `true`, sets the write index or data stream for the + alias. If an alias points to multiple indices or data streams and `is_write_index` + isn’t set, the alias rejects write requests. If an index alias points to + one index and `is_write_index` isn’t set, the index automatically acts as + the write index. Data stream aliases don’t automatically set a write data + stream, even if the alias points to one data stream. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param routing: Value used to route indexing and search operations to a specific + shard. Data stream aliases don’t support this parameter. + :param search_routing: Value used to route search operations to a specific shard. + If specified, this overwrites the `routing` value for search operations. + Data stream aliases don’t support this parameter. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -2706,15 +2819,22 @@ def put_data_lifecycle( """ Updates the data lifecycle of the selected data streams. - ``_ - - :param name: A comma-separated list of data streams whose lifecycle will be updated; - use `*` to set the lifecycle to all data streams - :param data_retention: - :param expand_wildcards: Whether wildcard expressions should get expanded to - open or closed indices (default: open) - :param master_timeout: Specify timeout for connection to master - :param timeout: Explicit timestamp for the document + ``_ + + :param name: Comma-separated list of data streams used to limit the request. + Supports wildcards (`*`). To target all data streams use `*` or `_all`. + :param data_retention: If defined, every document added to this data stream will + be stored at least for this time frame. Any time after this duration the + document could be deleted. When empty, every document in this data stream + will be stored indefinitely. + :param expand_wildcards: Type of data stream that wildcard patterns can match. + Supports comma-separated values, such as `open,hidden`. Valid values are: + `all`, `hidden`, `open`, `closed`, `none`. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -2774,18 +2894,29 @@ def put_index_template( """ Creates or updates an index template. - ``_ + ``_ :param name: Index or template name - :param composed_of: - :param create: Whether the index template should only be added if new or can - also replace an existing one - :param data_stream: - :param index_patterns: - :param meta: - :param priority: - :param template: - :param version: + :param composed_of: An ordered list of component template names. Component templates + are merged in the order specified, meaning that the last component template + specified has the highest precedence. + :param create: If `true`, this request cannot replace or update existing index + templates. + :param data_stream: If this object is included, the template is used to create + data streams and their backing indices. Supports an empty object. Data streams + require a matching index template with a `data_stream` object. + :param index_patterns: Name of the index template to create. + :param meta: Optional user metadata about the index template. May have any contents. + This map is not automatically generated by Elasticsearch. + :param priority: Priority to determine index template precedence when a new data + stream or index is created. The index template with the highest priority + is chosen. If no priority is specified the template is treated as though + it is of priority 0 (lowest priority). This number is not automatically generated + by Elasticsearch. + :param template: Template to be applied. It may optionally include an `aliases`, + `mappings`, or `settings` configuration. + :param version: Version number used to manage index templates externally. This + number is not automatically generated by Elasticsearch. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -2892,25 +3023,29 @@ def put_mapping( """ Updates the index mappings. - ``_ + ``_ :param index: A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. - :param 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) + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. :param date_detection: Controls whether dynamic date detection is enabled. :param dynamic: Controls whether new fields are added dynamically. :param dynamic_date_formats: If date detection is enabled then new string fields are checked against 'dynamic_date_formats' and if the value matches then a new date field is added instead of string. :param dynamic_templates: Specify dynamic templates for the mapping. - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. :param field_names: Control whether field names are enabled for the index. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param master_timeout: Specify timeout for connection to master + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. :param meta: A mapping type can have custom meta data associated with it. These are not used at all by Elasticsearch, but can be used to store application-specific metadata. @@ -2921,9 +3056,10 @@ def put_mapping( :param routing: Enable making a routing value required on indexed documents. :param runtime: Mapping of runtime fields for the index. :param source: Control whether the _source field is enabled on the index. - :param timeout: Explicit operation timeout - :param write_index_only: When true, applies mappings only to the write index - of an alias or data stream + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. + :param write_index_only: If `true`, the mappings are applied only to the current + write index for the target. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -3021,23 +3157,29 @@ def put_settings( """ Updates the index settings. - ``_ + ``_ :param settings: - :param index: A comma-separated list of index names; use `_all` or empty string - to perform the operation on all indices - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param flat_settings: Return settings in flat format (default: false) - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param master_timeout: Specify timeout for connection to master - :param preserve_existing: Whether to update existing settings. If set to `true` - existing settings on an index remain unchanged, the default is `false` - :param timeout: Explicit operation timeout + :param index: Comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. For + example, a request targeting `foo*,bar*` returns an error if an index starts + with `foo` but no index starts with `bar`. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. + :param flat_settings: If `true`, returns settings in flat format. + :param ignore_unavailable: If `true`, returns settings in flat format. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param preserve_existing: If `true`, existing index settings remain unchanged. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ if settings is None: raise ValueError("Empty value passed for parameter 'settings'") @@ -3105,13 +3247,13 @@ def put_template( """ Creates or updates an index template. - ``_ + ``_ :param name: The name of the template :param aliases: Aliases for the index. :param create: If true, this request cannot replace or update existing index templates. - :param flat_settings: + :param flat_settings: If `true`, returns settings in flat format. :param index_patterns: Array of wildcard expressions used to match the names of indices during creation. :param mappings: Mapping for fields in the index. @@ -3123,7 +3265,8 @@ def put_template( Templates with higher 'order' values are merged later, overriding templates with lower values. :param settings: Configuration options for the index. - :param timeout: + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. :param version: Version number used to manage index templates externally. This number is not automatically generated by Elasticsearch. """ @@ -3182,12 +3325,14 @@ def recovery( """ Returns information about ongoing index shard recoveries. - ``_ + ``_ - :param index: A comma-separated list of index names; use `_all` or empty string - to perform the operation on all indices - :param active_only: Display only those recoveries that are currently on-going - :param detailed: Whether to display detailed information about shard recovery + :param index: Comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param active_only: If `true`, the response only includes ongoing shard recoveries. + :param detailed: If `true`, the response includes detailed information about + shard recoveries. """ if index not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_recovery" @@ -3246,17 +3391,20 @@ def refresh( """ Performs the refresh operation in one or more indices. - ``_ + ``_ - :param index: A comma-separated list of index names; use `_all` or empty string - to perform the operation on all indices - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) + :param index: Comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. """ if index not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_refresh" @@ -3317,7 +3465,7 @@ def reload_search_analyzers( """ Reloads an index's search analyzers and their resources. - ``_ + ``_ :param index: A comma-separated list of index names to reload analyzers for :param allow_no_indices: Whether to ignore if a wildcard indices expression resolves @@ -3384,11 +3532,15 @@ def resolve_index( """ Returns information about any matching indices, aliases, and data streams - ``_ + ``_ - :param name: A comma-separated list of names or wildcard expressions - :param expand_wildcards: Whether wildcard expressions should get expanded to - open or closed indices (default: open) + :param name: Comma-separated name(s) or index pattern(s) of the indices, aliases, + and data streams to resolve. Resources on remote clusters can be specified + using the ``:`` syntax. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -3440,20 +3592,33 @@ def rollover( Updates an alias to point to a new index when the existing index is considered to be too large or too old. - ``_ - - :param alias: The name of the alias to rollover - :param new_index: The name of the rollover index - :param aliases: - :param conditions: - :param 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 - :param mappings: - :param master_timeout: Specify timeout for connection to master - :param settings: - :param timeout: Explicit operation timeout - :param wait_for_active_shards: Set the number of active shards to wait for on - the newly created rollover index before the operation returns. + ``_ + + :param alias: Name of the data stream or index alias to roll over. + :param new_index: Name of the index to create. Supports date math. Data streams + do not support this parameter. + :param aliases: Aliases for the target index. Data streams do not support this + parameter. + :param conditions: Conditions for the rollover. If specified, Elasticsearch only + performs the rollover if the current index satisfies these conditions. If + this parameter is not specified, Elasticsearch performs the rollover unconditionally. + If conditions are specified, at least one of them must be a `max_*` condition. + The index will rollover if any `max_*` condition is satisfied and all `min_*` + conditions are satisfied. + :param dry_run: If `true`, checks whether the current index satisfies the specified + conditions but does not perform a rollover. + :param mappings: Mapping for fields in the index. If specified, this mapping + can include field names, field data types, and mapping paramaters. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param settings: Configuration options for the index. Data streams do not support + this parameter. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. + :param wait_for_active_shards: The number of shard copies that must be active + before proceeding with the operation. Set to all or any positive integer + up to the total number of shards in the index (`number_of_replicas+1`). """ if alias in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'alias'") @@ -3534,18 +3699,21 @@ def segments( """ Provides low-level information about segments in a Lucene index. - ``_ + ``_ - :param index: A comma-separated list of index names; use `_all` or empty string - to perform the operation on all indices - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param verbose: Includes detailed memory usage by Lucene. + :param index: Comma-separated list of data streams, indices, and aliases used + to limit the request. Supports wildcards (`*`). To target all data streams + and indices, omit this parameter or use `*` or `_all`. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param verbose: If `true`, the request returns a verbose response. """ if index not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_segments" @@ -3619,7 +3787,7 @@ def shard_stores( """ Provides store information for shard copies of indices. - ``_ + ``_ :param index: List of data streams, indices, and aliases used to limit the request. :param allow_no_indices: If false, the request returns an error if any wildcard @@ -3685,16 +3853,20 @@ def shrink( """ Allow to shrink an existing index into a new index with fewer primary shards. - ``_ + ``_ - :param index: The name of the source index to shrink - :param target: The name of the target index to shrink into - :param aliases: - :param master_timeout: Specify timeout for connection to master - :param settings: - :param timeout: Explicit operation timeout - :param wait_for_active_shards: Set the number of active shards to wait for on - the shrunken index before the operation returns. + :param index: Name of the source index to shrink. + :param target: Name of the target index to create. + :param aliases: The key is the alias name. Index alias names support date math. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param settings: Configuration options for the target index. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. + :param wait_for_active_shards: The number of shard copies that must be active + before proceeding with the operation. Set to `all` or any positive integer + up to the total number of shards in the index (`number_of_replicas+1`). """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -3763,26 +3935,43 @@ def simulate_index_template( """ Simulate matching the given index name against the index templates in the system - ``_ + ``_ :param name: Index or template name to simulate - :param allow_auto_create: - :param composed_of: + :param allow_auto_create: This setting overrides the value of the `action.auto_create_index` + cluster setting. If set to `true` in a template, then indices can be automatically + created using that template even if auto-creation of indices is disabled + via `actions.auto_create_index`. If set to `false`, then indices or data + streams matching the template must always be explicitly created, and may + never be automatically created. + :param composed_of: An ordered list of component template names. Component templates + are merged in the order specified, meaning that the last component template + specified has the highest precedence. :param create: If `true`, the template passed in the body is only used if no existing templates match the same index patterns. If `false`, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation. - :param data_stream: + :param data_stream: If this object is included, the template is used to create + data streams and their backing indices. Supports an empty object. Data streams + require a matching index template with a `data_stream` object. :param include_defaults: If true, returns all relevant default configurations for the index template. - :param index_patterns: + :param index_patterns: Array of wildcard (`*`) expressions used to match the + names of data streams and indices during creation. :param master_timeout: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. - :param meta: - :param priority: - :param template: - :param version: + :param meta: Optional user metadata about the index template. May have any contents. + This map is not automatically generated by Elasticsearch. + :param priority: Priority to determine index template precedence when a new data + stream or index is created. The index template with the highest priority + is chosen. If no priority is specified the template is treated as though + it is of priority 0 (lowest priority). This number is not automatically generated + by Elasticsearch. + :param template: Template to be applied. It may optionally include an `aliases`, + `mappings`, or `settings` configuration. + :param version: Version number used to manage index templates externally. This + number is not automatically generated by Elasticsearch. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'name'") @@ -3851,7 +4040,7 @@ def simulate_template( """ Simulate resolving the given template name or body - ``_ + ``_ :param name: Name of the index template to simulate. To test a template configuration before you add it to the cluster, omit this parameter and specify the template @@ -3923,16 +4112,20 @@ def split( """ Allows you to split an existing index into a new index with more primary shards. - ``_ + ``_ - :param index: The name of the source index to split - :param target: The name of the target index to split into - :param aliases: - :param master_timeout: Specify timeout for connection to master - :param settings: - :param timeout: Explicit operation timeout - :param wait_for_active_shards: Set the number of active shards to wait for on - the shrunken index before the operation returns. + :param index: Name of the source index to split. + :param target: Name of the target index to create. + :param aliases: Aliases for the resulting index. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param settings: Configuration options for the target index. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. + :param wait_for_active_shards: The number of shard copies that must be active + before proceeding with the operation. Set to `all` or any positive integer + up to the total number of shards in the index (`number_of_replicas+1`). """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -4022,7 +4215,7 @@ def stats( """ Provides statistics on operations happening in an index. - ``_ + ``_ :param index: A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices @@ -4130,20 +4323,26 @@ def unfreeze( Unfreezes an index. When a frozen index is unfrozen, the index goes through the normal recovery process and becomes writeable again. - ``_ + ``_ - :param index: The name of the index to unfreeze - :param 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) - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param master_timeout: Specify timeout for connection to master - :param timeout: Explicit operation timeout - :param wait_for_active_shards: Sets the number of active shards to wait for before - the operation returns. + :param index: Identifier for the index. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. + :param wait_for_active_shards: The number of shard copies that must be active + before proceeding with the operation. Set to `all` or any positive integer + up to the total number of shards in the index (`number_of_replicas+1`). """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") @@ -4197,11 +4396,14 @@ def update_aliases( """ Updates index aliases. - ``_ + ``_ - :param actions: - :param master_timeout: Specify timeout for connection to master - :param timeout: Request timeout + :param actions: Actions to perform. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ __path = "/_aliases" __body: t.Dict[str, t.Any] = {} @@ -4272,33 +4474,38 @@ def validate_query( """ Allows a user to validate a potentially expensive query without executing it. - ``_ + ``_ - :param index: A comma-separated list of index names to restrict the operation; - use `_all` or empty string to perform the operation on all indices - :param all_shards: Execute validation on all shards instead of one random shard - per index - :param 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) - :param analyze_wildcard: Specify whether wildcard and prefix queries should be - analyzed (default: false) - :param analyzer: The analyzer to use for the query string - :param default_operator: The default operator for query string query (AND or - OR) - :param df: The field to use as default where no field prefix is given in the - query string - :param expand_wildcards: Whether to expand wildcard expression to concrete indices - that are open, closed or both. - :param explain: Return detailed information about the error - :param ignore_unavailable: Whether specified concrete indices should be ignored - when unavailable (missing or closed) - :param lenient: Specify whether format-based query failures (such as providing - text to a numeric field) should be ignored - :param q: Query in the Lucene query string syntax - :param query: - :param rewrite: Provide a more detailed explanation showing the actual Lucene - query that will be executed. + :param index: Comma-separated list of data streams, indices, and aliases to search. + Supports wildcards (`*`). To search all data streams or indices, omit this + parameter or use `*` or `_all`. + :param all_shards: If `true`, the validation is executed on all shards instead + of one random shard per index. + :param allow_no_indices: If `false`, the request returns an error if any wildcard + expression, index alias, or `_all` value targets only missing or closed indices. + This behavior applies even if the request targets other open indices. + :param analyze_wildcard: If `true`, wildcard and prefix queries are analyzed. + :param analyzer: Analyzer to use for the query string. This parameter can only + be used when the `q` query string parameter is specified. + :param default_operator: The default operator for query string query: `AND` or + `OR`. + :param df: Field to use as default where no field prefix is given in the query + string. This parameter can only be used when the `q` query string parameter + is specified. + :param expand_wildcards: Type of index that wildcard patterns can match. If the + request can target data streams, this argument determines whether wildcard + expressions match hidden data streams. Supports comma-separated values, such + as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`. + :param explain: If `true`, the response returns detailed information if an error + has occurred. + :param ignore_unavailable: If `false`, the request returns an error if it targets + a missing or closed index. + :param lenient: If `true`, format-based query failures (such as providing text + to a numeric field) in the query string will be ignored. + :param q: Query in the Lucene query string syntax. + :param query: Query in the Lucene query string syntax. + :param rewrite: If `true`, returns a more detailed explanation showing the actual + Lucene query that will be executed. """ if index not in SKIP_IN_PATH: __path = f"/{_quote(index)}/_validate/query" diff --git a/elasticsearch/_sync/client/ingest.py b/elasticsearch/_sync/client/ingest.py index b6ef297dd..77dff86ca 100644 --- a/elasticsearch/_sync/client/ingest.py +++ b/elasticsearch/_sync/client/ingest.py @@ -43,11 +43,15 @@ def delete_pipeline( """ Deletes a pipeline. - ``_ + ``_ - :param id: Pipeline ID - :param master_timeout: Explicit operation timeout for connection to master node - :param timeout: Explicit operation timeout + :param id: Pipeline ID or wildcard expression of pipeline IDs used to limit the + request. To delete all ingest pipelines in a cluster, use a value of `*`. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. + :param timeout: Period to wait for a response. If no response is received before + the timeout expires, the request fails and returns an error. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") @@ -84,7 +88,7 @@ def geo_ip_stats( """ Returns statistical information about geoip databases - ``_ + ``_ """ __path = "/_ingest/geoip/stats" __query: t.Dict[str, t.Any] = {} @@ -120,10 +124,13 @@ def get_pipeline( """ Returns a pipeline. - ``_ + ``_ - :param id: Comma separated list of pipeline ids. Wildcards supported - :param master_timeout: Explicit operation timeout for connection to master node + :param id: Comma-separated list of pipeline IDs to retrieve. Wildcard (`*`) expressions + are supported. To get all ingest pipelines, omit this parameter or use `*`. + :param master_timeout: Period to wait for a connection to the master node. If + no response is received before the timeout expires, the request fails and + returns an error. :param summary: Return pipelines without their definitions (default: false) """ if id not in SKIP_IN_PATH: @@ -162,7 +169,7 @@ def processor_grok( """ Returns a list of the built-in patterns. - ``_ + ``_ """ __path = "/_ingest/processor/grok" __query: t.Dict[str, t.Any] = {} @@ -211,7 +218,7 @@ def put_pipeline( """ Creates or updates a pipeline. - ``_ + ``_ :param id: ID of the ingest pipeline to create or update. :param description: Description of the ingest pipeline. @@ -292,13 +299,16 @@ def simulate( """ Allows to simulate a pipeline with example documents. - ``_ + ``_ - :param id: Pipeline ID - :param docs: - :param pipeline: - :param verbose: Verbose mode. Display data output for each processor in executed - pipeline + :param id: Pipeline to test. If you don’t specify a `pipeline` in the request + body, this parameter is required. + :param docs: Sample documents to test in the pipeline. + :param pipeline: Pipeline to test. If you don’t specify the `pipeline` request + path parameter, this parameter is required. If you specify both this and + the request path parameter, the API only uses the request path parameter. + :param verbose: If `true`, the response includes output data for each processor + in the executed pipeline. """ if id not in SKIP_IN_PATH: __path = f"/_ingest/pipeline/{_quote(id)}/_simulate" diff --git a/elasticsearch/_sync/client/license.py b/elasticsearch/_sync/client/license.py index 4287857f1..b1db405ff 100644 --- a/elasticsearch/_sync/client/license.py +++ b/elasticsearch/_sync/client/license.py @@ -38,7 +38,7 @@ def delete( """ Deletes licensing information for the cluster - ``_ + ``_ """ __path = "/_license" __query: t.Dict[str, t.Any] = {} @@ -71,7 +71,7 @@ def get( """ Retrieves licensing information for the cluster - ``_ + ``_ :param accept_enterprise: If `true`, this parameter returns enterprise for Enterprise license types. If `false`, this parameter returns platinum for both platinum @@ -113,7 +113,7 @@ def get_basic_status( """ Retrieves information about the status of the basic license. - ``_ + ``_ """ __path = "/_license/basic_status" __query: t.Dict[str, t.Any] = {} @@ -144,7 +144,7 @@ def get_trial_status( """ Retrieves information about the status of the trial license. - ``_ + ``_ """ __path = "/_license/trial_status" __query: t.Dict[str, t.Any] = {} @@ -182,7 +182,7 @@ def post( """ Updates the license for the cluster. - ``_ + ``_ :param acknowledge: Specifies whether you acknowledge the license changes. :param license: @@ -230,7 +230,7 @@ def post_start_basic( """ Starts an indefinite basic license. - ``_ + ``_ :param acknowledge: whether the user has acknowledged acknowledge messages (default: false) @@ -268,7 +268,7 @@ def post_start_trial( """ starts a limited time trial license. - ``_ + ``_ :param acknowledge: whether the user has acknowledged acknowledge messages (default: false) diff --git a/elasticsearch/_sync/client/logstash.py b/elasticsearch/_sync/client/logstash.py index 6b4017b6f..f35c4b927 100644 --- a/elasticsearch/_sync/client/logstash.py +++ b/elasticsearch/_sync/client/logstash.py @@ -39,9 +39,9 @@ def delete_pipeline( """ Deletes Logstash Pipelines used by Central Management - ``_ + ``_ - :param id: The ID of the Pipeline + :param id: Identifier for the pipeline. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") @@ -75,9 +75,9 @@ def get_pipeline( """ Retrieves Logstash Pipelines used by Central Management - ``_ + ``_ - :param id: A comma-separated list of Pipeline IDs + :param id: Comma-separated list of pipeline identifiers. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'id'") @@ -117,9 +117,9 @@ def put_pipeline( """ Adds and updates Logstash Pipelines used for Central Management - ``_ + ``_ - :param id: The ID of the Pipeline + :param id: Identifier for the pipeline. :param pipeline: """ if id in SKIP_IN_PATH: diff --git a/elasticsearch/_sync/client/migration.py b/elasticsearch/_sync/client/migration.py index 22663c440..d0b0a3830 100644 --- a/elasticsearch/_sync/client/migration.py +++ b/elasticsearch/_sync/client/migration.py @@ -41,7 +41,7 @@ def deprecations( that use deprecated features that will be removed or changed in the next major version. - ``_ + ``_ :param index: Comma-separate list of data streams or indices to check. Wildcard (*) expressions are supported. @@ -78,7 +78,7 @@ def get_feature_upgrade_status( """ Find out whether system features need to be upgraded or not - ``_ + ``_ """ __path = "/_migration/system_features" __query: t.Dict[str, t.Any] = {} @@ -109,7 +109,7 @@ def post_feature_upgrade( """ Begin upgrades for system features - ``_ + ``_ """ __path = "/_migration/system_features" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_sync/client/ml.py b/elasticsearch/_sync/client/ml.py index b4f1a527b..c562187e2 100644 --- a/elasticsearch/_sync/client/ml.py +++ b/elasticsearch/_sync/client/ml.py @@ -39,7 +39,7 @@ def clear_trained_model_deployment_cache( """ Clear the cached results from a trained model deployment - ``_ + ``_ :param model_id: The unique identifier of the trained model. """ @@ -81,7 +81,7 @@ def close_job( Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. You can close multiple anomaly detection @@ -136,7 +136,7 @@ def delete_calendar( """ Deletes a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. """ @@ -173,7 +173,7 @@ def delete_calendar_event( """ Deletes scheduled events from a calendar. - ``_ + ``_ :param calendar_id: The ID of the calendar to modify :param event_id: The ID of the event to remove from the calendar @@ -213,7 +213,7 @@ def delete_calendar_job( """ Deletes anomaly detection jobs from a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. :param job_id: An identifier for the anomaly detection jobs. It can be a job @@ -255,7 +255,7 @@ def delete_data_frame_analytics( """ Deletes an existing data frame analytics job. - ``_ + ``_ :param id: Identifier for the data frame analytics job. :param force: If `true`, it deletes a job that is not stopped; this method is @@ -299,7 +299,7 @@ def delete_datafeed( """ Deletes an existing datafeed. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -346,7 +346,7 @@ def delete_expired_data( """ Deletes expired and unused machine learning data. - ``_ + ``_ :param job_id: Identifier for an anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. @@ -397,7 +397,7 @@ def delete_filter( """ Deletes a filter. - ``_ + ``_ :param filter_id: A string that uniquely identifies a filter. """ @@ -436,7 +436,7 @@ def delete_forecast( """ Deletes forecasts from a machine learning job. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param forecast_id: A comma-separated list of forecast identifiers. If you do @@ -494,7 +494,7 @@ def delete_job( """ Deletes an existing anomaly detection job. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param delete_user_annotations: Specifies whether annotations that have been @@ -544,7 +544,7 @@ def delete_model_snapshot( """ Deletes an existing model snapshot. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: Identifier for the model snapshot. @@ -585,7 +585,7 @@ def delete_trained_model( Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param force: Forcefully deletes a trained model that is referenced by ingest @@ -626,7 +626,7 @@ def delete_trained_model_alias( """ Deletes a model alias that refers to the trained model - ``_ + ``_ :param model_id: The trained model ID to which the model alias refers. :param model_alias: The model alias to delete. @@ -669,7 +669,7 @@ def estimate_model_memory( """ Estimates the model memory - ``_ + ``_ :param analysis_config: For a list of the properties that you can specify in the `analysis_config` component of the body of this API. @@ -727,7 +727,7 @@ def evaluate_data_frame( """ Evaluates the data frame analytics for an annotated index. - ``_ + ``_ :param evaluation: Defines the type of evaluation you want to perform. :param index: Defines the `index` in which the evaluation will be performed. @@ -785,7 +785,7 @@ def explain_data_frame_analytics( """ Explains a data frame analytics config. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -876,7 +876,7 @@ def flush_job( """ Forces any buffered data to be processed by the job. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param advance_time: Refer to the description for the `advance_time` query parameter. @@ -937,7 +937,7 @@ def forecast( """ Predicts the future behavior of a time series by using its historical behavior. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. The job must be open when you create a forecast; otherwise, an error occurs. @@ -1003,7 +1003,7 @@ def get_buckets( """ Retrieves anomaly detection job results for one or more buckets. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param timestamp: The timestamp of a single bucket result. If you do not specify @@ -1090,7 +1090,7 @@ def get_calendar_events( """ Retrieves information about the scheduled events in calendars. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. You can get information for multiple calendars by using a comma-separated list of ids @@ -1151,7 +1151,7 @@ def get_calendars( """ Retrieves configuration information for calendars. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. You can get information for multiple calendars by using a comma-separated list of ids @@ -1215,7 +1215,7 @@ def get_categories( """ Retrieves anomaly detection job results for one or more categories. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param category_id: Identifier for the category, which is unique in the job. @@ -1283,7 +1283,7 @@ def get_data_frame_analytics( """ Retrieves configuration information for data frame analytics jobs. - ``_ + ``_ :param id: Identifier for the data frame analytics job. If you do not specify this option, the API returns information for the first hundred data frame @@ -1349,7 +1349,7 @@ def get_data_frame_analytics_stats( """ Retrieves usage information for data frame analytics jobs. - ``_ + ``_ :param id: Identifier for the data frame analytics job. If you do not specify this option, the API returns information for the first hundred data frame @@ -1410,7 +1410,7 @@ def get_datafeed_stats( """ Retrieves usage information for datafeeds. - ``_ + ``_ :param datafeed_id: Identifier for the datafeed. It can be a datafeed identifier or a wildcard expression. If you do not specify one of these options, the @@ -1462,7 +1462,7 @@ def get_datafeeds( """ Retrieves configuration information for datafeeds. - ``_ + ``_ :param datafeed_id: Identifier for the datafeed. It can be a datafeed identifier or a wildcard expression. If you do not specify one of these options, the @@ -1521,7 +1521,7 @@ def get_filters( """ Retrieves filters. - ``_ + ``_ :param filter_id: A string that uniquely identifies a filter. :param from_: Skips the specified number of filters. @@ -1576,7 +1576,7 @@ def get_influencers( """ Retrieves anomaly detection job results for one or more influencers. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param desc: If true, the results are sorted in descending order. @@ -1650,7 +1650,7 @@ def get_job_stats( """ Retrieves usage information for anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. It can be a job identifier, a group name, a comma-separated list of jobs, or a wildcard expression. If @@ -1703,7 +1703,7 @@ def get_jobs( """ Retrieves configuration information for anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. If you do not specify one of these @@ -1760,7 +1760,7 @@ def get_memory_stats( """ Returns information on how ML is using memory. - ``_ + ``_ :param node_id: The names of particular nodes in the cluster to target. For example, `nodeId1,nodeId2` or `ml:true` @@ -1809,7 +1809,7 @@ def get_model_snapshot_upgrade_stats( """ Gets stats for anomaly detection job model snapshot upgrades that are in progress. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: A numerical character string that uniquely identifies the @@ -1872,7 +1872,7 @@ def get_model_snapshots( """ Retrieves information about model snapshots. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: A numerical character string that uniquely identifies the @@ -1954,7 +1954,7 @@ def get_overall_buckets( Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. It can be a job identifier, a group name, a comma-separated list of jobs or groups, or a wildcard expression. @@ -2034,7 +2034,7 @@ def get_records( """ Retrieves anomaly records for an anomaly detection job. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param desc: Refer to the description for the `desc` query parameter. @@ -2117,7 +2117,7 @@ def get_trained_models( """ Retrieves configuration information for a trained inference model. - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param allow_no_match: Specifies what to do when the request: - Contains wildcard @@ -2193,7 +2193,7 @@ def get_trained_models_stats( """ Retrieves usage information for trained inference models. - ``_ + ``_ :param model_id: The unique identifier of the trained model or a model alias. It can be a comma-separated list or a wildcard expression. @@ -2251,7 +2251,7 @@ def infer_trained_model( """ Evaluate a trained model. - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param docs: An array of objects to pass to the model for inference. The objects @@ -2302,7 +2302,7 @@ def info( """ Returns defaults and limits used by machine learning. - ``_ + ``_ """ __path = "/_ml/info" __query: t.Dict[str, t.Any] = {} @@ -2337,7 +2337,7 @@ def open_job( """ Opens one or more anomaly detection jobs. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param timeout: Refer to the description for the `timeout` query parameter. @@ -2386,7 +2386,7 @@ def post_calendar_events( """ Posts scheduled events in a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. :param events: A list of one of more scheduled events. The event’s start and @@ -2435,7 +2435,7 @@ def post_data( """ Sends data to an anomaly detection job for analysis. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. The job must have a state of open to receive and process the data. @@ -2488,7 +2488,7 @@ def preview_data_frame_analytics( """ Previews that will be analyzed given a data frame analytics config. - ``_ + ``_ :param id: Identifier for the data frame analytics job. :param config: A data frame analytics config as described in create data frame @@ -2541,7 +2541,7 @@ def preview_datafeed( """ Previews a datafeed. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -2608,7 +2608,7 @@ def put_calendar( """ Instantiates a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. :param description: A description of the calendar. @@ -2656,7 +2656,7 @@ def put_calendar_job( """ Adds an anomaly detection job to a calendar. - ``_ + ``_ :param calendar_id: A string that uniquely identifies a calendar. :param job_id: An identifier for the anomaly detection jobs. It can be a job @@ -2711,7 +2711,7 @@ def put_data_frame_analytics( """ Instantiates a data frame analytics job. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -2872,7 +2872,7 @@ def put_datafeed( """ Instantiates a datafeed. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -3018,7 +3018,7 @@ def put_filter( """ Instantiates a filter. - ``_ + ``_ :param filter_id: A string that uniquely identifies a filter. :param description: A description of the filter. @@ -3081,7 +3081,7 @@ def put_job( """ Instantiates an anomaly detection job. - ``_ + ``_ :param job_id: The identifier for the anomaly detection job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and @@ -3217,7 +3217,6 @@ def put_trained_model( self, *, model_id: str, - inference_config: t.Mapping[str, t.Any], compressed_definition: t.Optional[str] = None, defer_definition_decompression: t.Optional[bool] = None, definition: t.Optional[t.Mapping[str, t.Any]] = None, @@ -3227,6 +3226,7 @@ def put_trained_model( t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] ] = None, human: t.Optional[bool] = None, + inference_config: t.Optional[t.Mapping[str, t.Any]] = None, input: t.Optional[t.Mapping[str, t.Any]] = None, metadata: t.Optional[t.Any] = None, model_size_bytes: t.Optional[int] = None, @@ -3239,12 +3239,9 @@ def put_trained_model( """ Creates an inference trained model. - ``_ + ``_ :param model_id: The unique identifier of the trained model. - :param inference_config: The default configuration for inference. This can be - either a regression or classification configuration. It must match the underlying - definition.trained_model's target_type. :param compressed_definition: The compressed (GZipped and Base64 encoded) inference definition of the model. If compressed_definition is specified, then definition cannot be specified. @@ -3254,6 +3251,10 @@ def put_trained_model( :param definition: The inference definition for the model. If definition is specified, then compressed_definition cannot be specified. :param description: A human-readable description of the inference trained model. + :param inference_config: The default configuration for inference. This can be + either a regression or classification configuration. It must match the underlying + definition.trained_model's target_type. For pre-packaged models such as ELSER + the config is not required. :param input: The input field names for the model definition. :param metadata: An object map that contains metadata about the model. :param model_size_bytes: The estimated memory usage in bytes to keep the trained @@ -3264,13 +3265,9 @@ def put_trained_model( """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'model_id'") - if inference_config is None: - raise ValueError("Empty value passed for parameter 'inference_config'") __path = f"/_ml/trained_models/{_quote(model_id)}" __body: t.Dict[str, t.Any] = {} __query: t.Dict[str, t.Any] = {} - if inference_config is not None: - __body["inference_config"] = inference_config if compressed_definition is not None: __body["compressed_definition"] = compressed_definition if defer_definition_decompression is not None: @@ -3285,6 +3282,8 @@ def put_trained_model( __query["filter_path"] = filter_path if human is not None: __query["human"] = human + if inference_config is not None: + __body["inference_config"] = inference_config if input is not None: __body["input"] = input if metadata is not None: @@ -3320,7 +3319,7 @@ def put_trained_model_alias( Creates a new model alias (or reassigns an existing one) to refer to the trained model - ``_ + ``_ :param model_id: The identifier for the trained model that the alias refers to. :param model_alias: The alias to create or update. This value cannot end in numbers. @@ -3370,7 +3369,7 @@ def put_trained_model_definition_part( """ Creates part of a trained model definition - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param part: The definition part number. When the definition is loaded for inference @@ -3436,7 +3435,7 @@ def put_trained_model_vocabulary( """ Creates a trained model vocabulary - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param vocabulary: The model vocabulary, which must not be empty. @@ -3483,7 +3482,7 @@ def reset_job( """ Resets an existing anomaly detection job. - ``_ + ``_ :param job_id: The ID of the job to reset. :param delete_user_annotations: Specifies whether annotations that have been @@ -3532,7 +3531,7 @@ def revert_model_snapshot( """ Reverts to a specific snapshot. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: You can specify `empty` as the . Reverting to @@ -3584,7 +3583,7 @@ def set_upgrade_mode( Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. - ``_ + ``_ :param enabled: When `true`, it enables `upgrade_mode` which temporarily halts all job and datafeed tasks and prohibits new job and datafeed tasks from @@ -3626,7 +3625,7 @@ def start_data_frame_analytics( """ Starts a data frame analytics job. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -3673,7 +3672,7 @@ def start_datafeed( """ Starts one or more datafeeds. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -3735,7 +3734,7 @@ def start_trained_model_deployment( """ Start a trained model deployment. - ``_ + ``_ :param model_id: The unique identifier of the trained model. Currently, only PyTorch models are supported. @@ -3811,7 +3810,7 @@ def stop_data_frame_analytics( """ Stops one or more data frame analytics jobs. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -3871,7 +3870,7 @@ def stop_datafeed( """ Stops one or more datafeeds. - ``_ + ``_ :param datafeed_id: Identifier for the datafeed. You can stop multiple datafeeds in a single API request by using a comma-separated list of datafeeds or a @@ -3927,7 +3926,7 @@ def stop_trained_model_deployment( """ Stop a trained model deployment. - ``_ + ``_ :param model_id: The unique identifier of the trained model. :param allow_no_match: Specifies what to do when the request: contains wildcard @@ -3982,7 +3981,7 @@ def update_data_frame_analytics( """ Updates certain properties of a data frame analytics job. - ``_ + ``_ :param id: Identifier for the data frame analytics job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -4078,7 +4077,7 @@ def update_datafeed( """ Updates certain properties of a datafeed. - ``_ + ``_ :param datafeed_id: A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z @@ -4234,7 +4233,7 @@ def update_filter( """ Updates the description of a filter, adds items, or removes items. - ``_ + ``_ :param filter_id: A string that uniquely identifies a filter. :param add_items: The items to add to the filter. @@ -4305,7 +4304,7 @@ def update_job( """ Updates certain properties of an anomaly detection job. - ``_ + ``_ :param job_id: Identifier for the job. :param allow_lazy_open: Advanced configuration option. Specifies whether this @@ -4426,7 +4425,7 @@ def update_model_snapshot( """ Updates certain properties of a snapshot. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: Identifier for the model snapshot. @@ -4477,7 +4476,7 @@ def upgrade_job_snapshot( """ Upgrades a given job snapshot to the current major version. - ``_ + ``_ :param job_id: Identifier for the anomaly detection job. :param snapshot_id: A numerical character string that uniquely identifies the @@ -4535,7 +4534,7 @@ def validate( """ Validates an anomaly detection job. - ``_ + ``_ :param analysis_config: :param analysis_limits: @@ -4598,7 +4597,7 @@ def validate_detector( """ Validates an anomaly detection detector. - ``_ + ``_ :param detector: """ diff --git a/elasticsearch/_sync/client/monitoring.py b/elasticsearch/_sync/client/monitoring.py index 3e29ec232..14bbcde70 100644 --- a/elasticsearch/_sync/client/monitoring.py +++ b/elasticsearch/_sync/client/monitoring.py @@ -46,7 +46,7 @@ def bulk( """ Used by the monitoring features to send monitoring data. - ``_ + ``_ :param interval: Collection interval (e.g., '10s' or '10000ms') of the payload :param operations: diff --git a/elasticsearch/_sync/client/nodes.py b/elasticsearch/_sync/client/nodes.py index ac77c9aff..715c2acdd 100644 --- a/elasticsearch/_sync/client/nodes.py +++ b/elasticsearch/_sync/client/nodes.py @@ -40,7 +40,7 @@ def clear_repositories_metering_archive( """ Removes the archived repositories metering information present in the cluster. - ``_ + ``_ :param node_id: Comma-separated list of node IDs or names used to limit returned information. All the nodes selective options are explained [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster.html#cluster-nodes). @@ -81,7 +81,7 @@ def get_repositories_metering_info( """ Returns cluster repositories metering information. - ``_ + ``_ :param node_id: Comma-separated list of node IDs or names used to limit returned information. All the nodes selective options are explained [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster.html#cluster-nodes). @@ -134,7 +134,7 @@ def hot_threads( """ Returns information about hot threads on each node in the cluster. - ``_ + ``_ :param node_id: List of node IDs or names used to limit returned information. :param ignore_idle_threads: If true, known idle threads (e.g. waiting in a socket @@ -209,7 +209,7 @@ def info( """ Returns information about nodes in the cluster. - ``_ + ``_ :param node_id: Comma-separated list of node IDs or names used to limit returned information. @@ -271,7 +271,7 @@ def reload_secure_settings( """ Reloads secure settings. - ``_ + ``_ :param node_id: A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes. @@ -348,7 +348,7 @@ def stats( """ Returns statistical information about nodes in the cluster. - ``_ + ``_ :param node_id: Comma-separated list of node IDs or names used to limit returned information. @@ -450,7 +450,7 @@ def usage( """ Returns low-level information about REST actions usage on nodes. - ``_ + ``_ :param 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 diff --git a/elasticsearch/_sync/client/query_ruleset.py b/elasticsearch/_sync/client/query_ruleset.py new file mode 100644 index 000000000..475f5592d --- /dev/null +++ b/elasticsearch/_sync/client/query_ruleset.py @@ -0,0 +1,187 @@ +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import typing as t + +from elastic_transport import ObjectApiResponse + +from ._base import NamespacedClient +from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters + + +class QueryRulesetClient(NamespacedClient): + @_rewrite_parameters() + def delete( + self, + *, + ruleset_id: str, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Deletes a query ruleset. + + ``_ + + :param ruleset_id: The unique identifier of the query ruleset to delete + """ + if ruleset_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'ruleset_id'") + __path = f"/_query_rules/{_quote(ruleset_id)}" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json"} + return self.perform_request( # type: ignore[return-value] + "DELETE", __path, params=__query, headers=__headers + ) + + @_rewrite_parameters() + def get( + self, + *, + ruleset_id: str, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Returns the details about a query ruleset. + + ``_ + + :param ruleset_id: The unique identifier of the query ruleset + """ + if ruleset_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'ruleset_id'") + __path = f"/_query_rules/{_quote(ruleset_id)}" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json"} + return self.perform_request( # type: ignore[return-value] + "GET", __path, params=__query, headers=__headers + ) + + @_rewrite_parameters( + parameter_aliases={"from": "from_"}, + ) + def list( + self, + *, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + from_: t.Optional[int] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + size: t.Optional[int] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Lists query rulesets. + + ``_ + + :param from_: Starting offset (default: 0) + :param size: specifies a max number of results to get + """ + __path = "/_query_rules" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if from_ is not None: + __query["from"] = from_ + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + if size is not None: + __query["size"] = size + __headers = {"accept": "application/json"} + return self.perform_request( # type: ignore[return-value] + "GET", __path, params=__query, headers=__headers + ) + + @_rewrite_parameters( + body_fields=True, + ) + def put( + self, + *, + ruleset_id: str, + rules: t.Union[ + t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] + ], + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Creates or updates a query ruleset. + + ``_ + + :param ruleset_id: The unique identifier of the query ruleset to be created or + updated + :param rules: + """ + if ruleset_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'ruleset_id'") + if rules is None: + raise ValueError("Empty value passed for parameter 'rules'") + __path = f"/_query_rules/{_quote(ruleset_id)}" + __body: t.Dict[str, t.Any] = {} + __query: t.Dict[str, t.Any] = {} + if rules is not None: + __body["rules"] = rules + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json", "content-type": "application/json"} + return self.perform_request( # type: ignore[return-value] + "PUT", __path, params=__query, headers=__headers, body=__body + ) diff --git a/elasticsearch/_sync/client/rollup.py b/elasticsearch/_sync/client/rollup.py index ec7b0e8bc..1b594335e 100644 --- a/elasticsearch/_sync/client/rollup.py +++ b/elasticsearch/_sync/client/rollup.py @@ -39,7 +39,7 @@ def delete_job( """ Deletes an existing rollup job. - ``_ + ``_ :param id: The ID of the job to delete """ @@ -75,7 +75,7 @@ def get_jobs( """ Retrieves the configuration, stats, and status of rollup jobs. - ``_ + ``_ :param id: The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs @@ -114,7 +114,7 @@ def get_rollup_caps( Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. - ``_ + ``_ :param id: The ID of the index to check rollup capabilities on, or left blank for all jobs @@ -153,7 +153,7 @@ def get_rollup_index_caps( Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). - ``_ + ``_ :param index: The rollup index or index pattern to obtain rollup capabilities from. @@ -205,7 +205,7 @@ def put_job( """ Creates a rollup job. - ``_ + ``_ :param id: Identifier for the rollup job. This can be any alphanumeric string and uniquely identifies the data that is associated with the rollup job. @@ -314,7 +314,7 @@ def rollup_search( """ Enables searching rolled-up data using the standard query DSL. - ``_ + ``_ :param index: The indices or index-pattern(s) (containing rollup or regular data) that should be searched @@ -372,7 +372,7 @@ def start_job( """ Starts an existing, stopped rollup job. - ``_ + ``_ :param id: The ID of the job to start """ @@ -410,7 +410,7 @@ def stop_job( """ Stops an existing, started rollup job. - ``_ + ``_ :param id: The ID of the job to stop :param timeout: Block for (at maximum) the specified duration while waiting for diff --git a/elasticsearch/_sync/client/search_application.py b/elasticsearch/_sync/client/search_application.py index 103519409..48de457b1 100644 --- a/elasticsearch/_sync/client/search_application.py +++ b/elasticsearch/_sync/client/search_application.py @@ -39,7 +39,7 @@ def delete( """ Deletes a search application. - ``_ + ``_ :param name: The name of the search application to delete """ @@ -75,7 +75,7 @@ def delete_behavioral_analytics( """ Delete a behavioral analytics collection. - ``_ + ``_ :param name: The name of the analytics collection to be deleted """ @@ -111,7 +111,7 @@ def get( """ Returns the details about a search application. - ``_ + ``_ :param name: The name of the search application """ @@ -147,7 +147,7 @@ def get_behavioral_analytics( """ Returns the existing behavioral analytics collections. - ``_ + ``_ :param name: A list of analytics collections to limit the returned information """ @@ -188,7 +188,7 @@ def list( """ Returns the existing search applications. - ``_ + ``_ :param from_: Starting offset (default: 0) :param q: Query in the Lucene query string syntax" @@ -234,7 +234,7 @@ def put( """ Creates or updates a search application. - ``_ + ``_ :param name: The name of the search application to be created or updated :param search_application: @@ -278,7 +278,7 @@ def put_behavioral_analytics( """ Creates a behavioral analytics collection. - ``_ + ``_ :param name: The name of the analytics collection to be created or updated """ @@ -318,7 +318,7 @@ def search( """ Perform a search against a search application - ``_ + ``_ :param name: The name of the search application to be searched :param params: diff --git a/elasticsearch/_sync/client/searchable_snapshots.py b/elasticsearch/_sync/client/searchable_snapshots.py index 5adf5d333..b3b97e1aa 100644 --- a/elasticsearch/_sync/client/searchable_snapshots.py +++ b/elasticsearch/_sync/client/searchable_snapshots.py @@ -44,7 +44,7 @@ def cache_stats( """ Retrieve node-level cache statistics about searchable snapshots. - ``_ + ``_ :param 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 @@ -106,7 +106,7 @@ def clear_cache( """ Clear the cache of searchable snapshots. - ``_ + ``_ :param index: A comma-separated list of index names :param allow_no_indices: Whether to ignore if a wildcard indices expression resolves @@ -170,7 +170,7 @@ def mount( """ Mount a snapshot as a searchable index. - ``_ + ``_ :param repository: The name of the repository containing the snapshot of the index to mount @@ -239,7 +239,7 @@ def stats( """ Retrieve shard-level statistics about searchable snapshots. - ``_ + ``_ :param index: A comma-separated list of index names :param level: Return stats aggregated at cluster, index or shard level diff --git a/elasticsearch/_sync/client/security.py b/elasticsearch/_sync/client/security.py index 478580bc2..0434a2abd 100644 --- a/elasticsearch/_sync/client/security.py +++ b/elasticsearch/_sync/client/security.py @@ -44,7 +44,7 @@ def activate_user_profile( """ Creates or updates the user profile on behalf of another user. - ``_ + ``_ :param grant_type: :param access_token: @@ -92,7 +92,7 @@ def authenticate( Enables authentication as a user and retrieve information about the authenticated user. - ``_ + ``_ """ __path = "/_security/_authenticate" __query: t.Dict[str, t.Any] = {} @@ -131,7 +131,7 @@ def change_password( """ Changes the passwords of users in the native realm and built-in users. - ``_ + ``_ :param username: The user whose password you want to change. If you do not specify this parameter, the password is changed for the current user. @@ -185,9 +185,10 @@ def clear_api_key_cache( """ Clear a subset or all entries from the API key cache. - ``_ + ``_ - :param ids: A comma-separated list of IDs of API keys to clear from the cache + :param ids: Comma-separated list of API key IDs to evict from the API key cache. + To evict all API keys, use `*`. Does not support other wildcard patterns. """ if ids in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'ids'") @@ -221,7 +222,7 @@ def clear_cached_privileges( """ Evicts application privileges from the native application privileges cache. - ``_ + ``_ :param application: A comma-separated list of application names """ @@ -259,7 +260,7 @@ def clear_cached_realms( Evicts users from the user cache. Can completely clear the cache or evict specific users. - ``_ + ``_ :param realms: Comma-separated list of realms to clear :param usernames: Comma-separated list of usernames to clear from the cache @@ -298,7 +299,7 @@ def clear_cached_roles( """ Evicts roles from the native role cache. - ``_ + ``_ :param name: Role name """ @@ -336,7 +337,7 @@ def clear_cached_service_tokens( """ Evicts tokens from the service account token caches. - ``_ + ``_ :param namespace: An identifier for the namespace :param service: An identifier for the service name @@ -386,13 +387,13 @@ def create_api_key( """ Creates an API key for access without requiring basic authentication. - ``_ + ``_ :param expiration: Expiration time for the API key. By default, API keys never expire. :param metadata: Arbitrary metadata that you want to associate with the API key. It supports nested data structure. Within the metadata object, keys beginning - with _ are reserved for system usage. + with `_` are reserved for system usage. :param name: Specifies the name for this API key. :param refresh: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to @@ -452,7 +453,7 @@ def create_service_token( """ Creates a service account token for access without requiring basic authentication. - ``_ + ``_ :param namespace: An identifier for the namespace :param service: An identifier for the service name @@ -512,7 +513,7 @@ def delete_privileges( """ Removes application privileges. - ``_ + ``_ :param application: Application name :param name: Privilege name @@ -559,7 +560,7 @@ def delete_role( """ Removes roles in the native realm. - ``_ + ``_ :param name: Role name :param refresh: If `true` (the default) then refresh the affected shards to make @@ -603,7 +604,7 @@ def delete_role_mapping( """ Removes role mappings. - ``_ + ``_ :param name: Role-mapping name :param refresh: If `true` (the default) then refresh the affected shards to make @@ -649,7 +650,7 @@ def delete_service_token( """ Deletes a service account token. - ``_ + ``_ :param namespace: An identifier for the namespace :param service: An identifier for the service name @@ -699,7 +700,7 @@ def delete_user( """ Deletes users from the native realm. - ``_ + ``_ :param username: username :param refresh: If `true` (the default) then refresh the affected shards to make @@ -743,7 +744,7 @@ def disable_user( """ Disables users in the native realm. - ``_ + ``_ :param username: The username of the user to disable :param refresh: If `true` (the default) then refresh the affected shards to make @@ -787,7 +788,7 @@ def disable_user_profile( """ Disables a user profile so it's not visible in user profile searches. - ``_ + ``_ :param uid: Unique identifier for the user profile. :param refresh: If 'true', Elasticsearch refreshes the affected shards to make @@ -831,7 +832,7 @@ def enable_user( """ Enables users in the native realm. - ``_ + ``_ :param username: The username of the user to enable :param refresh: If `true` (the default) then refresh the affected shards to make @@ -875,7 +876,7 @@ def enable_user_profile( """ Enables a user profile so it's visible in user profile searches. - ``_ + ``_ :param uid: Unique identifier for the user profile. :param refresh: If 'true', Elasticsearch refreshes the affected shards to make @@ -916,7 +917,7 @@ def enroll_kibana( Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster. - ``_ + ``_ """ __path = "/_security/enroll/kibana" __query: t.Dict[str, t.Any] = {} @@ -947,7 +948,7 @@ def enroll_node( """ Allows a new node to enroll to an existing cluster with security enabled. - ``_ + ``_ """ __path = "/_security/enroll/node" __query: t.Dict[str, t.Any] = {} @@ -984,13 +985,20 @@ def get_api_key( """ Retrieves information for one or more API keys. - ``_ - - :param id: API key id of the API key to be retrieved - :param name: API key name of the API key to be retrieved - :param owner: flag to query API keys owned by the currently authenticated user - :param realm_name: realm name of the user who created this API key to be retrieved - :param username: user name of the user who created this API key to be retrieved + ``_ + + :param id: An API key id. This parameter cannot be used with any of `name`, `realm_name` + or `username`. + :param name: An API key name. This parameter cannot be used with any of `id`, + `realm_name` or `username`. It supports prefix search with wildcard. + :param owner: A boolean flag that can be used to query API keys owned by the + currently authenticated user. The `realm_name` or `username` parameters cannot + be specified when this parameter is set to `true` as they are assumed to + be the currently authenticated ones. + :param realm_name: The name of an authentication realm. This parameter cannot + be used with either `id` or `name` or when `owner` flag is set to `true`. + :param username: The username of a user. This parameter cannot be used with either + `id` or `name` or when `owner` flag is set to `true`. :param with_limited_by: Return the snapshot of the owner user's role descriptors associated with the API key. An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors. @@ -1037,7 +1045,7 @@ def get_builtin_privileges( Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch. - ``_ + ``_ """ __path = "/_security/privilege/_builtin" __query: t.Dict[str, t.Any] = {} @@ -1070,7 +1078,7 @@ def get_privileges( """ Retrieves application privileges. - ``_ + ``_ :param application: Application name :param name: Privilege name @@ -1110,7 +1118,7 @@ def get_role( """ Retrieves roles in the native realm. - ``_ + ``_ :param name: The name of the role. You can specify multiple roles as a comma-separated list. If you do not specify this parameter, the API returns information about @@ -1149,7 +1157,7 @@ def get_role_mapping( """ Retrieves role mappings. - ``_ + ``_ :param name: The distinct name that identifies the role mapping. The name is used solely as an identifier to facilitate interaction via the API; it does @@ -1191,7 +1199,7 @@ def get_service_accounts( """ Retrieves information about service accounts. - ``_ + ``_ :param namespace: Name of the namespace. Omit this parameter to retrieve information about all service accounts. If you omit this parameter, you must also omit @@ -1235,7 +1243,7 @@ def get_service_credentials( """ Retrieves information of all service credentials for a service account. - ``_ + ``_ :param namespace: Name of the namespace. :param service: Name of the service name. @@ -1286,7 +1294,7 @@ def get_token( """ Creates a bearer token for access without requiring basic authentication. - ``_ + ``_ :param grant_type: :param kerberos_ticket: @@ -1341,7 +1349,7 @@ def get_user( """ Retrieves information about users in the native realm and built-in users. - ``_ + ``_ :param username: An identifier for the user. You can specify multiple usernames as a comma-separated list. If you omit this parameter, the API retrieves @@ -1386,7 +1394,7 @@ def get_user_privileges( """ Retrieves security privileges for the logged in user. - ``_ + ``_ :param application: The name of the application. Application privileges are always associated with exactly one application. If you do not specify this parameter, @@ -1432,7 +1440,7 @@ def get_user_profile( """ Retrieves user profiles for the given unique ID(s). - ``_ + ``_ :param uid: A unique identifier for the user profile. :param data: List of filters for the `data` field of the profile document. To @@ -1482,14 +1490,20 @@ def grant_api_key( """ Creates an API key on behalf of another user. - ``_ - - :param api_key: - :param grant_type: - :param access_token: - :param password: - :param run_as: - :param username: + ``_ + + :param api_key: Defines the API key. + :param grant_type: The type of grant. Supported grant types are: `access_token`, + `password`. + :param access_token: The user’s access token. If you specify the `access_token` + grant type, this parameter is required. It is not valid with other grant + types. + :param password: The user’s password. If you specify the `password` grant type, + this parameter is required. It is not valid with other grant types. + :param run_as: The name of the user to be impersonated. + :param username: The user name that identifies the user. If you specify the `password` + grant type, this parameter is required. It is not valid with other grant + types. """ if api_key is None: raise ValueError("Empty value passed for parameter 'api_key'") @@ -1563,7 +1577,7 @@ def has_privileges( """ Determines whether the specified user has a specified list of privileges. - ``_ + ``_ :param user: Username :param application: @@ -1614,7 +1628,7 @@ def has_privileges_user_profile( Determines whether the users associated with the specified profile IDs have all the requested privileges. - ``_ + ``_ :param privileges: :param uids: A list of profile IDs. The privileges are checked for associated @@ -1666,14 +1680,21 @@ def invalidate_api_key( """ Invalidates one or more API keys. - ``_ + ``_ :param id: - :param ids: - :param name: - :param owner: - :param realm_name: - :param username: + :param ids: A list of API key ids. This parameter cannot be used with any of + `name`, `realm_name`, or `username`. + :param name: An API key name. This parameter cannot be used with any of `ids`, + `realm_name` or `username`. + :param owner: Can be used to query API keys owned by the currently authenticated + user. The `realm_name` or `username` parameters cannot be specified when + this parameter is set to `true` as they are assumed to be the currently authenticated + ones. + :param realm_name: The name of an authentication realm. This parameter cannot + be used with either `ids` or `name`, or when `owner` flag is set to `true`. + :param username: The username of a user. This parameter cannot be used with either + `ids` or `name`, or when `owner` flag is set to `true`. """ __path = "/_security/api_key" __query: t.Dict[str, t.Any] = {} @@ -1723,7 +1744,7 @@ def invalidate_token( """ Invalidates one or more access tokens or refresh tokens. - ``_ + ``_ :param realm_name: :param refresh_token: @@ -1774,7 +1795,7 @@ def put_privileges( """ Adds or updates application privileges. - ``_ + ``_ :param privileges: :param refresh: If `true` (the default) then refresh the affected shards to make @@ -1849,7 +1870,7 @@ def put_role( """ Adds and updates roles in the native realm. - ``_ + ``_ :param name: The name of the role. :param applications: A list of application privilege entries. @@ -1931,7 +1952,7 @@ def put_role_mapping( """ Creates and updates role mappings. - ``_ + ``_ :param name: Role-mapping name :param enabled: @@ -2001,7 +2022,7 @@ def put_user( Adds and updates users in the native realm. These users are commonly referred to as native users. - ``_ + ``_ :param username: The username of the User :param email: @@ -2085,20 +2106,22 @@ def query_api_keys( """ Retrieves information for API keys using a subset of query DSL - ``_ + ``_ :param from_: Starting document offset. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more - hits, use the search_after parameter. + hits, use the `search_after` parameter. :param query: A query to filter which API keys to return. The query supports - a subset of query types, including match_all, bool, term, terms, ids, prefix, - wildcard, and range. You can query all public information associated with - an API key - :param search_after: + a subset of query types, including `match_all`, `bool`, `term`, `terms`, + `ids`, `prefix`, `wildcard`, and `range`. You can query all public information + associated with an API key. + :param search_after: Search after definition :param size: The number of hits to return. By default, you cannot page through - more than 10,000 hits using the from and size parameters. To page through - more hits, use the search_after parameter. - :param sort: + more than 10,000 hits using the `from` and `size` parameters. To page through + more hits, use the `search_after` parameter. + :param sort: Other than `id`, all public fields of an API key are eligible for + sorting. In addition, sort can also be applied to the `_doc` field to sort + by index order. :param with_limited_by: Return the snapshot of the owner user's role descriptors associated with the API key. An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors. @@ -2166,7 +2189,7 @@ def saml_authenticate( Exchanges a SAML Response message for an Elasticsearch access token and refresh token pair - ``_ + ``_ :param content: The SAML response as it was sent by the user’s browser, usually a Base64 encoded XML document. @@ -2221,7 +2244,7 @@ def saml_complete_logout( """ Verifies the logout response sent from the SAML IdP - ``_ + ``_ :param ids: A json array with all the valid SAML Request Ids that the caller of the API has for the current user. @@ -2280,7 +2303,7 @@ def saml_invalidate( """ Consumes a SAML LogoutRequest - ``_ + ``_ :param query_string: The query part of the URL that the user was redirected to by the SAML IdP to initiate the Single Logout. This query should include @@ -2341,7 +2364,7 @@ def saml_logout( Invalidates an access token and a refresh token that were generated via the SAML Authenticate API - ``_ + ``_ :param token: The access token that was returned as a response to calling the SAML authenticate API. Alternatively, the most recent token that was received @@ -2391,7 +2414,7 @@ def saml_prepare_authentication( """ Creates a SAML authentication request - ``_ + ``_ :param acs: The Assertion Consumer Service URL that matches the one of the SAML realms in Elasticsearch. The realm is used to generate the authentication @@ -2440,7 +2463,7 @@ def saml_service_provider_metadata( """ Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider - ``_ + ``_ :param realm_name: The name of the SAML realm in Elasticsearch. """ @@ -2481,7 +2504,7 @@ def suggest_user_profiles( """ Get suggestions for user profiles that match specified search criteria. - ``_ + ``_ :param data: List of filters for the `data` field of the profile document. To return all content use `data=*`. To return a subset of content use `data=` @@ -2542,7 +2565,7 @@ def update_api_key( """ Updates attributes of an existing API key. - ``_ + ``_ :param id: The ID of the API key to update. :param metadata: Arbitrary metadata that you want to associate with the API key. @@ -2607,7 +2630,7 @@ def update_user_profile_data( """ Update application specific data for the user profile of the given unique ID. - ``_ + ``_ :param uid: A unique identifier for the user profile. :param data: Non-searchable data that you want to associate with the user profile. diff --git a/elasticsearch/_sync/client/slm.py b/elasticsearch/_sync/client/slm.py index 92e455941..391b919a8 100644 --- a/elasticsearch/_sync/client/slm.py +++ b/elasticsearch/_sync/client/slm.py @@ -39,7 +39,7 @@ def delete_lifecycle( """ Deletes an existing snapshot lifecycle policy. - ``_ + ``_ :param policy_id: The id of the snapshot lifecycle policy to remove """ @@ -76,7 +76,7 @@ def execute_lifecycle( Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. - ``_ + ``_ :param policy_id: The id of the snapshot lifecycle policy to be executed """ @@ -111,7 +111,7 @@ def execute_retention( """ Deletes any snapshots that are expired according to the policy's retention rules. - ``_ + ``_ """ __path = "/_slm/_execute_retention" __query: t.Dict[str, t.Any] = {} @@ -146,7 +146,7 @@ def get_lifecycle( Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. - ``_ + ``_ :param policy_id: Comma-separated list of snapshot lifecycle policies to retrieve """ @@ -183,7 +183,7 @@ def get_stats( Returns global and policy-level statistics about actions taken by snapshot lifecycle management. - ``_ + ``_ """ __path = "/_slm/stats" __query: t.Dict[str, t.Any] = {} @@ -214,7 +214,7 @@ def get_status( """ Retrieves the status of snapshot lifecycle management (SLM). - ``_ + ``_ """ __path = "/_slm/status" __query: t.Dict[str, t.Any] = {} @@ -257,7 +257,7 @@ def put_lifecycle( """ Creates or updates a snapshot lifecycle policy. - ``_ + ``_ :param policy_id: ID for the snapshot lifecycle policy you want to create or update. @@ -328,7 +328,7 @@ def start( """ Turns on snapshot lifecycle management (SLM). - ``_ + ``_ """ __path = "/_slm/start" __query: t.Dict[str, t.Any] = {} @@ -359,7 +359,7 @@ def stop( """ Turns off snapshot lifecycle management (SLM). - ``_ + ``_ """ __path = "/_slm/stop" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_sync/client/snapshot.py b/elasticsearch/_sync/client/snapshot.py index 6cecd9c2c..798266ffa 100644 --- a/elasticsearch/_sync/client/snapshot.py +++ b/elasticsearch/_sync/client/snapshot.py @@ -43,7 +43,7 @@ def cleanup_repository( """ Removes stale data from repository. - ``_ + ``_ :param name: Snapshot repository to clean up. :param master_timeout: Period to wait for a connection to the master node. @@ -94,7 +94,7 @@ def clone( """ Clones indices from one snapshot into another snapshot in the same repository. - ``_ + ``_ :param repository: A repository name :param snapshot: The name of the snapshot to clone from @@ -163,7 +163,7 @@ def create( """ Creates a snapshot in a repository. - ``_ + ``_ :param repository: Repository for the snapshot. :param snapshot: Name of the snapshot. Must be unique in the repository. @@ -261,7 +261,7 @@ def create_repository( """ Creates a repository. - ``_ + ``_ :param name: A repository name :param settings: @@ -324,7 +324,7 @@ def delete( """ Deletes one or more snapshots. - ``_ + ``_ :param repository: A repository name :param snapshot: A comma-separated list of snapshot names @@ -370,7 +370,7 @@ def delete_repository( """ Deletes a repository. - ``_ + ``_ :param name: Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported. @@ -434,7 +434,7 @@ def get( """ Returns information about a snapshot. - ``_ + ``_ :param repository: Comma-separated list of snapshot repository names used to limit the request. Wildcard (*) expressions are supported. @@ -541,7 +541,7 @@ def get_repository( """ Returns information about a repository. - ``_ + ``_ :param name: A comma-separated list of repository names :param local: Return local information, do not retrieve the state from master @@ -606,7 +606,7 @@ def restore( """ Restores a snapshot. - ``_ + ``_ :param repository: A repository name :param snapshot: A snapshot name @@ -694,7 +694,7 @@ def status( """ Returns information about the status of a snapshot. - ``_ + ``_ :param repository: A repository name :param snapshot: A comma-separated list of snapshot names @@ -745,7 +745,7 @@ def verify_repository( """ Verifies a repository. - ``_ + ``_ :param name: A repository name :param master_timeout: Explicit operation timeout for connection to master node diff --git a/elasticsearch/_sync/client/sql.py b/elasticsearch/_sync/client/sql.py index e65aa4403..dd86395a1 100644 --- a/elasticsearch/_sync/client/sql.py +++ b/elasticsearch/_sync/client/sql.py @@ -41,7 +41,7 @@ def clear_cursor( """ Clears the SQL cursor - ``_ + ``_ :param cursor: """ @@ -81,7 +81,7 @@ def delete_async( Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. - ``_ + ``_ :param id: The async search ID """ @@ -124,7 +124,7 @@ def get_async( Returns the current status and available results for an async SQL search or stored synchronous SQL search - ``_ + ``_ :param id: The async search ID :param delimiter: Separator for CSV results. The API only supports this parameter @@ -178,7 +178,7 @@ def get_async_status( Returns the current status of an async SQL search or a stored synchronous SQL search - ``_ + ``_ :param id: The async search ID """ @@ -237,7 +237,7 @@ def query( """ Executes a SQL request - ``_ + ``_ :param catalog: Default catalog (cluster) for queries. If unspecified, the queries execute on the data in the local cluster only. @@ -339,7 +339,7 @@ def translate( """ Translates SQL into Elasticsearch queries - ``_ + ``_ :param query: :param fetch_size: diff --git a/elasticsearch/_sync/client/ssl.py b/elasticsearch/_sync/client/ssl.py index a9b39f0b2..dc6be713b 100644 --- a/elasticsearch/_sync/client/ssl.py +++ b/elasticsearch/_sync/client/ssl.py @@ -39,7 +39,7 @@ def certificates( Retrieves information about the X.509 certificates used to encrypt communications in the cluster. - ``_ + ``_ """ __path = "/_ssl/certificates" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_sync/client/synonyms.py b/elasticsearch/_sync/client/synonyms.py new file mode 100644 index 000000000..65b9a8dcc --- /dev/null +++ b/elasticsearch/_sync/client/synonyms.py @@ -0,0 +1,325 @@ +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import typing as t + +from elastic_transport import ObjectApiResponse + +from ._base import NamespacedClient +from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters + + +class SynonymsClient(NamespacedClient): + @_rewrite_parameters() + def delete_synonym( + self, + *, + id: str, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Deletes a synonym set + + ``_ + + :param id: The id of the synonyms set to be deleted + """ + if id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'id'") + __path = f"/_synonyms/{_quote(id)}" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json"} + return self.perform_request( # type: ignore[return-value] + "DELETE", __path, params=__query, headers=__headers + ) + + @_rewrite_parameters() + def delete_synonym_rule( + self, + *, + set_id: str, + rule_id: str, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Deletes a synonym rule in a synonym set + + ``_ + + :param set_id: The id of the synonym set to be updated + :param rule_id: The id of the synonym rule to be deleted + """ + if set_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'set_id'") + if rule_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'rule_id'") + __path = f"/_synonyms/{_quote(set_id)}/{_quote(rule_id)}" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json"} + return self.perform_request( # type: ignore[return-value] + "DELETE", __path, params=__query, headers=__headers + ) + + @_rewrite_parameters( + parameter_aliases={"from": "from_"}, + ) + def get_synonym( + self, + *, + id: str, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + from_: t.Optional[int] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + size: t.Optional[int] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Retrieves a synonym set + + ``_ + + :param id: "The id of the synonyms set to be retrieved + :param from_: Starting offset for query rules to be retrieved + :param size: specifies a max number of query rules to retrieve + """ + if id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'id'") + __path = f"/_synonyms/{_quote(id)}" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if from_ is not None: + __query["from"] = from_ + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + if size is not None: + __query["size"] = size + __headers = {"accept": "application/json"} + return self.perform_request( # type: ignore[return-value] + "GET", __path, params=__query, headers=__headers + ) + + @_rewrite_parameters() + def get_synonym_rule( + self, + *, + set_id: str, + rule_id: str, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Retrieves a synonym rule from a synonym set + + ``_ + + :param set_id: The id of the synonym set to retrieve the synonym rule from + :param rule_id: The id of the synonym rule to retrieve + """ + if set_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'set_id'") + if rule_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'rule_id'") + __path = f"/_synonyms/{_quote(set_id)}/{_quote(rule_id)}" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json"} + return self.perform_request( # type: ignore[return-value] + "GET", __path, params=__query, headers=__headers + ) + + @_rewrite_parameters( + parameter_aliases={"from": "from_"}, + ) + def get_synonyms_sets( + self, + *, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + from_: t.Optional[int] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + size: t.Optional[int] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Retrieves a summary of all defined synonym sets + + ``_ + + :param from_: Starting offset + :param size: specifies a max number of results to get + """ + __path = "/_synonyms" + __query: t.Dict[str, t.Any] = {} + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if from_ is not None: + __query["from"] = from_ + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + if size is not None: + __query["size"] = size + __headers = {"accept": "application/json"} + return self.perform_request( # type: ignore[return-value] + "GET", __path, params=__query, headers=__headers + ) + + @_rewrite_parameters( + body_fields=True, + ) + def put_synonym( + self, + *, + id: str, + synonyms_set: t.Union[ + t.List[t.Mapping[str, t.Any]], t.Tuple[t.Mapping[str, t.Any], ...] + ], + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Creates or updates a synonyms set + + ``_ + + :param id: The id of the synonyms set to be created or updated + :param synonyms_set: The synonym set information to update + """ + if id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'id'") + if synonyms_set is None: + raise ValueError("Empty value passed for parameter 'synonyms_set'") + __path = f"/_synonyms/{_quote(id)}" + __body: t.Dict[str, t.Any] = {} + __query: t.Dict[str, t.Any] = {} + if synonyms_set is not None: + __body["synonyms_set"] = synonyms_set + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json", "content-type": "application/json"} + return self.perform_request( # type: ignore[return-value] + "PUT", __path, params=__query, headers=__headers, body=__body + ) + + @_rewrite_parameters( + body_fields=True, + ) + def put_synonym_rule( + self, + *, + set_id: str, + rule_id: str, + synonyms: t.Union[t.List[str], t.Tuple[str, ...]], + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[ + t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]] + ] = None, + human: t.Optional[bool] = None, + pretty: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Creates or updates a synonym rule in a synonym set + + ``_ + + :param set_id: The id of the synonym set to be updated with the synonym rule + :param rule_id: The id of the synonym rule to be updated or created + :param synonyms: + """ + if set_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'set_id'") + if rule_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'rule_id'") + if synonyms is None: + raise ValueError("Empty value passed for parameter 'synonyms'") + __path = f"/_synonyms/{_quote(set_id)}/{_quote(rule_id)}" + __body: t.Dict[str, t.Any] = {} + __query: t.Dict[str, t.Any] = {} + if synonyms is not None: + __body["synonyms"] = synonyms + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if pretty is not None: + __query["pretty"] = pretty + __headers = {"accept": "application/json", "content-type": "application/json"} + return self.perform_request( # type: ignore[return-value] + "PUT", __path, params=__query, headers=__headers, body=__body + ) diff --git a/elasticsearch/_sync/client/tasks.py b/elasticsearch/_sync/client/tasks.py index c15ef6b7b..6990d43de 100644 --- a/elasticsearch/_sync/client/tasks.py +++ b/elasticsearch/_sync/client/tasks.py @@ -45,7 +45,7 @@ def cancel( """ Cancels a task, if it can be cancelled through an API. - ``_ + ``_ :param task_id: Cancel the task with specified task id (node_id:task_number) :param actions: A comma-separated list of actions that should be cancelled. Leave @@ -101,7 +101,7 @@ def get( """ Returns information about a task. - ``_ + ``_ :param task_id: Return the task with specified id (node_id:task_number) :param timeout: Explicit operation timeout @@ -157,7 +157,7 @@ def list( """ Returns a list of tasks. - ``_ + ``_ :param actions: Comma-separated list or wildcard expression of actions used to limit the request. diff --git a/elasticsearch/_sync/client/text_structure.py b/elasticsearch/_sync/client/text_structure.py index d181cb3fa..4eb5599c5 100644 --- a/elasticsearch/_sync/client/text_structure.py +++ b/elasticsearch/_sync/client/text_structure.py @@ -50,7 +50,7 @@ def find_structure( Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch. - ``_ + ``_ :param text_files: :param charset: The text’s character set. It must be a character set that is diff --git a/elasticsearch/_sync/client/transform.py b/elasticsearch/_sync/client/transform.py index 420c5fd8f..3cc95ba16 100644 --- a/elasticsearch/_sync/client/transform.py +++ b/elasticsearch/_sync/client/transform.py @@ -41,7 +41,7 @@ def delete_transform( """ Deletes an existing transform. - ``_ + ``_ :param transform_id: Identifier for the transform. :param force: If this value is false, the transform must be stopped before it @@ -94,7 +94,7 @@ def get_transform( """ Retrieves configuration information for transforms. - ``_ + ``_ :param transform_id: Identifier for the transform. It can be a transform identifier or a wildcard expression. You can get information for all transforms by using @@ -157,7 +157,7 @@ def get_transform_stats( """ Retrieves usage information for transforms. - ``_ + ``_ :param transform_id: Identifier for the transform. It can be a transform identifier or a wildcard expression. You can get information for all transforms by using @@ -223,7 +223,7 @@ def preview_transform( """ Previews a transform. - ``_ + ``_ :param transform_id: Identifier for the transform to preview. If you specify this path parameter, you cannot provide transform configuration details in @@ -320,7 +320,7 @@ def put_transform( """ Instantiates a transform. - ``_ + ``_ :param transform_id: Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -414,7 +414,7 @@ def reset_transform( """ Resets an existing transform. - ``_ + ``_ :param transform_id: Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. @@ -458,7 +458,7 @@ def schedule_now_transform( """ Schedules now a transform. - ``_ + ``_ :param transform_id: Identifier for the transform. :param timeout: Controls the time to wait for the scheduling to take place @@ -501,7 +501,7 @@ def start_transform( """ Starts one or more transforms. - ``_ + ``_ :param transform_id: Identifier for the transform. :param from_: Restricts the set of transformed entities to those changed after @@ -551,7 +551,7 @@ def stop_transform( """ Stops one or more transforms. - ``_ + ``_ :param transform_id: Identifier for the transform. To stop multiple transforms, use a comma-separated list or a wildcard expression. To stop all transforms, @@ -630,7 +630,7 @@ def update_transform( """ Updates certain properties of a transform. - ``_ + ``_ :param transform_id: Identifier for the transform. :param defer_validation: When true, deferrable validations are not run. This @@ -705,7 +705,7 @@ def upgrade_transforms( """ Upgrades all transforms. - ``_ + ``_ :param dry_run: When true, the request checks for updates but does not run them. :param timeout: Period to wait for a response. If no response is received before diff --git a/elasticsearch/_sync/client/watcher.py b/elasticsearch/_sync/client/watcher.py index e4d256593..ee89a6772 100644 --- a/elasticsearch/_sync/client/watcher.py +++ b/elasticsearch/_sync/client/watcher.py @@ -42,7 +42,7 @@ def ack_watch( """ Acknowledges a watch, manually throttling the execution of the watch's actions. - ``_ + ``_ :param watch_id: Watch ID :param action_id: A comma-separated list of the action ids to be acked @@ -84,7 +84,7 @@ def activate_watch( """ Activates a currently inactive watch. - ``_ + ``_ :param watch_id: Watch ID """ @@ -120,7 +120,7 @@ def deactivate_watch( """ Deactivates a currently active watch. - ``_ + ``_ :param watch_id: Watch ID """ @@ -156,7 +156,7 @@ def delete_watch( """ Removes a watch from Watcher. - ``_ + ``_ :param id: Watch ID """ @@ -210,7 +210,7 @@ def execute_watch( """ Forces the execution of a stored watch. - ``_ + ``_ :param id: Identifier for the watch. :param action_modes: Determines how to handle the watch actions as part of the @@ -285,7 +285,7 @@ def get_watch( """ Retrieves a watch by its ID. - ``_ + ``_ :param id: Watch ID """ @@ -334,7 +334,7 @@ def put_watch( """ Creates a new watch, or updates an existing one. - ``_ + ``_ :param id: Watch ID :param actions: @@ -430,7 +430,7 @@ def query_watches( """ Retrieves stored watches. - ``_ + ``_ :param from_: The offset from the first result to fetch. Needs to be non-negative. :param query: Optional, query filter watches to be returned. @@ -494,7 +494,7 @@ def start( """ Starts Watcher if it is not already running. - ``_ + ``_ """ __path = "/_watcher/_start" __query: t.Dict[str, t.Any] = {} @@ -549,7 +549,7 @@ def stats( """ Retrieves the current Watcher metrics. - ``_ + ``_ :param metric: Defines which additional metrics are included in the response. :param emit_stacktraces: Defines whether stack traces are generated for each @@ -589,7 +589,7 @@ def stop( """ Stops Watcher if it is running. - ``_ + ``_ """ __path = "/_watcher/_stop" __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_sync/client/xpack.py b/elasticsearch/_sync/client/xpack.py index 2fd5bbf24..b5c79b52d 100644 --- a/elasticsearch/_sync/client/xpack.py +++ b/elasticsearch/_sync/client/xpack.py @@ -45,7 +45,7 @@ def info( """ Retrieves information about the installed X-Pack features. - ``_ + ``_ :param accept_enterprise: If this param is used it must be set to true :param categories: A comma-separated list of the information categories to include @@ -87,7 +87,7 @@ def usage( """ Retrieves usage information about the installed X-Pack features. - ``_ + ``_ :param master_timeout: Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and diff --git a/elasticsearch/client.py b/elasticsearch/client.py index 06c49ba7c..d4436f480 100644 --- a/elasticsearch/client.py +++ b/elasticsearch/client.py @@ -44,6 +44,9 @@ from ._sync.client.ml import MlClient as MlClient # noqa: F401 from ._sync.client.monitoring import MonitoringClient as MonitoringClient # noqa: F401 from ._sync.client.nodes import NodesClient as NodesClient # noqa: F401 +from ._sync.client.query_ruleset import ( # noqa: F401 + QueryRulesetClient as QueryRulesetClient, +) from ._sync.client.rollup import RollupClient as RollupClient # noqa: F401 from ._sync.client.search_application import ( # noqa: F401 SearchApplicationClient as SearchApplicationClient, @@ -57,6 +60,7 @@ from ._sync.client.snapshot import SnapshotClient as SnapshotClient # noqa: F401 from ._sync.client.sql import SqlClient as SqlClient # noqa: F401 from ._sync.client.ssl import SslClient as SslClient # noqa: F401 +from ._sync.client.synonyms import SynonymsClient as SynonymsClient # noqa: F401 from ._sync.client.tasks import TasksClient as TasksClient # noqa: F401 from ._sync.client.text_structure import ( # noqa: F401 TextStructureClient as TextStructureClient,