From fded85141b53ae86439cf6accc33ebdc8ea31bbd Mon Sep 17 00:00:00 2001 From: saimedhi Date: Wed, 17 Apr 2024 14:26:47 -0700 Subject: [PATCH 1/3] Code generated using native OpenAPI specification Signed-off-by: saimedhi --- CHANGELOG.md | 1 + opensearchpy/_async/client/__init__.py | 2116 +++++++++++------ opensearchpy/_async/client/cat.py | 568 ++++- opensearchpy/_async/client/cluster.py | 600 ++++- .../_async/client/dangling_indices.py | 73 +- opensearchpy/_async/client/indices.py | 1897 +++++++++++---- opensearchpy/_async/client/ingest.py | 128 +- opensearchpy/_async/client/nodes.py | 176 +- opensearchpy/_async/client/plugins.py | 2 + opensearchpy/_async/client/remote_store.py | 20 +- opensearchpy/_async/client/search_pipeline.py | 90 + opensearchpy/_async/client/security.py | 579 ++++- opensearchpy/_async/client/snapshot.py | 347 ++- opensearchpy/_async/client/tasks.py | 114 +- opensearchpy/_async/plugins/knn.py | 79 +- opensearchpy/_async/plugins/notifications.py | 326 +++ opensearchpy/client/__init__.py | 2116 +++++++++++------ opensearchpy/client/cat.py | 568 ++++- opensearchpy/client/cluster.py | 600 ++++- opensearchpy/client/dangling_indices.py | 73 +- opensearchpy/client/indices.py | 1897 +++++++++++---- opensearchpy/client/ingest.py | 128 +- opensearchpy/client/nodes.py | 176 +- opensearchpy/client/plugins.py | 2 + opensearchpy/client/remote_store.py | 20 +- opensearchpy/client/search_pipeline.py | 90 + opensearchpy/client/security.py | 579 ++++- opensearchpy/client/snapshot.py | 347 ++- opensearchpy/client/tasks.py | 114 +- opensearchpy/plugins/knn.py | 79 +- opensearchpy/plugins/notifications.py | 326 +++ 31 files changed, 11115 insertions(+), 3116 deletions(-) create mode 100644 opensearchpy/_async/client/search_pipeline.py create mode 100644 opensearchpy/_async/plugins/notifications.py create mode 100644 opensearchpy/client/search_pipeline.py create mode 100644 opensearchpy/plugins/notifications.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 342ba1c8..364e0a86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Fixed - Updated code generator to use native OpenAPI specification ([#721](https://github.com/opensearch-project/opensearch-py/pull/721)) ### Updated APIs +- Updated opensearch-py APIs to reflect [opensearch-api-specification@29faff0](https://github.com/opensearch-project/opensearch-api-specification/commit/29faff0709b2557acfd4c3c7e053a2c313413633) ### Security ### Dependencies - Bumps `aiohttp` from >=3,<4 to >=3.9.2,<4 ([#717](https://github.com/opensearch-project/opensearch-py/pull/717)) diff --git a/opensearchpy/_async/client/__init__.py b/opensearchpy/_async/client/__init__.py index 3c904ed4..1121b32d 100644 --- a/opensearchpy/_async/client/__init__.py +++ b/opensearchpy/_async/client/__init__.py @@ -52,6 +52,7 @@ from .plugins import PluginsClient from .remote import RemoteClient from .remote_store import RemoteStoreClient +from .search_pipeline import SearchPipelineClient from .security import SecurityClient from .snapshot import SnapshotClient from .tasks import TasksClient @@ -215,6 +216,7 @@ class as kwargs, or a string in the format of ``host[:port]`` which will be super().__init__(hosts, transport_class, **kwargs) # namespaced clients for compatibility with API names + self.search_pipeline = SearchPipelineClient(self) self.cat = CatClient(self) self.cluster = ClusterClient(self) self.dangling_indices = DanglingIndicesClient(self) @@ -256,7 +258,7 @@ async def close(self) -> None: await self.transport.close() # AUTO-GENERATED-API-DEFINITIONS # - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def ping( self, params: Any = None, @@ -265,6 +267,17 @@ async def ping( """ Returns whether the cluster is running. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ try: return await self.transport.perform_request( @@ -273,7 +286,7 @@ async def ping( except TransportError: return False - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def info( self, params: Any = None, @@ -282,15 +295,31 @@ async def info( """ Returns basic information about the cluster. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/", params=params, headers=headers ) @query_params( + "error_trace", + "filter_path", + "human", "pipeline", + "pretty", "refresh", "routing", + "source", "timeout", "version", "version_type", @@ -309,25 +338,47 @@ async def create( with a same ID already exists in the index. - :arg index: Index name. - :arg id: Document ID. + :arg index: Name of the data stream or index to target. If the + target doesn’t exist and matches the name or wildcard (`*`) pattern of + an index template with a `data_stream` definition, this request creates + the data stream. If the target doesn’t exist and doesn’t match a data + stream template, this request creates the index. + :arg id: Unique identifier for the document. :arg body: The document - :arg pipeline: The pipeline id to preprocess incoming documents - with. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pipeline: ID of the pipeline to use to preprocess incoming + documents.If the index has a default ingest pipeline specified, then + setting the value to `_none` disables the default ingest pipeline for + this request.If a final pipeline is configured it will always run, + regardless of the value of this parameter. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, Opensearch refreshes the affected + shards to make this operation visible to search, if `wait_for` then wait + for a refresh to make this operation visible to search, if `false` do + nothing with refreshes.Valid values: `true`, `false`, `wait_for`. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period the request waits for the following + operations: automatic index creation, dynamic mapping updates, waiting + for active shards. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. + :arg 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`). Valid choices are all, index-setting. """ for param in (index, id, body): if param in SKIP_IN_PATH: @@ -340,13 +391,18 @@ async def create( ) @query_params( + "error_trace", + "filter_path", + "human", "if_primary_term", "if_seq_no", "op_type", "pipeline", + "pretty", "refresh", "require_alias", "routing", + "source", "timeout", "version", "version_type", @@ -364,34 +420,55 @@ async def index( Creates or updates a document in an index. - :arg index: Index name. + :arg index: Name of the data stream or index to target. :arg body: The document - :arg id: Document ID. - :arg if_primary_term: only perform the operation if the last - operation that has changed the document has the specified primary term. - :arg if_seq_no: only perform the operation if the last operation - that has changed the document has the specified sequence number. - :arg op_type: Explicit operation type. Defaults to `index` for - requests with an explicit document ID, and to `create` for requests - without an explicit document ID. Valid choices are index, create. - :arg pipeline: The pipeline id to preprocess incoming documents - with. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg require_alias: When true, requires destination to be an - alias. Default is false. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + :arg id: Unique identifier for the document. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg if_primary_term: Only perform the operation if the document + has this primary term. + :arg if_seq_no: Only perform the operation if the document has + this sequence number. + :arg op_type: Set to create to only index the document if it + does not already exist (put if absent).If a document with the specified + `_id` already exists, the indexing operation will fail.Same as using the + `/_create` endpoint.Valid values: `index`, `create`.If document + id is specified, it defaults to `index`.Otherwise, it defaults to + `create`. + :arg pipeline: ID of the pipeline to use to preprocess incoming + documents.If the index has a default ingest pipeline specified, then + setting the value to `_none` disables the default ingest pipeline for + this request.If a final pipeline is configured it will always run, + regardless of the value of this parameter. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, Opensearch refreshes the affected + shards to make this operation visible to search, if `wait_for` then wait + for a refresh to make this operation visible to search, if `false` do + nothing with refreshes.Valid values: `true`, `false`, `wait_for`. + :arg require_alias: If `true`, the destination must be an index + alias. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period the request waits for the following + operations: automatic index creation, dynamic mapping updates, waiting + for active shards. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. + :arg 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`). Valid choices are all, index-setting. """ for param in (index, body): if param in SKIP_IN_PATH: @@ -409,10 +486,15 @@ async def index( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "pipeline", + "pretty", "refresh", "require_alias", "routing", + "source", "timeout", "wait_for_active_shards", ) @@ -429,29 +511,44 @@ async def bulk( :arg body: The operation definition and data (action-data pairs), separated by newlines - :arg index: Default index for items which don't provide one. - :arg _source: True or false to return the _source field or not, - or default list of fields to return, can be overridden on each sub- - request. - :arg _source_excludes: Default list of fields to exclude from - the returned _source field, can be overridden on each sub-request. - :arg _source_includes: Default list of fields to extract and - return from the _source field, can be overridden on each sub-request. - :arg pipeline: The pipeline id to preprocess incoming documents - with. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg require_alias: Sets require_alias for all incoming - documents. Default is false. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + :arg index: Name of the data stream, index, or index alias to + perform bulk actions on. + :arg _source: `true` or `false` to return the `_source` field or + not, or a list of fields to return. + :arg _source_excludes: A comma-separated list of source fields + to exclude from the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pipeline: ID of the pipeline to use to preprocess incoming + documents.If the index has a default ingest pipeline specified, then + setting the value to `_none` disables the default ingest pipeline for + this request.If a final pipeline is configured it will always run, + regardless of the value of this parameter. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, Opensearch refreshes the affected + shards to make this operation visible to search, if `wait_for` then wait + for a refresh to make this operation visible to search, if `false` do + nothing with refreshes.Valid values: `true`, `false`, `wait_for`. + :arg require_alias: If `true`, the request’s actions must target + an index alias. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period each action waits for the following + operations: automatic index creation, dynamic mapping updates, waiting + for active shards. + :arg 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`). Valid choices are all, index-setting. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -465,7 +562,7 @@ async def bulk( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def clear_scroll( self, body: Any = None, @@ -479,7 +576,18 @@ async def clear_scroll( :arg body: Comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter - :arg scroll_id: Comma-separated list of scroll IDs to clear. + :arg scroll_id: Comma-separated list of scroll IDs to clear. To + clear all scroll IDs, use `_all`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if scroll_id in SKIP_IN_PATH and body in SKIP_IN_PATH: raise ValueError("You need to supply scroll_id or body.") @@ -498,14 +606,19 @@ async def clear_scroll( "analyzer", "default_operator", "df", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_throttled", "ignore_unavailable", "lenient", "min_score", "preference", + "pretty", "q", "routing", + "source", "terminate_after", ) async def count( @@ -521,36 +634,56 @@ async def count( :arg body: Query to restrict the results specified with the Query DSL (optional) - :arg index: Comma-separated list of indices to restrict the - results. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. + :arg 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`. + :arg 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. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed.This parameter can only be used when the `q` query string + parameter is specified. + :arg analyzer: Analyzer to use for the query string.This + parameter can only be used when the `q` query string parameter is + specified. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_throttled: Whether specified concrete, expanded or - aliased indices should be ignored when throttled. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg min_score: Include only documents with a specific `_score` - value in the result. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. + query: `AND` or `OR`.This parameter can only be used when the `q` query + string parameter is specified. Valid choices are and, or. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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 choices are all, open, + closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_throttled: If `true`, concrete, expanded or aliased + indices are ignored when frozen. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg min_score: Sets the minimum `_score` value that documents + must have to be included in the result. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg routing: Comma-separated list of specific routing values. - :arg terminate_after: The maximum number of documents to collect - for each shard, upon reaching which the query execution will terminate - early. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg terminate_after: Maximum number of documents to collect for + each shard.If a query reaches this limit, Opensearch terminates the + query early.Opensearch collects documents before sorting. """ return await self.transport.perform_request( "POST", @@ -561,10 +694,15 @@ async def count( ) @query_params( + "error_trace", + "filter_path", + "human", "if_primary_term", "if_seq_no", + "pretty", "refresh", "routing", + "source", "timeout", "version", "version_type", @@ -581,26 +719,39 @@ async def delete( Removes a document from the index. - :arg index: Index name. - :arg id: Document ID. - :arg if_primary_term: only perform the operation if the last - operation that has changed the document has the specified primary term. - :arg if_seq_no: only perform the operation if the last operation - that has changed the document has the specified sequence number. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + :arg index: Name of the target index. + :arg id: Unique identifier for the document. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg if_primary_term: Only perform the operation if the document + has this primary term. + :arg if_seq_no: Only perform the operation if the document has + this sequence number. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, Opensearch refreshes the affected + shards to make this operation visible to search, if `wait_for` then wait + for a refresh to make this operation visible to search, if `false` do + nothing with refreshes.Valid values: `true`, `false`, `wait_for`. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for active shards. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. + :arg 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`). Valid choices are all, index-setting. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -620,12 +771,16 @@ async def delete( "conflicts", "default_operator", "df", + "error_trace", "expand_wildcards", + "filter_path", "from_", + "human", "ignore_unavailable", "lenient", "max_docs", "preference", + "pretty", "q", "refresh", "request_cache", @@ -638,6 +793,7 @@ async def delete( "size", "slices", "sort", + "source", "stats", "terminate_after", "timeout", @@ -656,8 +812,9 @@ async def delete_by_query( Deletes documents matching the provided query. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + :arg 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`. :arg body: The search definition using the Query DSL :arg _source: True or false to return the _source field or not, or a list of fields to return. @@ -665,67 +822,86 @@ async def delete_by_query( returned _source field. :arg _source_includes: List of fields to extract and return from the _source field. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. - :arg conflicts: What to do when the operation encounters version - conflicts?. Valid choices are abort, proceed. + :arg 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`. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed. + :arg analyzer: Analyzer to use for the query string. + :arg conflicts: What to do if delete by query hits version + conflicts: `abort` or `proceed`. Valid choices are abort, proceed. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg from_: Starting offset. Default is 0. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg max_docs: Maximum number of documents to process (default: - all documents). - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. + query: `AND` or `OR`. Valid choices are and, or. + :arg df: Field to use as default where no field prefix is given + in the query string. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, + hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg from_: Starting offset (default: 0) + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg max_docs: Maximum number of documents to process.Defaults + to all documents. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg request_cache: Specify if request cache should be used for - this request or not, defaults to index level setting. + :arg refresh: If `true`, Opensearch refreshes all shards + involved in the delete by query after the request completes. + :arg request_cache: If `true`, the request cache is used for + this request.Defaults to the index-level setting. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. Default is 0. - :arg routing: Comma-separated list of specific routing values. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. - :arg scroll_size: Size on the scroll request powering the - operation. Default is 100. - :arg search_timeout: Explicit timeout for each search request. - Defaults to no timeout. - :arg search_type: Search operation type. Valid choices are + requests per second. + :arg routing: Custom value used to route operations to a + specific shard. + :arg scroll: Period to retain the search context for scrolling. + :arg scroll_size: Size of the scroll request that powers the + operation. + :arg search_timeout: Explicit timeout for each search + request.Defaults to no timeout. + :arg search_type: The type of the search operation.Available + options: `query_then_fetch`, `dfs_query_then_fetch`. Valid choices are query_then_fetch, dfs_query_then_fetch. :arg size: Deprecated, please use `max_docs` instead. :arg slices: The number of slices this task should be divided - into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default is 1. - :arg sort: Comma-separated list of : pairs. - :arg stats: Specific 'tag' of the request for logging and + into. Valid choices are auto. + :arg sort: A comma-separated list of : pairs. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stats: Specific `tag` of the request for logging and statistical purposes. - :arg terminate_after: The maximum number of documents to collect - for each shard, upon reaching which the query execution will terminate - early. - :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default is 1m. - :arg version: Whether to return document version as part of a - hit. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is True. + :arg terminate_after: Maximum number of documents to collect for + each shard.If a query reaches this limit, Opensearch terminates the + query early.Opensearch collects documents before sorting.Use with + caution.Opensearch applies this parameter to each shard handling the + request.When possible, let Opensearch perform early termination + automatically.Avoid specifying this parameter for requests that target + data streams with backing indices across multiple data tiers. + :arg timeout: Period each deletion request waits for active + shards. + :arg version: If `true`, returns the document version as part of + a hit. + :arg 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`). Valid choices are all, index-setting. + :arg wait_for_completion: If `true`, the request blocks until + the operation is complete. """ # from is a reserved word so it cannot be used, use from_ instead if "from_" in params: @@ -743,7 +919,9 @@ async def delete_by_query( body=body, ) - @query_params("requests_per_second") + @query_params( + "error_trace", "filter_path", "human", "pretty", "requests_per_second", "source" + ) async def delete_by_query_rethrottle( self, task_id: Any, @@ -755,9 +933,19 @@ async def delete_by_query_rethrottle( operation. - :arg task_id: The task id to rethrottle. + :arg task_id: The ID for the task. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. + requests per second. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'task_id'.") @@ -769,7 +957,16 @@ async def delete_by_query_rethrottle( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def delete_script( self, id: Any, @@ -780,13 +977,26 @@ async def delete_script( Deletes a script. - :arg id: Script ID. + :arg id: Identifier for the stored script or search template. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg 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 a required argument 'id'.") @@ -799,10 +1009,15 @@ async def delete_script( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "stored_fields", "version", "version_type", @@ -818,26 +1033,42 @@ async def exists( Returns information about whether a document exists in an index. - :arg index: Index name. - :arg id: Document ID. - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. - :arg stored_fields: Comma-separated list of stored fields to - return. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. + :arg index: Comma-separated list of data streams, indices, and + aliases. Supports wildcards (`*`). + :arg id: Identifier of the document. + :arg _source: `true` or `false` to return the `_source` field or + not, or a list of fields to return. + :arg _source_excludes: A comma-separated list of source fields + to exclude in the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If `true`, the request is real-time as opposed to + near-real-time. + :arg refresh: If `true`, Opensearch refreshes all shards + involved in the delete by query after the request completes. + :arg routing: Target the specified primary shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg 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. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -851,10 +1082,15 @@ async def exists( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "version", "version_type", ) @@ -869,24 +1105,38 @@ async def exists_source( Returns information about whether a document source exists in an index. - :arg index: Index name. - :arg id: Document ID. - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. + :arg index: Comma-separated list of data streams, indices, and + aliases. Supports wildcards (`*`). + :arg id: Identifier of the document. + :arg _source: `true` or `false` to return the `_source` field or + not, or a list of fields to return. + :arg _source_excludes: A comma-separated list of source fields + to exclude in the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If true, the request is real-time as opposed to + near-real-time. + :arg refresh: If `true`, Opensearch refreshes all shards + involved in the delete by query after the request completes. + :arg routing: Target the specified primary shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -906,10 +1156,15 @@ async def exists_source( "analyzer", "default_operator", "df", + "error_trace", + "filter_path", + "human", "lenient", "preference", + "pretty", "q", "routing", + "source", "stored_fields", ) async def explain( @@ -924,30 +1179,44 @@ async def explain( Returns information about why a specific matches (or doesn't match) a query. - :arg index: Index name. - :arg id: Document ID. + :arg index: Index names used to limit the request. Only a single + index name can be provided to this parameter. + :arg id: Defines the document ID. :arg body: The query definition using the Query DSL - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg analyze_wildcard: Specify whether wildcards and prefix - queries in the query string query should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. + :arg _source: True or false to return the `_source` field or + not, or a list of fields to return. + :arg _source_excludes: A comma-separated list of source fields + to exclude from the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed. + :arg analyzer: Analyzer to use for the query string.This + parameter can only be used when the `q` query string parameter is + specified. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The default field for query string query. Default is - _all. - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. + query: `AND` or `OR`. Valid choices are and, or. + :arg df: Field to use as default where no field prefix is given + in the query string. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg routing: Routing value. - :arg stored_fields: Comma-separated list of stored fields to - return. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stored_fields: A comma-separated list of stored fields to + return in the response. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -961,10 +1230,15 @@ async def explain( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", "fields", + "filter_path", + "human", "ignore_unavailable", "include_unmapped", + "pretty", + "source", ) async def field_caps( self, @@ -979,19 +1253,36 @@ async def field_caps( :arg body: An index filter specified with the Query DSL - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg fields: Comma-separated list of field names. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg include_unmapped: Indicates whether unmapped fields should - be included in the response. Default is false. + :arg 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. + :arg 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 requesttargeting `foo*,bar*` + returns an error if an index starts with foo but no index starts with + bar. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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 choices are all, open, + closed, hidden, none. + :arg fields: Comma-separated list of fields to retrieve + capabilities for. Wildcard (`*`) expressions are supported. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `true`, missing or closed indices + are not included in the response. + :arg include_unmapped: If true, unmapped fields are included in + the response. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "POST", @@ -1005,10 +1296,15 @@ async def field_caps( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "stored_fields", "version", "version_type", @@ -1024,26 +1320,41 @@ async def get( Returns a document. - :arg index: Index name. - :arg id: Document ID. + :arg index: Name of the index that contains the document. + :arg id: Unique identifier of the document. :arg _source: True or false to return the _source field or not, or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. - :arg stored_fields: Comma-separated list of stored fields to - return. + :arg _source_excludes: A comma-separated list of source fields + to exclude in the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on. Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If `true`, the request is real-time as opposed to + near-real-time. + :arg refresh: If true, Opensearch refreshes the affected shards + to make this operation visible to search. If false, do nothing with + refreshes. + :arg routing: Target the specified primary shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg 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. :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. + The specified version must match the current version of the document for + the request to succeed. + :arg version_type: Specific version type: internal, external, + external_gte. Valid choices are internal, external, external_gte, force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -1053,7 +1364,15 @@ async def get( "GET", _make_path(index, "_doc", id), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) async def get_script( self, id: Any, @@ -1064,12 +1383,22 @@ async def get_script( Returns a script. - :arg id: Script ID. + :arg id: Identifier for the stored script or search template. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'id'.") @@ -1082,10 +1411,15 @@ async def get_script( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "version", "version_type", ) @@ -1100,24 +1434,37 @@ async def get_source( Returns the source of a document. - :arg index: Index name. - :arg id: Document ID. + :arg index: Name of the index that contains the document. + :arg id: Unique identifier of the document. :arg _source: True or false to return the _source field or not, or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. + :arg _source_excludes: A comma-separated list of source fields + to exclude in the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on. Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: Boolean) If true, the request is real-time as + opposed to near-real-time. + :arg refresh: If true, Opensearch refreshes the affected shards + to make this operation visible to search. If false, do nothing with + refreshes. + :arg routing: Target the specified primary shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. + The specified version must match the current version of the document for + the request to succeed. + :arg version_type: Specific version type: internal, external, + external_gte. Valid choices are internal, external, external_gte, force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -1133,10 +1480,15 @@ async def get_source( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "stored_fields", ) async def mget( @@ -1153,22 +1505,39 @@ async def mget( :arg body: Document identifiers; can be either `docs` (containing full document information) or `ids` (when index is provided in the URL. - :arg index: Index name. - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. - :arg stored_fields: Comma-separated list of stored fields to - return. + :arg 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. + :arg _source: True or false to return the `_source` field or + not, or a list of fields to return. + :arg _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. + :arg _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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on. Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If `true`, the request is real-time as opposed to + near-real-time. + :arg refresh: If `true`, the request refreshes relevant shards + before retrieving documents. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stored_fields: If `true`, retrieves the document fields + stored in the index rather than the document `_source`. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1183,11 +1552,16 @@ async def mget( @query_params( "ccs_minimize_roundtrips", + "error_trace", + "filter_path", + "human", "max_concurrent_searches", "max_concurrent_shard_requests", "pre_filter_shard_size", + "pretty", "rest_total_hits_as_int", "search_type", + "source", "typed_keys", ) async def msearch( @@ -1203,31 +1577,39 @@ async def msearch( :arg body: The request definitions (metadata-search request definition pairs), separated by newlines - :arg index: Comma-separated list of indices to use as default. - :arg ccs_minimize_roundtrips: Indicates whether network round- - trips should be minimized as part of cross-cluster search requests - execution. Default is True. - :arg max_concurrent_searches: Controls the maximum number of - concurrent searches the multi search api will execute. - :arg max_concurrent_shard_requests: The number of concurrent - shard requests each sub search executes concurrently per node. This - value should be used to limit the impact of the search on the cluster in - order to limit the number of concurrent shard requests. Default is 5. - :arg pre_filter_shard_size: Threshold that enforces a pre-filter - round-trip to prefilter search shards based on query rewriting if the - number of shards the search request expands to exceeds the threshold. - This filter round-trip 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. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg search_type: Search operation type. Valid choices are - query_then_fetch, query_and_fetch, dfs_query_then_fetch, - dfs_query_and_fetch. - :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response. + :arg index: Comma-separated list of data streams, indices, and + index aliases to search. + :arg ccs_minimize_roundtrips: If true, network roundtrips + between the coordinating node and remote clusters are minimized for + cross-cluster search requests. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg max_concurrent_searches: Maximum number of concurrent + searches the multi search API can execute. + :arg max_concurrent_shard_requests: Maximum number of concurrent + shard requests that each sub-search request executes per node. + :arg 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 i.e., if date filters are mandatory to match but + the shard bounds and the query are disjoint. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg rest_total_hits_as_int: If true, hits.total are returned as + an integer in the response. Defaults to false, which returns an object. + :arg search_type: Indicates whether global term and document + frequencies should be used when scoring returned documents. Valid + choices are query_then_fetch, dfs_query_then_fetch. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg typed_keys: Specifies whether aggregation and suggester + names should be prefixed by their respective types in the response. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1243,9 +1625,14 @@ async def msearch( @query_params( "ccs_minimize_roundtrips", + "error_trace", + "filter_path", + "human", "max_concurrent_searches", + "pretty", "rest_total_hits_as_int", "search_type", + "source", "typed_keys", ) async def msearch_template( @@ -1261,20 +1648,31 @@ async def msearch_template( :arg body: The request definitions (metadata-search request definition pairs), separated by newlines - :arg index: Comma-separated list of indices to use as default. - :arg ccs_minimize_roundtrips: Indicates whether network round- - trips should be minimized as part of cross-cluster search requests - execution. Default is True. - :arg max_concurrent_searches: Controls the maximum number of - concurrent searches the multi search api will execute. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg search_type: Search operation type. Valid choices are - query_then_fetch, query_and_fetch, dfs_query_then_fetch, - dfs_query_and_fetch. - :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response. + :arg 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 `*`. + :arg ccs_minimize_roundtrips: If `true`, network round-trips are + minimized for cross-cluster search requests. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg max_concurrent_searches: Maximum number of concurrent + searches the API can run. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg rest_total_hits_as_int: If `true`, the response returns + `hits.total` as an integer.If `false`, it returns `hits.total` as an + object. + :arg search_type: The type of the search operation.Available + options: `query_then_fetch`, `dfs_query_then_fetch`. Valid choices are + query_then_fetch, dfs_query_then_fetch. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg typed_keys: If `true`, the response prefixes aggregation + and suggester names with their respective types. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1289,15 +1687,20 @@ async def msearch_template( ) @query_params( + "error_trace", "field_statistics", "fields", + "filter_path", + "human", "ids", "offsets", "payloads", "positions", "preference", + "pretty", "realtime", "routing", + "source", "term_statistics", "version", "version_type", @@ -1316,36 +1719,39 @@ async def mtermvectors( :arg body: Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation. - :arg index: The index in which the document resides. - :arg field_statistics: Specifies if document count, sum of - document frequencies and sum of total term frequencies should be - returned. Applies to all returned documents unless otherwise specified - in body 'params' or 'docs'. Default is True. - :arg fields: Comma-separated list of fields to return. Applies - to all returned documents unless otherwise specified in body 'params' or - 'docs'. - :arg ids: Comma-separated list of documents ids. You must define - ids as parameter or set 'ids' or 'docs' in the request body. - :arg offsets: Specifies if term offsets should be returned. - Applies to all returned documents unless otherwise specified in body - 'params' or 'docs'. Default is True. - :arg payloads: Specifies if term payloads should be returned. - Applies to all returned documents unless otherwise specified in body - 'params' or 'docs'. Default is True. - :arg positions: Specifies if term positions should be returned. - Applies to all returned documents unless otherwise specified in body - 'params' or 'docs'. Default is True. - :arg preference: Specify the node or shard the operation should - be performed on. Applies to all returned documents unless otherwise - specified in body 'params' or 'docs'. Default is random. - :arg realtime: Specifies if requests are real-time as opposed to - near-real-time. Default is True. - :arg routing: Routing value. Applies to all returned documents - unless otherwise specified in body 'params' or 'docs'. - :arg term_statistics: Specifies if total term frequency and - document frequency should be returned. Applies to all returned documents - unless otherwise specified in body 'params' or 'docs'. Default is false. - :arg version: Explicit version number for concurrency control. + :arg index: Name of the index that contains the documents. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg field_statistics: If `true`, the response includes the + document count, sum of document frequencies, and sum of total term + frequencies. + :arg fields: Comma-separated list or wildcard expressions of + fields to include in the statistics.Used as the default list unless a + specific field list is provided in the `completion_fields` or + `fielddata_fields` parameters. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ids: A comma-separated list of documents ids. You must + define ids as parameter or set "ids" or "docs" in the request body + :arg offsets: If `true`, the response includes term offsets. + :arg payloads: If `true`, the response includes term payloads. + :arg positions: If `true`, the response includes term positions. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If true, the request is real-time as opposed to + near-real-time. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg term_statistics: If true, the response includes term + frequency and document frequency. + :arg version: If `true`, returns the document version as part of + a hit. :arg version_type: Specific version type. Valid choices are internal, external, external_gte, force. """ @@ -1355,7 +1761,16 @@ async def mtermvectors( "POST", path, params=params, headers=headers, body=body ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def put_script( self, id: Any, @@ -1368,15 +1783,31 @@ async def put_script( Creates or updates a script. - :arg id: Script ID. + :arg id: Identifier for the stored script or search template. + Must be unique within the cluster. :arg body: The document - :arg context: Script context. + :arg context: Context in which the script or search template + should run. To prevent errors, the API immediately compiles the script + or template in this context. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ for param in (id, body): if param in SKIP_IN_PATH: @@ -1391,7 +1822,15 @@ async def put_script( ) @query_params( - "allow_no_indices", "expand_wildcards", "ignore_unavailable", "search_type" + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "search_type", + "source", ) async def rank_eval( self, @@ -1407,18 +1846,32 @@ async def rank_eval( :arg body: The ranking evaluation search definition, including search requests, document ratings and ranking metric definition. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg index: Comma-separated list of data streams, indices, and + index aliases used to limit the request. Wildcard (`*`) expressions are + supported. To target all data streams and indices in a cluster, omit + this parameter or use `_all` or `*`. + :arg 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`. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg search_type: Search operation type. Valid choices are - query_then_fetch, dfs_query_then_fetch. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `true`, missing or closed indices + are not included in the response. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg search_type: Search operation type + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1432,11 +1885,16 @@ async def rank_eval( ) @query_params( + "error_trace", + "filter_path", + "human", "max_docs", + "pretty", "refresh", "requests_per_second", "scroll", "slices", + "source", "timeout", "wait_for_active_shards", "wait_for_completion", @@ -1455,25 +1913,35 @@ async def reindex( :arg body: The search definition using the Query DSL and the prototype for the index request. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg max_docs: Maximum number of documents to process (default: all documents). - :arg refresh: Should the affected indexes be refreshed?. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, the request refreshes affected shards + to make this operation visible to search. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. Default is 0. - :arg scroll: Specify how long a consistent view of the index + requests per second.Defaults to no throttle. + :arg scroll: Specifies how long a consistent view of the index should be maintained for scrolled search. :arg slices: The number of slices this task should be divided - into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default is 1. - :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default is 1m. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is True. + into.Defaults to 1 slice, meaning the task isn’t sliced into subtasks. + Valid choices are auto. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period each indexing waits for automatic index + creation, dynamic mapping updates, and waiting for active shards. + :arg 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`). Valid choices are all, index-setting. + :arg wait_for_completion: If `true`, the request blocks until + the operation is complete. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1482,7 +1950,9 @@ async def reindex( "POST", "/_reindex", params=params, headers=headers, body=body ) - @query_params("requests_per_second") + @query_params( + "error_trace", "filter_path", "human", "pretty", "requests_per_second", "source" + ) async def reindex_rethrottle( self, task_id: Any, @@ -1493,9 +1963,19 @@ async def reindex_rethrottle( Changes the number of requests per second for a particular Reindex operation. - :arg task_id: The task id to rethrottle. + :arg task_id: Identifier for the task. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. + requests per second. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'task_id'.") @@ -1507,7 +1987,7 @@ async def reindex_rethrottle( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def render_search_template( self, body: Any = None, @@ -1520,7 +2000,18 @@ async def render_search_template( :arg body: The search definition template and its params - :arg id: The id of the stored search template. + :arg id: ID of the search template to render. If no `source` is + specified, this or the `id` request body parameter is required. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "POST", @@ -1530,7 +2021,7 @@ async def render_search_template( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def scripts_painless_execute( self, body: Any = None, @@ -1542,6 +2033,16 @@ async def scripts_painless_execute( :arg body: The script to execute + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "POST", @@ -1551,7 +2052,15 @@ async def scripts_painless_execute( body=body, ) - @query_params("rest_total_hits_as_int", "scroll") + @query_params( + "error_trace", + "filter_path", + "human", + "pretty", + "rest_total_hits_as_int", + "scroll", + "source", + ) async def scroll( self, body: Any = None, @@ -1565,12 +2074,21 @@ async def scroll( :arg body: The scroll ID if not passed by URL or query parameter. - :arg scroll_id: Scroll ID. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. + :arg scroll_id: The scroll ID for scrolled search + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg rest_total_hits_as_int: If true, the API response’s + hit.total property is returned as an integer. If false, the API + response’s hit.total property is returned as an object. + :arg scroll: Period to retain the search context for scrolling. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if scroll_id in SKIP_IN_PATH and body in SKIP_IN_PATH: raise ValueError("You need to supply scroll_id or body.") @@ -1596,9 +2114,12 @@ async def scroll( "default_operator", "df", "docvalue_fields", + "error_trace", "expand_wildcards", "explain", + "filter_path", "from_", + "human", "ignore_throttled", "ignore_unavailable", "include_named_queries_score", @@ -1606,6 +2127,7 @@ async def scroll( "max_concurrent_shard_requests", "pre_filter_shard_size", "preference", + "pretty", "q", "request_cache", "rest_total_hits_as_int", @@ -1616,6 +2138,7 @@ async def scroll( "seq_no_primary_term", "size", "sort", + "source", "stats", "stored_fields", "suggest_field", @@ -1641,104 +2164,184 @@ async def search( :arg body: The search definition using the Query DSL - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg allow_partial_search_results: Indicate if an error should - be returned if there is a partial search failure or timeout. Default is - True. - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. + :arg 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`. + :arg _source: Indicates which source fields are returned for + matching documents.These fields are returned in the `hits._source` + property of the search response.Valid values are:`true` to return the + entire document source;`false` to not return the document + source;`` to return the source fields that are specified as a + comma-separated list (supports wildcard (`*`) patterns). + :arg _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. + :arg _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. + :arg 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`. + :arg 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. + :arg analyze_wildcard: If true, wildcard and prefix queries are + analyzed.This parameter can only be used when the q query string + parameter is specified. + :arg analyzer: Analyzer to use for the query string.This + parameter can only be used when the q query string parameter is + specified. :arg batched_reduce_size: The number of shard results that - should be reduced at once on the coordinating node. This value should be + 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. - Default is 512. - :arg ccs_minimize_roundtrips: Indicates whether network round- - trips should be minimized as part of cross-cluster search requests - execution. Default is True. + :arg 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. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg docvalue_fields: Comma-separated list of fields to return - as the docvalue representation of a field for each hit. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg explain: Specify whether to return detailed information - about score computation as part of a hit. - :arg from_: Starting offset. Default is 0. - :arg ignore_throttled: Whether specified concrete, expanded or - aliased indices should be ignored when throttled. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + query: AND or OR.This parameter can only be used when the `q` query + string parameter is specified. Valid choices are and, or. + :arg 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. + :arg docvalue_fields: A comma-separated list of fields to return + as the docvalue representation for each hit. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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 choices are all, open, + closed, hidden, none. + :arg explain: If `true`, returns detailed information about + score computation as part of a hit. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg 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. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_throttled: If `true`, concrete, expanded or aliased + indices will be ignored when frozen. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. :arg include_named_queries_score: Indicates whether hit.matched_queries should be rendered as a map that includes the name of the matched query associated with its score (true) or as an array containing the name of the matched queries (false) Default is false. - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg max_concurrent_shard_requests: The number of concurrent - shard requests per node this search executes concurrently. This value - should be used to limit the impact of the search on the cluster in order - to limit the number of concurrent shard requests. Default is 5. - :arg pre_filter_shard_size: Threshold that enforces a pre-filter - round-trip to prefilter search shards based on query rewriting if the - number of shards the search request expands to exceeds the threshold. - This filter round-trip 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. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg q: Query in the Lucene query string syntax. - :arg request_cache: Specify if request cache should be used for - this request or not, defaults to index level setting. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg routing: Comma-separated list of specific routing values. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. + :arg 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. + :arg 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. + :arg 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. + :arg preference: Nodes and shards used for the search.By + default, Opensearch 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg q: Query in the Lucene query string syntax using query + parameter search.Query parameter searches do not support the full + Opensearch Query DSL but are handy for testing. + :arg request_cache: If `true`, the caching of search results is + enabled for requests where `size` is `0`.Defaults to index level + settings. + :arg rest_total_hits_as_int: Indicates whether `hits.total` + should be rendered as an integer or an object in the rest search + response. + :arg routing: Custom value used to route operations to a + specific shard. + :arg 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. :arg search_pipeline: Customizable sequence of processing stages applied to search queries. - :arg search_type: Search operation type. Valid choices are - query_then_fetch, dfs_query_then_fetch. - :arg seq_no_primary_term: Specify whether to return sequence - number and primary term of the last modification of each hit. - :arg size: Number of hits to return. Default is 10. - :arg sort: Comma-separated list of : pairs. - :arg stats: Specific 'tag' of the request for logging and + :arg search_type: How distributed term frequencies are + calculated for relevance scoring. Valid choices are query_then_fetch, + dfs_query_then_fetch. + :arg seq_no_primary_term: If `true`, returns sequence number and + primary term of the last modification of each hit. + :arg size: Defines 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. + :arg sort: A comma-separated list of : pairs. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stats: Specific `tag` of the request for logging and statistical purposes. - :arg stored_fields: Comma-separated list of stored fields to - return. - :arg suggest_field: Specify which field to use for suggestions. - :arg suggest_mode: Specify suggest mode. Valid choices are - missing, popular, always. - :arg suggest_size: How many suggestions to return in response. + :arg stored_fields: A comma-separated 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. + :arg suggest_field: Specifies which field to use for + suggestions. + :arg suggest_mode: Specifies the suggest mode.This parameter can + only be used when the `suggest_field` and `suggest_text` query string + parameters are specified. Valid choices are missing, popular, always. + :arg 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. :arg suggest_text: The source text for which the suggestions - should be returned. - :arg terminate_after: The maximum number of documents to collect - for each shard, upon reaching which the query execution will terminate - early. - :arg timeout: Operation timeout. - :arg track_scores: Whether to calculate and return scores even - if they are not used for sorting. - :arg track_total_hits: Indicate if the number of documents that - match the query should be tracked. - :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response. - :arg version: Whether to return document version as part of a + should be returned.This parameter can only be used when the + `suggest_field` and `suggest_text` query string parameters are + specified. + :arg terminate_after: Maximum number of documents to collect for + each shard.If a query reaches this limit, Opensearch terminates the + query early.Opensearch collects documents before sorting.Use with + caution.Opensearch applies this parameter to each shard handling the + request.When possible, let Opensearch 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. + :arg 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. + :arg track_scores: If `true`, calculate and return document + scores, even if the scores are not used for sorting. + :arg 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. + :arg typed_keys: If `true`, aggregation and suggester names are + be prefixed by their respective types in the response. + :arg version: If `true`, returns document version as part of a hit. """ # from is a reserved word so it cannot be used, use from_ instead @@ -1755,11 +2358,16 @@ async def search( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "local", "preference", + "pretty", "routing", + "source", ) async def search_shards( self, @@ -1772,21 +2380,38 @@ async def search_shards( executed against. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg routing: Routing value. + :arg index: Returns the indices and shards that a search request + would be executed against. + :arg 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`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path(index, "_search_shards"), params=params, headers=headers @@ -1795,16 +2420,21 @@ async def search_shards( @query_params( "allow_no_indices", "ccs_minimize_roundtrips", + "error_trace", "expand_wildcards", "explain", + "filter_path", + "human", "ignore_throttled", "ignore_unavailable", "preference", + "pretty", "profile", "rest_total_hits_as_int", "routing", "scroll", "search_type", + "source", "typed_keys", ) async def search_template( @@ -1819,37 +2449,51 @@ async def search_template( :arg body: The search definition template and its params - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg ccs_minimize_roundtrips: Indicates whether network round- - trips should be minimized as part of cross-cluster search requests - execution. Default is True. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg explain: Specify whether to return detailed information - about score computation as part of a hit. - :arg ignore_throttled: Whether specified concrete, expanded or - aliased indices should be ignored when throttled. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg profile: Specify whether to profile the query execution. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg routing: Comma-separated list of specific routing values. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. - :arg search_type: Search operation type. Valid choices are - query_then_fetch, query_and_fetch, dfs_query_then_fetch, - dfs_query_and_fetch. - :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response. + :arg index: Comma-separated list of data streams, indices, and + aliases to search. Supports wildcards (*). + :arg 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`. + :arg ccs_minimize_roundtrips: If `true`, network round-trips are + minimized for cross-cluster search requests. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg explain: If `true`, the response includes additional + details about score computation as part of a hit. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_throttled: If `true`, specified concrete, expanded, + or aliased indices are not included in the response when throttled. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg profile: If `true`, the query execution is profiled. + :arg rest_total_hits_as_int: If true, hits.total are rendered as + an integer in the response. + :arg routing: Custom value used to route operations to a + specific shard. + :arg scroll: Specifies how long a consistent view of the + indexshould be maintained for scrolled search. + :arg search_type: The type of the search operation. Valid + choices are query_then_fetch, dfs_query_then_fetch. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg typed_keys: If `true`, the response prefixes aggregation + and suggester names with their respective types. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1863,14 +2507,19 @@ async def search_template( ) @query_params( + "error_trace", "field_statistics", "fields", + "filter_path", + "human", "offsets", "payloads", "positions", "preference", + "pretty", "realtime", "routing", + "source", "term_statistics", "version", "version_type", @@ -1888,29 +2537,40 @@ async def termvectors( document. - :arg index: The index in which the document resides. + :arg index: Name of the index that contains the document. :arg body: Define parameters and or supply a document to get termvectors for. See documentation. - :arg id: Document ID. When not specified a doc param should be - supplied. - :arg field_statistics: Specifies if document count, sum of - document frequencies and sum of total term frequencies should be - returned. Default is True. - :arg fields: Comma-separated list of fields to return. - :arg offsets: Specifies if term offsets should be returned. - Default is True. - :arg payloads: Specifies if term payloads should be returned. - Default is True. - :arg positions: Specifies if term positions should be returned. - Default is True. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specifies if request is real-time as opposed to - near-real-time. Default is True. - :arg routing: Routing value. - :arg term_statistics: Specifies if total term frequency and - document frequency should be returned. Default is false. - :arg version: Explicit version number for concurrency control. + :arg id: Unique identifier of the document. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg field_statistics: If `true`, the response includes the + document count, sum of document frequencies, and sum of total term + frequencies. + :arg fields: Comma-separated list or wildcard expressions of + fields to include in the statistics.Used as the default list unless a + specific field list is provided in the `completion_fields` or + `fielddata_fields` parameters. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg offsets: If `true`, the response includes term offsets. + :arg payloads: If `true`, the response includes term payloads. + :arg positions: If `true`, the response includes term positions. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If true, the request is real-time as opposed to + near-real-time. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg term_statistics: If `true`, the response includes term + frequency and document frequency. + :arg version: If `true`, returns the document version as part of + a hit. :arg version_type: Specific version type. Valid choices are internal, external, external_gte, force. """ @@ -1927,13 +2587,18 @@ async def termvectors( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "if_primary_term", "if_seq_no", "lang", + "pretty", "refresh", "require_alias", "retry_on_conflict", "routing", + "source", "timeout", "wait_for_active_shards", ) @@ -1949,36 +2614,50 @@ async def update( Updates a document with a script or partial document. - :arg index: Index name. - :arg id: Document ID. + :arg index: The name of the index + :arg id: Document ID :arg body: The request definition requires either `script` or partial `doc` - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg if_primary_term: only perform the operation if the last - operation that has changed the document has the specified primary term. - :arg if_seq_no: only perform the operation if the last operation - that has changed the document has the specified sequence number. - :arg lang: The script language. Default is painless. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg require_alias: When true, requires destination to be an - alias. Default is false. + :arg _source: Set to false to disable source retrieval. You can + also specify a comma-separatedlist of the fields you want to retrieve. + :arg _source_excludes: Specify the source fields you want to + exclude. + :arg _source_includes: Specify the source fields you want to + retrieve. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg if_primary_term: Only perform the operation if the document + has this primary term. + :arg if_seq_no: Only perform the operation if the document has + this sequence number. + :arg lang: The script language. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If 'true', Opensearch refreshes the affected + shards to make this operationvisible to search, if 'wait_for' then wait + for a refresh to make this operationvisible to search, if 'false' do + nothing with refreshes. Valid choices are true, false, wait_for. + :arg require_alias: If true, the destination must be an index + alias. :arg retry_on_conflict: Specify how many times should the - operation be retried when a conflict occurs. Default is 0. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + operation be retried when a conflict occurs. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for dynamic mapping updates and + active shards.This guarantees Opensearch waits for at least the timeout + before failing.The actual wait time could be longer, particularly when + multiple waits occur. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operations.Set to 'all' or any + positive integer up to the total number of shards in the + index(number_of_replicas+1). Defaults to 1 meaning the primary shard. + Valid choices are all, index-setting. """ for param in (index, id, body): if param in SKIP_IN_PATH: @@ -2000,13 +2679,17 @@ async def update( "conflicts", "default_operator", "df", + "error_trace", "expand_wildcards", + "filter_path", "from_", + "human", "ignore_unavailable", "lenient", "max_docs", "pipeline", "preference", + "pretty", "q", "refresh", "request_cache", @@ -2019,6 +2702,7 @@ async def update( "size", "slices", "sort", + "source", "stats", "terminate_after", "timeout", @@ -2038,8 +2722,9 @@ async def update_by_query( for example to pick up a mapping change. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + :arg 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`. :arg body: The search definition using the Query DSL :arg _source: True or false to return the _source field or not, or a list of fields to return. @@ -2047,68 +2732,90 @@ async def update_by_query( returned _source field. :arg _source_includes: List of fields to extract and return from the _source field. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. - :arg conflicts: What to do when the operation encounters version - conflicts?. Valid choices are abort, proceed. + :arg 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`. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed. + :arg analyzer: Analyzer to use for the query string. + :arg conflicts: What to do if update by query hits version + conflicts: `abort` or `proceed`. Valid choices are abort, proceed. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg from_: Starting offset. Default is 0. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg max_docs: Maximum number of documents to process (default: - all documents). - :arg pipeline: The pipeline id to preprocess incoming documents - with. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. + query: `AND` or `OR`. Valid choices are and, or. + :arg df: Field to use as default where no field prefix is given + in the query string. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg from_: Starting offset (default: 0) + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg max_docs: Maximum number of documents to process.Defaults + to all documents. + :arg pipeline: ID of the pipeline to use to preprocess incoming + documents.If the index has a default ingest pipeline specified, then + setting the value to `_none` disables the default ingest pipeline for + this request.If a final pipeline is configured it will always run, + regardless of the value of this parameter. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg refresh: Should the affected indexes be refreshed?. - :arg request_cache: Specify if request cache should be used for - this request or not, defaults to index level setting. + :arg refresh: If `true`, Opensearch refreshes affected shards to + make the operation visible to search. + :arg request_cache: If `true`, the request cache is used for + this request. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. Default is 0. - :arg routing: Comma-separated list of specific routing values. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. - :arg scroll_size: Size on the scroll request powering the - operation. Default is 100. + requests per second. + :arg routing: Custom value used to route operations to a + specific shard. + :arg scroll: Period to retain the search context for scrolling. + :arg scroll_size: Size of the scroll request that powers the + operation. :arg search_timeout: Explicit timeout for each search request. - Defaults to no timeout. - :arg search_type: Search operation type. Valid choices are + :arg search_type: The type of the search operation. Available + options: `query_then_fetch`, `dfs_query_then_fetch`. Valid choices are query_then_fetch, dfs_query_then_fetch. :arg size: Deprecated, please use `max_docs` instead. :arg slices: The number of slices this task should be divided - into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default is 1. - :arg sort: Comma-separated list of : pairs. - :arg stats: Specific 'tag' of the request for logging and + into. Valid choices are auto. + :arg sort: A comma-separated list of : pairs. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stats: Specific `tag` of the request for logging and statistical purposes. - :arg terminate_after: The maximum number of documents to collect - for each shard, upon reaching which the query execution will terminate - early. - :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default is 1m. - :arg version: Whether to return document version as part of a - hit. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is True. + :arg terminate_after: Maximum number of documents to collect for + each shard.If a query reaches this limit, Opensearch terminates the + query early.Opensearch collects documents before sorting.Use with + caution.Opensearch applies this parameter to each shard handling the + request.When possible, let Opensearch perform early termination + automatically.Avoid specifying this parameter for requests that target + data streams with backing indices across multiple data tiers. + :arg timeout: Period each update request waits for the following + operations: dynamic mapping updates, waiting for active shards. + :arg version: If `true`, returns the document version as part of + a hit. + :arg 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`). Valid choices are all, index-setting. + :arg wait_for_completion: If `true`, the request blocks until + the operation is complete. """ # from is a reserved word so it cannot be used, use from_ instead if "from_" in params: @@ -2125,7 +2832,9 @@ async def update_by_query( body=body, ) - @query_params("requests_per_second") + @query_params( + "error_trace", "filter_path", "human", "pretty", "requests_per_second", "source" + ) async def update_by_query_rethrottle( self, task_id: Any, @@ -2137,9 +2846,19 @@ async def update_by_query_rethrottle( operation. - :arg task_id: The task id to rethrottle. + :arg task_id: The ID for the task. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. + requests per second. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'task_id'.") @@ -2151,7 +2870,7 @@ async def update_by_query_rethrottle( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_script_context( self, params: Any = None, @@ -2160,12 +2879,23 @@ async def get_script_context( """ Returns all script contexts. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_script_context", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_script_languages( self, params: Any = None, @@ -2174,6 +2904,17 @@ async def get_script_languages( """ Returns available script types, languages and contexts. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_script_language", params=params, headers=headers @@ -2181,10 +2922,15 @@ async def get_script_languages( @query_params( "allow_partial_pit_creation", + "error_trace", "expand_wildcards", + "filter_path", + "human", "keep_alive", "preference", + "pretty", "routing", + "source", ) async def create_pit( self, @@ -2200,13 +2946,23 @@ async def create_pit( string to perform the operation on all indices. :arg allow_partial_pit_creation: Allow if point in time can be created with partial failures. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg keep_alive: Specify the keep alive for point in time. :arg preference: Specify the node or shard the operation should be performed on. Default is random. + :arg pretty: Whether to pretty format the returned JSON + response. :arg routing: Comma-separated list of specific routing values. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -2218,7 +2974,7 @@ async def create_pit( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_all_pits( self, params: Any = None, @@ -2227,12 +2983,23 @@ async def delete_all_pits( """ Deletes all active point in time searches. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "DELETE", "/_search/point_in_time/_all", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_pit( self, body: Any = None, @@ -2244,6 +3011,16 @@ async def delete_pit( :arg body: The point-in-time ids to be deleted + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "DELETE", @@ -2253,7 +3030,7 @@ async def delete_pit( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_all_pits( self, params: Any = None, @@ -2262,6 +3039,17 @@ async def get_all_pits( """ Lists all active point in time searches. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_search/point_in_time/_all", params=params, headers=headers diff --git a/opensearchpy/_async/client/cat.py b/opensearchpy/_async/client/cat.py index 89f7a9a7..a11c237a 100644 --- a/opensearchpy/_async/client/cat.py +++ b/opensearchpy/_async/client/cat.py @@ -40,7 +40,20 @@ class CatClient(NamespacedClient): - @query_params("expand_wildcards", "format", "h", "help", "local", "s", "v") + @query_params( + "error_trace", + "expand_wildcards", + "filter_path", + "format", + "h", + "help", + "human", + "local", + "pretty", + "s", + "source", + "v", + ) async def aliases( self, name: Any = None, @@ -52,25 +65,49 @@ async def aliases( filter and routing infos. - :arg name: Comma-separated list of alias names. + :arg name: A comma-separated list of aliases to retrieve. + Supports wildcards (`*`). To retrieve all aliases, omit this parameter + or use `*` or `_all`. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", _make_path("_cat", "aliases", name), params=params, headers=headers ) - @query_params("bytes", "format", "h", "help", "s", "v") + @query_params( + "bytes", + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "v", + ) async def all_pit_segments( self, params: Any = None, @@ -82,12 +119,22 @@ async def all_pit_segments( :arg bytes: The unit in which to display byte values. Valid choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -97,12 +144,17 @@ async def all_pit_segments( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) async def allocation( @@ -116,23 +168,33 @@ async def allocation( much disk space they are using. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg node_id: Comma-separated list of node identifiers or names + used to limit the returned information. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -144,12 +206,17 @@ async def allocation( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) async def cluster_manager( @@ -163,24 +230,45 @@ async def cluster_manager( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", "/_cat/cluster_manager", params=params, headers=headers ) - @query_params("format", "h", "help", "s", "v") + @query_params( + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "v", + ) async def count( self, index: Any = None, @@ -192,21 +280,44 @@ async def count( individual indices. - :arg index: Comma-separated list of indices to limit the - returned information. + :arg 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`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", _make_path("_cat", "count", index), params=params, headers=headers ) - @query_params("bytes", "format", "h", "help", "s", "v") + @query_params( + "bytes", + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "v", + ) async def fielddata( self, fields: Any = None, @@ -218,16 +329,26 @@ async def fielddata( node in the cluster. - :arg fields: Comma-separated list of fields to return in the - output. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg fields: Comma-separated list of fields used to limit + returned information. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -237,7 +358,20 @@ async def fielddata( headers=headers, ) - @query_params("format", "h", "help", "s", "time", "ts", "v") + @query_params( + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "time", + "ts", + "v", + ) async def health( self, params: Any = None, @@ -247,22 +381,34 @@ async def health( Returns a concise representation of the cluster health. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. - :arg ts: Set to false to disable timestamping. Default is True. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg time: The unit used to display time values. Valid choices + are nanos, micros, ms, s, m, h, d. + :arg ts: If true, returns `HH:MM:SS` and Unix epoch timestamps. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", "/_cat/health", params=params, headers=headers ) - @query_params("help", "s") + @query_params( + "error_trace", "filter_path", "help", "human", "pretty", "s", "source" + ) async def help( self, params: Any = None, @@ -272,9 +418,19 @@ async def help( Returns help for the Cat APIs. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_cat", params=params, headers=headers @@ -283,16 +439,21 @@ async def help( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "format", "h", "health", "help", + "human", "include_unloaded_segments", "local", "master_timeout", + "pretty", "pri", "s", + "source", "time", "v", ) @@ -307,36 +468,45 @@ async def indices( counts, disk size, ... - :arg index: Comma-separated list of indices to limit the - returned information. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg 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`. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: The type of index that wildcard patterns + can match. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg health: Health status ('green', 'yellow', or 'red') to - filter only indices matching the specified health status. Valid choices - are green, yellow, red. + :arg health: The health status used to limit returned indices. + By default, the response includes indices of any health status. Valid + choices are green, yellow, red. :arg help: Return help information. Default is false. - :arg include_unloaded_segments: If set to true segment stats - will include stats for segments that are not currently loaded into - memory. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg include_unloaded_segments: If true, the response includes + information from segments that are not loaded into memory. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. - :arg pri: Set to true to return stats only for primary shards. - Default is false. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg pri: If true, the response only includes information from + primary shards. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg time: The unit used to display time values. Valid choices + are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -345,12 +515,17 @@ async def indices( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) async def master( @@ -364,17 +539,27 @@ async def master( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ from warnings import warn @@ -388,12 +573,17 @@ async def master( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) async def nodeattrs( @@ -407,17 +597,27 @@ async def nodeattrs( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -427,13 +627,18 @@ async def nodeattrs( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "full_id", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "time", "v", ) @@ -446,26 +651,35 @@ async def nodes( Returns basic statistics about performance of cluster nodes. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. - :arg full_id: Return the full node ID instead of the shortened - version. Default is false. + :arg full_id: If `true`, return the full node ID. If `false`, + return the shortened node ID. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. - :arg local (Deprecated: This parameter does not cause this API - to act locally.): Return local information, do not retrieve the state + :arg human: Whether to return human readable values for + statistics. + :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -474,12 +688,17 @@ async def nodes( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "time", "v", ) @@ -494,26 +713,48 @@ async def pending_tasks( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", "/_cat/pending_tasks", params=params, headers=headers ) - @query_params("bytes", "format", "h", "help", "s", "v") + @query_params( + "bytes", + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "v", + ) async def pit_segments( self, body: Any = None, @@ -526,12 +767,22 @@ async def pit_segments( :arg bytes: The unit in which to display byte values. Valid choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -540,12 +791,17 @@ async def pit_segments( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) async def plugins( @@ -559,17 +815,27 @@ async def plugins( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -577,7 +843,20 @@ async def plugins( ) @query_params( - "active_only", "bytes", "detailed", "format", "h", "help", "s", "time", "v" + "active_only", + "bytes", + "detailed", + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "time", + "v", ) async def recovery( self, @@ -592,19 +871,29 @@ async def recovery( :arg index: Comma-separated list or wildcard expression of index names to limit the returned information. :arg active_only: If `true`, the response only includes ongoing - shard recoveries. Default is false. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + shard recoveries. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg detailed: If `true`, the response includes detailed - information about shard recoveries. Default is false. + information about shard recoveries. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -613,12 +902,17 @@ async def recovery( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) async def repositories( @@ -632,17 +926,27 @@ async def repositories( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -655,14 +959,19 @@ async def repositories( "bytes", "completed_only", "detailed", + "error_trace", "expand_wildcards", + "filter_path", "format", "h", "help", + "human", "ignore_throttled", "ignore_unavailable", + "pretty", "s", "shards", + "source", "time", "timeout", "v", @@ -691,22 +1000,32 @@ async def segment_replication( latest completed segment replication events. Default is false. :arg detailed: If `true`, the response includes detailed information about segment replications. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg ignore_throttled: Whether specified concrete, expanded or aliased indices should be ignored when throttled. :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed). + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. :arg shards: Comma-separated list of shards to display. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg timeout: Operation timeout. :arg v: Verbose mode. Display column headers. Default is false. """ @@ -720,11 +1039,16 @@ async def segment_replication( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "master_timeout", + "pretty", "s", + "source", "v", ) async def segments( @@ -737,21 +1061,32 @@ async def segments( Provides low-level information about the segments in the shards of an index. - :arg index: Comma-separated list of indices to limit the - returned information. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg 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`. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -761,12 +1096,17 @@ async def segments( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "time", "v", ) @@ -780,25 +1120,36 @@ async def shards( Provides a detailed view of shard allocation on nodes. - :arg index: Comma-separated list of indices to limit the - returned information. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg 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`. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -807,13 +1158,18 @@ async def shards( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", "size", + "source", "v", ) async def thread_pool( @@ -827,22 +1183,32 @@ async def thread_pool( queue and rejected statistics are returned for all thread pools. - :arg thread_pool_patterns: Comma-separated list of regular- - expressions to filter the thread pools in the output. + :arg thread_pool_patterns: A comma-separated list of thread pool + names used to limit the request. Accepts wildcard expressions. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. :arg size: The multiplier in which to display values. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -854,12 +1220,17 @@ async def thread_pool( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "ignore_unavailable", "master_timeout", + "pretty", "s", + "source", "time", "v", ) @@ -873,23 +1244,35 @@ async def snapshots( Returns all snapshots in a specific repository. - :arg repository: Comma-separated list of repository names. + :arg 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, Opensearch + returns an error. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). Default is - false. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `true`, the response does not + include information from unavailable snapshots. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -902,12 +1285,17 @@ async def snapshots( @query_params( "actions", "detailed", + "error_trace", + "filter_path", "format", "h", "help", + "human", "nodes", "parent_task_id", + "pretty", "s", + "source", "time", "v", ) @@ -921,24 +1309,34 @@ async def tasks( the cluster. - :arg actions: Comma-separated list of actions that should be - returned. Leave empty to return all. - :arg detailed: Return detailed task information. Default is - false. + :arg actions: The task action names, which are used to limit the + response. + :arg detailed: If `true`, the response includes detailed + information about shard recoveries. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg nodes: Comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. - :arg parent_task_id: Return tasks with specified parent task id - (node_id:task_number). Set to -1 to return all. + :arg parent_task_id: The parent task identifier, which is used + to limit the response. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -947,12 +1345,17 @@ async def tasks( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) async def templates( @@ -965,20 +1368,31 @@ async def templates( Returns information about existing templates. - :arg name: The name of the template. + :arg name: The name of the template to return. Accepts wildcard + expressions. If omitted, all templates are returned. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( diff --git a/opensearchpy/_async/client/cluster.py b/opensearchpy/_async/client/cluster.py index be068ecb..71c6ee28 100644 --- a/opensearchpy/_async/client/cluster.py +++ b/opensearchpy/_async/client/cluster.py @@ -43,10 +43,15 @@ class ClusterClient(NamespacedClient): @query_params( "awareness_attribute", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "level", "local", "master_timeout", + "pretty", + "source", "timeout", "wait_for_active_shards", "wait_for_events", @@ -65,36 +70,63 @@ async def health( Returns basic information about the health of the cluster. - :arg index: Limit the information returned to specific indicies. + :arg index: Comma-separated list of data streams, indices, and + index aliases used to limit the request. Wildcard expressions (*) are + supported. To target all data streams and indices in a cluster, omit + this parameter or use `_all` or `*`. :arg awareness_attribute: The awareness attribute for which the health is required. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. - :arg level: Specify the level of detail for returned - information. Valid choices are cluster, indices, shards, - awareness_attributes. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg level: Can be one of cluster, indices or shards. Controls + the details level of the health information returned. Valid choices are + cluster, indices, shards, awareness_attributes. + :arg local: If true, the request retrieves information from the + local node only. Defaults to false, which means information is retrieved + from the master node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Wait until the specified number of - shards is active. - :arg wait_for_events: Wait until all currently queued events - with the given priority are processed. Valid choices are immediate, - urgent, high, normal, low, languid. - :arg wait_for_no_initializing_shards: Whether to wait until - there are no initializing shards in the cluster. - :arg wait_for_no_relocating_shards: Whether to wait until there - are no relocating shards in the cluster. - :arg wait_for_nodes: Wait until the specified number of nodes is - available. - :arg wait_for_status: Wait until cluster is in a specific state. - Valid choices are green, yellow, red. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_active_shards: A number controlling to how many + active shards to wait for, all to wait for all shards in the cluster to + be active, or 0 to not wait. Valid choices are all, index-setting. + :arg wait_for_events: Can be one of immediate, urgent, high, + normal, low, languid. Wait until all currently queued events with the + given priority are processed. Valid choices are immediate, urgent, high, + normal, low, languid. + :arg wait_for_no_initializing_shards: A boolean value which + controls whether to wait (until the timeout provided) for the cluster to + have no shard initializations. Defaults to false, which means it will + not wait for initializing shards. + :arg wait_for_no_relocating_shards: A boolean value which + controls whether to wait (until the timeout provided) for the cluster to + have no shard relocations. Defaults to false, which means it will not + wait for relocating shards. + :arg wait_for_nodes: The request waits until the specified + number N of nodes is available. It also accepts >=N, <=N, >N and yellow > red. By default, will + not wait for any status. Valid choices are green, yellow, red. """ return await self.transport.perform_request( "GET", @@ -103,7 +135,16 @@ async def health( headers=headers, ) - @query_params("cluster_manager_timeout", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) async def pending_tasks( self, params: Any = None, @@ -116,11 +157,23 @@ async def pending_tasks( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg local: If `true`, the request retrieves information from + the local node only.If `false`, information is retrieved from the master + node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_cluster/pending_tasks", params=params, headers=headers @@ -129,11 +182,16 @@ async def pending_tasks( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "local", "master_timeout", + "pretty", + "source", "wait_for_metadata_version", "wait_for_timeout", ) @@ -149,31 +207,40 @@ async def state( :arg metric: Limit the information returned to the specified - metrics. Valid choices are _all, blocks, metadata, nodes, routing_table, - routing_nodes, master_node, cluster_manager_node, version. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + metrics + :arg index: A comma-separated list of index names; use `_all` or + empty string to perform the operation on all indices :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + string or when no indices have been specified) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: Return settings in flat format (default: + false) + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + should be ignored when unavailable (missing or closed) :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + from cluster-manager node (default: false) :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_metadata_version: Wait for the metadata version to - be equal or greater than the specified metadata version. + be equal or greater than the specified metadata version :arg wait_for_timeout: The maximum time to wait for - wait_for_metadata_version before timing out. + wait_for_metadata_version before timing out """ if index and metric in SKIP_IN_PATH: metric = "_all" @@ -185,7 +252,15 @@ async def state( headers=headers, ) - @query_params("flat_settings", "timeout") + @query_params( + "error_trace", + "filter_path", + "flat_settings", + "human", + "pretty", + "source", + "timeout", + ) async def stats( self, node_id: Any = None, @@ -196,13 +271,23 @@ async def stats( Returns high-level overview of cluster statistics. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg timeout: Operation timeout. + :arg node_id: Comma-separated list of node filters used to limit + returned information. Defaults to all nodes in the cluster. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg 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. """ return await self.transport.perform_request( "GET", @@ -218,10 +303,15 @@ async def stats( @query_params( "cluster_manager_timeout", "dry_run", + "error_trace", "explain", + "filter_path", + "human", "master_timeout", "metric", + "pretty", "retry_failed", + "source", "timeout", ) async def reroute( @@ -238,18 +328,31 @@ async def reroute( `cancel`, `allocate`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg dry_run: Simulate the operation only and return the - resulting state. - :arg explain: Return an explanation of why the commands can or - cannot be executed. + :arg dry_run: If true, then the request simulates the operation + only and returns the resulting state. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg explain: If true, then the response contains an explanation + of why the commands can or cannot be executed. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg metric: Limit the information returned to the specified - metrics. Defaults to all but metadata. - :arg retry_failed: Retries allocation of shards that are blocked - due to too many subsequent allocation failures. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg metric: Limits the information returned to the specified + metrics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg retry_failed: If true, then retries allocation of shards + that are blocked due to too many subsequent allocation failures. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. """ return await self.transport.perform_request( "POST", "/_cluster/reroute", params=params, headers=headers, body=body @@ -257,9 +360,14 @@ async def reroute( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "flat_settings", + "human", "include_defaults", "master_timeout", + "pretty", + "source", "timeout", ) async def get_settings( @@ -273,21 +381,41 @@ async def get_settings( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg include_defaults: Whether to return all default clusters - setting. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg include_defaults: If `true`, returns default cluster + settings from the local node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ return await self.transport.perform_request( "GET", "/_cluster/settings", params=params, headers=headers ) @query_params( - "cluster_manager_timeout", "flat_settings", "master_timeout", "timeout" + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "master_timeout", + "pretty", + "source", + "timeout", ) async def put_settings( self, @@ -303,12 +431,22 @@ async def put_settings( or `persistent` (survives cluster restart). :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: Return settings in flat format (default: + false) + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -317,7 +455,7 @@ async def put_settings( "PUT", "/_cluster/settings", params=params, headers=headers, body=body ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def remote_info( self, params: Any = None, @@ -326,12 +464,31 @@ async def remote_info( """ Returns the information about configured remote clusters. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_remote/info", params=params, headers=headers ) - @query_params("include_disk_info", "include_yes_decisions") + @query_params( + "error_trace", + "filter_path", + "human", + "include_disk_info", + "include_yes_decisions", + "pretty", + "source", + ) async def allocation_explain( self, body: Any = None, @@ -344,10 +501,20 @@ async def allocation_explain( :arg body: The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard' - :arg include_disk_info: Return information about disk usage and - shard sizes. Default is false. - :arg include_yes_decisions: Return 'YES' decisions in - explanation. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg include_disk_info: If true, returns information about disk + usage and shard sizes. + :arg include_yes_decisions: If true, returns YES decisions in + explanation. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "POST", @@ -357,7 +524,16 @@ async def allocation_explain( body=body, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def delete_component_template( self, name: Any, @@ -368,13 +544,27 @@ async def delete_component_template( Deletes a component template. - :arg name: The name of the template. + :arg name: Name of the component template to delete. Wildcard + (*) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg 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 a required argument 'name'.") @@ -386,7 +576,16 @@ async def delete_component_template( headers=headers, ) - @query_params("cluster_manager_timeout", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) async def get_component_template( self, name: Any = None, @@ -397,14 +596,27 @@ async def get_component_template( Returns one or more component templates. - :arg name: The Comma-separated names of the component templates. + :arg name: Name of the component template to retrieve. Wildcard + (`*`) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg local: If `true`, the request retrieves information from + the local node only.If `false`, information is retrieved from the master + node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", @@ -413,7 +625,17 @@ async def get_component_template( headers=headers, ) - @query_params("cluster_manager_timeout", "create", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def put_component_template( self, name: Any, @@ -425,15 +647,35 @@ async def put_component_template( Creates or updates a component template. - :arg name: The name of the template. + :arg name: Name of the component template to create. Opensearch + includes the following built-in component templates: `logs-mappings`; + 'logs-settings`; `metrics-mappings`; `metrics-settings`;`synthetics- + mapping`; `synthetics-settings`. Opensearch Agent uses these templates + to configure backing indices for its data streams. If you use Opensearch + 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 Opensearch Agent and want to disable all built-in component + and index templates, set `stack.templates.enabled` to `false` using the + cluster update settings API. :arg body: The template definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template should only be added if - new or can also replace an existing one. Default is false. + :arg create: If `true`, this request cannot replace or update + existing component templates. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg timeout: Operation timeout. """ for param in (name, body): @@ -448,7 +690,16 @@ async def put_component_template( body=body, ) - @query_params("cluster_manager_timeout", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) async def exists_component_template( self, name: Any, @@ -459,14 +710,27 @@ async def exists_component_template( Returns information about whether a particular component template exist. - :arg name: The name of the template. + :arg name: Name of the component template to check existence of. + Wildcard (*) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg local: If true, the request retrieves information from the + local node only.Defaults to false, which means information is retrieved + from the master node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response isreceived before the timeout + expires, the request fails and returns anerror. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -478,7 +742,9 @@ async def exists_component_template( headers=headers, ) - @query_params("wait_for_removal") + @query_params( + "error_trace", "filter_path", "human", "pretty", "source", "wait_for_removal" + ) async def delete_voting_config_exclusions( self, params: Any = None, @@ -488,9 +754,22 @@ async def delete_voting_config_exclusions( Clears cluster voting config exclusions. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_removal: Specifies whether to wait for all - excluded nodes to be removed from the cluster before clearing the voting - configuration exclusions list. Default is True. + excluded nodes to be removed from thecluster before clearing the voting + configuration exclusions list.Defaults to true, meaning that all + excluded nodes must be removed fromthe cluster before this API takes any + action. If set to false then thevoting configuration exclusions list is + cleared even if some excludednodes are still in the cluster. """ return await self.transport.perform_request( "DELETE", @@ -499,7 +778,16 @@ async def delete_voting_config_exclusions( headers=headers, ) - @query_params("node_ids", "node_names", "timeout") + @query_params( + "error_trace", + "filter_path", + "human", + "node_ids", + "node_names", + "pretty", + "source", + "timeout", + ) async def post_voting_config_exclusions( self, params: Any = None, @@ -509,19 +797,33 @@ async def post_voting_config_exclusions( Updates the cluster voting config exclusions by node ids or node names. - :arg node_ids: Comma-separated list of the persistent ids of the - nodes to exclude from the voting configuration. If specified, you may - not also specify ?node_names. - :arg node_names: Comma-separated list of the names of the nodes - to exclude from the voting configuration. If specified, you may not also - specify ?node_ids. - :arg timeout: Operation timeout. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg node_ids: A comma-separated list of the persistent ids of + the nodes to excludefrom the voting configuration. If specified, you may + not also specify node_names. + :arg node_names: A comma-separated list of the names of the + nodes to exclude from thevoting configuration. If specified, you may not + also specify node_ids. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: When adding a voting configuration exclusion, the + API waits for thespecified nodes to be excluded from the voting + configuration beforereturning. If the timeout expires before the + appropriate conditionis satisfied, the request fails and returns an + error. """ return await self.transport.perform_request( "POST", "/_cluster/voting_config_exclusions", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_decommission_awareness( self, params: Any = None, @@ -530,12 +832,23 @@ async def delete_decommission_awareness( """ Delete any existing decommission. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "DELETE", "/_cluster/decommission/awareness", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_weighted_routing( self, params: Any = None, @@ -544,6 +857,17 @@ async def delete_weighted_routing( """ Delete weighted shard routing weights. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "DELETE", @@ -552,7 +876,7 @@ async def delete_weighted_routing( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_decommission_awareness( self, awareness_attribute_name: Any, @@ -564,6 +888,16 @@ async def get_decommission_awareness( :arg awareness_attribute_name: Awareness attribute name. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if awareness_attribute_name in SKIP_IN_PATH: raise ValueError( @@ -583,7 +917,7 @@ async def get_decommission_awareness( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_weighted_routing( self, attribute: Any, @@ -595,6 +929,16 @@ async def get_weighted_routing( :arg attribute: Awareness attribute name. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if attribute in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'attribute'.") @@ -606,7 +950,7 @@ async def get_weighted_routing( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def put_decommission_awareness( self, awareness_attribute_name: Any, @@ -620,6 +964,16 @@ async def put_decommission_awareness( :arg awareness_attribute_name: Awareness attribute name. :arg awareness_attribute_value: Awareness attribute value. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (awareness_attribute_name, awareness_attribute_value): if param in SKIP_IN_PATH: @@ -638,7 +992,7 @@ async def put_decommission_awareness( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def put_weighted_routing( self, attribute: Any, @@ -650,6 +1004,16 @@ async def put_weighted_routing( :arg attribute: Awareness attribute name. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if attribute in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'attribute'.") diff --git a/opensearchpy/_async/client/dangling_indices.py b/opensearchpy/_async/client/dangling_indices.py index beb24247..75e64013 100644 --- a/opensearchpy/_async/client/dangling_indices.py +++ b/opensearchpy/_async/client/dangling_indices.py @@ -41,7 +41,15 @@ class DanglingIndicesClient(NamespacedClient): @query_params( - "accept_data_loss", "cluster_manager_timeout", "master_timeout", "timeout" + "accept_data_loss", + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", ) async def delete_dangling_index( self, @@ -53,15 +61,25 @@ async def delete_dangling_index( Deletes the specified dangling index. - :arg index_uuid: The UUID of the dangling index. + :arg index_uuid: The UUID of the dangling index :arg accept_data_loss: Must be set to true in order to delete - the dangling index. + the dangling index :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if index_uuid in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index_uuid'.") @@ -74,7 +92,15 @@ async def delete_dangling_index( ) @query_params( - "accept_data_loss", "cluster_manager_timeout", "master_timeout", "timeout" + "accept_data_loss", + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", ) async def import_dangling_index( self, @@ -86,15 +112,25 @@ async def import_dangling_index( Imports the specified dangling index. - :arg index_uuid: The UUID of the dangling index. + :arg index_uuid: The UUID of the dangling index :arg accept_data_loss: Must be set to true in order to import - the dangling index. + the dangling index :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if index_uuid in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index_uuid'.") @@ -103,7 +139,7 @@ async def import_dangling_index( "POST", _make_path("_dangling", index_uuid), params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def list_dangling_indices( self, params: Any = None, @@ -112,6 +148,17 @@ async def list_dangling_indices( """ Returns all dangling indices. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_dangling", params=params, headers=headers diff --git a/opensearchpy/_async/client/indices.py b/opensearchpy/_async/client/indices.py index fc1111d1..6d259bc1 100644 --- a/opensearchpy/_async/client/indices.py +++ b/opensearchpy/_async/client/indices.py @@ -40,7 +40,7 @@ class IndicesClient(NamespacedClient): - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def analyze( self, body: Any = None, @@ -56,6 +56,16 @@ async def analyze( :arg body: Define analyzer/tokenizer parameters and the text on which the analysis should be performed :arg index: The name of the index to scope the operation. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "POST", @@ -65,7 +75,16 @@ async def analyze( body=body, ) - @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") + @query_params( + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "source", + ) async def refresh( self, index: Any = None, @@ -76,16 +95,31 @@ async def refresh( Performs the refresh operation in one or more indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + :arg 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`. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "POST", _make_path(index, "_refresh"), params=params, headers=headers @@ -93,9 +127,14 @@ async def refresh( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", "force", + "human", "ignore_unavailable", + "pretty", + "source", "wait_if_ongoing", ) async def flush( @@ -108,32 +147,52 @@ async def flush( Performs the flush operation on one or more indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg force: Whether a flush should be forced even if it is not - necessarily needed ie. if no changes will be committed to the index. - This is useful if transaction log IDs should be incremented even if no - uncommitted changes are present. (This setting can be considered as - internal). - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg wait_if_ongoing: If set to true the flush operation will - block until the flush can be executed if another flush operation is - already executing. If set to false the flush will be skipped iff if - another flush operation is already running. Default is True. + :arg 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`. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg force: If `true`, the request forces a flush even if there + are no changes to commit to the index. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg wait_if_ongoing: If `true`, the flush operation blocks + until execution when another flush operation is running.If `false`, + Opensearch returns an error if you request a flush when another flush + operation is running. """ return await self.transport.perform_request( "POST", _make_path(index, "_flush"), params=params, headers=headers ) @query_params( - "cluster_manager_timeout", "master_timeout", "timeout", "wait_for_active_shards" + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + "wait_for_active_shards", ) async def create( self, @@ -146,17 +205,32 @@ async def create( Creates an index with optional settings and mappings. - :arg index: Index name. + :arg index: Name of the index you wish to create. :arg body: The configuration for the index (`settings` and `mappings`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for before the operation returns. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg 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`). Valid choices are all, index-setting. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -167,7 +241,12 @@ async def create( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", "master_timeout", + "pretty", + "source", "task_execution_timeout", "timeout", "wait_for_active_shards", @@ -185,20 +264,35 @@ async def clone( Clones an index. - :arg index: The name of the source index to clone. - :arg target: The name of the target index. + :arg index: Name of the source index to clone. + :arg target: Name of the target index to create. :arg body: The configuration for the target index (`settings` and `aliases`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg task_execution_timeout: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for on the cloned index before the operation returns. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg 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`). Valid choices are all, index-setting. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -217,12 +311,17 @@ async def clone( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "include_defaults", "local", "master_timeout", + "pretty", + "source", ) async def get( self, @@ -234,27 +333,43 @@ async def get( Returns information about one or more indices. - :arg index: Comma-separated list of indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). Default is false. + :arg index: Comma-separated list of data streams, indices, and + index aliases used to limit the request. Wildcard expressions (*) are + supported. + :arg allow_no_indices: If false, the request returns an error if + any wildcard expression, index alias, or _all value targets onlymissing + 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. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). Default is - false. - :arg include_defaults: Whether to return all default setting for - each of the indices. Default is false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard expressions + can match. If the request can target data streams, this + argumentdetermines whether wildcard expressions match hidden data + streams. Supports comma-separated values,such as open,hidden. Valid + choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If true, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If false, requests that target a + missing index return an error. + :arg include_defaults: If true, return all default settings in + the response. + :arg local: If true, the request retrieves information from the + local node only. Defaults to false, which means information is retrieved + from the master node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -266,9 +381,14 @@ async def get( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "task_execution_timeout", "timeout", "wait_for_active_shards", @@ -284,25 +404,50 @@ async def open( Opens an index. - :arg index: Comma-separated list of indices to open. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg 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 `opensearch.yml` file or using the cluster update + settings API. + :arg 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. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg task_execution_timeout: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Sets the number of active shards to - wait for before the operation returns. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg 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`). Valid choices are all, index-setting. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -316,9 +461,14 @@ async def open( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "timeout", "wait_for_active_shards", ) @@ -332,23 +482,43 @@ async def close( Closes an index. - :arg index: Comma-separated list of indices to close. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg index: Comma-separated list or wildcard expression of index + names used to limit the request. + :arg 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. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Sets the number of active shards to - wait for before the operation returns. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg 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`). Valid choices are all, index-setting. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -360,9 +530,14 @@ async def close( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "timeout", ) async def delete( @@ -375,23 +550,41 @@ async def delete( Deletes an index. - :arg index: Comma-separated list of indices to delete; use - `_all` or `*` string to delete all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). Default is false. + :arg 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`. + :arg 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. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). Default is - false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg 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 a required argument 'index'.") @@ -402,11 +595,16 @@ async def delete( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "include_defaults", "local", + "pretty", + "source", ) async def exists( self, @@ -418,22 +616,35 @@ async def exists( Returns information about whether a particular index exists. - :arg index: Comma-separated list of indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). Default is false. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). Default is - false. - :arg include_defaults: Whether to return all default setting for - each of the indices. Default is false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg index: Comma-separated list of data streams, indices, and + aliases. Supports wildcards (`*`). + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg include_defaults: If `true`, return all default settings in + the response. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -445,9 +656,14 @@ async def exists( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "timeout", "write_index_only", ) @@ -465,22 +681,39 @@ async def put_mapping( :arg body: The mapping definition :arg index: Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg 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. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg write_index_only: When true, applies mappings only to the - write index of an alias or data stream. Default is false. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg write_index_only: If `true`, the mappings are applied only + to the current write index for the target. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -499,10 +732,15 @@ async def put_mapping( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "local", "master_timeout", + "pretty", + "source", ) async def get_mapping( self, @@ -514,23 +752,39 @@ async def get_mapping( Returns mappings for one or more indices. - :arg index: Comma-separated list of indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg 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`. + :arg 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. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg local (Deprecated: This parameter is a no-op and field - mappings are always retrieved locally.): Return local information, do - not retrieve the state from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg local: If `true`, the request retrieves information from + the local node only. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path(index, "_mapping"), params=params, headers=headers @@ -538,10 +792,15 @@ async def get_mapping( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "include_defaults", "local", + "pretty", + "source", ) async def get_field_mapping( self, @@ -554,20 +813,37 @@ async def get_field_mapping( Returns mapping for one or more fields. - :arg fields: Comma-separated list of fields. - :arg index: Comma-separated list of indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg include_defaults: Whether the default mapping values should - be returned as well. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg fields: Comma-separated list or wildcard expression of + fields used to limit returned information. + :arg 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`. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg include_defaults: If `true`, return all default settings in + the response. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if fields in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'fields'.") @@ -579,7 +855,16 @@ async def get_field_mapping( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def put_alias( self, index: Any, @@ -592,17 +877,32 @@ async def put_alias( Creates or updates an alias. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg name: The name of the alias to be created or updated. + :arg 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. + :arg name: Alias to update. If the alias doesn’t exist, the + request creates it. Index alias names support date math. :arg body: The settings for the alias, such as `routing` or `filter` :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ for param in (index, name): if param in SKIP_IN_PATH: @@ -616,7 +916,17 @@ async def put_alias( body=body, ) - @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable", "local") + @query_params( + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "local", + "pretty", + "source", + ) async def exists_alias( self, name: Any, @@ -628,18 +938,36 @@ async def exists_alias( Returns information about whether a particular alias exists. - :arg name: Comma-separated list of alias names. - :arg index: Comma-separated list of indices to filter aliases. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg name: Comma-separated list of aliases to check. Supports + wildcards (`*`). + :arg 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`. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, requests that include a + missing data stream or index in the target indices or data streams + return an error. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -648,7 +976,17 @@ async def exists_alias( "HEAD", _make_path(index, "_alias", name), params=params, headers=headers ) - @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable", "local") + @query_params( + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "local", + "pretty", + "source", + ) async def get_alias( self, index: Any = None, @@ -660,24 +998,51 @@ async def get_alias( Returns an alias. - :arg index: Comma-separated list of indices to filter aliases. - :arg name: Comma-separated list of alias names. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg 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`. + :arg name: Comma-separated list of aliases to retrieve. Supports + wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` + or `_all`. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path(index, "_alias", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def update_aliases( self, body: Any, @@ -691,10 +1056,23 @@ async def update_aliases( :arg body: The definition of `actions` to perform :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -703,7 +1081,16 @@ async def update_aliases( "POST", "/_aliases", params=params, headers=headers, body=body ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def delete_alias( self, index: Any, @@ -715,16 +1102,29 @@ async def delete_alias( Deletes an alias. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg name: Comma-separated list of aliases to delete (supports - wildcards); use `_all` to delete all aliases for the specified indices. + :arg index: Comma-separated list of data streams or indices used + to limit the request. Supports wildcards (`*`). + :arg name: Comma-separated list of aliases to remove. Supports + wildcards (`*`). To remove all aliases, use `*` or `_all`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ for param in (index, name): if param in SKIP_IN_PATH: @@ -734,7 +1134,17 @@ async def delete_alias( "DELETE", _make_path(index, "_alias", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "create", "master_timeout", "order") + @query_params( + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "order", + "pretty", + "source", + ) async def put_template( self, name: Any, @@ -746,18 +1156,30 @@ async def put_template( Creates or updates an index template. - :arg name: The name of the template. + :arg name: The name of the template :arg body: The template definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template should only be added if - new or can also replace an existing one. Default is false. + :arg create: If true, this request cannot replace or update + existing index templates. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg order: The order for this template when merging multiple - matching ones (higher numbers are merged later, overriding the lower - numbers). + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response isreceived before the timeout + expires, the request fails and returns an error. + :arg order: Order in which Opensearch applies this template if + indexmatches multiple templates.Templates with lower 'order' values are + merged first. Templates with higher'order' values are merged later, + overriding templates with lower values. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (name, body): if param in SKIP_IN_PATH: @@ -771,7 +1193,17 @@ async def put_template( body=body, ) - @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) async def exists_template( self, name: Any, @@ -782,16 +1214,26 @@ async def exists_template( Returns information about whether a particular index template exists. - :arg name: Comma-separated names of the index templates. + :arg name: The comma separated names of the index templates :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: Return settings in flat format (default: + false) + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + from cluster-manager node (default: false) :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -800,7 +1242,17 @@ async def exists_template( "HEAD", _make_path("_template", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) async def get_template( self, name: Any = None, @@ -811,22 +1263,44 @@ async def get_template( Returns an index template. - :arg name: Comma-separated names of the index templates. + :arg 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 + `*`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg local: If `true`, the request retrieves information from + the local node only. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path("_template", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def delete_template( self, name: Any, @@ -837,13 +1311,27 @@ async def delete_template( Deletes an index template. - :arg name: The name of the template. + :arg name: The name of the legacy index template to delete. + Wildcard (`*`) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg 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 a required argument 'name'.") @@ -855,12 +1343,17 @@ async def delete_template( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "include_defaults", "local", "master_timeout", + "pretty", + "source", ) async def get_settings( self, @@ -873,28 +1366,46 @@ async def get_settings( Returns settings for one or more indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg name: Comma-separated list of settings. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg 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`. + :arg name: Comma-separated list or wildcard expression of + settings to retrieve. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, indexalias, or `_all` value targets only + missing or closed indices. Thisbehavior applies even if the request + targets other open indices. Forexample, a request targeting `foo*,bar*` + returns an error if an indexstarts with foo but no index starts with + `bar`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg include_defaults: Whether to return all default setting for - each of the indices. Default is false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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 choices are all, open, + closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg include_defaults: If `true`, return all default settings in + the response. + :arg local: If `true`, the request retrieves information from + the local node only. If`false`, information is retrieved from the master + node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response isreceived before the timeout + expires, the request fails and returns anerror. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path(index, "_settings", name), params=params, headers=headers @@ -903,11 +1414,16 @@ async def get_settings( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "master_timeout", "preserve_existing", + "pretty", + "source", "timeout", ) async def put_settings( @@ -921,28 +1437,44 @@ async def put_settings( Updates the index settings. - :arg body: The index settings to be updated - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg 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`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, indexalias, or `_all` value targets only + missing or closed indices. Thisbehavior applies even if the request + targets other open indices. Forexample, a request targeting `foo*,bar*` + returns an error if an indexstarts with `foo` but no index starts with + `bar`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match. If the request can targetdata streams, this argument determines + whether wildcard expressions matchhidden data streams. Supports comma- + separated values, such as`open,hidden`. Valid choices are all, open, + closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed). :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg preserve_existing: Whether to update existing settings. If - set to `true` existing settings on an index remain unchanged. Default is - false. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response isreceived before the timeout + expires, the request fails and returns anerror. + :arg preserve_existing: If `true`, existing index settings + remain unchanged. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -957,14 +1489,19 @@ async def put_settings( @query_params( "completion_fields", + "error_trace", "expand_wildcards", "fielddata_fields", "fields", + "filter_path", "forbid_closed_indices", "groups", + "human", "include_segment_file_sizes", "include_unloaded_segments", "level", + "pretty", + "source", ) async def stats( self, @@ -977,41 +1514,58 @@ async def stats( Provides statistics on operations happening in an index. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + :arg index: A comma-separated list of index names; use `_all` or + empty string to perform the operation on all indices :arg metric: Limit the information returned the specific - metrics. Valid choices are _all, store, indexing, get, search, merge, - flush, refresh, query_cache, fielddata, docs, warmer, completion, - segments, translog, suggest, request_cache, recovery. - :arg completion_fields: Comma-separated list of fields for - `fielddata` and `suggest` index metric (supports wildcards). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg fielddata_fields: Comma-separated list of fields for - `fielddata` index metric (supports wildcards). - :arg fields: Comma-separated list of fields for `fielddata` and - `completion` index metric (supports wildcards). - :arg forbid_closed_indices: If set to false stats will also - collected from closed indices if explicitly specified or if - expand_wildcards expands to closed indices. Default is True. - :arg groups: Comma-separated list of search groups for `search` - index metric. - :arg include_segment_file_sizes: Whether to report the + metrics. + :arg completion_fields: Comma-separated list or wildcard + expressions of fields to include in fielddata and suggest statistics. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match. If the request can target data streams, this argumentdetermines + whether wildcard expressions match hidden data streams. Supports comma- + separated values,such as `open,hidden`. Valid choices are all, open, + closed, hidden, none. + :arg fielddata_fields: Comma-separated list or wildcard + expressions of fields to include in fielddata statistics. + :arg fields: Comma-separated list or wildcard expressions of + fields to include in the statistics. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg forbid_closed_indices: If true, statistics are not + collected from closed indices. + :arg groups: Comma-separated list of search groups to include in + the search statistics. + :arg human: Whether to return human readable values for + statistics. + :arg include_segment_file_sizes: If true, the call reports the aggregated disk usage of each one of the Lucene index files (only - applies if segment stats are requested). Default is false. - :arg include_unloaded_segments: If set to true segment stats - will include stats for segments that are not currently loaded into - memory. Default is false. - :arg level: Return stats aggregated at cluster, index or shard - level. Valid choices are cluster, indices, shards. + applies if segment stats are requested). + :arg include_unloaded_segments: If true, the response includes + information from segments that are not loaded into memory. + :arg level: Indicates whether statistics are aggregated at the + cluster, index, or shard level. Valid choices are cluster, indices, + shards. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path(index, "_stats", metric), params=params, headers=headers ) @query_params( - "allow_no_indices", "expand_wildcards", "ignore_unavailable", "verbose" + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "source", + "verbose", ) async def segments( self, @@ -1023,18 +1577,32 @@ async def segments( Provides low-level information about segments in a Lucene index. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg verbose: Includes detailed memory usage by Lucene. Default - is false. + :arg 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`. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg verbose: If `true`, the request returns a verbose response. """ return await self.transport.perform_request( "GET", _make_path(index, "_segments"), params=params, headers=headers @@ -1047,12 +1615,17 @@ async def segments( "analyzer", "default_operator", "df", + "error_trace", "expand_wildcards", "explain", + "filter_path", + "human", "ignore_unavailable", "lenient", + "pretty", "q", "rewrite", + "source", ) async def validate_query( self, @@ -1066,31 +1639,50 @@ async def validate_query( :arg body: The query definition specified with the Query DSL - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg all_shards: Execute validation on all shards instead of one - random shard per index. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. + :arg 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`. + :arg all_shards: If `true`, the validation is executed on all + shards instead of one random shard per index. + :arg 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. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed. + :arg analyzer: Analyzer to use for the query string.This + parameter can only be used when the `q` query string parameter is + specified. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg explain: Return detailed information about the error. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. + query: `AND` or `OR`. Valid choices are and, or. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg explain: If `true`, the response returns detailed + information if an error has occurred. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg rewrite: Provide a more detailed explanation showing the - actual Lucene query that will be executed. + :arg rewrite: If `true`, returns a more detailed explanation + showing the actual Lucene query that will be executed. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "POST", @@ -1102,12 +1694,17 @@ async def validate_query( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", "fielddata", "fields", + "filter_path", + "human", "ignore_unavailable", + "pretty", "query", "request", + "source", ) async def clear_cache( self, @@ -1121,25 +1718,48 @@ async def clear_cache( :arg index: Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg fielddata: Clear field data. - :arg fields: Comma-separated list of fields to clear when using - the `fielddata` parameter (default: all). - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg query: Clear query caches. - :arg request: Clear request cache. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg fielddata: If `true`, clears the fields cache.Use the + `fields` parameter to clear the cache of specific fields only. + :arg fields: Comma-separated list of field names used to limit + the `fielddata` parameter. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg query: If `true`, clears the query cache. + :arg request: If `true`, clears the request cache. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "POST", _make_path(index, "_cache", "clear"), params=params, headers=headers ) - @query_params("active_only", "detailed") + @query_params( + "active_only", + "detailed", + "error_trace", + "filter_path", + "human", + "pretty", + "source", + ) async def recovery( self, index: Any = None, @@ -1150,12 +1770,23 @@ async def recovery( Returns information about ongoing index shard recoveries. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg active_only: Display only those recoveries that are - currently on-going. Default is false. - :arg detailed: Whether to display detailed information about - shard recovery. Default is false. + :arg 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`. + :arg active_only: If `true`, the response only includes ongoing + shard recoveries. + :arg detailed: If `true`, the response includes detailed + information about shard recoveries. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path(index, "_recovery"), params=params, headers=headers @@ -1163,9 +1794,14 @@ async def recovery( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "only_ancient_segments", + "pretty", + "source", "wait_for_completion", ) async def upgrade( @@ -1183,13 +1819,23 @@ async def upgrade( :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified). + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed). :arg only_ancient_segments: If true, only ancient (an older Lucene major release) segments will be upgraded. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is false. """ @@ -1197,7 +1843,16 @@ async def upgrade( "POST", _make_path(index, "_upgrade"), params=params, headers=headers ) - @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") + @query_params( + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "source", + ) async def get_upgrade( self, index: Any = None, @@ -1213,18 +1868,36 @@ async def get_upgrade( :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified). + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed). + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path(index, "_upgrade"), params=params, headers=headers ) @query_params( - "allow_no_indices", "expand_wildcards", "ignore_unavailable", "status" + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "source", + "status", ) async def shard_stores( self, @@ -1236,18 +1909,30 @@ async def shard_stores( Provides store information for shard copies of indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg status: Comma-separated list of statuses used to filter on - shards to get store information for. + :arg index: List of data streams, indices, and aliases used to + limit the request. + :arg allow_no_indices: If false, the request returns an error if + any wildcard expression, index alias, or _allvalue targets only missing + or closed indices. This behavior applies even if the requesttargets + other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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. Valid choices + are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If true, missing or closed indices are + not included in the response. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg status: List of shard health statuses used to limit the + request. """ return await self.transport.perform_request( "GET", _make_path(index, "_shard_stores"), params=params, headers=headers @@ -1255,12 +1940,17 @@ async def shard_stores( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", "flush", + "human", "ignore_unavailable", "max_num_segments", "only_expunge_deletes", + "pretty", "primary_only", + "source", "wait_for_completion", ) async def forcemerge( @@ -1273,26 +1963,36 @@ async def forcemerge( Performs the force merge operation on one or more indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + :arg index: A comma-separated list of index names; use `_all` or + empty string to perform the operation on all indices :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + string or when no indices have been specified) + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg flush: Specify whether the index should be flushed after - performing the operation. Default is True. + performing the operation (default: true) + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + should be ignored when unavailable (missing or closed) :arg max_num_segments: The number of segments the index should - be merged into (default: dynamic). + be merged into (default: dynamic) :arg only_expunge_deletes: Specify whether the operation should - only expunge deleted documents. + only expunge deleted documents + :arg pretty: Whether to pretty format the returned JSON + response. :arg primary_only: Specify whether the operation should only perform on primary shards. Defaults to false. Default is false. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is True. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg wait_for_completion: Should the request wait until the + force merge is completed. """ return await self.transport.perform_request( "POST", _make_path(index, "_forcemerge"), params=params, headers=headers @@ -1301,7 +2001,12 @@ async def forcemerge( @query_params( "cluster_manager_timeout", "copy_settings", + "error_trace", + "filter_path", + "human", "master_timeout", + "pretty", + "source", "task_execution_timeout", "timeout", "wait_for_active_shards", @@ -1319,22 +2024,37 @@ async def shrink( Allow to shrink an existing index into a new index with fewer primary shards. - :arg index: The name of the source index to shrink. - :arg target: The name of the target index. + :arg index: Name of the source index to shrink. + :arg target: Name of the target index to create. :arg body: The configuration for the target index (`settings` and `aliases`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg copy_settings: whether or not to copy settings from the source index. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg task_execution_timeout: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for on the shrunken index before the operation returns. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg 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`). Valid choices are all, index-setting. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -1353,7 +2073,12 @@ async def shrink( @query_params( "cluster_manager_timeout", "copy_settings", + "error_trace", + "filter_path", + "human", "master_timeout", + "pretty", + "source", "task_execution_timeout", "timeout", "wait_for_active_shards", @@ -1372,22 +2097,37 @@ async def split( shards. - :arg index: The name of the source index to split. - :arg target: The name of the target index. + :arg index: Name of the source index to split. + :arg target: Name of the target index to create. :arg body: The configuration for the target index (`settings` and `aliases`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg copy_settings: whether or not to copy settings from the source index. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg task_execution_timeout: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for on the shrunken index before the operation returns. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg 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`). Valid choices are all, index-setting. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -1406,7 +2146,12 @@ async def split( @query_params( "cluster_manager_timeout", "dry_run", + "error_trace", + "filter_path", + "human", "master_timeout", + "pretty", + "source", "timeout", "wait_for_active_shards", ) @@ -1423,22 +2168,36 @@ async def rollover( to be too large or too old. - :arg alias: The name of the alias to rollover. + :arg alias: Name of the data stream or index alias to roll over. :arg body: The conditions that needs to be met for executing rollover - :arg new_index: The name of the rollover index. + :arg new_index: Name of the index to create. Supports date math. + Data streams do not support this parameter. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg dry_run: If set to true the rollover action will only be - validated but not actually performed even if a condition matches. - Default is false. + :arg dry_run: If `true`, checks whether the current index + satisfies the specified conditions but does not perform a rollover. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for on the newly created rollover index before the operation - returns. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg 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`). Valid choices are all, index-setting. """ if alias in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'alias'.") @@ -1451,7 +2210,7 @@ async def rollover( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def create_data_stream( self, name: Any, @@ -1463,8 +2222,23 @@ async def create_data_stream( Creates or updates a data stream. - :arg name: The name of the data stream. + :arg name: Name of the data stream, which must meet the + following criteria: Lowercase only; Cannot include `/`, `*`, `?`, `"`, + `<`, `>`, `|`, `,`, `#`, `:`, backslash, 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. :arg body: The data stream definition + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1477,7 +2251,7 @@ async def create_data_stream( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_data_stream( self, name: Any, @@ -1488,8 +2262,18 @@ async def delete_data_stream( Deletes a data stream. - :arg name: Comma-separated list of data streams; use `_all` or - empty string to perform the operation on all data streams. + :arg name: Comma-separated list of data streams to delete. + Wildcard (`*`) expressions are supported. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1498,7 +2282,16 @@ async def delete_data_stream( "DELETE", _make_path("_data_stream", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def delete_index_template( self, name: Any, @@ -1509,13 +2302,27 @@ async def delete_index_template( Deletes an index template. - :arg name: The name of the template. + :arg name: Name of the index template to delete. Wildcard (*) + expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg 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 a required argument 'name'.") @@ -1527,7 +2334,17 @@ async def delete_index_template( headers=headers, ) - @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) async def exists_index_template( self, name: Any, @@ -1538,16 +2355,28 @@ async def exists_index_template( Returns information about whether a particular index template exists. - :arg name: The name of the template. + :arg name: Name of the index template to check existence of. + Wildcard (*) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg flat_settings: Return settings in flat format. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1556,7 +2385,17 @@ async def exists_index_template( "HEAD", _make_path("_index_template", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) async def get_index_template( self, name: Any = None, @@ -1567,22 +2406,44 @@ async def get_index_template( Returns an index template. - :arg name: Comma-separated names of the index templates. + :arg name: Name of the index template to retrieve. Wildcard (*) + expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If true, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg local: If true, the request retrieves information from the + local node only. Defaults to false, which means information is retrieved + from the master node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path("_index_template", name), params=params, headers=headers ) - @query_params("cause", "cluster_manager_timeout", "create", "master_timeout") + @query_params( + "cause", + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) async def put_index_template( self, name: Any, @@ -1594,17 +2455,27 @@ async def put_index_template( Creates or updates an index template. - :arg name: The name of the template. + :arg name: Index or template name :arg body: The template definition :arg cause: User defined reason for creating/updating the index template. Default is false. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template should only be added if - new or can also replace an existing one. Default is false. + :arg create: If `true`, this request cannot replace or update + existing index templates. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (name, body): if param in SKIP_IN_PATH: @@ -1618,7 +2489,17 @@ async def put_index_template( body=body, ) - @query_params("cause", "cluster_manager_timeout", "create", "master_timeout") + @query_params( + "cause", + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) async def simulate_index_template( self, name: Any, @@ -1631,20 +2512,32 @@ async def simulate_index_template( system. - :arg name: The name of the index (it must be a concrete index - name). + :arg name: Index or template name to simulate :arg body: New index template definition, which will be included in the simulation, as if it already exists in the system :arg cause: User defined reason for dry-run creating the new template for simulation purposes. Default is false. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template we optionally defined in - the body should only be dry-run added if new or can also replace an - existing one. Default is false. + :arg create: If `true`, the template passed in the body is only + used if no existingtemplates match the same index patterns. If `false`, + the simulation usesthe template with the highest priority. Note that the + template is notpermanently added or updated in either case; it is only + used for thesimulation. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is receivedbefore the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1657,7 +2550,7 @@ async def simulate_index_template( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_data_stream( self, name: Any = None, @@ -1668,14 +2561,35 @@ async def get_data_stream( Returns data streams. - :arg name: Comma-separated list of data streams; use `_all` or - empty string to perform the operation on all data streams. + :arg name: Comma-separated list of data stream names used to + limit the request. Wildcard (`*`) expressions are supported. If omitted, + all data streams are returned. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path("_data_stream", name), params=params, headers=headers ) - @query_params("cause", "cluster_manager_timeout", "create", "master_timeout") + @query_params( + "cause", + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) async def simulate_template( self, body: Any = None, @@ -1687,19 +2601,32 @@ async def simulate_template( Simulate resolving the given template name or body. - :arg body: New index template definition to be simulated, if no - index template name is specified - :arg name: The name of the template. + :arg 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 configuration in the request body. :arg cause: User defined reason for dry-run creating the new template for simulation purposes. Default is false. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template we optionally defined in - the body should only be dry-run added if new or can also replace an - existing one. Default is false. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "POST", @@ -1709,7 +2636,9 @@ async def simulate_template( body=body, ) - @query_params("expand_wildcards") + @query_params( + "error_trace", "expand_wildcards", "filter_path", "human", "pretty", "source" + ) async def resolve_index( self, name: Any, @@ -1720,11 +2649,25 @@ async def resolve_index( Returns information about any matching indices, aliases, and data streams. - :arg name: Comma-separated list of names or wildcard - expressions. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1736,9 +2679,14 @@ async def resolve_index( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "timeout", ) async def add_block( @@ -1752,23 +2700,33 @@ async def add_block( Adds a block to an index. - :arg index: Comma-separated list of indices to add a block to. + :arg index: A comma separated list of indices to add a block to :arg block: The block to add (one of read, write, read_only or - metadata). + metadata) :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + string or when no indices have been specified) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + should be ignored when unavailable (missing or closed) :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ for param in (index, block): if param in SKIP_IN_PATH: @@ -1778,7 +2736,7 @@ async def add_block( "PUT", _make_path(index, "_block", block), params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def data_streams_stats( self, name: Any = None, @@ -1789,8 +2747,19 @@ async def data_streams_stats( Provides statistics on operations happening in a data stream. - :arg name: Comma-separated list of data streams; use `_all` or - empty string to perform the operation on all data streams. + :arg 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 `*`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", diff --git a/opensearchpy/_async/client/ingest.py b/opensearchpy/_async/client/ingest.py index 9702a346..45f92604 100644 --- a/opensearchpy/_async/client/ingest.py +++ b/opensearchpy/_async/client/ingest.py @@ -40,7 +40,15 @@ class IngestClient(NamespacedClient): - @query_params("cluster_manager_timeout", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) async def get_pipeline( self, id: Any = None, @@ -51,19 +59,40 @@ async def get_pipeline( Returns a pipeline. - :arg id: Comma-separated list of pipeline ids. Wildcards - supported. + :arg id: Comma-separated list of pipeline IDs to retrieve. + Wildcard (`*`) expressions are supported. To get all ingest pipelines, + omit this parameter or use `*`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path("_ingest", "pipeline", id), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def put_pipeline( self, id: Any, @@ -75,14 +104,27 @@ async def put_pipeline( Creates or updates a pipeline. - :arg id: Pipeline ID. + :arg id: ID of the ingest pipeline to create or update. :arg body: The ingest definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. """ for param in (id, body): if param in SKIP_IN_PATH: @@ -96,7 +138,16 @@ async def put_pipeline( body=body, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def delete_pipeline( self, id: Any, @@ -107,13 +158,28 @@ async def delete_pipeline( Deletes a pipeline. - :arg id: Pipeline ID. + :arg 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 `*`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg 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 a required argument 'id'.") @@ -125,7 +191,7 @@ async def delete_pipeline( headers=headers, ) - @query_params("verbose") + @query_params("error_trace", "filter_path", "human", "pretty", "source", "verbose") async def simulate( self, body: Any, @@ -138,9 +204,20 @@ async def simulate( :arg body: The simulate definition - :arg id: Pipeline ID. - :arg verbose: Verbose mode. Display data output for each - processor in executed pipeline. Default is false. + :arg id: Pipeline to test. If you don’t specify a `pipeline` in + the request body, this parameter is required. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg verbose: If `true`, the response includes output data for + each processor in the executed pipeline. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -153,7 +230,7 @@ async def simulate( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def processor_grok( self, params: Any = None, @@ -162,6 +239,17 @@ async def processor_grok( """ Returns a list of the built-in patterns. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_ingest/processor/grok", params=params, headers=headers diff --git a/opensearchpy/_async/client/nodes.py b/opensearchpy/_async/client/nodes.py index f060bd5f..3cb5b634 100644 --- a/opensearchpy/_async/client/nodes.py +++ b/opensearchpy/_async/client/nodes.py @@ -40,7 +40,7 @@ class NodesClient(NamespacedClient): - @query_params("timeout") + @query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout") async def reload_secure_settings( self, body: Any = None, @@ -54,10 +54,21 @@ async def reload_secure_settings( :arg body: An object containing the password for the opensearch keystore - :arg node_id: Comma-separated list of node IDs to span the - reload/reinit call. Should stay empty because reloading usually involves - all cluster nodes. - :arg timeout: Operation timeout. + :arg node_id: The names of particular nodes in the cluster to + target. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ return await self.transport.perform_request( "POST", @@ -67,7 +78,15 @@ async def reload_secure_settings( body=body, ) - @query_params("flat_settings", "timeout") + @query_params( + "error_trace", + "filter_path", + "flat_settings", + "human", + "pretty", + "source", + "timeout", + ) async def info( self, node_id: Any = None, @@ -79,16 +98,24 @@ async def info( Returns information about nodes in the cluster. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. - :arg metric: Comma-separated list of metrics you wish returned. - Leave empty to return all. Valid choices are settings, os, process, jvm, - thread_pool, transport, http, plugins, ingest. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg timeout: Operation timeout. + :arg node_id: Comma-separated list of node IDs or names used to + limit returned information. + :arg metric: Limits the information returned to the specific + metrics. Supports a comma-separated list, such as http,ingest. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If true, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. """ return await self.transport.perform_request( "GET", _make_path("_nodes", node_id, metric), params=params, headers=headers @@ -96,11 +123,16 @@ async def info( @query_params( "completion_fields", + "error_trace", "fielddata_fields", "fields", + "filter_path", "groups", + "human", "include_segment_file_sizes", "level", + "pretty", + "source", "timeout", "types", ) @@ -116,35 +148,42 @@ async def stats( Returns statistical information about nodes in the cluster. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. + :arg node_id: Comma-separated list of node IDs or names used to + limit returned information. :arg metric: Limit the information returned to the specified - metrics. Valid choices are _all, breaker, fs, http, indices, jvm, os, - process, thread_pool, transport, discovery, indexing_pressure, - search_pipeline. - :arg index_metric: Limit the information returned for `indices` - metric to the specific index metrics. Isn't used if `indices` (or `all`) - metric isn't specified. Valid choices are _all, store, indexing, get, - search, merge, flush, refresh, query_cache, fielddata, docs, warmer, - completion, segments, translog, suggest, request_cache, recovery. - :arg completion_fields: Comma-separated list of fields for - `fielddata` and `suggest` index metric (supports wildcards). - :arg fielddata_fields: Comma-separated list of fields for - `fielddata` index metric (supports wildcards). - :arg fields: Comma-separated list of fields for `fielddata` and - `completion` index metric (supports wildcards). - :arg groups: Comma-separated list of search groups for `search` - index metric. - :arg include_segment_file_sizes: Whether to report the + metrics + :arg index_metric: Limit the information returned for indices + metric to the specific index metrics. It can be used only if indices (or + all) metric is specified. + :arg completion_fields: Comma-separated list or wildcard + expressions of fields to include in fielddata and suggest statistics. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg fielddata_fields: Comma-separated list or wildcard + expressions of fields to include in fielddata statistics. + :arg fields: Comma-separated list or wildcard expressions of + fields to include in the statistics. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg groups: Comma-separated list of search groups to include in + the search statistics. + :arg human: Whether to return human readable values for + statistics. + :arg include_segment_file_sizes: If true, the call reports the aggregated disk usage of each one of the Lucene index files (only - applies if segment stats are requested). Default is false. - :arg level: Return indices stats aggregated at index, node or - shard level. Valid choices are indices, node, shards. - :arg timeout: Operation timeout. - :arg types: Comma-separated list of document types for the - `indexing` index metric. + applies if segment stats are requested). + :arg level: Indicates whether statistics are aggregated at the + cluster, index, or shard level. Valid choices are cluster, indices, + shards. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. + :arg types: A comma-separated list of document types for the + indexing index metric. """ return await self.transport.perform_request( "GET", @@ -154,7 +193,17 @@ async def stats( ) @query_params( - "doc_type", "ignore_idle_threads", "interval", "snapshots", "threads", "timeout" + "doc_type", + "error_trace", + "filter_path", + "human", + "ignore_idle_threads", + "interval", + "pretty", + "snapshots", + "source", + "threads", + "timeout", ) async def hot_threads( self, @@ -172,12 +221,22 @@ async def hot_threads( nodes. :arg doc_type: The type to sample. Valid choices are cpu, wait, block. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_idle_threads: Don't show threads that are in known- idle places, such as waiting on a socket select or pulling from an empty task queue. Default is True. :arg interval: The interval for the second sampling of threads. + :arg pretty: Whether to pretty format the returned JSON + response. :arg snapshots: Number of samples of thread stacktrace. Default is 10. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg threads: Specify the number of threads to provide information for. Default is 3. :arg timeout: Operation timeout. @@ -193,7 +252,7 @@ async def hot_threads( headers=headers, ) - @query_params("timeout") + @query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout") async def usage( self, node_id: Any = None, @@ -205,13 +264,26 @@ async def usage( Returns low-level information about REST actions usage on nodes. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. - :arg metric: Limit the information returned to the specified - metrics. Valid choices are _all, rest_actions. - :arg timeout: Operation timeout. + :arg node_id: A comma-separated list of node IDs or names to + limit the returned information; use `_local` to return information from + the node you're connecting to, leave empty to get information from all + nodes + :arg metric: Limits the information returned to the specific + metrics. A comma-separated list of the following options: `_all`, + `rest_actions`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ return await self.transport.perform_request( "GET", diff --git a/opensearchpy/_async/client/plugins.py b/opensearchpy/_async/client/plugins.py index 85faf661..fe82ff87 100644 --- a/opensearchpy/_async/client/plugins.py +++ b/opensearchpy/_async/client/plugins.py @@ -13,6 +13,7 @@ from ..plugins.alerting import AlertingClient from ..plugins.index_management import IndexManagementClient from ..plugins.knn import KnnClient +from ..plugins.notifications import NotificationsClient from .client import Client from .utils import NamespacedClient @@ -23,6 +24,7 @@ class PluginsClient(NamespacedClient): def __init__(self, client: Client) -> None: super(PluginsClient, self).__init__(client) + self.notifications = NotificationsClient(client) self.knn = KnnClient(client) # self.query_workbench = QueryWorkbenchClient(client) # self.reporting = ReportingClient(client) diff --git a/opensearchpy/_async/client/remote_store.py b/opensearchpy/_async/client/remote_store.py index 7b97513c..143ce0b3 100644 --- a/opensearchpy/_async/client/remote_store.py +++ b/opensearchpy/_async/client/remote_store.py @@ -22,7 +22,15 @@ class RemoteStoreClient(NamespacedClient): - @query_params("cluster_manager_timeout", "wait_for_completion") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "pretty", + "source", + "wait_for_completion", + ) async def restore( self, body: Any, @@ -36,6 +44,16 @@ async def restore( :arg body: Comma-separated list of index IDs :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is false. """ diff --git a/opensearchpy/_async/client/search_pipeline.py b/opensearchpy/_async/client/search_pipeline.py new file mode 100644 index 00000000..2e9f30de --- /dev/null +++ b/opensearchpy/_async/client/search_pipeline.py @@ -0,0 +1,90 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. +# +# Modifications Copyright OpenSearch Contributors. See +# GitHub history for details. + +# ------------------------------------------------------------------------------------------ +# THIS CODE IS AUTOMATICALLY GENERATED AND MANUAL EDITS WILL BE LOST +# +# To contribute, kindly make modifications in the opensearch-py client generator +# or in the OpenSearch API specification, and run `nox -rs generate`. See DEVELOPER_GUIDE.md +# and https://github.com/opensearch-project/opensearch-api-specification for details. +# -----------------------------------------------------------------------------------------+ + + +from typing import Any + +from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params + + +class SearchPipelineClient(NamespacedClient): + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def create( + self, + pipeline: Any, + body: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Creates or replaces the specified search pipeline. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + for param in (pipeline, body): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return await self.transport.perform_request( + "PUT", + _make_path("_search", "pipeline", pipeline), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get( + self, + pipeline: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Retrieves information about a specified search pipeline. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if pipeline in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'pipeline'.") + + return await self.transport.perform_request( + "GET", + _make_path("_search", "pipeline", pipeline), + params=params, + headers=headers, + ) diff --git a/opensearchpy/_async/client/security.py b/opensearchpy/_async/client/security.py index 6b8c2026..e24e293f 100644 --- a/opensearchpy/_async/client/security.py +++ b/opensearchpy/_async/client/security.py @@ -24,7 +24,7 @@ class SecurityClient(NamespacedClient): from ._patch import health_check, update_audit_config # type: ignore - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_account_details( self, params: Any = None, @@ -33,12 +33,23 @@ async def get_account_details( """ Returns account details for the current user. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_plugins/_security/api/account", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def change_password( self, body: Any, @@ -49,6 +60,16 @@ async def change_password( Changes the password for the current user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -61,7 +82,7 @@ async def change_password( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_action_group( self, action_group: Any, @@ -73,6 +94,16 @@ async def get_action_group( :arg action_group: Action group to retrieve. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if action_group in SKIP_IN_PATH: raise ValueError( @@ -86,7 +117,7 @@ async def get_action_group( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_action_groups( self, params: Any = None, @@ -95,6 +126,17 @@ async def get_action_groups( """ Retrieves all action groups. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", @@ -103,7 +145,7 @@ async def get_action_groups( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_action_group( self, action_group: Any, @@ -115,6 +157,16 @@ async def delete_action_group( :arg action_group: Action group to delete. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if action_group in SKIP_IN_PATH: raise ValueError( @@ -128,7 +180,7 @@ async def delete_action_group( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def create_action_group( self, action_group: Any, @@ -142,6 +194,16 @@ async def create_action_group( :arg action_group: The name of the action group to create or replace + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (action_group, body): if param in SKIP_IN_PATH: @@ -155,7 +217,7 @@ async def create_action_group( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_action_group( self, action_group: Any, @@ -167,6 +229,16 @@ async def patch_action_group( Updates individual attributes of an action group. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (action_group, body): if param in SKIP_IN_PATH: @@ -180,7 +252,7 @@ async def patch_action_group( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_action_groups( self, body: Any, @@ -191,6 +263,16 @@ async def patch_action_groups( Creates, updates, or deletes multiple action groups in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -203,7 +285,7 @@ async def patch_action_groups( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_user( self, username: Any, @@ -214,6 +296,16 @@ async def get_user( Retrieve one internal user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'username'.") @@ -225,7 +317,7 @@ async def get_user( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_users( self, params: Any = None, @@ -234,6 +326,17 @@ async def get_users( """ Retrieve all internal users. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", @@ -242,7 +345,7 @@ async def get_users( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_user( self, username: Any, @@ -253,6 +356,16 @@ async def delete_user( Delete the specified user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'username'.") @@ -264,7 +377,7 @@ async def delete_user( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def create_user( self, username: Any, @@ -276,6 +389,16 @@ async def create_user( Creates or replaces the specified user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (username, body): if param in SKIP_IN_PATH: @@ -289,7 +412,7 @@ async def create_user( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_user( self, username: Any, @@ -301,6 +424,16 @@ async def patch_user( Updates individual attributes of an internal user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (username, body): if param in SKIP_IN_PATH: @@ -314,7 +447,7 @@ async def patch_user( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_users( self, body: Any, @@ -325,6 +458,16 @@ async def patch_users( Creates, updates, or deletes multiple internal users in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -337,7 +480,7 @@ async def patch_users( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_role( self, role: Any, @@ -348,6 +491,16 @@ async def get_role( Retrieves one role. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -359,7 +512,7 @@ async def get_role( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_roles( self, params: Any = None, @@ -368,12 +521,23 @@ async def get_roles( """ Retrieves all roles. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_plugins/_security/api/roles/", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_role( self, role: Any, @@ -384,6 +548,16 @@ async def delete_role( Delete the specified role. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -395,7 +569,7 @@ async def delete_role( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def create_role( self, role: Any, @@ -407,6 +581,16 @@ async def create_role( Creates or replaces the specified role. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (role, body): if param in SKIP_IN_PATH: @@ -420,7 +604,7 @@ async def create_role( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_role( self, role: Any, @@ -432,6 +616,16 @@ async def patch_role( Updates individual attributes of a role. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (role, body): if param in SKIP_IN_PATH: @@ -445,7 +639,7 @@ async def patch_role( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_roles( self, body: Any, @@ -456,6 +650,16 @@ async def patch_roles( Creates, updates, or deletes multiple roles in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -468,7 +672,7 @@ async def patch_roles( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_role_mapping( self, role: Any, @@ -479,6 +683,16 @@ async def get_role_mapping( Retrieves one role mapping. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -490,7 +704,7 @@ async def get_role_mapping( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_role_mappings( self, params: Any = None, @@ -499,6 +713,17 @@ async def get_role_mappings( """ Retrieves all role mappings. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", @@ -507,7 +732,7 @@ async def get_role_mappings( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_role_mapping( self, role: Any, @@ -518,6 +743,16 @@ async def delete_role_mapping( Deletes the specified role mapping. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -529,7 +764,7 @@ async def delete_role_mapping( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def create_role_mapping( self, role: Any, @@ -541,6 +776,16 @@ async def create_role_mapping( Creates or replaces the specified role mapping. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (role, body): if param in SKIP_IN_PATH: @@ -554,7 +799,7 @@ async def create_role_mapping( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_role_mapping( self, role: Any, @@ -566,6 +811,16 @@ async def patch_role_mapping( Updates individual attributes of a role mapping. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (role, body): if param in SKIP_IN_PATH: @@ -579,7 +834,7 @@ async def patch_role_mapping( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_role_mappings( self, body: Any, @@ -590,6 +845,16 @@ async def patch_role_mappings( Creates or updates multiple role mappings in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -602,7 +867,7 @@ async def patch_role_mappings( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_tenant( self, tenant: Any, @@ -613,6 +878,16 @@ async def get_tenant( Retrieves one tenant. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if tenant in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'tenant'.") @@ -624,7 +899,7 @@ async def get_tenant( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_tenants( self, params: Any = None, @@ -633,12 +908,23 @@ async def get_tenants( """ Retrieves all tenants. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_plugins/_security/api/tenants/", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_tenant( self, tenant: Any, @@ -649,6 +935,16 @@ async def delete_tenant( Delete the specified tenant. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if tenant in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'tenant'.") @@ -660,7 +956,7 @@ async def delete_tenant( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def create_tenant( self, tenant: Any, @@ -672,6 +968,16 @@ async def create_tenant( Creates or replaces the specified tenant. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (tenant, body): if param in SKIP_IN_PATH: @@ -685,7 +991,7 @@ async def create_tenant( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_tenant( self, tenant: Any, @@ -697,6 +1003,16 @@ async def patch_tenant( Add, delete, or modify a single tenant. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (tenant, body): if param in SKIP_IN_PATH: @@ -710,7 +1026,7 @@ async def patch_tenant( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_tenants( self, body: Any, @@ -721,6 +1037,16 @@ async def patch_tenants( Add, delete, or modify multiple tenants in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -733,7 +1059,7 @@ async def patch_tenants( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_configuration( self, params: Any = None, @@ -742,6 +1068,17 @@ async def get_configuration( """ Returns the current Security plugin configuration in JSON format. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", @@ -750,7 +1087,7 @@ async def get_configuration( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def update_configuration( self, body: Any, @@ -761,6 +1098,16 @@ async def update_configuration( Adds or updates the existing configuration using the REST API. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -773,7 +1120,7 @@ async def update_configuration( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_configuration( self, body: Any, @@ -784,6 +1131,16 @@ async def patch_configuration( A PATCH call is used to update the existing configuration using the REST API. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -796,7 +1153,7 @@ async def patch_configuration( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_distinguished_names( self, cluster_name: Any = None, @@ -804,9 +1161,19 @@ async def get_distinguished_names( headers: Any = None, ) -> Any: """ - Retrieves all distinguished names in the allow list. + Retrieves distinguished names. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", @@ -815,7 +1182,7 @@ async def get_distinguished_names( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def update_distinguished_names( self, cluster_name: Any, @@ -828,6 +1195,16 @@ async def update_distinguished_names( allow list. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if cluster_name in SKIP_IN_PATH: raise ValueError( @@ -842,7 +1219,7 @@ async def update_distinguished_names( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_distinguished_names( self, cluster_name: Any, @@ -854,6 +1231,16 @@ async def delete_distinguished_names( list. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if cluster_name in SKIP_IN_PATH: raise ValueError( @@ -867,7 +1254,7 @@ async def delete_distinguished_names( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_certificates( self, params: Any = None, @@ -876,12 +1263,23 @@ async def get_certificates( """ Retrieves the cluster’s security certificates. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_plugins/_security/api/ssl/certs", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def reload_transport_certificates( self, params: Any = None, @@ -890,6 +1288,17 @@ async def reload_transport_certificates( """ Reload transport layer communication certificates. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "PUT", @@ -898,7 +1307,7 @@ async def reload_transport_certificates( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def reload_http_certificates( self, params: Any = None, @@ -907,6 +1316,17 @@ async def reload_http_certificates( """ Reload HTTP layer communication certificates. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "PUT", @@ -915,7 +1335,7 @@ async def reload_http_certificates( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def flush_cache( self, params: Any = None, @@ -924,12 +1344,23 @@ async def flush_cache( """ Flushes the Security plugin user, authentication, and authorization cache. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "DELETE", "/_plugins/_security/api/cache", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def health( self, params: Any = None, @@ -938,12 +1369,23 @@ async def health( """ Checks to see if the Security plugin is up and running. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_plugins/_security/health", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_audit_configuration( self, params: Any = None, @@ -952,12 +1394,23 @@ async def get_audit_configuration( """ Retrieves the audit configuration. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", "/_plugins/_security/api/audit", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def update_audit_configuration( self, body: Any, @@ -968,6 +1421,16 @@ async def update_audit_configuration( Updates the audit configuration. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -980,7 +1443,7 @@ async def update_audit_configuration( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_audit_configuration( self, body: Any, @@ -991,6 +1454,16 @@ async def patch_audit_configuration( A PATCH call is used to update specified fields in the audit configuration. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1003,7 +1476,7 @@ async def patch_audit_configuration( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def patch_distinguished_names( self, body: Any, @@ -1014,6 +1487,16 @@ async def patch_distinguished_names( Bulk update of distinguished names. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") diff --git a/opensearchpy/_async/client/snapshot.py b/opensearchpy/_async/client/snapshot.py index c21ea254..4f7d7bad 100644 --- a/opensearchpy/_async/client/snapshot.py +++ b/opensearchpy/_async/client/snapshot.py @@ -40,7 +40,16 @@ class SnapshotClient(NamespacedClient): - @query_params("cluster_manager_timeout", "master_timeout", "wait_for_completion") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "wait_for_completion", + ) async def create( self, repository: Any, @@ -53,16 +62,29 @@ async def create( Creates a snapshot in a repository. - :arg repository: Repository name. - :arg snapshot: Snapshot name. + :arg repository: Repository for the snapshot. + :arg snapshot: Name of the snapshot. Must be unique in the + repository. :arg body: The snapshot definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg wait_for_completion: If `true`, the request returns a + response when the snapshot is complete. If `false`, the request returns + a response when the snapshot initializes. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -76,7 +98,15 @@ async def create( body=body, ) - @query_params("cluster_manager_timeout", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) async def delete( self, repository: Any, @@ -88,13 +118,23 @@ async def delete( Deletes a snapshot. - :arg repository: Repository name. - :arg snapshot: Snapshot name. + :arg repository: A repository name + :arg snapshot: A comma-separated list of snapshot names :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -108,7 +148,15 @@ async def delete( ) @query_params( - "cluster_manager_timeout", "ignore_unavailable", "master_timeout", "verbose" + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "ignore_unavailable", + "master_timeout", + "pretty", + "source", + "verbose", ) async def get( self, @@ -121,18 +169,35 @@ async def get( Returns information about a snapshot. - :arg repository: Repository name. - :arg snapshot: Comma-separated list of snapshot names. + :arg repository: Comma-separated list of snapshot repository + names used to limit the request. Wildcard (*) expressions are supported. + :arg snapshot: Comma-separated list of snapshot names to + retrieve. Also accepts wildcards (*). - To get information about all + snapshots in a registered repository, use a wildcard (*) or _all. - To + get information about any snapshots that are currently running, use + _current. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg ignore_unavailable: Whether to ignore unavailable - snapshots, defaults to false which means a SnapshotMissingException is - thrown. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If false, the request returns an error + for any snapshots that are unavailable. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg verbose: Whether to show verbose snapshot info or only show - the basic info found in the repository index blob. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg verbose: If true, returns additional information about each + snapshot such as the version of Opensearch which took the snapshot, the + start and end times of the snapshot, and the number of shards + snapshotted. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -145,7 +210,16 @@ async def get( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def delete_repository( self, repository: Any, @@ -160,10 +234,20 @@ async def delete_repository( Wildcard (`*`) patterns are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -175,7 +259,16 @@ async def delete_repository( headers=headers, ) - @query_params("cluster_manager_timeout", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) async def get_repository( self, repository: Any = None, @@ -186,20 +279,40 @@ async def get_repository( Returns information about a repository. - :arg repository: Comma-separated list of repository names. + :arg repository: A comma-separated list of repository names :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + from cluster-manager node (default: false) :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", _make_path("_snapshot", repository), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout", "verify") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + "verify", + ) async def create_repository( self, repository: Any, @@ -211,15 +324,25 @@ async def create_repository( Creates a repository. - :arg repository: Repository name. + :arg repository: A repository name :arg body: The repository definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg verify: Whether to verify the repository after creation. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout + :arg verify: Whether to verify the repository after creation """ for param in (repository, body): if param in SKIP_IN_PATH: @@ -233,7 +356,16 @@ async def create_repository( body=body, ) - @query_params("cluster_manager_timeout", "master_timeout", "wait_for_completion") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "wait_for_completion", + ) async def restore( self, repository: Any, @@ -246,16 +378,26 @@ async def restore( Restores a snapshot. - :arg repository: Repository name. - :arg snapshot: Snapshot name. + :arg repository: A repository name + :arg snapshot: A snapshot name :arg body: Details of what to restore :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + operation has completed before returning """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -269,7 +411,16 @@ async def restore( body=body, ) - @query_params("cluster_manager_timeout", "ignore_unavailable", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "ignore_unavailable", + "master_timeout", + "pretty", + "source", + ) async def status( self, repository: Any = None, @@ -281,16 +432,26 @@ async def status( Returns information about the status of a snapshot. - :arg repository: Repository name. - :arg snapshot: Comma-separated list of snapshot names. + :arg repository: A repository name + :arg snapshot: A comma-separated list of snapshot names :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is - thrown. Default is false. + thrown :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( "GET", @@ -299,7 +460,16 @@ async def status( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def verify_repository( self, repository: Any, @@ -310,13 +480,23 @@ async def verify_repository( Verifies a repository. - :arg repository: Repository name. + :arg repository: A repository name :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -328,7 +508,16 @@ async def verify_repository( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) async def cleanup_repository( self, repository: Any, @@ -339,13 +528,23 @@ async def cleanup_repository( Removes stale data from repository. - :arg repository: Repository name. + :arg repository: Snapshot repository to clean up. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -357,7 +556,15 @@ async def cleanup_repository( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) async def clone( self, repository: Any, @@ -371,15 +578,25 @@ async def clone( Clones indices from one snapshot into another snapshot in the same repository. - :arg repository: Repository name. - :arg snapshot: Snapshot name. - :arg target_snapshot: The name of the cloned snapshot to create. + :arg repository: A repository name + :arg snapshot: The name of the snapshot to clone from + :arg target_snapshot: The name of the cloned snapshot to create :arg body: The snapshot clone definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (repository, snapshot, target_snapshot, body): if param in SKIP_IN_PATH: diff --git a/opensearchpy/_async/client/tasks.py b/opensearchpy/_async/client/tasks.py index aad58c99..3cbfdfec 100644 --- a/opensearchpy/_async/client/tasks.py +++ b/opensearchpy/_async/client/tasks.py @@ -44,9 +44,14 @@ class TasksClient(NamespacedClient): @query_params( "actions", "detailed", + "error_trace", + "filter_path", "group_by", + "human", "nodes", "parent_task_id", + "pretty", + "source", "timeout", "wait_for_completion", ) @@ -59,27 +64,50 @@ async def list( Returns a list of tasks. - :arg actions: Comma-separated list of actions that should be - returned. Leave empty to return all. - :arg detailed: Return detailed task information. Default is - false. - :arg group_by: Group tasks by nodes or parent/child - relationships. Valid choices are nodes, parents, none. + :arg actions: Comma-separated list or wildcard expression of + actions used to limit the request. + :arg detailed: If `true`, the response includes detailed + information about shard recoveries. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg group_by: Key used to group tasks in the response. Valid + choices are nodes, parents, none. + :arg human: Whether to return human readable values for + statistics. :arg nodes: Comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. - :arg parent_task_id: Return tasks with specified parent task id - (node_id:task_number). Set to -1 to return all. - :arg timeout: Operation timeout. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + :arg parent_task_id: Parent task ID used to limit returned + information. To return all tasks, omit this parameter or use a value of + `-1`. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_completion: If `true`, the request blocks until + the operation is complete. """ return await self.transport.perform_request( "GET", "/_tasks", params=params, headers=headers ) - @query_params("actions", "nodes", "parent_task_id", "wait_for_completion") + @query_params( + "actions", + "error_trace", + "filter_path", + "human", + "nodes", + "parent_task_id", + "pretty", + "source", + "wait_for_completion", + ) async def cancel( self, task_id: Any = None, @@ -90,18 +118,25 @@ async def cancel( Cancels a task, if it can be cancelled through an API. - :arg task_id: Cancel the task with specified task id - (node_id:task_number). - :arg actions: Comma-separated list of actions that should be - cancelled. Leave empty to cancel all. - :arg nodes: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. - :arg parent_task_id: Cancel tasks with specified parent task id - (node_id:task_number). Set to -1 to cancel all. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + :arg task_id: ID of the task. + :arg actions: Comma-separated list or wildcard expression of + actions used to limit the request. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg nodes: Comma-separated list of node IDs or names used to + limit the request. + :arg parent_task_id: Parent task ID used to limit the tasks. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg wait_for_completion: Should the request block until the + cancellation of the task and its descendant tasks is completed. Defaults + to false """ return await self.transport.perform_request( "POST", @@ -110,7 +145,15 @@ async def cancel( headers=headers, ) - @query_params("timeout", "wait_for_completion") + @query_params( + "error_trace", + "filter_path", + "human", + "pretty", + "source", + "timeout", + "wait_for_completion", + ) async def get( self, task_id: Any = None, @@ -121,11 +164,22 @@ async def get( Returns information about a task. - :arg task_id: Return the task with specified id - (node_id:task_number). - :arg timeout: Operation timeout. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + :arg task_id: ID of the task. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_completion: If `true`, the request blocks until + the task has completed. """ if task_id in SKIP_IN_PATH: warnings.warn( diff --git a/opensearchpy/_async/plugins/knn.py b/opensearchpy/_async/plugins/knn.py index 527029f2..8129bd0a 100644 --- a/opensearchpy/_async/plugins/knn.py +++ b/opensearchpy/_async/plugins/knn.py @@ -22,7 +22,7 @@ class KnnClient(NamespacedClient): - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def delete_model( self, model_id: Any, @@ -34,6 +34,16 @@ async def delete_model( :arg model_id: The id of the model. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'model_id'.") @@ -45,7 +55,7 @@ async def delete_model( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def get_model( self, model_id: Any, @@ -57,6 +67,16 @@ async def get_model( :arg model_id: The id of the model. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'model_id'.") @@ -81,15 +101,19 @@ async def get_model( "default_operator", "df", "docvalue_fields", + "error_trace", "expand_wildcards", "explain", + "filter_path", "from_", + "human", "ignore_throttled", "ignore_unavailable", "lenient", "max_concurrent_shard_requests", "pre_filter_shard_size", "preference", + "pretty", "q", "request_cache", "rest_total_hits_as_int", @@ -99,6 +123,7 @@ async def get_model( "seq_no_primary_term", "size", "sort", + "source", "stats", "stored_fields", "suggest_field", @@ -151,12 +176,18 @@ async def search_models( given in the query string. :arg docvalue_fields: Comma-separated list of fields to return as the docvalue representation of a field for each hit. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. :arg explain: Specify whether to return detailed information about score computation as part of a hit. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg from_: Starting offset. Default is 0. + :arg human: Whether to return human readable values for + statistics. :arg ignore_throttled: Whether specified concrete, expanded or aliased indices should be ignored when throttled. :arg ignore_unavailable: Whether specified concrete indices @@ -176,6 +207,8 @@ async def search_models( and the query are disjoint. :arg preference: Specify the node or shard the operation should be performed on. Default is random. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. :arg request_cache: Specify if request cache should be used for this request or not, defaults to index level setting. @@ -191,6 +224,8 @@ async def search_models( number and primary term of the last modification of each hit. :arg size: Number of hits to return. Default is 10. :arg sort: Comma-separated list of : pairs. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg stats: Specific 'tag' of the request for logging and statistical purposes. :arg stored_fields: Comma-separated list of stored fields to @@ -226,7 +261,7 @@ async def search_models( body=body, ) - @query_params("timeout") + @query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout") async def stats( self, node_id: Any = None, @@ -254,6 +289,16 @@ async def stats( model_index_status, indexing_from_model_degraded, training_requests, training_errors, training_memory_usage, training_memory_usage_percentage. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg timeout: Operation timeout. """ return await self.transport.perform_request( @@ -263,7 +308,9 @@ async def stats( headers=headers, ) - @query_params("preference") + @query_params( + "error_trace", "filter_path", "human", "preference", "pretty", "source" + ) async def train_model( self, body: Any, @@ -277,7 +324,17 @@ async def train_model( :arg model_id: The id of the model. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg preference: Preferred node to execute training. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -290,7 +347,7 @@ async def train_model( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") async def warmup( self, index: Any, @@ -299,11 +356,21 @@ async def warmup( ) -> Any: """ Preloads native library files into memory, reducing initial search latency for - specified indexes + specified indexes. :arg index: Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") diff --git a/opensearchpy/_async/plugins/notifications.py b/opensearchpy/_async/plugins/notifications.py new file mode 100644 index 00000000..9c66c64e --- /dev/null +++ b/opensearchpy/_async/plugins/notifications.py @@ -0,0 +1,326 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. +# +# Modifications Copyright OpenSearch Contributors. See +# GitHub history for details. + +# ------------------------------------------------------------------------------------------ +# THIS CODE IS AUTOMATICALLY GENERATED AND MANUAL EDITS WILL BE LOST +# +# To contribute, kindly make modifications in the opensearch-py client generator +# or in the OpenSearch API specification, and run `nox -rs generate`. See DEVELOPER_GUIDE.md +# and https://github.com/opensearch-project/opensearch-api-specification for details. +# -----------------------------------------------------------------------------------------+ + + +from typing import Any + +from ..client.utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params + + +class NotificationsClient(NamespacedClient): + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def create_config( + self, + body: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Create channel configuration. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if body in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'body'.") + + return await self.transport.perform_request( + "POST", + "/_plugins/_notifications/configs", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def delete_config( + self, + config_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Delete a channel configuration. + + + :arg config_id: The ID of the channel configuration to delete. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if config_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'config_id'.") + + return await self.transport.perform_request( + "DELETE", + _make_path("_plugins", "_notifications", "configs", config_id), + params=params, + headers=headers, + ) + + @query_params( + "config_id", + "config_id_list", + "error_trace", + "filter_path", + "human", + "pretty", + "source", + ) + async def delete_configs( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Delete multiple channel configurations. + + + :arg config_id: The ID of the channel configuration to delete. + :arg config_id_list: A comma-separated list of channel IDs to + delete. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + return await self.transport.perform_request( + "DELETE", "/_plugins/_notifications/configs", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get_config( + self, + config_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get a specific channel configuration. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if config_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'config_id'.") + + return await self.transport.perform_request( + "GET", + _make_path("_plugins", "_notifications", "configs", config_id), + params=params, + headers=headers, + ) + + @query_params( + "chime.url", + "chime.url.keyword", + "config_type", + "created_time_ms", + "description", + "description.keyword", + "email.email_account_id", + "email.email_group_id_list", + "email.recipient_list.recipient", + "email.recipient_list.recipient.keyword", + "email_group.recipient_list.recipient", + "email_group.recipient_list.recipient.keyword", + "error_trace", + "filter_path", + "human", + "is_enabled", + "last_updated_time_ms", + "microsoft_teams.url", + "microsoft_teams.url.keyword", + "name", + "name.keyword", + "pretty", + "query", + "ses_account.from_address", + "ses_account.from_address.keyword", + "ses_account.region", + "ses_account.role_arn", + "ses_account.role_arn.keyword", + "slack.url", + "slack.url.keyword", + "smtp_account.from_address", + "smtp_account.from_address.keyword", + "smtp_account.host", + "smtp_account.host.keyword", + "smtp_account.method", + "sns.role_arn", + "sns.role_arn.keyword", + "sns.topic_arn", + "sns.topic_arn.keyword", + "source", + "text_query", + "webhook.url", + "webhook.url.keyword", + ) + async def get_configs( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get multiple channel configurations with filtering. + + + :arg config_type: Type of notification configuration. Valid + choices are slack, chime, microsoft_teams, webhook, email, sns, + ses_account, smtp_account, email_group. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + return await self.transport.perform_request( + "GET", + "/_plugins/_notifications/configs", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def list_features( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + List supported channel configurations. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + return await self.transport.perform_request( + "GET", "/_plugins/_notifications/features", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def send_test( + self, + config_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Send a test notification. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if config_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'config_id'.") + + return await self.transport.perform_request( + "GET", + _make_path("_plugins", "_notifications", "feature", "test", config_id), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def update_config( + self, + config_id: Any, + body: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Update channel configuration. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + for param in (config_id, body): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return await self.transport.perform_request( + "PUT", + _make_path("_plugins", "_notifications", "configs", config_id), + params=params, + headers=headers, + body=body, + ) diff --git a/opensearchpy/client/__init__.py b/opensearchpy/client/__init__.py index 3c98e94d..7949976a 100644 --- a/opensearchpy/client/__init__.py +++ b/opensearchpy/client/__init__.py @@ -52,6 +52,7 @@ from .plugins import PluginsClient from .remote import RemoteClient from .remote_store import RemoteStoreClient +from .search_pipeline import SearchPipelineClient from .security import SecurityClient from .snapshot import SnapshotClient from .tasks import TasksClient @@ -215,6 +216,7 @@ class as kwargs, or a string in the format of ``host[:port]`` which will be super().__init__(hosts, transport_class, **kwargs) # namespaced clients for compatibility with API names + self.search_pipeline = SearchPipelineClient(self) self.cat = CatClient(self) self.cluster = ClusterClient(self) self.dangling_indices = DanglingIndicesClient(self) @@ -256,7 +258,7 @@ def close(self) -> None: self.transport.close() # AUTO-GENERATED-API-DEFINITIONS # - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def ping( self, params: Any = None, @@ -265,6 +267,17 @@ def ping( """ Returns whether the cluster is running. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ try: return self.transport.perform_request( @@ -273,7 +286,7 @@ def ping( except TransportError: return False - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def info( self, params: Any = None, @@ -282,15 +295,31 @@ def info( """ Returns basic information about the cluster. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/", params=params, headers=headers ) @query_params( + "error_trace", + "filter_path", + "human", "pipeline", + "pretty", "refresh", "routing", + "source", "timeout", "version", "version_type", @@ -309,25 +338,47 @@ def create( with a same ID already exists in the index. - :arg index: Index name. - :arg id: Document ID. + :arg index: Name of the data stream or index to target. If the + target doesn’t exist and matches the name or wildcard (`*`) pattern of + an index template with a `data_stream` definition, this request creates + the data stream. If the target doesn’t exist and doesn’t match a data + stream template, this request creates the index. + :arg id: Unique identifier for the document. :arg body: The document - :arg pipeline: The pipeline id to preprocess incoming documents - with. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pipeline: ID of the pipeline to use to preprocess incoming + documents.If the index has a default ingest pipeline specified, then + setting the value to `_none` disables the default ingest pipeline for + this request.If a final pipeline is configured it will always run, + regardless of the value of this parameter. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, Opensearch refreshes the affected + shards to make this operation visible to search, if `wait_for` then wait + for a refresh to make this operation visible to search, if `false` do + nothing with refreshes.Valid values: `true`, `false`, `wait_for`. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period the request waits for the following + operations: automatic index creation, dynamic mapping updates, waiting + for active shards. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. + :arg 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`). Valid choices are all, index-setting. """ for param in (index, id, body): if param in SKIP_IN_PATH: @@ -340,13 +391,18 @@ def create( ) @query_params( + "error_trace", + "filter_path", + "human", "if_primary_term", "if_seq_no", "op_type", "pipeline", + "pretty", "refresh", "require_alias", "routing", + "source", "timeout", "version", "version_type", @@ -364,34 +420,55 @@ def index( Creates or updates a document in an index. - :arg index: Index name. + :arg index: Name of the data stream or index to target. :arg body: The document - :arg id: Document ID. - :arg if_primary_term: only perform the operation if the last - operation that has changed the document has the specified primary term. - :arg if_seq_no: only perform the operation if the last operation - that has changed the document has the specified sequence number. - :arg op_type: Explicit operation type. Defaults to `index` for - requests with an explicit document ID, and to `create` for requests - without an explicit document ID. Valid choices are index, create. - :arg pipeline: The pipeline id to preprocess incoming documents - with. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg require_alias: When true, requires destination to be an - alias. Default is false. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + :arg id: Unique identifier for the document. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg if_primary_term: Only perform the operation if the document + has this primary term. + :arg if_seq_no: Only perform the operation if the document has + this sequence number. + :arg op_type: Set to create to only index the document if it + does not already exist (put if absent).If a document with the specified + `_id` already exists, the indexing operation will fail.Same as using the + `/_create` endpoint.Valid values: `index`, `create`.If document + id is specified, it defaults to `index`.Otherwise, it defaults to + `create`. + :arg pipeline: ID of the pipeline to use to preprocess incoming + documents.If the index has a default ingest pipeline specified, then + setting the value to `_none` disables the default ingest pipeline for + this request.If a final pipeline is configured it will always run, + regardless of the value of this parameter. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, Opensearch refreshes the affected + shards to make this operation visible to search, if `wait_for` then wait + for a refresh to make this operation visible to search, if `false` do + nothing with refreshes.Valid values: `true`, `false`, `wait_for`. + :arg require_alias: If `true`, the destination must be an index + alias. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period the request waits for the following + operations: automatic index creation, dynamic mapping updates, waiting + for active shards. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. + :arg 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`). Valid choices are all, index-setting. """ for param in (index, body): if param in SKIP_IN_PATH: @@ -409,10 +486,15 @@ def index( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "pipeline", + "pretty", "refresh", "require_alias", "routing", + "source", "timeout", "wait_for_active_shards", ) @@ -429,29 +511,44 @@ def bulk( :arg body: The operation definition and data (action-data pairs), separated by newlines - :arg index: Default index for items which don't provide one. - :arg _source: True or false to return the _source field or not, - or default list of fields to return, can be overridden on each sub- - request. - :arg _source_excludes: Default list of fields to exclude from - the returned _source field, can be overridden on each sub-request. - :arg _source_includes: Default list of fields to extract and - return from the _source field, can be overridden on each sub-request. - :arg pipeline: The pipeline id to preprocess incoming documents - with. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg require_alias: Sets require_alias for all incoming - documents. Default is false. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + :arg index: Name of the data stream, index, or index alias to + perform bulk actions on. + :arg _source: `true` or `false` to return the `_source` field or + not, or a list of fields to return. + :arg _source_excludes: A comma-separated list of source fields + to exclude from the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pipeline: ID of the pipeline to use to preprocess incoming + documents.If the index has a default ingest pipeline specified, then + setting the value to `_none` disables the default ingest pipeline for + this request.If a final pipeline is configured it will always run, + regardless of the value of this parameter. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, Opensearch refreshes the affected + shards to make this operation visible to search, if `wait_for` then wait + for a refresh to make this operation visible to search, if `false` do + nothing with refreshes.Valid values: `true`, `false`, `wait_for`. + :arg require_alias: If `true`, the request’s actions must target + an index alias. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period each action waits for the following + operations: automatic index creation, dynamic mapping updates, waiting + for active shards. + :arg 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`). Valid choices are all, index-setting. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -465,7 +562,7 @@ def bulk( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def clear_scroll( self, body: Any = None, @@ -479,7 +576,18 @@ def clear_scroll( :arg body: Comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter - :arg scroll_id: Comma-separated list of scroll IDs to clear. + :arg scroll_id: Comma-separated list of scroll IDs to clear. To + clear all scroll IDs, use `_all`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if scroll_id in SKIP_IN_PATH and body in SKIP_IN_PATH: raise ValueError("You need to supply scroll_id or body.") @@ -498,14 +606,19 @@ def clear_scroll( "analyzer", "default_operator", "df", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_throttled", "ignore_unavailable", "lenient", "min_score", "preference", + "pretty", "q", "routing", + "source", "terminate_after", ) def count( @@ -521,36 +634,56 @@ def count( :arg body: Query to restrict the results specified with the Query DSL (optional) - :arg index: Comma-separated list of indices to restrict the - results. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. + :arg 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`. + :arg 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. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed.This parameter can only be used when the `q` query string + parameter is specified. + :arg analyzer: Analyzer to use for the query string.This + parameter can only be used when the `q` query string parameter is + specified. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_throttled: Whether specified concrete, expanded or - aliased indices should be ignored when throttled. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg min_score: Include only documents with a specific `_score` - value in the result. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. + query: `AND` or `OR`.This parameter can only be used when the `q` query + string parameter is specified. Valid choices are and, or. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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 choices are all, open, + closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_throttled: If `true`, concrete, expanded or aliased + indices are ignored when frozen. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg min_score: Sets the minimum `_score` value that documents + must have to be included in the result. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg routing: Comma-separated list of specific routing values. - :arg terminate_after: The maximum number of documents to collect - for each shard, upon reaching which the query execution will terminate - early. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg terminate_after: Maximum number of documents to collect for + each shard.If a query reaches this limit, Opensearch terminates the + query early.Opensearch collects documents before sorting. """ return self.transport.perform_request( "POST", @@ -561,10 +694,15 @@ def count( ) @query_params( + "error_trace", + "filter_path", + "human", "if_primary_term", "if_seq_no", + "pretty", "refresh", "routing", + "source", "timeout", "version", "version_type", @@ -581,26 +719,39 @@ def delete( Removes a document from the index. - :arg index: Index name. - :arg id: Document ID. - :arg if_primary_term: only perform the operation if the last - operation that has changed the document has the specified primary term. - :arg if_seq_no: only perform the operation if the last operation - that has changed the document has the specified sequence number. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + :arg index: Name of the target index. + :arg id: Unique identifier for the document. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg if_primary_term: Only perform the operation if the document + has this primary term. + :arg if_seq_no: Only perform the operation if the document has + this sequence number. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, Opensearch refreshes the affected + shards to make this operation visible to search, if `wait_for` then wait + for a refresh to make this operation visible to search, if `false` do + nothing with refreshes.Valid values: `true`, `false`, `wait_for`. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for active shards. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. + :arg 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`). Valid choices are all, index-setting. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -620,12 +771,16 @@ def delete( "conflicts", "default_operator", "df", + "error_trace", "expand_wildcards", + "filter_path", "from_", + "human", "ignore_unavailable", "lenient", "max_docs", "preference", + "pretty", "q", "refresh", "request_cache", @@ -638,6 +793,7 @@ def delete( "size", "slices", "sort", + "source", "stats", "terminate_after", "timeout", @@ -656,8 +812,9 @@ def delete_by_query( Deletes documents matching the provided query. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + :arg 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`. :arg body: The search definition using the Query DSL :arg _source: True or false to return the _source field or not, or a list of fields to return. @@ -665,67 +822,86 @@ def delete_by_query( returned _source field. :arg _source_includes: List of fields to extract and return from the _source field. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. - :arg conflicts: What to do when the operation encounters version - conflicts?. Valid choices are abort, proceed. + :arg 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`. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed. + :arg analyzer: Analyzer to use for the query string. + :arg conflicts: What to do if delete by query hits version + conflicts: `abort` or `proceed`. Valid choices are abort, proceed. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg from_: Starting offset. Default is 0. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg max_docs: Maximum number of documents to process (default: - all documents). - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. + query: `AND` or `OR`. Valid choices are and, or. + :arg df: Field to use as default where no field prefix is given + in the query string. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, + hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg from_: Starting offset (default: 0) + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg max_docs: Maximum number of documents to process.Defaults + to all documents. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg request_cache: Specify if request cache should be used for - this request or not, defaults to index level setting. + :arg refresh: If `true`, Opensearch refreshes all shards + involved in the delete by query after the request completes. + :arg request_cache: If `true`, the request cache is used for + this request.Defaults to the index-level setting. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. Default is 0. - :arg routing: Comma-separated list of specific routing values. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. - :arg scroll_size: Size on the scroll request powering the - operation. Default is 100. - :arg search_timeout: Explicit timeout for each search request. - Defaults to no timeout. - :arg search_type: Search operation type. Valid choices are + requests per second. + :arg routing: Custom value used to route operations to a + specific shard. + :arg scroll: Period to retain the search context for scrolling. + :arg scroll_size: Size of the scroll request that powers the + operation. + :arg search_timeout: Explicit timeout for each search + request.Defaults to no timeout. + :arg search_type: The type of the search operation.Available + options: `query_then_fetch`, `dfs_query_then_fetch`. Valid choices are query_then_fetch, dfs_query_then_fetch. :arg size: Deprecated, please use `max_docs` instead. :arg slices: The number of slices this task should be divided - into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default is 1. - :arg sort: Comma-separated list of : pairs. - :arg stats: Specific 'tag' of the request for logging and + into. Valid choices are auto. + :arg sort: A comma-separated list of : pairs. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stats: Specific `tag` of the request for logging and statistical purposes. - :arg terminate_after: The maximum number of documents to collect - for each shard, upon reaching which the query execution will terminate - early. - :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default is 1m. - :arg version: Whether to return document version as part of a - hit. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is True. + :arg terminate_after: Maximum number of documents to collect for + each shard.If a query reaches this limit, Opensearch terminates the + query early.Opensearch collects documents before sorting.Use with + caution.Opensearch applies this parameter to each shard handling the + request.When possible, let Opensearch perform early termination + automatically.Avoid specifying this parameter for requests that target + data streams with backing indices across multiple data tiers. + :arg timeout: Period each deletion request waits for active + shards. + :arg version: If `true`, returns the document version as part of + a hit. + :arg 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`). Valid choices are all, index-setting. + :arg wait_for_completion: If `true`, the request blocks until + the operation is complete. """ # from is a reserved word so it cannot be used, use from_ instead if "from_" in params: @@ -743,7 +919,9 @@ def delete_by_query( body=body, ) - @query_params("requests_per_second") + @query_params( + "error_trace", "filter_path", "human", "pretty", "requests_per_second", "source" + ) def delete_by_query_rethrottle( self, task_id: Any, @@ -755,9 +933,19 @@ def delete_by_query_rethrottle( operation. - :arg task_id: The task id to rethrottle. + :arg task_id: The ID for the task. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. + requests per second. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'task_id'.") @@ -769,7 +957,16 @@ def delete_by_query_rethrottle( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def delete_script( self, id: Any, @@ -780,13 +977,26 @@ def delete_script( Deletes a script. - :arg id: Script ID. + :arg id: Identifier for the stored script or search template. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg 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 a required argument 'id'.") @@ -799,10 +1009,15 @@ def delete_script( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "stored_fields", "version", "version_type", @@ -818,26 +1033,42 @@ def exists( Returns information about whether a document exists in an index. - :arg index: Index name. - :arg id: Document ID. - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. - :arg stored_fields: Comma-separated list of stored fields to - return. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. + :arg index: Comma-separated list of data streams, indices, and + aliases. Supports wildcards (`*`). + :arg id: Identifier of the document. + :arg _source: `true` or `false` to return the `_source` field or + not, or a list of fields to return. + :arg _source_excludes: A comma-separated list of source fields + to exclude in the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If `true`, the request is real-time as opposed to + near-real-time. + :arg refresh: If `true`, Opensearch refreshes all shards + involved in the delete by query after the request completes. + :arg routing: Target the specified primary shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg 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. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -851,10 +1082,15 @@ def exists( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "version", "version_type", ) @@ -869,24 +1105,38 @@ def exists_source( Returns information about whether a document source exists in an index. - :arg index: Index name. - :arg id: Document ID. - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. - :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. + :arg index: Comma-separated list of data streams, indices, and + aliases. Supports wildcards (`*`). + :arg id: Identifier of the document. + :arg _source: `true` or `false` to return the `_source` field or + not, or a list of fields to return. + :arg _source_excludes: A comma-separated list of source fields + to exclude in the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If true, the request is real-time as opposed to + near-real-time. + :arg refresh: If `true`, Opensearch refreshes all shards + involved in the delete by query after the request completes. + :arg routing: Target the specified primary shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg version: Explicit version number for concurrency + control.The specified version must match the current version of the + document for the request to succeed. + :arg version_type: Specific version type: `external`, + `external_gte`. Valid choices are internal, external, external_gte, + force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -906,10 +1156,15 @@ def exists_source( "analyzer", "default_operator", "df", + "error_trace", + "filter_path", + "human", "lenient", "preference", + "pretty", "q", "routing", + "source", "stored_fields", ) def explain( @@ -924,30 +1179,44 @@ def explain( Returns information about why a specific matches (or doesn't match) a query. - :arg index: Index name. - :arg id: Document ID. + :arg index: Index names used to limit the request. Only a single + index name can be provided to this parameter. + :arg id: Defines the document ID. :arg body: The query definition using the Query DSL - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg analyze_wildcard: Specify whether wildcards and prefix - queries in the query string query should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. + :arg _source: True or false to return the `_source` field or + not, or a list of fields to return. + :arg _source_excludes: A comma-separated list of source fields + to exclude from the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed. + :arg analyzer: Analyzer to use for the query string.This + parameter can only be used when the `q` query string parameter is + specified. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The default field for query string query. Default is - _all. - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. + query: `AND` or `OR`. Valid choices are and, or. + :arg df: Field to use as default where no field prefix is given + in the query string. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg routing: Routing value. - :arg stored_fields: Comma-separated list of stored fields to - return. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stored_fields: A comma-separated list of stored fields to + return in the response. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -961,10 +1230,15 @@ def explain( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", "fields", + "filter_path", + "human", "ignore_unavailable", "include_unmapped", + "pretty", + "source", ) def field_caps( self, @@ -979,19 +1253,36 @@ def field_caps( :arg body: An index filter specified with the Query DSL - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg fields: Comma-separated list of field names. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg include_unmapped: Indicates whether unmapped fields should - be included in the response. Default is false. + :arg 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. + :arg 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 requesttargeting `foo*,bar*` + returns an error if an index starts with foo but no index starts with + bar. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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 choices are all, open, + closed, hidden, none. + :arg fields: Comma-separated list of fields to retrieve + capabilities for. Wildcard (`*`) expressions are supported. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `true`, missing or closed indices + are not included in the response. + :arg include_unmapped: If true, unmapped fields are included in + the response. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "POST", @@ -1005,10 +1296,15 @@ def field_caps( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "stored_fields", "version", "version_type", @@ -1024,26 +1320,41 @@ def get( Returns a document. - :arg index: Index name. - :arg id: Document ID. + :arg index: Name of the index that contains the document. + :arg id: Unique identifier of the document. :arg _source: True or false to return the _source field or not, or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. - :arg stored_fields: Comma-separated list of stored fields to - return. + :arg _source_excludes: A comma-separated list of source fields + to exclude in the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on. Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If `true`, the request is real-time as opposed to + near-real-time. + :arg refresh: If true, Opensearch refreshes the affected shards + to make this operation visible to search. If false, do nothing with + refreshes. + :arg routing: Target the specified primary shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg 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. :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. + The specified version must match the current version of the document for + the request to succeed. + :arg version_type: Specific version type: internal, external, + external_gte. Valid choices are internal, external, external_gte, force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -1053,7 +1364,15 @@ def get( "GET", _make_path(index, "_doc", id), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) def get_script( self, id: Any, @@ -1064,12 +1383,22 @@ def get_script( Returns a script. - :arg id: Script ID. + :arg id: Identifier for the stored script or search template. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'id'.") @@ -1082,10 +1411,15 @@ def get_script( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "version", "version_type", ) @@ -1100,24 +1434,37 @@ def get_source( Returns the source of a document. - :arg index: Index name. - :arg id: Document ID. + :arg index: Name of the index that contains the document. + :arg id: Unique identifier of the document. :arg _source: True or false to return the _source field or not, or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. + :arg _source_excludes: A comma-separated list of source fields + to exclude in the response. + :arg _source_includes: A comma-separated list of source fields + to include in the response. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on. Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: Boolean) If true, the request is real-time as + opposed to near-real-time. + :arg refresh: If true, Opensearch refreshes the affected shards + to make this operation visible to search. If false, do nothing with + refreshes. + :arg routing: Target the specified primary shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg version: Explicit version number for concurrency control. - :arg version_type: Specific version type. Valid choices are - internal, external, external_gte, force. + The specified version must match the current version of the document for + the request to succeed. + :arg version_type: Specific version type: internal, external, + external_gte. Valid choices are internal, external, external_gte, force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -1133,10 +1480,15 @@ def get_source( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "preference", + "pretty", "realtime", "refresh", "routing", + "source", "stored_fields", ) def mget( @@ -1153,22 +1505,39 @@ def mget( :arg body: Document identifiers; can be either `docs` (containing full document information) or `ids` (when index is provided in the URL. - :arg index: Index name. - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specify whether to perform the operation in - realtime or search mode. - :arg refresh: Refresh the shard containing the document before - performing the operation. - :arg routing: Routing value. - :arg stored_fields: Comma-separated list of stored fields to - return. + :arg 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. + :arg _source: True or false to return the `_source` field or + not, or a list of fields to return. + :arg _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. + :arg _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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg preference: Specifies the node or shard the operation + should be performed on. Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If `true`, the request is real-time as opposed to + near-real-time. + :arg refresh: If `true`, the request refreshes relevant shards + before retrieving documents. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stored_fields: If `true`, retrieves the document fields + stored in the index rather than the document `_source`. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1183,11 +1552,16 @@ def mget( @query_params( "ccs_minimize_roundtrips", + "error_trace", + "filter_path", + "human", "max_concurrent_searches", "max_concurrent_shard_requests", "pre_filter_shard_size", + "pretty", "rest_total_hits_as_int", "search_type", + "source", "typed_keys", ) def msearch( @@ -1203,31 +1577,39 @@ def msearch( :arg body: The request definitions (metadata-search request definition pairs), separated by newlines - :arg index: Comma-separated list of indices to use as default. - :arg ccs_minimize_roundtrips: Indicates whether network round- - trips should be minimized as part of cross-cluster search requests - execution. Default is True. - :arg max_concurrent_searches: Controls the maximum number of - concurrent searches the multi search api will execute. - :arg max_concurrent_shard_requests: The number of concurrent - shard requests each sub search executes concurrently per node. This - value should be used to limit the impact of the search on the cluster in - order to limit the number of concurrent shard requests. Default is 5. - :arg pre_filter_shard_size: Threshold that enforces a pre-filter - round-trip to prefilter search shards based on query rewriting if the - number of shards the search request expands to exceeds the threshold. - This filter round-trip 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. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg search_type: Search operation type. Valid choices are - query_then_fetch, query_and_fetch, dfs_query_then_fetch, - dfs_query_and_fetch. - :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response. + :arg index: Comma-separated list of data streams, indices, and + index aliases to search. + :arg ccs_minimize_roundtrips: If true, network roundtrips + between the coordinating node and remote clusters are minimized for + cross-cluster search requests. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg max_concurrent_searches: Maximum number of concurrent + searches the multi search API can execute. + :arg max_concurrent_shard_requests: Maximum number of concurrent + shard requests that each sub-search request executes per node. + :arg 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 i.e., if date filters are mandatory to match but + the shard bounds and the query are disjoint. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg rest_total_hits_as_int: If true, hits.total are returned as + an integer in the response. Defaults to false, which returns an object. + :arg search_type: Indicates whether global term and document + frequencies should be used when scoring returned documents. Valid + choices are query_then_fetch, dfs_query_then_fetch. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg typed_keys: Specifies whether aggregation and suggester + names should be prefixed by their respective types in the response. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1243,9 +1625,14 @@ def msearch( @query_params( "ccs_minimize_roundtrips", + "error_trace", + "filter_path", + "human", "max_concurrent_searches", + "pretty", "rest_total_hits_as_int", "search_type", + "source", "typed_keys", ) def msearch_template( @@ -1261,20 +1648,31 @@ def msearch_template( :arg body: The request definitions (metadata-search request definition pairs), separated by newlines - :arg index: Comma-separated list of indices to use as default. - :arg ccs_minimize_roundtrips: Indicates whether network round- - trips should be minimized as part of cross-cluster search requests - execution. Default is True. - :arg max_concurrent_searches: Controls the maximum number of - concurrent searches the multi search api will execute. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg search_type: Search operation type. Valid choices are - query_then_fetch, query_and_fetch, dfs_query_then_fetch, - dfs_query_and_fetch. - :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response. + :arg 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 `*`. + :arg ccs_minimize_roundtrips: If `true`, network round-trips are + minimized for cross-cluster search requests. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg max_concurrent_searches: Maximum number of concurrent + searches the API can run. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg rest_total_hits_as_int: If `true`, the response returns + `hits.total` as an integer.If `false`, it returns `hits.total` as an + object. + :arg search_type: The type of the search operation.Available + options: `query_then_fetch`, `dfs_query_then_fetch`. Valid choices are + query_then_fetch, dfs_query_then_fetch. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg typed_keys: If `true`, the response prefixes aggregation + and suggester names with their respective types. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1289,15 +1687,20 @@ def msearch_template( ) @query_params( + "error_trace", "field_statistics", "fields", + "filter_path", + "human", "ids", "offsets", "payloads", "positions", "preference", + "pretty", "realtime", "routing", + "source", "term_statistics", "version", "version_type", @@ -1316,36 +1719,39 @@ def mtermvectors( :arg body: Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation. - :arg index: The index in which the document resides. - :arg field_statistics: Specifies if document count, sum of - document frequencies and sum of total term frequencies should be - returned. Applies to all returned documents unless otherwise specified - in body 'params' or 'docs'. Default is True. - :arg fields: Comma-separated list of fields to return. Applies - to all returned documents unless otherwise specified in body 'params' or - 'docs'. - :arg ids: Comma-separated list of documents ids. You must define - ids as parameter or set 'ids' or 'docs' in the request body. - :arg offsets: Specifies if term offsets should be returned. - Applies to all returned documents unless otherwise specified in body - 'params' or 'docs'. Default is True. - :arg payloads: Specifies if term payloads should be returned. - Applies to all returned documents unless otherwise specified in body - 'params' or 'docs'. Default is True. - :arg positions: Specifies if term positions should be returned. - Applies to all returned documents unless otherwise specified in body - 'params' or 'docs'. Default is True. - :arg preference: Specify the node or shard the operation should - be performed on. Applies to all returned documents unless otherwise - specified in body 'params' or 'docs'. Default is random. - :arg realtime: Specifies if requests are real-time as opposed to - near-real-time. Default is True. - :arg routing: Routing value. Applies to all returned documents - unless otherwise specified in body 'params' or 'docs'. - :arg term_statistics: Specifies if total term frequency and - document frequency should be returned. Applies to all returned documents - unless otherwise specified in body 'params' or 'docs'. Default is false. - :arg version: Explicit version number for concurrency control. + :arg index: Name of the index that contains the documents. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg field_statistics: If `true`, the response includes the + document count, sum of document frequencies, and sum of total term + frequencies. + :arg fields: Comma-separated list or wildcard expressions of + fields to include in the statistics.Used as the default list unless a + specific field list is provided in the `completion_fields` or + `fielddata_fields` parameters. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ids: A comma-separated list of documents ids. You must + define ids as parameter or set "ids" or "docs" in the request body + :arg offsets: If `true`, the response includes term offsets. + :arg payloads: If `true`, the response includes term payloads. + :arg positions: If `true`, the response includes term positions. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If true, the request is real-time as opposed to + near-real-time. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg term_statistics: If true, the response includes term + frequency and document frequency. + :arg version: If `true`, returns the document version as part of + a hit. :arg version_type: Specific version type. Valid choices are internal, external, external_gte, force. """ @@ -1355,7 +1761,16 @@ def mtermvectors( "POST", path, params=params, headers=headers, body=body ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def put_script( self, id: Any, @@ -1368,15 +1783,31 @@ def put_script( Creates or updates a script. - :arg id: Script ID. + :arg id: Identifier for the stored script or search template. + Must be unique within the cluster. :arg body: The document - :arg context: Script context. + :arg context: Context in which the script or search template + should run. To prevent errors, the API immediately compiles the script + or template in this context. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ for param in (id, body): if param in SKIP_IN_PATH: @@ -1391,7 +1822,15 @@ def put_script( ) @query_params( - "allow_no_indices", "expand_wildcards", "ignore_unavailable", "search_type" + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "search_type", + "source", ) def rank_eval( self, @@ -1407,18 +1846,32 @@ def rank_eval( :arg body: The ranking evaluation search definition, including search requests, document ratings and ranking metric definition. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg index: Comma-separated list of data streams, indices, and + index aliases used to limit the request. Wildcard (`*`) expressions are + supported. To target all data streams and indices in a cluster, omit + this parameter or use `_all` or `*`. + :arg 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`. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg search_type: Search operation type. Valid choices are - query_then_fetch, dfs_query_then_fetch. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `true`, missing or closed indices + are not included in the response. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg search_type: Search operation type + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1432,11 +1885,16 @@ def rank_eval( ) @query_params( + "error_trace", + "filter_path", + "human", "max_docs", + "pretty", "refresh", "requests_per_second", "scroll", "slices", + "source", "timeout", "wait_for_active_shards", "wait_for_completion", @@ -1455,25 +1913,35 @@ def reindex( :arg body: The search definition using the Query DSL and the prototype for the index request. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg max_docs: Maximum number of documents to process (default: all documents). - :arg refresh: Should the affected indexes be refreshed?. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If `true`, the request refreshes affected shards + to make this operation visible to search. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. Default is 0. - :arg scroll: Specify how long a consistent view of the index + requests per second.Defaults to no throttle. + :arg scroll: Specifies how long a consistent view of the index should be maintained for scrolled search. :arg slices: The number of slices this task should be divided - into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default is 1. - :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default is 1m. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is True. + into.Defaults to 1 slice, meaning the task isn’t sliced into subtasks. + Valid choices are auto. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period each indexing waits for automatic index + creation, dynamic mapping updates, and waiting for active shards. + :arg 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`). Valid choices are all, index-setting. + :arg wait_for_completion: If `true`, the request blocks until + the operation is complete. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1482,7 +1950,9 @@ def reindex( "POST", "/_reindex", params=params, headers=headers, body=body ) - @query_params("requests_per_second") + @query_params( + "error_trace", "filter_path", "human", "pretty", "requests_per_second", "source" + ) def reindex_rethrottle( self, task_id: Any, @@ -1493,9 +1963,19 @@ def reindex_rethrottle( Changes the number of requests per second for a particular Reindex operation. - :arg task_id: The task id to rethrottle. + :arg task_id: Identifier for the task. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. + requests per second. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'task_id'.") @@ -1507,7 +1987,7 @@ def reindex_rethrottle( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def render_search_template( self, body: Any = None, @@ -1520,7 +2000,18 @@ def render_search_template( :arg body: The search definition template and its params - :arg id: The id of the stored search template. + :arg id: ID of the search template to render. If no `source` is + specified, this or the `id` request body parameter is required. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "POST", @@ -1530,7 +2021,7 @@ def render_search_template( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def scripts_painless_execute( self, body: Any = None, @@ -1542,6 +2033,16 @@ def scripts_painless_execute( :arg body: The script to execute + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "POST", @@ -1551,7 +2052,15 @@ def scripts_painless_execute( body=body, ) - @query_params("rest_total_hits_as_int", "scroll") + @query_params( + "error_trace", + "filter_path", + "human", + "pretty", + "rest_total_hits_as_int", + "scroll", + "source", + ) def scroll( self, body: Any = None, @@ -1565,12 +2074,21 @@ def scroll( :arg body: The scroll ID if not passed by URL or query parameter. - :arg scroll_id: Scroll ID. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. + :arg scroll_id: The scroll ID for scrolled search + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg rest_total_hits_as_int: If true, the API response’s + hit.total property is returned as an integer. If false, the API + response’s hit.total property is returned as an object. + :arg scroll: Period to retain the search context for scrolling. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if scroll_id in SKIP_IN_PATH and body in SKIP_IN_PATH: raise ValueError("You need to supply scroll_id or body.") @@ -1596,9 +2114,12 @@ def scroll( "default_operator", "df", "docvalue_fields", + "error_trace", "expand_wildcards", "explain", + "filter_path", "from_", + "human", "ignore_throttled", "ignore_unavailable", "include_named_queries_score", @@ -1606,6 +2127,7 @@ def scroll( "max_concurrent_shard_requests", "pre_filter_shard_size", "preference", + "pretty", "q", "request_cache", "rest_total_hits_as_int", @@ -1616,6 +2138,7 @@ def scroll( "seq_no_primary_term", "size", "sort", + "source", "stats", "stored_fields", "suggest_field", @@ -1641,104 +2164,184 @@ def search( :arg body: The search definition using the Query DSL - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg allow_partial_search_results: Indicate if an error should - be returned if there is a partial search failure or timeout. Default is - True. - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. + :arg 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`. + :arg _source: Indicates which source fields are returned for + matching documents.These fields are returned in the `hits._source` + property of the search response.Valid values are:`true` to return the + entire document source;`false` to not return the document + source;`` to return the source fields that are specified as a + comma-separated list (supports wildcard (`*`) patterns). + :arg _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. + :arg _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. + :arg 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`. + :arg 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. + :arg analyze_wildcard: If true, wildcard and prefix queries are + analyzed.This parameter can only be used when the q query string + parameter is specified. + :arg analyzer: Analyzer to use for the query string.This + parameter can only be used when the q query string parameter is + specified. :arg batched_reduce_size: The number of shard results that - should be reduced at once on the coordinating node. This value should be + 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. - Default is 512. - :arg ccs_minimize_roundtrips: Indicates whether network round- - trips should be minimized as part of cross-cluster search requests - execution. Default is True. + :arg 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. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg docvalue_fields: Comma-separated list of fields to return - as the docvalue representation of a field for each hit. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg explain: Specify whether to return detailed information - about score computation as part of a hit. - :arg from_: Starting offset. Default is 0. - :arg ignore_throttled: Whether specified concrete, expanded or - aliased indices should be ignored when throttled. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + query: AND or OR.This parameter can only be used when the `q` query + string parameter is specified. Valid choices are and, or. + :arg 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. + :arg docvalue_fields: A comma-separated list of fields to return + as the docvalue representation for each hit. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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 choices are all, open, + closed, hidden, none. + :arg explain: If `true`, returns detailed information about + score computation as part of a hit. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg 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. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_throttled: If `true`, concrete, expanded or aliased + indices will be ignored when frozen. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. :arg include_named_queries_score: Indicates whether hit.matched_queries should be rendered as a map that includes the name of the matched query associated with its score (true) or as an array containing the name of the matched queries (false) Default is false. - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg max_concurrent_shard_requests: The number of concurrent - shard requests per node this search executes concurrently. This value - should be used to limit the impact of the search on the cluster in order - to limit the number of concurrent shard requests. Default is 5. - :arg pre_filter_shard_size: Threshold that enforces a pre-filter - round-trip to prefilter search shards based on query rewriting if the - number of shards the search request expands to exceeds the threshold. - This filter round-trip 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. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg q: Query in the Lucene query string syntax. - :arg request_cache: Specify if request cache should be used for - this request or not, defaults to index level setting. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg routing: Comma-separated list of specific routing values. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. + :arg 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. + :arg 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. + :arg 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. + :arg preference: Nodes and shards used for the search.By + default, Opensearch 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg q: Query in the Lucene query string syntax using query + parameter search.Query parameter searches do not support the full + Opensearch Query DSL but are handy for testing. + :arg request_cache: If `true`, the caching of search results is + enabled for requests where `size` is `0`.Defaults to index level + settings. + :arg rest_total_hits_as_int: Indicates whether `hits.total` + should be rendered as an integer or an object in the rest search + response. + :arg routing: Custom value used to route operations to a + specific shard. + :arg 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. :arg search_pipeline: Customizable sequence of processing stages applied to search queries. - :arg search_type: Search operation type. Valid choices are - query_then_fetch, dfs_query_then_fetch. - :arg seq_no_primary_term: Specify whether to return sequence - number and primary term of the last modification of each hit. - :arg size: Number of hits to return. Default is 10. - :arg sort: Comma-separated list of : pairs. - :arg stats: Specific 'tag' of the request for logging and + :arg search_type: How distributed term frequencies are + calculated for relevance scoring. Valid choices are query_then_fetch, + dfs_query_then_fetch. + :arg seq_no_primary_term: If `true`, returns sequence number and + primary term of the last modification of each hit. + :arg size: Defines 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. + :arg sort: A comma-separated list of : pairs. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stats: Specific `tag` of the request for logging and statistical purposes. - :arg stored_fields: Comma-separated list of stored fields to - return. - :arg suggest_field: Specify which field to use for suggestions. - :arg suggest_mode: Specify suggest mode. Valid choices are - missing, popular, always. - :arg suggest_size: How many suggestions to return in response. + :arg stored_fields: A comma-separated 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. + :arg suggest_field: Specifies which field to use for + suggestions. + :arg suggest_mode: Specifies the suggest mode.This parameter can + only be used when the `suggest_field` and `suggest_text` query string + parameters are specified. Valid choices are missing, popular, always. + :arg 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. :arg suggest_text: The source text for which the suggestions - should be returned. - :arg terminate_after: The maximum number of documents to collect - for each shard, upon reaching which the query execution will terminate - early. - :arg timeout: Operation timeout. - :arg track_scores: Whether to calculate and return scores even - if they are not used for sorting. - :arg track_total_hits: Indicate if the number of documents that - match the query should be tracked. - :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response. - :arg version: Whether to return document version as part of a + should be returned.This parameter can only be used when the + `suggest_field` and `suggest_text` query string parameters are + specified. + :arg terminate_after: Maximum number of documents to collect for + each shard.If a query reaches this limit, Opensearch terminates the + query early.Opensearch collects documents before sorting.Use with + caution.Opensearch applies this parameter to each shard handling the + request.When possible, let Opensearch 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. + :arg 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. + :arg track_scores: If `true`, calculate and return document + scores, even if the scores are not used for sorting. + :arg 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. + :arg typed_keys: If `true`, aggregation and suggester names are + be prefixed by their respective types in the response. + :arg version: If `true`, returns document version as part of a hit. """ # from is a reserved word so it cannot be used, use from_ instead @@ -1755,11 +2358,16 @@ def search( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "local", "preference", + "pretty", "routing", + "source", ) def search_shards( self, @@ -1772,21 +2380,38 @@ def search_shards( executed against. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg routing: Routing value. + :arg index: Returns the indices and shards that a search request + would be executed against. + :arg 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`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path(index, "_search_shards"), params=params, headers=headers @@ -1795,16 +2420,21 @@ def search_shards( @query_params( "allow_no_indices", "ccs_minimize_roundtrips", + "error_trace", "expand_wildcards", "explain", + "filter_path", + "human", "ignore_throttled", "ignore_unavailable", "preference", + "pretty", "profile", "rest_total_hits_as_int", "routing", "scroll", "search_type", + "source", "typed_keys", ) def search_template( @@ -1819,37 +2449,51 @@ def search_template( :arg body: The search definition template and its params - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg ccs_minimize_roundtrips: Indicates whether network round- - trips should be minimized as part of cross-cluster search requests - execution. Default is True. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg explain: Specify whether to return detailed information - about score computation as part of a hit. - :arg ignore_throttled: Whether specified concrete, expanded or - aliased indices should be ignored when throttled. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg profile: Specify whether to profile the query execution. - :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response. - Default is false. - :arg routing: Comma-separated list of specific routing values. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. - :arg search_type: Search operation type. Valid choices are - query_then_fetch, query_and_fetch, dfs_query_then_fetch, - dfs_query_and_fetch. - :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response. + :arg index: Comma-separated list of data streams, indices, and + aliases to search. Supports wildcards (*). + :arg 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`. + :arg ccs_minimize_roundtrips: If `true`, network round-trips are + minimized for cross-cluster search requests. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg explain: If `true`, the response includes additional + details about score computation as part of a hit. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_throttled: If `true`, specified concrete, expanded, + or aliased indices are not included in the response when throttled. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg profile: If `true`, the query execution is profiled. + :arg rest_total_hits_as_int: If true, hits.total are rendered as + an integer in the response. + :arg routing: Custom value used to route operations to a + specific shard. + :arg scroll: Specifies how long a consistent view of the + indexshould be maintained for scrolled search. + :arg search_type: The type of the search operation. Valid + choices are query_then_fetch, dfs_query_then_fetch. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg typed_keys: If `true`, the response prefixes aggregation + and suggester names with their respective types. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1863,14 +2507,19 @@ def search_template( ) @query_params( + "error_trace", "field_statistics", "fields", + "filter_path", + "human", "offsets", "payloads", "positions", "preference", + "pretty", "realtime", "routing", + "source", "term_statistics", "version", "version_type", @@ -1888,29 +2537,40 @@ def termvectors( document. - :arg index: The index in which the document resides. + :arg index: Name of the index that contains the document. :arg body: Define parameters and or supply a document to get termvectors for. See documentation. - :arg id: Document ID. When not specified a doc param should be - supplied. - :arg field_statistics: Specifies if document count, sum of - document frequencies and sum of total term frequencies should be - returned. Default is True. - :arg fields: Comma-separated list of fields to return. - :arg offsets: Specifies if term offsets should be returned. - Default is True. - :arg payloads: Specifies if term payloads should be returned. - Default is True. - :arg positions: Specifies if term positions should be returned. - Default is True. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. - :arg realtime: Specifies if request is real-time as opposed to - near-real-time. Default is True. - :arg routing: Routing value. - :arg term_statistics: Specifies if total term frequency and - document frequency should be returned. Default is false. - :arg version: Explicit version number for concurrency control. + :arg id: Unique identifier of the document. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg field_statistics: If `true`, the response includes the + document count, sum of document frequencies, and sum of total term + frequencies. + :arg fields: Comma-separated list or wildcard expressions of + fields to include in the statistics.Used as the default list unless a + specific field list is provided in the `completion_fields` or + `fielddata_fields` parameters. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg offsets: If `true`, the response includes term offsets. + :arg payloads: If `true`, the response includes term payloads. + :arg positions: If `true`, the response includes term positions. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg realtime: If true, the request is real-time as opposed to + near-real-time. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg term_statistics: If `true`, the response includes term + frequency and document frequency. + :arg version: If `true`, returns the document version as part of + a hit. :arg version_type: Specific version type. Valid choices are internal, external, external_gte, force. """ @@ -1927,13 +2587,18 @@ def termvectors( "_source", "_source_excludes", "_source_includes", + "error_trace", + "filter_path", + "human", "if_primary_term", "if_seq_no", "lang", + "pretty", "refresh", "require_alias", "retry_on_conflict", "routing", + "source", "timeout", "wait_for_active_shards", ) @@ -1949,36 +2614,50 @@ def update( Updates a document with a script or partial document. - :arg index: Index name. - :arg id: Document ID. + :arg index: The name of the index + :arg id: Document ID :arg body: The request definition requires either `script` or partial `doc` - :arg _source: True or false to return the _source field or not, - or a list of fields to return. - :arg _source_excludes: List of fields to exclude from the - returned _source field. - :arg _source_includes: List of fields to extract and return from - the _source field. - :arg if_primary_term: only perform the operation if the last - operation that has changed the document has the specified primary term. - :arg if_seq_no: only perform the operation if the last operation - that has changed the document has the specified sequence number. - :arg lang: The script language. Default is painless. - :arg refresh: If `true` then refresh the affected shards to make - this operation visible to search, if `wait_for` then wait for a refresh - to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices are true, false, wait_for. - :arg require_alias: When true, requires destination to be an - alias. Default is false. + :arg _source: Set to false to disable source retrieval. You can + also specify a comma-separatedlist of the fields you want to retrieve. + :arg _source_excludes: Specify the source fields you want to + exclude. + :arg _source_includes: Specify the source fields you want to + retrieve. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg if_primary_term: Only perform the operation if the document + has this primary term. + :arg if_seq_no: Only perform the operation if the document has + this sequence number. + :arg lang: The script language. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg refresh: If 'true', Opensearch refreshes the affected + shards to make this operationvisible to search, if 'wait_for' then wait + for a refresh to make this operationvisible to search, if 'false' do + nothing with refreshes. Valid choices are true, false, wait_for. + :arg require_alias: If true, the destination must be an index + alias. :arg retry_on_conflict: Specify how many times should the - operation be retried when a conflict occurs. Default is 0. - :arg routing: Routing value. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. + operation be retried when a conflict occurs. + :arg routing: Custom value used to route operations to a + specific shard. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for dynamic mapping updates and + active shards.This guarantees Opensearch waits for at least the timeout + before failing.The actual wait time could be longer, particularly when + multiple waits occur. + :arg wait_for_active_shards: The number of shard copies that + must be active before proceeding with the operations.Set to 'all' or any + positive integer up to the total number of shards in the + index(number_of_replicas+1). Defaults to 1 meaning the primary shard. + Valid choices are all, index-setting. """ for param in (index, id, body): if param in SKIP_IN_PATH: @@ -2000,13 +2679,17 @@ def update( "conflicts", "default_operator", "df", + "error_trace", "expand_wildcards", + "filter_path", "from_", + "human", "ignore_unavailable", "lenient", "max_docs", "pipeline", "preference", + "pretty", "q", "refresh", "request_cache", @@ -2019,6 +2702,7 @@ def update( "size", "slices", "sort", + "source", "stats", "terminate_after", "timeout", @@ -2038,8 +2722,9 @@ def update_by_query( for example to pick up a mapping change. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + :arg 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`. :arg body: The search definition using the Query DSL :arg _source: True or false to return the _source field or not, or a list of fields to return. @@ -2047,68 +2732,90 @@ def update_by_query( returned _source field. :arg _source_includes: List of fields to extract and return from the _source field. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. - :arg conflicts: What to do when the operation encounters version - conflicts?. Valid choices are abort, proceed. + :arg 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`. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed. + :arg analyzer: Analyzer to use for the query string. + :arg conflicts: What to do if update by query hits version + conflicts: `abort` or `proceed`. Valid choices are abort, proceed. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg from_: Starting offset. Default is 0. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. - :arg max_docs: Maximum number of documents to process (default: - all documents). - :arg pipeline: The pipeline id to preprocess incoming documents - with. - :arg preference: Specify the node or shard the operation should - be performed on. Default is random. + query: `AND` or `OR`. Valid choices are and, or. + :arg df: Field to use as default where no field prefix is given + in the query string. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg from_: Starting offset (default: 0) + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg max_docs: Maximum number of documents to process.Defaults + to all documents. + :arg pipeline: ID of the pipeline to use to preprocess incoming + documents.If the index has a default ingest pipeline specified, then + setting the value to `_none` disables the default ingest pipeline for + this request.If a final pipeline is configured it will always run, + regardless of the value of this parameter. + :arg preference: Specifies the node or shard the operation + should be performed on.Random by default. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg refresh: Should the affected indexes be refreshed?. - :arg request_cache: Specify if request cache should be used for - this request or not, defaults to index level setting. + :arg refresh: If `true`, Opensearch refreshes affected shards to + make the operation visible to search. + :arg request_cache: If `true`, the request cache is used for + this request. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. Default is 0. - :arg routing: Comma-separated list of specific routing values. - :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search. - :arg scroll_size: Size on the scroll request powering the - operation. Default is 100. + requests per second. + :arg routing: Custom value used to route operations to a + specific shard. + :arg scroll: Period to retain the search context for scrolling. + :arg scroll_size: Size of the scroll request that powers the + operation. :arg search_timeout: Explicit timeout for each search request. - Defaults to no timeout. - :arg search_type: Search operation type. Valid choices are + :arg search_type: The type of the search operation. Available + options: `query_then_fetch`, `dfs_query_then_fetch`. Valid choices are query_then_fetch, dfs_query_then_fetch. :arg size: Deprecated, please use `max_docs` instead. :arg slices: The number of slices this task should be divided - into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default is 1. - :arg sort: Comma-separated list of : pairs. - :arg stats: Specific 'tag' of the request for logging and + into. Valid choices are auto. + :arg sort: A comma-separated list of : pairs. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg stats: Specific `tag` of the request for logging and statistical purposes. - :arg terminate_after: The maximum number of documents to collect - for each shard, upon reaching which the query execution will terminate - early. - :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default is 1m. - :arg version: Whether to return document version as part of a - hit. - :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the operation. Defaults to 1, - meaning the primary shard only. Set to `all` for all shard copies, - otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1). Default is 1. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is True. + :arg terminate_after: Maximum number of documents to collect for + each shard.If a query reaches this limit, Opensearch terminates the + query early.Opensearch collects documents before sorting.Use with + caution.Opensearch applies this parameter to each shard handling the + request.When possible, let Opensearch perform early termination + automatically.Avoid specifying this parameter for requests that target + data streams with backing indices across multiple data tiers. + :arg timeout: Period each update request waits for the following + operations: dynamic mapping updates, waiting for active shards. + :arg version: If `true`, returns the document version as part of + a hit. + :arg 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`). Valid choices are all, index-setting. + :arg wait_for_completion: If `true`, the request blocks until + the operation is complete. """ # from is a reserved word so it cannot be used, use from_ instead if "from_" in params: @@ -2125,7 +2832,9 @@ def update_by_query( body=body, ) - @query_params("requests_per_second") + @query_params( + "error_trace", "filter_path", "human", "pretty", "requests_per_second", "source" + ) def update_by_query_rethrottle( self, task_id: Any, @@ -2137,9 +2846,19 @@ def update_by_query_rethrottle( operation. - :arg task_id: The task id to rethrottle. + :arg task_id: The ID for the task. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. + requests per second. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'task_id'.") @@ -2151,7 +2870,7 @@ def update_by_query_rethrottle( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_script_context( self, params: Any = None, @@ -2160,12 +2879,23 @@ def get_script_context( """ Returns all script contexts. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_script_context", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_script_languages( self, params: Any = None, @@ -2174,6 +2904,17 @@ def get_script_languages( """ Returns available script types, languages and contexts. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_script_language", params=params, headers=headers @@ -2181,10 +2922,15 @@ def get_script_languages( @query_params( "allow_partial_pit_creation", + "error_trace", "expand_wildcards", + "filter_path", + "human", "keep_alive", "preference", + "pretty", "routing", + "source", ) def create_pit( self, @@ -2200,13 +2946,23 @@ def create_pit( string to perform the operation on all indices. :arg allow_partial_pit_creation: Allow if point in time can be created with partial failures. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg keep_alive: Specify the keep alive for point in time. :arg preference: Specify the node or shard the operation should be performed on. Default is random. + :arg pretty: Whether to pretty format the returned JSON + response. :arg routing: Comma-separated list of specific routing values. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -2218,7 +2974,7 @@ def create_pit( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_all_pits( self, params: Any = None, @@ -2227,12 +2983,23 @@ def delete_all_pits( """ Deletes all active point in time searches. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "DELETE", "/_search/point_in_time/_all", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_pit( self, body: Any = None, @@ -2244,6 +3011,16 @@ def delete_pit( :arg body: The point-in-time ids to be deleted + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "DELETE", @@ -2253,7 +3030,7 @@ def delete_pit( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_all_pits( self, params: Any = None, @@ -2262,6 +3039,17 @@ def get_all_pits( """ Lists all active point in time searches. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_search/point_in_time/_all", params=params, headers=headers diff --git a/opensearchpy/client/cat.py b/opensearchpy/client/cat.py index a1860813..e92741e6 100644 --- a/opensearchpy/client/cat.py +++ b/opensearchpy/client/cat.py @@ -40,7 +40,20 @@ class CatClient(NamespacedClient): - @query_params("expand_wildcards", "format", "h", "help", "local", "s", "v") + @query_params( + "error_trace", + "expand_wildcards", + "filter_path", + "format", + "h", + "help", + "human", + "local", + "pretty", + "s", + "source", + "v", + ) def aliases( self, name: Any = None, @@ -52,25 +65,49 @@ def aliases( filter and routing infos. - :arg name: Comma-separated list of alias names. + :arg name: A comma-separated list of aliases to retrieve. + Supports wildcards (`*`). To retrieve all aliases, omit this parameter + or use `*` or `_all`. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", _make_path("_cat", "aliases", name), params=params, headers=headers ) - @query_params("bytes", "format", "h", "help", "s", "v") + @query_params( + "bytes", + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "v", + ) def all_pit_segments( self, params: Any = None, @@ -82,12 +119,22 @@ def all_pit_segments( :arg bytes: The unit in which to display byte values. Valid choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -97,12 +144,17 @@ def all_pit_segments( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) def allocation( @@ -116,23 +168,33 @@ def allocation( much disk space they are using. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg node_id: Comma-separated list of node identifiers or names + used to limit the returned information. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -144,12 +206,17 @@ def allocation( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) def cluster_manager( @@ -163,24 +230,45 @@ def cluster_manager( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", "/_cat/cluster_manager", params=params, headers=headers ) - @query_params("format", "h", "help", "s", "v") + @query_params( + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "v", + ) def count( self, index: Any = None, @@ -192,21 +280,44 @@ def count( individual indices. - :arg index: Comma-separated list of indices to limit the - returned information. + :arg 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`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", _make_path("_cat", "count", index), params=params, headers=headers ) - @query_params("bytes", "format", "h", "help", "s", "v") + @query_params( + "bytes", + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "v", + ) def fielddata( self, fields: Any = None, @@ -218,16 +329,26 @@ def fielddata( node in the cluster. - :arg fields: Comma-separated list of fields to return in the - output. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg fields: Comma-separated list of fields used to limit + returned information. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -237,7 +358,20 @@ def fielddata( headers=headers, ) - @query_params("format", "h", "help", "s", "time", "ts", "v") + @query_params( + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "time", + "ts", + "v", + ) def health( self, params: Any = None, @@ -247,22 +381,34 @@ def health( Returns a concise representation of the cluster health. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. - :arg ts: Set to false to disable timestamping. Default is True. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg time: The unit used to display time values. Valid choices + are nanos, micros, ms, s, m, h, d. + :arg ts: If true, returns `HH:MM:SS` and Unix epoch timestamps. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", "/_cat/health", params=params, headers=headers ) - @query_params("help", "s") + @query_params( + "error_trace", "filter_path", "help", "human", "pretty", "s", "source" + ) def help( self, params: Any = None, @@ -272,9 +418,19 @@ def help( Returns help for the Cat APIs. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_cat", params=params, headers=headers @@ -283,16 +439,21 @@ def help( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "format", "h", "health", "help", + "human", "include_unloaded_segments", "local", "master_timeout", + "pretty", "pri", "s", + "source", "time", "v", ) @@ -307,36 +468,45 @@ def indices( counts, disk size, ... - :arg index: Comma-separated list of indices to limit the - returned information. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg 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`. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: The type of index that wildcard patterns + can match. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg health: Health status ('green', 'yellow', or 'red') to - filter only indices matching the specified health status. Valid choices - are green, yellow, red. + :arg health: The health status used to limit returned indices. + By default, the response includes indices of any health status. Valid + choices are green, yellow, red. :arg help: Return help information. Default is false. - :arg include_unloaded_segments: If set to true segment stats - will include stats for segments that are not currently loaded into - memory. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg include_unloaded_segments: If true, the response includes + information from segments that are not loaded into memory. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. - :arg pri: Set to true to return stats only for primary shards. - Default is false. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg pri: If true, the response only includes information from + primary shards. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg time: The unit used to display time values. Valid choices + are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -345,12 +515,17 @@ def indices( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) def master( @@ -364,17 +539,27 @@ def master( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ from warnings import warn @@ -388,12 +573,17 @@ def master( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) def nodeattrs( @@ -407,17 +597,27 @@ def nodeattrs( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -427,13 +627,18 @@ def nodeattrs( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "full_id", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "time", "v", ) @@ -446,26 +651,35 @@ def nodes( Returns basic statistics about performance of cluster nodes. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. - :arg full_id: Return the full node ID instead of the shortened - version. Default is false. + :arg full_id: If `true`, return the full node ID. If `false`, + return the shortened node ID. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. - :arg local (Deprecated: This parameter does not cause this API - to act locally.): Return local information, do not retrieve the state + :arg human: Whether to return human readable values for + statistics. + :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -474,12 +688,17 @@ def nodes( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "time", "v", ) @@ -494,26 +713,48 @@ def pending_tasks( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", "/_cat/pending_tasks", params=params, headers=headers ) - @query_params("bytes", "format", "h", "help", "s", "v") + @query_params( + "bytes", + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "v", + ) def pit_segments( self, body: Any = None, @@ -526,12 +767,22 @@ def pit_segments( :arg bytes: The unit in which to display byte values. Valid choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -540,12 +791,17 @@ def pit_segments( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) def plugins( @@ -559,17 +815,27 @@ def plugins( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -577,7 +843,20 @@ def plugins( ) @query_params( - "active_only", "bytes", "detailed", "format", "h", "help", "s", "time", "v" + "active_only", + "bytes", + "detailed", + "error_trace", + "filter_path", + "format", + "h", + "help", + "human", + "pretty", + "s", + "source", + "time", + "v", ) def recovery( self, @@ -592,19 +871,29 @@ def recovery( :arg index: Comma-separated list or wildcard expression of index names to limit the returned information. :arg active_only: If `true`, the response only includes ongoing - shard recoveries. Default is false. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + shard recoveries. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg detailed: If `true`, the response includes detailed - information about shard recoveries. Default is false. + information about shard recoveries. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -613,12 +902,17 @@ def recovery( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) def repositories( @@ -632,17 +926,27 @@ def repositories( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -655,14 +959,19 @@ def repositories( "bytes", "completed_only", "detailed", + "error_trace", "expand_wildcards", + "filter_path", "format", "h", "help", + "human", "ignore_throttled", "ignore_unavailable", + "pretty", "s", "shards", + "source", "time", "timeout", "v", @@ -691,22 +1000,32 @@ def segment_replication( latest completed segment replication events. Default is false. :arg detailed: If `true`, the response includes detailed information about segment replications. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg ignore_throttled: Whether specified concrete, expanded or aliased indices should be ignored when throttled. :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed). + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. :arg shards: Comma-separated list of shards to display. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg timeout: Operation timeout. :arg v: Verbose mode. Display column headers. Default is false. """ @@ -720,11 +1039,16 @@ def segment_replication( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "master_timeout", + "pretty", "s", + "source", "v", ) def segments( @@ -737,21 +1061,32 @@ def segments( Provides low-level information about the segments in the shards of an index. - :arg index: Comma-separated list of indices to limit the - returned information. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg 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`. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -761,12 +1096,17 @@ def segments( @query_params( "bytes", "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "time", "v", ) @@ -780,25 +1120,36 @@ def shards( Provides a detailed view of shard allocation on nodes. - :arg index: Comma-separated list of indices to limit the - returned information. - :arg bytes: The unit in which to display byte values. Valid - choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. + :arg 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`. + :arg bytes: The unit used to display byte values. Valid choices + are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -807,13 +1158,18 @@ def shards( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", "size", + "source", "v", ) def thread_pool( @@ -827,22 +1183,32 @@ def thread_pool( queue and rejected statistics are returned for all thread pools. - :arg thread_pool_patterns: Comma-separated list of regular- - expressions to filter the thread pools in the output. + :arg thread_pool_patterns: A comma-separated list of thread pool + names used to limit the request. Accepts wildcard expressions. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. :arg size: The multiplier in which to display values. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -854,12 +1220,17 @@ def thread_pool( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "ignore_unavailable", "master_timeout", + "pretty", "s", + "source", "time", "v", ) @@ -873,23 +1244,35 @@ def snapshots( Returns all snapshots in a specific repository. - :arg repository: Comma-separated list of repository names. + :arg 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, Opensearch + returns an error. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). Default is - false. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `true`, the response does not + include information from unavailable snapshots. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -902,12 +1285,17 @@ def snapshots( @query_params( "actions", "detailed", + "error_trace", + "filter_path", "format", "h", "help", + "human", "nodes", "parent_task_id", + "pretty", "s", + "source", "time", "v", ) @@ -921,24 +1309,34 @@ def tasks( the cluster. - :arg actions: Comma-separated list of actions that should be - returned. Leave empty to return all. - :arg detailed: Return detailed task information. Default is - false. + :arg actions: The task action names, which are used to limit the + response. + :arg detailed: If `true`, the response includes detailed + information about shard recoveries. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg nodes: Comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. - :arg parent_task_id: Return tasks with specified parent task id - (node_id:task_number). Set to -1 to return all. + :arg parent_task_id: The parent task identifier, which is used + to limit the response. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg time: The unit in which to display time values. Valid - choices are d, h, m, s, ms, micros, nanos. + choices are nanos, micros, ms, s, m, h, d. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -947,12 +1345,17 @@ def tasks( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "format", "h", "help", + "human", "local", "master_timeout", + "pretty", "s", + "source", "v", ) def templates( @@ -965,20 +1368,31 @@ def templates( Returns information about existing templates. - :arg name: The name of the template. + :arg name: The name of the template to return. Accepts wildcard + expressions. If omitted, all templates are returned. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg help: Return help information. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. :arg s: Comma-separated list of column names or column aliases to sort by. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( diff --git a/opensearchpy/client/cluster.py b/opensearchpy/client/cluster.py index 20539920..4bca0529 100644 --- a/opensearchpy/client/cluster.py +++ b/opensearchpy/client/cluster.py @@ -43,10 +43,15 @@ class ClusterClient(NamespacedClient): @query_params( "awareness_attribute", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "level", "local", "master_timeout", + "pretty", + "source", "timeout", "wait_for_active_shards", "wait_for_events", @@ -65,36 +70,63 @@ def health( Returns basic information about the health of the cluster. - :arg index: Limit the information returned to specific indicies. + :arg index: Comma-separated list of data streams, indices, and + index aliases used to limit the request. Wildcard expressions (*) are + supported. To target all data streams and indices in a cluster, omit + this parameter or use `_all` or `*`. :arg awareness_attribute: The awareness attribute for which the health is required. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. - :arg level: Specify the level of detail for returned - information. Valid choices are cluster, indices, shards, - awareness_attributes. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg level: Can be one of cluster, indices or shards. Controls + the details level of the health information returned. Valid choices are + cluster, indices, shards, awareness_attributes. + :arg local: If true, the request retrieves information from the + local node only. Defaults to false, which means information is retrieved + from the master node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Wait until the specified number of - shards is active. - :arg wait_for_events: Wait until all currently queued events - with the given priority are processed. Valid choices are immediate, - urgent, high, normal, low, languid. - :arg wait_for_no_initializing_shards: Whether to wait until - there are no initializing shards in the cluster. - :arg wait_for_no_relocating_shards: Whether to wait until there - are no relocating shards in the cluster. - :arg wait_for_nodes: Wait until the specified number of nodes is - available. - :arg wait_for_status: Wait until cluster is in a specific state. - Valid choices are green, yellow, red. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_active_shards: A number controlling to how many + active shards to wait for, all to wait for all shards in the cluster to + be active, or 0 to not wait. Valid choices are all, index-setting. + :arg wait_for_events: Can be one of immediate, urgent, high, + normal, low, languid. Wait until all currently queued events with the + given priority are processed. Valid choices are immediate, urgent, high, + normal, low, languid. + :arg wait_for_no_initializing_shards: A boolean value which + controls whether to wait (until the timeout provided) for the cluster to + have no shard initializations. Defaults to false, which means it will + not wait for initializing shards. + :arg wait_for_no_relocating_shards: A boolean value which + controls whether to wait (until the timeout provided) for the cluster to + have no shard relocations. Defaults to false, which means it will not + wait for relocating shards. + :arg wait_for_nodes: The request waits until the specified + number N of nodes is available. It also accepts >=N, <=N, >N and yellow > red. By default, will + not wait for any status. Valid choices are green, yellow, red. """ return self.transport.perform_request( "GET", @@ -103,7 +135,16 @@ def health( headers=headers, ) - @query_params("cluster_manager_timeout", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) def pending_tasks( self, params: Any = None, @@ -116,11 +157,23 @@ def pending_tasks( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg local: If `true`, the request retrieves information from + the local node only.If `false`, information is retrieved from the master + node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_cluster/pending_tasks", params=params, headers=headers @@ -129,11 +182,16 @@ def pending_tasks( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "local", "master_timeout", + "pretty", + "source", "wait_for_metadata_version", "wait_for_timeout", ) @@ -149,31 +207,40 @@ def state( :arg metric: Limit the information returned to the specified - metrics. Valid choices are _all, blocks, metadata, nodes, routing_table, - routing_nodes, master_node, cluster_manager_node, version. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + metrics + :arg index: A comma-separated list of index names; use `_all` or + empty string to perform the operation on all indices :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + string or when no indices have been specified) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: Return settings in flat format (default: + false) + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + should be ignored when unavailable (missing or closed) :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + from cluster-manager node (default: false) :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_metadata_version: Wait for the metadata version to - be equal or greater than the specified metadata version. + be equal or greater than the specified metadata version :arg wait_for_timeout: The maximum time to wait for - wait_for_metadata_version before timing out. + wait_for_metadata_version before timing out """ if index and metric in SKIP_IN_PATH: metric = "_all" @@ -185,7 +252,15 @@ def state( headers=headers, ) - @query_params("flat_settings", "timeout") + @query_params( + "error_trace", + "filter_path", + "flat_settings", + "human", + "pretty", + "source", + "timeout", + ) def stats( self, node_id: Any = None, @@ -196,13 +271,23 @@ def stats( Returns high-level overview of cluster statistics. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg timeout: Operation timeout. + :arg node_id: Comma-separated list of node filters used to limit + returned information. Defaults to all nodes in the cluster. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg 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. """ return self.transport.perform_request( "GET", @@ -218,10 +303,15 @@ def stats( @query_params( "cluster_manager_timeout", "dry_run", + "error_trace", "explain", + "filter_path", + "human", "master_timeout", "metric", + "pretty", "retry_failed", + "source", "timeout", ) def reroute( @@ -238,18 +328,31 @@ def reroute( `cancel`, `allocate`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg dry_run: Simulate the operation only and return the - resulting state. - :arg explain: Return an explanation of why the commands can or - cannot be executed. + :arg dry_run: If true, then the request simulates the operation + only and returns the resulting state. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg explain: If true, then the response contains an explanation + of why the commands can or cannot be executed. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg metric: Limit the information returned to the specified - metrics. Defaults to all but metadata. - :arg retry_failed: Retries allocation of shards that are blocked - due to too many subsequent allocation failures. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg metric: Limits the information returned to the specified + metrics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg retry_failed: If true, then retries allocation of shards + that are blocked due to too many subsequent allocation failures. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. """ return self.transport.perform_request( "POST", "/_cluster/reroute", params=params, headers=headers, body=body @@ -257,9 +360,14 @@ def reroute( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", "flat_settings", + "human", "include_defaults", "master_timeout", + "pretty", + "source", "timeout", ) def get_settings( @@ -273,21 +381,41 @@ def get_settings( :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg include_defaults: Whether to return all default clusters - setting. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg include_defaults: If `true`, returns default cluster + settings from the local node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ return self.transport.perform_request( "GET", "/_cluster/settings", params=params, headers=headers ) @query_params( - "cluster_manager_timeout", "flat_settings", "master_timeout", "timeout" + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "master_timeout", + "pretty", + "source", + "timeout", ) def put_settings( self, @@ -303,12 +431,22 @@ def put_settings( or `persistent` (survives cluster restart). :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: Return settings in flat format (default: + false) + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -317,7 +455,7 @@ def put_settings( "PUT", "/_cluster/settings", params=params, headers=headers, body=body ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def remote_info( self, params: Any = None, @@ -326,12 +464,31 @@ def remote_info( """ Returns the information about configured remote clusters. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_remote/info", params=params, headers=headers ) - @query_params("include_disk_info", "include_yes_decisions") + @query_params( + "error_trace", + "filter_path", + "human", + "include_disk_info", + "include_yes_decisions", + "pretty", + "source", + ) def allocation_explain( self, body: Any = None, @@ -344,10 +501,20 @@ def allocation_explain( :arg body: The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard' - :arg include_disk_info: Return information about disk usage and - shard sizes. Default is false. - :arg include_yes_decisions: Return 'YES' decisions in - explanation. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg include_disk_info: If true, returns information about disk + usage and shard sizes. + :arg include_yes_decisions: If true, returns YES decisions in + explanation. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "POST", @@ -357,7 +524,16 @@ def allocation_explain( body=body, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def delete_component_template( self, name: Any, @@ -368,13 +544,27 @@ def delete_component_template( Deletes a component template. - :arg name: The name of the template. + :arg name: Name of the component template to delete. Wildcard + (*) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg 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 a required argument 'name'.") @@ -386,7 +576,16 @@ def delete_component_template( headers=headers, ) - @query_params("cluster_manager_timeout", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) def get_component_template( self, name: Any = None, @@ -397,14 +596,27 @@ def get_component_template( Returns one or more component templates. - :arg name: The Comma-separated names of the component templates. + :arg name: Name of the component template to retrieve. Wildcard + (`*`) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg local: If `true`, the request retrieves information from + the local node only.If `false`, information is retrieved from the master + node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", @@ -413,7 +625,17 @@ def get_component_template( headers=headers, ) - @query_params("cluster_manager_timeout", "create", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def put_component_template( self, name: Any, @@ -425,15 +647,35 @@ def put_component_template( Creates or updates a component template. - :arg name: The name of the template. + :arg name: Name of the component template to create. Opensearch + includes the following built-in component templates: `logs-mappings`; + 'logs-settings`; `metrics-mappings`; `metrics-settings`;`synthetics- + mapping`; `synthetics-settings`. Opensearch Agent uses these templates + to configure backing indices for its data streams. If you use Opensearch + 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 Opensearch Agent and want to disable all built-in component + and index templates, set `stack.templates.enabled` to `false` using the + cluster update settings API. :arg body: The template definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template should only be added if - new or can also replace an existing one. Default is false. + :arg create: If `true`, this request cannot replace or update + existing component templates. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg timeout: Operation timeout. """ for param in (name, body): @@ -448,7 +690,16 @@ def put_component_template( body=body, ) - @query_params("cluster_manager_timeout", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) def exists_component_template( self, name: Any, @@ -459,14 +710,27 @@ def exists_component_template( Returns information about whether a particular component template exist. - :arg name: The name of the template. + :arg name: Name of the component template to check existence of. + Wildcard (*) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg local: If true, the request retrieves information from the + local node only.Defaults to false, which means information is retrieved + from the master node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response isreceived before the timeout + expires, the request fails and returns anerror. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -478,7 +742,9 @@ def exists_component_template( headers=headers, ) - @query_params("wait_for_removal") + @query_params( + "error_trace", "filter_path", "human", "pretty", "source", "wait_for_removal" + ) def delete_voting_config_exclusions( self, params: Any = None, @@ -488,9 +754,22 @@ def delete_voting_config_exclusions( Clears cluster voting config exclusions. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_removal: Specifies whether to wait for all - excluded nodes to be removed from the cluster before clearing the voting - configuration exclusions list. Default is True. + excluded nodes to be removed from thecluster before clearing the voting + configuration exclusions list.Defaults to true, meaning that all + excluded nodes must be removed fromthe cluster before this API takes any + action. If set to false then thevoting configuration exclusions list is + cleared even if some excludednodes are still in the cluster. """ return self.transport.perform_request( "DELETE", @@ -499,7 +778,16 @@ def delete_voting_config_exclusions( headers=headers, ) - @query_params("node_ids", "node_names", "timeout") + @query_params( + "error_trace", + "filter_path", + "human", + "node_ids", + "node_names", + "pretty", + "source", + "timeout", + ) def post_voting_config_exclusions( self, params: Any = None, @@ -509,19 +797,33 @@ def post_voting_config_exclusions( Updates the cluster voting config exclusions by node ids or node names. - :arg node_ids: Comma-separated list of the persistent ids of the - nodes to exclude from the voting configuration. If specified, you may - not also specify ?node_names. - :arg node_names: Comma-separated list of the names of the nodes - to exclude from the voting configuration. If specified, you may not also - specify ?node_ids. - :arg timeout: Operation timeout. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg node_ids: A comma-separated list of the persistent ids of + the nodes to excludefrom the voting configuration. If specified, you may + not also specify node_names. + :arg node_names: A comma-separated list of the names of the + nodes to exclude from thevoting configuration. If specified, you may not + also specify node_ids. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: When adding a voting configuration exclusion, the + API waits for thespecified nodes to be excluded from the voting + configuration beforereturning. If the timeout expires before the + appropriate conditionis satisfied, the request fails and returns an + error. """ return self.transport.perform_request( "POST", "/_cluster/voting_config_exclusions", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_decommission_awareness( self, params: Any = None, @@ -530,12 +832,23 @@ def delete_decommission_awareness( """ Delete any existing decommission. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "DELETE", "/_cluster/decommission/awareness", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_weighted_routing( self, params: Any = None, @@ -544,6 +857,17 @@ def delete_weighted_routing( """ Delete weighted shard routing weights. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "DELETE", @@ -552,7 +876,7 @@ def delete_weighted_routing( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_decommission_awareness( self, awareness_attribute_name: Any, @@ -564,6 +888,16 @@ def get_decommission_awareness( :arg awareness_attribute_name: Awareness attribute name. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if awareness_attribute_name in SKIP_IN_PATH: raise ValueError( @@ -583,7 +917,7 @@ def get_decommission_awareness( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_weighted_routing( self, attribute: Any, @@ -595,6 +929,16 @@ def get_weighted_routing( :arg attribute: Awareness attribute name. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if attribute in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'attribute'.") @@ -606,7 +950,7 @@ def get_weighted_routing( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def put_decommission_awareness( self, awareness_attribute_name: Any, @@ -620,6 +964,16 @@ def put_decommission_awareness( :arg awareness_attribute_name: Awareness attribute name. :arg awareness_attribute_value: Awareness attribute value. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (awareness_attribute_name, awareness_attribute_value): if param in SKIP_IN_PATH: @@ -638,7 +992,7 @@ def put_decommission_awareness( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def put_weighted_routing( self, attribute: Any, @@ -650,6 +1004,16 @@ def put_weighted_routing( :arg attribute: Awareness attribute name. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if attribute in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'attribute'.") diff --git a/opensearchpy/client/dangling_indices.py b/opensearchpy/client/dangling_indices.py index e6184e9a..bee5c3f1 100644 --- a/opensearchpy/client/dangling_indices.py +++ b/opensearchpy/client/dangling_indices.py @@ -41,7 +41,15 @@ class DanglingIndicesClient(NamespacedClient): @query_params( - "accept_data_loss", "cluster_manager_timeout", "master_timeout", "timeout" + "accept_data_loss", + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", ) def delete_dangling_index( self, @@ -53,15 +61,25 @@ def delete_dangling_index( Deletes the specified dangling index. - :arg index_uuid: The UUID of the dangling index. + :arg index_uuid: The UUID of the dangling index :arg accept_data_loss: Must be set to true in order to delete - the dangling index. + the dangling index :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if index_uuid in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index_uuid'.") @@ -74,7 +92,15 @@ def delete_dangling_index( ) @query_params( - "accept_data_loss", "cluster_manager_timeout", "master_timeout", "timeout" + "accept_data_loss", + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", ) def import_dangling_index( self, @@ -86,15 +112,25 @@ def import_dangling_index( Imports the specified dangling index. - :arg index_uuid: The UUID of the dangling index. + :arg index_uuid: The UUID of the dangling index :arg accept_data_loss: Must be set to true in order to import - the dangling index. + the dangling index :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if index_uuid in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index_uuid'.") @@ -103,7 +139,7 @@ def import_dangling_index( "POST", _make_path("_dangling", index_uuid), params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def list_dangling_indices( self, params: Any = None, @@ -112,6 +148,17 @@ def list_dangling_indices( """ Returns all dangling indices. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_dangling", params=params, headers=headers diff --git a/opensearchpy/client/indices.py b/opensearchpy/client/indices.py index 179e2f5f..d582f6e8 100644 --- a/opensearchpy/client/indices.py +++ b/opensearchpy/client/indices.py @@ -40,7 +40,7 @@ class IndicesClient(NamespacedClient): - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def analyze( self, body: Any = None, @@ -56,6 +56,16 @@ def analyze( :arg body: Define analyzer/tokenizer parameters and the text on which the analysis should be performed :arg index: The name of the index to scope the operation. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "POST", @@ -65,7 +75,16 @@ def analyze( body=body, ) - @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") + @query_params( + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "source", + ) def refresh( self, index: Any = None, @@ -76,16 +95,31 @@ def refresh( Performs the refresh operation in one or more indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + :arg 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`. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "POST", _make_path(index, "_refresh"), params=params, headers=headers @@ -93,9 +127,14 @@ def refresh( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", "force", + "human", "ignore_unavailable", + "pretty", + "source", "wait_if_ongoing", ) def flush( @@ -108,32 +147,52 @@ def flush( Performs the flush operation on one or more indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg force: Whether a flush should be forced even if it is not - necessarily needed ie. if no changes will be committed to the index. - This is useful if transaction log IDs should be incremented even if no - uncommitted changes are present. (This setting can be considered as - internal). - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg wait_if_ongoing: If set to true the flush operation will - block until the flush can be executed if another flush operation is - already executing. If set to false the flush will be skipped iff if - another flush operation is already running. Default is True. + :arg 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`. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg force: If `true`, the request forces a flush even if there + are no changes to commit to the index. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg wait_if_ongoing: If `true`, the flush operation blocks + until execution when another flush operation is running.If `false`, + Opensearch returns an error if you request a flush when another flush + operation is running. """ return self.transport.perform_request( "POST", _make_path(index, "_flush"), params=params, headers=headers ) @query_params( - "cluster_manager_timeout", "master_timeout", "timeout", "wait_for_active_shards" + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + "wait_for_active_shards", ) def create( self, @@ -146,17 +205,32 @@ def create( Creates an index with optional settings and mappings. - :arg index: Index name. + :arg index: Name of the index you wish to create. :arg body: The configuration for the index (`settings` and `mappings`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for before the operation returns. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg 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`). Valid choices are all, index-setting. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -167,7 +241,12 @@ def create( @query_params( "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", "master_timeout", + "pretty", + "source", "task_execution_timeout", "timeout", "wait_for_active_shards", @@ -185,20 +264,35 @@ def clone( Clones an index. - :arg index: The name of the source index to clone. - :arg target: The name of the target index. + :arg index: Name of the source index to clone. + :arg target: Name of the target index to create. :arg body: The configuration for the target index (`settings` and `aliases`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg task_execution_timeout: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for on the cloned index before the operation returns. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg 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`). Valid choices are all, index-setting. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -217,12 +311,17 @@ def clone( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "include_defaults", "local", "master_timeout", + "pretty", + "source", ) def get( self, @@ -234,27 +333,43 @@ def get( Returns information about one or more indices. - :arg index: Comma-separated list of indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). Default is false. + :arg index: Comma-separated list of data streams, indices, and + index aliases used to limit the request. Wildcard expressions (*) are + supported. + :arg allow_no_indices: If false, the request returns an error if + any wildcard expression, index alias, or _all value targets onlymissing + 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. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). Default is - false. - :arg include_defaults: Whether to return all default setting for - each of the indices. Default is false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard expressions + can match. If the request can target data streams, this + argumentdetermines whether wildcard expressions match hidden data + streams. Supports comma-separated values,such as open,hidden. Valid + choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If true, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If false, requests that target a + missing index return an error. + :arg include_defaults: If true, return all default settings in + the response. + :arg local: If true, the request retrieves information from the + local node only. Defaults to false, which means information is retrieved + from the master node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -266,9 +381,14 @@ def get( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "task_execution_timeout", "timeout", "wait_for_active_shards", @@ -284,25 +404,50 @@ def open( Opens an index. - :arg index: Comma-separated list of indices to open. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg 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 `opensearch.yml` file or using the cluster update + settings API. + :arg 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. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg task_execution_timeout: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Sets the number of active shards to - wait for before the operation returns. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg 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`). Valid choices are all, index-setting. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -316,9 +461,14 @@ def open( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "timeout", "wait_for_active_shards", ) @@ -332,23 +482,43 @@ def close( Closes an index. - :arg index: Comma-separated list of indices to close. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg index: Comma-separated list or wildcard expression of index + names used to limit the request. + :arg 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. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Sets the number of active shards to - wait for before the operation returns. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg 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`). Valid choices are all, index-setting. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -360,9 +530,14 @@ def close( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "timeout", ) def delete( @@ -375,23 +550,41 @@ def delete( Deletes an index. - :arg index: Comma-separated list of indices to delete; use - `_all` or `*` string to delete all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). Default is false. + :arg 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`. + :arg 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. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). Default is - false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg 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 a required argument 'index'.") @@ -402,11 +595,16 @@ def delete( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "include_defaults", "local", + "pretty", + "source", ) def exists( self, @@ -418,22 +616,35 @@ def exists( Returns information about whether a particular index exists. - :arg index: Comma-separated list of indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). Default is false. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). Default is - false. - :arg include_defaults: Whether to return all default setting for - each of the indices. Default is false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg index: Comma-separated list of data streams, indices, and + aliases. Supports wildcards (`*`). + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg include_defaults: If `true`, return all default settings in + the response. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -445,9 +656,14 @@ def exists( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "timeout", "write_index_only", ) @@ -465,22 +681,39 @@ def put_mapping( :arg body: The mapping definition :arg index: Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg 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. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg write_index_only: When true, applies mappings only to the - write index of an alias or data stream. Default is false. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg write_index_only: If `true`, the mappings are applied only + to the current write index for the target. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -499,10 +732,15 @@ def put_mapping( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "local", "master_timeout", + "pretty", + "source", ) def get_mapping( self, @@ -514,23 +752,39 @@ def get_mapping( Returns mappings for one or more indices. - :arg index: Comma-separated list of indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg 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`. + :arg 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. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg local (Deprecated: This parameter is a no-op and field - mappings are always retrieved locally.): Return local information, do - not retrieve the state from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg local: If `true`, the request retrieves information from + the local node only. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path(index, "_mapping"), params=params, headers=headers @@ -538,10 +792,15 @@ def get_mapping( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "include_defaults", "local", + "pretty", + "source", ) def get_field_mapping( self, @@ -554,20 +813,37 @@ def get_field_mapping( Returns mapping for one or more fields. - :arg fields: Comma-separated list of fields. - :arg index: Comma-separated list of indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg include_defaults: Whether the default mapping values should - be returned as well. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg fields: Comma-separated list or wildcard expression of + fields used to limit returned information. + :arg 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`. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg include_defaults: If `true`, return all default settings in + the response. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if fields in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'fields'.") @@ -579,7 +855,16 @@ def get_field_mapping( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def put_alias( self, index: Any, @@ -592,17 +877,32 @@ def put_alias( Creates or updates an alias. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg name: The name of the alias to be created or updated. + :arg 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. + :arg name: Alias to update. If the alias doesn’t exist, the + request creates it. Index alias names support date math. :arg body: The settings for the alias, such as `routing` or `filter` :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ for param in (index, name): if param in SKIP_IN_PATH: @@ -616,7 +916,17 @@ def put_alias( body=body, ) - @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable", "local") + @query_params( + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "local", + "pretty", + "source", + ) def exists_alias( self, name: Any, @@ -628,18 +938,36 @@ def exists_alias( Returns information about whether a particular alias exists. - :arg name: Comma-separated list of alias names. - :arg index: Comma-separated list of indices to filter aliases. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg name: Comma-separated list of aliases to check. Supports + wildcards (`*`). + :arg 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`. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, requests that include a + missing data stream or index in the target indices or data streams + return an error. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -648,7 +976,17 @@ def exists_alias( "HEAD", _make_path(index, "_alias", name), params=params, headers=headers ) - @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable", "local") + @query_params( + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "local", + "pretty", + "source", + ) def get_alias( self, index: Any = None, @@ -660,24 +998,51 @@ def get_alias( Returns an alias. - :arg index: Comma-separated list of indices to filter aliases. - :arg name: Comma-separated list of alias names. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg 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`. + :arg name: Comma-separated list of aliases to retrieve. Supports + wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` + or `_all`. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg local: If `true`, the request retrieves information from + the local node only. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path(index, "_alias", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def update_aliases( self, body: Any, @@ -691,10 +1056,23 @@ def update_aliases( :arg body: The definition of `actions` to perform :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -703,7 +1081,16 @@ def update_aliases( "POST", "/_aliases", params=params, headers=headers, body=body ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def delete_alias( self, index: Any, @@ -715,16 +1102,29 @@ def delete_alias( Deletes an alias. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg name: Comma-separated list of aliases to delete (supports - wildcards); use `_all` to delete all aliases for the specified indices. + :arg index: Comma-separated list of data streams or indices used + to limit the request. Supports wildcards (`*`). + :arg name: Comma-separated list of aliases to remove. Supports + wildcards (`*`). To remove all aliases, use `*` or `_all`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ for param in (index, name): if param in SKIP_IN_PATH: @@ -734,7 +1134,17 @@ def delete_alias( "DELETE", _make_path(index, "_alias", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "create", "master_timeout", "order") + @query_params( + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "order", + "pretty", + "source", + ) def put_template( self, name: Any, @@ -746,18 +1156,30 @@ def put_template( Creates or updates an index template. - :arg name: The name of the template. + :arg name: The name of the template :arg body: The template definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template should only be added if - new or can also replace an existing one. Default is false. + :arg create: If true, this request cannot replace or update + existing index templates. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg order: The order for this template when merging multiple - matching ones (higher numbers are merged later, overriding the lower - numbers). + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response isreceived before the timeout + expires, the request fails and returns an error. + :arg order: Order in which Opensearch applies this template if + indexmatches multiple templates.Templates with lower 'order' values are + merged first. Templates with higher'order' values are merged later, + overriding templates with lower values. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (name, body): if param in SKIP_IN_PATH: @@ -771,7 +1193,17 @@ def put_template( body=body, ) - @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) def exists_template( self, name: Any, @@ -782,16 +1214,26 @@ def exists_template( Returns information about whether a particular index template exists. - :arg name: Comma-separated names of the index templates. + :arg name: The comma separated names of the index templates :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: Return settings in flat format (default: + false) + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + from cluster-manager node (default: false) :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -800,7 +1242,17 @@ def exists_template( "HEAD", _make_path("_template", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) def get_template( self, name: Any = None, @@ -811,22 +1263,44 @@ def get_template( Returns an index template. - :arg name: Comma-separated names of the index templates. + :arg 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 + `*`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg local: If `true`, the request retrieves information from + the local node only. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path("_template", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def delete_template( self, name: Any, @@ -837,13 +1311,27 @@ def delete_template( Deletes an index template. - :arg name: The name of the template. + :arg name: The name of the legacy index template to delete. + Wildcard (`*`) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg 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 a required argument 'name'.") @@ -855,12 +1343,17 @@ def delete_template( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "include_defaults", "local", "master_timeout", + "pretty", + "source", ) def get_settings( self, @@ -873,28 +1366,46 @@ def get_settings( Returns settings for one or more indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg name: Comma-separated list of settings. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg 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`. + :arg name: Comma-separated list or wildcard expression of + settings to retrieve. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, indexalias, or `_all` value targets only + missing or closed indices. Thisbehavior applies even if the request + targets other open indices. Forexample, a request targeting `foo*,bar*` + returns an error if an indexstarts with foo but no index starts with + `bar`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg include_defaults: Whether to return all default setting for - each of the indices. Default is false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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 choices are all, open, + closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg include_defaults: If `true`, return all default settings in + the response. + :arg local: If `true`, the request retrieves information from + the local node only. If`false`, information is retrieved from the master + node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response isreceived before the timeout + expires, the request fails and returns anerror. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path(index, "_settings", name), params=params, headers=headers @@ -903,11 +1414,16 @@ def get_settings( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", "flat_settings", + "human", "ignore_unavailable", "master_timeout", "preserve_existing", + "pretty", + "source", "timeout", ) def put_settings( @@ -921,28 +1437,44 @@ def put_settings( Updates the index settings. - :arg body: The index settings to be updated - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + :arg 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`. + :arg allow_no_indices: If `false`, the request returns an error + if any wildcard expression, indexalias, or `_all` value targets only + missing or closed indices. Thisbehavior applies even if the request + targets other open indices. Forexample, a request targeting `foo*,bar*` + returns an error if an indexstarts with `foo` but no index starts with + `bar`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg flat_settings: Return settings in flat format. Default is - false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match. If the request can targetdata streams, this argument determines + whether wildcard expressions matchhidden data streams. Supports comma- + separated values, such as`open,hidden`. Valid choices are all, open, + closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If `true`, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed). :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg preserve_existing: Whether to update existing settings. If - set to `true` existing settings on an index remain unchanged. Default is - false. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response isreceived before the timeout + expires, the request fails and returns anerror. + :arg preserve_existing: If `true`, existing index settings + remain unchanged. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -957,14 +1489,19 @@ def put_settings( @query_params( "completion_fields", + "error_trace", "expand_wildcards", "fielddata_fields", "fields", + "filter_path", "forbid_closed_indices", "groups", + "human", "include_segment_file_sizes", "include_unloaded_segments", "level", + "pretty", + "source", ) def stats( self, @@ -977,41 +1514,58 @@ def stats( Provides statistics on operations happening in an index. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + :arg index: A comma-separated list of index names; use `_all` or + empty string to perform the operation on all indices :arg metric: Limit the information returned the specific - metrics. Valid choices are _all, store, indexing, get, search, merge, - flush, refresh, query_cache, fielddata, docs, warmer, completion, - segments, translog, suggest, request_cache, recovery. - :arg completion_fields: Comma-separated list of fields for - `fielddata` and `suggest` index metric (supports wildcards). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg fielddata_fields: Comma-separated list of fields for - `fielddata` index metric (supports wildcards). - :arg fields: Comma-separated list of fields for `fielddata` and - `completion` index metric (supports wildcards). - :arg forbid_closed_indices: If set to false stats will also - collected from closed indices if explicitly specified or if - expand_wildcards expands to closed indices. Default is True. - :arg groups: Comma-separated list of search groups for `search` - index metric. - :arg include_segment_file_sizes: Whether to report the + metrics. + :arg completion_fields: Comma-separated list or wildcard + expressions of fields to include in fielddata and suggest statistics. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg expand_wildcards: Type of index that wildcard patterns can + match. If the request can target data streams, this argumentdetermines + whether wildcard expressions match hidden data streams. Supports comma- + separated values,such as `open,hidden`. Valid choices are all, open, + closed, hidden, none. + :arg fielddata_fields: Comma-separated list or wildcard + expressions of fields to include in fielddata statistics. + :arg fields: Comma-separated list or wildcard expressions of + fields to include in the statistics. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg forbid_closed_indices: If true, statistics are not + collected from closed indices. + :arg groups: Comma-separated list of search groups to include in + the search statistics. + :arg human: Whether to return human readable values for + statistics. + :arg include_segment_file_sizes: If true, the call reports the aggregated disk usage of each one of the Lucene index files (only - applies if segment stats are requested). Default is false. - :arg include_unloaded_segments: If set to true segment stats - will include stats for segments that are not currently loaded into - memory. Default is false. - :arg level: Return stats aggregated at cluster, index or shard - level. Valid choices are cluster, indices, shards. + applies if segment stats are requested). + :arg include_unloaded_segments: If true, the response includes + information from segments that are not loaded into memory. + :arg level: Indicates whether statistics are aggregated at the + cluster, index, or shard level. Valid choices are cluster, indices, + shards. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path(index, "_stats", metric), params=params, headers=headers ) @query_params( - "allow_no_indices", "expand_wildcards", "ignore_unavailable", "verbose" + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "source", + "verbose", ) def segments( self, @@ -1023,18 +1577,32 @@ def segments( Provides low-level information about segments in a Lucene index. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg verbose: Includes detailed memory usage by Lucene. Default - is false. + :arg 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`. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg verbose: If `true`, the request returns a verbose response. """ return self.transport.perform_request( "GET", _make_path(index, "_segments"), params=params, headers=headers @@ -1047,12 +1615,17 @@ def segments( "analyzer", "default_operator", "df", + "error_trace", "expand_wildcards", "explain", + "filter_path", + "human", "ignore_unavailable", "lenient", + "pretty", "q", "rewrite", + "source", ) def validate_query( self, @@ -1066,31 +1639,50 @@ def validate_query( :arg body: The query definition specified with the Query DSL - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg all_shards: Execute validation on all shards instead of one - random shard per index. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed. Default is false. - :arg analyzer: The analyzer to use for the query string. + :arg 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`. + :arg all_shards: If `true`, the validation is executed on all + shards instead of one random shard per index. + :arg 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. + :arg analyze_wildcard: If `true`, wildcard and prefix queries + are analyzed. + :arg analyzer: Analyzer to use for the query string.This + parameter can only be used when the `q` query string parameter is + specified. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. - :arg df: The field to use as default where no field prefix is - given in the query string. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg explain: Return detailed information about the error. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored. + query: `AND` or `OR`. Valid choices are and, or. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg explain: If `true`, the response returns detailed + information if an error has occurred. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg lenient: If `true`, format-based query failures (such as + providing text to a numeric field) in the query string will be ignored. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. - :arg rewrite: Provide a more detailed explanation showing the - actual Lucene query that will be executed. + :arg rewrite: If `true`, returns a more detailed explanation + showing the actual Lucene query that will be executed. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "POST", @@ -1102,12 +1694,17 @@ def validate_query( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", "fielddata", "fields", + "filter_path", + "human", "ignore_unavailable", + "pretty", "query", "request", + "source", ) def clear_cache( self, @@ -1121,25 +1718,48 @@ def clear_cache( :arg index: Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg fielddata: Clear field data. - :arg fields: Comma-separated list of fields to clear when using - the `fielddata` parameter (default: all). - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg query: Clear query caches. - :arg request: Clear request cache. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg fielddata: If `true`, clears the fields cache.Use the + `fields` parameter to clear the cache of specific fields only. + :arg fields: Comma-separated list of field names used to limit + the `fielddata` parameter. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If `false`, the request returns an + error if it targets a missing or closed index. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg query: If `true`, clears the query cache. + :arg request: If `true`, clears the request cache. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "POST", _make_path(index, "_cache", "clear"), params=params, headers=headers ) - @query_params("active_only", "detailed") + @query_params( + "active_only", + "detailed", + "error_trace", + "filter_path", + "human", + "pretty", + "source", + ) def recovery( self, index: Any = None, @@ -1150,12 +1770,23 @@ def recovery( Returns information about ongoing index shard recoveries. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg active_only: Display only those recoveries that are - currently on-going. Default is false. - :arg detailed: Whether to display detailed information about - shard recovery. Default is false. + :arg 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`. + :arg active_only: If `true`, the response only includes ongoing + shard recoveries. + :arg detailed: If `true`, the response includes detailed + information about shard recoveries. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path(index, "_recovery"), params=params, headers=headers @@ -1163,9 +1794,14 @@ def recovery( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "only_ancient_segments", + "pretty", + "source", "wait_for_completion", ) def upgrade( @@ -1183,13 +1819,23 @@ def upgrade( :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified). + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed). :arg only_ancient_segments: If true, only ancient (an older Lucene major release) segments will be upgraded. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is false. """ @@ -1197,7 +1843,16 @@ def upgrade( "POST", _make_path(index, "_upgrade"), params=params, headers=headers ) - @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") + @query_params( + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "source", + ) def get_upgrade( self, index: Any = None, @@ -1213,18 +1868,36 @@ def get_upgrade( :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified). + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed). + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path(index, "_upgrade"), params=params, headers=headers ) @query_params( - "allow_no_indices", "expand_wildcards", "ignore_unavailable", "status" + "allow_no_indices", + "error_trace", + "expand_wildcards", + "filter_path", + "human", + "ignore_unavailable", + "pretty", + "source", + "status", ) def shard_stores( self, @@ -1236,18 +1909,30 @@ def shard_stores( Provides store information for shard copies of indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). - :arg status: Comma-separated list of statuses used to filter on - shards to get store information for. + :arg index: List of data streams, indices, and aliases used to + limit the request. + :arg allow_no_indices: If false, the request returns an error if + any wildcard expression, index alias, or _allvalue targets only missing + or closed indices. This behavior applies even if the requesttargets + other open indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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. Valid choices + are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If true, missing or closed indices are + not included in the response. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg status: List of shard health statuses used to limit the + request. """ return self.transport.perform_request( "GET", _make_path(index, "_shard_stores"), params=params, headers=headers @@ -1255,12 +1940,17 @@ def shard_stores( @query_params( "allow_no_indices", + "error_trace", "expand_wildcards", + "filter_path", "flush", + "human", "ignore_unavailable", "max_num_segments", "only_expunge_deletes", + "pretty", "primary_only", + "source", "wait_for_completion", ) def forcemerge( @@ -1273,26 +1963,36 @@ def forcemerge( Performs the force merge operation on one or more indices. - :arg index: Comma-separated list of indices; use `_all` or empty - string to perform the operation on all indices. + :arg index: A comma-separated list of index names; use `_all` or + empty string to perform the operation on all indices :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + string or when no indices have been specified) + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg flush: Specify whether the index should be flushed after - performing the operation. Default is True. + performing the operation (default: true) + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + should be ignored when unavailable (missing or closed) :arg max_num_segments: The number of segments the index should - be merged into (default: dynamic). + be merged into (default: dynamic) :arg only_expunge_deletes: Specify whether the operation should - only expunge deleted documents. + only expunge deleted documents + :arg pretty: Whether to pretty format the returned JSON + response. :arg primary_only: Specify whether the operation should only perform on primary shards. Defaults to false. Default is false. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is True. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg wait_for_completion: Should the request wait until the + force merge is completed. """ return self.transport.perform_request( "POST", _make_path(index, "_forcemerge"), params=params, headers=headers @@ -1301,7 +2001,12 @@ def forcemerge( @query_params( "cluster_manager_timeout", "copy_settings", + "error_trace", + "filter_path", + "human", "master_timeout", + "pretty", + "source", "task_execution_timeout", "timeout", "wait_for_active_shards", @@ -1319,22 +2024,37 @@ def shrink( Allow to shrink an existing index into a new index with fewer primary shards. - :arg index: The name of the source index to shrink. - :arg target: The name of the target index. + :arg index: Name of the source index to shrink. + :arg target: Name of the target index to create. :arg body: The configuration for the target index (`settings` and `aliases`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg copy_settings: whether or not to copy settings from the source index. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg task_execution_timeout: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for on the shrunken index before the operation returns. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg 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`). Valid choices are all, index-setting. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -1353,7 +2073,12 @@ def shrink( @query_params( "cluster_manager_timeout", "copy_settings", + "error_trace", + "filter_path", + "human", "master_timeout", + "pretty", + "source", "task_execution_timeout", "timeout", "wait_for_active_shards", @@ -1372,22 +2097,37 @@ def split( shards. - :arg index: The name of the source index to split. - :arg target: The name of the target index. + :arg index: Name of the source index to split. + :arg target: Name of the target index to create. :arg body: The configuration for the target index (`settings` and `aliases`) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg copy_settings: whether or not to copy settings from the source index. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg task_execution_timeout: Explicit task execution timeout, only useful when wait_for_completion is false, defaults to 1h. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for on the shrunken index before the operation returns. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg 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`). Valid choices are all, index-setting. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -1406,7 +2146,12 @@ def split( @query_params( "cluster_manager_timeout", "dry_run", + "error_trace", + "filter_path", + "human", "master_timeout", + "pretty", + "source", "timeout", "wait_for_active_shards", ) @@ -1423,22 +2168,36 @@ def rollover( to be too large or too old. - :arg alias: The name of the alias to rollover. + :arg alias: Name of the data stream or index alias to roll over. :arg body: The conditions that needs to be met for executing rollover - :arg new_index: The name of the rollover index. + :arg new_index: Name of the index to create. Supports date math. + Data streams do not support this parameter. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg dry_run: If set to true the rollover action will only be - validated but not actually performed even if a condition matches. - Default is false. + :arg dry_run: If `true`, checks whether the current index + satisfies the specified conditions but does not perform a rollover. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg wait_for_active_shards: Set the number of active shards to - wait for on the newly created rollover index before the operation - returns. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg 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`). Valid choices are all, index-setting. """ if alias in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'alias'.") @@ -1451,7 +2210,7 @@ def rollover( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def create_data_stream( self, name: Any, @@ -1463,8 +2222,23 @@ def create_data_stream( Creates or updates a data stream. - :arg name: The name of the data stream. + :arg name: Name of the data stream, which must meet the + following criteria: Lowercase only; Cannot include `/`, `*`, `?`, `"`, + `<`, `>`, `|`, `,`, `#`, `:`, backslash, 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. :arg body: The data stream definition + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1477,7 +2251,7 @@ def create_data_stream( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_data_stream( self, name: Any, @@ -1488,8 +2262,18 @@ def delete_data_stream( Deletes a data stream. - :arg name: Comma-separated list of data streams; use `_all` or - empty string to perform the operation on all data streams. + :arg name: Comma-separated list of data streams to delete. + Wildcard (`*`) expressions are supported. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1498,7 +2282,16 @@ def delete_data_stream( "DELETE", _make_path("_data_stream", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def delete_index_template( self, name: Any, @@ -1509,13 +2302,27 @@ def delete_index_template( Deletes an index template. - :arg name: The name of the template. + :arg name: Name of the index template to delete. Wildcard (*) + expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg 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 a required argument 'name'.") @@ -1527,7 +2334,17 @@ def delete_index_template( headers=headers, ) - @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) def exists_index_template( self, name: Any, @@ -1538,16 +2355,28 @@ def exists_index_template( Returns information about whether a particular index template exists. - :arg name: The name of the template. + :arg name: Name of the index template to check existence of. + Wildcard (*) expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg flat_settings: Return settings in flat format. Default is false. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1556,7 +2385,17 @@ def exists_index_template( "HEAD", _make_path("_index_template", name), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "flat_settings", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) def get_index_template( self, name: Any = None, @@ -1567,22 +2406,44 @@ def get_index_template( Returns an index template. - :arg name: Comma-separated names of the index templates. + :arg name: Name of the index template to retrieve. Wildcard (*) + expressions are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If true, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg local: If true, the request retrieves information from the + local node only. Defaults to false, which means information is retrieved + from the master node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path("_index_template", name), params=params, headers=headers ) - @query_params("cause", "cluster_manager_timeout", "create", "master_timeout") + @query_params( + "cause", + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) def put_index_template( self, name: Any, @@ -1594,17 +2455,27 @@ def put_index_template( Creates or updates an index template. - :arg name: The name of the template. + :arg name: Index or template name :arg body: The template definition :arg cause: User defined reason for creating/updating the index template. Default is false. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template should only be added if - new or can also replace an existing one. Default is false. + :arg create: If `true`, this request cannot replace or update + existing index templates. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, use 'cluster_manager_timeout' instead.): Operation timeout for connection to master node. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (name, body): if param in SKIP_IN_PATH: @@ -1618,7 +2489,17 @@ def put_index_template( body=body, ) - @query_params("cause", "cluster_manager_timeout", "create", "master_timeout") + @query_params( + "cause", + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) def simulate_index_template( self, name: Any, @@ -1631,20 +2512,32 @@ def simulate_index_template( system. - :arg name: The name of the index (it must be a concrete index - name). + :arg name: Index or template name to simulate :arg body: New index template definition, which will be included in the simulation, as if it already exists in the system :arg cause: User defined reason for dry-run creating the new template for simulation purposes. Default is false. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template we optionally defined in - the body should only be dry-run added if new or can also replace an - existing one. Default is false. + :arg create: If `true`, the template passed in the body is only + used if no existingtemplates match the same index patterns. If `false`, + the simulation usesthe template with the highest priority. Note that the + template is notpermanently added or updated in either case; it is only + used for thesimulation. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. If no response is receivedbefore the timeout + expires, the request fails and returns an error. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1657,7 +2550,7 @@ def simulate_index_template( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_data_stream( self, name: Any = None, @@ -1668,14 +2561,35 @@ def get_data_stream( Returns data streams. - :arg name: Comma-separated list of data streams; use `_all` or - empty string to perform the operation on all data streams. + :arg name: Comma-separated list of data stream names used to + limit the request. Wildcard (`*`) expressions are supported. If omitted, + all data streams are returned. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path("_data_stream", name), params=params, headers=headers ) - @query_params("cause", "cluster_manager_timeout", "create", "master_timeout") + @query_params( + "cause", + "cluster_manager_timeout", + "create", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) def simulate_template( self, body: Any = None, @@ -1687,19 +2601,32 @@ def simulate_template( Simulate resolving the given template name or body. - :arg body: New index template definition to be simulated, if no - index template name is specified - :arg name: The name of the template. + :arg 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 configuration in the request body. :arg cause: User defined reason for dry-run creating the new template for simulation purposes. Default is false. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg create: Whether the index template we optionally defined in - the body should only be dry-run added if new or can also replace an - existing one. Default is false. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "POST", @@ -1709,7 +2636,9 @@ def simulate_template( body=body, ) - @query_params("expand_wildcards") + @query_params( + "error_trace", "expand_wildcards", "filter_path", "human", "pretty", "source" + ) def resolve_index( self, name: Any, @@ -1720,11 +2649,25 @@ def resolve_index( Returns information about any matching indices, aliases, and data streams. - :arg name: Comma-separated list of names or wildcard - expressions. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices are all, - open, closed, hidden, none. + :arg 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. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg 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`. Valid choices are all, open, closed, hidden, + none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1736,9 +2679,14 @@ def resolve_index( @query_params( "allow_no_indices", "cluster_manager_timeout", + "error_trace", "expand_wildcards", + "filter_path", + "human", "ignore_unavailable", "master_timeout", + "pretty", + "source", "timeout", ) def add_block( @@ -1752,23 +2700,33 @@ def add_block( Adds a block to an index. - :arg index: Comma-separated list of indices to add a block to. + :arg index: A comma separated list of indices to add a block to :arg block: The block to add (one of read, write, read_only or - metadata). + metadata) :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified). + string or when no indices have been specified) :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). + should be ignored when unavailable (missing or closed) :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Specify timeout for connection + to master + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ for param in (index, block): if param in SKIP_IN_PATH: @@ -1778,7 +2736,7 @@ def add_block( "PUT", _make_path(index, "_block", block), params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def data_streams_stats( self, name: Any = None, @@ -1789,8 +2747,19 @@ def data_streams_stats( Provides statistics on operations happening in a data stream. - :arg name: Comma-separated list of data streams; use `_all` or - empty string to perform the operation on all data streams. + :arg 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 `*`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", diff --git a/opensearchpy/client/ingest.py b/opensearchpy/client/ingest.py index 632a23d9..4b11d5c5 100644 --- a/opensearchpy/client/ingest.py +++ b/opensearchpy/client/ingest.py @@ -40,7 +40,15 @@ class IngestClient(NamespacedClient): - @query_params("cluster_manager_timeout", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) def get_pipeline( self, id: Any = None, @@ -51,19 +59,40 @@ def get_pipeline( Returns a pipeline. - :arg id: Comma-separated list of pipeline ids. Wildcards - supported. + :arg id: Comma-separated list of pipeline IDs to retrieve. + Wildcard (`*`) expressions are supported. To get all ingest pipelines, + omit this parameter or use `*`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path("_ingest", "pipeline", id), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def put_pipeline( self, id: Any, @@ -75,14 +104,27 @@ def put_pipeline( Creates or updates a pipeline. - :arg id: Pipeline ID. + :arg id: ID of the ingest pipeline to create or update. :arg body: The ingest definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. """ for param in (id, body): if param in SKIP_IN_PATH: @@ -96,7 +138,16 @@ def put_pipeline( body=body, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def delete_pipeline( self, id: Any, @@ -107,13 +158,28 @@ def delete_pipeline( Deletes a pipeline. - :arg id: Pipeline ID. + :arg 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 `*`. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg 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 a required argument 'id'.") @@ -125,7 +191,7 @@ def delete_pipeline( headers=headers, ) - @query_params("verbose") + @query_params("error_trace", "filter_path", "human", "pretty", "source", "verbose") def simulate( self, body: Any, @@ -138,9 +204,20 @@ def simulate( :arg body: The simulate definition - :arg id: Pipeline ID. - :arg verbose: Verbose mode. Display data output for each - processor in executed pipeline. Default is false. + :arg id: Pipeline to test. If you don’t specify a `pipeline` in + the request body, this parameter is required. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg verbose: If `true`, the response includes output data for + each processor in the executed pipeline. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -153,7 +230,7 @@ def simulate( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def processor_grok( self, params: Any = None, @@ -162,6 +239,17 @@ def processor_grok( """ Returns a list of the built-in patterns. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_ingest/processor/grok", params=params, headers=headers diff --git a/opensearchpy/client/nodes.py b/opensearchpy/client/nodes.py index ea2d4b47..eb224d49 100644 --- a/opensearchpy/client/nodes.py +++ b/opensearchpy/client/nodes.py @@ -40,7 +40,7 @@ class NodesClient(NamespacedClient): - @query_params("timeout") + @query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout") def reload_secure_settings( self, body: Any = None, @@ -54,10 +54,21 @@ def reload_secure_settings( :arg body: An object containing the password for the opensearch keystore - :arg node_id: Comma-separated list of node IDs to span the - reload/reinit call. Should stay empty because reloading usually involves - all cluster nodes. - :arg timeout: Operation timeout. + :arg node_id: The names of particular nodes in the cluster to + target. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ return self.transport.perform_request( "POST", @@ -67,7 +78,15 @@ def reload_secure_settings( body=body, ) - @query_params("flat_settings", "timeout") + @query_params( + "error_trace", + "filter_path", + "flat_settings", + "human", + "pretty", + "source", + "timeout", + ) def info( self, node_id: Any = None, @@ -79,16 +98,24 @@ def info( Returns information about nodes in the cluster. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. - :arg metric: Comma-separated list of metrics you wish returned. - Leave empty to return all. Valid choices are settings, os, process, jvm, - thread_pool, transport, http, plugins, ingest. - :arg flat_settings: Return settings in flat format. Default is - false. - :arg timeout: Operation timeout. + :arg node_id: Comma-separated list of node IDs or names used to + limit returned information. + :arg metric: Limits the information returned to the specific + metrics. Supports a comma-separated list, such as http,ingest. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg flat_settings: If true, returns settings in flat format. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. """ return self.transport.perform_request( "GET", _make_path("_nodes", node_id, metric), params=params, headers=headers @@ -96,11 +123,16 @@ def info( @query_params( "completion_fields", + "error_trace", "fielddata_fields", "fields", + "filter_path", "groups", + "human", "include_segment_file_sizes", "level", + "pretty", + "source", "timeout", "types", ) @@ -116,35 +148,42 @@ def stats( Returns statistical information about nodes in the cluster. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. + :arg node_id: Comma-separated list of node IDs or names used to + limit returned information. :arg metric: Limit the information returned to the specified - metrics. Valid choices are _all, breaker, fs, http, indices, jvm, os, - process, thread_pool, transport, discovery, indexing_pressure, - search_pipeline. - :arg index_metric: Limit the information returned for `indices` - metric to the specific index metrics. Isn't used if `indices` (or `all`) - metric isn't specified. Valid choices are _all, store, indexing, get, - search, merge, flush, refresh, query_cache, fielddata, docs, warmer, - completion, segments, translog, suggest, request_cache, recovery. - :arg completion_fields: Comma-separated list of fields for - `fielddata` and `suggest` index metric (supports wildcards). - :arg fielddata_fields: Comma-separated list of fields for - `fielddata` index metric (supports wildcards). - :arg fields: Comma-separated list of fields for `fielddata` and - `completion` index metric (supports wildcards). - :arg groups: Comma-separated list of search groups for `search` - index metric. - :arg include_segment_file_sizes: Whether to report the + metrics + :arg index_metric: Limit the information returned for indices + metric to the specific index metrics. It can be used only if indices (or + all) metric is specified. + :arg completion_fields: Comma-separated list or wildcard + expressions of fields to include in fielddata and suggest statistics. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg fielddata_fields: Comma-separated list or wildcard + expressions of fields to include in fielddata statistics. + :arg fields: Comma-separated list or wildcard expressions of + fields to include in the statistics. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg groups: Comma-separated list of search groups to include in + the search statistics. + :arg human: Whether to return human readable values for + statistics. + :arg include_segment_file_sizes: If true, the call reports the aggregated disk usage of each one of the Lucene index files (only - applies if segment stats are requested). Default is false. - :arg level: Return indices stats aggregated at index, node or - shard level. Valid choices are indices, node, shards. - :arg timeout: Operation timeout. - :arg types: Comma-separated list of document types for the - `indexing` index metric. + applies if segment stats are requested). + :arg level: Indicates whether statistics are aggregated at the + cluster, index, or shard level. Valid choices are cluster, indices, + shards. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. + :arg types: A comma-separated list of document types for the + indexing index metric. """ return self.transport.perform_request( "GET", @@ -154,7 +193,17 @@ def stats( ) @query_params( - "doc_type", "ignore_idle_threads", "interval", "snapshots", "threads", "timeout" + "doc_type", + "error_trace", + "filter_path", + "human", + "ignore_idle_threads", + "interval", + "pretty", + "snapshots", + "source", + "threads", + "timeout", ) def hot_threads( self, @@ -172,12 +221,22 @@ def hot_threads( nodes. :arg doc_type: The type to sample. Valid choices are cpu, wait, block. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_idle_threads: Don't show threads that are in known- idle places, such as waiting on a socket select or pulling from an empty task queue. Default is True. :arg interval: The interval for the second sampling of threads. + :arg pretty: Whether to pretty format the returned JSON + response. :arg snapshots: Number of samples of thread stacktrace. Default is 10. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg threads: Specify the number of threads to provide information for. Default is 3. :arg timeout: Operation timeout. @@ -193,7 +252,7 @@ def hot_threads( headers=headers, ) - @query_params("timeout") + @query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout") def usage( self, node_id: Any = None, @@ -205,13 +264,26 @@ def usage( Returns low-level information about REST actions usage on nodes. - :arg node_id: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. - :arg metric: Limit the information returned to the specified - metrics. Valid choices are _all, rest_actions. - :arg timeout: Operation timeout. + :arg node_id: A comma-separated list of node IDs or names to + limit the returned information; use `_local` to return information from + the node you're connecting to, leave empty to get information from all + nodes + :arg metric: Limits the information returned to the specific + metrics. A comma-separated list of the following options: `_all`, + `rest_actions`. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. """ return self.transport.perform_request( "GET", diff --git a/opensearchpy/client/plugins.py b/opensearchpy/client/plugins.py index 85faf661..fe82ff87 100644 --- a/opensearchpy/client/plugins.py +++ b/opensearchpy/client/plugins.py @@ -13,6 +13,7 @@ from ..plugins.alerting import AlertingClient from ..plugins.index_management import IndexManagementClient from ..plugins.knn import KnnClient +from ..plugins.notifications import NotificationsClient from .client import Client from .utils import NamespacedClient @@ -23,6 +24,7 @@ class PluginsClient(NamespacedClient): def __init__(self, client: Client) -> None: super(PluginsClient, self).__init__(client) + self.notifications = NotificationsClient(client) self.knn = KnnClient(client) # self.query_workbench = QueryWorkbenchClient(client) # self.reporting = ReportingClient(client) diff --git a/opensearchpy/client/remote_store.py b/opensearchpy/client/remote_store.py index 55d8fd6e..20e22eae 100644 --- a/opensearchpy/client/remote_store.py +++ b/opensearchpy/client/remote_store.py @@ -22,7 +22,15 @@ class RemoteStoreClient(NamespacedClient): - @query_params("cluster_manager_timeout", "wait_for_completion") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "pretty", + "source", + "wait_for_completion", + ) def restore( self, body: Any, @@ -36,6 +44,16 @@ def restore( :arg body: Comma-separated list of index IDs :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is false. """ diff --git a/opensearchpy/client/search_pipeline.py b/opensearchpy/client/search_pipeline.py new file mode 100644 index 00000000..36460aff --- /dev/null +++ b/opensearchpy/client/search_pipeline.py @@ -0,0 +1,90 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. +# +# Modifications Copyright OpenSearch Contributors. See +# GitHub history for details. + +# ------------------------------------------------------------------------------------------ +# THIS CODE IS AUTOMATICALLY GENERATED AND MANUAL EDITS WILL BE LOST +# +# To contribute, kindly make modifications in the opensearch-py client generator +# or in the OpenSearch API specification, and run `nox -rs generate`. See DEVELOPER_GUIDE.md +# and https://github.com/opensearch-project/opensearch-api-specification for details. +# -----------------------------------------------------------------------------------------+ + + +from typing import Any + +from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params + + +class SearchPipelineClient(NamespacedClient): + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def create( + self, + pipeline: Any, + body: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Creates or replaces the specified search pipeline. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + for param in (pipeline, body): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return self.transport.perform_request( + "PUT", + _make_path("_search", "pipeline", pipeline), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get( + self, + pipeline: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Retrieves information about a specified search pipeline. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if pipeline in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'pipeline'.") + + return self.transport.perform_request( + "GET", + _make_path("_search", "pipeline", pipeline), + params=params, + headers=headers, + ) diff --git a/opensearchpy/client/security.py b/opensearchpy/client/security.py index 66a365fd..b2945fc0 100644 --- a/opensearchpy/client/security.py +++ b/opensearchpy/client/security.py @@ -24,7 +24,7 @@ class SecurityClient(NamespacedClient): from ._patch import health_check, update_audit_config # type: ignore - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_account_details( self, params: Any = None, @@ -33,12 +33,23 @@ def get_account_details( """ Returns account details for the current user. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_plugins/_security/api/account", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def change_password( self, body: Any, @@ -49,6 +60,16 @@ def change_password( Changes the password for the current user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -61,7 +82,7 @@ def change_password( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_action_group( self, action_group: Any, @@ -73,6 +94,16 @@ def get_action_group( :arg action_group: Action group to retrieve. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if action_group in SKIP_IN_PATH: raise ValueError( @@ -86,7 +117,7 @@ def get_action_group( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_action_groups( self, params: Any = None, @@ -95,6 +126,17 @@ def get_action_groups( """ Retrieves all action groups. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", @@ -103,7 +145,7 @@ def get_action_groups( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_action_group( self, action_group: Any, @@ -115,6 +157,16 @@ def delete_action_group( :arg action_group: Action group to delete. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if action_group in SKIP_IN_PATH: raise ValueError( @@ -128,7 +180,7 @@ def delete_action_group( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def create_action_group( self, action_group: Any, @@ -142,6 +194,16 @@ def create_action_group( :arg action_group: The name of the action group to create or replace + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (action_group, body): if param in SKIP_IN_PATH: @@ -155,7 +217,7 @@ def create_action_group( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_action_group( self, action_group: Any, @@ -167,6 +229,16 @@ def patch_action_group( Updates individual attributes of an action group. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (action_group, body): if param in SKIP_IN_PATH: @@ -180,7 +252,7 @@ def patch_action_group( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_action_groups( self, body: Any, @@ -191,6 +263,16 @@ def patch_action_groups( Creates, updates, or deletes multiple action groups in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -203,7 +285,7 @@ def patch_action_groups( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_user( self, username: Any, @@ -214,6 +296,16 @@ def get_user( Retrieve one internal user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'username'.") @@ -225,7 +317,7 @@ def get_user( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_users( self, params: Any = None, @@ -234,6 +326,17 @@ def get_users( """ Retrieve all internal users. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", @@ -242,7 +345,7 @@ def get_users( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_user( self, username: Any, @@ -253,6 +356,16 @@ def delete_user( Delete the specified user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'username'.") @@ -264,7 +377,7 @@ def delete_user( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def create_user( self, username: Any, @@ -276,6 +389,16 @@ def create_user( Creates or replaces the specified user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (username, body): if param in SKIP_IN_PATH: @@ -289,7 +412,7 @@ def create_user( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_user( self, username: Any, @@ -301,6 +424,16 @@ def patch_user( Updates individual attributes of an internal user. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (username, body): if param in SKIP_IN_PATH: @@ -314,7 +447,7 @@ def patch_user( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_users( self, body: Any, @@ -325,6 +458,16 @@ def patch_users( Creates, updates, or deletes multiple internal users in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -337,7 +480,7 @@ def patch_users( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_role( self, role: Any, @@ -348,6 +491,16 @@ def get_role( Retrieves one role. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -359,7 +512,7 @@ def get_role( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_roles( self, params: Any = None, @@ -368,12 +521,23 @@ def get_roles( """ Retrieves all roles. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_plugins/_security/api/roles/", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_role( self, role: Any, @@ -384,6 +548,16 @@ def delete_role( Delete the specified role. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -395,7 +569,7 @@ def delete_role( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def create_role( self, role: Any, @@ -407,6 +581,16 @@ def create_role( Creates or replaces the specified role. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (role, body): if param in SKIP_IN_PATH: @@ -420,7 +604,7 @@ def create_role( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_role( self, role: Any, @@ -432,6 +616,16 @@ def patch_role( Updates individual attributes of a role. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (role, body): if param in SKIP_IN_PATH: @@ -445,7 +639,7 @@ def patch_role( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_roles( self, body: Any, @@ -456,6 +650,16 @@ def patch_roles( Creates, updates, or deletes multiple roles in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -468,7 +672,7 @@ def patch_roles( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_role_mapping( self, role: Any, @@ -479,6 +683,16 @@ def get_role_mapping( Retrieves one role mapping. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -490,7 +704,7 @@ def get_role_mapping( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_role_mappings( self, params: Any = None, @@ -499,6 +713,17 @@ def get_role_mappings( """ Retrieves all role mappings. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", @@ -507,7 +732,7 @@ def get_role_mappings( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_role_mapping( self, role: Any, @@ -518,6 +743,16 @@ def delete_role_mapping( Deletes the specified role mapping. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -529,7 +764,7 @@ def delete_role_mapping( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def create_role_mapping( self, role: Any, @@ -541,6 +776,16 @@ def create_role_mapping( Creates or replaces the specified role mapping. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (role, body): if param in SKIP_IN_PATH: @@ -554,7 +799,7 @@ def create_role_mapping( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_role_mapping( self, role: Any, @@ -566,6 +811,16 @@ def patch_role_mapping( Updates individual attributes of a role mapping. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (role, body): if param in SKIP_IN_PATH: @@ -579,7 +834,7 @@ def patch_role_mapping( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_role_mappings( self, body: Any, @@ -590,6 +845,16 @@ def patch_role_mappings( Creates or updates multiple role mappings in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -602,7 +867,7 @@ def patch_role_mappings( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_tenant( self, tenant: Any, @@ -613,6 +878,16 @@ def get_tenant( Retrieves one tenant. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if tenant in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'tenant'.") @@ -624,7 +899,7 @@ def get_tenant( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_tenants( self, params: Any = None, @@ -633,12 +908,23 @@ def get_tenants( """ Retrieves all tenants. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_plugins/_security/api/tenants/", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_tenant( self, tenant: Any, @@ -649,6 +935,16 @@ def delete_tenant( Delete the specified tenant. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if tenant in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'tenant'.") @@ -660,7 +956,7 @@ def delete_tenant( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def create_tenant( self, tenant: Any, @@ -672,6 +968,16 @@ def create_tenant( Creates or replaces the specified tenant. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (tenant, body): if param in SKIP_IN_PATH: @@ -685,7 +991,7 @@ def create_tenant( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_tenant( self, tenant: Any, @@ -697,6 +1003,16 @@ def patch_tenant( Add, delete, or modify a single tenant. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (tenant, body): if param in SKIP_IN_PATH: @@ -710,7 +1026,7 @@ def patch_tenant( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_tenants( self, body: Any, @@ -721,6 +1037,16 @@ def patch_tenants( Add, delete, or modify multiple tenants in a single call. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -733,7 +1059,7 @@ def patch_tenants( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_configuration( self, params: Any = None, @@ -742,6 +1068,17 @@ def get_configuration( """ Returns the current Security plugin configuration in JSON format. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", @@ -750,7 +1087,7 @@ def get_configuration( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def update_configuration( self, body: Any, @@ -761,6 +1098,16 @@ def update_configuration( Adds or updates the existing configuration using the REST API. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -773,7 +1120,7 @@ def update_configuration( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_configuration( self, body: Any, @@ -784,6 +1131,16 @@ def patch_configuration( A PATCH call is used to update the existing configuration using the REST API. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -796,7 +1153,7 @@ def patch_configuration( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_distinguished_names( self, cluster_name: Any = None, @@ -804,9 +1161,19 @@ def get_distinguished_names( headers: Any = None, ) -> Any: """ - Retrieves all distinguished names in the allow list. + Retrieves distinguished names. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", @@ -815,7 +1182,7 @@ def get_distinguished_names( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def update_distinguished_names( self, cluster_name: Any, @@ -828,6 +1195,16 @@ def update_distinguished_names( allow list. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if cluster_name in SKIP_IN_PATH: raise ValueError( @@ -842,7 +1219,7 @@ def update_distinguished_names( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_distinguished_names( self, cluster_name: Any, @@ -854,6 +1231,16 @@ def delete_distinguished_names( list. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if cluster_name in SKIP_IN_PATH: raise ValueError( @@ -867,7 +1254,7 @@ def delete_distinguished_names( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_certificates( self, params: Any = None, @@ -876,12 +1263,23 @@ def get_certificates( """ Retrieves the cluster’s security certificates. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_plugins/_security/api/ssl/certs", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def reload_transport_certificates( self, params: Any = None, @@ -890,6 +1288,17 @@ def reload_transport_certificates( """ Reload transport layer communication certificates. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "PUT", @@ -898,7 +1307,7 @@ def reload_transport_certificates( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def reload_http_certificates( self, params: Any = None, @@ -907,6 +1316,17 @@ def reload_http_certificates( """ Reload HTTP layer communication certificates. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "PUT", @@ -915,7 +1335,7 @@ def reload_http_certificates( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def flush_cache( self, params: Any = None, @@ -924,12 +1344,23 @@ def flush_cache( """ Flushes the Security plugin user, authentication, and authorization cache. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "DELETE", "/_plugins/_security/api/cache", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def health( self, params: Any = None, @@ -938,12 +1369,23 @@ def health( """ Checks to see if the Security plugin is up and running. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_plugins/_security/health", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_audit_configuration( self, params: Any = None, @@ -952,12 +1394,23 @@ def get_audit_configuration( """ Retrieves the audit configuration. + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", "/_plugins/_security/api/audit", params=params, headers=headers ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def update_audit_configuration( self, body: Any, @@ -968,6 +1421,16 @@ def update_audit_configuration( Updates the audit configuration. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -980,7 +1443,7 @@ def update_audit_configuration( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_audit_configuration( self, body: Any, @@ -991,6 +1454,16 @@ def patch_audit_configuration( A PATCH call is used to update specified fields in the audit configuration. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1003,7 +1476,7 @@ def patch_audit_configuration( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def patch_distinguished_names( self, body: Any, @@ -1014,6 +1487,16 @@ def patch_distinguished_names( Bulk update of distinguished names. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") diff --git a/opensearchpy/client/snapshot.py b/opensearchpy/client/snapshot.py index eecd15a9..7e57e474 100644 --- a/opensearchpy/client/snapshot.py +++ b/opensearchpy/client/snapshot.py @@ -40,7 +40,16 @@ class SnapshotClient(NamespacedClient): - @query_params("cluster_manager_timeout", "master_timeout", "wait_for_completion") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "wait_for_completion", + ) def create( self, repository: Any, @@ -53,16 +62,29 @@ def create( Creates a snapshot in a repository. - :arg repository: Repository name. - :arg snapshot: Snapshot name. + :arg repository: Repository for the snapshot. + :arg snapshot: Name of the snapshot. Must be unique in the + repository. :arg body: The snapshot definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg wait_for_completion: If `true`, the request returns a + response when the snapshot is complete. If `false`, the request returns + a response when the snapshot initializes. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -76,7 +98,15 @@ def create( body=body, ) - @query_params("cluster_manager_timeout", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) def delete( self, repository: Any, @@ -88,13 +118,23 @@ def delete( Deletes a snapshot. - :arg repository: Repository name. - :arg snapshot: Snapshot name. + :arg repository: A repository name + :arg snapshot: A comma-separated list of snapshot names :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -108,7 +148,15 @@ def delete( ) @query_params( - "cluster_manager_timeout", "ignore_unavailable", "master_timeout", "verbose" + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "ignore_unavailable", + "master_timeout", + "pretty", + "source", + "verbose", ) def get( self, @@ -121,18 +169,35 @@ def get( Returns information about a snapshot. - :arg repository: Repository name. - :arg snapshot: Comma-separated list of snapshot names. + :arg repository: Comma-separated list of snapshot repository + names used to limit the request. Wildcard (*) expressions are supported. + :arg snapshot: Comma-separated list of snapshot names to + retrieve. Also accepts wildcards (*). - To get information about all + snapshots in a registered repository, use a wildcard (*) or _all. - To + get information about any snapshots that are currently running, use + _current. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg ignore_unavailable: Whether to ignore unavailable - snapshots, defaults to false which means a SnapshotMissingException is - thrown. Default is false. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg ignore_unavailable: If false, the request returns an error + for any snapshots that are unavailable. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg verbose: Whether to show verbose snapshot info or only show - the basic info found in the repository index blob. + use 'cluster_manager_timeout' instead.): 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. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg verbose: If true, returns additional information about each + snapshot such as the version of Opensearch which took the snapshot, the + start and end times of the snapshot, and the number of shards + snapshotted. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -145,7 +210,16 @@ def get( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def delete_repository( self, repository: Any, @@ -160,10 +234,20 @@ def delete_repository( Wildcard (`*`) patterns are supported. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -175,7 +259,16 @@ def delete_repository( headers=headers, ) - @query_params("cluster_manager_timeout", "local", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "local", + "master_timeout", + "pretty", + "source", + ) def get_repository( self, repository: Any = None, @@ -186,20 +279,40 @@ def get_repository( Returns information about a repository. - :arg repository: Comma-separated list of repository names. + :arg repository: A comma-separated list of repository names :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + from cluster-manager node (default: false) :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", _make_path("_snapshot", repository), params=params, headers=headers ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout", "verify") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + "verify", + ) def create_repository( self, repository: Any, @@ -211,15 +324,25 @@ def create_repository( Creates a repository. - :arg repository: Repository name. + :arg repository: A repository name :arg body: The repository definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. - :arg verify: Whether to verify the repository after creation. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout + :arg verify: Whether to verify the repository after creation """ for param in (repository, body): if param in SKIP_IN_PATH: @@ -233,7 +356,16 @@ def create_repository( body=body, ) - @query_params("cluster_manager_timeout", "master_timeout", "wait_for_completion") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "wait_for_completion", + ) def restore( self, repository: Any, @@ -246,16 +378,26 @@ def restore( Restores a snapshot. - :arg repository: Repository name. - :arg snapshot: Snapshot name. + :arg repository: A repository name + :arg snapshot: A snapshot name :arg body: Details of what to restore :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + operation has completed before returning """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -269,7 +411,16 @@ def restore( body=body, ) - @query_params("cluster_manager_timeout", "ignore_unavailable", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "ignore_unavailable", + "master_timeout", + "pretty", + "source", + ) def status( self, repository: Any = None, @@ -281,16 +432,26 @@ def status( Returns information about the status of a snapshot. - :arg repository: Repository name. - :arg snapshot: Comma-separated list of snapshot names. + :arg repository: A repository name + :arg snapshot: A comma-separated list of snapshot names :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg ignore_unavailable: Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is - thrown. Default is false. + thrown :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( "GET", @@ -299,7 +460,16 @@ def status( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def verify_repository( self, repository: Any, @@ -310,13 +480,23 @@ def verify_repository( Verifies a repository. - :arg repository: Repository name. + :arg repository: A repository name :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Explicit operation timeout """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -328,7 +508,16 @@ def verify_repository( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout", "timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + "timeout", + ) def cleanup_repository( self, repository: Any, @@ -339,13 +528,23 @@ def cleanup_repository( Removes stale data from repository. - :arg repository: Repository name. + :arg repository: Snapshot repository to clean up. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. - :arg timeout: Operation timeout. + use 'cluster_manager_timeout' instead.): Period to wait for a connection + to the master node. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -357,7 +556,15 @@ def cleanup_repository( headers=headers, ) - @query_params("cluster_manager_timeout", "master_timeout") + @query_params( + "cluster_manager_timeout", + "error_trace", + "filter_path", + "human", + "master_timeout", + "pretty", + "source", + ) def clone( self, repository: Any, @@ -371,15 +578,25 @@ def clone( Clones indices from one snapshot into another snapshot in the same repository. - :arg repository: Repository name. - :arg snapshot: Snapshot name. - :arg target_snapshot: The name of the cloned snapshot to create. + :arg repository: A repository name + :arg snapshot: The name of the snapshot to clone from + :arg target_snapshot: The name of the cloned snapshot to create :arg body: The snapshot clone definition :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead.): Operation timeout for - connection to master node. + use 'cluster_manager_timeout' instead.): Explicit operation timeout for + connection to master node + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ for param in (repository, snapshot, target_snapshot, body): if param in SKIP_IN_PATH: diff --git a/opensearchpy/client/tasks.py b/opensearchpy/client/tasks.py index 02a3eb0f..25eda7a1 100644 --- a/opensearchpy/client/tasks.py +++ b/opensearchpy/client/tasks.py @@ -44,9 +44,14 @@ class TasksClient(NamespacedClient): @query_params( "actions", "detailed", + "error_trace", + "filter_path", "group_by", + "human", "nodes", "parent_task_id", + "pretty", + "source", "timeout", "wait_for_completion", ) @@ -59,27 +64,50 @@ def list( Returns a list of tasks. - :arg actions: Comma-separated list of actions that should be - returned. Leave empty to return all. - :arg detailed: Return detailed task information. Default is - false. - :arg group_by: Group tasks by nodes or parent/child - relationships. Valid choices are nodes, parents, none. + :arg actions: Comma-separated list or wildcard expression of + actions used to limit the request. + :arg detailed: If `true`, the response includes detailed + information about shard recoveries. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg group_by: Key used to group tasks in the response. Valid + choices are nodes, parents, none. + :arg human: Whether to return human readable values for + statistics. :arg nodes: Comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. - :arg parent_task_id: Return tasks with specified parent task id - (node_id:task_number). Set to -1 to return all. - :arg timeout: Operation timeout. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + :arg parent_task_id: Parent task ID used to limit returned + information. To return all tasks, omit this parameter or use a value of + `-1`. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response. If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_completion: If `true`, the request blocks until + the operation is complete. """ return self.transport.perform_request( "GET", "/_tasks", params=params, headers=headers ) - @query_params("actions", "nodes", "parent_task_id", "wait_for_completion") + @query_params( + "actions", + "error_trace", + "filter_path", + "human", + "nodes", + "parent_task_id", + "pretty", + "source", + "wait_for_completion", + ) def cancel( self, task_id: Any = None, @@ -90,18 +118,25 @@ def cancel( Cancels a task, if it can be cancelled through an API. - :arg task_id: Cancel the task with specified task id - (node_id:task_number). - :arg actions: Comma-separated list of actions that should be - cancelled. Leave empty to cancel all. - :arg nodes: Comma-separated list of node IDs or names to limit - the returned information; use `_local` to return information from the - node you're connecting to, leave empty to get information from all - nodes. - :arg parent_task_id: Cancel tasks with specified parent task id - (node_id:task_number). Set to -1 to cancel all. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + :arg task_id: ID of the task. + :arg actions: Comma-separated list or wildcard expression of + actions used to limit the request. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg nodes: Comma-separated list of node IDs or names used to + limit the request. + :arg parent_task_id: Parent task ID used to limit the tasks. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg wait_for_completion: Should the request block until the + cancellation of the task and its descendant tasks is completed. Defaults + to false """ return self.transport.perform_request( "POST", @@ -110,7 +145,15 @@ def cancel( headers=headers, ) - @query_params("timeout", "wait_for_completion") + @query_params( + "error_trace", + "filter_path", + "human", + "pretty", + "source", + "timeout", + "wait_for_completion", + ) def get( self, task_id: Any = None, @@ -121,11 +164,22 @@ def get( Returns information about a task. - :arg task_id: Return the task with specified id - (node_id:task_number). - :arg timeout: Operation timeout. - :arg wait_for_completion: Should this request wait until the - operation has completed before returning. Default is false. + :arg task_id: ID of the task. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: Period to wait for a response.If no response is + received before the timeout expires, the request fails and returns an + error. + :arg wait_for_completion: If `true`, the request blocks until + the task has completed. """ if task_id in SKIP_IN_PATH: warnings.warn( diff --git a/opensearchpy/plugins/knn.py b/opensearchpy/plugins/knn.py index 43bd37dc..475492d2 100644 --- a/opensearchpy/plugins/knn.py +++ b/opensearchpy/plugins/knn.py @@ -22,7 +22,7 @@ class KnnClient(NamespacedClient): - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def delete_model( self, model_id: Any, @@ -34,6 +34,16 @@ def delete_model( :arg model_id: The id of the model. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'model_id'.") @@ -45,7 +55,7 @@ def delete_model( headers=headers, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def get_model( self, model_id: Any, @@ -57,6 +67,16 @@ def get_model( :arg model_id: The id of the model. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if model_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'model_id'.") @@ -81,15 +101,19 @@ def get_model( "default_operator", "df", "docvalue_fields", + "error_trace", "expand_wildcards", "explain", + "filter_path", "from_", + "human", "ignore_throttled", "ignore_unavailable", "lenient", "max_concurrent_shard_requests", "pre_filter_shard_size", "preference", + "pretty", "q", "request_cache", "rest_total_hits_as_int", @@ -99,6 +123,7 @@ def get_model( "seq_no_primary_term", "size", "sort", + "source", "stats", "stored_fields", "suggest_field", @@ -151,12 +176,18 @@ def search_models( given in the query string. :arg docvalue_fields: Comma-separated list of fields to return as the docvalue representation of a field for each hit. + :arg error_trace: Whether to include the stack trace of returned + errors. :arg expand_wildcards: Whether to expand wildcard expression to concrete indices that are open, closed or both. Valid choices are all, open, closed, hidden, none. :arg explain: Specify whether to return detailed information about score computation as part of a hit. + :arg filter_path: Comma-separated list of filters used to reduce + the response. :arg from_: Starting offset. Default is 0. + :arg human: Whether to return human readable values for + statistics. :arg ignore_throttled: Whether specified concrete, expanded or aliased indices should be ignored when throttled. :arg ignore_unavailable: Whether specified concrete indices @@ -176,6 +207,8 @@ def search_models( and the query are disjoint. :arg preference: Specify the node or shard the operation should be performed on. Default is random. + :arg pretty: Whether to pretty format the returned JSON + response. :arg q: Query in the Lucene query string syntax. :arg request_cache: Specify if request cache should be used for this request or not, defaults to index level setting. @@ -191,6 +224,8 @@ def search_models( number and primary term of the last modification of each hit. :arg size: Number of hits to return. Default is 10. :arg sort: Comma-separated list of : pairs. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg stats: Specific 'tag' of the request for logging and statistical purposes. :arg stored_fields: Comma-separated list of stored fields to @@ -226,7 +261,7 @@ def search_models( body=body, ) - @query_params("timeout") + @query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout") def stats( self, node_id: Any = None, @@ -254,6 +289,16 @@ def stats( model_index_status, indexing_from_model_degraded, training_requests, training_errors, training_memory_usage, training_memory_usage_percentage. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. :arg timeout: Operation timeout. """ return self.transport.perform_request( @@ -263,7 +308,9 @@ def stats( headers=headers, ) - @query_params("preference") + @query_params( + "error_trace", "filter_path", "human", "preference", "pretty", "source" + ) def train_model( self, body: Any, @@ -277,7 +324,17 @@ def train_model( :arg model_id: The id of the model. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. :arg preference: Preferred node to execute training. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -290,7 +347,7 @@ def train_model( body=body, ) - @query_params() + @query_params("error_trace", "filter_path", "human", "pretty", "source") def warmup( self, index: Any, @@ -299,11 +356,21 @@ def warmup( ) -> Any: """ Preloads native library files into memory, reducing initial search latency for - specified indexes + specified indexes. :arg index: Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") diff --git a/opensearchpy/plugins/notifications.py b/opensearchpy/plugins/notifications.py new file mode 100644 index 00000000..88e6270f --- /dev/null +++ b/opensearchpy/plugins/notifications.py @@ -0,0 +1,326 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. +# +# Modifications Copyright OpenSearch Contributors. See +# GitHub history for details. + +# ------------------------------------------------------------------------------------------ +# THIS CODE IS AUTOMATICALLY GENERATED AND MANUAL EDITS WILL BE LOST +# +# To contribute, kindly make modifications in the opensearch-py client generator +# or in the OpenSearch API specification, and run `nox -rs generate`. See DEVELOPER_GUIDE.md +# and https://github.com/opensearch-project/opensearch-api-specification for details. +# -----------------------------------------------------------------------------------------+ + + +from typing import Any + +from ..client.utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params + + +class NotificationsClient(NamespacedClient): + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def create_config( + self, + body: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Create channel configuration. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if body in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'body'.") + + return self.transport.perform_request( + "POST", + "/_plugins/_notifications/configs", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def delete_config( + self, + config_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Delete a channel configuration. + + + :arg config_id: The ID of the channel configuration to delete. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if config_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'config_id'.") + + return self.transport.perform_request( + "DELETE", + _make_path("_plugins", "_notifications", "configs", config_id), + params=params, + headers=headers, + ) + + @query_params( + "config_id", + "config_id_list", + "error_trace", + "filter_path", + "human", + "pretty", + "source", + ) + def delete_configs( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Delete multiple channel configurations. + + + :arg config_id: The ID of the channel configuration to delete. + :arg config_id_list: A comma-separated list of channel IDs to + delete. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + return self.transport.perform_request( + "DELETE", "/_plugins/_notifications/configs", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get_config( + self, + config_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get a specific channel configuration. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if config_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'config_id'.") + + return self.transport.perform_request( + "GET", + _make_path("_plugins", "_notifications", "configs", config_id), + params=params, + headers=headers, + ) + + @query_params( + "chime.url", + "chime.url.keyword", + "config_type", + "created_time_ms", + "description", + "description.keyword", + "email.email_account_id", + "email.email_group_id_list", + "email.recipient_list.recipient", + "email.recipient_list.recipient.keyword", + "email_group.recipient_list.recipient", + "email_group.recipient_list.recipient.keyword", + "error_trace", + "filter_path", + "human", + "is_enabled", + "last_updated_time_ms", + "microsoft_teams.url", + "microsoft_teams.url.keyword", + "name", + "name.keyword", + "pretty", + "query", + "ses_account.from_address", + "ses_account.from_address.keyword", + "ses_account.region", + "ses_account.role_arn", + "ses_account.role_arn.keyword", + "slack.url", + "slack.url.keyword", + "smtp_account.from_address", + "smtp_account.from_address.keyword", + "smtp_account.host", + "smtp_account.host.keyword", + "smtp_account.method", + "sns.role_arn", + "sns.role_arn.keyword", + "sns.topic_arn", + "sns.topic_arn.keyword", + "source", + "text_query", + "webhook.url", + "webhook.url.keyword", + ) + def get_configs( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get multiple channel configurations with filtering. + + + :arg config_type: Type of notification configuration. Valid + choices are slack, chime, microsoft_teams, webhook, email, sns, + ses_account, smtp_account, email_group. + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + return self.transport.perform_request( + "GET", + "/_plugins/_notifications/configs", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def list_features( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + List supported channel configurations. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + return self.transport.perform_request( + "GET", "/_plugins/_notifications/features", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def send_test( + self, + config_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Send a test notification. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if config_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'config_id'.") + + return self.transport.perform_request( + "GET", + _make_path("_plugins", "_notifications", "feature", "test", config_id), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def update_config( + self, + config_id: Any, + body: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Update channel configuration. + + + :arg error_trace: Whether to include the stack trace of returned + errors. + :arg filter_path: Comma-separated list of filters used to reduce + the response. + :arg human: Whether to return human readable values for + statistics. + :arg pretty: Whether to pretty format the returned JSON + response. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + for param in (config_id, body): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return self.transport.perform_request( + "PUT", + _make_path("_plugins", "_notifications", "configs", config_id), + params=params, + headers=headers, + body=body, + ) From 77842e8876c8c3e462c82b671b15ecfce92ae343 Mon Sep 17 00:00:00 2001 From: saimedhi Date: Wed, 17 Apr 2024 15:30:40 -0700 Subject: [PATCH 2/3] Code generated using native OpenAPI specification Signed-off-by: saimedhi --- opensearchpy/_async/client/__init__.py | 12 +++---- opensearchpy/_async/client/indices.py | 45 +++++++++----------------- opensearchpy/client/__init__.py | 12 +++---- opensearchpy/client/indices.py | 45 +++++++++----------------- utils/templates/base | 2 +- 5 files changed, 39 insertions(+), 77 deletions(-) diff --git a/opensearchpy/_async/client/__init__.py b/opensearchpy/_async/client/__init__.py index 1121b32d..71a4b8c1 100644 --- a/opensearchpy/_async/client/__init__.py +++ b/opensearchpy/_async/client/__init__.py @@ -843,8 +843,7 @@ async def delete_by_query( 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`. Valid choices are all, open, closed, - hidden, none. + `open`, `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg from_: Starting offset (default: 0) @@ -2394,8 +2393,7 @@ async def search_shards( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -2465,8 +2463,7 @@ async def search_template( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg explain: If `true`, the response includes additional details about score computation as part of a hit. :arg filter_path: Comma-separated list of filters used to reduce @@ -2753,8 +2750,7 @@ async def update_by_query( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg from_: Starting offset (default: 0) diff --git a/opensearchpy/_async/client/indices.py b/opensearchpy/_async/client/indices.py index 6d259bc1..6ee29c1d 100644 --- a/opensearchpy/_async/client/indices.py +++ b/opensearchpy/_async/client/indices.py @@ -108,8 +108,7 @@ async def refresh( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -160,8 +159,7 @@ async def flush( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg force: If `true`, the request forces a flush even if there @@ -423,8 +421,7 @@ async def open( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -496,8 +493,7 @@ async def close( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -566,8 +562,7 @@ async def delete( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -628,8 +623,7 @@ async def exists( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg flat_settings: If `true`, returns settings in flat format. @@ -693,8 +687,7 @@ async def put_mapping( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -767,8 +760,7 @@ async def get_mapping( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -828,8 +820,7 @@ async def get_field_mapping( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -953,8 +944,7 @@ async def exists_alias( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -1014,8 +1004,7 @@ async def get_alias( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -1590,8 +1579,7 @@ async def segments( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -1664,8 +1652,7 @@ async def validate_query( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg explain: If `true`, the response returns detailed information if an error has occurred. :arg filter_path: Comma-separated list of filters used to reduce @@ -1728,8 +1715,7 @@ async def clear_cache( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg fielddata: If `true`, clears the fields cache.Use the `fields` parameter to clear the cache of specific fields only. :arg fields: Comma-separated list of field names used to limit @@ -2658,8 +2644,7 @@ async def resolve_index( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for diff --git a/opensearchpy/client/__init__.py b/opensearchpy/client/__init__.py index 7949976a..f480daf5 100644 --- a/opensearchpy/client/__init__.py +++ b/opensearchpy/client/__init__.py @@ -843,8 +843,7 @@ def delete_by_query( 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`. Valid choices are all, open, closed, - hidden, none. + `open`, `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg from_: Starting offset (default: 0) @@ -2394,8 +2393,7 @@ def search_shards( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -2465,8 +2463,7 @@ def search_template( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg explain: If `true`, the response includes additional details about score computation as part of a hit. :arg filter_path: Comma-separated list of filters used to reduce @@ -2753,8 +2750,7 @@ def update_by_query( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg from_: Starting offset (default: 0) diff --git a/opensearchpy/client/indices.py b/opensearchpy/client/indices.py index d582f6e8..2dec6548 100644 --- a/opensearchpy/client/indices.py +++ b/opensearchpy/client/indices.py @@ -108,8 +108,7 @@ def refresh( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -160,8 +159,7 @@ def flush( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg force: If `true`, the request forces a flush even if there @@ -423,8 +421,7 @@ def open( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -496,8 +493,7 @@ def close( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -566,8 +562,7 @@ def delete( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -628,8 +623,7 @@ def exists( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg flat_settings: If `true`, returns settings in flat format. @@ -693,8 +687,7 @@ def put_mapping( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -767,8 +760,7 @@ def get_mapping( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -828,8 +820,7 @@ def get_field_mapping( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -953,8 +944,7 @@ def exists_alias( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -1014,8 +1004,7 @@ def get_alias( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -1590,8 +1579,7 @@ def segments( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for @@ -1664,8 +1652,7 @@ def validate_query( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg explain: If `true`, the response returns detailed information if an error has occurred. :arg filter_path: Comma-separated list of filters used to reduce @@ -1728,8 +1715,7 @@ def clear_cache( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg fielddata: If `true`, clears the fields cache.Use the `fields` parameter to clear the cache of specific fields only. :arg fields: Comma-separated list of field names used to limit @@ -2658,8 +2644,7 @@ def resolve_index( 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`. Valid choices are all, open, closed, hidden, - none. + `closed`, `hidden`, `none`. :arg filter_path: Comma-separated list of filters used to reduce the response. :arg human: Whether to return human readable values for diff --git a/utils/templates/base b/utils/templates/base index d70f8d94..fa0ba213 100644 --- a/utils/templates/base +++ b/utils/templates/base @@ -22,7 +22,7 @@ {% for p, info in api.params %} {% if info.description %} {% filter wordwrap(72, wrapstring="\n ") %} - :arg {{ p }}{% if info.deprecated and info.deprecation_message is defined %} (Deprecated: {{ info['deprecation_message'][:-1] }}.){% endif %}: {{ info.description }} {% if info.options and "Valid values: " not in info.description %}Valid choices are {{ info.options|join(", ") }}.{% endif %} + :arg {{ p }}{% if info.deprecated and info.deprecation_message is defined %} (Deprecated: {{ info['deprecation_message'][:-1] }}.){% endif %}: {{ info.description }} {% if info.options and "Valid values" not in info.description %}Valid choices are {{ info.options|join(", ") }}.{% endif %} {% if info.default is defined %}{% if info.default is not none %}{% if info.default is sameas(false) %}Default is false.{% else %}Default is {{ info.default }}.{% endif %}{% endif %}{% endif %} {% endfilter %} From 34d3db7685ea9b1e63a811dbda48461527120b9c Mon Sep 17 00:00:00 2001 From: saimedhi Date: Wed, 17 Apr 2024 15:45:37 -0700 Subject: [PATCH 3/3] Code generated using native OpenAPI specification Signed-off-by: saimedhi --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 364e0a86..82021e89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Added - Added support for Python 3.12 ([#717](https://github.com/opensearch-project/opensearch-py/pull/717)) - Added service time metrics ([#716](https://github.com/opensearch-project/opensearch-py/pull/716)) +- Added `search_pipeline` APIs and `notifications` plugin APIs ([#724](https://github.com/opensearch-project/opensearch-py/pull/724)) ### Changed ### Deprecated ### Removed