diff --git a/CHANGELOG.md b/CHANGELOG.md index f86c5795..9d6acf89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added option to pass custom headers to 'AWSV4SignerAsyncAuth' ([863](https://github.com/opensearch-project/opensearch-py/pull/863)) - Added sync and async sample that uses `search_after` parameter ([859](https://github.com/opensearch-project/opensearch-py/pull/859)) ### Updated APIs +- Updated opensearch-py APIs to reflect [opensearch-api-specification@3d086c0](https://github.com/opensearch-project/opensearch-api-specification/commit/3d086c000f24551662dfb99dc9f9b647edfabf61) ### Changed - Small refactor of AWS Signer classes for both sync and async clients ([866](https://github.com/opensearch-project/opensearch-py/pull/866)) - Small refactor to fix overwriting the module files when generating apis ([874](https://github.com/opensearch-project/opensearch-py/pull/874)) diff --git a/opensearchpy/_async/client/__init__.py b/opensearchpy/_async/client/__init__.py index 5c1fa04f..8bb4ec29 100644 --- a/opensearchpy/_async/client/__init__.py +++ b/opensearchpy/_async/client/__init__.py @@ -48,6 +48,7 @@ from .ingest import IngestClient from .insights import InsightsClient from .list import ListClient +from .ltr import LtrClient from .nodes import NodesClient from .plugins import PluginsClient from .remote import RemoteClient @@ -219,6 +220,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.ltr = LtrClient(self) self.wlm = WlmClient(self) self.list = ListClient(self) self.insights = InsightsClient(self) @@ -385,12 +387,11 @@ async def create( 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 external, external_gte, force, - internal. + `external_gte`. :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. + (`number_of_replicas+1`). """ for param in (index, id, body): if param in SKIP_IN_PATH: @@ -477,12 +478,11 @@ async def index( 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 external, external_gte, force, - internal. + `external_gte`. :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. + (`number_of_replicas+1`). """ for param in (index, body): if param in SKIP_IN_PATH: @@ -564,7 +564,7 @@ async def bulk( :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. + (`number_of_replicas+1`). """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -667,16 +667,12 @@ async def count( specified. :arg default_operator: The default operator for query string query: `AND` or `OR`. This parameter can only be used when the `q` query - string parameter is specified. Valid choices are and, or. + string parameter is specified. Valid choices are and, AND, or, 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. Default is false. - :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`. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields @@ -767,12 +763,11 @@ async def delete( 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 external, external_gte, force, - internal. + `external_gte`. :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. + (`number_of_replicas+1`). """ for param in (index, id): if param in SKIP_IN_PATH: @@ -853,9 +848,9 @@ async def delete_by_query( are analyzed. Default is false. :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. + conflicts: `abort` or `proceed`. :arg default_operator: The default operator for query string - query: `AND` or `OR`. Valid choices are and, or. + query: `AND` or `OR`. Valid choices are and, AND, or, 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 @@ -897,11 +892,10 @@ async def delete_by_query( :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 - dfs_query_then_fetch, query_then_fetch. + options: `query_then_fetch`, `dfs_query_then_fetch`. :arg size: Deprecated, use `max_docs` instead. :arg slices: The number of slices this task should be divided - into. Valid choices are auto. + into. :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. @@ -921,7 +915,7 @@ async def delete_by_query( :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. + (`number_of_replicas+1`). :arg wait_for_completion: If `true`, the request blocks until the operation is complete. Default is True. """ @@ -1095,8 +1089,7 @@ async def exists( 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 external, external_gte, force, - internal. + `external_gte`. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -1165,8 +1158,7 @@ async def exists_source( 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 external, external_gte, force, - internal. + `external_gte`. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -1225,7 +1217,7 @@ async def explain( 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. + query: `AND` or `OR`. Valid choices are and, AND, or, OR. :arg df: Field to use as default where no field prefix is given in the query string. Default is _all. :arg error_trace: Whether to include the stack trace of returned @@ -1389,8 +1381,7 @@ async def get( 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 external, external_gte, - force, internal. + `external`, `external_gte`. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -1504,8 +1495,7 @@ async def get_source( The specified version must match the current version of the document for the request to succeed. :arg version_type: Specific version type. One of `internal`, - `external`, `external_gte`. Valid choices are external, external_gte, - force, internal. + `external`, `external_gte`. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -1651,8 +1641,7 @@ async def msearch( returned as an integer in the response. Defaults to false, which returns an object. Default is false. :arg search_type: Indicates whether global term and document - frequencies should be used when scoring returned documents. Valid - choices are dfs_query_then_fetch, query_then_fetch. + frequencies should be used when scoring returned documents. :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 @@ -1716,8 +1705,7 @@ async def msearch_template( `hits.total` as an integer. If `false`, it returns `hits.total` as an object. Default is false. :arg search_type: The type of the search operation. Available - options: `query_then_fetch`, `dfs_query_then_fetch`. Valid choices are - dfs_query_then_fetch, query_then_fetch. + options: `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 @@ -1806,8 +1794,7 @@ async def mtermvectors( frequency and document frequency. Default is false. :arg version: If `true`, returns the document version as part of a hit. - :arg version_type: Specific version type. Valid choices are - external, external_gte, force, internal. + :arg version_type: Specific version type. """ path = _make_path(index, "_mtermvectors") @@ -1926,8 +1913,7 @@ async def rank_eval( are not included in the response. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg search_type: Search operation type Valid choices are - dfs_query_then_fetch, query_then_fetch. + :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. """ @@ -1950,6 +1936,7 @@ async def rank_eval( "pretty", "refresh", "requests_per_second", + "require_alias", "scroll", "slices", "source", @@ -1991,7 +1978,6 @@ async def reindex( should be maintained for scrolled search. :arg slices: The number of slices this task should be divided 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 @@ -1999,7 +1985,7 @@ async def reindex( :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. + (`number_of_replicas+1`). :arg wait_for_completion: If `true`, the request blocks until the operation is complete. Default is True. """ @@ -2020,7 +2006,7 @@ async def reindex_rethrottle( headers: Any = None, ) -> Any: """ - Changes the number of requests per second for a particular Reindex operation. + Changes the number of requests per second for a particular reindex operation. :arg task_id: Identifier for the task. @@ -2138,8 +2124,6 @@ async def scroll( Allows to retrieve a large numbers of results from a single search request. - :arg body: The scroll ID if not passed by URL or query - parameter. :arg scroll_id: The scroll ID for scrolled search :arg error_trace: Whether to include the stack trace of returned errors. Default is false. @@ -2221,6 +2205,7 @@ async def scroll( "track_scores", "track_total_hits", "typed_keys", + "verbose_pipeline", "version", ) async def search( @@ -2281,7 +2266,7 @@ async def search( executing cross-cluster search (CCS) requests. Default is True. :arg default_operator: The default operator for query string query: AND or OR. This parameter can only be used when the `q` query - string parameter is specified. Valid choices are and, or. + string parameter is specified. Valid choices are and, AND, or, 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. @@ -2371,8 +2356,7 @@ async def search( :arg search_pipeline: Customizable sequence of processing stages applied to search queries. :arg search_type: How distributed term frequencies are - calculated for relevance scoring. Valid choices are - dfs_query_then_fetch, query_then_fetch. + calculated for relevance scoring. :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 @@ -2421,6 +2405,13 @@ async def search( 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 verbose_pipeline: Enables or disables verbose mode for the + search pipeline. When verbose mode is enabled, detailed information + about each processor in the search pipeline is included in the search + response. This includes the processor name, execution status, input, + output, and time taken for processing. This parameter is primarily + intended for debugging purposes, allowing users to track how data flows + and transforms through the search pipeline. :arg version: If `true`, returns document version as part of a hit. """ @@ -2570,8 +2561,7 @@ async def search_template( specific shard. :arg scroll: Specifies how long a consistent view of the index should be maintained for scrolled search. - :arg search_type: The type of the search operation. Valid - choices are dfs_query_then_fetch, query_then_fetch. + :arg search_type: The type of the search operation. :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 @@ -2658,8 +2648,7 @@ async def termvectors( frequency and document frequency. Default is false. :arg version: If `true`, returns the document version as part of a hit. - :arg version_type: Specific version type. Valid choices are - external, external_gte, force, internal. + :arg version_type: Specific version type. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -2746,8 +2735,7 @@ async def update( :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. + (number_of_replicas+1). Defaults to 1 meaning the primary shard. """ for param in (index, id, body): if param in SKIP_IN_PATH: @@ -2832,9 +2820,9 @@ async def update_by_query( are analyzed. Default is false. :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. + conflicts: `abort` or `proceed`. :arg default_operator: The default operator for query string - query: `AND` or `OR`. Valid choices are and, or. + query: `AND` or `OR`. Valid choices are and, AND, or, 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 @@ -2880,11 +2868,10 @@ async def update_by_query( operation. Default is 100. :arg search_timeout: Explicit timeout for each search request. :arg search_type: The type of the search operation. Available - options: `query_then_fetch`, `dfs_query_then_fetch`. Valid choices are - dfs_query_then_fetch, query_then_fetch. + options: `query_then_fetch`, `dfs_query_then_fetch`. :arg size: Deprecated, use `max_docs` instead. :arg slices: The number of slices this task should be divided - into. Valid choices are auto. + into. :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. @@ -2904,7 +2891,7 @@ async def update_by_query( :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. + (`number_of_replicas+1`). :arg wait_for_completion: If `true`, the request blocks until the operation is complete. Default is True. """ @@ -3235,7 +3222,7 @@ async def bulk_stream( :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. + (`number_of_replicas+1`). """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") diff --git a/opensearchpy/_async/client/cat.py b/opensearchpy/_async/client/cat.py index 3b38803d..ce448316 100644 --- a/opensearchpy/_async/client/cat.py +++ b/opensearchpy/_async/client/cat.py @@ -61,36 +61,32 @@ async def aliases( headers: Any = None, ) -> Any: """ - Shows information about currently configured aliases to indexes including - filter and routing info. + Shows information about aliases currently configured to indexes, including + filter and routing information. - :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. Default is false. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indexes that are open, closed or both. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Whether to return information from the local node + only instead of from the cluster manager node. Default is false. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", _make_path("_cat", "aliases", name), params=params, headers=headers @@ -115,30 +111,30 @@ async def all_pit_segments( headers: Any = None, ) -> Any: """ - Lists all active point-in-time segments. + Lists all active CAT point-in-time segments. - :arg bytes: The unit in which to display byte values. Valid - choices are b, g, gb, k, kb, m, mb, p, pb, t, tb. + :arg bytes: The units used to display byte values. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", "/_cat/pit_segments/_all", params=params, headers=headers @@ -171,36 +167,36 @@ async def allocation( much disk space they are using. - :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, g, gb, k, kb, m, mb, p, pb, t, tb. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg node_id: A comma-separated list of node IDs or names used + to limit the returned information. + :arg bytes: The units used to display byte values. + :arg cluster_manager_timeout: A timeout for connection to the + cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the HTTP `Accept` header, such + as `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does 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 cluster-manager node. + use `cluster_manager_timeout` instead.): A timeout for connection to the + cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", @@ -233,32 +229,33 @@ async def cluster_manager( Returns information about the cluster-manager node. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg cluster_manager_timeout: A timeout for connection to the + cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the HTTP `Accept` header, such + as `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): A timeout for connection to the + cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", "/_cat/cluster_manager", params=params, headers=headers @@ -283,8 +280,8 @@ async def count( headers: Any = None, ) -> Any: """ - Provides quick access to the document count of the entire cluster, or - individual indexes. + Provides quick access to the document count of the entire cluster or of an + individual index. :arg index: Comma-separated list of data streams, indexes, and @@ -296,19 +293,20 @@ async def count( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", _make_path("_cat", "count", index), params=params, headers=headers @@ -338,29 +336,29 @@ async def fielddata( node in the cluster. - :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, g, gb, k, kb, m, mb, p, pb, t, tb. + :arg fields: A comma-separated list of fields used to limit the + amount of returned information. + :arg bytes: The units used to display byte values. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", @@ -398,23 +396,23 @@ async def health( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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 used to display time values. Valid choices - are d, h, m, micros, ms, nanos, s. - :arg ts: If `true`, returns `HH:MM:SS` and Unix epoch + :arg time: The unit used to display time values. + :arg ts: When `true`, returns `HH:MM:SS` and Unix epoch timestamps. Default is True. - :arg v: Verbose mode. Display column headers. Default is false. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", "/_cat/health", params=params, headers=headers @@ -475,53 +473,48 @@ async def indices( headers: Any = None, ) -> Any: """ - Returns information about indexes: number of primaries and replicas, document - counts, disk size, ... + Lists information related to indexes, that is, how much disk space they are + using, how many shards they have, their health status, and so on. - :arg index: Comma-separated list of data streams, indexes, and + :arg index: A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. - :arg bytes: The unit used to display byte values. Valid choices - are b, g, gb, k, kb, m, mb, p, pb, t, tb. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg bytes: The units used to display byte values. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. - :arg expand_wildcards: The type of index that wildcard patterns - can match. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg health: The health status used to limit returned indexes. - By default, the response includes indexes of any health status. Valid - choices are green, red, yellow. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg health: Limits indexes based on their health status. + Supported values are `green`, `yellow`, and `red`. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg include_unloaded_segments: If `true`, the response includes - information from segments that are not loaded into memory. Default is - false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg include_unloaded_segments: Whether to include information + from segments not loaded into memory. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg pri: If `true`, the response only includes information from - primary shards. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg pri: When `true`, returns information only from the primary + shards. Default is false. + :arg s: A 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 used to display time values. Valid choices - are d, h, m, micros, ms, nanos, s. - :arg v: Verbose mode. Display column headers. Default is false. + :arg time: Specifies the time units. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", _make_path("_cat", "indices", index), params=params, headers=headers @@ -551,32 +544,33 @@ async def master( Returns information about the cluster-manager node. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ from warnings import warn @@ -611,32 +605,33 @@ async def nodeattrs( Returns information about custom node attributes. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", "/_cat/nodeattrs", params=params, headers=headers @@ -666,42 +661,43 @@ async def nodes( headers: Any = None, ) -> Any: """ - Returns basic statistics about performance of cluster nodes. + Returns basic statistics about the performance of cluster nodes. - :arg bytes: The unit used to display byte values. Valid choices - are b, g, gb, k, kb, m, mb, p, pb, t, tb. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg bytes: The units used to display byte values. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg full_id: If `true`, return the full node ID. If `false`, - return the shortened node ID. Default is false. - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg full_id: When `true`, returns the full node ID. When + `false`, returns the shortened node ID. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg local (Deprecated: This parameter does not cause this API - to act locally.): Return local information, do not retrieve the state - from cluster-manager node. Default is false. + to act locally.): Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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, micros, ms, nanos, s. - :arg v: Verbose mode. Display column headers. Default is false. + :arg time: Specifies the time units, for example, `5d` or `7h`. + For more information, see [Supported + units](https://opensearch.org/docs/latest/api-reference/units/). + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", "/_cat/nodes", params=params, headers=headers @@ -729,37 +725,39 @@ async def pending_tasks( headers: Any = None, ) -> Any: """ - Returns a concise representation of the cluster pending tasks. + Returns a concise representation of the cluster's pending tasks. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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, micros, ms, nanos, s. - :arg v: Verbose mode. Display column headers. Default is false. + :arg time: Specifies the time units, for example, `5d` or `7h`. + For more information, see [Supported + units](https://opensearch.org/docs/latest/api-reference/units/). + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", "/_cat/pending_tasks", params=params, headers=headers @@ -785,30 +783,30 @@ async def pit_segments( headers: Any = None, ) -> Any: """ - List segments for one or several PITs. + Lists one or several CAT point-in-time segments. - :arg bytes: The unit in which to display byte values. Valid - choices are b, g, gb, k, kb, m, mb, p, pb, t, tb. + :arg bytes: The units used to display byte values. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", "/_cat/pit_segments", params=params, headers=headers, body=body @@ -835,35 +833,37 @@ async def plugins( headers: Any = None, ) -> Any: """ - Returns information about installed plugins across nodes node. + Returns information about the names, components, and versions of the installed + plugins. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", "/_cat/plugins", params=params, headers=headers @@ -892,38 +892,40 @@ async def recovery( headers: Any = None, ) -> Any: """ - Returns information about index shard recoveries, both on-going completed. + Returns all completed and ongoing index and shard recoveries. - :arg index: Comma-separated list or wildcard expression of index - names to limit the returned information. + :arg index: A comma-separated list of data streams, indexes, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indexes, omit this parameter or use `*` or `_all`. :arg active_only: If `true`, the response only includes ongoing shard recoveries. Default is false. - :arg bytes: The unit used to display byte values. Valid choices - are b, g, gb, k, kb, m, mb, p, pb, t, tb. - :arg detailed: If `true`, the response includes detailed - information about shard recoveries. Default is false. + :arg bytes: The units used to display byte values. + :arg detailed: When `true`, includes detailed information about + shard recoveries. Default is false. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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, micros, ms, nanos, s. - :arg v: Verbose mode. Display column headers. Default is false. + :arg time: Specifies the time units, for example, `5d` or `7h`. + For more information, see [Supported + units](https://opensearch.org/docs/latest/api-reference/units/). + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", _make_path("_cat", "recovery", index), params=params, headers=headers @@ -950,35 +952,36 @@ async def repositories( headers: Any = None, ) -> Any: """ - Returns information about snapshot repositories registered in the cluster. + Returns information about all snapshot repositories for a cluster. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", "/_cat/repositories", params=params, headers=headers @@ -1014,52 +1017,54 @@ async def segment_replication( headers: Any = None, ) -> Any: """ - Returns information about both on-going and latest completed Segment - Replication events. + Returns information about active and last-completed segment replication events + on each replica shard, including related shard-level metrics. These metrics + provide information about how far behind the primary shard the replicas are + lagging. - :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 - segment replication events. Default is false. - :arg allow_no_indices: Whether to ignore if a wildcard indexes - expression resolves into no concrete indexes. (This includes `_all` - string or when no indexes have been specified). - :arg bytes: The unit in which to display byte values. Valid - choices are b, g, gb, k, kb, m, mb, p, pb, t, tb. - :arg completed_only: If `true`, the response only includes - latest completed segment replication events. Default is false. - :arg detailed: If `true`, the response includes detailed - information about segment replications. Default is false. + :arg index: A comma-separated list of data streams, indexes, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indexes, omit this parameter or use `*` or `_all`. + :arg active_only: When `true`, the response only includes + ongoing segment replication events. Default is false. + :arg allow_no_indices: Whether to ignore the index if a wildcard + index expression resolves to no concrete indexes. This includes the + `_all` string or when no indexes have been specified. + :arg bytes: The units used to display byte values. + :arg completed_only: When `true`, the response only includes the + last-completed segment replication events. Default is false. + :arg detailed: When `true`, the response includes additional + metrics for each stage of a segment replication event. Default is false. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indexes that are open, closed or both. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg ignore_throttled: Whether specified concrete, expanded or + :arg ignore_throttled: Whether specified concrete, expanded, or aliased indexes should be ignored when throttled. - :arg ignore_unavailable: Whether specified concrete indexes - should be ignored when unavailable (missing or closed). + :arg ignore_unavailable: Whether the specified concrete indexes + should be ignored when missing or closed. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A comma-separated list of column names or column aliases to sort by. - :arg shards: Comma-separated list of shards to display. + :arg shards: A 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, micros, ms, nanos, s. - :arg timeout: Operation timeout. - :arg v: Verbose mode. Display column headers. Default is false. + :arg time: Specifies the time units, for example, `5d` or `7h`. + For more information, see [Supported + units](https://opensearch.org/docs/latest/api-reference/units/). + :arg timeout: The operation timeout. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", @@ -1096,32 +1101,32 @@ async def segments( :arg index: A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. - :arg bytes: The unit used to display byte values. Valid choices - are b, g, gb, k, kb, m, mb, p, pb, t, tb. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg bytes: The units used to display byte values. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", _make_path("_cat", "segments", index), params=params, headers=headers @@ -1151,42 +1156,38 @@ async def shards( headers: Any = None, ) -> Any: """ - Provides a detailed view of shard allocation on nodes. + Lists the states of all primary and replica shards and how they are + distributed. - :arg index: A comma-separated list of data streams, indexes, and - aliases used to limit the request. Supports wildcards (`*`). To target - all data streams and indexes, omit this parameter or use `*` or `_all`. - :arg bytes: The unit used to display byte values. Valid choices - are b, g, gb, k, kb, m, mb, p, pb, t, tb. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg bytes: The units used to display byte values. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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, micros, ms, nanos, s. - :arg v: Verbose mode. Display column headers. Default is false. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", _make_path("_cat", "shards", index), params=params, headers=headers @@ -1216,38 +1217,39 @@ async def thread_pool( ) -> Any: """ Returns cluster-wide thread pool statistics per node. By default the active, - queue and rejected statistics are returned for all thread pools. + queued, and rejected statistics are returned for all thread pools. :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 cluster_manager_timeout: A timeout for connection to the + cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", @@ -1279,41 +1281,43 @@ async def snapshots( headers: Any = None, ) -> Any: """ - Returns all snapshots in a specific repository. + Lists all of the snapshots stored in a specific repository. :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 cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg ignore_unavailable: If `true`, the response does not + :arg ignore_unavailable: When `true`, the response does not include information from unavailable snapshots. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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, micros, ms, nanos, s. - :arg v: Verbose mode. Display column headers. Default is false. + :arg time: Specifies the time units, for example, `5d` or `7h`. + For more information, see [Supported + units](https://opensearch.org/docs/latest/api-reference/units/). + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", @@ -1345,12 +1349,10 @@ async def tasks( headers: Any = None, ) -> Any: """ - Returns information about the tasks currently executing on one or more nodes in - the cluster. + Lists the progress of all tasks currently running on the cluster. - :arg actions: The task action names, which are used to limit the - response. + :arg actions: The task action names used to limit the response. :arg detailed: If `true`, the response includes detailed information about shard recoveries. Default is false. :arg error_trace: Whether to include the stack trace of returned @@ -1359,27 +1361,30 @@ async def tasks( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :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 nodes: A comma-separated list of node IDs or names used to + limit the returned information. Use `_local` to return information from + the node to which you're connecting, specify a specific node from which + to get information, or keep the parameter empty to get information from + all nodes. :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. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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, micros, ms, nanos, s. - :arg v: Verbose mode. Display column headers. Default is false. + :arg time: Specifies the time units, for example, `5d` or `7h`. + For more information, see [Supported + units](https://opensearch.org/docs/latest/api-reference/units/). + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", "/_cat/tasks", params=params, headers=headers @@ -1407,37 +1412,39 @@ async def templates( headers: Any = None, ) -> Any: """ - Returns information about existing templates. + Lists the names, patterns, order numbers, and version numbers of index + templates. :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 cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return await self.transport.perform_request( "GET", _make_path("_cat", "templates", name), params=params, headers=headers diff --git a/opensearchpy/_async/client/cluster.py b/opensearchpy/_async/client/cluster.py index 8a6b881d..034d0d28 100644 --- a/opensearchpy/_async/client/cluster.py +++ b/opensearchpy/_async/client/cluster.py @@ -70,64 +70,41 @@ async def health( Returns basic information about the health of the cluster. - :arg index: Comma-separated list of data streams, indexes, and - index aliases used to limit the request. Wildcard expressions (*) are - supported. To target all data streams and indexes 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 awareness_attribute: The name of the awareness attribute + for which to return the cluster health status (for example, `zone`). + Applicable only if `level` is set to `awareness_attributes`. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indexes that are open, closed or both. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg level: Can be one of cluster, indexes or shards. Controls - the details level of the health information returned. Valid choices are - awareness_attributes, cluster, indices, shards. - :arg local: If `true`, the request retrieves information from - the local node only. Defaults to false, which means information is - retrieved from the cluster-manager node. Default is false. - :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Period to wait for a connection - to the cluster-manager node. If no response is received before the - timeout expires, the request fails and returns an error. + :arg local: Whether to return information from the local node + only instead of from the cluster manager node. Default is false. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :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 high, immediate, - languid, low, normal, urgent. - :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, red, yellow. + :arg timeout: The amount of time to wait for a response from the + cluster manager node. For more information about supported time units, + see [Common parameters](https://opensearch.org/docs/latest/api- + reference/common-parameters/#time-units). + :arg wait_for_no_initializing_shards: Whether to wait until + there are no initializing shards in the cluster. Default is false. + :arg wait_for_no_relocating_shards: Whether to wait until there + are no relocating shards in the cluster. Default is false. + :arg wait_for_nodes: Waits until the specified number of nodes + (`N`) is available. Accepts `>=N`, `<=N`, `>N`, and ` Any: """ - Returns a list of any cluster-level changes (e.g. create index, update mapping, - allocate or fail shard) which have not yet been executed. + Returns a list of pending cluster-level tasks, such as index creation, mapping + updates, or new allocations. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -166,13 +146,9 @@ async def pending_tasks( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: If `true`, the request retrieves information from - the local node only. If `false`, information is retrieved from the - cluster-manager node. Default is false. - :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Period to wait for a connection - to the cluster-manager node. If no response is received before the - timeout expires, the request fails and returns an error. + :arg local: When `true`, the request retrieves information from + the local node only. When `false`, information is retrieved from the + cluster manager node. Default is false. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for @@ -206,37 +182,36 @@ async def state( headers: Any = None, ) -> Any: """ - Returns a comprehensive information about the state of the cluster. - - - :arg metric: Limit the information returned to the specified - metrics - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indexes - :arg allow_no_indices: Whether to ignore if a wildcard indexes - expression resolves into no concrete indexes. (This includes `_all` - string or when no indexes have been specified) - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + Returns comprehensive information about the state of the cluster. + + + :arg metric: Limits the information returned to only the + [specified metric groups](https://opensearch.org/docs/latest/api- + reference/cluster-api/cluster-stats/#metric-groups). + :arg allow_no_indices: Whether to ignore a wildcard index + expression that resolves into no concrete indexes. This includes the + `_all` string or when no indexes have been specified. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indexes that are open, closed or both. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg flat_settings: Return settings in flat format. Default is - false. + :arg flat_settings: Whether to return settings in the flat form, + which can improve readability, especially for heavily nested settings. + For example, the flat form of `"cluster": { "max_shards_per_node": 500 + }` is `"cluster.max_shards_per_node": "500"`. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg ignore_unavailable: Whether specified concrete indexes - 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 master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Specify timeout for connection - to cluster manager. + :arg ignore_unavailable: Whether the specified concrete indexes + should be ignored when unavailable (missing or closed). + :arg local: Whether to return information from the local node + only instead of from the cluster manager node. Default is false. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for @@ -274,34 +249,35 @@ async def stats( index_metric: Any = None, ) -> Any: """ - Returns high-level overview of cluster statistics. + Returns a high-level overview of cluster statistics. :arg metric: Limit the information returned to the specified metrics. - :arg index_metric: Limit the information returned for indexes - metric to the specific index metrics. It can be used only if indexes (or - all) metric is specified. - :arg node_id: Comma-separated list of node filters used to limit - returned information. Defaults to all nodes in the cluster. + :arg index_metric: A comma-separated list of [index metric + groups](https://opensearch.org/docs/latest/api-reference/cluster- + api/cluster-stats/#index-metric-groups), for example, `docs,store`. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg flat_settings: If `true`, returns settings in flat format. - Default is false. + :arg flat_settings: Whether to return settings in the flat form, + which can improve readability, especially for heavily nested settings. + For example, the flat form of `"cluster": { "max_shards_per_node": 500 + }` is `"cluster.max_shards_per_node": "500"`. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :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. + :arg timeout: The amount of time 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", @@ -342,35 +318,31 @@ async def reroute( :arg body: The definition of `commands` to perform (`move`, `cancel`, `allocate`) - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. - :arg dry_run: If `true`, then the request simulates the - operation only and returns the resulting state. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). + :arg dry_run: When `true`, the request simulates the operation + and returns the resulting state. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. - :arg explain: If `true`, then the response contains an - explanation of why the commands can or cannot be executed. + :arg explain: When `true`, the response contains an explanation + of why reroute certain commands can or cannot be executed. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Period to wait for a connection - to the cluster-manager 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. Default is false. - :arg retry_failed: If `true`, then retries allocation of shards - that are blocked due to too many subsequent allocation failures. + :arg retry_failed: When `true`, retries shard allocation if it + was blocked because of too many subsequent 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 @@ -397,31 +369,29 @@ async def get_settings( Returns cluster settings. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg flat_settings: If `true`, returns settings in flat format. - Default is false. + :arg flat_settings: Whether to return settings in the flat form, + which can improve readability, especially for heavily nested settings. + For example, the flat form of `"cluster": { "max_shards_per_node": 500 + }` is `"cluster.max_shards_per_node": "500"`. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg include_defaults: If `true`, returns default cluster + :arg include_defaults: When `true`, returns default cluster settings from the local node. Default is false. - :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Period to wait for a connection - to the cluster-manager 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. Default is false. :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 @@ -448,28 +418,28 @@ async def put_settings( Updates the cluster settings. - :arg body: The settings to be updated. Can be either `transient` - or `persistent` (survives cluster restart). - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg body: The cluster settings to update. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg flat_settings: Return settings in flat format. Default is - false. + :arg flat_settings: Whether to return settings in the flat form, + which can improve readability, especially for heavily nested settings. + For example, the flat form of `"cluster": { "max_shards_per_node": 500 + }` is `"cluster.max_shards_per_node": "500"`. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Explicit operation timeout for - connection to cluster-manager node :arg pretty: Whether to pretty format the returned JSON response. Default is false. :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'.") @@ -521,11 +491,13 @@ async def allocation_explain( headers: Any = None, ) -> Any: """ - Provides explanations for shard allocations in the cluster. + Explains how shards are allocated in the current cluster and provides an + explanation for why unassigned shards can't be allocated to a node. - :arg body: The index, shard, and primary flag to explain. Empty - means 'explain the first unassigned shard' + :arg body: The index, shard, and primary flag for which to + generate an explanation. Leave this empty to generate an explanation for + the first unassigned shard. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -534,10 +506,12 @@ async def allocation_explain( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg include_disk_info: If `true`, returns information about + :arg include_disk_info: When `true`, returns information about disk usage and shard sizes. Default is false. - :arg include_yes_decisions: If `true`, returns YES decisions in - explanation. Default is false. + :arg include_yes_decisions: When `true`, returns any `YES` + decisions in the allocation explanation. `YES` decisions indicate when a + particular shard allocation attempt was successful for the given node. + Default is false. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for @@ -571,10 +545,13 @@ async def delete_component_template( Deletes a component 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 name: The name of the component template to delete. + Supports wildcard (*) expressions. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -583,17 +560,10 @@ async def delete_component_template( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Period to wait for a connection - to the cluster-manager 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. Default is false. :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'.") @@ -609,6 +579,7 @@ async def delete_component_template( "cluster_manager_timeout", "error_trace", "filter_path", + "flat_settings", "human", "local", "master_timeout", @@ -625,25 +596,28 @@ async def get_component_template( Returns one or more 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 name: The name of the component template to retrieve. + Wildcard (`*`) expressions are supported. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". + :arg flat_settings: Whether to return settings in the flat form, + which can improve readability, especially for heavily nested settings. + For example, the flat form of `"cluster": { "max_shards_per_node": 500 + }` is `"cluster.max_shards_per_node": "500"`. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: If `true`, the request retrieves information from - the local node only. If `false`, information is retrieved from the - cluster-manager node. Default is false. - :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Period to wait for a connection - to the cluster-manager node. If no response is received before the - timeout expires, the request fails and returns an error. + :arg local: When `true`, the request retrieves information from + the local node only. When `false`, information is retrieved from the + cluster manager node. Default is false. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for @@ -678,20 +652,24 @@ async def put_component_template( Creates or updates a component 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 indexes 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: If `true`, this request cannot replace or update + :arg name: The 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`, and `synthetics-settings`. OpenSearch uses these + templates to configure backing indexes for its data streams. If you want + to overwrite one of these templates, set the replacement template + `version` to a higher value than the current version. If you want to + disable all built-in component and index templates, set + `stack.templates.enabled` to `false` using the [Cluster Update Settings + API](https://opensearch.org/docs/latest/api-reference/cluster- + api/cluster-settings/). + :arg body: The template definition. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). + :arg create: When `true`, this request cannot replace or update existing component templates. Default is false. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. @@ -701,15 +679,10 @@ async def put_component_template( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Period to wait for a connection - to the cluster-manager 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. Default is false. :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): if param in SKIP_IN_PATH: @@ -743,10 +716,13 @@ async def exists_component_template( Returns information about whether a particular component template exist. - :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 name: The name of the component template. Wildcard (*) + expressions are supported. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -755,13 +731,9 @@ async def exists_component_template( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: If `true`, the request retrieves information from - the local node only. Defaults to false, which means information is - retrieved from the cluster-manager node. Default is false. - :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Period to wait for a connection - to the cluster-manager node. If no response is received before the - timeout expires, the request fails and returns an error. + :arg local: When `true`, the request retrieves information from + the local node only. When `false, information is retrieved from the + cluster manager node. Default is false. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for @@ -786,7 +758,7 @@ async def delete_voting_config_exclusions( headers: Any = None, ) -> Any: """ - Clears cluster voting config exclusions. + Clears any cluster voting configuration exclusions. :arg error_trace: Whether to include the stack trace of returned @@ -803,11 +775,10 @@ async def delete_voting_config_exclusions( 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. Defaults to true, meaning that all - excluded nodes must be removed from the cluster before this API takes - any action. If set to `false` then the voting configuration exclusions - list is cleared even if some excluded nodes are still in the cluster. - Default is True. + configuration exclusions list. When `true`, all excluded nodes are + removed from the cluster before this API takes any action. When `false`, + the voting configuration exclusions list is cleared even if some + excluded nodes are still in the cluster. Default is True. """ return await self.transport.perform_request( "DELETE", @@ -832,7 +803,8 @@ async def post_voting_config_exclusions( headers: Any = None, ) -> Any: """ - Updates the cluster voting config exclusions by node ids or node names. + Updates the cluster voting configuration by excluding certain node IDs or + names. :arg error_trace: Whether to include the stack trace of returned @@ -843,20 +815,22 @@ async def post_voting_config_exclusions( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg node_ids: A comma-separated list of the persistent ids of - the nodes to exclude from the voting configuration. If specified, you - may not also specify `node_names`. - :arg node_names: A 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 node_ids: A comma-separated list of node IDs to exclude + from the voting configuration. When using this setting, you cannot also + specify `node_names`. Either `node_ids` or `node_names` are required to + receive a valid response. + :arg node_names: A comma-separated list of node names to exclude + from the voting configuration. When using this setting, you cannot also + specify `node_ids`. Either `node_ids` or `node_names` are required to + receive a valid response. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :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 the specified nodes to be excluded from the voting - configuration before returning. If the timeout expires before the - appropriate condition is satisfied, the request fails and returns an + configuration before returning a response. If the timeout expires before + the appropriate condition is satisfied, the request fails and returns an error. """ return await self.transport.perform_request( @@ -870,7 +844,7 @@ async def delete_decommission_awareness( headers: Any = None, ) -> Any: """ - Delete any existing decommission. + Recommissions a decommissioned zone. :arg error_trace: Whether to include the stack trace of returned @@ -930,10 +904,11 @@ async def get_decommission_awareness( headers: Any = None, ) -> Any: """ - Get details and status of decommissioned attribute. + Retrieves the decommission status for all zones. - :arg awareness_attribute_name: Awareness attribute name. + :arg awareness_attribute_name: The name of the awareness + attribute. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -976,7 +951,7 @@ async def get_weighted_routing( Fetches weighted shard routing weights. - :arg attribute: Awareness attribute name. + :arg attribute: The name of the awareness attribute. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -1009,11 +984,18 @@ async def put_decommission_awareness( headers: Any = None, ) -> Any: """ - Decommissions an awareness attribute. - - - :arg awareness_attribute_name: Awareness attribute name. - :arg awareness_attribute_value: Awareness attribute value. + Decommissions a cluster zone based on awareness. This can greatly benefit + multi-zone deployments, where awareness attributes can aid in applying new + upgrades to a cluster in a controlled fashion. + + + :arg awareness_attribute_name: The name of the awareness + attribute. + :arg awareness_attribute_value: The value of the awareness + attribute. For example, if you have shards allocated in two different + zones, you can give each zone a value of `zone-a` or `zoneb`. The + cluster decommission operation decommissions the zone listed in the + method. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -1056,7 +1038,7 @@ async def put_weighted_routing( Updates weighted shard routing weights. - :arg attribute: Awareness attribute name. + :arg attribute: The name of awareness attribute, usually `zone`. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter diff --git a/opensearchpy/_async/client/indices.py b/opensearchpy/_async/client/indices.py index 99603830..98f0f369 100644 --- a/opensearchpy/_async/client/indices.py +++ b/opensearchpy/_async/client/indices.py @@ -236,7 +236,7 @@ async def create( :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. + (`number_of_replicas+1`). """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -300,7 +300,7 @@ async def clone( :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. + (`number_of_replicas+1`). :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -459,7 +459,7 @@ async def open( :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. + (`number_of_replicas+1`). :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -531,7 +531,7 @@ async def close( :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. + (`number_of_replicas+1`). """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -1638,7 +1638,7 @@ async def validate_query( 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. + query: `AND` or `OR`. Valid choices are and, AND, or, 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. @@ -2053,7 +2053,7 @@ async def shrink( :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. + (`number_of_replicas+1`). :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -2128,7 +2128,7 @@ async def split( :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. + (`number_of_replicas+1`). :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -2201,7 +2201,7 @@ async def rollover( :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. + (`number_of_replicas+1`). """ if alias in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'alias'.") diff --git a/opensearchpy/_async/client/ingest.py b/opensearchpy/_async/client/ingest.py index a247e704..21f4ed1c 100644 --- a/opensearchpy/_async/client/ingest.py +++ b/opensearchpy/_async/client/ingest.py @@ -56,14 +56,14 @@ async def get_pipeline( headers: Any = None, ) -> Any: """ - Returns a pipeline. + Returns an ingest pipeline. - :arg id: Comma-separated list of pipeline IDs to retrieve. + :arg id: A 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 cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -103,13 +103,13 @@ async def put_pipeline( headers: Any = None, ) -> Any: """ - Creates or updates a pipeline. + Creates or updates an ingest pipeline. - :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 id: The ID of the ingest pipeline. + :arg body: The ingest definition. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -126,9 +126,7 @@ async def put_pipeline( response. Default is false. :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 timeout: The amount of time to wait for a response. """ for param in (id, body): if param in SKIP_IN_PATH: @@ -159,14 +157,14 @@ async def delete_pipeline( headers: Any = None, ) -> Any: """ - Deletes a pipeline. + Deletes an ingest pipeline. - :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 id: The 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: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -183,9 +181,7 @@ async def delete_pipeline( response. Default is false. :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 timeout: The amount of time to wait for a response. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'id'.") @@ -206,12 +202,12 @@ async def simulate( headers: Any = None, ) -> Any: """ - Allows to simulate a pipeline with example documents. + Simulates an ingest pipeline with example documents. :arg body: The simulate definition - :arg id: Pipeline to test. If you don't specify a `pipeline` in - the request body, this parameter is required. + :arg id: The 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. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -224,8 +220,8 @@ async def simulate( response. Default is false. :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. Default is false. + :arg verbose: When `true`, the response includes output data for + each processor in the pipeline Default is false. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -245,7 +241,7 @@ async def processor_grok( headers: Any = None, ) -> Any: """ - Returns a list of the built-in patterns. + Returns a list of built-in grok patterns. :arg error_trace: Whether to include the stack trace of returned @@ -258,7 +254,8 @@ async def processor_grok( statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Sort returned patterns by key name. Default is false. + :arg s: Determines how to sort returned grok patterns by key + name. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ diff --git a/opensearchpy/_async/client/list.py b/opensearchpy/_async/client/list.py index 8a38d00d..b5d0826c 100644 --- a/opensearchpy/_async/client/list.py +++ b/opensearchpy/_async/client/list.py @@ -87,8 +87,7 @@ async def indices( :arg index: Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. - :arg bytes: The unit used to display byte values. Valid choices - are b, g, gb, k, kb, m, mb, p, pb, t, tb. + :arg bytes: The unit used to display byte values. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg error_trace: Whether to include the stack trace of returned @@ -103,8 +102,7 @@ async def indices( `JSON`, `YAML`. :arg h: Comma-separated list of column names to display. :arg health: The health status used to limit returned indexes. - By default, the response includes indexes of any health status. Valid - choices are green, red, yellow. + By default, the response includes indexes of any health status. :arg help: Return help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. @@ -129,8 +127,7 @@ async def indices( indexes would be displayed first. Valid choices are asc, desc. :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 d, h, m, micros, ms, nanos, s. + :arg time: The unit used to display time values. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( @@ -170,8 +167,7 @@ async def shards( :arg index: A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. - :arg bytes: The unit used to display byte values. Valid choices - are b, g, gb, k, kb, m, mb, p, pb, t, tb. + :arg bytes: The unit used to display byte values. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg error_trace: Whether to include the stack trace of returned @@ -202,8 +198,7 @@ async def shards( shards would be displayed first. Valid choices are asc, desc. :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, micros, ms, nanos, s. + :arg time: The unit in which to display time values. :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( diff --git a/opensearchpy/_async/client/ltr.py b/opensearchpy/_async/client/ltr.py new file mode 100644 index 00000000..33e326f4 --- /dev/null +++ b/opensearchpy/_async/client/ltr.py @@ -0,0 +1,299 @@ +# 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 LtrClient(NamespacedClient): + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def cache_stats( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Retrieves cache statistics for all feature stores. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", "/_ltr/_cachestats", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def clear_cache( + self, + store: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Clears the store caches. + + + :arg store: The name of the feature store for which to clear the + cache. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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("_ltr", store, "_clearcache"), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def create_default_store( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Creates the default feature store. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", "/_ltr", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def create_store( + self, + store: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Creates a new feature store with the specified name. + + + :arg store: The name of the feature store. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if store in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'store'.") + + return await self.transport.perform_request( + "PUT", _make_path("_ltr", store), params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def delete_default_store( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Deletes the default feature store. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", "/_ltr", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def delete_store( + self, + store: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Deletes a feature store with the specified name. + + + :arg store: The name of the feature store. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if store in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'store'.") + + return await self.transport.perform_request( + "DELETE", _make_path("_ltr", store), params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get_store( + self, + store: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Checks if a store exists. + + + :arg store: The name of the feature store. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if store in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'store'.") + + return await self.transport.perform_request( + "GET", _make_path("_ltr", store), params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def list_stores( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Lists all available feature stores. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", "/_ltr", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout") + async def stats( + self, + node_id: Any = None, + stat: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Provides information about the current status of the LTR plugin. + + + :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 stat: Comma-separated list of stats to retrieve; use `_all` + or empty string to retrieve all stats. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: The time in milliseconds to wait for a response. + """ + return await self.transport.perform_request( + "GET", + _make_path("_plugins", "_ltr", node_id, "stats", stat), + params=params, + headers=headers, + ) diff --git a/opensearchpy/_async/client/nodes.py b/opensearchpy/_async/client/nodes.py index 3b1ce107..61a69500 100644 --- a/opensearchpy/_async/client/nodes.py +++ b/opensearchpy/_async/client/nodes.py @@ -68,9 +68,9 @@ async def reload_secure_settings( response. Default is false. :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 timeout: The amount of time 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", @@ -101,8 +101,8 @@ async def info( Returns information about nodes in the cluster. - :arg node_id: Comma-separated list of node IDs or names used to - limit returned information. + :arg node_id: A 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 node_id_or_metric: Limits the information returned to a @@ -114,17 +114,17 @@ async def info( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg flat_settings: If `true`, returns settings in flat format. - Default is false. + :arg flat_settings: When `true`, returns settings in flat + format. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :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 timeout: The amount of time 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 @@ -157,30 +157,30 @@ async def stats( Returns statistical information about nodes in the cluster. - :arg node_id: Comma-separated list of node IDs or names used to - limit returned information. + :arg node_id: A comma-separated list of node IDs or names used + to limit returned information. :arg metric: Limit the information returned to the specified - metrics + metrics. :arg index_metric: Limit the information returned for indexes - metric to the specific index metrics. It can be used only if indexes (or - all) metric is specified. - :arg completion_fields: Comma-separated list or wildcard + metric to the specified index metrics. It can be used only if indexes + (or all) metric is specified. + :arg completion_fields: A comma-separated list or wildcard expressions of fields to include in field data and suggest statistics. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. - :arg fielddata_fields: Comma-separated list or wildcard + :arg fielddata_fields: A comma-separated list or wildcard expressions of fields to include in field data statistics. - :arg fields: Comma-separated list or wildcard expressions of + :arg fields: A comma-separated list or wildcard expressions of fields to include in the statistics. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg groups: Comma-separated list of search groups to include in - the search statistics. + :arg groups: A comma-separated list of search groups to include + in the search statistics. :arg human: Whether to return human readable values for statistics. Default is True. - :arg include_segment_file_sizes: If `true`, the call reports the + :arg include_segment_file_sizes: When `true`, 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: Indicates whether statistics are aggregated at the @@ -190,9 +190,9 @@ async def stats( response. Default is false. :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 timeout: The amount of time 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. """ @@ -226,12 +226,11 @@ async def hot_threads( Returns information about hot threads on each node 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 + :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 doc_type: The type to sample. Valid choices are block, cpu, - wait. + :arg doc_type: The type to sample. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -240,19 +239,22 @@ async def hot_threads( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :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 ignore_idle_threads: Whether to 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 time interval between thread stack trace + samples. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg snapshots: Number of samples of thread stack trace. Default - is 10. + :arg snapshots: The number of thread stack trace samples to + collect. 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. + :arg threads: The number of threads to provide information for. + Default is 3. + :arg timeout: The amount of time to wait for a response. If no + response is received before the timeout expires, the request fails and + returns an error. """ # type is a reserved word so it cannot be used, use doc_type instead if "doc_type" in params: diff --git a/opensearchpy/_async/client/plugins.py b/opensearchpy/_async/client/plugins.py index d625f838..a92e06e1 100644 --- a/opensearchpy/_async/client/plugins.py +++ b/opensearchpy/_async/client/plugins.py @@ -13,15 +13,18 @@ from ..plugins.alerting import AlertingClient from ..plugins.asynchronous_search import AsynchronousSearchClient from ..plugins.flow_framework import FlowFrameworkClient +from ..plugins.geospatial import GeospatialClient from ..plugins.index_management import IndexManagementClient from ..plugins.knn import KnnClient from ..plugins.ml import MlClient +from ..plugins.neural import NeuralClient from ..plugins.notifications import NotificationsClient from ..plugins.observability import ObservabilityClient from ..plugins.ppl import PplClient from ..plugins.query import QueryClient from ..plugins.replication import ReplicationClient from ..plugins.rollups import RollupsClient +from ..plugins.sm import SmClient from ..plugins.sql import SqlClient from ..plugins.transforms import TransformsClient from .client import Client @@ -29,6 +32,7 @@ class PluginsClient(NamespacedClient): + geospatial: Any asynchronous_search: Any alerting: Any index_management: Any @@ -45,6 +49,9 @@ class PluginsClient(NamespacedClient): def __init__(self, client: Client) -> None: super().__init__(client) + self.sm = SmClient(client) + self.neural = NeuralClient(client) + self.geospatial = GeospatialClient(client) self.replication = ReplicationClient(client) self.flow_framework = FlowFrameworkClient(client) self.asynchronous_search = AsynchronousSearchClient(client) @@ -66,6 +73,9 @@ def _dynamic_lookup(self, client: Any) -> None: # Issue : https://github.com/opensearch-project/opensearch-py/issues/90#issuecomment-1003396742 plugins = [ + "sm", + "neural", + "geospatial", "replication", "flow_framework", "asynchronous_search", diff --git a/opensearchpy/_async/client/security.py b/opensearchpy/_async/client/security.py index 5271bc1a..87b2ee74 100644 --- a/opensearchpy/_async/client/security.py +++ b/opensearchpy/_async/client/security.py @@ -31,7 +31,7 @@ async def get_account_details( headers: Any = None, ) -> Any: """ - Returns account details for the current user. + Returns account information for the current user. :arg error_trace: Whether to include the stack trace of returned @@ -161,7 +161,7 @@ async def delete_action_group( headers: Any = None, ) -> Any: """ - Delete a specified action group. + Deletes the specified action group. :arg action_group: The name of the action group to delete. @@ -238,7 +238,7 @@ async def patch_action_group( headers: Any = None, ) -> Any: """ - Updates individual attributes of an action group. + Updates the individual attributes of an action group. :arg action_group: The name of the action group to update. @@ -275,7 +275,7 @@ async def patch_action_groups( headers: Any = None, ) -> Any: """ - Creates, updates, or deletes multiple action groups in a single call. + Creates, updates, or deletes multiple action groups in a single request. :arg error_trace: Whether to include the stack trace of returned @@ -310,7 +310,7 @@ async def get_user( headers: Any = None, ) -> Any: """ - Retrieve one internal user. + Retrieve information about the specified internal user. :arg username: The name of the user to retrieve. @@ -375,7 +375,7 @@ async def delete_user( headers: Any = None, ) -> Any: """ - Delete the specified user. + Deletes the specified internal user. :arg username: The name of the user to delete. @@ -414,7 +414,7 @@ async def create_user( Creates or replaces the specified user. - :arg username: The name of the user to be created. + :arg username: The name of the user to create. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -449,7 +449,7 @@ async def patch_user( headers: Any = None, ) -> Any: """ - Updates individual attributes of an internal user. + Updates individual attributes for an internal user. :arg username: The name of the user to update. @@ -486,7 +486,7 @@ async def patch_users( headers: Any = None, ) -> Any: """ - Creates, updates, or deletes multiple internal users in a single call. + Creates, updates, or deletes multiple internal users in a single request. :arg error_trace: Whether to include the stack trace of returned @@ -524,6 +524,7 @@ async def get_role( Retrieves one role. + :arg role: The name of the role to retrieve. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -582,7 +583,7 @@ async def delete_role( headers: Any = None, ) -> Any: """ - Delete the specified role. + Deletes the specified role. :arg role: The name of the role to delete. @@ -621,7 +622,7 @@ async def create_role( Creates or replaces the specified role. - :arg role: The name of the role to be created. + :arg role: The name of the role to create. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -656,7 +657,7 @@ async def patch_role( headers: Any = None, ) -> Any: """ - Updates individual attributes of a role. + Updates the individual attributes of a role. :arg role: The name of the role to update. @@ -728,9 +729,10 @@ async def get_role_mapping( headers: Any = None, ) -> Any: """ - Retrieves one role mapping. + Retrieves the specified role mapping. + :arg role: The name of the role mapping to retrieve. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -795,7 +797,8 @@ async def delete_role_mapping( Deletes the specified role mapping. - :arg role: The name of the role whose mapping needs to delete. + :arg role: The name of the role for which to delete the role's + mappings. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -831,7 +834,8 @@ async def create_role_mapping( Creates or replaces the specified role mapping. - :arg role: The name of the role to create a role mapping for. + :arg role: The name of the role for which to create a role + mapping. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -866,10 +870,10 @@ async def patch_role_mapping( headers: Any = None, ) -> Any: """ - Updates individual attributes of a role mapping. + Updates the individual attributes of a role mapping. - :arg role: The name of the role to update role-mapping for. + :arg role: The name of the role to update a role mapping for :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -903,7 +907,7 @@ async def patch_role_mappings( headers: Any = None, ) -> Any: """ - Creates or updates multiple role mappings in a single call. + Creates or updates multiple role mappings in a single request. :arg error_trace: Whether to include the stack trace of returned @@ -938,7 +942,7 @@ async def get_tenant( headers: Any = None, ) -> Any: """ - Retrieves one tenant. + Retrieves the specified tenant. :arg tenant: The name of the tenant to retrieve. @@ -1000,7 +1004,7 @@ async def delete_tenant( headers: Any = None, ) -> Any: """ - Delete the specified tenant. + Deletes the specified tenant. :arg tenant: The name of the tenant to delete. @@ -1039,7 +1043,7 @@ async def create_tenant( Creates or replaces the specified tenant. - :arg tenant: The name of the tenant to be created. + :arg tenant: The name of the tenant to create. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -1074,7 +1078,7 @@ async def patch_tenant( headers: Any = None, ) -> Any: """ - Add, delete, or modify a single tenant. + Adds, deletes, or modifies a single tenant. :arg tenant: The name of the tenant to update. @@ -1111,7 +1115,7 @@ async def patch_tenants( headers: Any = None, ) -> Any: """ - Add, delete, or modify multiple tenants in a single call. + Adds, deletes, or modifies multiple tenants in a single request. :arg error_trace: Whether to include the stack trace of returned @@ -1145,7 +1149,7 @@ async def get_configuration( headers: Any = None, ) -> Any: """ - Returns the current Security plugin configuration in JSON format. + Returns the current Security plugin configuration in a JSON format. :arg error_trace: Whether to include the stack trace of returned @@ -1176,8 +1180,8 @@ async def update_configuration( headers: Any = None, ) -> Any: """ - Adds or updates the existing configuration using the REST API. Only accessible - by admins and users with REST API access and only when put or patch is enabled. + Updates the settings for an existing security configuration. Requires super + admin or REST API permissions. :arg error_trace: Whether to include the stack trace of returned @@ -1212,9 +1216,8 @@ async def patch_configuration( headers: Any = None, ) -> Any: """ - A `PATCH` call is used to update the existing configuration using the REST API. - Only accessible by admins and users with REST API access and only when put or - patch is enabled. + Updates the existing security configuration using the REST API. Requires super + admin or REST API permissions. :arg error_trace: Whether to include the stack trace of returned @@ -1248,8 +1251,8 @@ async def get_distinguished_names( headers: Any = None, ) -> Any: """ - Retrieves distinguished names. Only accessible to super-admins and with rest- - api permissions when enabled. + Retrieves all node distinguished names. Requires super admin or REST API + permissions. :arg error_trace: Whether to include the stack trace of returned @@ -1262,8 +1265,8 @@ async def get_distinguished_names( statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg show_all: A Boolean flag to include/exclude static nodes DN - from final result. + :arg show_all: Whether to include or exclude any static node's + DN settings from the final result. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -1305,7 +1308,7 @@ async def reload_transport_certificates( headers: Any = None, ) -> Any: """ - Reload Transport layer communication certificates. + Reloads the transport communication certificates. :arg error_trace: Whether to include the stack trace of returned @@ -1335,7 +1338,7 @@ async def reload_http_certificates( headers: Any = None, ) -> Any: """ - Reload HTTP layer communication certificates. + Reloads the HTTP communication certificates. :arg error_trace: Whether to include the stack trace of returned @@ -1365,7 +1368,7 @@ async def flush_cache( headers: Any = None, ) -> Any: """ - Flushes the Security plugin user, authentication, and authorization cache. + Flushes the Security plugin's user, authentication, and authorization cache. :arg error_trace: Whether to include the stack trace of returned @@ -1392,7 +1395,7 @@ async def health( headers: Any = None, ) -> Any: """ - Checks to see if the Security plugin is up and running. + Checks to see if the Security plugin is running. :arg error_trace: Whether to include the stack trace of returned @@ -1403,9 +1406,10 @@ async def health( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg mode: A flag to indicate whether service should consider - security-plugin's status before returning health response. `strict` mode - indicates service should check Security plugin status. + :arg mode: A flag that determines whether to consider the + security status before returning a response for a health query response. + For example, `strict` mode indicates service should check the Security + plugin status. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for @@ -1485,7 +1489,7 @@ async def patch_audit_configuration( headers: Any = None, ) -> Any: """ - A PATCH call is used to update specified fields in the audit configuration. + Updates the specified fields in the audit configuration. :arg error_trace: Whether to include the stack trace of returned @@ -1520,8 +1524,8 @@ async def patch_distinguished_names( headers: Any = None, ) -> Any: """ - Bulk update of distinguished names. Only accessible to super-admins and with - rest-api permissions when enabled. + Bulk updates specified node distinguished names. Requires super admin or REST + API permissions. :arg error_trace: Whether to include the stack trace of returned @@ -1563,10 +1567,11 @@ async def authinfo( headers: Any = None, ) -> Any: """ - Returns the authentication information. + Returns or updates authentication information for the currently authenticated + user. - :arg auth_type: The type of current authentication request. + :arg auth_type: The type of the current authentication request. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -1579,8 +1584,7 @@ async def authinfo( response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. - :arg verbose: Indicates whether a verbose response should be - returned. + :arg verbose: Whether to return a verbose response. """ return await self.transport.perform_request( "GET", "/_plugins/_security/authinfo", params=params, headers=headers @@ -1593,7 +1597,7 @@ async def authtoken( headers: Any = None, ) -> Any: """ - Returns the authorization token. + Returns the authorization token for the current user. :arg error_trace: Whether to include the stack trace of returned @@ -1620,7 +1624,7 @@ async def cache( headers: Any = None, ) -> Any: """ - Not supported for cache API. + Not supported for the Cache API. :arg error_trace: Whether to include the stack trace of returned @@ -1647,8 +1651,8 @@ async def config_upgrade_check( headers: Any = None, ) -> Any: """ - Check whether or not an upgrade can be performed and what resources can be - updated. + Checks whether or not an upgrade can be performed and which security resources + can be updated. :arg error_trace: Whether to include the stack trace of returned @@ -1679,7 +1683,8 @@ async def config_upgrade_perform( headers: Any = None, ) -> Any: """ - Helps cluster operator upgrade missing defaults and stale default definitions. + Assists the cluster operator with upgrading missing default values and stale + default definitions. :arg error_trace: Whether to include the stack trace of returned @@ -1711,8 +1716,8 @@ async def create_allowlist( headers: Any = None, ) -> Any: """ - Creates or replaces the permitted APIs. Accessible using Super Admin - certificate or REST API permission. + Creates or replaces APIs permitted for users on the allow list. Requires a + super admin certificate or REST API permissions. :arg error_trace: Whether to include the stack trace of returned @@ -1747,8 +1752,8 @@ async def create_update_tenancy_config( headers: Any = None, ) -> Any: """ - Creates or replaces the multi-tenancy configuration. Only accessible to admins - and users with REST API permissions. + Creates or replaces the multi-tenancy configuration. Requires super admin or + REST API permissions. :arg error_trace: Whether to include the stack trace of returned @@ -1787,7 +1792,7 @@ async def create_user_legacy( Creates or replaces the specified user. Legacy API. - :arg username: The name of the user to be created. + :arg username: The name of the user to create. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -1821,11 +1826,11 @@ async def delete_distinguished_name( headers: Any = None, ) -> Any: """ - Deletes all distinguished names in the specified cluster or node allow list. - Only accessible to super-admins and with rest-api permissions when enabled. + Deletes all distinguished names in the specified cluster or node allowlist. + Requires super admin or REST API permissions. - :arg cluster_name: The cluster-name to delete from list of + :arg cluster_name: The cluster name to delete from list of distinguished names. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. @@ -1895,7 +1900,7 @@ async def generate_obo_token( headers: Any = None, ) -> Any: """ - Generates On-Behalf-Of token for the current user. + Generates a `On-Behalf-Of` token for the current user. :arg error_trace: Whether to include the stack trace of returned @@ -1930,11 +1935,11 @@ async def generate_user_token( headers: Any = None, ) -> Any: """ - Generates authorization token for the given user. + Generates an authorization token for the specified user. - :arg username: The name of the user for whom an auth token is to - be vended. + :arg username: The name of the user for whom to issue an + authorization token. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -1971,8 +1976,8 @@ async def generate_user_token_legacy( Generates authorization token for the given user. Legacy API. Not Implemented. - :arg username: The name of the user for whom an auth token is to - be vended. + :arg username: The name of the user for whom to issue an + authorization token. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -2003,7 +2008,7 @@ async def get_allowlist( headers: Any = None, ) -> Any: """ - Retrieves the current list of allowed API accessible to normal user. + Retrieves the current list of allowed APIs accessible to a normal user. :arg error_trace: Whether to include the stack trace of returned @@ -2030,7 +2035,8 @@ async def get_dashboards_info( headers: Any = None, ) -> Any: """ - Retrieves the current security-dashboards plugin configuration. + Retrieves the current values for dynamic security settings for OpenSearch + Dashboards. :arg error_trace: Whether to include the stack trace of returned @@ -2058,12 +2064,12 @@ async def get_distinguished_name( headers: Any = None, ) -> Any: """ - Retrieves distinguished names. Only accessible to super-admins and with rest- - api permissions when enabled. + Retrieves all node distinguished names. Requires super admin or REST API + permissions. - :arg cluster_name: The cluster-name to retrieve nodes DN setting - for. + :arg cluster_name: The name of the cluster to retrieve that + cluster's nodes DN settings. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -2074,8 +2080,8 @@ async def get_distinguished_name( statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg show_all: A Boolean flag to include/exclude static nodes DN - from final result. + :arg show_all: Whether to include or exclude any static node's + DN settings from the final result. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -2098,7 +2104,7 @@ async def get_permissions_info( headers: Any = None, ) -> Any: """ - Gets the evaluated REST API permissions for the currently logged in user. + Retrieves the evaluated REST API permissions for the currently logged in user. :arg error_trace: Whether to include the stack trace of returned @@ -2128,7 +2134,7 @@ async def get_sslinfo( headers: Any = None, ) -> Any: """ - Retrieves the SSL configuration information. + Retrieves information about the SSL configuration. :arg error_trace: Whether to include the stack trace of returned @@ -2141,8 +2147,8 @@ async def get_sslinfo( statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg show_dn: A Boolean flag to indicate whether all domain - names should be returned. + :arg show_dn: Whether to include all domain names in the + response. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -2157,8 +2163,8 @@ async def get_tenancy_config( headers: Any = None, ) -> Any: """ - Retrieves multi-tenancy configuration. Only accessible to admins and users with - REST API permissions. + Retrieves the multi-tenancy configuration. Requires super admin or REST API + permissions. :arg error_trace: Whether to include the stack trace of returned @@ -2250,7 +2256,7 @@ async def migrate( headers: Any = None, ) -> Any: """ - Migrates security configuration from v6 to v7. + Migrates the security configuration from v6 to v7. :arg error_trace: Whether to include the stack trace of returned @@ -2278,7 +2284,7 @@ async def patch_allowlist( headers: Any = None, ) -> Any: """ - Updates the current list of allowed API accessible to normal user. + Updates the current list of APIs accessible for users on the allow list. :arg error_trace: Whether to include the stack trace of returned @@ -2314,11 +2320,12 @@ async def patch_distinguished_name( headers: Any = None, ) -> Any: """ - Updates a distinguished cluster name for a specific cluster. Only accessible to - super-admins and with rest-api permissions when enabled. + Updates the distinguished cluster name for the specified cluster. Requires + super admin or REST API permissions. - :arg cluster_name: The cluster name to update `nodesDn` value. + :arg cluster_name: The cluster name to update the `nodesDn` + value. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -2352,7 +2359,8 @@ async def post_dashboards_info( headers: Any = None, ) -> Any: """ - Updates the current security-dashboards plugin configuration. + Retrieves the current values for dynamic security settings for OpenSearch + Dashboards. :arg error_trace: Whether to include the stack trace of returned @@ -2379,8 +2387,8 @@ async def tenant_info( headers: Any = None, ) -> Any: """ - Retrieves the tenant names if any exist. Only accessible to super admins or - kibanaserver user. + Retrieves the names of current tenants. Requires super admin or `kibanaserver` + permissions. :arg error_trace: Whether to include the stack trace of returned @@ -2409,13 +2417,12 @@ async def update_distinguished_name( headers: Any = None, ) -> Any: """ - Adds or updates the specified distinguished names in the cluster or node allow - list. Only accessible to super-admins and with rest-api permissions when - enabled. + Adds or updates the specified distinguished names in the cluster or node + allowlist. Requires super admin or REST API permissions. - :arg cluster_name: The cluster-name to create/update `nodesDn` - value for. + :arg cluster_name: The name of the cluster containing the + `nodesDn` value to create or update. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -2455,8 +2462,8 @@ async def validate( to v7. - :arg accept_invalid: A Boolean flag to indicate whether invalid - v6 configuration should be allowed. + :arg accept_invalid: Whether an invalid v6 configuration should + be allowed. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -2481,7 +2488,7 @@ async def who_am_i( headers: Any = None, ) -> Any: """ - Gets the user identity related information for currently logged in user. + Gets the identity information for the user currently logged in. :arg error_trace: Whether to include the stack trace of returned @@ -2508,9 +2515,9 @@ async def who_am_i_protected( headers: Any = None, ) -> Any: """ - Gets the user identity related information for currently logged in user. User - needs to have access to this endpoint when authorization at REST layer is - enabled. + Gets the identity information for the user currently logged in. To use this + operation, you must have access to this endpoint when authorization at REST + layer is enabled. :arg error_trace: Whether to include the stack trace of returned @@ -2548,8 +2555,8 @@ async def get_all_certificates( Retrieves the cluster security certificates. - :arg cert_type: The type of certificates (HTTP, TRANSPORT, ALL) - to retrieve from all nodes. + :arg cert_type: The type of certificates (`HTTP`, `TRANSPORT`, + or `ALL`) to retrieve from all nodes. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -2562,8 +2569,8 @@ async def get_all_certificates( response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. - :arg timeout: The maximum duration, in seconds, to be spent to - retrieve certificates from all nodes. + :arg timeout: The maximum duration, in seconds, to spend + retrieving certificates from all nodes before a timeout. """ return await self.transport.perform_request( "GET", @@ -2588,12 +2595,12 @@ async def get_node_certificates( headers: Any = None, ) -> Any: """ - Retrieves the given node's security certificates. + Retrieves the specified node's security certificates. - :arg node_id: The full-id of the node to retrieve certificates. - :arg cert_type: The type of certificates (HTTP, TRANSPORT, ALL) - to retrieve for a node. + :arg node_id: The node ID to retrieve certificates for. + :arg cert_type: The type of certificates (`HTTP`, `TRANSPORT`, + or `ALL`) to retrieve from a node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -2606,8 +2613,8 @@ async def get_node_certificates( response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. - :arg timeout: The maximum duration, in seconds, to be spent to - retrieve a node's certificates. + :arg timeout: The maximum duration, in seconds, to spend + retrieving certificates from all nodes before a timeout. """ if node_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'node_id'.") diff --git a/opensearchpy/_async/client/snapshot.py b/opensearchpy/_async/client/snapshot.py index f7029ffd..65037d01 100644 --- a/opensearchpy/_async/client/snapshot.py +++ b/opensearchpy/_async/client/snapshot.py @@ -59,15 +59,19 @@ async def create( headers: Any = None, ) -> Any: """ - Creates a snapshot in a repository. + Creates a snapshot within an existing repository. - :arg repository: Repository for the snapshot. - :arg snapshot: Name of the snapshot. Must be unique in the + :arg repository: The name of the repository where the snapshot + will be stored. + :arg snapshot: The 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 body: The snapshot definition. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -84,9 +88,9 @@ async def create( response. Default is false. :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. Default is false. + :arg wait_for_completion: When `true`, the request returns a + response when the snapshot is complete. When `false`, the request + returns a response when the snapshot initializes. Default is false. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -120,10 +124,14 @@ async def delete( Deletes a snapshot. - :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 repository: The name of the snapshot repository to delete. + :arg snapshot: A comma-separated list of snapshot names to + delete from the repository. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -173,15 +181,18 @@ async def get( Returns information about a snapshot. - :arg repository: Comma-separated list of snapshot repository + :arg repository: A 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 snapshot: A comma-separated list of snapshot names to + retrieve. Also accepts wildcard expressions. (`*`). - 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: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -190,7 +201,7 @@ async def get( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg ignore_unavailable: If `false`, the request returns an + :arg ignore_unavailable: When `false`, the request returns an error for any snapshots that are unavailable. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use `cluster_manager_timeout` instead.): Period to wait for a connection @@ -200,10 +211,10 @@ async def get( response. Default is false. :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 + :arg verbose: When `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. + contained in the snapshot. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -233,13 +244,16 @@ async def delete_repository( headers: Any = None, ) -> Any: """ - Deletes a repository. + Deletes a snapshot repository. - :arg repository: Name of the snapshot repository to unregister. - Wildcard (`*`) patterns are supported. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg repository: The name of the snapshot repository to + unregister. Wildcard (`*`) patterns are supported. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -255,7 +269,7 @@ async def delete_repository( response. Default is false. :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 timeout: The amount of time to wait for a response. """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -284,12 +298,15 @@ async def get_repository( headers: Any = None, ) -> Any: """ - Returns information about a repository. + Returns information about a snapshot repository. - :arg repository: A comma-separated list of repository names - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg repository: A comma-separated list of repository names. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -298,8 +315,8 @@ async def get_repository( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Whether to get information from the local node. + Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use `cluster_manager_timeout` instead.): Explicit operation timeout for connection to cluster-manager node @@ -331,13 +348,16 @@ async def create_repository( headers: Any = None, ) -> Any: """ - Creates a repository. + Creates a snapshot repository. - :arg repository: A repository name - :arg body: The repository definition - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg repository: The name for the newly registered repository. + :arg body: The repository definition. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -353,8 +373,9 @@ async def create_repository( response. Default is false. :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 + :arg timeout: The amount of time to wait for a response. + :arg verify: When `true`, verifies the creation of the snapshot + repository. """ for param in (repository, body): if param in SKIP_IN_PATH: @@ -390,11 +411,16 @@ async def restore( Restores a snapshot. - :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 repository: The name of the repository containing the + snapshot + :arg snapshot: The name of the snapshot to restore. + :arg body: Determines which settings and indexes to restore when + restoring a snapshot + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -410,8 +436,11 @@ async def restore( response. Default is false. :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. + :arg wait_for_completion: -| Whether to return a response after + the restore operation has completed. When `false`, the request returns a + response when the restore operation initializes. When `true`, the + request returns a response when the restore operation completes. Default + is false. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -446,10 +475,14 @@ async def status( Returns information about the status of a snapshot. - :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 repository: The name of the repository containing the + snapshot. + :arg snapshot: A comma-separated list of snapshot names. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -458,9 +491,9 @@ async def status( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg ignore_unavailable: Whether to ignore unavailable - snapshots, defaults to `false` which means a SnapshotMissingException is - thrown Default is false. + :arg ignore_unavailable: Whether to ignore any unavailable + snapshots, When `false`, a `SnapshotMissingException` is thrown. Default + is false. :arg master_timeout (Deprecated: To promote inclusive language, use `cluster_manager_timeout` instead.): Explicit operation timeout for connection to cluster-manager node @@ -496,9 +529,13 @@ async def verify_repository( Verifies a repository. - :arg repository: A repository name - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg repository: The name of the repository containing the + snapshot. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -514,7 +551,7 @@ async def verify_repository( response. Default is false. :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 timeout: The amount of time to wait for a response. """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -543,12 +580,15 @@ async def cleanup_repository( headers: Any = None, ) -> Any: """ - Removes stale data from repository. + Removes any stale data from a snapshot repository. :arg repository: Snapshot repository to clean up. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -564,7 +604,7 @@ async def cleanup_repository( response. Default is false. :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. + :arg timeout: The amount of time to wait for a response. """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -595,15 +635,20 @@ async def clone( headers: Any = None, ) -> Any: """ - Clones indexes from one snapshot into another snapshot in the same repository. - - - :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. + Creates a clone of all or part of a snapshot in the same repository as the + original snapshot. + + + :arg repository: The name of repository which will contain the + snapshots clone. + :arg snapshot: The name of the original snapshot. + :arg target_snapshot: The name of the cloned snapshot. + :arg body: The snapshot clone definition. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter diff --git a/opensearchpy/_async/client/tasks.py b/opensearchpy/_async/client/tasks.py index 98bede8e..b529f7cc 100644 --- a/opensearchpy/_async/client/tasks.py +++ b/opensearchpy/_async/client/tasks.py @@ -64,9 +64,9 @@ async def list( Returns a list of tasks. - :arg actions: Comma-separated list or wildcard expression of - actions used to limit the request. - :arg detailed: If `true`, the response includes detailed + :arg actions: A comma-separated list of actions that should be + returned. Keep empty to return all. + :arg detailed: When `true`, the response includes detailed information about shard recoveries. Default is false. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. @@ -74,26 +74,25 @@ async def list( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg group_by: Key used to group tasks in the response. Valid - choices are nodes, none, parents. + :arg group_by: Groups tasks by parent/child relationships or + nodes. Valid choices are nodes, none, parents. :arg human: Whether to return human readable values for statistics. Default is True. - :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: Parent task ID used to limit returned - information. To return all tasks, omit this parameter or use a value of - `-1`. + :arg nodes: A comma-separated list of node IDs or names used to + limit the returned information. Use `_local` to return information from + the node you're connecting to, specify the node name to get information + from a specific node, or keep the parameter empty to get information + from all nodes. + :arg parent_task_id: Returns tasks with a specified parent task + ID (`node_id:task_number`). Keep empty or set to -1 to return all. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :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. Default is false. + :arg timeout: The amount of time to wait for a response. + :arg wait_for_completion: Waits for the matching task to + complete. When `true`, the request is blocked until the task has + completed. Default is false. """ return await self.transport.perform_request( "GET", "/_tasks", params=params, headers=headers @@ -120,9 +119,9 @@ async def cancel( Cancels a task, if it can be cancelled through an API. - :arg task_id: ID of the task. - :arg actions: Comma-separated list or wildcard expression of - actions used to limit the request. + :arg task_id: The task ID. + :arg actions: A comma-separated list of actions that should be + returned. Keep empty to return all. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -131,16 +130,20 @@ async def cancel( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :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 nodes: A comma-separated list of node IDs or names used to + limit the returned information. Use `_local` to return information from + the node you're connecting to, specify the node name to get information + from a specific node, or keep the parameter empty to get information + from all nodes. + :arg parent_task_id: Returns tasks with a specified parent task + ID (`node_id:task_number`). Keep empty or set to -1 to return all. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :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 Default is false. + :arg wait_for_completion: Waits for the matching task to + complete. When `true`, the request is blocked until the task has + completed. Default is false. """ return await self.transport.perform_request( "POST", @@ -168,7 +171,7 @@ async def get( Returns information about a task. - :arg task_id: ID of the task. + :arg task_id: The task ID. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -181,11 +184,10 @@ async def get( response. Default is false. :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. Default is false. + :arg timeout: The amount of time to wait for a response. + :arg wait_for_completion: Waits for the matching task to + complete. When `true`, the request is blocked until the task has + completed. Default is false. """ if task_id in SKIP_IN_PATH: warnings.warn( diff --git a/opensearchpy/_async/plugins/asynchronous_search.py b/opensearchpy/_async/plugins/asynchronous_search.py index 33e218de..fb9cac11 100644 --- a/opensearchpy/_async/plugins/asynchronous_search.py +++ b/opensearchpy/_async/plugins/asynchronous_search.py @@ -30,7 +30,7 @@ async def delete( headers: Any = None, ) -> Any: """ - Delete asynchronous search. + Deletes any responses from an asynchronous search. :arg error_trace: Whether to include the stack trace of returned @@ -64,7 +64,7 @@ async def get( headers: Any = None, ) -> Any: """ - Get partial responses from asynchronous search. + Gets partial responses from an asynchronous search. :arg error_trace: Whether to include the stack trace of returned @@ -108,7 +108,7 @@ async def search( headers: Any = None, ) -> Any: """ - Perform an asynchronous search. + Performs an asynchronous search. :arg error_trace: Whether to include the stack trace of returned @@ -124,19 +124,20 @@ async def search( expression of index names. :arg keep_alive: The amount of time that the result is saved in the cluster. For example, `2d` means that the results are stored in the - cluster for 48 hours. The saved search results are deleted after this + cluster for 48 hours. The saved search results are deleted after this period or if the search is canceled. Note that this includes the query - execution time. If the query overruns this time, the process cancels - this query automatically. - :arg keep_on_completion: Whether you want to save the results in - the cluster after the search is complete. + execution time. If the query exceeds this amount of time, the process + cancels this query automatically. + :arg keep_on_completion: Whether to save the results in the + cluster after the search is complete. You can examine the stored results + at a later time. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :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_timeout: The amount of time that you - plan to wait for the results. You can poll the remaining results based - on an ID. The maximum value is `300s`. Default is `1s`. + :arg wait_for_completion_timeout: The amount of time to wait for + the results. You can poll the remaining results based on an ID. The + maximum value is 300 seconds. Default is `1s`. """ return await self.transport.perform_request( "POST", @@ -153,8 +154,8 @@ async def stats( headers: Any = None, ) -> Any: """ - Monitoring of asynchronous searches that are running, completed, and/or - persisted. + Monitors any asynchronous searches that are `running`, `completed`, or + `persisted`. :arg error_trace: Whether to include the stack trace of returned diff --git a/opensearchpy/_async/plugins/flow_framework.py b/opensearchpy/_async/plugins/flow_framework.py index 8fc75a2c..b1fd1ad3 100644 --- a/opensearchpy/_async/plugins/flow_framework.py +++ b/opensearchpy/_async/plugins/flow_framework.py @@ -41,7 +41,7 @@ async def create( headers: Any = None, ) -> Any: """ - Create a workflow. + Creates a new workflow template. :arg error_trace: Whether to include the stack trace of returned @@ -56,8 +56,7 @@ async def create( response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. - :arg use_case: To use a workflow template, specify it in the - `use_case` query parameter when creating a workflow. + :arg use_case: Specifies the workflow template to use. """ return await self.transport.perform_request( "POST", @@ -77,7 +76,7 @@ async def delete( headers: Any = None, ) -> Any: """ - Delete a workflow. + Deletes a workflow template. :arg error_trace: Whether to include the stack trace of returned @@ -115,7 +114,7 @@ async def deprovision( headers: Any = None, ) -> Any: """ - Deprovision workflow's resources when you no longer need it. + Deprovision workflow's resources when you no longer need them. :arg error_trace: Whether to include the stack trace of returned @@ -153,7 +152,7 @@ async def get( headers: Any = None, ) -> Any: """ - Get a workflow. + Retrieves a workflow template. :arg error_trace: Whether to include the stack trace of returned @@ -189,11 +188,11 @@ async def get_status( headers: Any = None, ) -> Any: """ - Get the provisioning deployment status until it is complete. + Retrieves the current workflow provisioning status. - :arg all: The all parameter specifies whether the response - should return all fields. Default is false. + :arg all: Whether to return all fields in the response. Default + is false. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -230,7 +229,7 @@ async def get_steps( headers: Any = None, ) -> Any: """ - Get a list of workflow steps. + Retrieves available workflow steps. :arg error_trace: Whether to include the stack trace of returned @@ -384,8 +383,7 @@ async def update( headers: Any = None, ) -> Any: """ - Update a workflow. You can only update a complete workflow if it has not yet - been provisioned. + Updates a workflow template that has not been provisioned. :arg error_trace: Whether to include the stack trace of returned @@ -400,8 +398,7 @@ async def update( response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. - :arg use_case: To use a workflow template, specify it in the - `use_case` query parameter when creating a workflow. + :arg use_case: Specifies the workflow template to use. """ if workflow_id in SKIP_IN_PATH: raise ValueError( diff --git a/opensearchpy/_async/plugins/geospatial.py b/opensearchpy/_async/plugins/geospatial.py new file mode 100644 index 00000000..1570884c --- /dev/null +++ b/opensearchpy/_async/plugins/geospatial.py @@ -0,0 +1,269 @@ +# 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 GeospatialClient(NamespacedClient): + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def delete_ip2geo_datasource( + self, + name: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Delete a specific IP2Geo data source. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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'.") + + return await self.transport.perform_request( + "DELETE", + _make_path("_plugins", "geospatial", "ip2geo", "datasource", name), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def geojson_upload_post( + self, + body: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Use an OpenSearch query to upload `GeoJSON`, operation will fail if index + exists. - When type is `geo_point`, only Point geometry is allowed - When type + is `geo_shape`, all geometry types are allowed (Point, MultiPoint, LineString, + MultiLineString, Polygon, MultiPolygon, GeometryCollection, Envelope). + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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/geospatial/geojson/_upload", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def geojson_upload_put( + self, + body: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Use an OpenSearch query to upload `GeoJSON` regardless if index exists. - When + type is `geo_point`, only Point geometry is allowed - When type is `geo_shape`, + all geometry types are allowed (Point, MultiPoint, LineString, MultiLineString, + Polygon, MultiPolygon, GeometryCollection, Envelope). + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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( + "PUT", + "/_plugins/geospatial/geojson/_upload", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get_ip2geo_datasource( + self, + name: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get one or more IP2Geo data sources, defaulting to returning all if no names + specified. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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("_plugins", "geospatial", "ip2geo", "datasource", name), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get_upload_stats( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Retrieves statistics for all geospatial uploads. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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/geospatial/_upload/stats", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def put_ip2geo_datasource( + self, + name: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Create a specific IP2Geo data source. Default values: - `endpoint`: + `"https://geoip.maps.opensearch.org/v1/geolite2-city/manifest.json"` - + `update_interval_in_days`: 3. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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'.") + + return await self.transport.perform_request( + "PUT", + _make_path("_plugins", "geospatial", "ip2geo", "datasource", name), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def put_ip2geo_datasource_settings( + self, + name: Any, + body: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Update a specific IP2Geo data source. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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: + raise ValueError("Empty value passed for a required argument.") + + return await self.transport.perform_request( + "PUT", + _make_path( + "_plugins", "geospatial", "ip2geo", "datasource", name, "_settings" + ), + params=params, + headers=headers, + body=body, + ) diff --git a/opensearchpy/_async/plugins/knn.py b/opensearchpy/_async/plugins/knn.py index 8cf7fa42..0aab0c74 100644 --- a/opensearchpy/_async/plugins/knn.py +++ b/opensearchpy/_async/plugins/knn.py @@ -175,7 +175,7 @@ async def search_models( trips should be minimized as part of cross-cluster search requests execution. Default is True. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. + query (AND or OR). Valid choices are and, AND, or, 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 @@ -223,8 +223,7 @@ async def search_models( :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 - dfs_query_then_fetch, query_then_fetch. + :arg search_type: Search operation type. :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. @@ -310,7 +309,7 @@ async def stats( ) async def train_model( self, - body: Any, + body: Any = None, model_id: Any = None, params: Any = None, headers: Any = None, @@ -335,9 +334,6 @@ async def train_model( :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", _make_path("_plugins", "_knn", "models", model_id, "_train"), diff --git a/opensearchpy/_async/plugins/ml.py b/opensearchpy/_async/plugins/ml.py index d4c10f54..d8c8f541 100644 --- a/opensearchpy/_async/plugins/ml.py +++ b/opensearchpy/_async/plugins/ml.py @@ -251,7 +251,7 @@ async def search_models( libraries that do not accept a request body for non-POST requests. """ return await self.transport.perform_request( - "GET", + "POST", "/_plugins/_ml/models/_search", params=params, headers=headers, @@ -295,7 +295,8 @@ async def deploy_model( @query_params("error_trace", "filter_path", "human", "pretty", "source") async def undeploy_model( self, - model_id: Any, + body: Any = None, + model_id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -316,14 +317,12 @@ async def undeploy_model( :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'.") - return await self.transport.perform_request( "POST", _make_path("_plugins", "_ml", "models", model_id, "_undeploy"), params=params, headers=headers, + body=body, ) @query_params("error_trace", "filter_path", "human", "pretty", "source") @@ -493,3 +492,1579 @@ async def register_agents( headers=headers, body=body, ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def chunk_model( + self, + model_id: Any, + chunk_number: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Uploads model chunk. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + from warnings import warn + + warn("Deprecated: Use `upload_chunk` instead.") + for param in (model_id, chunk_number): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return await self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "models", model_id, "chunk", chunk_number), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def create_controller( + self, + model_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Creates a controller. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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'.") + + return await self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "controllers", model_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def create_memory( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Create a memory. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", "/_plugins/_ml/memory", params=params, headers=headers, body=body + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def create_message( + self, + memory_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Create a message. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if memory_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'memory_id'.") + + return await self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "memory", memory_id, "messages"), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def create_model_meta( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Registers model metadata. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + from warnings import warn + + warn("Deprecated: Use `_register_meta` instead.") + return await self.transport.perform_request( + "POST", + "/_plugins/_ml/models/meta", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def delete_controller( + self, + model_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Deletes a controller. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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'.") + + return await self.transport.perform_request( + "DELETE", + _make_path("_plugins", "_ml", "controllers", model_id), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def delete_memory( + self, + memory_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Delete a memory. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if memory_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'memory_id'.") + + return await self.transport.perform_request( + "DELETE", + _make_path("_plugins", "_ml", "memory", memory_id), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def execute_agent( + self, + agent_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Execute an agent. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if agent_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'agent_id'.") + + return await self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "agents", agent_id, "_execute"), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def execute_algorithm( + self, + algorithm_name: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Execute an algorithm. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if algorithm_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'algorithm_name'." + ) + + return await self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "_execute", algorithm_name), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get_agent( + self, + agent_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get an agent. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if agent_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'agent_id'.") + + return await self.transport.perform_request( + "GET", + _make_path("_plugins", "_ml", "agents", agent_id), + params=params, + headers=headers, + ) + + @query_params( + "error_trace", + "filter_path", + "human", + "max_results", + "next_token", + "pretty", + "source", + ) + async def get_all_memories( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get all memories. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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/_ml/memory", params=params, headers=headers + ) + + @query_params( + "error_trace", + "filter_path", + "human", + "max_results", + "next_token", + "pretty", + "source", + ) + async def get_all_messages( + self, + memory_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get all messages in a memory. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if memory_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'memory_id'.") + + return await self.transport.perform_request( + "GET", + _make_path("_plugins", "_ml", "memory", memory_id, "messages"), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get_all_tools( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get tools. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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/_ml/tools", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get_connector( + self, + connector_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Retrieves a standalone connector. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if connector_id in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'connector_id'." + ) + + return await self.transport.perform_request( + "GET", + _make_path("_plugins", "_ml", "connectors", connector_id), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get_controller( + self, + model_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Retrieves a controller. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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'.") + + return await self.transport.perform_request( + "GET", + _make_path("_plugins", "_ml", "controllers", model_id), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get_memory( + self, + memory_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get a memory. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if memory_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'memory_id'.") + + return await self.transport.perform_request( + "GET", + _make_path("_plugins", "_ml", "memory", memory_id), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get_message( + self, + message_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get a message. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if message_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'message_id'.") + + return await self.transport.perform_request( + "GET", + _make_path("_plugins", "_ml", "memory", "message", message_id), + params=params, + headers=headers, + ) + + @query_params( + "error_trace", + "filter_path", + "human", + "max_results", + "next_token", + "pretty", + "source", + ) + async def get_message_traces( + self, + message_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get a message traces. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if message_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'message_id'.") + + return await self.transport.perform_request( + "GET", + _make_path("_plugins", "_ml", "memory", "message", message_id, "traces"), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get_model( + self, + model_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Retrieves a model. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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'.") + + return await self.transport.perform_request( + "GET", + _make_path("_plugins", "_ml", "models", model_id), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get_profile( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get a profile. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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/_ml/profile", params=params, headers=headers, body=body + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get_profile_models( + self, + body: Any = None, + model_id: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get a profile models. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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("_plugins", "_ml", "profile", "models", model_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get_profile_tasks( + self, + body: Any = None, + task_id: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get a profile tasks. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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("_plugins", "_ml", "profile", "tasks", task_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get_stats( + self, + node_id: Any = None, + stat: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get stats. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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("_plugins", "_ml", node_id, "stats", stat), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get_tool( + self, + tool_name: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get tools. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if tool_name in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'tool_name'.") + + return await self.transport.perform_request( + "GET", + _make_path("_plugins", "_ml", "tools", tool_name), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def load_model( + self, + model_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Deploys a model. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + from warnings import warn + + warn("Deprecated: Use `deploy_model` instead.") + if model_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'model_id'.") + + return await self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "models", model_id, "_load"), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def predict( + self, + algorithm_name: Any, + model_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Predicts new data with trained model. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + for param in (algorithm_name, model_id): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return await self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "_predict", algorithm_name, model_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def predict_model( + self, + model_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Predicts a model. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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'.") + + return await self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "models", model_id, "_predict"), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def register_model_meta( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Registers model metadata. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", + "/_plugins/_ml/models/_register_meta", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def search_agents( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Search agents. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", + "/_plugins/_ml/agents/_search", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def search_connectors( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Searches for standalone connectors. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", + "/_plugins/_ml/connectors/_search", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def search_memory( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Search memory. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", + "/_plugins/_ml/memory/_search", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def search_message( + self, + memory_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Search messages. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if memory_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'memory_id'.") + + return await self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "memory", memory_id, "_search"), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def search_model_group( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Searches for model groups. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", + "/_plugins/_ml/model_groups/_search", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def search_tasks( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Searches for tasks. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", + "/_plugins/_ml/tasks/_search", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def train( + self, + algorithm_name: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Trains a model synchronously. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if algorithm_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'algorithm_name'." + ) + + return await self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "_train", algorithm_name), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def train_predict( + self, + algorithm_name: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Trains a model and predicts against the same training dataset. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if algorithm_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'algorithm_name'." + ) + + return await self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "_train_predict", algorithm_name), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def unload_model( + self, + body: Any = None, + model_id: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Unloads a model. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + from warnings import warn + + warn("Deprecated: Use `undeploy_model` instead.") + return await self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "models", model_id, "_unload"), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def update_connector( + self, + connector_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Updates a standalone connector. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if connector_id in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'connector_id'." + ) + + return await self.transport.perform_request( + "PUT", + _make_path("_plugins", "_ml", "connectors", connector_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def update_controller( + self, + model_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Updates a controller. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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'.") + + return await self.transport.perform_request( + "PUT", + _make_path("_plugins", "_ml", "controllers", model_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def update_memory( + self, + memory_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Update a memory. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if memory_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'memory_id'.") + + return await self.transport.perform_request( + "PUT", + _make_path("_plugins", "_ml", "memory", memory_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def update_message( + self, + message_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Update a message. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if message_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'message_id'.") + + return await self.transport.perform_request( + "PUT", + _make_path("_plugins", "_ml", "memory", "message", message_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def update_model( + self, + model_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Updates a model. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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'.") + + return await self.transport.perform_request( + "PUT", + _make_path("_plugins", "_ml", "models", model_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def update_model_group( + self, + model_group_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Updates a model group. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if model_group_id in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'model_group_id'." + ) + + return await self.transport.perform_request( + "PUT", + _make_path("_plugins", "_ml", "model_groups", model_group_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def upload_chunk( + self, + model_id: Any, + chunk_number: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Uploads model chunk. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + for param in (model_id, chunk_number): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return await self.transport.perform_request( + "POST", + _make_path( + "_plugins", "_ml", "models", model_id, "upload_chunk", chunk_number + ), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def upload_model( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Registers a model. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + from warnings import warn + + warn("Deprecated: Use `register_model` instead.") + return await self.transport.perform_request( + "POST", + "/_plugins/_ml/models/_upload", + params=params, + headers=headers, + body=body, + ) diff --git a/opensearchpy/_async/plugins/neural.py b/opensearchpy/_async/plugins/neural.py new file mode 100644 index 00000000..66322176 --- /dev/null +++ b/opensearchpy/_async/plugins/neural.py @@ -0,0 +1,77 @@ +# 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 NamespacedClient, _make_path, query_params + + +class NeuralClient(NamespacedClient): + @query_params( + "error_trace", + "filter_path", + "flat_stat_paths", + "human", + "include_metadata", + "pretty", + "source", + ) + async def stats( + self, + node_id: Any = None, + stat: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Provides information about the current status of the neural-search plugin. + + + :arg node_id: Comma-separated list of node IDs or names to limit + the returned information; leave empty to get information from all nodes. + :arg stat: Comma-separated list of stats to retrieve; use empty + string to retrieve all stats. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg flat_stat_paths: Whether to return stats in the flat form, + which can improve readability, especially for heavily nested stats. For + example, the flat form of `"processors": { "ingest": { + "text_embedding_executions": 20181212 } }` is + `"processors.ingest.text_embedding_executions": "20181212"`. Default is + false. + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg include_metadata: Whether to return stat metadata instead + of the raw stat value, includes additional information about the stat. + These can include things like type hints, time since last stats being + recorded, or recent rolling interval values Default is false. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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("_plugins", "_neural", node_id, "stats", stat), + params=params, + headers=headers, + ) diff --git a/opensearchpy/_async/plugins/observability.py b/opensearchpy/_async/plugins/observability.py index 1242171d..35f9b7a9 100644 --- a/opensearchpy/_async/plugins/observability.py +++ b/opensearchpy/_async/plugins/observability.py @@ -65,7 +65,7 @@ async def delete_object( Deletes specific observability object specified by ID. - :arg object_id: The ID of the Observability Object. + :arg object_id: The ID of the observability object to delete. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -115,10 +115,10 @@ async def delete_objects( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg objectId: The ID of a single Observability Object to + :arg objectId: The ID of a single observability object to delete. - :arg objectIdList: A comma-separated list of Observability - Object IDs to delete. + :arg objectIdList: A comma-separated list of observability + object IDs to delete. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for @@ -135,7 +135,7 @@ async def get_localstats( headers: Any = None, ) -> Any: """ - Retrieves Local Stats of all observability objects. + Retrieves local stats of all observability objects. :arg error_trace: Whether to include the stack trace of returned @@ -169,7 +169,7 @@ async def get_object( Retrieves specific observability object specified by ID. - :arg object_id: The ID of the Observability Object. + :arg object_id: The ID of the observability object to retrieve. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -232,7 +232,7 @@ async def update_object( Updates an existing observability object. - :arg object_id: The ID of the Observability Object. + :arg object_id: The ID of the observability object to update. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter diff --git a/opensearchpy/_async/plugins/ppl.py b/opensearchpy/_async/plugins/ppl.py index 1fc4e564..6d7440e6 100644 --- a/opensearchpy/_async/plugins/ppl.py +++ b/opensearchpy/_async/plugins/ppl.py @@ -32,7 +32,7 @@ async def explain( headers: Any = None, ) -> Any: """ - Shows how a query is executed against OpenSearch. + Returns the execution plan for a PPL query. :arg error_trace: Whether to include the stack trace of returned @@ -41,14 +41,13 @@ async def explain( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON, YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg sanitize: Specifies whether to escape special characters in - the results. Default is True. + :arg sanitize: Whether to escape special characters in the + results. Default is True. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -68,7 +67,7 @@ async def get_stats( headers: Any = None, ) -> Any: """ - Collect metrics for the plugin within the interval. + Retrieves performance metrics for the PPL plugin. :arg error_trace: Whether to include the stack trace of returned @@ -77,14 +76,13 @@ async def get_stats( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON, YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg sanitize: Specifies whether to escape special characters in - the results. Default is True. + :arg sanitize: Whether to escape special characters in the + results. Default is True. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -102,8 +100,7 @@ async def post_stats( headers: Any = None, ) -> Any: """ - By a stats endpoint, you are able to collect metrics for the plugin within the - interval. + Retrieves filtered performance metrics for the PPL plugin. :arg error_trace: Whether to include the stack trace of returned @@ -112,14 +109,13 @@ async def post_stats( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON, YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg sanitize: Specifies whether to escape special characters in - the results. Default is True. + :arg sanitize: Whether to escape special characters in the + results. Default is True. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -140,7 +136,7 @@ async def query( headers: Any = None, ) -> Any: """ - Send a PPL query to the PPL plugin. + Executes a PPL query against OpenSearch indexes. :arg error_trace: Whether to include the stack trace of returned @@ -149,14 +145,13 @@ async def query( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON OR YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg sanitize: Specifies whether to escape special characters in - the results. Default is True. + :arg sanitize: Whether to sanitize special characters in the + results. Default is True. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ diff --git a/opensearchpy/_async/plugins/query.py b/opensearchpy/_async/plugins/query.py index 93f7db1c..28d69dc8 100644 --- a/opensearchpy/_async/plugins/query.py +++ b/opensearchpy/_async/plugins/query.py @@ -30,10 +30,10 @@ async def datasource_delete( headers: Any = None, ) -> Any: """ - Deletes specific datasource specified by name. + Deletes a specific data source by name. - :arg datasource_name: The Name of the DataSource to delete. + :arg datasource_name: The name of the data source to delete. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -67,10 +67,10 @@ async def datasource_retrieve( headers: Any = None, ) -> Any: """ - Retrieves specific datasource specified by name. + Retrieves a specific data source by name. - :arg datasource_name: The Name of the DataSource to retrieve. + :arg datasource_name: The name of the data source to retrieve. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -104,7 +104,7 @@ async def datasources_create( headers: Any = None, ) -> Any: """ - Creates a new query datasource. + Creates a new query data source. :arg error_trace: Whether to include the stack trace of returned @@ -135,7 +135,7 @@ async def datasources_list( headers: Any = None, ) -> Any: """ - Retrieves list of all datasources. + Retrieves a list of all available data sources. :arg error_trace: Whether to include the stack trace of returned @@ -163,7 +163,7 @@ async def datasources_update( headers: Any = None, ) -> Any: """ - Updates an existing query datasource. + Updates an existing query data source. :arg error_trace: Whether to include the stack trace of returned diff --git a/opensearchpy/_async/plugins/replication.py b/opensearchpy/_async/plugins/replication.py index bdd9186d..296edd0f 100644 --- a/opensearchpy/_async/plugins/replication.py +++ b/opensearchpy/_async/plugins/replication.py @@ -29,7 +29,7 @@ async def autofollow_stats( headers: Any = None, ) -> Any: """ - Gets information about auto-follow activity and any replication rules + Retrieves information about any auto-follow activity and any replication rules configured on the specified cluster. @@ -61,7 +61,7 @@ async def create_replication_rule( headers: Any = None, ) -> Any: """ - Automatically starts replication on indexes matching a specified pattern. + Automatically starts the replication on indexes matching a specified pattern. :arg error_trace: Whether to include the stack trace of returned @@ -130,7 +130,8 @@ async def follower_stats( headers: Any = None, ) -> Any: """ - Gets information about follower (syncing) indexes on a specified cluster. + Retrieves information about any follower (syncing) indexes on a specified + cluster. :arg error_trace: Whether to include the stack trace of returned @@ -160,7 +161,8 @@ async def leader_stats( headers: Any = None, ) -> Any: """ - Gets information about replicated leader indexes on a specified cluster. + Retrieves information about any replicated leader indexes on a specified + cluster. :arg error_trace: Whether to include the stack trace of returned @@ -189,11 +191,11 @@ async def pause( headers: Any = None, ) -> Any: """ - Pauses replication of the leader index. + Pauses the replication of the leader index. - :arg index: Name of the data stream, index, or index alias to - perform bulk actions on. + :arg index: The name of the data stream, index, or index alias + to perform bulk actions on. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -231,8 +233,8 @@ async def resume( Resumes replication of the leader index. - :arg index: Name of the data stream, index, or index alias to - perform bulk actions on. + :arg index: The name of the data stream, index, or index alias + to perform bulk actions on. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -267,12 +269,12 @@ async def start( headers: Any = None, ) -> Any: """ - Initiate replication of an index from the leader cluster to the follower + Initiates the replication of an index from the leader cluster to the follower cluster. - :arg index: Name of the data stream, index, or index alias to - perform bulk actions on. + :arg index: The name of the data stream, index, or index alias + to perform bulk actions on. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -306,11 +308,11 @@ async def status( headers: Any = None, ) -> Any: """ - Gets the status of index replication. + Retrieves the the status of an index replication. - :arg index: Name of the data stream, index, or index alias to - perform bulk actions on. + :arg index: The name of the data stream, index, or index alias + to perform bulk actions on. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -343,11 +345,11 @@ async def stop( headers: Any = None, ) -> Any: """ - Terminates replication and converts the follower index to a standard index. + Terminates the replication and converts the follower index to a standard index. - :arg index: Name of the data stream, index, or index alias to - perform bulk actions on. + :arg index: The name of the data stream, index, or index alias + to perform bulk actions on. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -382,11 +384,11 @@ async def update_settings( headers: Any = None, ) -> Any: """ - Updates settings on the follower index. + Updates any settings on the follower index. - :arg index: Name of the data stream, index, or index alias to - perform bulk actions on. + :arg index: The name of the data stream, index, or index alias + to perform bulk actions on. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter diff --git a/opensearchpy/_async/plugins/rollups.py b/opensearchpy/_async/plugins/rollups.py index d50918b8..3ee8b49d 100644 --- a/opensearchpy/_async/plugins/rollups.py +++ b/opensearchpy/_async/plugins/rollups.py @@ -30,10 +30,10 @@ async def delete( headers: Any = None, ) -> Any: """ - Delete index rollup. + Deletes an index rollup job configuration. - :arg id: Rollup to access + :arg id: The ID of the rollup job. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -65,10 +65,10 @@ async def explain( headers: Any = None, ) -> Any: """ - Get a rollup's current status. + Retrieves the execution status information for an index rollup job. - :arg id: Rollup to access + :arg id: The ID of the rollup job. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -100,10 +100,10 @@ async def get( headers: Any = None, ) -> Any: """ - Get an index rollup. + Retrieves an index rollup job configuration by ID. - :arg id: Rollup to access + :arg id: The ID of the rollup job. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -144,10 +144,10 @@ async def put( headers: Any = None, ) -> Any: """ - Create or update index rollup. + Creates or updates an index rollup job configuration. - :arg id: Rollup to access + :arg id: The ID of the rollup job. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -156,10 +156,10 @@ async def put( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :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 if_primary_term: Only performs the operation if the + document has the specified primary term. + :arg if_seq_no: Only performs the operation if the document has + the specified sequence number. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for @@ -184,10 +184,10 @@ async def start( headers: Any = None, ) -> Any: """ - Start rollup. + Starts the execution of an index rollup job. - :arg id: Rollup to access + :arg id: The ID of the rollup job. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -219,10 +219,10 @@ async def stop( headers: Any = None, ) -> Any: """ - Stop rollup. + Stops the execution of an index rollup job. - :arg id: Rollup to access + :arg id: The ID of the rollup job. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter diff --git a/opensearchpy/_async/plugins/sm.py b/opensearchpy/_async/plugins/sm.py new file mode 100644 index 00000000..9cc6909f --- /dev/null +++ b/opensearchpy/_async/plugins/sm.py @@ -0,0 +1,356 @@ +# 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 SmClient(NamespacedClient): + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def create_policy( + self, + policy_name: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Creates a snapshot management policy. + + + :arg policy_name: The name of the snapshot management policy to + create. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if policy_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'policy_name'." + ) + + return await self.transport.perform_request( + "POST", + _make_path("_plugins", "_sm", "policies", policy_name), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def delete_policy( + self, + policy_name: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Deletes a snapshot management policy. + + + :arg policy_name: The name of the snapshot management policy to + delete. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if policy_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'policy_name'." + ) + + return await self.transport.perform_request( + "DELETE", + _make_path("_plugins", "_sm", "policies", policy_name), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def explain_policy( + self, + policy_name: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Explains the state of the snapshot management policy. + + + :arg policy_name: The name of the snapshot management policy to + explain. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if policy_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'policy_name'." + ) + + return await self.transport.perform_request( + "GET", + _make_path("_plugins", "_sm", "policies", policy_name, "_explain"), + params=params, + headers=headers, + ) + + @query_params( + "error_trace", + "filter_path", + "from_", + "human", + "pretty", + "queryString", + "size", + "sortField", + "sortOrder", + "source", + ) + async def get_policies( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Retrieves all snapshot management policies with optional pagination and + filtering. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg from_: The starting index from which to retrieve snapshot + management policies. Default is 0. + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg queryString: The query string to filter the returned + snapshot management policies. + :arg size: The number of snapshot management policies to return. + :arg sortField: The name of the field to sort the snapshot + management policies by. + :arg sortOrder: The order to sort the snapshot management + policies. Valid choices are asc, desc.Default is asc. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + # from is a reserved word so it cannot be used, use from_ instead + if "from_" in params: + params["from"] = params.pop("from_") + + return await self.transport.perform_request( + "GET", "/_plugins/_sm/policies", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def get_policy( + self, + policy_name: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Retrieves a specific snapshot management policy by name. + + + :arg policy_name: The name of the snapshot management policy to + retrieve. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if policy_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'policy_name'." + ) + + return await self.transport.perform_request( + "GET", + _make_path("_plugins", "_sm", "policies", policy_name), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def start_policy( + self, + policy_name: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Starts a snapshot management policy. + + + :arg policy_name: The name of the snapshot management policy to + start. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if policy_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'policy_name'." + ) + + return await self.transport.perform_request( + "POST", + _make_path("_plugins", "_sm", "policies", policy_name, "_start"), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + async def stop_policy( + self, + policy_name: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Stops a snapshot management policy. + + + :arg policy_name: The name of the snapshot management policy to + stop. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if policy_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'policy_name'." + ) + + return await self.transport.perform_request( + "POST", + _make_path("_plugins", "_sm", "policies", policy_name, "_stop"), + params=params, + headers=headers, + ) + + @query_params( + "error_trace", + "filter_path", + "human", + "if_primary_term", + "if_seq_no", + "pretty", + "source", + ) + async def update_policy( + self, + policy_name: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Updates an existing snapshot management policy. Requires `if_seq_no` and + `if_primary_term`. + + + :arg policy_name: The name of the snapshot management policy to + update. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg if_primary_term: The primary term of the policy to update. + :arg if_seq_no: The sequence number of the policy to update. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if policy_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'policy_name'." + ) + + return await self.transport.perform_request( + "PUT", + _make_path("_plugins", "_sm", "policies", policy_name), + params=params, + headers=headers, + body=body, + ) diff --git a/opensearchpy/_async/plugins/sql.py b/opensearchpy/_async/plugins/sql.py index cfccb376..ffb568f8 100644 --- a/opensearchpy/_async/plugins/sql.py +++ b/opensearchpy/_async/plugins/sql.py @@ -32,7 +32,7 @@ async def close( headers: Any = None, ) -> Any: """ - Clear the cursor context. + Closes an open cursor to free server-side resources. :arg error_trace: Whether to include the stack trace of returned @@ -41,14 +41,13 @@ async def close( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON or YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg sanitize: Specifies whether to escape special characters in - the results Default is True. + :arg sanitize: Whether to escape special characters in the + results. Default is True. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -66,7 +65,7 @@ async def explain( headers: Any = None, ) -> Any: """ - Shows how a query is executed against OpenSearch. + Returns the execution plan for a SQL or PPL query. :arg error_trace: Whether to include the stack trace of returned @@ -75,14 +74,13 @@ async def explain( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON or YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg sanitize: Specifies whether to escape special characters in - the results Default is True. + :arg sanitize: Whether to escape special characters in the + results. Default is True. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -99,7 +97,7 @@ async def get_stats( headers: Any = None, ) -> Any: """ - Collect metrics for the plugin within the interval. + Retrieves performance metrics for the SQL plugin. :arg error_trace: Whether to include the stack trace of returned @@ -108,14 +106,13 @@ async def get_stats( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON or YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg sanitize: Specifies whether to escape special characters in - the results Default is True. + :arg sanitize: Whether to escape special characters in the + results. Default is True. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -133,8 +130,7 @@ async def post_stats( headers: Any = None, ) -> Any: """ - By a stats endpoint, you are able to collect metrics for the plugin within the - interval. + Retrieves filtered performance metrics for the SQL plugin. :arg error_trace: Whether to include the stack trace of returned @@ -143,14 +139,13 @@ async def post_stats( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON or YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg sanitize: Specifies whether to escape special characters in - the results Default is True. + :arg sanitize: Whether to escape special characters in the + results. Default is True. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -168,7 +163,7 @@ async def query( headers: Any = None, ) -> Any: """ - Send a SQL/PPL query to the SQL plugin. + Executes SQL or PPL queries against OpenSearch indexes. :arg error_trace: Whether to include the stack trace of returned @@ -177,14 +172,13 @@ async def query( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON or YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg sanitize: Specifies whether to escape special characters in - the results Default is True. + :arg sanitize: Whether to escape special characters in the + results. Default is True. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -200,7 +194,7 @@ async def settings( headers: Any = None, ) -> Any: """ - Adds SQL settings to the standard OpenSearch cluster settings. + Updates SQL plugin settings in the OpenSearch cluster configuration. :arg error_trace: Whether to include the stack trace of returned @@ -209,8 +203,7 @@ async def settings( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON or YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON diff --git a/opensearchpy/client/__init__.py b/opensearchpy/client/__init__.py index 118cfa7a..1575403d 100644 --- a/opensearchpy/client/__init__.py +++ b/opensearchpy/client/__init__.py @@ -48,6 +48,7 @@ from .ingest import IngestClient from .insights import InsightsClient from .list import ListClient +from .ltr import LtrClient from .nodes import NodesClient from .plugins import PluginsClient from .remote import RemoteClient @@ -219,6 +220,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.ltr = LtrClient(self) self.wlm = WlmClient(self) self.list = ListClient(self) self.insights = InsightsClient(self) @@ -385,12 +387,11 @@ def create( 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 external, external_gte, force, - internal. + `external_gte`. :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. + (`number_of_replicas+1`). """ for param in (index, id, body): if param in SKIP_IN_PATH: @@ -477,12 +478,11 @@ def index( 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 external, external_gte, force, - internal. + `external_gte`. :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. + (`number_of_replicas+1`). """ for param in (index, body): if param in SKIP_IN_PATH: @@ -564,7 +564,7 @@ def bulk( :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. + (`number_of_replicas+1`). """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -667,16 +667,12 @@ def count( specified. :arg default_operator: The default operator for query string query: `AND` or `OR`. This parameter can only be used when the `q` query - string parameter is specified. Valid choices are and, or. + string parameter is specified. Valid choices are and, AND, or, 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. Default is false. - :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`. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields @@ -767,12 +763,11 @@ def delete( 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 external, external_gte, force, - internal. + `external_gte`. :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. + (`number_of_replicas+1`). """ for param in (index, id): if param in SKIP_IN_PATH: @@ -853,9 +848,9 @@ def delete_by_query( are analyzed. Default is false. :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. + conflicts: `abort` or `proceed`. :arg default_operator: The default operator for query string - query: `AND` or `OR`. Valid choices are and, or. + query: `AND` or `OR`. Valid choices are and, AND, or, 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 @@ -897,11 +892,10 @@ def delete_by_query( :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 - dfs_query_then_fetch, query_then_fetch. + options: `query_then_fetch`, `dfs_query_then_fetch`. :arg size: Deprecated, use `max_docs` instead. :arg slices: The number of slices this task should be divided - into. Valid choices are auto. + into. :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. @@ -921,7 +915,7 @@ def delete_by_query( :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. + (`number_of_replicas+1`). :arg wait_for_completion: If `true`, the request blocks until the operation is complete. Default is True. """ @@ -1095,8 +1089,7 @@ def exists( 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 external, external_gte, force, - internal. + `external_gte`. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -1165,8 +1158,7 @@ def exists_source( 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 external, external_gte, force, - internal. + `external_gte`. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -1225,7 +1217,7 @@ def explain( 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. + query: `AND` or `OR`. Valid choices are and, AND, or, OR. :arg df: Field to use as default where no field prefix is given in the query string. Default is _all. :arg error_trace: Whether to include the stack trace of returned @@ -1389,8 +1381,7 @@ def get( 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 external, external_gte, - force, internal. + `external`, `external_gte`. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -1504,8 +1495,7 @@ def get_source( The specified version must match the current version of the document for the request to succeed. :arg version_type: Specific version type. One of `internal`, - `external`, `external_gte`. Valid choices are external, external_gte, - force, internal. + `external`, `external_gte`. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -1651,8 +1641,7 @@ def msearch( returned as an integer in the response. Defaults to false, which returns an object. Default is false. :arg search_type: Indicates whether global term and document - frequencies should be used when scoring returned documents. Valid - choices are dfs_query_then_fetch, query_then_fetch. + frequencies should be used when scoring returned documents. :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 @@ -1716,8 +1705,7 @@ def msearch_template( `hits.total` as an integer. If `false`, it returns `hits.total` as an object. Default is false. :arg search_type: The type of the search operation. Available - options: `query_then_fetch`, `dfs_query_then_fetch`. Valid choices are - dfs_query_then_fetch, query_then_fetch. + options: `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 @@ -1806,8 +1794,7 @@ def mtermvectors( frequency and document frequency. Default is false. :arg version: If `true`, returns the document version as part of a hit. - :arg version_type: Specific version type. Valid choices are - external, external_gte, force, internal. + :arg version_type: Specific version type. """ path = _make_path(index, "_mtermvectors") @@ -1926,8 +1913,7 @@ def rank_eval( are not included in the response. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg search_type: Search operation type Valid choices are - dfs_query_then_fetch, query_then_fetch. + :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. """ @@ -1950,6 +1936,7 @@ def rank_eval( "pretty", "refresh", "requests_per_second", + "require_alias", "scroll", "slices", "source", @@ -1991,7 +1978,6 @@ def reindex( should be maintained for scrolled search. :arg slices: The number of slices this task should be divided 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 @@ -1999,7 +1985,7 @@ def reindex( :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. + (`number_of_replicas+1`). :arg wait_for_completion: If `true`, the request blocks until the operation is complete. Default is True. """ @@ -2020,7 +2006,7 @@ def reindex_rethrottle( headers: Any = None, ) -> Any: """ - Changes the number of requests per second for a particular Reindex operation. + Changes the number of requests per second for a particular reindex operation. :arg task_id: Identifier for the task. @@ -2138,8 +2124,6 @@ def scroll( Allows to retrieve a large numbers of results from a single search request. - :arg body: The scroll ID if not passed by URL or query - parameter. :arg scroll_id: The scroll ID for scrolled search :arg error_trace: Whether to include the stack trace of returned errors. Default is false. @@ -2221,6 +2205,7 @@ def scroll( "track_scores", "track_total_hits", "typed_keys", + "verbose_pipeline", "version", ) def search( @@ -2281,7 +2266,7 @@ def search( executing cross-cluster search (CCS) requests. Default is True. :arg default_operator: The default operator for query string query: AND or OR. This parameter can only be used when the `q` query - string parameter is specified. Valid choices are and, or. + string parameter is specified. Valid choices are and, AND, or, 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. @@ -2371,8 +2356,7 @@ def search( :arg search_pipeline: Customizable sequence of processing stages applied to search queries. :arg search_type: How distributed term frequencies are - calculated for relevance scoring. Valid choices are - dfs_query_then_fetch, query_then_fetch. + calculated for relevance scoring. :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 @@ -2421,6 +2405,13 @@ def search( 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 verbose_pipeline: Enables or disables verbose mode for the + search pipeline. When verbose mode is enabled, detailed information + about each processor in the search pipeline is included in the search + response. This includes the processor name, execution status, input, + output, and time taken for processing. This parameter is primarily + intended for debugging purposes, allowing users to track how data flows + and transforms through the search pipeline. :arg version: If `true`, returns document version as part of a hit. """ @@ -2570,8 +2561,7 @@ def search_template( specific shard. :arg scroll: Specifies how long a consistent view of the index should be maintained for scrolled search. - :arg search_type: The type of the search operation. Valid - choices are dfs_query_then_fetch, query_then_fetch. + :arg search_type: The type of the search operation. :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 @@ -2658,8 +2648,7 @@ def termvectors( frequency and document frequency. Default is false. :arg version: If `true`, returns the document version as part of a hit. - :arg version_type: Specific version type. Valid choices are - external, external_gte, force, internal. + :arg version_type: Specific version type. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -2746,8 +2735,7 @@ def update( :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. + (number_of_replicas+1). Defaults to 1 meaning the primary shard. """ for param in (index, id, body): if param in SKIP_IN_PATH: @@ -2832,9 +2820,9 @@ def update_by_query( are analyzed. Default is false. :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. + conflicts: `abort` or `proceed`. :arg default_operator: The default operator for query string - query: `AND` or `OR`. Valid choices are and, or. + query: `AND` or `OR`. Valid choices are and, AND, or, 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 @@ -2880,11 +2868,10 @@ def update_by_query( operation. Default is 100. :arg search_timeout: Explicit timeout for each search request. :arg search_type: The type of the search operation. Available - options: `query_then_fetch`, `dfs_query_then_fetch`. Valid choices are - dfs_query_then_fetch, query_then_fetch. + options: `query_then_fetch`, `dfs_query_then_fetch`. :arg size: Deprecated, use `max_docs` instead. :arg slices: The number of slices this task should be divided - into. Valid choices are auto. + into. :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. @@ -2904,7 +2891,7 @@ def update_by_query( :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. + (`number_of_replicas+1`). :arg wait_for_completion: If `true`, the request blocks until the operation is complete. Default is True. """ @@ -3235,7 +3222,7 @@ def bulk_stream( :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. + (`number_of_replicas+1`). """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") diff --git a/opensearchpy/client/cat.py b/opensearchpy/client/cat.py index ce668e7f..7917b690 100644 --- a/opensearchpy/client/cat.py +++ b/opensearchpy/client/cat.py @@ -61,36 +61,32 @@ def aliases( headers: Any = None, ) -> Any: """ - Shows information about currently configured aliases to indexes including - filter and routing info. + Shows information about aliases currently configured to indexes, including + filter and routing information. - :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. Default is false. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indexes that are open, closed or both. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Whether to return information from the local node + only instead of from the cluster manager node. Default is false. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", _make_path("_cat", "aliases", name), params=params, headers=headers @@ -115,30 +111,30 @@ def all_pit_segments( headers: Any = None, ) -> Any: """ - Lists all active point-in-time segments. + Lists all active CAT point-in-time segments. - :arg bytes: The unit in which to display byte values. Valid - choices are b, g, gb, k, kb, m, mb, p, pb, t, tb. + :arg bytes: The units used to display byte values. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", "/_cat/pit_segments/_all", params=params, headers=headers @@ -171,36 +167,36 @@ def allocation( much disk space they are using. - :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, g, gb, k, kb, m, mb, p, pb, t, tb. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg node_id: A comma-separated list of node IDs or names used + to limit the returned information. + :arg bytes: The units used to display byte values. + :arg cluster_manager_timeout: A timeout for connection to the + cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the HTTP `Accept` header, such + as `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does 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 cluster-manager node. + use `cluster_manager_timeout` instead.): A timeout for connection to the + cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", @@ -233,32 +229,33 @@ def cluster_manager( Returns information about the cluster-manager node. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg cluster_manager_timeout: A timeout for connection to the + cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the HTTP `Accept` header, such + as `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): A timeout for connection to the + cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", "/_cat/cluster_manager", params=params, headers=headers @@ -283,8 +280,8 @@ def count( headers: Any = None, ) -> Any: """ - Provides quick access to the document count of the entire cluster, or - individual indexes. + Provides quick access to the document count of the entire cluster or of an + individual index. :arg index: Comma-separated list of data streams, indexes, and @@ -296,19 +293,20 @@ def count( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", _make_path("_cat", "count", index), params=params, headers=headers @@ -338,29 +336,29 @@ def fielddata( node in the cluster. - :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, g, gb, k, kb, m, mb, p, pb, t, tb. + :arg fields: A comma-separated list of fields used to limit the + amount of returned information. + :arg bytes: The units used to display byte values. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", @@ -398,23 +396,23 @@ def health( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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 used to display time values. Valid choices - are d, h, m, micros, ms, nanos, s. - :arg ts: If `true`, returns `HH:MM:SS` and Unix epoch + :arg time: The unit used to display time values. + :arg ts: When `true`, returns `HH:MM:SS` and Unix epoch timestamps. Default is True. - :arg v: Verbose mode. Display column headers. Default is false. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", "/_cat/health", params=params, headers=headers @@ -475,53 +473,48 @@ def indices( headers: Any = None, ) -> Any: """ - Returns information about indexes: number of primaries and replicas, document - counts, disk size, ... + Lists information related to indexes, that is, how much disk space they are + using, how many shards they have, their health status, and so on. - :arg index: Comma-separated list of data streams, indexes, and + :arg index: A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. - :arg bytes: The unit used to display byte values. Valid choices - are b, g, gb, k, kb, m, mb, p, pb, t, tb. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg bytes: The units used to display byte values. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. - :arg expand_wildcards: The type of index that wildcard patterns - can match. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg health: The health status used to limit returned indexes. - By default, the response includes indexes of any health status. Valid - choices are green, red, yellow. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg health: Limits indexes based on their health status. + Supported values are `green`, `yellow`, and `red`. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg include_unloaded_segments: If `true`, the response includes - information from segments that are not loaded into memory. Default is - false. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg include_unloaded_segments: Whether to include information + from segments not loaded into memory. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg pri: If `true`, the response only includes information from - primary shards. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg pri: When `true`, returns information only from the primary + shards. Default is false. + :arg s: A 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 used to display time values. Valid choices - are d, h, m, micros, ms, nanos, s. - :arg v: Verbose mode. Display column headers. Default is false. + :arg time: Specifies the time units. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", _make_path("_cat", "indices", index), params=params, headers=headers @@ -551,32 +544,33 @@ def master( Returns information about the cluster-manager node. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ from warnings import warn @@ -611,32 +605,33 @@ def nodeattrs( Returns information about custom node attributes. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", "/_cat/nodeattrs", params=params, headers=headers @@ -666,42 +661,43 @@ def nodes( headers: Any = None, ) -> Any: """ - Returns basic statistics about performance of cluster nodes. + Returns basic statistics about the performance of cluster nodes. - :arg bytes: The unit used to display byte values. Valid choices - are b, g, gb, k, kb, m, mb, p, pb, t, tb. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg bytes: The units used to display byte values. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg full_id: If `true`, return the full node ID. If `false`, - return the shortened node ID. Default is false. - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg full_id: When `true`, returns the full node ID. When + `false`, returns the shortened node ID. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg local (Deprecated: This parameter does not cause this API - to act locally.): Return local information, do not retrieve the state - from cluster-manager node. Default is false. + to act locally.): Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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, micros, ms, nanos, s. - :arg v: Verbose mode. Display column headers. Default is false. + :arg time: Specifies the time units, for example, `5d` or `7h`. + For more information, see [Supported + units](https://opensearch.org/docs/latest/api-reference/units/). + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", "/_cat/nodes", params=params, headers=headers @@ -729,37 +725,39 @@ def pending_tasks( headers: Any = None, ) -> Any: """ - Returns a concise representation of the cluster pending tasks. + Returns a concise representation of the cluster's pending tasks. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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, micros, ms, nanos, s. - :arg v: Verbose mode. Display column headers. Default is false. + :arg time: Specifies the time units, for example, `5d` or `7h`. + For more information, see [Supported + units](https://opensearch.org/docs/latest/api-reference/units/). + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", "/_cat/pending_tasks", params=params, headers=headers @@ -785,30 +783,30 @@ def pit_segments( headers: Any = None, ) -> Any: """ - List segments for one or several PITs. + Lists one or several CAT point-in-time segments. - :arg bytes: The unit in which to display byte values. Valid - choices are b, g, gb, k, kb, m, mb, p, pb, t, tb. + :arg bytes: The units used to display byte values. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", "/_cat/pit_segments", params=params, headers=headers, body=body @@ -835,35 +833,37 @@ def plugins( headers: Any = None, ) -> Any: """ - Returns information about installed plugins across nodes node. + Returns information about the names, components, and versions of the installed + plugins. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", "/_cat/plugins", params=params, headers=headers @@ -892,38 +892,40 @@ def recovery( headers: Any = None, ) -> Any: """ - Returns information about index shard recoveries, both on-going completed. + Returns all completed and ongoing index and shard recoveries. - :arg index: Comma-separated list or wildcard expression of index - names to limit the returned information. + :arg index: A comma-separated list of data streams, indexes, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indexes, omit this parameter or use `*` or `_all`. :arg active_only: If `true`, the response only includes ongoing shard recoveries. Default is false. - :arg bytes: The unit used to display byte values. Valid choices - are b, g, gb, k, kb, m, mb, p, pb, t, tb. - :arg detailed: If `true`, the response includes detailed - information about shard recoveries. Default is false. + :arg bytes: The units used to display byte values. + :arg detailed: When `true`, includes detailed information about + shard recoveries. Default is false. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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, micros, ms, nanos, s. - :arg v: Verbose mode. Display column headers. Default is false. + :arg time: Specifies the time units, for example, `5d` or `7h`. + For more information, see [Supported + units](https://opensearch.org/docs/latest/api-reference/units/). + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", _make_path("_cat", "recovery", index), params=params, headers=headers @@ -950,35 +952,36 @@ def repositories( headers: Any = None, ) -> Any: """ - Returns information about snapshot repositories registered in the cluster. + Returns information about all snapshot repositories for a cluster. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", "/_cat/repositories", params=params, headers=headers @@ -1014,52 +1017,54 @@ def segment_replication( headers: Any = None, ) -> Any: """ - Returns information about both on-going and latest completed Segment - Replication events. + Returns information about active and last-completed segment replication events + on each replica shard, including related shard-level metrics. These metrics + provide information about how far behind the primary shard the replicas are + lagging. - :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 - segment replication events. Default is false. - :arg allow_no_indices: Whether to ignore if a wildcard indexes - expression resolves into no concrete indexes. (This includes `_all` - string or when no indexes have been specified). - :arg bytes: The unit in which to display byte values. Valid - choices are b, g, gb, k, kb, m, mb, p, pb, t, tb. - :arg completed_only: If `true`, the response only includes - latest completed segment replication events. Default is false. - :arg detailed: If `true`, the response includes detailed - information about segment replications. Default is false. + :arg index: A comma-separated list of data streams, indexes, and + aliases used to limit the request. Supports wildcards (`*`). To target + all data streams and indexes, omit this parameter or use `*` or `_all`. + :arg active_only: When `true`, the response only includes + ongoing segment replication events. Default is false. + :arg allow_no_indices: Whether to ignore the index if a wildcard + index expression resolves to no concrete indexes. This includes the + `_all` string or when no indexes have been specified. + :arg bytes: The units used to display byte values. + :arg completed_only: When `true`, the response only includes the + last-completed segment replication events. Default is false. + :arg detailed: When `true`, the response includes additional + metrics for each stage of a segment replication event. Default is false. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indexes that are open, closed or both. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg ignore_throttled: Whether specified concrete, expanded or + :arg ignore_throttled: Whether specified concrete, expanded, or aliased indexes should be ignored when throttled. - :arg ignore_unavailable: Whether specified concrete indexes - should be ignored when unavailable (missing or closed). + :arg ignore_unavailable: Whether the specified concrete indexes + should be ignored when missing or closed. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A comma-separated list of column names or column aliases to sort by. - :arg shards: Comma-separated list of shards to display. + :arg shards: A 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, micros, ms, nanos, s. - :arg timeout: Operation timeout. - :arg v: Verbose mode. Display column headers. Default is false. + :arg time: Specifies the time units, for example, `5d` or `7h`. + For more information, see [Supported + units](https://opensearch.org/docs/latest/api-reference/units/). + :arg timeout: The operation timeout. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", @@ -1096,32 +1101,32 @@ def segments( :arg index: A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. - :arg bytes: The unit used to display byte values. Valid choices - are b, g, gb, k, kb, m, mb, p, pb, t, tb. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg bytes: The units used to display byte values. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", _make_path("_cat", "segments", index), params=params, headers=headers @@ -1151,42 +1156,38 @@ def shards( headers: Any = None, ) -> Any: """ - Provides a detailed view of shard allocation on nodes. + Lists the states of all primary and replica shards and how they are + distributed. - :arg index: A comma-separated list of data streams, indexes, and - aliases used to limit the request. Supports wildcards (`*`). To target - all data streams and indexes, omit this parameter or use `*` or `_all`. - :arg bytes: The unit used to display byte values. Valid choices - are b, g, gb, k, kb, m, mb, p, pb, t, tb. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg bytes: The units used to display byte values. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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, micros, ms, nanos, s. - :arg v: Verbose mode. Display column headers. Default is false. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", _make_path("_cat", "shards", index), params=params, headers=headers @@ -1216,38 +1217,39 @@ def thread_pool( ) -> Any: """ Returns cluster-wide thread pool statistics per node. By default the active, - queue and rejected statistics are returned for all thread pools. + queued, and rejected statistics are returned for all thread pools. :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 cluster_manager_timeout: A timeout for connection to the + cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", @@ -1279,41 +1281,43 @@ def snapshots( headers: Any = None, ) -> Any: """ - Returns all snapshots in a specific repository. + Lists all of the snapshots stored in a specific repository. :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 cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg ignore_unavailable: If `true`, the response does not + :arg ignore_unavailable: When `true`, the response does not include information from unavailable snapshots. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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, micros, ms, nanos, s. - :arg v: Verbose mode. Display column headers. Default is false. + :arg time: Specifies the time units, for example, `5d` or `7h`. + For more information, see [Supported + units](https://opensearch.org/docs/latest/api-reference/units/). + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", @@ -1345,12 +1349,10 @@ def tasks( headers: Any = None, ) -> Any: """ - Returns information about the tasks currently executing on one or more nodes in - the cluster. + Lists the progress of all tasks currently running on the cluster. - :arg actions: The task action names, which are used to limit the - response. + :arg actions: The task action names used to limit the response. :arg detailed: If `true`, the response includes detailed information about shard recoveries. Default is false. :arg error_trace: Whether to include the stack trace of returned @@ -1359,27 +1361,30 @@ def tasks( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :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 nodes: A comma-separated list of node IDs or names used to + limit the returned information. Use `_local` to return information from + the node to which you're connecting, specify a specific node from which + to get information, or keep the parameter empty to get information from + all nodes. :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. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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, micros, ms, nanos, s. - :arg v: Verbose mode. Display column headers. Default is false. + :arg time: Specifies the time units, for example, `5d` or `7h`. + For more information, see [Supported + units](https://opensearch.org/docs/latest/api-reference/units/). + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", "/_cat/tasks", params=params, headers=headers @@ -1407,37 +1412,39 @@ def templates( headers: Any = None, ) -> Any: """ - Returns information about existing templates. + Lists the names, patterns, order numbers, and version numbers of index + templates. :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 cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). - :arg h: Comma-separated list of column names to display. - :arg help: Return help information. Default is false. + :arg format: A short version of the `Accept` header, such as + `json` or `yaml`. + :arg h: A comma-separated list of column names to display. + :arg help: Returns help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Returns local information but does not retrieve the + state from the cluster manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Operation timeout for - connection to cluster-manager node. + use `cluster_manager_timeout` instead.): The amount of time allowed to + establish a connection to the cluster manager node. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Comma-separated list of column names or column aliases + :arg s: A 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. + :arg v: Enables verbose mode, which displays column headers. + Default is false. """ return self.transport.perform_request( "GET", _make_path("_cat", "templates", name), params=params, headers=headers diff --git a/opensearchpy/client/cluster.py b/opensearchpy/client/cluster.py index 7dc19976..acb90424 100644 --- a/opensearchpy/client/cluster.py +++ b/opensearchpy/client/cluster.py @@ -70,64 +70,41 @@ def health( Returns basic information about the health of the cluster. - :arg index: Comma-separated list of data streams, indexes, and - index aliases used to limit the request. Wildcard expressions (*) are - supported. To target all data streams and indexes 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 awareness_attribute: The name of the awareness attribute + for which to return the cluster health status (for example, `zone`). + Applicable only if `level` is set to `awareness_attributes`. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indexes that are open, closed or both. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg level: Can be one of cluster, indexes or shards. Controls - the details level of the health information returned. Valid choices are - awareness_attributes, cluster, indices, shards. - :arg local: If `true`, the request retrieves information from - the local node only. Defaults to false, which means information is - retrieved from the cluster-manager node. Default is false. - :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Period to wait for a connection - to the cluster-manager node. If no response is received before the - timeout expires, the request fails and returns an error. + :arg local: Whether to return information from the local node + only instead of from the cluster manager node. Default is false. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :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 high, immediate, - languid, low, normal, urgent. - :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, red, yellow. + :arg timeout: The amount of time to wait for a response from the + cluster manager node. For more information about supported time units, + see [Common parameters](https://opensearch.org/docs/latest/api- + reference/common-parameters/#time-units). + :arg wait_for_no_initializing_shards: Whether to wait until + there are no initializing shards in the cluster. Default is false. + :arg wait_for_no_relocating_shards: Whether to wait until there + are no relocating shards in the cluster. Default is false. + :arg wait_for_nodes: Waits until the specified number of nodes + (`N`) is available. Accepts `>=N`, `<=N`, `>N`, and ` Any: """ - Returns a list of any cluster-level changes (e.g. create index, update mapping, - allocate or fail shard) which have not yet been executed. + Returns a list of pending cluster-level tasks, such as index creation, mapping + updates, or new allocations. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -166,13 +146,9 @@ def pending_tasks( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: If `true`, the request retrieves information from - the local node only. If `false`, information is retrieved from the - cluster-manager node. Default is false. - :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Period to wait for a connection - to the cluster-manager node. If no response is received before the - timeout expires, the request fails and returns an error. + :arg local: When `true`, the request retrieves information from + the local node only. When `false`, information is retrieved from the + cluster manager node. Default is false. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for @@ -206,37 +182,36 @@ def state( headers: Any = None, ) -> Any: """ - Returns a comprehensive information about the state of the cluster. - - - :arg metric: Limit the information returned to the specified - metrics - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indexes - :arg allow_no_indices: Whether to ignore if a wildcard indexes - expression resolves into no concrete indexes. (This includes `_all` - string or when no indexes have been specified) - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + Returns comprehensive information about the state of the cluster. + + + :arg metric: Limits the information returned to only the + [specified metric groups](https://opensearch.org/docs/latest/api- + reference/cluster-api/cluster-stats/#metric-groups). + :arg allow_no_indices: Whether to ignore a wildcard index + expression that resolves into no concrete indexes. This includes the + `_all` string or when no indexes have been specified. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indexes that are open, closed or both. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg flat_settings: Return settings in flat format. Default is - false. + :arg flat_settings: Whether to return settings in the flat form, + which can improve readability, especially for heavily nested settings. + For example, the flat form of `"cluster": { "max_shards_per_node": 500 + }` is `"cluster.max_shards_per_node": "500"`. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg ignore_unavailable: Whether specified concrete indexes - 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 master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Specify timeout for connection - to cluster manager. + :arg ignore_unavailable: Whether the specified concrete indexes + should be ignored when unavailable (missing or closed). + :arg local: Whether to return information from the local node + only instead of from the cluster manager node. Default is false. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for @@ -274,34 +249,35 @@ def stats( index_metric: Any = None, ) -> Any: """ - Returns high-level overview of cluster statistics. + Returns a high-level overview of cluster statistics. :arg metric: Limit the information returned to the specified metrics. - :arg index_metric: Limit the information returned for indexes - metric to the specific index metrics. It can be used only if indexes (or - all) metric is specified. - :arg node_id: Comma-separated list of node filters used to limit - returned information. Defaults to all nodes in the cluster. + :arg index_metric: A comma-separated list of [index metric + groups](https://opensearch.org/docs/latest/api-reference/cluster- + api/cluster-stats/#index-metric-groups), for example, `docs,store`. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg flat_settings: If `true`, returns settings in flat format. - Default is false. + :arg flat_settings: Whether to return settings in the flat form, + which can improve readability, especially for heavily nested settings. + For example, the flat form of `"cluster": { "max_shards_per_node": 500 + }` is `"cluster.max_shards_per_node": "500"`. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :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. + :arg timeout: The amount of time 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", @@ -342,35 +318,31 @@ def reroute( :arg body: The definition of `commands` to perform (`move`, `cancel`, `allocate`) - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. - :arg dry_run: If `true`, then the request simulates the - operation only and returns the resulting state. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). + :arg dry_run: When `true`, the request simulates the operation + and returns the resulting state. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. - :arg explain: If `true`, then the response contains an - explanation of why the commands can or cannot be executed. + :arg explain: When `true`, the response contains an explanation + of why reroute certain commands can or cannot be executed. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Period to wait for a connection - to the cluster-manager 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. Default is false. - :arg retry_failed: If `true`, then retries allocation of shards - that are blocked due to too many subsequent allocation failures. + :arg retry_failed: When `true`, retries shard allocation if it + was blocked because of too many subsequent 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 @@ -397,31 +369,29 @@ def get_settings( Returns cluster settings. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg flat_settings: If `true`, returns settings in flat format. - Default is false. + :arg flat_settings: Whether to return settings in the flat form, + which can improve readability, especially for heavily nested settings. + For example, the flat form of `"cluster": { "max_shards_per_node": 500 + }` is `"cluster.max_shards_per_node": "500"`. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg include_defaults: If `true`, returns default cluster + :arg include_defaults: When `true`, returns default cluster settings from the local node. Default is false. - :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Period to wait for a connection - to the cluster-manager 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. Default is false. :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 @@ -448,28 +418,28 @@ def put_settings( Updates the cluster settings. - :arg body: The settings to be updated. Can be either `transient` - or `persistent` (survives cluster restart). - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg body: The cluster settings to update. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg flat_settings: Return settings in flat format. Default is - false. + :arg flat_settings: Whether to return settings in the flat form, + which can improve readability, especially for heavily nested settings. + For example, the flat form of `"cluster": { "max_shards_per_node": 500 + }` is `"cluster.max_shards_per_node": "500"`. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Explicit operation timeout for - connection to cluster-manager node :arg pretty: Whether to pretty format the returned JSON response. Default is false. :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'.") @@ -521,11 +491,13 @@ def allocation_explain( headers: Any = None, ) -> Any: """ - Provides explanations for shard allocations in the cluster. + Explains how shards are allocated in the current cluster and provides an + explanation for why unassigned shards can't be allocated to a node. - :arg body: The index, shard, and primary flag to explain. Empty - means 'explain the first unassigned shard' + :arg body: The index, shard, and primary flag for which to + generate an explanation. Leave this empty to generate an explanation for + the first unassigned shard. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -534,10 +506,12 @@ def allocation_explain( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg include_disk_info: If `true`, returns information about + :arg include_disk_info: When `true`, returns information about disk usage and shard sizes. Default is false. - :arg include_yes_decisions: If `true`, returns YES decisions in - explanation. Default is false. + :arg include_yes_decisions: When `true`, returns any `YES` + decisions in the allocation explanation. `YES` decisions indicate when a + particular shard allocation attempt was successful for the given node. + Default is false. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for @@ -571,10 +545,13 @@ def delete_component_template( Deletes a component 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 name: The name of the component template to delete. + Supports wildcard (*) expressions. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -583,17 +560,10 @@ def delete_component_template( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Period to wait for a connection - to the cluster-manager 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. Default is false. :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'.") @@ -609,6 +579,7 @@ def delete_component_template( "cluster_manager_timeout", "error_trace", "filter_path", + "flat_settings", "human", "local", "master_timeout", @@ -625,25 +596,28 @@ def get_component_template( Returns one or more 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 name: The name of the component template to retrieve. + Wildcard (`*`) expressions are supported. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". + :arg flat_settings: Whether to return settings in the flat form, + which can improve readability, especially for heavily nested settings. + For example, the flat form of `"cluster": { "max_shards_per_node": 500 + }` is `"cluster.max_shards_per_node": "500"`. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: If `true`, the request retrieves information from - the local node only. If `false`, information is retrieved from the - cluster-manager node. Default is false. - :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Period to wait for a connection - to the cluster-manager node. If no response is received before the - timeout expires, the request fails and returns an error. + :arg local: When `true`, the request retrieves information from + the local node only. When `false`, information is retrieved from the + cluster manager node. Default is false. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for @@ -678,20 +652,24 @@ def put_component_template( Creates or updates a component 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 indexes 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: If `true`, this request cannot replace or update + :arg name: The 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`, and `synthetics-settings`. OpenSearch uses these + templates to configure backing indexes for its data streams. If you want + to overwrite one of these templates, set the replacement template + `version` to a higher value than the current version. If you want to + disable all built-in component and index templates, set + `stack.templates.enabled` to `false` using the [Cluster Update Settings + API](https://opensearch.org/docs/latest/api-reference/cluster- + api/cluster-settings/). + :arg body: The template definition. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). + :arg create: When `true`, this request cannot replace or update existing component templates. Default is false. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. @@ -701,15 +679,10 @@ def put_component_template( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Period to wait for a connection - to the cluster-manager 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. Default is false. :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): if param in SKIP_IN_PATH: @@ -743,10 +716,13 @@ def exists_component_template( Returns information about whether a particular component template exist. - :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 name: The name of the component template. Wildcard (*) + expressions are supported. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -755,13 +731,9 @@ def exists_component_template( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: If `true`, the request retrieves information from - the local node only. Defaults to false, which means information is - retrieved from the cluster-manager node. Default is false. - :arg master_timeout (Deprecated: To promote inclusive language, - use `cluster_manager_timeout` instead.): Period to wait for a connection - to the cluster-manager node. If no response is received before the - timeout expires, the request fails and returns an error. + :arg local: When `true`, the request retrieves information from + the local node only. When `false, information is retrieved from the + cluster manager node. Default is false. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for @@ -786,7 +758,7 @@ def delete_voting_config_exclusions( headers: Any = None, ) -> Any: """ - Clears cluster voting config exclusions. + Clears any cluster voting configuration exclusions. :arg error_trace: Whether to include the stack trace of returned @@ -803,11 +775,10 @@ def delete_voting_config_exclusions( 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. Defaults to true, meaning that all - excluded nodes must be removed from the cluster before this API takes - any action. If set to `false` then the voting configuration exclusions - list is cleared even if some excluded nodes are still in the cluster. - Default is True. + configuration exclusions list. When `true`, all excluded nodes are + removed from the cluster before this API takes any action. When `false`, + the voting configuration exclusions list is cleared even if some + excluded nodes are still in the cluster. Default is True. """ return self.transport.perform_request( "DELETE", @@ -832,7 +803,8 @@ def post_voting_config_exclusions( headers: Any = None, ) -> Any: """ - Updates the cluster voting config exclusions by node ids or node names. + Updates the cluster voting configuration by excluding certain node IDs or + names. :arg error_trace: Whether to include the stack trace of returned @@ -843,20 +815,22 @@ def post_voting_config_exclusions( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg node_ids: A comma-separated list of the persistent ids of - the nodes to exclude from the voting configuration. If specified, you - may not also specify `node_names`. - :arg node_names: A 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 node_ids: A comma-separated list of node IDs to exclude + from the voting configuration. When using this setting, you cannot also + specify `node_names`. Either `node_ids` or `node_names` are required to + receive a valid response. + :arg node_names: A comma-separated list of node names to exclude + from the voting configuration. When using this setting, you cannot also + specify `node_ids`. Either `node_ids` or `node_names` are required to + receive a valid response. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :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 the specified nodes to be excluded from the voting - configuration before returning. If the timeout expires before the - appropriate condition is satisfied, the request fails and returns an + configuration before returning a response. If the timeout expires before + the appropriate condition is satisfied, the request fails and returns an error. """ return self.transport.perform_request( @@ -870,7 +844,7 @@ def delete_decommission_awareness( headers: Any = None, ) -> Any: """ - Delete any existing decommission. + Recommissions a decommissioned zone. :arg error_trace: Whether to include the stack trace of returned @@ -930,10 +904,11 @@ def get_decommission_awareness( headers: Any = None, ) -> Any: """ - Get details and status of decommissioned attribute. + Retrieves the decommission status for all zones. - :arg awareness_attribute_name: Awareness attribute name. + :arg awareness_attribute_name: The name of the awareness + attribute. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -976,7 +951,7 @@ def get_weighted_routing( Fetches weighted shard routing weights. - :arg attribute: Awareness attribute name. + :arg attribute: The name of the awareness attribute. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -1009,11 +984,18 @@ def put_decommission_awareness( headers: Any = None, ) -> Any: """ - Decommissions an awareness attribute. - - - :arg awareness_attribute_name: Awareness attribute name. - :arg awareness_attribute_value: Awareness attribute value. + Decommissions a cluster zone based on awareness. This can greatly benefit + multi-zone deployments, where awareness attributes can aid in applying new + upgrades to a cluster in a controlled fashion. + + + :arg awareness_attribute_name: The name of the awareness + attribute. + :arg awareness_attribute_value: The value of the awareness + attribute. For example, if you have shards allocated in two different + zones, you can give each zone a value of `zone-a` or `zoneb`. The + cluster decommission operation decommissions the zone listed in the + method. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -1056,7 +1038,7 @@ def put_weighted_routing( Updates weighted shard routing weights. - :arg attribute: Awareness attribute name. + :arg attribute: The name of awareness attribute, usually `zone`. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter diff --git a/opensearchpy/client/indices.py b/opensearchpy/client/indices.py index c4b2405c..4ecb36b0 100644 --- a/opensearchpy/client/indices.py +++ b/opensearchpy/client/indices.py @@ -236,7 +236,7 @@ def create( :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. + (`number_of_replicas+1`). """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -300,7 +300,7 @@ def clone( :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. + (`number_of_replicas+1`). :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -459,7 +459,7 @@ def open( :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. + (`number_of_replicas+1`). :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -531,7 +531,7 @@ def close( :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. + (`number_of_replicas+1`). """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -1638,7 +1638,7 @@ def validate_query( 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. + query: `AND` or `OR`. Valid choices are and, AND, or, 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. @@ -2053,7 +2053,7 @@ def shrink( :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. + (`number_of_replicas+1`). :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -2128,7 +2128,7 @@ def split( :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. + (`number_of_replicas+1`). :arg wait_for_completion: Should this request wait until the operation has completed before returning. Default is True. """ @@ -2201,7 +2201,7 @@ def rollover( :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. + (`number_of_replicas+1`). """ if alias in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'alias'.") diff --git a/opensearchpy/client/ingest.py b/opensearchpy/client/ingest.py index 1572e70b..93333689 100644 --- a/opensearchpy/client/ingest.py +++ b/opensearchpy/client/ingest.py @@ -56,14 +56,14 @@ def get_pipeline( headers: Any = None, ) -> Any: """ - Returns a pipeline. + Returns an ingest pipeline. - :arg id: Comma-separated list of pipeline IDs to retrieve. + :arg id: A 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 cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -103,13 +103,13 @@ def put_pipeline( headers: Any = None, ) -> Any: """ - Creates or updates a pipeline. + Creates or updates an ingest pipeline. - :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 id: The ID of the ingest pipeline. + :arg body: The ingest definition. + :arg cluster_manager_timeout: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -126,9 +126,7 @@ def put_pipeline( response. Default is false. :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 timeout: The amount of time to wait for a response. """ for param in (id, body): if param in SKIP_IN_PATH: @@ -159,14 +157,14 @@ def delete_pipeline( headers: Any = None, ) -> Any: """ - Deletes a pipeline. + Deletes an ingest pipeline. - :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 id: The 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: The amount of time allowed to + establish a connection to the cluster manager node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -183,9 +181,7 @@ def delete_pipeline( response. Default is false. :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 timeout: The amount of time to wait for a response. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'id'.") @@ -206,12 +202,12 @@ def simulate( headers: Any = None, ) -> Any: """ - Allows to simulate a pipeline with example documents. + Simulates an ingest pipeline with example documents. :arg body: The simulate definition - :arg id: Pipeline to test. If you don't specify a `pipeline` in - the request body, this parameter is required. + :arg id: The 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. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -224,8 +220,8 @@ def simulate( response. Default is false. :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. Default is false. + :arg verbose: When `true`, the response includes output data for + each processor in the pipeline Default is false. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -245,7 +241,7 @@ def processor_grok( headers: Any = None, ) -> Any: """ - Returns a list of the built-in patterns. + Returns a list of built-in grok patterns. :arg error_trace: Whether to include the stack trace of returned @@ -258,7 +254,8 @@ def processor_grok( statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg s: Sort returned patterns by key name. Default is false. + :arg s: Determines how to sort returned grok patterns by key + name. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ diff --git a/opensearchpy/client/list.py b/opensearchpy/client/list.py index cbf6d5d9..984213e4 100644 --- a/opensearchpy/client/list.py +++ b/opensearchpy/client/list.py @@ -87,8 +87,7 @@ def indices( :arg index: Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. - :arg bytes: The unit used to display byte values. Valid choices - are b, g, gb, k, kb, m, mb, p, pb, t, tb. + :arg bytes: The unit used to display byte values. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg error_trace: Whether to include the stack trace of returned @@ -103,8 +102,7 @@ def indices( `JSON`, `YAML`. :arg h: Comma-separated list of column names to display. :arg health: The health status used to limit returned indexes. - By default, the response includes indexes of any health status. Valid - choices are green, red, yellow. + By default, the response includes indexes of any health status. :arg help: Return help information. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. @@ -129,8 +127,7 @@ def indices( indexes would be displayed first. Valid choices are asc, desc. :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 d, h, m, micros, ms, nanos, s. + :arg time: The unit used to display time values. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( @@ -170,8 +167,7 @@ def shards( :arg index: A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. - :arg bytes: The unit used to display byte values. Valid choices - are b, g, gb, k, kb, m, mb, p, pb, t, tb. + :arg bytes: The unit used to display byte values. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg error_trace: Whether to include the stack trace of returned @@ -202,8 +198,7 @@ def shards( shards would be displayed first. Valid choices are asc, desc. :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, micros, ms, nanos, s. + :arg time: The unit in which to display time values. :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( diff --git a/opensearchpy/client/ltr.py b/opensearchpy/client/ltr.py new file mode 100644 index 00000000..1f0789e2 --- /dev/null +++ b/opensearchpy/client/ltr.py @@ -0,0 +1,299 @@ +# 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 LtrClient(NamespacedClient): + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def cache_stats( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Retrieves cache statistics for all feature stores. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", "/_ltr/_cachestats", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def clear_cache( + self, + store: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Clears the store caches. + + + :arg store: The name of the feature store for which to clear the + cache. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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("_ltr", store, "_clearcache"), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def create_default_store( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Creates the default feature store. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", "/_ltr", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def create_store( + self, + store: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Creates a new feature store with the specified name. + + + :arg store: The name of the feature store. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if store in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'store'.") + + return self.transport.perform_request( + "PUT", _make_path("_ltr", store), params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def delete_default_store( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Deletes the default feature store. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", "/_ltr", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def delete_store( + self, + store: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Deletes a feature store with the specified name. + + + :arg store: The name of the feature store. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if store in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'store'.") + + return self.transport.perform_request( + "DELETE", _make_path("_ltr", store), params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get_store( + self, + store: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Checks if a store exists. + + + :arg store: The name of the feature store. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if store in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'store'.") + + return self.transport.perform_request( + "GET", _make_path("_ltr", store), params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def list_stores( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Lists all available feature stores. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", "/_ltr", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source", "timeout") + def stats( + self, + node_id: Any = None, + stat: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Provides information about the current status of the LTR plugin. + + + :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 stat: Comma-separated list of stats to retrieve; use `_all` + or empty string to retrieve all stats. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + :arg timeout: The time in milliseconds to wait for a response. + """ + return self.transport.perform_request( + "GET", + _make_path("_plugins", "_ltr", node_id, "stats", stat), + params=params, + headers=headers, + ) diff --git a/opensearchpy/client/nodes.py b/opensearchpy/client/nodes.py index d2f4ddb9..b321940d 100644 --- a/opensearchpy/client/nodes.py +++ b/opensearchpy/client/nodes.py @@ -68,9 +68,9 @@ def reload_secure_settings( response. Default is false. :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 timeout: The amount of time 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", @@ -101,8 +101,8 @@ def info( Returns information about nodes in the cluster. - :arg node_id: Comma-separated list of node IDs or names used to - limit returned information. + :arg node_id: A 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 node_id_or_metric: Limits the information returned to a @@ -114,17 +114,17 @@ def info( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg flat_settings: If `true`, returns settings in flat format. - Default is false. + :arg flat_settings: When `true`, returns settings in flat + format. Default is false. :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :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 timeout: The amount of time 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 @@ -157,30 +157,30 @@ def stats( Returns statistical information about nodes in the cluster. - :arg node_id: Comma-separated list of node IDs or names used to - limit returned information. + :arg node_id: A comma-separated list of node IDs or names used + to limit returned information. :arg metric: Limit the information returned to the specified - metrics + metrics. :arg index_metric: Limit the information returned for indexes - metric to the specific index metrics. It can be used only if indexes (or - all) metric is specified. - :arg completion_fields: Comma-separated list or wildcard + metric to the specified index metrics. It can be used only if indexes + (or all) metric is specified. + :arg completion_fields: A comma-separated list or wildcard expressions of fields to include in field data and suggest statistics. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. - :arg fielddata_fields: Comma-separated list or wildcard + :arg fielddata_fields: A comma-separated list or wildcard expressions of fields to include in field data statistics. - :arg fields: Comma-separated list or wildcard expressions of + :arg fields: A comma-separated list or wildcard expressions of fields to include in the statistics. :arg filter_path: Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg groups: Comma-separated list of search groups to include in - the search statistics. + :arg groups: A comma-separated list of search groups to include + in the search statistics. :arg human: Whether to return human readable values for statistics. Default is True. - :arg include_segment_file_sizes: If `true`, the call reports the + :arg include_segment_file_sizes: When `true`, 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: Indicates whether statistics are aggregated at the @@ -190,9 +190,9 @@ def stats( response. Default is false. :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 timeout: The amount of time 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. """ @@ -226,12 +226,11 @@ def hot_threads( Returns information about hot threads on each node 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 + :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 doc_type: The type to sample. Valid choices are block, cpu, - wait. + :arg doc_type: The type to sample. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -240,19 +239,22 @@ def hot_threads( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :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 ignore_idle_threads: Whether to 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 time interval between thread stack trace + samples. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg snapshots: Number of samples of thread stack trace. Default - is 10. + :arg snapshots: The number of thread stack trace samples to + collect. 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. + :arg threads: The number of threads to provide information for. + Default is 3. + :arg timeout: The amount of time to wait for a response. If no + response is received before the timeout expires, the request fails and + returns an error. """ # type is a reserved word so it cannot be used, use doc_type instead if "doc_type" in params: diff --git a/opensearchpy/client/plugins.py b/opensearchpy/client/plugins.py index d625f838..a92e06e1 100644 --- a/opensearchpy/client/plugins.py +++ b/opensearchpy/client/plugins.py @@ -13,15 +13,18 @@ from ..plugins.alerting import AlertingClient from ..plugins.asynchronous_search import AsynchronousSearchClient from ..plugins.flow_framework import FlowFrameworkClient +from ..plugins.geospatial import GeospatialClient from ..plugins.index_management import IndexManagementClient from ..plugins.knn import KnnClient from ..plugins.ml import MlClient +from ..plugins.neural import NeuralClient from ..plugins.notifications import NotificationsClient from ..plugins.observability import ObservabilityClient from ..plugins.ppl import PplClient from ..plugins.query import QueryClient from ..plugins.replication import ReplicationClient from ..plugins.rollups import RollupsClient +from ..plugins.sm import SmClient from ..plugins.sql import SqlClient from ..plugins.transforms import TransformsClient from .client import Client @@ -29,6 +32,7 @@ class PluginsClient(NamespacedClient): + geospatial: Any asynchronous_search: Any alerting: Any index_management: Any @@ -45,6 +49,9 @@ class PluginsClient(NamespacedClient): def __init__(self, client: Client) -> None: super().__init__(client) + self.sm = SmClient(client) + self.neural = NeuralClient(client) + self.geospatial = GeospatialClient(client) self.replication = ReplicationClient(client) self.flow_framework = FlowFrameworkClient(client) self.asynchronous_search = AsynchronousSearchClient(client) @@ -66,6 +73,9 @@ def _dynamic_lookup(self, client: Any) -> None: # Issue : https://github.com/opensearch-project/opensearch-py/issues/90#issuecomment-1003396742 plugins = [ + "sm", + "neural", + "geospatial", "replication", "flow_framework", "asynchronous_search", diff --git a/opensearchpy/client/security.py b/opensearchpy/client/security.py index 3a7a094a..6b460b12 100644 --- a/opensearchpy/client/security.py +++ b/opensearchpy/client/security.py @@ -31,7 +31,7 @@ def get_account_details( headers: Any = None, ) -> Any: """ - Returns account details for the current user. + Returns account information for the current user. :arg error_trace: Whether to include the stack trace of returned @@ -161,7 +161,7 @@ def delete_action_group( headers: Any = None, ) -> Any: """ - Delete a specified action group. + Deletes the specified action group. :arg action_group: The name of the action group to delete. @@ -238,7 +238,7 @@ def patch_action_group( headers: Any = None, ) -> Any: """ - Updates individual attributes of an action group. + Updates the individual attributes of an action group. :arg action_group: The name of the action group to update. @@ -275,7 +275,7 @@ def patch_action_groups( headers: Any = None, ) -> Any: """ - Creates, updates, or deletes multiple action groups in a single call. + Creates, updates, or deletes multiple action groups in a single request. :arg error_trace: Whether to include the stack trace of returned @@ -310,7 +310,7 @@ def get_user( headers: Any = None, ) -> Any: """ - Retrieve one internal user. + Retrieve information about the specified internal user. :arg username: The name of the user to retrieve. @@ -375,7 +375,7 @@ def delete_user( headers: Any = None, ) -> Any: """ - Delete the specified user. + Deletes the specified internal user. :arg username: The name of the user to delete. @@ -414,7 +414,7 @@ def create_user( Creates or replaces the specified user. - :arg username: The name of the user to be created. + :arg username: The name of the user to create. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -449,7 +449,7 @@ def patch_user( headers: Any = None, ) -> Any: """ - Updates individual attributes of an internal user. + Updates individual attributes for an internal user. :arg username: The name of the user to update. @@ -486,7 +486,7 @@ def patch_users( headers: Any = None, ) -> Any: """ - Creates, updates, or deletes multiple internal users in a single call. + Creates, updates, or deletes multiple internal users in a single request. :arg error_trace: Whether to include the stack trace of returned @@ -524,6 +524,7 @@ def get_role( Retrieves one role. + :arg role: The name of the role to retrieve. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -582,7 +583,7 @@ def delete_role( headers: Any = None, ) -> Any: """ - Delete the specified role. + Deletes the specified role. :arg role: The name of the role to delete. @@ -621,7 +622,7 @@ def create_role( Creates or replaces the specified role. - :arg role: The name of the role to be created. + :arg role: The name of the role to create. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -656,7 +657,7 @@ def patch_role( headers: Any = None, ) -> Any: """ - Updates individual attributes of a role. + Updates the individual attributes of a role. :arg role: The name of the role to update. @@ -728,9 +729,10 @@ def get_role_mapping( headers: Any = None, ) -> Any: """ - Retrieves one role mapping. + Retrieves the specified role mapping. + :arg role: The name of the role mapping to retrieve. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -795,7 +797,8 @@ def delete_role_mapping( Deletes the specified role mapping. - :arg role: The name of the role whose mapping needs to delete. + :arg role: The name of the role for which to delete the role's + mappings. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -831,7 +834,8 @@ def create_role_mapping( Creates or replaces the specified role mapping. - :arg role: The name of the role to create a role mapping for. + :arg role: The name of the role for which to create a role + mapping. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -866,10 +870,10 @@ def patch_role_mapping( headers: Any = None, ) -> Any: """ - Updates individual attributes of a role mapping. + Updates the individual attributes of a role mapping. - :arg role: The name of the role to update role-mapping for. + :arg role: The name of the role to update a role mapping for :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -903,7 +907,7 @@ def patch_role_mappings( headers: Any = None, ) -> Any: """ - Creates or updates multiple role mappings in a single call. + Creates or updates multiple role mappings in a single request. :arg error_trace: Whether to include the stack trace of returned @@ -938,7 +942,7 @@ def get_tenant( headers: Any = None, ) -> Any: """ - Retrieves one tenant. + Retrieves the specified tenant. :arg tenant: The name of the tenant to retrieve. @@ -1000,7 +1004,7 @@ def delete_tenant( headers: Any = None, ) -> Any: """ - Delete the specified tenant. + Deletes the specified tenant. :arg tenant: The name of the tenant to delete. @@ -1039,7 +1043,7 @@ def create_tenant( Creates or replaces the specified tenant. - :arg tenant: The name of the tenant to be created. + :arg tenant: The name of the tenant to create. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -1074,7 +1078,7 @@ def patch_tenant( headers: Any = None, ) -> Any: """ - Add, delete, or modify a single tenant. + Adds, deletes, or modifies a single tenant. :arg tenant: The name of the tenant to update. @@ -1111,7 +1115,7 @@ def patch_tenants( headers: Any = None, ) -> Any: """ - Add, delete, or modify multiple tenants in a single call. + Adds, deletes, or modifies multiple tenants in a single request. :arg error_trace: Whether to include the stack trace of returned @@ -1145,7 +1149,7 @@ def get_configuration( headers: Any = None, ) -> Any: """ - Returns the current Security plugin configuration in JSON format. + Returns the current Security plugin configuration in a JSON format. :arg error_trace: Whether to include the stack trace of returned @@ -1176,8 +1180,8 @@ def update_configuration( headers: Any = None, ) -> Any: """ - Adds or updates the existing configuration using the REST API. Only accessible - by admins and users with REST API access and only when put or patch is enabled. + Updates the settings for an existing security configuration. Requires super + admin or REST API permissions. :arg error_trace: Whether to include the stack trace of returned @@ -1212,9 +1216,8 @@ def patch_configuration( headers: Any = None, ) -> Any: """ - A `PATCH` call is used to update the existing configuration using the REST API. - Only accessible by admins and users with REST API access and only when put or - patch is enabled. + Updates the existing security configuration using the REST API. Requires super + admin or REST API permissions. :arg error_trace: Whether to include the stack trace of returned @@ -1248,8 +1251,8 @@ def get_distinguished_names( headers: Any = None, ) -> Any: """ - Retrieves distinguished names. Only accessible to super-admins and with rest- - api permissions when enabled. + Retrieves all node distinguished names. Requires super admin or REST API + permissions. :arg error_trace: Whether to include the stack trace of returned @@ -1262,8 +1265,8 @@ def get_distinguished_names( statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg show_all: A Boolean flag to include/exclude static nodes DN - from final result. + :arg show_all: Whether to include or exclude any static node's + DN settings from the final result. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -1305,7 +1308,7 @@ def reload_transport_certificates( headers: Any = None, ) -> Any: """ - Reload Transport layer communication certificates. + Reloads the transport communication certificates. :arg error_trace: Whether to include the stack trace of returned @@ -1335,7 +1338,7 @@ def reload_http_certificates( headers: Any = None, ) -> Any: """ - Reload HTTP layer communication certificates. + Reloads the HTTP communication certificates. :arg error_trace: Whether to include the stack trace of returned @@ -1365,7 +1368,7 @@ def flush_cache( headers: Any = None, ) -> Any: """ - Flushes the Security plugin user, authentication, and authorization cache. + Flushes the Security plugin's user, authentication, and authorization cache. :arg error_trace: Whether to include the stack trace of returned @@ -1392,7 +1395,7 @@ def health( headers: Any = None, ) -> Any: """ - Checks to see if the Security plugin is up and running. + Checks to see if the Security plugin is running. :arg error_trace: Whether to include the stack trace of returned @@ -1403,9 +1406,10 @@ def health( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg mode: A flag to indicate whether service should consider - security-plugin's status before returning health response. `strict` mode - indicates service should check Security plugin status. + :arg mode: A flag that determines whether to consider the + security status before returning a response for a health query response. + For example, `strict` mode indicates service should check the Security + plugin status. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for @@ -1485,7 +1489,7 @@ def patch_audit_configuration( headers: Any = None, ) -> Any: """ - A PATCH call is used to update specified fields in the audit configuration. + Updates the specified fields in the audit configuration. :arg error_trace: Whether to include the stack trace of returned @@ -1520,8 +1524,8 @@ def patch_distinguished_names( headers: Any = None, ) -> Any: """ - Bulk update of distinguished names. Only accessible to super-admins and with - rest-api permissions when enabled. + Bulk updates specified node distinguished names. Requires super admin or REST + API permissions. :arg error_trace: Whether to include the stack trace of returned @@ -1563,10 +1567,11 @@ def authinfo( headers: Any = None, ) -> Any: """ - Returns the authentication information. + Returns or updates authentication information for the currently authenticated + user. - :arg auth_type: The type of current authentication request. + :arg auth_type: The type of the current authentication request. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -1579,8 +1584,7 @@ def authinfo( response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. - :arg verbose: Indicates whether a verbose response should be - returned. + :arg verbose: Whether to return a verbose response. """ return self.transport.perform_request( "GET", "/_plugins/_security/authinfo", params=params, headers=headers @@ -1593,7 +1597,7 @@ def authtoken( headers: Any = None, ) -> Any: """ - Returns the authorization token. + Returns the authorization token for the current user. :arg error_trace: Whether to include the stack trace of returned @@ -1620,7 +1624,7 @@ def cache( headers: Any = None, ) -> Any: """ - Not supported for cache API. + Not supported for the Cache API. :arg error_trace: Whether to include the stack trace of returned @@ -1647,8 +1651,8 @@ def config_upgrade_check( headers: Any = None, ) -> Any: """ - Check whether or not an upgrade can be performed and what resources can be - updated. + Checks whether or not an upgrade can be performed and which security resources + can be updated. :arg error_trace: Whether to include the stack trace of returned @@ -1679,7 +1683,8 @@ def config_upgrade_perform( headers: Any = None, ) -> Any: """ - Helps cluster operator upgrade missing defaults and stale default definitions. + Assists the cluster operator with upgrading missing default values and stale + default definitions. :arg error_trace: Whether to include the stack trace of returned @@ -1711,8 +1716,8 @@ def create_allowlist( headers: Any = None, ) -> Any: """ - Creates or replaces the permitted APIs. Accessible using Super Admin - certificate or REST API permission. + Creates or replaces APIs permitted for users on the allow list. Requires a + super admin certificate or REST API permissions. :arg error_trace: Whether to include the stack trace of returned @@ -1747,8 +1752,8 @@ def create_update_tenancy_config( headers: Any = None, ) -> Any: """ - Creates or replaces the multi-tenancy configuration. Only accessible to admins - and users with REST API permissions. + Creates or replaces the multi-tenancy configuration. Requires super admin or + REST API permissions. :arg error_trace: Whether to include the stack trace of returned @@ -1787,7 +1792,7 @@ def create_user_legacy( Creates or replaces the specified user. Legacy API. - :arg username: The name of the user to be created. + :arg username: The name of the user to create. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -1821,11 +1826,11 @@ def delete_distinguished_name( headers: Any = None, ) -> Any: """ - Deletes all distinguished names in the specified cluster or node allow list. - Only accessible to super-admins and with rest-api permissions when enabled. + Deletes all distinguished names in the specified cluster or node allowlist. + Requires super admin or REST API permissions. - :arg cluster_name: The cluster-name to delete from list of + :arg cluster_name: The cluster name to delete from list of distinguished names. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. @@ -1895,7 +1900,7 @@ def generate_obo_token( headers: Any = None, ) -> Any: """ - Generates On-Behalf-Of token for the current user. + Generates a `On-Behalf-Of` token for the current user. :arg error_trace: Whether to include the stack trace of returned @@ -1930,11 +1935,11 @@ def generate_user_token( headers: Any = None, ) -> Any: """ - Generates authorization token for the given user. + Generates an authorization token for the specified user. - :arg username: The name of the user for whom an auth token is to - be vended. + :arg username: The name of the user for whom to issue an + authorization token. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -1971,8 +1976,8 @@ def generate_user_token_legacy( Generates authorization token for the given user. Legacy API. Not Implemented. - :arg username: The name of the user for whom an auth token is to - be vended. + :arg username: The name of the user for whom to issue an + authorization token. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -2003,7 +2008,7 @@ def get_allowlist( headers: Any = None, ) -> Any: """ - Retrieves the current list of allowed API accessible to normal user. + Retrieves the current list of allowed APIs accessible to a normal user. :arg error_trace: Whether to include the stack trace of returned @@ -2030,7 +2035,8 @@ def get_dashboards_info( headers: Any = None, ) -> Any: """ - Retrieves the current security-dashboards plugin configuration. + Retrieves the current values for dynamic security settings for OpenSearch + Dashboards. :arg error_trace: Whether to include the stack trace of returned @@ -2058,12 +2064,12 @@ def get_distinguished_name( headers: Any = None, ) -> Any: """ - Retrieves distinguished names. Only accessible to super-admins and with rest- - api permissions when enabled. + Retrieves all node distinguished names. Requires super admin or REST API + permissions. - :arg cluster_name: The cluster-name to retrieve nodes DN setting - for. + :arg cluster_name: The name of the cluster to retrieve that + cluster's nodes DN settings. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -2074,8 +2080,8 @@ def get_distinguished_name( statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg show_all: A Boolean flag to include/exclude static nodes DN - from final result. + :arg show_all: Whether to include or exclude any static node's + DN settings from the final result. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -2098,7 +2104,7 @@ def get_permissions_info( headers: Any = None, ) -> Any: """ - Gets the evaluated REST API permissions for the currently logged in user. + Retrieves the evaluated REST API permissions for the currently logged in user. :arg error_trace: Whether to include the stack trace of returned @@ -2128,7 +2134,7 @@ def get_sslinfo( headers: Any = None, ) -> Any: """ - Retrieves the SSL configuration information. + Retrieves information about the SSL configuration. :arg error_trace: Whether to include the stack trace of returned @@ -2141,8 +2147,8 @@ def get_sslinfo( statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg show_dn: A Boolean flag to indicate whether all domain - names should be returned. + :arg show_dn: Whether to include all domain names in the + response. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -2157,8 +2163,8 @@ def get_tenancy_config( headers: Any = None, ) -> Any: """ - Retrieves multi-tenancy configuration. Only accessible to admins and users with - REST API permissions. + Retrieves the multi-tenancy configuration. Requires super admin or REST API + permissions. :arg error_trace: Whether to include the stack trace of returned @@ -2250,7 +2256,7 @@ def migrate( headers: Any = None, ) -> Any: """ - Migrates security configuration from v6 to v7. + Migrates the security configuration from v6 to v7. :arg error_trace: Whether to include the stack trace of returned @@ -2278,7 +2284,7 @@ def patch_allowlist( headers: Any = None, ) -> Any: """ - Updates the current list of allowed API accessible to normal user. + Updates the current list of APIs accessible for users on the allow list. :arg error_trace: Whether to include the stack trace of returned @@ -2314,11 +2320,12 @@ def patch_distinguished_name( headers: Any = None, ) -> Any: """ - Updates a distinguished cluster name for a specific cluster. Only accessible to - super-admins and with rest-api permissions when enabled. + Updates the distinguished cluster name for the specified cluster. Requires + super admin or REST API permissions. - :arg cluster_name: The cluster name to update `nodesDn` value. + :arg cluster_name: The cluster name to update the `nodesDn` + value. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -2352,7 +2359,8 @@ def post_dashboards_info( headers: Any = None, ) -> Any: """ - Updates the current security-dashboards plugin configuration. + Retrieves the current values for dynamic security settings for OpenSearch + Dashboards. :arg error_trace: Whether to include the stack trace of returned @@ -2379,8 +2387,8 @@ def tenant_info( headers: Any = None, ) -> Any: """ - Retrieves the tenant names if any exist. Only accessible to super admins or - kibanaserver user. + Retrieves the names of current tenants. Requires super admin or `kibanaserver` + permissions. :arg error_trace: Whether to include the stack trace of returned @@ -2409,13 +2417,12 @@ def update_distinguished_name( headers: Any = None, ) -> Any: """ - Adds or updates the specified distinguished names in the cluster or node allow - list. Only accessible to super-admins and with rest-api permissions when - enabled. + Adds or updates the specified distinguished names in the cluster or node + allowlist. Requires super admin or REST API permissions. - :arg cluster_name: The cluster-name to create/update `nodesDn` - value for. + :arg cluster_name: The name of the cluster containing the + `nodesDn` value to create or update. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -2455,8 +2462,8 @@ def validate( to v7. - :arg accept_invalid: A Boolean flag to indicate whether invalid - v6 configuration should be allowed. + :arg accept_invalid: Whether an invalid v6 configuration should + be allowed. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -2481,7 +2488,7 @@ def who_am_i( headers: Any = None, ) -> Any: """ - Gets the user identity related information for currently logged in user. + Gets the identity information for the user currently logged in. :arg error_trace: Whether to include the stack trace of returned @@ -2508,9 +2515,9 @@ def who_am_i_protected( headers: Any = None, ) -> Any: """ - Gets the user identity related information for currently logged in user. User - needs to have access to this endpoint when authorization at REST layer is - enabled. + Gets the identity information for the user currently logged in. To use this + operation, you must have access to this endpoint when authorization at REST + layer is enabled. :arg error_trace: Whether to include the stack trace of returned @@ -2548,8 +2555,8 @@ def get_all_certificates( Retrieves the cluster security certificates. - :arg cert_type: The type of certificates (HTTP, TRANSPORT, ALL) - to retrieve from all nodes. + :arg cert_type: The type of certificates (`HTTP`, `TRANSPORT`, + or `ALL`) to retrieve from all nodes. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -2562,8 +2569,8 @@ def get_all_certificates( response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. - :arg timeout: The maximum duration, in seconds, to be spent to - retrieve certificates from all nodes. + :arg timeout: The maximum duration, in seconds, to spend + retrieving certificates from all nodes before a timeout. """ return self.transport.perform_request( "GET", @@ -2588,12 +2595,12 @@ def get_node_certificates( headers: Any = None, ) -> Any: """ - Retrieves the given node's security certificates. + Retrieves the specified node's security certificates. - :arg node_id: The full-id of the node to retrieve certificates. - :arg cert_type: The type of certificates (HTTP, TRANSPORT, ALL) - to retrieve for a node. + :arg node_id: The node ID to retrieve certificates for. + :arg cert_type: The type of certificates (`HTTP`, `TRANSPORT`, + or `ALL`) to retrieve from a node. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -2606,8 +2613,8 @@ def get_node_certificates( response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. - :arg timeout: The maximum duration, in seconds, to be spent to - retrieve a node's certificates. + :arg timeout: The maximum duration, in seconds, to spend + retrieving certificates from all nodes before a timeout. """ if node_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'node_id'.") diff --git a/opensearchpy/client/snapshot.py b/opensearchpy/client/snapshot.py index b4e98c5f..0740c469 100644 --- a/opensearchpy/client/snapshot.py +++ b/opensearchpy/client/snapshot.py @@ -59,15 +59,19 @@ def create( headers: Any = None, ) -> Any: """ - Creates a snapshot in a repository. + Creates a snapshot within an existing repository. - :arg repository: Repository for the snapshot. - :arg snapshot: Name of the snapshot. Must be unique in the + :arg repository: The name of the repository where the snapshot + will be stored. + :arg snapshot: The 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 body: The snapshot definition. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -84,9 +88,9 @@ def create( response. Default is false. :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. Default is false. + :arg wait_for_completion: When `true`, the request returns a + response when the snapshot is complete. When `false`, the request + returns a response when the snapshot initializes. Default is false. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -120,10 +124,14 @@ def delete( Deletes a snapshot. - :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 repository: The name of the snapshot repository to delete. + :arg snapshot: A comma-separated list of snapshot names to + delete from the repository. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -173,15 +181,18 @@ def get( Returns information about a snapshot. - :arg repository: Comma-separated list of snapshot repository + :arg repository: A 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 snapshot: A comma-separated list of snapshot names to + retrieve. Also accepts wildcard expressions. (`*`). - 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: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -190,7 +201,7 @@ def get( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg ignore_unavailable: If `false`, the request returns an + :arg ignore_unavailable: When `false`, the request returns an error for any snapshots that are unavailable. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use `cluster_manager_timeout` instead.): Period to wait for a connection @@ -200,10 +211,10 @@ def get( response. Default is false. :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 + :arg verbose: When `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. + contained in the snapshot. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -233,13 +244,16 @@ def delete_repository( headers: Any = None, ) -> Any: """ - Deletes a repository. + Deletes a snapshot repository. - :arg repository: Name of the snapshot repository to unregister. - Wildcard (`*`) patterns are supported. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg repository: The name of the snapshot repository to + unregister. Wildcard (`*`) patterns are supported. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -255,7 +269,7 @@ def delete_repository( response. Default is false. :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 timeout: The amount of time to wait for a response. """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -284,12 +298,15 @@ def get_repository( headers: Any = None, ) -> Any: """ - Returns information about a repository. + Returns information about a snapshot repository. - :arg repository: A comma-separated list of repository names - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg repository: A comma-separated list of repository names. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -298,8 +315,8 @@ def get_repository( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg local: Return local information, do not retrieve the state - from cluster-manager node. Default is false. + :arg local: Whether to get information from the local node. + Default is false. :arg master_timeout (Deprecated: To promote inclusive language, use `cluster_manager_timeout` instead.): Explicit operation timeout for connection to cluster-manager node @@ -331,13 +348,16 @@ def create_repository( headers: Any = None, ) -> Any: """ - Creates a repository. + Creates a snapshot repository. - :arg repository: A repository name - :arg body: The repository definition - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg repository: The name for the newly registered repository. + :arg body: The repository definition. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -353,8 +373,9 @@ def create_repository( response. Default is false. :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 + :arg timeout: The amount of time to wait for a response. + :arg verify: When `true`, verifies the creation of the snapshot + repository. """ for param in (repository, body): if param in SKIP_IN_PATH: @@ -390,11 +411,16 @@ def restore( Restores a snapshot. - :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 repository: The name of the repository containing the + snapshot + :arg snapshot: The name of the snapshot to restore. + :arg body: Determines which settings and indexes to restore when + restoring a snapshot + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -410,8 +436,11 @@ def restore( response. Default is false. :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. + :arg wait_for_completion: -| Whether to return a response after + the restore operation has completed. When `false`, the request returns a + response when the restore operation initializes. When `true`, the + request returns a response when the restore operation completes. Default + is false. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -446,10 +475,14 @@ def status( Returns information about the status of a snapshot. - :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 repository: The name of the repository containing the + snapshot. + :arg snapshot: A comma-separated list of snapshot names. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -458,9 +491,9 @@ def status( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg ignore_unavailable: Whether to ignore unavailable - snapshots, defaults to `false` which means a SnapshotMissingException is - thrown Default is false. + :arg ignore_unavailable: Whether to ignore any unavailable + snapshots, When `false`, a `SnapshotMissingException` is thrown. Default + is false. :arg master_timeout (Deprecated: To promote inclusive language, use `cluster_manager_timeout` instead.): Explicit operation timeout for connection to cluster-manager node @@ -496,9 +529,13 @@ def verify_repository( Verifies a repository. - :arg repository: A repository name - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg repository: The name of the repository containing the + snapshot. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -514,7 +551,7 @@ def verify_repository( response. Default is false. :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 timeout: The amount of time to wait for a response. """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -543,12 +580,15 @@ def cleanup_repository( headers: Any = None, ) -> Any: """ - Removes stale data from repository. + Removes any stale data from a snapshot repository. :arg repository: Snapshot repository to clean up. - :arg cluster_manager_timeout: Operation timeout for connection - to cluster-manager node. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -564,7 +604,7 @@ def cleanup_repository( response. Default is false. :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. + :arg timeout: The amount of time to wait for a response. """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -595,15 +635,20 @@ def clone( headers: Any = None, ) -> Any: """ - Clones indexes from one snapshot into another snapshot in the same repository. - - - :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. + Creates a clone of all or part of a snapshot in the same repository as the + original snapshot. + + + :arg repository: The name of repository which will contain the + snapshots clone. + :arg snapshot: The name of the original snapshot. + :arg target_snapshot: The name of the cloned snapshot. + :arg body: The snapshot clone definition. + :arg cluster_manager_timeout: The amount of time to wait for a + response from the cluster manager node. For more information about + supported time units, see [Common + parameters](https://opensearch.org/docs/latest/api-reference/common- + parameters/#time-units). :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter diff --git a/opensearchpy/client/tasks.py b/opensearchpy/client/tasks.py index dcd80200..598fccf7 100644 --- a/opensearchpy/client/tasks.py +++ b/opensearchpy/client/tasks.py @@ -64,9 +64,9 @@ def list( Returns a list of tasks. - :arg actions: Comma-separated list or wildcard expression of - actions used to limit the request. - :arg detailed: If `true`, the response includes detailed + :arg actions: A comma-separated list of actions that should be + returned. Keep empty to return all. + :arg detailed: When `true`, the response includes detailed information about shard recoveries. Default is false. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. @@ -74,26 +74,25 @@ def list( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg group_by: Key used to group tasks in the response. Valid - choices are nodes, none, parents. + :arg group_by: Groups tasks by parent/child relationships or + nodes. Valid choices are nodes, none, parents. :arg human: Whether to return human readable values for statistics. Default is True. - :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: Parent task ID used to limit returned - information. To return all tasks, omit this parameter or use a value of - `-1`. + :arg nodes: A comma-separated list of node IDs or names used to + limit the returned information. Use `_local` to return information from + the node you're connecting to, specify the node name to get information + from a specific node, or keep the parameter empty to get information + from all nodes. + :arg parent_task_id: Returns tasks with a specified parent task + ID (`node_id:task_number`). Keep empty or set to -1 to return all. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :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. Default is false. + :arg timeout: The amount of time to wait for a response. + :arg wait_for_completion: Waits for the matching task to + complete. When `true`, the request is blocked until the task has + completed. Default is false. """ return self.transport.perform_request( "GET", "/_tasks", params=params, headers=headers @@ -120,9 +119,9 @@ def cancel( Cancels a task, if it can be cancelled through an API. - :arg task_id: ID of the task. - :arg actions: Comma-separated list or wildcard expression of - actions used to limit the request. + :arg task_id: The task ID. + :arg actions: A comma-separated list of actions that should be + returned. Keep empty to return all. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -131,16 +130,20 @@ def cancel( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :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 nodes: A comma-separated list of node IDs or names used to + limit the returned information. Use `_local` to return information from + the node you're connecting to, specify the node name to get information + from a specific node, or keep the parameter empty to get information + from all nodes. + :arg parent_task_id: Returns tasks with a specified parent task + ID (`node_id:task_number`). Keep empty or set to -1 to return all. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :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 Default is false. + :arg wait_for_completion: Waits for the matching task to + complete. When `true`, the request is blocked until the task has + completed. Default is false. """ return self.transport.perform_request( "POST", @@ -168,7 +171,7 @@ def get( Returns information about a task. - :arg task_id: ID of the task. + :arg task_id: The task ID. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -181,11 +184,10 @@ def get( response. Default is false. :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. Default is false. + :arg timeout: The amount of time to wait for a response. + :arg wait_for_completion: Waits for the matching task to + complete. When `true`, the request is blocked until the task has + completed. Default is false. """ if task_id in SKIP_IN_PATH: warnings.warn( diff --git a/opensearchpy/plugins/asynchronous_search.py b/opensearchpy/plugins/asynchronous_search.py index f208b8ad..1a1d332c 100644 --- a/opensearchpy/plugins/asynchronous_search.py +++ b/opensearchpy/plugins/asynchronous_search.py @@ -30,7 +30,7 @@ def delete( headers: Any = None, ) -> Any: """ - Delete asynchronous search. + Deletes any responses from an asynchronous search. :arg error_trace: Whether to include the stack trace of returned @@ -64,7 +64,7 @@ def get( headers: Any = None, ) -> Any: """ - Get partial responses from asynchronous search. + Gets partial responses from an asynchronous search. :arg error_trace: Whether to include the stack trace of returned @@ -108,7 +108,7 @@ def search( headers: Any = None, ) -> Any: """ - Perform an asynchronous search. + Performs an asynchronous search. :arg error_trace: Whether to include the stack trace of returned @@ -124,19 +124,20 @@ def search( expression of index names. :arg keep_alive: The amount of time that the result is saved in the cluster. For example, `2d` means that the results are stored in the - cluster for 48 hours. The saved search results are deleted after this + cluster for 48 hours. The saved search results are deleted after this period or if the search is canceled. Note that this includes the query - execution time. If the query overruns this time, the process cancels - this query automatically. - :arg keep_on_completion: Whether you want to save the results in - the cluster after the search is complete. + execution time. If the query exceeds this amount of time, the process + cancels this query automatically. + :arg keep_on_completion: Whether to save the results in the + cluster after the search is complete. You can examine the stored results + at a later time. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :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_timeout: The amount of time that you - plan to wait for the results. You can poll the remaining results based - on an ID. The maximum value is `300s`. Default is `1s`. + :arg wait_for_completion_timeout: The amount of time to wait for + the results. You can poll the remaining results based on an ID. The + maximum value is 300 seconds. Default is `1s`. """ return self.transport.perform_request( "POST", @@ -153,8 +154,8 @@ def stats( headers: Any = None, ) -> Any: """ - Monitoring of asynchronous searches that are running, completed, and/or - persisted. + Monitors any asynchronous searches that are `running`, `completed`, or + `persisted`. :arg error_trace: Whether to include the stack trace of returned diff --git a/opensearchpy/plugins/flow_framework.py b/opensearchpy/plugins/flow_framework.py index 12bf8056..2353fd5e 100644 --- a/opensearchpy/plugins/flow_framework.py +++ b/opensearchpy/plugins/flow_framework.py @@ -41,7 +41,7 @@ def create( headers: Any = None, ) -> Any: """ - Create a workflow. + Creates a new workflow template. :arg error_trace: Whether to include the stack trace of returned @@ -56,8 +56,7 @@ def create( response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. - :arg use_case: To use a workflow template, specify it in the - `use_case` query parameter when creating a workflow. + :arg use_case: Specifies the workflow template to use. """ return self.transport.perform_request( "POST", @@ -77,7 +76,7 @@ def delete( headers: Any = None, ) -> Any: """ - Delete a workflow. + Deletes a workflow template. :arg error_trace: Whether to include the stack trace of returned @@ -115,7 +114,7 @@ def deprovision( headers: Any = None, ) -> Any: """ - Deprovision workflow's resources when you no longer need it. + Deprovision workflow's resources when you no longer need them. :arg error_trace: Whether to include the stack trace of returned @@ -153,7 +152,7 @@ def get( headers: Any = None, ) -> Any: """ - Get a workflow. + Retrieves a workflow template. :arg error_trace: Whether to include the stack trace of returned @@ -189,11 +188,11 @@ def get_status( headers: Any = None, ) -> Any: """ - Get the provisioning deployment status until it is complete. + Retrieves the current workflow provisioning status. - :arg all: The all parameter specifies whether the response - should return all fields. Default is false. + :arg all: Whether to return all fields in the response. Default + is false. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -230,7 +229,7 @@ def get_steps( headers: Any = None, ) -> Any: """ - Get a list of workflow steps. + Retrieves available workflow steps. :arg error_trace: Whether to include the stack trace of returned @@ -384,8 +383,7 @@ def update( headers: Any = None, ) -> Any: """ - Update a workflow. You can only update a complete workflow if it has not yet - been provisioned. + Updates a workflow template that has not been provisioned. :arg error_trace: Whether to include the stack trace of returned @@ -400,8 +398,7 @@ def update( response. Default is false. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. - :arg use_case: To use a workflow template, specify it in the - `use_case` query parameter when creating a workflow. + :arg use_case: Specifies the workflow template to use. """ if workflow_id in SKIP_IN_PATH: raise ValueError( diff --git a/opensearchpy/plugins/geospatial.py b/opensearchpy/plugins/geospatial.py new file mode 100644 index 00000000..7ec8551e --- /dev/null +++ b/opensearchpy/plugins/geospatial.py @@ -0,0 +1,269 @@ +# 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 GeospatialClient(NamespacedClient): + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def delete_ip2geo_datasource( + self, + name: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Delete a specific IP2Geo data source. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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'.") + + return self.transport.perform_request( + "DELETE", + _make_path("_plugins", "geospatial", "ip2geo", "datasource", name), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def geojson_upload_post( + self, + body: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Use an OpenSearch query to upload `GeoJSON`, operation will fail if index + exists. - When type is `geo_point`, only Point geometry is allowed - When type + is `geo_shape`, all geometry types are allowed (Point, MultiPoint, LineString, + MultiLineString, Polygon, MultiPolygon, GeometryCollection, Envelope). + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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/geospatial/geojson/_upload", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def geojson_upload_put( + self, + body: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Use an OpenSearch query to upload `GeoJSON` regardless if index exists. - When + type is `geo_point`, only Point geometry is allowed - When type is `geo_shape`, + all geometry types are allowed (Point, MultiPoint, LineString, MultiLineString, + Polygon, MultiPolygon, GeometryCollection, Envelope). + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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( + "PUT", + "/_plugins/geospatial/geojson/_upload", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get_ip2geo_datasource( + self, + name: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get one or more IP2Geo data sources, defaulting to returning all if no names + specified. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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("_plugins", "geospatial", "ip2geo", "datasource", name), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get_upload_stats( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Retrieves statistics for all geospatial uploads. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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/geospatial/_upload/stats", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def put_ip2geo_datasource( + self, + name: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Create a specific IP2Geo data source. Default values: - `endpoint`: + `"https://geoip.maps.opensearch.org/v1/geolite2-city/manifest.json"` - + `update_interval_in_days`: 3. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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'.") + + return self.transport.perform_request( + "PUT", + _make_path("_plugins", "geospatial", "ip2geo", "datasource", name), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def put_ip2geo_datasource_settings( + self, + name: Any, + body: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Update a specific IP2Geo data source. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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: + raise ValueError("Empty value passed for a required argument.") + + return self.transport.perform_request( + "PUT", + _make_path( + "_plugins", "geospatial", "ip2geo", "datasource", name, "_settings" + ), + params=params, + headers=headers, + body=body, + ) diff --git a/opensearchpy/plugins/knn.py b/opensearchpy/plugins/knn.py index 191bfb5f..51bb338d 100644 --- a/opensearchpy/plugins/knn.py +++ b/opensearchpy/plugins/knn.py @@ -175,7 +175,7 @@ def search_models( trips should be minimized as part of cross-cluster search requests execution. Default is True. :arg default_operator: The default operator for query string - query (AND or OR). Valid choices are AND, OR. + query (AND or OR). Valid choices are and, AND, or, 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 @@ -223,8 +223,7 @@ def search_models( :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 - dfs_query_then_fetch, query_then_fetch. + :arg search_type: Search operation type. :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. @@ -310,7 +309,7 @@ def stats( ) def train_model( self, - body: Any, + body: Any = None, model_id: Any = None, params: Any = None, headers: Any = None, @@ -335,9 +334,6 @@ def train_model( :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", _make_path("_plugins", "_knn", "models", model_id, "_train"), diff --git a/opensearchpy/plugins/ml.py b/opensearchpy/plugins/ml.py index cfb58405..fc561935 100644 --- a/opensearchpy/plugins/ml.py +++ b/opensearchpy/plugins/ml.py @@ -251,7 +251,7 @@ def search_models( libraries that do not accept a request body for non-POST requests. """ return self.transport.perform_request( - "GET", + "POST", "/_plugins/_ml/models/_search", params=params, headers=headers, @@ -295,7 +295,8 @@ def deploy_model( @query_params("error_trace", "filter_path", "human", "pretty", "source") def undeploy_model( self, - model_id: Any, + body: Any = None, + model_id: Any = None, params: Any = None, headers: Any = None, ) -> Any: @@ -316,14 +317,12 @@ def undeploy_model( :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'.") - return self.transport.perform_request( "POST", _make_path("_plugins", "_ml", "models", model_id, "_undeploy"), params=params, headers=headers, + body=body, ) @query_params("error_trace", "filter_path", "human", "pretty", "source") @@ -493,3 +492,1579 @@ def register_agents( headers=headers, body=body, ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def chunk_model( + self, + model_id: Any, + chunk_number: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Uploads model chunk. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + from warnings import warn + + warn("Deprecated: Use `upload_chunk` instead.") + for param in (model_id, chunk_number): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "models", model_id, "chunk", chunk_number), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def create_controller( + self, + model_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Creates a controller. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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'.") + + return self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "controllers", model_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def create_memory( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Create a memory. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", "/_plugins/_ml/memory", params=params, headers=headers, body=body + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def create_message( + self, + memory_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Create a message. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if memory_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'memory_id'.") + + return self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "memory", memory_id, "messages"), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def create_model_meta( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Registers model metadata. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + from warnings import warn + + warn("Deprecated: Use `_register_meta` instead.") + return self.transport.perform_request( + "POST", + "/_plugins/_ml/models/meta", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def delete_controller( + self, + model_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Deletes a controller. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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'.") + + return self.transport.perform_request( + "DELETE", + _make_path("_plugins", "_ml", "controllers", model_id), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def delete_memory( + self, + memory_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Delete a memory. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if memory_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'memory_id'.") + + return self.transport.perform_request( + "DELETE", + _make_path("_plugins", "_ml", "memory", memory_id), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def execute_agent( + self, + agent_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Execute an agent. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if agent_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'agent_id'.") + + return self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "agents", agent_id, "_execute"), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def execute_algorithm( + self, + algorithm_name: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Execute an algorithm. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if algorithm_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'algorithm_name'." + ) + + return self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "_execute", algorithm_name), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get_agent( + self, + agent_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get an agent. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if agent_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'agent_id'.") + + return self.transport.perform_request( + "GET", + _make_path("_plugins", "_ml", "agents", agent_id), + params=params, + headers=headers, + ) + + @query_params( + "error_trace", + "filter_path", + "human", + "max_results", + "next_token", + "pretty", + "source", + ) + def get_all_memories( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get all memories. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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/_ml/memory", params=params, headers=headers + ) + + @query_params( + "error_trace", + "filter_path", + "human", + "max_results", + "next_token", + "pretty", + "source", + ) + def get_all_messages( + self, + memory_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get all messages in a memory. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if memory_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'memory_id'.") + + return self.transport.perform_request( + "GET", + _make_path("_plugins", "_ml", "memory", memory_id, "messages"), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get_all_tools( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get tools. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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/_ml/tools", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get_connector( + self, + connector_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Retrieves a standalone connector. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if connector_id in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'connector_id'." + ) + + return self.transport.perform_request( + "GET", + _make_path("_plugins", "_ml", "connectors", connector_id), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get_controller( + self, + model_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Retrieves a controller. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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'.") + + return self.transport.perform_request( + "GET", + _make_path("_plugins", "_ml", "controllers", model_id), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get_memory( + self, + memory_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get a memory. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if memory_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'memory_id'.") + + return self.transport.perform_request( + "GET", + _make_path("_plugins", "_ml", "memory", memory_id), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get_message( + self, + message_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get a message. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if message_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'message_id'.") + + return self.transport.perform_request( + "GET", + _make_path("_plugins", "_ml", "memory", "message", message_id), + params=params, + headers=headers, + ) + + @query_params( + "error_trace", + "filter_path", + "human", + "max_results", + "next_token", + "pretty", + "source", + ) + def get_message_traces( + self, + message_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get a message traces. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if message_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'message_id'.") + + return self.transport.perform_request( + "GET", + _make_path("_plugins", "_ml", "memory", "message", message_id, "traces"), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get_model( + self, + model_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Retrieves a model. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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'.") + + return self.transport.perform_request( + "GET", + _make_path("_plugins", "_ml", "models", model_id), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get_profile( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get a profile. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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/_ml/profile", params=params, headers=headers, body=body + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get_profile_models( + self, + body: Any = None, + model_id: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get a profile models. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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("_plugins", "_ml", "profile", "models", model_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get_profile_tasks( + self, + body: Any = None, + task_id: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get a profile tasks. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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("_plugins", "_ml", "profile", "tasks", task_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get_stats( + self, + node_id: Any = None, + stat: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get stats. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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("_plugins", "_ml", node_id, "stats", stat), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get_tool( + self, + tool_name: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Get tools. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if tool_name in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'tool_name'.") + + return self.transport.perform_request( + "GET", + _make_path("_plugins", "_ml", "tools", tool_name), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def load_model( + self, + model_id: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Deploys a model. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + from warnings import warn + + warn("Deprecated: Use `deploy_model` instead.") + if model_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'model_id'.") + + return self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "models", model_id, "_load"), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def predict( + self, + algorithm_name: Any, + model_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Predicts new data with trained model. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + for param in (algorithm_name, model_id): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "_predict", algorithm_name, model_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def predict_model( + self, + model_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Predicts a model. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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'.") + + return self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "models", model_id, "_predict"), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def register_model_meta( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Registers model metadata. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", + "/_plugins/_ml/models/_register_meta", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def search_agents( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Search agents. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", + "/_plugins/_ml/agents/_search", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def search_connectors( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Searches for standalone connectors. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", + "/_plugins/_ml/connectors/_search", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def search_memory( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Search memory. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", + "/_plugins/_ml/memory/_search", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def search_message( + self, + memory_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Search messages. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if memory_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'memory_id'.") + + return self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "memory", memory_id, "_search"), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def search_model_group( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Searches for model groups. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", + "/_plugins/_ml/model_groups/_search", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def search_tasks( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Searches for tasks. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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", + "/_plugins/_ml/tasks/_search", + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def train( + self, + algorithm_name: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Trains a model synchronously. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if algorithm_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'algorithm_name'." + ) + + return self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "_train", algorithm_name), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def train_predict( + self, + algorithm_name: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Trains a model and predicts against the same training dataset. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if algorithm_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'algorithm_name'." + ) + + return self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "_train_predict", algorithm_name), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def unload_model( + self, + body: Any = None, + model_id: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Unloads a model. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + from warnings import warn + + warn("Deprecated: Use `undeploy_model` instead.") + return self.transport.perform_request( + "POST", + _make_path("_plugins", "_ml", "models", model_id, "_unload"), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def update_connector( + self, + connector_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Updates a standalone connector. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if connector_id in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'connector_id'." + ) + + return self.transport.perform_request( + "PUT", + _make_path("_plugins", "_ml", "connectors", connector_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def update_controller( + self, + model_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Updates a controller. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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'.") + + return self.transport.perform_request( + "PUT", + _make_path("_plugins", "_ml", "controllers", model_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def update_memory( + self, + memory_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Update a memory. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if memory_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'memory_id'.") + + return self.transport.perform_request( + "PUT", + _make_path("_plugins", "_ml", "memory", memory_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def update_message( + self, + message_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Update a message. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if message_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'message_id'.") + + return self.transport.perform_request( + "PUT", + _make_path("_plugins", "_ml", "memory", "message", message_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def update_model( + self, + model_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Updates a model. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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'.") + + return self.transport.perform_request( + "PUT", + _make_path("_plugins", "_ml", "models", model_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def update_model_group( + self, + model_group_id: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Updates a model group. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if model_group_id in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'model_group_id'." + ) + + return self.transport.perform_request( + "PUT", + _make_path("_plugins", "_ml", "model_groups", model_group_id), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def upload_chunk( + self, + model_id: Any, + chunk_number: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Uploads model chunk. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + for param in (model_id, chunk_number): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return self.transport.perform_request( + "POST", + _make_path( + "_plugins", "_ml", "models", model_id, "upload_chunk", chunk_number + ), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def upload_model( + self, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Registers a model. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + from warnings import warn + + warn("Deprecated: Use `register_model` instead.") + return self.transport.perform_request( + "POST", + "/_plugins/_ml/models/_upload", + params=params, + headers=headers, + body=body, + ) diff --git a/opensearchpy/plugins/neural.py b/opensearchpy/plugins/neural.py new file mode 100644 index 00000000..154472c0 --- /dev/null +++ b/opensearchpy/plugins/neural.py @@ -0,0 +1,77 @@ +# 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 NamespacedClient, _make_path, query_params + + +class NeuralClient(NamespacedClient): + @query_params( + "error_trace", + "filter_path", + "flat_stat_paths", + "human", + "include_metadata", + "pretty", + "source", + ) + def stats( + self, + node_id: Any = None, + stat: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Provides information about the current status of the neural-search plugin. + + + :arg node_id: Comma-separated list of node IDs or names to limit + the returned information; leave empty to get information from all nodes. + :arg stat: Comma-separated list of stats to retrieve; use empty + string to retrieve all stats. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg flat_stat_paths: Whether to return stats in the flat form, + which can improve readability, especially for heavily nested stats. For + example, the flat form of `"processors": { "ingest": { + "text_embedding_executions": 20181212 } }` is + `"processors.ingest.text_embedding_executions": "20181212"`. Default is + false. + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg include_metadata: Whether to return stat metadata instead + of the raw stat value, includes additional information about the stat. + These can include things like type hints, time since last stats being + recorded, or recent rolling interval values Default is false. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :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("_plugins", "_neural", node_id, "stats", stat), + params=params, + headers=headers, + ) diff --git a/opensearchpy/plugins/observability.py b/opensearchpy/plugins/observability.py index 2bf9e03f..cb1301cd 100644 --- a/opensearchpy/plugins/observability.py +++ b/opensearchpy/plugins/observability.py @@ -65,7 +65,7 @@ def delete_object( Deletes specific observability object specified by ID. - :arg object_id: The ID of the Observability Object. + :arg object_id: The ID of the observability object to delete. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -115,10 +115,10 @@ def delete_objects( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :arg objectId: The ID of a single Observability Object to + :arg objectId: The ID of a single observability object to delete. - :arg objectIdList: A comma-separated list of Observability - Object IDs to delete. + :arg objectIdList: A comma-separated list of observability + object IDs to delete. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for @@ -135,7 +135,7 @@ def get_localstats( headers: Any = None, ) -> Any: """ - Retrieves Local Stats of all observability objects. + Retrieves local stats of all observability objects. :arg error_trace: Whether to include the stack trace of returned @@ -169,7 +169,7 @@ def get_object( Retrieves specific observability object specified by ID. - :arg object_id: The ID of the Observability Object. + :arg object_id: The ID of the observability object to retrieve. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -232,7 +232,7 @@ def update_object( Updates an existing observability object. - :arg object_id: The ID of the Observability Object. + :arg object_id: The ID of the observability object to update. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter diff --git a/opensearchpy/plugins/ppl.py b/opensearchpy/plugins/ppl.py index d0933867..d85a6843 100644 --- a/opensearchpy/plugins/ppl.py +++ b/opensearchpy/plugins/ppl.py @@ -32,7 +32,7 @@ def explain( headers: Any = None, ) -> Any: """ - Shows how a query is executed against OpenSearch. + Returns the execution plan for a PPL query. :arg error_trace: Whether to include the stack trace of returned @@ -41,14 +41,13 @@ def explain( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON, YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg sanitize: Specifies whether to escape special characters in - the results. Default is True. + :arg sanitize: Whether to escape special characters in the + results. Default is True. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -68,7 +67,7 @@ def get_stats( headers: Any = None, ) -> Any: """ - Collect metrics for the plugin within the interval. + Retrieves performance metrics for the PPL plugin. :arg error_trace: Whether to include the stack trace of returned @@ -77,14 +76,13 @@ def get_stats( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON, YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg sanitize: Specifies whether to escape special characters in - the results. Default is True. + :arg sanitize: Whether to escape special characters in the + results. Default is True. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -102,8 +100,7 @@ def post_stats( headers: Any = None, ) -> Any: """ - By a stats endpoint, you are able to collect metrics for the plugin within the - interval. + Retrieves filtered performance metrics for the PPL plugin. :arg error_trace: Whether to include the stack trace of returned @@ -112,14 +109,13 @@ def post_stats( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON, YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg sanitize: Specifies whether to escape special characters in - the results. Default is True. + :arg sanitize: Whether to escape special characters in the + results. Default is True. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -140,7 +136,7 @@ def query( headers: Any = None, ) -> Any: """ - Send a PPL query to the PPL plugin. + Executes a PPL query against OpenSearch indexes. :arg error_trace: Whether to include the stack trace of returned @@ -149,14 +145,13 @@ def query( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON OR YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg sanitize: Specifies whether to escape special characters in - the results. Default is True. + :arg sanitize: Whether to sanitize special characters in the + results. Default is True. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ diff --git a/opensearchpy/plugins/query.py b/opensearchpy/plugins/query.py index ab368d85..cedfab41 100644 --- a/opensearchpy/plugins/query.py +++ b/opensearchpy/plugins/query.py @@ -30,10 +30,10 @@ def datasource_delete( headers: Any = None, ) -> Any: """ - Deletes specific datasource specified by name. + Deletes a specific data source by name. - :arg datasource_name: The Name of the DataSource to delete. + :arg datasource_name: The name of the data source to delete. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -67,10 +67,10 @@ def datasource_retrieve( headers: Any = None, ) -> Any: """ - Retrieves specific datasource specified by name. + Retrieves a specific data source by name. - :arg datasource_name: The Name of the DataSource to retrieve. + :arg datasource_name: The name of the data source to retrieve. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -104,7 +104,7 @@ def datasources_create( headers: Any = None, ) -> Any: """ - Creates a new query datasource. + Creates a new query data source. :arg error_trace: Whether to include the stack trace of returned @@ -135,7 +135,7 @@ def datasources_list( headers: Any = None, ) -> Any: """ - Retrieves list of all datasources. + Retrieves a list of all available data sources. :arg error_trace: Whether to include the stack trace of returned @@ -163,7 +163,7 @@ def datasources_update( headers: Any = None, ) -> Any: """ - Updates an existing query datasource. + Updates an existing query data source. :arg error_trace: Whether to include the stack trace of returned diff --git a/opensearchpy/plugins/replication.py b/opensearchpy/plugins/replication.py index 8bbf8314..3ac9d3fb 100644 --- a/opensearchpy/plugins/replication.py +++ b/opensearchpy/plugins/replication.py @@ -29,7 +29,7 @@ def autofollow_stats( headers: Any = None, ) -> Any: """ - Gets information about auto-follow activity and any replication rules + Retrieves information about any auto-follow activity and any replication rules configured on the specified cluster. @@ -61,7 +61,7 @@ def create_replication_rule( headers: Any = None, ) -> Any: """ - Automatically starts replication on indexes matching a specified pattern. + Automatically starts the replication on indexes matching a specified pattern. :arg error_trace: Whether to include the stack trace of returned @@ -130,7 +130,8 @@ def follower_stats( headers: Any = None, ) -> Any: """ - Gets information about follower (syncing) indexes on a specified cluster. + Retrieves information about any follower (syncing) indexes on a specified + cluster. :arg error_trace: Whether to include the stack trace of returned @@ -160,7 +161,8 @@ def leader_stats( headers: Any = None, ) -> Any: """ - Gets information about replicated leader indexes on a specified cluster. + Retrieves information about any replicated leader indexes on a specified + cluster. :arg error_trace: Whether to include the stack trace of returned @@ -189,11 +191,11 @@ def pause( headers: Any = None, ) -> Any: """ - Pauses replication of the leader index. + Pauses the replication of the leader index. - :arg index: Name of the data stream, index, or index alias to - perform bulk actions on. + :arg index: The name of the data stream, index, or index alias + to perform bulk actions on. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -231,8 +233,8 @@ def resume( Resumes replication of the leader index. - :arg index: Name of the data stream, index, or index alias to - perform bulk actions on. + :arg index: The name of the data stream, index, or index alias + to perform bulk actions on. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -267,12 +269,12 @@ def start( headers: Any = None, ) -> Any: """ - Initiate replication of an index from the leader cluster to the follower + Initiates the replication of an index from the leader cluster to the follower cluster. - :arg index: Name of the data stream, index, or index alias to - perform bulk actions on. + :arg index: The name of the data stream, index, or index alias + to perform bulk actions on. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -306,11 +308,11 @@ def status( headers: Any = None, ) -> Any: """ - Gets the status of index replication. + Retrieves the the status of an index replication. - :arg index: Name of the data stream, index, or index alias to - perform bulk actions on. + :arg index: The name of the data stream, index, or index alias + to perform bulk actions on. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -343,11 +345,11 @@ def stop( headers: Any = None, ) -> Any: """ - Terminates replication and converts the follower index to a standard index. + Terminates the replication and converts the follower index to a standard index. - :arg index: Name of the data stream, index, or index alias to - perform bulk actions on. + :arg index: The name of the data stream, index, or index alias + to perform bulk actions on. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -382,11 +384,11 @@ def update_settings( headers: Any = None, ) -> Any: """ - Updates settings on the follower index. + Updates any settings on the follower index. - :arg index: Name of the data stream, index, or index alias to - perform bulk actions on. + :arg index: The name of the data stream, index, or index alias + to perform bulk actions on. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter diff --git a/opensearchpy/plugins/rollups.py b/opensearchpy/plugins/rollups.py index 90b16e53..13c3ebaf 100644 --- a/opensearchpy/plugins/rollups.py +++ b/opensearchpy/plugins/rollups.py @@ -30,10 +30,10 @@ def delete( headers: Any = None, ) -> Any: """ - Delete index rollup. + Deletes an index rollup job configuration. - :arg id: Rollup to access + :arg id: The ID of the rollup job. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -65,10 +65,10 @@ def explain( headers: Any = None, ) -> Any: """ - Get a rollup's current status. + Retrieves the execution status information for an index rollup job. - :arg id: Rollup to access + :arg id: The ID of the rollup job. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -100,10 +100,10 @@ def get( headers: Any = None, ) -> Any: """ - Get an index rollup. + Retrieves an index rollup job configuration by ID. - :arg id: Rollup to access + :arg id: The ID of the rollup job. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -144,10 +144,10 @@ def put( headers: Any = None, ) -> Any: """ - Create or update index rollup. + Creates or updates an index rollup job configuration. - :arg id: Rollup to access + :arg id: The ID of the rollup job. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -156,10 +156,10 @@ def put( with "-". :arg human: Whether to return human readable values for statistics. Default is True. - :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 if_primary_term: Only performs the operation if the + document has the specified primary term. + :arg if_seq_no: Only performs the operation if the document has + the specified sequence number. :arg pretty: Whether to pretty format the returned JSON response. Default is false. :arg source: The URL-encoded request definition. Useful for @@ -184,10 +184,10 @@ def start( headers: Any = None, ) -> Any: """ - Start rollup. + Starts the execution of an index rollup job. - :arg id: Rollup to access + :arg id: The ID of the rollup job. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter @@ -219,10 +219,10 @@ def stop( headers: Any = None, ) -> Any: """ - Stop rollup. + Stops the execution of an index rollup job. - :arg id: Rollup to access + :arg id: The ID of the rollup job. :arg error_trace: Whether to include the stack trace of returned errors. Default is false. :arg filter_path: Used to reduce the response. This parameter diff --git a/opensearchpy/plugins/sm.py b/opensearchpy/plugins/sm.py new file mode 100644 index 00000000..598e8349 --- /dev/null +++ b/opensearchpy/plugins/sm.py @@ -0,0 +1,356 @@ +# 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 SmClient(NamespacedClient): + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def create_policy( + self, + policy_name: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Creates a snapshot management policy. + + + :arg policy_name: The name of the snapshot management policy to + create. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if policy_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'policy_name'." + ) + + return self.transport.perform_request( + "POST", + _make_path("_plugins", "_sm", "policies", policy_name), + params=params, + headers=headers, + body=body, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def delete_policy( + self, + policy_name: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Deletes a snapshot management policy. + + + :arg policy_name: The name of the snapshot management policy to + delete. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if policy_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'policy_name'." + ) + + return self.transport.perform_request( + "DELETE", + _make_path("_plugins", "_sm", "policies", policy_name), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def explain_policy( + self, + policy_name: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Explains the state of the snapshot management policy. + + + :arg policy_name: The name of the snapshot management policy to + explain. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if policy_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'policy_name'." + ) + + return self.transport.perform_request( + "GET", + _make_path("_plugins", "_sm", "policies", policy_name, "_explain"), + params=params, + headers=headers, + ) + + @query_params( + "error_trace", + "filter_path", + "from_", + "human", + "pretty", + "queryString", + "size", + "sortField", + "sortOrder", + "source", + ) + def get_policies( + self, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Retrieves all snapshot management policies with optional pagination and + filtering. + + + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg from_: The starting index from which to retrieve snapshot + management policies. Default is 0. + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg queryString: The query string to filter the returned + snapshot management policies. + :arg size: The number of snapshot management policies to return. + :arg sortField: The name of the field to sort the snapshot + management policies by. + :arg sortOrder: The order to sort the snapshot management + policies. Valid choices are asc, desc.Default is asc. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + # from is a reserved word so it cannot be used, use from_ instead + if "from_" in params: + params["from"] = params.pop("from_") + + return self.transport.perform_request( + "GET", "/_plugins/_sm/policies", params=params, headers=headers + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def get_policy( + self, + policy_name: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Retrieves a specific snapshot management policy by name. + + + :arg policy_name: The name of the snapshot management policy to + retrieve. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if policy_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'policy_name'." + ) + + return self.transport.perform_request( + "GET", + _make_path("_plugins", "_sm", "policies", policy_name), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def start_policy( + self, + policy_name: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Starts a snapshot management policy. + + + :arg policy_name: The name of the snapshot management policy to + start. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if policy_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'policy_name'." + ) + + return self.transport.perform_request( + "POST", + _make_path("_plugins", "_sm", "policies", policy_name, "_start"), + params=params, + headers=headers, + ) + + @query_params("error_trace", "filter_path", "human", "pretty", "source") + def stop_policy( + self, + policy_name: Any, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Stops a snapshot management policy. + + + :arg policy_name: The name of the snapshot management policy to + stop. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if policy_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'policy_name'." + ) + + return self.transport.perform_request( + "POST", + _make_path("_plugins", "_sm", "policies", policy_name, "_stop"), + params=params, + headers=headers, + ) + + @query_params( + "error_trace", + "filter_path", + "human", + "if_primary_term", + "if_seq_no", + "pretty", + "source", + ) + def update_policy( + self, + policy_name: Any, + body: Any = None, + params: Any = None, + headers: Any = None, + ) -> Any: + """ + Updates an existing snapshot management policy. Requires `if_seq_no` and + `if_primary_term`. + + + :arg policy_name: The name of the snapshot management policy to + update. + :arg error_trace: Whether to include the stack trace of returned + errors. Default is false. + :arg filter_path: Used to reduce the response. This parameter + takes a comma-separated list of filters. It supports using wildcards to + match any field or part of a field’s name. You can also exclude fields + with "-". + :arg human: Whether to return human readable values for + statistics. Default is True. + :arg if_primary_term: The primary term of the policy to update. + :arg if_seq_no: The sequence number of the policy to update. + :arg pretty: Whether to pretty format the returned JSON + response. Default is false. + :arg source: The URL-encoded request definition. Useful for + libraries that do not accept a request body for non-POST requests. + """ + if policy_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'policy_name'." + ) + + return self.transport.perform_request( + "PUT", + _make_path("_plugins", "_sm", "policies", policy_name), + params=params, + headers=headers, + body=body, + ) diff --git a/opensearchpy/plugins/sql.py b/opensearchpy/plugins/sql.py index f8f9e56a..1392b590 100644 --- a/opensearchpy/plugins/sql.py +++ b/opensearchpy/plugins/sql.py @@ -32,7 +32,7 @@ def close( headers: Any = None, ) -> Any: """ - Clear the cursor context. + Closes an open cursor to free server-side resources. :arg error_trace: Whether to include the stack trace of returned @@ -41,14 +41,13 @@ def close( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON or YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg sanitize: Specifies whether to escape special characters in - the results Default is True. + :arg sanitize: Whether to escape special characters in the + results. Default is True. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -66,7 +65,7 @@ def explain( headers: Any = None, ) -> Any: """ - Shows how a query is executed against OpenSearch. + Returns the execution plan for a SQL or PPL query. :arg error_trace: Whether to include the stack trace of returned @@ -75,14 +74,13 @@ def explain( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON or YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg sanitize: Specifies whether to escape special characters in - the results Default is True. + :arg sanitize: Whether to escape special characters in the + results. Default is True. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -99,7 +97,7 @@ def get_stats( headers: Any = None, ) -> Any: """ - Collect metrics for the plugin within the interval. + Retrieves performance metrics for the SQL plugin. :arg error_trace: Whether to include the stack trace of returned @@ -108,14 +106,13 @@ def get_stats( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON or YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg sanitize: Specifies whether to escape special characters in - the results Default is True. + :arg sanitize: Whether to escape special characters in the + results. Default is True. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -133,8 +130,7 @@ def post_stats( headers: Any = None, ) -> Any: """ - By a stats endpoint, you are able to collect metrics for the plugin within the - interval. + Retrieves filtered performance metrics for the SQL plugin. :arg error_trace: Whether to include the stack trace of returned @@ -143,14 +139,13 @@ def post_stats( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON or YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg sanitize: Specifies whether to escape special characters in - the results Default is True. + :arg sanitize: Whether to escape special characters in the + results. Default is True. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -168,7 +163,7 @@ def query( headers: Any = None, ) -> Any: """ - Send a SQL/PPL query to the SQL plugin. + Executes SQL or PPL queries against OpenSearch indexes. :arg error_trace: Whether to include the stack trace of returned @@ -177,14 +172,13 @@ def query( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON or YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON response. Default is false. - :arg sanitize: Specifies whether to escape special characters in - the results Default is True. + :arg sanitize: Whether to escape special characters in the + results. Default is True. :arg source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. """ @@ -200,7 +194,7 @@ def settings( headers: Any = None, ) -> Any: """ - Adds SQL settings to the standard OpenSearch cluster settings. + Updates SQL plugin settings in the OpenSearch cluster configuration. :arg error_trace: Whether to include the stack trace of returned @@ -209,8 +203,7 @@ def settings( takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". - :arg format: A short version of the Accept header (for example, - `json`, `yaml`). + :arg format: Specifies the response format (JSON or YAML). :arg human: Whether to return human readable values for statistics. Default is True. :arg pretty: Whether to pretty format the returned JSON