From 1190079f517791e7333e7fce5d095ccfc116ef93 Mon Sep 17 00:00:00 2001 From: Sai Medhini Reddy Maryada <117196660+saimedhi@users.noreply.github.com> Date: Thu, 26 Oct 2023 07:58:33 -0700 Subject: [PATCH] Generate opensearch-py client from API specs (#551) Signed-off-by: saimedhi --- CHANGELOG.md | 1 + opensearchpy/_async/client/__init__.py | 1087 ++++++++-------- opensearchpy/_async/client/__init__.pyi | 35 +- opensearchpy/_async/client/cat.py | 276 ++-- opensearchpy/_async/client/cluster.py | 102 +- opensearchpy/_async/client/cluster.pyi | 1 + .../_async/client/dangling_indices.py | 8 +- opensearchpy/_async/client/indices.py | 1113 +++++++--------- opensearchpy/_async/client/indices.pyi | 232 +--- opensearchpy/_async/client/ingest.py | 14 +- opensearchpy/_async/client/nodes.py | 34 +- opensearchpy/_async/client/security.py | 219 +++- opensearchpy/_async/client/security.pyi | 713 ++++++++++- opensearchpy/_async/client/snapshot.py | 249 ++-- opensearchpy/_async/client/snapshot.pyi | 63 +- opensearchpy/_async/client/tasks.py | 11 +- opensearchpy/client/__init__.py | 1089 ++++++++-------- opensearchpy/client/__init__.pyi | 40 +- opensearchpy/client/_patch.pyi | 1 + opensearchpy/client/cat.py | 276 ++-- opensearchpy/client/cluster.py | 102 +- opensearchpy/client/cluster.pyi | 1 + opensearchpy/client/dangling_indices.py | 8 +- opensearchpy/client/indices.py | 1137 +++++++---------- opensearchpy/client/indices.pyi | 232 +--- opensearchpy/client/ingest.py | 14 +- opensearchpy/client/nodes.py | 34 +- opensearchpy/client/security.py | 221 +++- opensearchpy/client/security.pyi | 801 ++++++++++-- opensearchpy/client/snapshot.py | 249 ++-- opensearchpy/client/snapshot.pyi | 63 +- opensearchpy/client/tasks.py | 11 +- utils/generate-api.py | 20 +- utils/templates/base | 6 +- 34 files changed, 4496 insertions(+), 3967 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cc84534..434d218f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Generate `cluster` client from API specs ([#530](https://github.com/opensearch-project/opensearch-py/pull/530)) - Generate `nodes` client from API specs ([#514](https://github.com/opensearch-project/opensearch-py/pull/514)) - Generate `cat` client from API specs ([#529](https://github.com/opensearch-project/opensearch-py/pull/529)) +- Use API generator for all APIs ([#551](https://github.com/opensearch-project/opensearch-py/pull/551)) ### Deprecated - Deprecated point-in-time APIs (list_all_point_in_time, create_point_in_time, delete_point_in_time) and Security Client APIs (health_check and update_audit_config) ([#502](https://github.com/opensearch-project/opensearch-py/pull/502)) ### Removed diff --git a/opensearchpy/_async/client/__init__.py b/opensearchpy/_async/client/__init__.py index 2440b291..7f0d4f98 100644 --- a/opensearchpy/_async/client/__init__.py +++ b/opensearchpy/_async/client/__init__.py @@ -25,6 +25,17 @@ # specific language governing permissions and limitations # under the License. + +# ---------------------------------------------------- +# THIS CODE IS GENERATED AND MANUAL EDITS WILL BE LOST. +# +# To contribute, kindly make essential modifications through either the "opensearch-py client generator": +# https://github.com/opensearch-project/opensearch-py/blob/main/utils/generate-api.py +# or the "OpenSearch API specification" available at: +# https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json +# ----------------------------------------------------- + + from __future__ import unicode_literals import logging @@ -274,25 +285,25 @@ class AsyncOpenSearch(object): with a same ID already exists in the index. - :arg index: The name of the index - :arg id: Document ID + :arg index: Index name. + :arg id: Document ID. :arg body: The document :arg pipeline: The pipeline id to preprocess incoming documents - with + with. :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for - :arg routing: Specific routing value - :arg timeout: Explicit operation timeout - :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: - internal, external, external_gte + do nothing with refreshes. Valid choices are true, false, wait_for. + :arg routing: Routing value. + :arg timeout: Operation timeout. + :arg version: Explicit version number for concurrency control. + :arg version_type: Specific version type. Valid choices are + internal, external, external_gte, force. :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the index operation. Defaults - to 1, meaning the primary shard only. Set to `all` for all shard copies, + that must be active before proceeding with the operation. Defaults to 1, + meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1) + number of copies for the shard (number of replicas + 1). Default is 1. """ for param in (index, id, body): if param in SKIP_IN_PATH: @@ -322,46 +333,42 @@ class AsyncOpenSearch(object): Creates or updates a document in an index. - :arg index: The name of the index + :arg index: Index name. :arg body: The document - :arg id: Document ID - :arg if_primary_term: only perform the index operation if the - last operation that has changed the document has the specified primary - term - :arg if_seq_no: only perform the index operation if the last - operation that has changed the document has the specified sequence - number + :arg id: Document ID. + :arg if_primary_term: only perform the operation if the last + operation that has changed the document has the specified primary term. + :arg if_seq_no: only perform the operation if the last operation + that has changed the document has the specified sequence number. :arg op_type: Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests - without an explicit document ID Valid choices: index, create + without an explicit document ID. Valid choices are index, create. :arg pipeline: The pipeline id to preprocess incoming documents - with + with. :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for + do nothing with refreshes. Valid choices are true, false, wait_for. :arg require_alias: When true, requires destination to be an - alias. Default is false - :arg routing: Specific routing value - :arg timeout: Explicit operation timeout - :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: - internal, external, external_gte + alias. Default is false. + :arg routing: Routing value. + :arg timeout: Operation timeout. + :arg version: Explicit version number for concurrency control. + :arg version_type: Specific version type. Valid choices are + internal, external, external_gte, force. :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the index operation. Defaults - to 1, meaning the primary shard only. Set to `all` for all shard copies, + that must be active before proceeding with the operation. Defaults to 1, + meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1) + number of copies for the shard (number of replicas + 1). Default is 1. """ for param in (index, body): if param in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument.") - doc_type = "_doc" - return await self.transport.perform_request( "POST" if id in SKIP_IN_PATH else "PUT", - _make_path(index, doc_type, id), + _make_path(index, "_doc", id), params=params, headers=headers, body=body, @@ -385,29 +392,29 @@ class AsyncOpenSearch(object): :arg body: The operation definition and data (action-data pairs), separated by newlines - :arg index: Default index for items which don't provide one + :arg index: Default index for items which don't provide one. :arg _source: True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub- - request + request. :arg _source_excludes: Default list of fields to exclude from - the returned _source field, can be overridden on each sub-request + the returned _source field, can be overridden on each sub-request. :arg _source_includes: Default list of fields to extract and - return from the _source field, can be overridden on each sub-request + return from the _source field, can be overridden on each sub-request. :arg pipeline: The pipeline id to preprocess incoming documents - with + with. :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for + do nothing with refreshes. Valid choices are true, false, wait_for. :arg require_alias: Sets require_alias for all incoming - documents. Defaults to unset (false) - :arg routing: Specific routing value - :arg timeout: Explicit operation timeout + documents. Default is false. + :arg routing: Routing value. + :arg timeout: Operation timeout. :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the bulk operation. Defaults - to 1, meaning the primary shard only. Set to `all` for all shard copies, + that must be active before proceeding with the operation. Defaults to 1, + meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1) + number of copies for the shard (number of replicas + 1). Default is 1. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -427,9 +434,9 @@ class AsyncOpenSearch(object): Explicitly clears the search context for a scroll. - :arg body: A comma-separated list of scroll IDs to clear if none + :arg body: Comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter - :arg scroll_id: A comma-separated list of scroll IDs to clear + :arg scroll_id: Comma-separated list of scroll IDs to clear. """ if scroll_id in SKIP_IN_PATH and body in SKIP_IN_PATH: raise ValueError("You need to supply scroll_id or body.") @@ -463,37 +470,38 @@ class AsyncOpenSearch(object): Returns number of documents matching a query. - :arg body: A query to restrict the results specified with the + :arg body: Query to restrict the results specified with the Query DSL (optional) - :arg index: A comma-separated list of indices to restrict the - results + :arg index: Comma-separated list of indices to restrict the + results. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed (default: false) - :arg analyzer: The analyzer to use for the query string + queries should be analyzed. Default is false. + :arg analyzer: The analyzer to use for the query string. :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR). Valid choices are AND, OR. :arg df: The field to use as default where no field prefix is - given in the query string + given in the query string. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_throttled: Whether specified concrete, expanded or - aliased indices should be ignored when throttled + aliased indices should be ignored when throttled. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored + as providing text to a numeric field) should be ignored. :arg min_score: Include only documents with a specific `_score` - value in the result + value in the result. :arg preference: Specify the node or shard the operation should - be performed on (default: random) - :arg q: Query in the Lucene query string syntax - :arg routing: A comma-separated list of specific routing values - :arg terminate_after: The maximum count for each shard, upon - reaching which the query execution will terminate early + be performed on. Default is random. + :arg q: Query in the Lucene query string syntax. + :arg routing: Comma-separated list of specific routing values. + :arg terminate_after: The maximum number of documents to collect + for each shard, upon reaching which the query execution will terminate + early. """ return await self.transport.perform_request( "POST", @@ -518,37 +526,33 @@ class AsyncOpenSearch(object): Removes a document from the index. - :arg index: The name of the index - :arg id: The document ID - :arg if_primary_term: only perform the delete operation if the - last operation that has changed the document has the specified primary - term - :arg if_seq_no: only perform the delete operation if the last - operation that has changed the document has the specified sequence - number + :arg index: Index name. + :arg id: Document ID. + :arg if_primary_term: only perform the operation if the last + operation that has changed the document has the specified primary term. + :arg if_seq_no: only perform the operation if the last operation + that has changed the document has the specified sequence number. :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for - :arg routing: Specific routing value - :arg timeout: Explicit operation timeout - :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: - internal, external, external_gte, force + do nothing with refreshes. Valid choices are true, false, wait_for. + :arg routing: Routing value. + :arg timeout: Operation timeout. + :arg version: Explicit version number for concurrency control. + :arg version_type: Specific version type. Valid choices are + internal, external, external_gte, force. :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the delete operation. - Defaults to 1, meaning the primary shard only. Set to `all` for all - shard copies, otherwise set to any non-negative value less than or equal - to the total number of copies for the shard (number of replicas + 1) + that must be active before proceeding with the operation. Defaults to 1, + meaning the primary shard only. Set to `all` for all shard copies, + otherwise set to any non-negative value less than or equal to the total + number of copies for the shard (number of replicas + 1). Default is 1. """ for param in (index, id): if param in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument.") - doc_type = "_doc" - return await self.transport.perform_request( - "DELETE", _make_path(index, doc_type, id), params=params, headers=headers + "DELETE", _make_path(index, "_doc", id), params=params, headers=headers ) @query_params( @@ -591,76 +595,76 @@ class AsyncOpenSearch(object): Deletes documents matching the provided query. - :arg index: A comma-separated list of index names to search; use - `_all` or empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg body: The search definition using the Query DSL :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed (default: false) - :arg analyzer: The analyzer to use for the query string - :arg conflicts: What to do when the delete by query hits version - conflicts? Valid choices: abort, proceed Default: abort + queries should be analyzed. Default is false. + :arg analyzer: The analyzer to use for the query string. + :arg conflicts: What to do when the operation encounters version + conflicts?. Valid choices are abort, proceed. :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR). Valid choices are AND, OR. :arg df: The field to use as default where no field prefix is - given in the query string + given in the query string. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg from_: Starting offset (default: 0) + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg from_: Starting offset. Default is 0. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored + as providing text to a numeric field) should be ignored. :arg max_docs: Maximum number of documents to process (default: - all documents) + all documents). :arg preference: Specify the node or shard the operation should - be performed on (default: random) - :arg q: Query in the Lucene query string syntax - :arg refresh: Should the effected indexes be refreshed? + be performed on. Default is random. + :arg q: Query in the Lucene query string syntax. + :arg refresh: Refresh the shard containing the document before + performing the operation. :arg request_cache: Specify if request cache should be used for - this request or not, defaults to index level setting + this request or not, defaults to index level setting. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. - :arg routing: A comma-separated list of specific routing values + requests per second. -1 means no throttle. Default is 0. + :arg routing: Comma-separated list of specific routing values. :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search - :arg scroll_size: Size on the scroll request powering the delete - by query Default: 100 + should be maintained for scrolled search. + :arg scroll_size: Size on the scroll request powering the + operation. Default is 100. :arg search_timeout: Explicit timeout for each search request. Defaults to no timeout. - :arg search_type: Search operation type Valid choices: - query_then_fetch, dfs_query_then_fetch - :arg size: Deprecated, please use `max_docs` instead + :arg search_type: Search operation type. Valid choices are + query_then_fetch, dfs_query_then_fetch. + :arg size: Deprecated, please use `max_docs` instead. :arg slices: The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default: 1 - :arg sort: A comma-separated list of : pairs + set to `auto`. Default is 1. + :arg sort: Comma-separated list of : pairs. :arg stats: Specific 'tag' of the request for logging and - statistical purposes + statistical purposes. :arg terminate_after: The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default: 1m - :arg version: Specify whether to return document version as part - of a hit + shards that are unavailable. Default is 1m. + :arg version: Whether to return document version as part of a + hit. :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the delete by query - operation. Defaults to 1, meaning the primary shard only. Set to `all` - for all shard copies, otherwise set to any non-negative value less than - or equal to the total number of copies for the shard (number of replicas - + 1) - :arg wait_for_completion: Should the request should block until - the delete by query is complete. Default: True + that must be active before proceeding with the operation. Defaults to 1, + meaning the primary shard only. Set to `all` for all shard copies, + otherwise set to any non-negative value less than or equal to the total + number of copies for the shard (number of replicas + 1). Default is 1. + :arg wait_for_completion: Should this request wait until the + operation has completed before returning. Default is True. """ # from is a reserved word so it cannot be used, use from_ instead if "from_" in params: @@ -685,9 +689,9 @@ class AsyncOpenSearch(object): operation. - :arg task_id: The task id to rethrottle - :arg requests_per_second: The throttle to set on this request in - floating sub-requests per second. -1 means set no throttle. + :arg task_id: The task id to rethrottle. + :arg requests_per_second: The throttle for this request in sub- + requests per second. -1 means no throttle. """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'task_id'.") @@ -699,16 +703,19 @@ class AsyncOpenSearch(object): headers=headers, ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") async def delete_script(self, id, params=None, headers=None): """ Deletes a script. - :arg id: Script ID - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + :arg id: Script ID. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'id'.") @@ -734,35 +741,33 @@ class AsyncOpenSearch(object): Returns information about whether a document exists in an index. - :arg index: The name of the index - :arg id: The document ID + :arg index: Index name. + :arg id: Document ID. :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. :arg preference: Specify the node or shard the operation should - be performed on (default: random) + be performed on. Default is random. :arg realtime: Specify whether to perform the operation in - realtime or search mode + realtime or search mode. :arg refresh: Refresh the shard containing the document before - performing the operation - :arg routing: Specific routing value - :arg stored_fields: A comma-separated list of stored fields to - return in the response - :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: - internal, external, external_gte, force + performing the operation. + :arg routing: Routing value. + :arg stored_fields: Comma-separated list of stored fields to + return. + :arg version: Explicit version number for concurrency control. + :arg version_type: Specific version type. Valid choices are + internal, external, external_gte, force. """ for param in (index, id): if param in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument.") - doc_type = "_doc" - return await self.transport.perform_request( - "HEAD", _make_path(index, doc_type, id), params=params, headers=headers + "HEAD", _make_path(index, "_doc", id), params=params, headers=headers ) @query_params( @@ -781,24 +786,24 @@ class AsyncOpenSearch(object): Returns information about whether a document source exists in an index. - :arg index: The name of the index - :arg id: The document ID + :arg index: Index name. + :arg id: Document ID. :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. :arg preference: Specify the node or shard the operation should - be performed on (default: random) + be performed on. Default is random. :arg realtime: Specify whether to perform the operation in - realtime or search mode + realtime or search mode. :arg refresh: Refresh the shard containing the document before - performing the operation - :arg routing: Specific routing value - :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: - internal, external, external_gte, force + performing the operation. + :arg routing: Routing value. + :arg version: Explicit version number for concurrency control. + :arg version_type: Specific version type. Valid choices are + internal, external, external_gte, force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -829,30 +834,30 @@ class AsyncOpenSearch(object): Returns information about why a specific matches (or doesn't match) a query. - :arg index: The name of the index - :arg id: The document ID + :arg index: Index name. + :arg id: Document ID. :arg body: The query definition using the Query DSL :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. :arg analyze_wildcard: Specify whether wildcards and prefix - queries in the query string query should be analyzed (default: false) - :arg analyzer: The analyzer for the query string query + queries in the query string query should be analyzed. Default is false. + :arg analyzer: The analyzer to use for the query string. :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR - :arg df: The default field for query string query (default: - _all) + query (AND or OR). Valid choices are AND, OR. + :arg df: The default field for query string query. Default is + _all. :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored + as providing text to a numeric field) should be ignored. :arg preference: Specify the node or shard the operation should - be performed on (default: random) - :arg q: Query in the Lucene query string syntax - :arg routing: Specific routing value - :arg stored_fields: A comma-separated list of stored fields to - return in the response + be performed on. Default is random. + :arg q: Query in the Lucene query string syntax. + :arg routing: Routing value. + :arg stored_fields: Comma-separated list of stored fields to + return. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -878,19 +883,19 @@ class AsyncOpenSearch(object): :arg body: An index filter specified with the Query DSL - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg fields: A comma-separated list of field names + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg fields: Comma-separated list of field names. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg include_unmapped: Indicates whether unmapped fields should - be included in the response. + be included in the response. Default is false. """ return await self.transport.perform_request( "POST", @@ -917,46 +922,47 @@ class AsyncOpenSearch(object): Returns a document. - :arg index: The name of the index - :arg id: The document ID + :arg index: Index name. + :arg id: Document ID. :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. :arg preference: Specify the node or shard the operation should - be performed on (default: random) + be performed on. Default is random. :arg realtime: Specify whether to perform the operation in - realtime or search mode + realtime or search mode. :arg refresh: Refresh the shard containing the document before - performing the operation - :arg routing: Specific routing value - :arg stored_fields: A comma-separated list of stored fields to - return in the response - :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: - internal, external, external_gte, force + performing the operation. + :arg routing: Routing value. + :arg stored_fields: Comma-separated list of stored fields to + return. + :arg version: Explicit version number for concurrency control. + :arg version_type: Specific version type. Valid choices are + internal, external, external_gte, force. """ for param in (index, id): if param in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument.") - doc_type = "_doc" - return await self.transport.perform_request( - "GET", _make_path(index, doc_type, id), params=params, headers=headers + "GET", _make_path(index, "_doc", id), params=params, headers=headers ) - @query_params("master_timeout", "cluster_manager_timeout") + @query_params("cluster_manager_timeout", "master_timeout") async def get_script(self, id, params=None, headers=None): """ Returns a script. - :arg id: Script ID - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + :arg id: Script ID. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'id'.") @@ -981,24 +987,24 @@ class AsyncOpenSearch(object): Returns the source of a document. - :arg index: The name of the index - :arg id: The document ID + :arg index: Index name. + :arg id: Document ID. :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. :arg preference: Specify the node or shard the operation should - be performed on (default: random) + be performed on. Default is random. :arg realtime: Specify whether to perform the operation in - realtime or search mode + realtime or search mode. :arg refresh: Refresh the shard containing the document before - performing the operation - :arg routing: Specific routing value - :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: - internal, external, external_gte, force + performing the operation. + :arg routing: Routing value. + :arg version: Explicit version number for concurrency control. + :arg version_type: Specific version type. Valid choices are + internal, external, external_gte, force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -1026,24 +1032,24 @@ class AsyncOpenSearch(object): :arg body: Document identifiers; can be either `docs` - (containing full document information) or `ids` (when index and type is - provided in the URL. - :arg index: The name of the index + (containing full document information) or `ids` (when index is provided + in the URL. + :arg index: Index name. :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. :arg preference: Specify the node or shard the operation should - be performed on (default: random) + be performed on. Default is random. :arg realtime: Specify whether to perform the operation in - realtime or search mode + realtime or search mode. :arg refresh: Refresh the shard containing the document before - performing the operation - :arg routing: Specific routing value - :arg stored_fields: A comma-separated list of stored fields to - return in the response + performing the operation. + :arg routing: Routing value. + :arg stored_fields: Comma-separated list of stored fields to + return. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1072,30 +1078,31 @@ class AsyncOpenSearch(object): :arg body: The request definitions (metadata-search request definition pairs), separated by newlines - :arg index: A comma-separated list of index names to use as - default + :arg index: Comma-separated list of indices to use as default. :arg ccs_minimize_roundtrips: Indicates whether network round- trips should be minimized as part of cross-cluster search requests - execution Default: true + execution. Default is True. :arg max_concurrent_searches: Controls the maximum number of - concurrent searches the multi search api will execute + concurrent searches the multi search api will execute. :arg max_concurrent_shard_requests: The number of concurrent shard requests each sub search executes concurrently per node. This value should be used to limit the impact of the search on the cluster in - order to limit the number of concurrent shard requests Default: 5 - :arg pre_filter_shard_size: A threshold that enforces a pre- - filter roundtrip to prefilter search shards based on query rewriting if - the number of shards the search request expands to exceeds the - threshold. This filter roundtrip can limit the number of shards - significantly if for instance a shard can not match any documents based - on its rewrite method ie. if date filters are mandatory to match but the - shard bounds and the query are disjoint. + order to limit the number of concurrent shard requests. Default is 5. + :arg pre_filter_shard_size: Threshold that enforces a pre-filter + round-trip to prefilter search shards based on query rewriting if the + number of shards the search request expands to exceeds the threshold. + This filter round-trip can limit the number of shards significantly if + for instance a shard can not match any documents based on its rewrite + method ie. if date filters are mandatory to match but the shard bounds + and the query are disjoint. :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response - :arg search_type: Search operation type Valid choices: - query_then_fetch, dfs_query_then_fetch + be rendered as an integer or an object in the rest search response. + Default is false. + :arg search_type: Search operation type. Valid choices are + query_then_fetch, query_and_fetch, dfs_query_then_fetch, + dfs_query_and_fetch. :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response + should be prefixed by their respective types in the response. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1123,19 +1130,20 @@ class AsyncOpenSearch(object): :arg body: The request definitions (metadata-search request definition pairs), separated by newlines - :arg index: A comma-separated list of index names to use as - default + :arg index: Comma-separated list of indices to use as default. :arg ccs_minimize_roundtrips: Indicates whether network round- trips should be minimized as part of cross-cluster search requests - execution Default: true + execution. Default is True. :arg max_concurrent_searches: Controls the maximum number of - concurrent searches the multi search api will execute + concurrent searches the multi search api will execute. :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response - :arg search_type: Search operation type Valid choices: - query_then_fetch, dfs_query_then_fetch + be rendered as an integer or an object in the rest search response. + Default is false. + :arg search_type: Search operation type. Valid choices are + query_then_fetch, query_and_fetch, dfs_query_then_fetch, + dfs_query_and_fetch. :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response + should be prefixed by their respective types in the response. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1175,34 +1183,34 @@ class AsyncOpenSearch(object): :arg field_statistics: Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified - in body "params" or "docs". Default: True - :arg fields: A comma-separated list of fields to return. Applies - to all returned documents unless otherwise specified in body "params" or - "docs". - :arg ids: A comma-separated list of documents ids. You must - define ids as parameter or set "ids" or "docs" in the request body + in body 'params' or 'docs'. Default is True. + :arg fields: Comma-separated list of fields to return. Applies + to all returned documents unless otherwise specified in body 'params' or + 'docs'. + :arg ids: Comma-separated list of documents ids. You must define + ids as parameter or set 'ids' or 'docs' in the request body. :arg offsets: Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body - "params" or "docs". Default: True + 'params' or 'docs'. Default is True. :arg payloads: Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body - "params" or "docs". Default: True + 'params' or 'docs'. Default is True. :arg positions: Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body - "params" or "docs". Default: True + 'params' or 'docs'. Default is True. :arg preference: Specify the node or shard the operation should - be performed on (default: random) .Applies to all returned documents - unless otherwise specified in body "params" or "docs". + be performed on. Applies to all returned documents unless otherwise + specified in body 'params' or 'docs'. Default is random. :arg realtime: Specifies if requests are real-time as opposed to - near-real-time (default: true). - :arg routing: Specific routing value. Applies to all returned - documents unless otherwise specified in body "params" or "docs". + near-real-time. Default is True. + :arg routing: Routing value. Applies to all returned documents + unless otherwise specified in body 'params' or 'docs'. :arg term_statistics: Specifies if total term frequency and document frequency should be returned. Applies to all returned documents - unless otherwise specified in body "params" or "docs". - :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: - internal, external, external_gte, force + unless otherwise specified in body 'params' or 'docs'. Default is false. + :arg version: Explicit version number for concurrency control. + :arg version_type: Specific version type. Valid choices are + internal, external, external_gte, force. """ path = _make_path(index, "_mtermvectors") @@ -1210,18 +1218,21 @@ class AsyncOpenSearch(object): "POST", path, params=params, headers=headers, body=body ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") async def put_script(self, id, body, context=None, params=None, headers=None): """ Creates or updates a script. - :arg id: Script ID + :arg id: Script ID. :arg body: The document - :arg context: Context name to compile script against - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + :arg context: Script context. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ for param in (id, body): if param in SKIP_IN_PATH: @@ -1241,28 +1252,23 @@ class AsyncOpenSearch(object): async def rank_eval(self, body, index=None, params=None, headers=None): """ Allows to evaluate the quality of ranked search results over a set of typical - search queries + search queries. - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg body: The ranking evaluation search definition, including search requests, document ratings and ranking metric definition. - :arg index: A comma-separated list of index names to search; use - `_all` or empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg search_type: Search operation type Valid choices: - query_then_fetch, dfs_query_then_fetch + should be ignored when unavailable (missing or closed). + :arg search_type: Search operation type. Valid choices are + query_then_fetch, dfs_query_then_fetch. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1295,24 +1301,24 @@ class AsyncOpenSearch(object): :arg body: The search definition using the Query DSL and the prototype for the index request. :arg max_docs: Maximum number of documents to process (default: - all documents) - :arg refresh: Should the affected indexes be refreshed? - :arg requests_per_second: The throttle to set on this request in - sub-requests per second. -1 means no throttle. - :arg scroll: Control how long to keep the search context alive - Default: 5m + all documents). + :arg refresh: Should the affected indexes be refreshed?. + :arg requests_per_second: The throttle for this request in sub- + requests per second. -1 means no throttle. Default is 0. + :arg scroll: Specify how long a consistent view of the index + should be maintained for scrolled search. :arg slices: The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default: 1 + set to `auto`. Default is 1. :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default: 1m + shards that are unavailable. Default is 1m. :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the reindex operation. - Defaults to 1, meaning the primary shard only. Set to `all` for all - shard copies, otherwise set to any non-negative value less than or equal - to the total number of copies for the shard (number of replicas + 1) - :arg wait_for_completion: Should the request should block until - the reindex is complete. Default: True + that must be active before proceeding with the operation. Defaults to 1, + meaning the primary shard only. Set to `all` for all shard copies, + otherwise set to any non-negative value less than or equal to the total + number of copies for the shard (number of replicas + 1). Default is 1. + :arg wait_for_completion: Should this request wait until the + operation has completed before returning. Default is True. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1327,9 +1333,9 @@ class AsyncOpenSearch(object): Changes the number of requests per second for a particular Reindex operation. - :arg task_id: The task id to rethrottle - :arg requests_per_second: The throttle to set on this request in - floating sub-requests per second. -1 means set no throttle. + :arg task_id: The task id to rethrottle. + :arg requests_per_second: The throttle for this request in sub- + requests per second. -1 means no throttle. """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'task_id'.") @@ -1350,7 +1356,7 @@ class AsyncOpenSearch(object): :arg body: The search definition template and its params - :arg id: The id of the stored search template + :arg id: The id of the stored search template. """ return await self.transport.perform_request( "POST", @@ -1363,14 +1369,9 @@ class AsyncOpenSearch(object): @query_params() async def scripts_painless_execute(self, body=None, params=None, headers=None): """ - Allows an arbitrary script to be executed and a result to be returned + Allows an arbitrary script to be executed and a result to be returned. - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg body: The script to execute """ return await self.transport.perform_request( @@ -1389,11 +1390,12 @@ class AsyncOpenSearch(object): :arg body: The scroll ID if not passed by URL or query parameter. - :arg scroll_id: The scroll ID for scrolled search + :arg scroll_id: Scroll ID. :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response + be rendered as an integer or an object in the rest search response. + Default is false. :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search + should be maintained for scrolled search. """ if scroll_id in SKIP_IN_PATH and body in SKIP_IN_PATH: raise ValueError("You need to supply scroll_id or body.") @@ -1426,7 +1428,6 @@ class AsyncOpenSearch(object): "ignore_unavailable", "lenient", "max_concurrent_shard_requests", - "min_compatible_shard_node", "pre_filter_shard_size", "preference", "q", @@ -1457,101 +1458,99 @@ class AsyncOpenSearch(object): :arg body: The search definition using the Query DSL - :arg index: A comma-separated list of index names to search; use - `_all` or empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg allow_partial_search_results: Indicate if an error should - be returned if there is a partial search failure or timeout Default: - True + be returned if there is a partial search failure or timeout. Default is + True. :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed (default: false) - :arg analyzer: The analyzer to use for the query string + queries should be analyzed. Default is false. + :arg analyzer: The analyzer to use for the query string. :arg batched_reduce_size: The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. - Default: 512 + Default is 512. :arg ccs_minimize_roundtrips: Indicates whether network round- trips should be minimized as part of cross-cluster search requests - execution Default: true + execution. Default is True. :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR). Valid choices are AND, OR. :arg df: The field to use as default where no field prefix is - given in the query string - :arg docvalue_fields: A comma-separated list of fields to return - as the docvalue representation of a field for each hit + given in the query string. + :arg docvalue_fields: Comma-separated list of fields to return + as the docvalue representation of a field for each hit. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg explain: Specify whether to return detailed information - about score computation as part of a hit - :arg from_: Starting offset (default: 0) + about score computation as part of a hit. + :arg from_: Starting offset. Default is 0. :arg ignore_throttled: Whether specified concrete, expanded or - aliased indices should be ignored when throttled + aliased indices should be ignored when throttled. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored + as providing text to a numeric field) should be ignored. :arg max_concurrent_shard_requests: The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order - to limit the number of concurrent shard requests Default: 5 - :arg min_compatible_shard_node: The minimum compatible version - that all shards involved in search should have for this request to be - successful - :arg pre_filter_shard_size: A threshold that enforces a pre- - filter roundtrip to prefilter search shards based on query rewriting if - the number of shards the search request expands to exceeds the - threshold. This filter roundtrip can limit the number of shards - significantly if for instance a shard can not match any documents based - on its rewrite method ie. if date filters are mandatory to match but the - shard bounds and the query are disjoint. + to limit the number of concurrent shard requests. Default is 5. + :arg pre_filter_shard_size: Threshold that enforces a pre-filter + round-trip to prefilter search shards based on query rewriting if the + number of shards the search request expands to exceeds the threshold. + This filter round-trip can limit the number of shards significantly if + for instance a shard can not match any documents based on its rewrite + method ie. if date filters are mandatory to match but the shard bounds + and the query are disjoint. :arg preference: Specify the node or shard the operation should - be performed on (default: random) - :arg q: Query in the Lucene query string syntax + be performed on. Default is random. + :arg q: Query in the Lucene query string syntax. :arg request_cache: Specify if request cache should be used for - this request or not, defaults to index level setting + this request or not, defaults to index level setting. :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response - :arg routing: A comma-separated list of specific routing values + be rendered as an integer or an object in the rest search response. + Default is false. + :arg routing: Comma-separated list of specific routing values. :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search - :arg search_type: Search operation type Valid choices: - query_then_fetch, dfs_query_then_fetch + should be maintained for scrolled search. + :arg search_type: Search operation type. Valid choices are + query_then_fetch, dfs_query_then_fetch. :arg seq_no_primary_term: Specify whether to return sequence - number and primary term of the last modification of each hit - :arg size: Number of hits to return (default: 10) - :arg sort: A comma-separated list of : pairs + number and primary term of the last modification of each hit. + :arg size: Number of hits to return. Default is 10. + :arg sort: Comma-separated list of : pairs. :arg stats: Specific 'tag' of the request for logging and - statistical purposes - :arg stored_fields: A comma-separated list of stored fields to - return as part of a hit - :arg suggest_field: Specify which field to use for suggestions - :arg suggest_mode: Specify suggest mode Valid choices: missing, - popular, always Default: missing - :arg suggest_size: How many suggestions to return in response + statistical purposes. + :arg stored_fields: Comma-separated list of stored fields to + return. + :arg suggest_field: Specify which field to use for suggestions. + :arg suggest_mode: Specify suggest mode. Valid choices are + missing, popular, always. + :arg suggest_size: How many suggestions to return in response. :arg suggest_text: The source text for which the suggestions - should be returned + should be returned. :arg terminate_after: The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - :arg timeout: Explicit operation timeout + :arg timeout: Operation timeout. :arg track_scores: Whether to calculate and return scores even - if they are not used for sorting + if they are not used for sorting. :arg track_total_hits: Indicate if the number of documents that - match the query should be tracked + match the query should be tracked. :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response - :arg version: Specify whether to return document version as part - of a hit + should be prefixed by their respective types in the response. + :arg version: Whether to return document version as part of a + hit. """ # from is a reserved word so it cannot be used, use from_ instead if "from_" in params: @@ -1579,21 +1578,21 @@ class AsyncOpenSearch(object): executed against. - :arg index: A comma-separated list of index names to search; use - `_all` or empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) + from cluster-manager node. Default is false. :arg preference: Specify the node or shard the operation should - be performed on (default: random) - :arg routing: Specific routing value + be performed on. Default is random. + :arg routing: Routing value. """ return await self.transport.perform_request( "GET", _make_path(index, "_search_shards"), params=params, headers=headers @@ -1620,35 +1619,37 @@ class AsyncOpenSearch(object): :arg body: The search definition template and its params - :arg index: A comma-separated list of index names to search; use - `_all` or empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg ccs_minimize_roundtrips: Indicates whether network round- trips should be minimized as part of cross-cluster search requests - execution Default: true + execution. Default is True. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg explain: Specify whether to return detailed information - about score computation as part of a hit + about score computation as part of a hit. :arg ignore_throttled: Whether specified concrete, expanded or - aliased indices should be ignored when throttled + aliased indices should be ignored when throttled. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg preference: Specify the node or shard the operation should - be performed on (default: random) - :arg profile: Specify whether to profile the query execution + be performed on. Default is random. + :arg profile: Specify whether to profile the query execution. :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response - :arg routing: A comma-separated list of specific routing values + be rendered as an integer or an object in the rest search response. + Default is false. + :arg routing: Comma-separated list of specific routing values. :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search - :arg search_type: Search operation type Valid choices: - query_then_fetch, dfs_query_then_fetch + should be maintained for scrolled search. + :arg search_type: Search operation type. Valid choices are + query_then_fetch, query_and_fetch, dfs_query_then_fetch, + dfs_query_and_fetch. :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response + should be prefixed by their respective types in the response. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1683,28 +1684,28 @@ class AsyncOpenSearch(object): :arg index: The index in which the document resides. :arg body: Define parameters and or supply a document to get termvectors for. See documentation. - :arg id: The id of the document, when not specified a doc param - should be supplied. + :arg id: Document ID. When not specified a doc param should be + supplied. :arg field_statistics: Specifies if document count, sum of document frequencies and sum of total term frequencies should be - returned. Default: True - :arg fields: A comma-separated list of fields to return. + returned. Default is True. + :arg fields: Comma-separated list of fields to return. :arg offsets: Specifies if term offsets should be returned. - Default: True + Default is True. :arg payloads: Specifies if term payloads should be returned. - Default: True + Default is True. :arg positions: Specifies if term positions should be returned. - Default: True + Default is True. :arg preference: Specify the node or shard the operation should - be performed on (default: random). + be performed on. Default is random. :arg realtime: Specifies if request is real-time as opposed to - near-real-time (default: true). - :arg routing: Specific routing value. + near-real-time. Default is True. + :arg routing: Routing value. :arg term_statistics: Specifies if total term frequency and - document frequency should be returned. - :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: - internal, external, external_gte, force + document frequency should be returned. Default is false. + :arg version: Explicit version number for concurrency control. + :arg version_type: Specific version type. Valid choices are + internal, external, external_gte, force. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -1734,38 +1735,36 @@ class AsyncOpenSearch(object): Updates a document with a script or partial document. - :arg index: The name of the index - :arg id: Document ID + :arg index: Index name. + :arg id: Document ID. :arg body: The request definition requires either `script` or partial `doc` :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field - :arg if_primary_term: only perform the update operation if the - last operation that has changed the document has the specified primary - term - :arg if_seq_no: only perform the update operation if the last - operation that has changed the document has the specified sequence - number - :arg lang: The script language (default: painless) + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. + :arg if_primary_term: only perform the operation if the last + operation that has changed the document has the specified primary term. + :arg if_seq_no: only perform the operation if the last operation + that has changed the document has the specified sequence number. + :arg lang: The script language. Default is painless. :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for - :arg require_alias: When true, requires destination is an alias. - Default is false + do nothing with refreshes. Valid choices are true, false, wait_for. + :arg require_alias: When true, requires destination to be an + alias. Default is false. :arg retry_on_conflict: Specify how many times should the - operation be retried when a conflict occurs (default: 0) - :arg routing: Specific routing value - :arg timeout: Explicit operation timeout + operation be retried when a conflict occurs. Default is 0. + :arg routing: Routing value. + :arg timeout: Operation timeout. :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the update operation. - Defaults to 1, meaning the primary shard only. Set to `all` for all - shard copies, otherwise set to any non-negative value less than or equal - to the total number of copies for the shard (number of replicas + 1) + that must be active before proceeding with the operation. Defaults to 1, + meaning the primary shard only. Set to `all` for all shard copies, + otherwise set to any non-negative value less than or equal to the total + number of copies for the shard (number of replicas + 1). Default is 1. """ for param in (index, id, body): if param in SKIP_IN_PATH: @@ -1810,7 +1809,6 @@ class AsyncOpenSearch(object): "terminate_after", "timeout", "version", - "version_type", "wait_for_active_shards", "wait_for_completion", ) @@ -1820,80 +1818,77 @@ class AsyncOpenSearch(object): for example to pick up a mapping change. - :arg index: A comma-separated list of index names to search; use - `_all` or empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg body: The search definition using the Query DSL :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed (default: false) - :arg analyzer: The analyzer to use for the query string - :arg conflicts: What to do when the update by query hits version - conflicts? Valid choices: abort, proceed Default: abort + queries should be analyzed. Default is false. + :arg analyzer: The analyzer to use for the query string. + :arg conflicts: What to do when the operation encounters version + conflicts?. Valid choices are abort, proceed. :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR). Valid choices are AND, OR. :arg df: The field to use as default where no field prefix is - given in the query string + given in the query string. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg from_: Starting offset (default: 0) + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg from_: Starting offset. Default is 0. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored + as providing text to a numeric field) should be ignored. :arg max_docs: Maximum number of documents to process (default: - all documents) - :arg pipeline: Ingest pipeline to set on index requests made by - this action. (default: none) + all documents). + :arg pipeline: The pipeline id to preprocess incoming documents + with. :arg preference: Specify the node or shard the operation should - be performed on (default: random) - :arg q: Query in the Lucene query string syntax - :arg refresh: Should the affected indexes be refreshed? + be performed on. Default is random. + :arg q: Query in the Lucene query string syntax. + :arg refresh: Should the affected indexes be refreshed?. :arg request_cache: Specify if request cache should be used for - this request or not, defaults to index level setting - :arg requests_per_second: The throttle to set on this request in - sub-requests per second. -1 means no throttle. - :arg routing: A comma-separated list of specific routing values + this request or not, defaults to index level setting. + :arg requests_per_second: The throttle for this request in sub- + requests per second. -1 means no throttle. Default is 0. + :arg routing: Comma-separated list of specific routing values. :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search - :arg scroll_size: Size on the scroll request powering the update - by query Default: 100 + should be maintained for scrolled search. + :arg scroll_size: Size on the scroll request powering the + operation. Default is 100. :arg search_timeout: Explicit timeout for each search request. Defaults to no timeout. - :arg search_type: Search operation type Valid choices: - query_then_fetch, dfs_query_then_fetch - :arg size: Deprecated, please use `max_docs` instead + :arg search_type: Search operation type. Valid choices are + query_then_fetch, dfs_query_then_fetch. + :arg size: Deprecated, please use `max_docs` instead. :arg slices: The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default: 1 - :arg sort: A comma-separated list of : pairs + set to `auto`. Default is 1. + :arg sort: Comma-separated list of : pairs. :arg stats: Specific 'tag' of the request for logging and - statistical purposes + statistical purposes. :arg terminate_after: The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default: 1m - :arg version: Specify whether to return document version as part - of a hit - :arg version_type: Should the document increment the version - number (internal) on hit or not (reindex) + shards that are unavailable. Default is 1m. + :arg version: Whether to return document version as part of a + hit. :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the update by query - operation. Defaults to 1, meaning the primary shard only. Set to `all` - for all shard copies, otherwise set to any non-negative value less than - or equal to the total number of copies for the shard (number of replicas - + 1) - :arg wait_for_completion: Should the request should block until - the update by query operation is complete. Default: True + that must be active before proceeding with the operation. Defaults to 1, + meaning the primary shard only. Set to `all` for all shard copies, + otherwise set to any non-negative value less than or equal to the total + number of copies for the shard (number of replicas + 1). Default is 1. + :arg wait_for_completion: Should this request wait until the + operation has completed before returning. Default is True. """ # from is a reserved word so it cannot be used, use from_ instead if "from_" in params: @@ -1917,9 +1912,9 @@ class AsyncOpenSearch(object): operation. - :arg task_id: The task id to rethrottle - :arg requests_per_second: The throttle to set on this request in - floating sub-requests per second. -1 means set no throttle. + :arg task_id: The task id to rethrottle. + :arg requests_per_second: The throttle for this request in sub- + requests per second. -1 means no throttle. """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'task_id'.") @@ -1936,11 +1931,6 @@ class AsyncOpenSearch(object): """ Returns all script contexts. - - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version """ return await self.transport.perform_request( "GET", "/_script_context", params=params, headers=headers @@ -1949,13 +1939,8 @@ class AsyncOpenSearch(object): @query_params() async def get_script_languages(self, params=None, headers=None): """ - Returns available script types, languages and contexts + Returns available script types, languages and contexts. - - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version """ return await self.transport.perform_request( "GET", "/_script_language", params=params, headers=headers @@ -1978,11 +1963,11 @@ class AsyncOpenSearch(object): :arg allow_partial_pit_creation: Allow if point in time can be created with partial failures. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: all, - open, closed, hidden, none + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg keep_alive: Specify the keep alive for point in time. :arg preference: Specify the node or shard the operation should - be performed on. + be performed on. Default is random. :arg routing: Comma-separated list of specific routing values. """ if index in SKIP_IN_PATH: @@ -2011,7 +1996,7 @@ class AsyncOpenSearch(object): Deletes one or more point in time searches based on the IDs passed. - :arg body: a point-in-time id to delete + :arg body: The point-in-time ids to be deleted """ return await self.transport.perform_request( "DELETE", @@ -2025,36 +2010,8 @@ class AsyncOpenSearch(object): async def get_all_pits(self, params=None, headers=None): """ Lists all active point in time searches. + """ return await self.transport.perform_request( "GET", "/_search/point_in_time/_all", params=params, headers=headers ) - - @query_params() - async def terms_enum(self, index, body=None, params=None, headers=None): - """ - The terms enum API can be used to discover terms in the index that begin with - the provided string. It is designed for low-latency look-ups used in auto- - complete scenarios. - - - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - - :arg index: A comma-separated list of index names to search; use - `_all` or empty string to perform the operation on all indices - :arg body: field name, string which is the prefix expected in - matching terms, timeout and size for max number of results - """ - if index in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'index'.") - - return await self.transport.perform_request( - "POST", - _make_path(index, "_terms_enum"), - params=params, - headers=headers, - body=body, - ) diff --git a/opensearchpy/_async/client/__init__.pyi b/opensearchpy/_async/client/__init__.pyi index a016d791..70a93d19 100644 --- a/opensearchpy/_async/client/__init__.pyi +++ b/opensearchpy/_async/client/__init__.pyi @@ -25,6 +25,15 @@ # specific language governing permissions and limitations # under the License. +# ---------------------------------------------------- +# THIS CODE IS GENERATED AND MANUAL EDITS WILL BE LOST. +# +# To contribute, kindly make essential modifications through either the "opensearch-py client generator": +# https://github.com/opensearch-project/opensearch-py/blob/main/utils/generate-api.py +# or the "OpenSearch API specification" available at: +# https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json +# ----------------------------------------------------- + from __future__ import unicode_literals import logging @@ -333,8 +342,8 @@ class AsyncOpenSearch(object): self, id: Any, *, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -490,8 +499,8 @@ class AsyncOpenSearch(object): self, id: Any, *, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -642,8 +651,8 @@ class AsyncOpenSearch(object): *, body: Any, context: Optional[Any] = ..., - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -802,7 +811,6 @@ class AsyncOpenSearch(object): ignore_unavailable: Optional[Any] = ..., lenient: Optional[Any] = ..., max_concurrent_shard_requests: Optional[Any] = ..., - min_compatible_shard_node: Optional[Any] = ..., pre_filter_shard_size: Optional[Any] = ..., preference: Optional[Any] = ..., q: Optional[Any] = ..., @@ -991,7 +999,6 @@ class AsyncOpenSearch(object): terminate_after: Optional[Any] = ..., timeout: Optional[Any] = ..., version: Optional[Any] = ..., - version_type: Optional[Any] = ..., wait_for_active_shards: Optional[Any] = ..., wait_for_completion: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -1128,21 +1135,3 @@ class AsyncOpenSearch(object): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... - async def terms_enum( - self, - index: Any, - *, - body: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... diff --git a/opensearchpy/_async/client/cat.py b/opensearchpy/_async/client/cat.py index a4dd9786..d2864097 100644 --- a/opensearchpy/_async/client/cat.py +++ b/opensearchpy/_async/client/cat.py @@ -48,17 +48,17 @@ class CatClient(NamespacedClient): :arg name: Comma-separated list of alias names. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: all, - open, closed, hidden, none + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", _make_path("_cat", "aliases", name), params=params, headers=headers @@ -83,22 +83,22 @@ class CatClient(NamespacedClient): :arg node_id: Comma-separated list of node IDs or names to limit the returned information. - :arg bytes: The unit in which to display byte values. Valid - choices: b, k, kb, m, mb, g, gb, t, tb, p, pb + :arg bytes: The unit in which to display byte values. Valid + choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", @@ -119,10 +119,10 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", _make_path("_cat", "count", index), params=params, headers=headers @@ -137,13 +137,13 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices: d, h, m, s, ms, micros, nanos - :arg ts: Set to false to disable timestamping. (default: True) - :arg v: Verbose mode. Display column headers. (default: false) + :arg time: The unit in which to display time values. Valid + choices are d, h, m, s, ms, micros, nanos. + :arg ts: Set to false to disable timestamping. Default is True. + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", "/_cat/health", params=params, headers=headers @@ -155,7 +155,7 @@ class CatClient(NamespacedClient): Returns help for the Cat APIs. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg s: Comma-separated list of column names or column aliases to sort by. """ @@ -187,35 +187,35 @@ class CatClient(NamespacedClient): :arg index: Comma-separated list of indices to limit the returned information. - :arg bytes: The unit in which to display byte values. Valid - choices: b, k, kb, m, mb, g, gb, t, tb, p, pb + :arg bytes: The unit in which to display byte values. Valid + choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: all, - open, closed, hidden, none + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg health: Health status ('green', 'yellow', or 'red') to - filter only indices matching the specified health status. Valid - choices: green, yellow, red - :arg help: Return help information. (default: false) + filter only indices matching the specified health status. Valid choices + are green, yellow, red. + :arg help: Return help information. Default is false. :arg include_unloaded_segments: If set to true segment stats will include stats for segments that are not currently loaded into - memory. (default: false) + memory. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg pri: Set to true to return stats only for primary shards. - (default: false) + Default is false. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices: d, h, m, s, ms, micros, nanos - :arg v: Verbose mode. Display column headers. (default: false) + :arg time: The unit in which to display time values. Valid + choices are d, h, m, s, ms, micros, nanos. + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", _make_path("_cat", "indices", index), params=params, headers=headers @@ -241,15 +241,15 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ from warnings import warn @@ -280,15 +280,15 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", "/_cat/cluster_manager", params=params, headers=headers @@ -312,27 +312,27 @@ class CatClient(NamespacedClient): Returns basic statistics about performance of cluster nodes. - :arg bytes: The unit in which to display byte values. Valid - choices: b, k, kb, m, mb, g, gb, t, tb, p, pb + :arg bytes: The unit in which to display byte values. Valid + choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg format: A short version of the Accept header, e.g. json, yaml. :arg full_id: Return the full node ID instead of the shortened - version. (default: false) + version. Default is false. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local (Deprecated: This parameter does not cause this API - to act locally): Return local information, do not retrieve the state - from cluster-manager node. (default: false) + to act locally.): Return local information, do not retrieve the state + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices: d, h, m, s, ms, micros, nanos - :arg v: Verbose mode. Display column headers. (default: false) + :arg time: The unit in which to display time values. Valid + choices are d, h, m, s, ms, micros, nanos. + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", "/_cat/nodes", params=params, headers=headers @@ -349,20 +349,20 @@ class CatClient(NamespacedClient): :arg index: Comma-separated list or wildcard expression of index names to limit the returned information. :arg active_only: If `true`, the response only includes ongoing - shard recoveries. (default: false) - :arg bytes: The unit in which to display byte values. Valid - choices: b, k, kb, m, mb, g, gb, t, tb, p, pb + shard recoveries. Default is false. + :arg bytes: The unit in which to display byte values. Valid + choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg detailed: If `true`, the response includes detailed - information about shard recoveries. (default: false) + information about shard recoveries. Default is false. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices: d, h, m, s, ms, micros, nanos - :arg v: Verbose mode. Display column headers. (default: false) + :arg time: The unit in which to display time values. Valid + choices are d, h, m, s, ms, micros, nanos. + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", _make_path("_cat", "recovery", index), params=params, headers=headers @@ -387,24 +387,24 @@ class CatClient(NamespacedClient): :arg index: Comma-separated list of indices to limit the returned information. - :arg bytes: The unit in which to display byte values. Valid - choices: b, k, kb, m, mb, g, gb, t, tb, p, pb + :arg bytes: The unit in which to display byte values. Valid + choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices: d, h, m, s, ms, micros, nanos - :arg v: Verbose mode. Display column headers. (default: false) + :arg time: The unit in which to display time values. Valid + choices are d, h, m, s, ms, micros, nanos. + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", _make_path("_cat", "shards", index), params=params, headers=headers @@ -427,20 +427,20 @@ class CatClient(NamespacedClient): :arg index: Comma-separated list of indices to limit the returned information. - :arg bytes: The unit in which to display byte values. Valid - choices: b, k, kb, m, mb, g, gb, t, tb, p, pb + :arg bytes: The unit in which to display byte values. Valid + choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", _make_path("_cat", "segments", index), params=params, headers=headers @@ -467,17 +467,17 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices: d, h, m, s, ms, micros, nanos - :arg v: Verbose mode. Display column headers. (default: false) + :arg time: The unit in which to display time values. Valid + choices are d, h, m, s, ms, micros, nanos. + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", "/_cat/pending_tasks", params=params, headers=headers @@ -507,16 +507,16 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. :arg size: The multiplier in which to display values. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", @@ -534,15 +534,15 @@ class CatClient(NamespacedClient): :arg fields: Comma-separated list of fields to return in the output. - :arg bytes: The unit in which to display byte values. Valid - choices: b, k, kb, m, mb, g, gb, t, tb, p, pb + :arg bytes: The unit in which to display byte values. Valid + choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", @@ -571,15 +571,15 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", "/_cat/plugins", params=params, headers=headers @@ -605,15 +605,15 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", "/_cat/nodeattrs", params=params, headers=headers @@ -639,15 +639,15 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", "/_cat/repositories", params=params, headers=headers @@ -675,17 +675,18 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). (default: false) + should be ignored when unavailable (missing or closed). Default is + false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices: d, h, m, s, ms, micros, nanos - :arg v: Verbose mode. Display column headers. (default: false) + :arg time: The unit in which to display time values. Valid + choices are d, h, m, s, ms, micros, nanos. + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", @@ -714,12 +715,12 @@ class CatClient(NamespacedClient): :arg actions: Comma-separated list of actions that should be returned. Leave empty to return all. - :arg detailed: Return detailed task information. (default: - false) + :arg detailed: Return detailed task information. Default is + false. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :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 @@ -728,9 +729,9 @@ class CatClient(NamespacedClient): (node_id:task_number). Set to -1 to return all. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices: d, h, m, s, ms, micros, nanos - :arg v: Verbose mode. Display column headers. (default: false) + :arg time: The unit in which to display time values. Valid + choices are d, h, m, s, ms, micros, nanos. + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", "/_cat/tasks", params=params, headers=headers @@ -757,15 +758,15 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", _make_path("_cat", "templates", name), params=params, headers=headers @@ -787,7 +788,6 @@ class CatClient(NamespacedClient): List segments for one or several PITs. - :arg body: """ return await self.transport.perform_request( "GET", "/_cat/pit_segments", params=params, headers=headers, body=body @@ -815,23 +815,23 @@ class CatClient(NamespacedClient): :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: false) - :arg bytes: The unit in which to display byte values. Valid - choices: b, k, kb, m, mb, g, gb, t, tb, p, pb + segment replication events. Default is false. + :arg bytes: The unit in which to display byte values. Valid + choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg completed_only: If `true`, the response only includes - latest completed segment replication events. (default: false) + latest completed segment replication events. Default is false. :arg detailed: If `true`, the response includes detailed - information about segment replications. (default: false) + information about segment replications. Default is false. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg s: Comma-separated list of column names or column aliases to sort by. :arg shards: Comma-separated list of shards to display. - :arg time: The unit in which to display time values. Valid - choices: d, h, m, s, ms, micros, nanos - :arg v: Verbose mode. Display column headers. (default: false) + :arg time: The unit in which to display time values. Valid + choices are d, h, m, s, ms, micros, nanos. + :arg v: Verbose mode. Display column headers. Default is false. """ return await self.transport.perform_request( "GET", diff --git a/opensearchpy/_async/client/cluster.py b/opensearchpy/_async/client/cluster.py index b64bdc5b..7c9c5f46 100644 --- a/opensearchpy/_async/client/cluster.py +++ b/opensearchpy/_async/client/cluster.py @@ -65,22 +65,22 @@ class ClusterClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: all, - open, closed, hidden, none + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg level: Specify the level of detail for returned - information. Valid choices: cluster, indices, shards, - awareness_attributes + information. Valid choices are cluster, indices, shards, + awareness_attributes. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg timeout: Operation timeout. :arg wait_for_active_shards: Wait until the specified number of shards is active. :arg wait_for_events: Wait until all currently queued events - with the given priority are processed. Valid choices: immediate, - urgent, high, normal, low, languid + with the given priority are processed. Valid choices are immediate, + urgent, high, normal, low, languid. :arg wait_for_no_initializing_shards: Whether to wait until there are no initializing shards in the cluster. :arg wait_for_no_relocating_shards: Whether to wait until there @@ -88,7 +88,7 @@ class ClusterClient(NamespacedClient): :arg wait_for_nodes: Wait until the specified number of nodes is available. :arg wait_for_status: Wait until cluster is in a specific state. - Valid choices: green, yellow, red + Valid choices are green, yellow, red. """ return await self.transport.perform_request( "GET", @@ -107,10 +107,10 @@ class ClusterClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return await self.transport.perform_request( "GET", "/_cluster/pending_tasks", params=params, headers=headers @@ -133,8 +133,8 @@ class ClusterClient(NamespacedClient): :arg metric: Limit the information returned to the specified - metrics. Valid choices: _all, blocks, metadata, nodes, routing_table, - routing_nodes, master_node, cluster_manager_node, version + metrics. Valid choices are _all, blocks, metadata, nodes, routing_table, + routing_nodes, master_node, cluster_manager_node, version. :arg index: Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices @@ -143,17 +143,17 @@ class ClusterClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: all, - open, closed, hidden, none - :arg flat_settings: Return settings in flat format. (default: - false) + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg flat_settings: Return settings in flat format. Default is + false. :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed). :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg wait_for_metadata_version: Wait for the metadata version to be equal or greater than the specified metadata version. :arg wait_for_timeout: The maximum time to wait for @@ -179,8 +179,8 @@ class ClusterClient(NamespacedClient): the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. - :arg flat_settings: Return settings in flat format. (default: - false) + :arg flat_settings: Return settings in flat format. Default is + false. :arg timeout: Operation timeout. """ return await self.transport.perform_request( @@ -215,8 +215,8 @@ class ClusterClient(NamespacedClient): :arg explain: Return an explanation of why the commands can or cannot be executed. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg metric: Limit the information returned to the specified metrics. Defaults to all but metadata. :arg retry_failed: Retries allocation of shards that are blocked @@ -241,13 +241,13 @@ class ClusterClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. (default: - false) + :arg flat_settings: Return settings in flat format. Default is + false. :arg include_defaults: Whether to return all default clusters - setting. (default: false) + setting. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg timeout: Operation timeout. """ return await self.transport.perform_request( @@ -266,11 +266,11 @@ class ClusterClient(NamespacedClient): or `persistent` (survives cluster restart). :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. (default: - false) + :arg flat_settings: Return settings in flat format. Default is + false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg timeout: Operation timeout. """ if body in SKIP_IN_PATH: @@ -299,9 +299,9 @@ class ClusterClient(NamespacedClient): :arg body: The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard' :arg include_disk_info: Return information about disk usage and - shard sizes. (default: false) + shard sizes. Default is false. :arg include_yes_decisions: Return 'YES' decisions in - explanation. (default: false) + explanation. Default is false. """ return await self.transport.perform_request( "POST", @@ -321,8 +321,8 @@ class ClusterClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg timeout: Operation timeout. """ if name in SKIP_IN_PATH: @@ -345,10 +345,10 @@ class ClusterClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return await self.transport.perform_request( "GET", @@ -368,10 +368,10 @@ class ClusterClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg create: Whether the index template should only be added if - new or can also replace an existing one. (default: false) + new or can also replace an existing one. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg timeout: Operation timeout. """ for param in (name, body): @@ -386,18 +386,20 @@ class ClusterClient(NamespacedClient): body=body, ) - @query_params("local", "master_timeout") + @query_params("cluster_manager_timeout", "local", "master_timeout") async def exists_component_template(self, name, params=None, headers=None): """ Returns information about whether a particular component template exist. :arg name: The name of the template. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -417,7 +419,7 @@ class ClusterClient(NamespacedClient): :arg wait_for_removal: Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting - configuration exclusions list. (default: True) + configuration exclusions list. Default is True. """ return await self.transport.perform_request( "DELETE", diff --git a/opensearchpy/_async/client/cluster.pyi b/opensearchpy/_async/client/cluster.pyi index 2685cbb5..b75ec46c 100644 --- a/opensearchpy/_async/client/cluster.pyi +++ b/opensearchpy/_async/client/cluster.pyi @@ -300,6 +300,7 @@ class ClusterClient(NamespacedClient): self, name: Any, *, + cluster_manager_timeout: Optional[Any] = ..., local: Optional[Any] = ..., master_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., diff --git a/opensearchpy/_async/client/dangling_indices.py b/opensearchpy/_async/client/dangling_indices.py index cf382c52..b284ac27 100644 --- a/opensearchpy/_async/client/dangling_indices.py +++ b/opensearchpy/_async/client/dangling_indices.py @@ -53,8 +53,8 @@ class DanglingIndicesClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg timeout: Operation timeout. """ if index_uuid in SKIP_IN_PATH: @@ -81,8 +81,8 @@ class DanglingIndicesClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg timeout: Operation timeout. """ if index_uuid in SKIP_IN_PATH: diff --git a/opensearchpy/_async/client/indices.py b/opensearchpy/_async/client/indices.py index d58a3fb5..cfc48db4 100644 --- a/opensearchpy/_async/client/indices.py +++ b/opensearchpy/_async/client/indices.py @@ -25,6 +25,16 @@ # under the License. +# ---------------------------------------------------- +# THIS CODE IS GENERATED AND MANUAL EDITS WILL BE LOST. +# +# To contribute, kindly make essential modifications through either the "opensearch-py client generator": +# https://github.com/opensearch-project/opensearch-py/blob/main/utils/generate-api.py +# or the "OpenSearch API specification" available at: +# https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json +# ----------------------------------------------------- + + from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params @@ -38,7 +48,7 @@ class IndicesClient(NamespacedClient): :arg body: Define analyzer/tokenizer parameters and the text on which the analysis should be performed - :arg index: The name of the index to scope the operation + :arg index: The name of the index to scope the operation. """ return await self.transport.perform_request( "POST", @@ -54,16 +64,16 @@ class IndicesClient(NamespacedClient): Performs the refresh operation in one or more indices. - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). """ return await self.transport.perform_request( "POST", _make_path(index, "_refresh"), params=params, headers=headers @@ -81,44 +91,47 @@ class IndicesClient(NamespacedClient): Performs the flush operation on one or more indices. - :arg index: A comma-separated list of index names; use `_all` or - empty string for all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg force: Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as - internal) + internal). :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg wait_if_ongoing: If set to true the flush operation will block until the flush can be executed if another flush operation is - already executing. The default is true. If set to false the flush will - be skipped iff if another flush operation is already running. + already executing. If set to false the flush will be skipped iff if + another flush operation is already running. Default is True. """ return await self.transport.perform_request( "POST", _make_path(index, "_flush"), params=params, headers=headers ) @query_params( - "master_timeout", "cluster_manager_timeout", "timeout", "wait_for_active_shards" + "cluster_manager_timeout", "master_timeout", "timeout", "wait_for_active_shards" ) async def create(self, index, body=None, params=None, headers=None): """ Creates an index with optional settings and mappings. - :arg index: The name of the index + :arg index: Index name. :arg body: The configuration for the index (`settings` and `mappings`) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. :arg wait_for_active_shards: Set the number of active shards to wait for before the operation returns. """ @@ -130,20 +143,23 @@ class IndicesClient(NamespacedClient): ) @query_params( - "master_timeout", "cluster_manager_timeout", "timeout", "wait_for_active_shards" + "cluster_manager_timeout", "master_timeout", "timeout", "wait_for_active_shards" ) async def clone(self, index, target, body=None, params=None, headers=None): """ - Clones an index + Clones an index. - :arg index: The name of the source index to clone - :arg target: The name of the target index to clone into + :arg index: The name of the source index to clone. + :arg target: The name of the target index. :arg body: The configuration for the target index (`settings` and `aliases`) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. :arg wait_for_active_shards: Set the number of active shards to wait for on the cloned index before the operation returns. """ @@ -161,35 +177,40 @@ class IndicesClient(NamespacedClient): @query_params( "allow_no_indices", + "cluster_manager_timeout", "expand_wildcards", "flat_settings", "ignore_unavailable", "include_defaults", "local", "master_timeout", - "cluster_manager_timeout", ) async def get(self, index, params=None, headers=None): """ Returns information about one or more indices. - :arg index: A comma-separated list of index names - :arg allow_no_indices: Ignore if a wildcard expression resolves - to no concrete indices (default: false) - :arg expand_wildcards: Whether wildcard expressions should get - expanded to open or closed indices (default: open) Valid choices: open, - closed, hidden, none, all Default: open - :arg flat_settings: Return settings in flat format (default: - false) - :arg ignore_unavailable: Ignore unavailable indexes (default: - false) + :arg index: Comma-separated list of indices. + :arg allow_no_indices: Whether to ignore if a wildcard indices + expression resolves into no concrete indices. (This includes `_all` + string or when no indices have been specified). Default is false. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg expand_wildcards: Whether to expand wildcard expression to + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg flat_settings: Return settings in flat format. Default is + false. + :arg ignore_unavailable: Whether specified concrete indices + should be ignored when unavailable (missing or closed). Default is + false. :arg include_defaults: Whether to return all default setting for - each of the indices. + each of the indices. Default is false. :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + from cluster-manager node. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -200,10 +221,10 @@ class IndicesClient(NamespacedClient): @query_params( "allow_no_indices", + "cluster_manager_timeout", "expand_wildcards", "ignore_unavailable", "master_timeout", - "cluster_manager_timeout", "timeout", "wait_for_active_shards", ) @@ -212,18 +233,21 @@ class IndicesClient(NamespacedClient): Opens an index. - :arg index: A comma separated list of indices to open + :arg index: Comma-separated list of indices to open. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: closed + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + should be ignored when unavailable (missing or closed). + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. :arg wait_for_active_shards: Sets the number of active shards to wait for before the operation returns. """ @@ -236,10 +260,10 @@ class IndicesClient(NamespacedClient): @query_params( "allow_no_indices", + "cluster_manager_timeout", "expand_wildcards", "ignore_unavailable", "master_timeout", - "cluster_manager_timeout", "timeout", "wait_for_active_shards", ) @@ -248,22 +272,23 @@ class IndicesClient(NamespacedClient): Closes an index. - :arg index: A comma separated list of indices to close + :arg index: Comma-separated list of indices to close. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + should be ignored when unavailable (missing or closed). + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. :arg wait_for_active_shards: Sets the number of active shards to - wait for before the operation returns. Set to `index-setting` to wait - according to the index setting `index.write.wait_for_active_shards`, or - `all` to wait for all shards, or an integer. Defaults to `0`. + wait for before the operation returns. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -274,10 +299,10 @@ class IndicesClient(NamespacedClient): @query_params( "allow_no_indices", + "cluster_manager_timeout", "expand_wildcards", "ignore_unavailable", "master_timeout", - "cluster_manager_timeout", "timeout", ) async def delete(self, index, params=None, headers=None): @@ -285,18 +310,23 @@ class IndicesClient(NamespacedClient): Deletes an index. - :arg index: A comma-separated list of indices to delete; use - `_all` or `*` string to delete all indices - :arg allow_no_indices: Ignore if a wildcard expression resolves - to no concrete indices (default: false) - :arg expand_wildcards: Whether wildcard expressions should get - expanded to open or closed indices (default: open) Valid choices: open, - closed, hidden, none, all Default: open - :arg ignore_unavailable: Ignore unavailable indexes (default: - false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + :arg index: Comma-separated list of indices to delete; use + `_all` or `*` string to delete all indices. + :arg allow_no_indices: Whether to ignore if a wildcard indices + expression resolves into no concrete indices. (This includes `_all` + string or when no indices have been specified). Default is false. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg expand_wildcards: Whether to expand wildcard expression to + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg ignore_unavailable: Whether specified concrete indices + should be ignored when unavailable (missing or closed). Default is + false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -318,20 +348,22 @@ class IndicesClient(NamespacedClient): Returns information about whether a particular index exists. - :arg index: A comma-separated list of index names - :arg allow_no_indices: Ignore if a wildcard expression resolves - to no concrete indices (default: false) - :arg expand_wildcards: Whether wildcard expressions should get - expanded to open or closed indices (default: open) Valid choices: open, - closed, hidden, none, all Default: open - :arg flat_settings: Return settings in flat format (default: - false) - :arg ignore_unavailable: Ignore unavailable indexes (default: - false) + :arg index: Comma-separated list of indices. + :arg allow_no_indices: Whether to ignore if a wildcard indices + expression resolves into no concrete indices. (This includes `_all` + string or when no indices have been specified). Default is false. + :arg expand_wildcards: Whether to expand wildcard expression to + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg flat_settings: Return settings in flat format. Default is + false. + :arg ignore_unavailable: Whether specified concrete indices + should be ignored when unavailable (missing or closed). Default is + false. :arg include_defaults: Whether to return all default setting for - each of the indices. + each of the indices. Default is false. :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) + from cluster-manager node. Default is false. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -342,10 +374,10 @@ class IndicesClient(NamespacedClient): @query_params( "allow_no_indices", + "cluster_manager_timeout", "expand_wildcards", "ignore_unavailable", "master_timeout", - "cluster_manager_timeout", "timeout", "write_index_only", ) @@ -355,26 +387,31 @@ class IndicesClient(NamespacedClient): :arg body: The mapping definition - :arg index: A comma-separated list of index names the mapping - should be added to (supports wildcards); use `_all` or omit to add the - mapping on all indices. + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + should be ignored when unavailable (missing or closed). + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. :arg write_index_only: When true, applies mappings only to the - write index of an alias or data stream + write index of an alias or data stream. Default is false. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") + if index in SKIP_IN_PATH: + index = "_all" + return await self.transport.perform_request( "PUT", _make_path(index, "_mapping"), @@ -385,36 +422,37 @@ class IndicesClient(NamespacedClient): @query_params( "allow_no_indices", + "cluster_manager_timeout", "expand_wildcards", "ignore_unavailable", "local", "master_timeout", - "cluster_manager_timeout", ) async def get_mapping(self, index=None, params=None, headers=None): """ Returns mappings for one or more indices. - :arg index: A comma-separated list of index names + :arg index: Comma-separated list of indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + should be ignored when unavailable (missing or closed). + :arg local (Deprecated: This parameter is a no-op and field + mappings are always retrieved locally.): Return local information, do + not retrieve the state from cluster-manager node. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return await self.transport.perform_request( - "GET", - _make_path(index, "_mapping"), - params=params, - headers=headers, + "GET", _make_path(index, "_mapping"), params=params, headers=headers ) @query_params( @@ -429,20 +467,20 @@ class IndicesClient(NamespacedClient): Returns mapping for one or more fields. - :arg fields: A comma-separated list of fields - :arg index: A comma-separated list of index names + :arg fields: Comma-separated list of fields. + :arg index: Comma-separated list of indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg include_defaults: Whether the default mapping values should - be returned as well + be returned as well. :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) + from cluster-manager node. Default is false. """ if fields in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'fields'.") @@ -454,21 +492,23 @@ class IndicesClient(NamespacedClient): headers=headers, ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") async def put_alias(self, index, name, body=None, params=None, headers=None): """ Creates or updates an alias. - :arg index: A comma-separated list of index names the alias - should point to (supports wildcards); use `_all` to perform the - operation on all indices. - :arg name: The name of the alias to be created or updated + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. + :arg name: The name of the alias to be created or updated. :arg body: The settings for the alias, such as `routing` or `filter` - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit timestamp for the document + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ for param in (index, name): if param in SKIP_IN_PATH: @@ -488,19 +528,18 @@ class IndicesClient(NamespacedClient): Returns information about whether a particular alias exists. - :arg name: A comma-separated list of alias names to return - :arg index: A comma-separated list of index names to filter - aliases + :arg name: Comma-separated list of alias names. + :arg index: Comma-separated list of indices to filter aliases. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: all + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) + from cluster-manager node. Default is false. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -515,34 +554,36 @@ class IndicesClient(NamespacedClient): Returns an alias. - :arg index: A comma-separated list of index names to filter - aliases - :arg name: A comma-separated list of alias names to return + :arg index: Comma-separated list of indices to filter aliases. + :arg name: Comma-separated list of alias names. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: all + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) + from cluster-manager node. Default is false. """ return await self.transport.perform_request( "GET", _make_path(index, "_alias", name), params=params, headers=headers ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") async def update_aliases(self, body, params=None, headers=None): """ Updates index aliases. :arg body: The definition of `actions` to perform - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Request timeout + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -551,19 +592,22 @@ class IndicesClient(NamespacedClient): "POST", "/_aliases", params=params, headers=headers, body=body ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") async def delete_alias(self, index, name, params=None, headers=None): """ Deletes an alias. - :arg index: A comma-separated list of index names (supports - wildcards); use `_all` for all indices - :arg name: A comma-separated list of aliases to delete (supports + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. + :arg name: Comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit timestamp for the document + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ for param in (index, name): if param in SKIP_IN_PATH: @@ -573,21 +617,24 @@ class IndicesClient(NamespacedClient): "DELETE", _make_path(index, "_alias", name), params=params, headers=headers ) - @query_params("create", "master_timeout", "cluster_manager_timeout", "order") + @query_params("cluster_manager_timeout", "create", "master_timeout", "order") async def put_template(self, name, body, params=None, headers=None): """ Creates or updates an index template. - :arg name: The name of the template + :arg name: The name of the template. :arg body: The template definition + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg create: Whether the index template should only be added if - new or can also replace an existing one - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + new or can also replace an existing one. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg order: The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower - numbers) + numbers). """ for param in (name, body): if param in SKIP_IN_PATH: @@ -601,21 +648,22 @@ class IndicesClient(NamespacedClient): body=body, ) - @query_params("flat_settings", "local", "master_timeout", "cluster_manager_timeout") + @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") async def exists_template(self, name, params=None, headers=None): """ Returns information about whether a particular index template exists. - :arg name: The comma separated names of the index templates - :arg flat_settings: Return settings in flat format (default: - false) + :arg name: Comma-separated names of the index templates. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg flat_settings: Return settings in flat format. Default is + false. :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + from cluster-manager node. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -624,36 +672,40 @@ class IndicesClient(NamespacedClient): "HEAD", _make_path("_template", name), params=params, headers=headers ) - @query_params("flat_settings", "local", "master_timeout", "cluster_manager_timeout") + @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") async def get_template(self, name=None, params=None, headers=None): """ Returns an index template. - :arg name: The comma separated names of the index templates - :arg flat_settings: Return settings in flat format (default: - false) + :arg name: Comma-separated names of the index templates. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg flat_settings: Return settings in flat format. Default is + false. :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + from cluster-manager node. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return await self.transport.perform_request( "GET", _make_path("_template", name), params=params, headers=headers ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") async def delete_template(self, name, params=None, headers=None): """ Deletes an index template. - :arg name: The name of the template - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + :arg name: The name of the template. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -664,38 +716,41 @@ class IndicesClient(NamespacedClient): @query_params( "allow_no_indices", + "cluster_manager_timeout", "expand_wildcards", "flat_settings", "ignore_unavailable", "include_defaults", "local", "master_timeout", - "cluster_manager_timeout", ) async def get_settings(self, index=None, name=None, params=None, headers=None): """ Returns settings for one or more indices. - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices - :arg name: The name of the settings that should be included + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. + :arg name: Comma-separated list of settings. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: all - :arg flat_settings: Return settings in flat format (default: - false) + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg flat_settings: Return settings in flat format. Default is + false. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg include_defaults: Whether to return all default setting for - each of the indices. + each of the indices. Default is false. :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + from cluster-manager node. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return await self.transport.perform_request( "GET", _make_path(index, "_settings", name), params=params, headers=headers @@ -703,11 +758,11 @@ class IndicesClient(NamespacedClient): @query_params( "allow_no_indices", + "cluster_manager_timeout", "expand_wildcards", "flat_settings", "ignore_unavailable", "master_timeout", - "cluster_manager_timeout", "preserve_existing", "timeout", ) @@ -717,24 +772,27 @@ class IndicesClient(NamespacedClient): :arg body: The index settings to be updated - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg flat_settings: Return settings in flat format (default: - false) + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg flat_settings: Return settings in flat format. Default is + false. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + should be ignored when unavailable (missing or closed). + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg preserve_existing: Whether to update existing settings. If - set to `true` existing settings on an index remain unchanged, the - default is `false` - :arg timeout: Explicit operation timeout + set to `true` existing settings on an index remain unchanged. Default is + false. + :arg timeout: Operation timeout. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -757,43 +815,40 @@ class IndicesClient(NamespacedClient): "include_segment_file_sizes", "include_unloaded_segments", "level", - "types", ) async def stats(self, index=None, metric=None, params=None, headers=None): """ Provides statistics on operations happening in an index. - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg metric: Limit the information returned the specific - metrics. Valid choices: _all, completion, docs, fielddata, query_cache, - flush, get, indexing, merge, request_cache, refresh, search, segments, - store, warmer, suggest - :arg completion_fields: A comma-separated list of fields for - `fielddata` and `suggest` index metric (supports wildcards) + metrics. Valid choices are _all, store, indexing, get, search, merge, + flush, refresh, query_cache, fielddata, docs, warmer, completion, + segments, translog, suggest, request_cache, recovery. + :arg completion_fields: Comma-separated list of fields for + `fielddata` and `suggest` index metric (supports wildcards). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg fielddata_fields: A comma-separated list of fields for - `fielddata` index metric (supports wildcards) - :arg fields: A comma-separated list of fields for `fielddata` - and `completion` index metric (supports wildcards) + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg fielddata_fields: Comma-separated list of fields for + `fielddata` index metric (supports wildcards). + :arg fields: Comma-separated list of fields for `fielddata` and + `completion` index metric (supports wildcards). :arg forbid_closed_indices: If set to false stats will also collected from closed indices if explicitly specified or if - expand_wildcards expands to closed indices Default: True - :arg groups: A comma-separated list of search groups for - `search` index metric + expand_wildcards expands to closed indices. Default is True. + :arg groups: Comma-separated list of search groups for `search` + index metric. :arg include_segment_file_sizes: Whether to report the aggregated disk usage of each one of the Lucene index files (only - applies if segment stats are requested) + applies if segment stats are requested). Default is false. :arg include_unloaded_segments: If set to true segment stats will include stats for segments that are not currently loaded into - memory + memory. Default is false. :arg level: Return stats aggregated at cluster, index or shard - level Valid choices: cluster, indices, shards Default: indices - :arg types: A comma-separated list of document types for the - `indexing` index metric + level. Valid choices are cluster, indices, shards. """ return await self.transport.perform_request( "GET", _make_path(index, "_stats", metric), params=params, headers=headers @@ -807,17 +862,18 @@ class IndicesClient(NamespacedClient): Provides low-level information about segments in a Lucene index. - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg verbose: Includes detailed memory usage by Lucene. + should be ignored when unavailable (missing or closed). + :arg verbose: Includes detailed memory usage by Lucene. Default + is false. """ return await self.transport.perform_request( "GET", _make_path(index, "_segments"), params=params, headers=headers @@ -843,30 +899,29 @@ class IndicesClient(NamespacedClient): :arg body: The query definition specified with the Query DSL - :arg index: A comma-separated list of index names to restrict - the operation; use `_all` or empty string to perform the operation on - all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg all_shards: Execute validation on all shards instead of one - random shard per index + random shard per index. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed (default: false) - :arg analyzer: The analyzer to use for the query string + queries should be analyzed. Default is false. + :arg analyzer: The analyzer to use for the query string. :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR). Valid choices are AND, OR. :arg df: The field to use as default where no field prefix is - given in the query string + given in the query string. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg explain: Return detailed information about the error + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg explain: Return detailed information about the error. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored - :arg q: Query in the Lucene query string syntax + as providing text to a numeric field) should be ignored. + :arg q: Query in the Lucene query string syntax. :arg rewrite: Provide a more detailed explanation showing the actual Lucene query that will be executed. """ @@ -892,21 +947,21 @@ class IndicesClient(NamespacedClient): Clears all or specific caches for one or more indices. - :arg index: A comma-separated list of index name to limit the - operation + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg fielddata: Clear field data - :arg fields: A comma-separated list of fields to clear when - using the `fielddata` parameter (default: all) + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg fielddata: Clear field data. + :arg fields: Comma-separated list of fields to clear when using + the `fielddata` parameter (default: all). :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg query: Clear query caches - :arg request: Clear request cache + should be ignored when unavailable (missing or closed). + :arg query: Clear query caches. + :arg request: Clear request cache. """ return await self.transport.perform_request( "POST", _make_path(index, "_cache", "clear"), params=params, headers=headers @@ -918,12 +973,12 @@ class IndicesClient(NamespacedClient): Returns information about ongoing index shard recoveries. - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg active_only: Display only those recoveries that are - currently on-going + currently on-going. Default is false. :arg detailed: Whether to display detailed information about - shard recovery + shard recovery. Default is false. """ return await self.transport.perform_request( "GET", _make_path(index, "_recovery"), params=params, headers=headers @@ -938,23 +993,23 @@ class IndicesClient(NamespacedClient): ) async def upgrade(self, index=None, params=None, headers=None): """ - DEPRECATED Upgrades to the current version of Lucene. + The _upgrade API is no longer useful and will be removed. - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg only_ancient_segments: If true, only ancient (an older - Lucene major release) segments will be upgraded - :arg wait_for_completion: Specify whether the request should - block until the all segments are upgraded (default: false) + Lucene major release) segments will be upgraded. + :arg wait_for_completion: Should this request wait until the + operation has completed before returning. Default is false. """ return await self.transport.perform_request( "POST", _make_path(index, "_upgrade"), params=params, headers=headers @@ -963,19 +1018,19 @@ class IndicesClient(NamespacedClient): @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") async def get_upgrade(self, index=None, params=None, headers=None): """ - DEPRECATED Returns a progress status of current upgrade. + The _upgrade API is no longer useful and will be removed. - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). """ return await self.transport.perform_request( "GET", _make_path(index, "_upgrade"), params=params, headers=headers @@ -989,19 +1044,18 @@ class IndicesClient(NamespacedClient): Provides store information for shard copies of indices. - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg status: A comma-separated list of statuses used to filter - on shards to get store information for Valid choices: green, yellow, - red, all + should be ignored when unavailable (missing or closed). + :arg status: Comma-separated list of statuses used to filter on + shards to get store information for. """ return await self.transport.perform_request( "GET", _make_path(index, "_shard_stores"), params=params, headers=headers @@ -1020,31 +1074,31 @@ class IndicesClient(NamespacedClient): Performs the force merge operation on one or more indices. - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg flush: Specify whether the index should be flushed after - performing the operation (default: true) + performing the operation. Default is True. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg max_num_segments: The number of segments the index should - be merged into (default: dynamic) + be merged into (default: dynamic). :arg only_expunge_deletes: Specify whether the operation should - only expunge deleted documents + only expunge deleted documents. """ return await self.transport.perform_request( "POST", _make_path(index, "_forcemerge"), params=params, headers=headers ) @query_params( + "cluster_manager_timeout", "copy_settings", "master_timeout", - "cluster_manager_timeout", "timeout", "wait_for_active_shards", ) @@ -1053,15 +1107,18 @@ class IndicesClient(NamespacedClient): Allow to shrink an existing index into a new index with fewer primary shards. - :arg index: The name of the source index to shrink - :arg target: The name of the target index to shrink into + :arg index: The name of the source index to shrink. + :arg target: The name of the target index. :arg body: The configuration for the target index (`settings` and `aliases`) + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg copy_settings: whether or not to copy settings from the - source index (defaults to false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + source index. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. :arg wait_for_active_shards: Set the number of active shards to wait for on the shrunken index before the operation returns. """ @@ -1078,9 +1135,9 @@ class IndicesClient(NamespacedClient): ) @query_params( + "cluster_manager_timeout", "copy_settings", "master_timeout", - "cluster_manager_timeout", "timeout", "wait_for_active_shards", ) @@ -1090,15 +1147,18 @@ class IndicesClient(NamespacedClient): shards. - :arg index: The name of the source index to split - :arg target: The name of the target index to split into + :arg index: The name of the source index to split. + :arg target: The name of the target index. :arg body: The configuration for the target index (`settings` and `aliases`) + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg copy_settings: whether or not to copy settings from the - source index (defaults to false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + source index. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. :arg wait_for_active_shards: Set the number of active shards to wait for on the shrunken index before the operation returns. """ @@ -1115,9 +1175,9 @@ class IndicesClient(NamespacedClient): ) @query_params( + "cluster_manager_timeout", "dry_run", "master_timeout", - "cluster_manager_timeout", "timeout", "wait_for_active_shards", ) @@ -1129,16 +1189,19 @@ class IndicesClient(NamespacedClient): to be too large or too old. - :arg alias: The name of the alias to rollover + :arg alias: The name of the alias to rollover. :arg body: The conditions that needs to be met for executing rollover - :arg new_index: The name of the rollover index + :arg new_index: The name of the rollover index. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg dry_run: If set to true the rollover action will only be - validated but not actually performed even if a condition matches. The - default is false - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + validated but not actually performed even if a condition matches. + Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. :arg wait_for_active_shards: Set the number of active shards to wait for on the newly created rollover index before the operation returns. @@ -1154,133 +1217,34 @@ class IndicesClient(NamespacedClient): body=body, ) - @query_params( - "allow_no_indices", - "expand_wildcards", - "ignore_unavailable", - "master_timeout", - "cluster_manager_timeout", - "timeout", - "wait_for_active_shards", - ) - async def freeze(self, index, params=None, headers=None): - """ - Freezes an index. A frozen index has almost no overhead on the cluster (except - for maintaining its metadata in memory) and is read-only. - - - :arg index: The name of the index to freeze - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: closed - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout - :arg wait_for_active_shards: Sets the number of active shards to - wait for before the operation returns. - """ - if index in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'index'.") - - return await self.transport.perform_request( - "POST", _make_path(index, "_freeze"), params=params, headers=headers - ) - - @query_params( - "allow_no_indices", - "expand_wildcards", - "ignore_unavailable", - "master_timeout", - "cluster_manager_timeout", - "timeout", - "wait_for_active_shards", - ) - async def unfreeze(self, index, params=None, headers=None): - """ - Unfreezes an index. When a frozen index is unfrozen, the index goes through the - normal recovery process and becomes writeable again. - - - :arg index: The name of the index to unfreeze - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: closed - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout - :arg wait_for_active_shards: Sets the number of active shards to - wait for before the operation returns. - """ - if index in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'index'.") - - return await self.transport.perform_request( - "POST", _make_path(index, "_unfreeze"), params=params, headers=headers - ) - - @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") - async def reload_search_analyzers(self, index, params=None, headers=None): - """ - Reloads an index's search analyzers and their resources. - - - :arg index: A comma-separated list of index names to reload - analyzers for - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - """ - if index in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'index'.") - - return await self.transport.perform_request( - "GET", - _make_path(index, "_reload_search_analyzers"), - params=params, - headers=headers, - ) - @query_params() - async def create_data_stream(self, name, params=None, headers=None): + async def create_data_stream(self, name, body=None, params=None, headers=None): """ - Creates a data stream + Creates or updates a data stream. - :arg name: The name of the data stream + :arg name: The name of the data stream. + :arg body: The data stream definition """ 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("_data_stream", name), params=params, headers=headers + "PUT", + _make_path("_data_stream", name), + params=params, + headers=headers, + body=body, ) - @query_params("expand_wildcards") + @query_params() async def delete_data_stream(self, name, params=None, headers=None): """ Deletes a data stream. - :arg name: A comma-separated list of data streams to delete; use - `*` to delete all data streams - :arg expand_wildcards: Whether wildcard expressions should get - expanded to open or closed indices (default: open) Valid choices: open, - closed, hidden, none, all Default: open + :arg name: Comma-separated list of data streams; use `_all` or + empty string to perform the operation on all data streams. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1289,16 +1253,19 @@ class IndicesClient(NamespacedClient): "DELETE", _make_path("_data_stream", name), params=params, headers=headers ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") async def delete_index_template(self, name, params=None, headers=None): """ Deletes an index template. - :arg name: The name of the template - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + :arg name: The name of the template. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1310,21 +1277,22 @@ class IndicesClient(NamespacedClient): headers=headers, ) - @query_params("flat_settings", "local", "master_timeout", "cluster_manager_timeout") + @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") async def exists_index_template(self, name, params=None, headers=None): """ Returns information about whether a particular index template exists. - :arg name: The name of the template - :arg flat_settings: Return settings in flat format (default: - false) + :arg name: The name of the template. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg flat_settings: Return settings in flat format. Default is + false. :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + from cluster-manager node. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1333,40 +1301,44 @@ class IndicesClient(NamespacedClient): "HEAD", _make_path("_index_template", name), params=params, headers=headers ) - @query_params("flat_settings", "local", "master_timeout", "cluster_manager_timeout") + @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") async def get_index_template(self, name=None, params=None, headers=None): """ Returns an index template. - :arg name: The comma separated names of the index templates - :arg flat_settings: Return settings in flat format (default: - false) + :arg name: Comma-separated names of the index templates. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg flat_settings: Return settings in flat format. Default is + false. :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + from cluster-manager node. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return await self.transport.perform_request( "GET", _make_path("_index_template", name), params=params, headers=headers ) - @query_params("cause", "create", "master_timeout", "cluster_manager_timeout") + @query_params("cause", "cluster_manager_timeout", "create", "master_timeout") async def put_index_template(self, name, body, params=None, headers=None): """ Creates or updates an index template. - :arg name: The name of the template + :arg name: The name of the template. :arg body: The template definition :arg cause: User defined reason for creating/updating the index - template + template. Default is false. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg create: Whether the index template should only be added if - new or can also replace an existing one - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + new or can also replace an existing one. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ for param in (name, body): if param in SKIP_IN_PATH: @@ -1380,24 +1352,27 @@ class IndicesClient(NamespacedClient): body=body, ) - @query_params("cause", "create", "master_timeout", "cluster_manager_timeout") + @query_params("cause", "cluster_manager_timeout", "create", "master_timeout") async def simulate_index_template(self, name, body=None, params=None, headers=None): """ Simulate matching the given index name against the index templates in the - system + system. :arg name: The name of the index (it must be a concrete index - name) + name). :arg body: New index template definition, which will be included in the simulation, as if it already exists in the system :arg cause: User defined reason for dry-run creating the new - template for simulation purposes + template for simulation purposes. Default is false. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg create: Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an - existing one - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + existing one. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1410,38 +1385,38 @@ class IndicesClient(NamespacedClient): body=body, ) - @query_params("expand_wildcards") + @query_params() async def get_data_stream(self, name=None, params=None, headers=None): """ Returns data streams. - :arg name: A comma-separated list of data streams to get; use - `*` to get all data streams - :arg expand_wildcards: Whether wildcard expressions should get - expanded to open or closed indices (default: open) Valid choices: open, - closed, hidden, none, all Default: open + :arg name: Comma-separated list of data streams; use `_all` or + empty string to perform the operation on all data streams. """ return await self.transport.perform_request( "GET", _make_path("_data_stream", name), params=params, headers=headers ) - @query_params("cause", "create", "master_timeout", "cluster_manager_timeout") + @query_params("cause", "cluster_manager_timeout", "create", "master_timeout") async def simulate_template(self, body=None, name=None, params=None, headers=None): """ - Simulate resolving the given template name or body + Simulate resolving the given template name or body. :arg body: New index template definition to be simulated, if no index template name is specified - :arg name: The name of the index template + :arg name: The name of the template. :arg cause: User defined reason for dry-run creating the new - template for simulation purposes + template for simulation purposes. Default is false. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg create: Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an - existing one - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + existing one. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return await self.transport.perform_request( "POST", @@ -1454,19 +1429,14 @@ class IndicesClient(NamespacedClient): @query_params("expand_wildcards") async def resolve_index(self, name, params=None, headers=None): """ - Returns information about any matching indices, aliases, and data streams + Returns information about any matching indices, aliases, and data streams. - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - - :arg name: A comma-separated list of names or wildcard - expressions - :arg expand_wildcards: Whether wildcard expressions should get - expanded to open or closed indices (default: open) Valid choices: open, - closed, hidden, none, all Default: open + :arg name: Comma-separated list of names or wildcard + expressions. + :arg expand_wildcards: Whether to expand wildcard expression to + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1477,10 +1447,10 @@ class IndicesClient(NamespacedClient): @query_params( "allow_no_indices", + "cluster_manager_timeout", "expand_wildcards", "ignore_unavailable", "master_timeout", - "cluster_manager_timeout", "timeout", ) async def add_block(self, index, block, params=None, headers=None): @@ -1488,20 +1458,23 @@ class IndicesClient(NamespacedClient): Adds a block to an index. - :arg index: A comma separated list of indices to add a block to + :arg index: Comma-separated list of indices to add a block to. :arg block: The block to add (one of read, write, read_only or - metadata) + metadata). :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + should be ignored when unavailable (missing or closed). + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ for param in (index, block): if param in SKIP_IN_PATH: @@ -1517,8 +1490,8 @@ class IndicesClient(NamespacedClient): Provides statistics on operations happening in a data stream. - :arg name: A comma-separated list of data stream names; use - `_all` or empty string to perform the operation on all data streams + :arg name: Comma-separated list of data streams; use `_all` or + empty string to perform the operation on all data streams. """ return await self.transport.perform_request( "GET", @@ -1526,115 +1499,3 @@ class IndicesClient(NamespacedClient): params=params, headers=headers, ) - - @query_params() - async def promote_data_stream(self, name, params=None, headers=None): - """ - Promotes a data stream from a replicated data stream managed by CCR to a - regular data stream - - - :arg name: The name of the data stream - """ - if name in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'name'.") - - return await self.transport.perform_request( - "POST", - _make_path("_data_stream", "_promote", name), - params=params, - headers=headers, - ) - - @query_params() - async def migrate_to_data_stream(self, name, params=None, headers=None): - """ - Migrates an alias to a data stream - - - :arg name: The name of the alias to migrate - """ - if name in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'name'.") - - return await self.transport.perform_request( - "POST", - _make_path("_data_stream", "_migrate", name), - params=params, - headers=headers, - ) - - @query_params( - "allow_no_indices", - "expand_wildcards", - "flush", - "ignore_unavailable", - "run_expensive_tasks", - ) - async def disk_usage(self, index, params=None, headers=None): - """ - Analyzes the disk usage of each field of an index or data stream - - - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - - :arg index: Comma-separated list of indices or data streams to - analyze the disk usage - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg flush: Whether flush or not before analyzing the index disk - usage. Defaults to true - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg run_expensive_tasks: Must be set to [true] in order for the - task to be performed. Defaults to false. - """ - if index in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'index'.") - - return await self.transport.perform_request( - "POST", _make_path(index, "_disk_usage"), params=params, headers=headers - ) - - @query_params( - "allow_no_indices", "expand_wildcards", "fields", "ignore_unavailable" - ) - async def field_usage_stats(self, index, params=None, headers=None): - """ - Returns the field usage stats for each field of an index - - - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg fields: A comma-separated list of fields to include in the - stats if only a subset of fields should be returned (supports wildcards) - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - """ - if index in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'index'.") - - return await self.transport.perform_request( - "GET", - _make_path(index, "_field_usage_stats"), - params=params, - headers=headers, - ) diff --git a/opensearchpy/_async/client/indices.pyi b/opensearchpy/_async/client/indices.pyi index 53f6d87f..0d9b5953 100644 --- a/opensearchpy/_async/client/indices.pyi +++ b/opensearchpy/_async/client/indices.pyi @@ -24,6 +24,15 @@ # specific language governing permissions and limitations # under the License. +# ---------------------------------------------------- +# THIS CODE IS GENERATED AND MANUAL EDITS WILL BE LOST. +# +# To contribute, kindly make essential modifications through either the "opensearch-py client generator": +# https://github.com/opensearch-project/opensearch-py/blob/main/utils/generate-api.py +# or the "OpenSearch API specification" available at: +# https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json +# ----------------------------------------------------- + from typing import Any, Collection, MutableMapping, Optional, Tuple, Union from .utils import NamespacedClient @@ -94,8 +103,8 @@ class IndicesClient(NamespacedClient): index: Any, *, body: Optional[Any] = ..., - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., wait_for_active_shards: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -117,8 +126,8 @@ class IndicesClient(NamespacedClient): target: Any, *, body: Optional[Any] = ..., - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., wait_for_active_shards: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -139,13 +148,13 @@ class IndicesClient(NamespacedClient): index: Any, *, allow_no_indices: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., expand_wildcards: Optional[Any] = ..., flat_settings: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., include_defaults: Optional[Any] = ..., local: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -164,10 +173,10 @@ class IndicesClient(NamespacedClient): index: Any, *, allow_no_indices: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., expand_wildcards: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., wait_for_active_shards: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -188,10 +197,10 @@ class IndicesClient(NamespacedClient): index: Any, *, allow_no_indices: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., expand_wildcards: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., wait_for_active_shards: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -212,10 +221,10 @@ class IndicesClient(NamespacedClient): index: Any, *, allow_no_indices: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., expand_wildcards: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -259,10 +268,10 @@ class IndicesClient(NamespacedClient): body: Any, index: Optional[Any] = ..., allow_no_indices: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., expand_wildcards: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., write_index_only: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -283,11 +292,11 @@ class IndicesClient(NamespacedClient): *, index: Optional[Any] = ..., allow_no_indices: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., expand_wildcards: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., local: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -330,8 +339,8 @@ class IndicesClient(NamespacedClient): name: Any, *, body: Optional[Any] = ..., - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -394,8 +403,8 @@ class IndicesClient(NamespacedClient): self, *, body: Any, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -415,8 +424,8 @@ class IndicesClient(NamespacedClient): index: Any, name: Any, *, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -436,9 +445,9 @@ class IndicesClient(NamespacedClient): name: Any, *, body: Any, + cluster_manager_timeout: Optional[Any] = ..., create: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., order: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -457,10 +466,10 @@ class IndicesClient(NamespacedClient): self, name: Any, *, + cluster_manager_timeout: Optional[Any] = ..., flat_settings: Optional[Any] = ..., local: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -478,10 +487,10 @@ class IndicesClient(NamespacedClient): self, *, name: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., flat_settings: Optional[Any] = ..., local: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -499,8 +508,8 @@ class IndicesClient(NamespacedClient): self, name: Any, *, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -521,13 +530,13 @@ class IndicesClient(NamespacedClient): index: Optional[Any] = ..., name: Optional[Any] = ..., allow_no_indices: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., expand_wildcards: Optional[Any] = ..., flat_settings: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., include_defaults: Optional[Any] = ..., local: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -547,11 +556,11 @@ class IndicesClient(NamespacedClient): body: Any, index: Optional[Any] = ..., allow_no_indices: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., expand_wildcards: Optional[Any] = ..., flat_settings: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., preserve_existing: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -581,7 +590,6 @@ class IndicesClient(NamespacedClient): include_segment_file_sizes: Optional[Any] = ..., include_unloaded_segments: Optional[Any] = ..., level: Optional[Any] = ..., - types: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -731,26 +739,6 @@ class IndicesClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... - async def flush_synced( - self, - *, - index: Optional[Any] = ..., - allow_no_indices: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., - ignore_unavailable: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... async def shard_stores( self, *, @@ -801,9 +789,9 @@ class IndicesClient(NamespacedClient): target: Any, *, body: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., copy_settings: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., wait_for_active_shards: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -825,9 +813,9 @@ class IndicesClient(NamespacedClient): target: Any, *, body: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., copy_settings: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., wait_for_active_shards: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -849,9 +837,9 @@ class IndicesClient(NamespacedClient): *, body: Optional[Any] = ..., new_index: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., dry_run: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., wait_for_active_shards: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -867,78 +855,11 @@ class IndicesClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... - async def freeze( - self, - index: Any, - *, - allow_no_indices: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., - ignore_unavailable: Optional[Any] = ..., - master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., - timeout: Optional[Any] = ..., - wait_for_active_shards: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - async def unfreeze( - self, - index: Any, - *, - allow_no_indices: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., - ignore_unavailable: Optional[Any] = ..., - master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., - timeout: Optional[Any] = ..., - wait_for_active_shards: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - async def reload_search_analyzers( - self, - index: Any, - *, - allow_no_indices: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., - ignore_unavailable: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... async def create_data_stream( self, name: Any, *, + body: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -956,7 +877,6 @@ class IndicesClient(NamespacedClient): self, name: Any, *, - expand_wildcards: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -974,8 +894,8 @@ class IndicesClient(NamespacedClient): self, name: Any, *, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -994,10 +914,10 @@ class IndicesClient(NamespacedClient): self, name: Any, *, + cluster_manager_timeout: Optional[Any] = ..., flat_settings: Optional[Any] = ..., local: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -1015,10 +935,10 @@ class IndicesClient(NamespacedClient): self, *, name: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., flat_settings: Optional[Any] = ..., local: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -1038,9 +958,9 @@ class IndicesClient(NamespacedClient): *, body: Any, cause: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., create: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -1060,9 +980,9 @@ class IndicesClient(NamespacedClient): *, body: Optional[Any] = ..., cause: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., create: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -1080,7 +1000,6 @@ class IndicesClient(NamespacedClient): self, *, name: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -1100,9 +1019,9 @@ class IndicesClient(NamespacedClient): body: Optional[Any] = ..., name: Optional[Any] = ..., cause: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., create: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -1140,10 +1059,10 @@ class IndicesClient(NamespacedClient): block: Any, *, allow_no_indices: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., expand_wildcards: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -1175,80 +1094,3 @@ class IndicesClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... - async def promote_data_stream( - self, - name: Any, - *, - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - async def migrate_to_data_stream( - self, - name: Any, - *, - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - async def disk_usage( - self, - index: Any, - *, - allow_no_indices: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., - flush: Optional[Any] = ..., - ignore_unavailable: Optional[Any] = ..., - run_expensive_tasks: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - async def field_usage_stats( - self, - index: Any, - *, - allow_no_indices: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., - fields: Optional[Any] = ..., - ignore_unavailable: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... diff --git a/opensearchpy/_async/client/ingest.py b/opensearchpy/_async/client/ingest.py index cb5253eb..eab27980 100644 --- a/opensearchpy/_async/client/ingest.py +++ b/opensearchpy/_async/client/ingest.py @@ -50,8 +50,8 @@ class IngestClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return await self.transport.perform_request( "GET", _make_path("_ingest", "pipeline", id), params=params, headers=headers @@ -68,8 +68,8 @@ class IngestClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg timeout: Operation timeout. """ for param in (id, body): @@ -94,8 +94,8 @@ class IngestClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg timeout: Operation timeout. """ if id in SKIP_IN_PATH: @@ -117,7 +117,7 @@ class IngestClient(NamespacedClient): :arg body: The simulate definition :arg id: Pipeline ID. :arg verbose: Verbose mode. Display data output for each - processor in executed pipeline. + processor in executed pipeline. Default is false. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") diff --git a/opensearchpy/_async/client/nodes.py b/opensearchpy/_async/client/nodes.py index e0e8b06b..31cd4915 100644 --- a/opensearchpy/_async/client/nodes.py +++ b/opensearchpy/_async/client/nodes.py @@ -73,10 +73,10 @@ class NodesClient(NamespacedClient): node you're connecting to, leave empty to get information from all nodes. :arg metric: Comma-separated list of metrics you wish returned. - Leave empty to return all. Valid choices: settings, os, process, jvm, - thread_pool, transport, http, plugins, ingest - :arg flat_settings: Return settings in flat format. (default: - false) + Leave empty to return all. Valid choices are settings, os, process, jvm, + thread_pool, transport, http, plugins, ingest. + :arg flat_settings: Return settings in flat format. Default is + false. :arg timeout: Operation timeout. """ return await self.transport.perform_request( @@ -105,13 +105,13 @@ class NodesClient(NamespacedClient): node you're connecting to, leave empty to get information from all nodes. :arg metric: Limit the information returned to the specified - metrics. Valid choices: _all, breaker, fs, http, indices, jvm, os, - process, thread_pool, transport, discovery, indexing_pressure + metrics. Valid choices are _all, breaker, fs, http, indices, jvm, os, + process, thread_pool, transport, discovery, indexing_pressure. :arg index_metric: Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) - metric isn't specified. Valid choices: _all, store, indexing, get, + metric isn't specified. Valid choices are _all, store, indexing, get, search, merge, flush, refresh, query_cache, fielddata, docs, warmer, - completion, segments, translog, suggest, request_cache, recovery + completion, segments, translog, suggest, request_cache, recovery. :arg completion_fields: Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards). :arg fielddata_fields: Comma-separated list of fields for @@ -122,9 +122,9 @@ class NodesClient(NamespacedClient): index metric. :arg include_segment_file_sizes: Whether to report the aggregated disk usage of each one of the Lucene index files (only - applies if segment stats are requested). (default: false) + applies if segment stats are requested). Default is false. :arg level: Return indices stats aggregated at index, node or - shard level. Valid choices: indices, node, shards + shard level. Valid choices are indices, node, shards. :arg timeout: Operation timeout. :arg types: Comma-separated list of document types for the `indexing` index metric. @@ -148,16 +148,16 @@ class NodesClient(NamespacedClient): 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: cpu, wait, - block + :arg doc_type: The type to sample. Valid choices are cpu, wait, + block. :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: True) + task queue. Default is True. :arg interval: The interval for the second sampling of threads. - :arg snapshots: Number of samples of thread stacktrace. - (default: 10) + :arg snapshots: Number of samples of thread stacktrace. Default + is 10. :arg threads: Specify the number of threads to provide - information for. (default: 3) + information for. Default is 3. :arg timeout: Operation timeout. """ # type is a reserved word so it cannot be used, use doc_type instead @@ -182,7 +182,7 @@ class NodesClient(NamespacedClient): node you're connecting to, leave empty to get information from all nodes. :arg metric: Limit the information returned to the specified - metrics. Valid choices: _all, rest_actions + metrics. Valid choices are _all, rest_actions. :arg timeout: Operation timeout. """ return await self.transport.perform_request( diff --git a/opensearchpy/_async/client/security.py b/opensearchpy/_async/client/security.py index bc8e8671..49e658d9 100644 --- a/opensearchpy/_async/client/security.py +++ b/opensearchpy/_async/client/security.py @@ -7,6 +7,17 @@ # Modifications Copyright OpenSearch Contributors. See # GitHub history for details. + +# ---------------------------------------------------- +# THIS CODE IS GENERATED AND MANUAL EDITS WILL BE LOST. +# +# To contribute, kindly make essential modifications through either the "opensearch-py client generator": +# https://github.com/opensearch-project/opensearch-py/blob/main/utils/generate-api.py +# or the "OpenSearch API specification" available at: +# https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json +# ----------------------------------------------------- + + from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params @@ -17,25 +28,25 @@ class SecurityClient(NamespacedClient): async def get_account_details(self, params=None, headers=None): """ Returns account details for the current user. + """ return await self.transport.perform_request( - "GET", - _make_path("_plugins", "_security", "api", "account"), - params=params, - headers=headers, + "GET", "/_plugins/_security/api/account", params=params, headers=headers ) @query_params() async def change_password(self, body, params=None, headers=None): """ Changes the password for the current user. + + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return await self.transport.perform_request( "PUT", - _make_path("_plugins", "_security", "api", "account"), + "/_plugins/_security/api/account", params=params, headers=headers, body=body, @@ -45,10 +56,13 @@ class SecurityClient(NamespacedClient): async def get_action_group(self, action_group, params=None, headers=None): """ Retrieves one action group. + + + :arg action_group: Action group to retrieve. """ if action_group in SKIP_IN_PATH: raise ValueError( - "Empty value passed for a required argument 'action-group'." + "Empty value passed for a required argument 'action_group'." ) return await self.transport.perform_request( @@ -62,10 +76,11 @@ class SecurityClient(NamespacedClient): async def get_action_groups(self, params=None, headers=None): """ Retrieves all action groups. + """ return await self.transport.perform_request( "GET", - _make_path("_plugins", "_security", "api", "actiongroups"), + "/_plugins/_security/api/actiongroups/", params=params, headers=headers, ) @@ -73,11 +88,14 @@ class SecurityClient(NamespacedClient): @query_params() async def delete_action_group(self, action_group, params=None, headers=None): """ - Deletes the specified action group. + Delete a specified action group. + + + :arg action_group: Action group to delete. """ if action_group in SKIP_IN_PATH: raise ValueError( - "Empty value passed for a required argument 'action-group'." + "Empty value passed for a required argument 'action_group'." ) return await self.transport.perform_request( @@ -91,6 +109,10 @@ class SecurityClient(NamespacedClient): async def create_action_group(self, action_group, body, params=None, headers=None): """ Creates or replaces the specified action group. + + + :arg action_group: The name of the action group to create or + replace """ for param in (action_group, body): if param in SKIP_IN_PATH: @@ -108,6 +130,8 @@ class SecurityClient(NamespacedClient): async def patch_action_group(self, action_group, body, params=None, headers=None): """ Updates individual attributes of an action group. + + """ for param in (action_group, body): if param in SKIP_IN_PATH: @@ -125,13 +149,15 @@ class SecurityClient(NamespacedClient): async def patch_action_groups(self, body, params=None, headers=None): """ Creates, updates, or deletes multiple action groups in a single call. + + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return await self.transport.perform_request( "PATCH", - _make_path("_plugins", "_security", "api", "actiongroups"), + "/_plugins/_security/api/actiongroups", params=params, headers=headers, body=body, @@ -140,7 +166,9 @@ class SecurityClient(NamespacedClient): @query_params() async def get_user(self, username, params=None, headers=None): """ - Retrieves one user. + Retrieve one internal user. + + """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'username'.") @@ -155,11 +183,12 @@ class SecurityClient(NamespacedClient): @query_params() async def get_users(self, params=None, headers=None): """ - Retrieves all users. + Retrieve all internal users. + """ return await self.transport.perform_request( "GET", - _make_path("_plugins", "_security", "api", "internalusers"), + "/_plugins/_security/api/internalusers", params=params, headers=headers, ) @@ -167,7 +196,9 @@ class SecurityClient(NamespacedClient): @query_params() async def delete_user(self, username, params=None, headers=None): """ - Deletes the specified user. + Delete the specified user. + + """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'username'.") @@ -183,6 +214,8 @@ class SecurityClient(NamespacedClient): async def create_user(self, username, body, params=None, headers=None): """ Creates or replaces the specified user. + + """ for param in (username, body): if param in SKIP_IN_PATH: @@ -200,6 +233,8 @@ class SecurityClient(NamespacedClient): async def patch_user(self, username, body, params=None, headers=None): """ Updates individual attributes of an internal user. + + """ for param in (username, body): if param in SKIP_IN_PATH: @@ -217,13 +252,15 @@ class SecurityClient(NamespacedClient): async def patch_users(self, body, params=None, headers=None): """ Creates, updates, or deletes multiple internal users in a single call. + + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return await self.transport.perform_request( "PATCH", - _make_path("_plugins", "_security", "api", "internalusers"), + "/_plugins/_security/api/internalusers", params=params, headers=headers, body=body, @@ -233,6 +270,8 @@ class SecurityClient(NamespacedClient): async def get_role(self, role, params=None, headers=None): """ Retrieves one role. + + """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -248,18 +287,18 @@ class SecurityClient(NamespacedClient): async def get_roles(self, params=None, headers=None): """ Retrieves all roles. + """ return await self.transport.perform_request( - "GET", - _make_path("_plugins", "_security", "api", "roles"), - params=params, - headers=headers, + "GET", "/_plugins/_security/api/roles/", params=params, headers=headers ) @query_params() async def delete_role(self, role, params=None, headers=None): """ - Deletes the specified role. + Delete the specified role. + + """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -275,6 +314,8 @@ class SecurityClient(NamespacedClient): async def create_role(self, role, body, params=None, headers=None): """ Creates or replaces the specified role. + + """ for param in (role, body): if param in SKIP_IN_PATH: @@ -292,6 +333,8 @@ class SecurityClient(NamespacedClient): async def patch_role(self, role, body, params=None, headers=None): """ Updates individual attributes of a role. + + """ for param in (role, body): if param in SKIP_IN_PATH: @@ -309,13 +352,15 @@ class SecurityClient(NamespacedClient): async def patch_roles(self, body, params=None, headers=None): """ Creates, updates, or deletes multiple roles in a single call. + + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return await self.transport.perform_request( "PATCH", - _make_path("_plugins", "_security", "api", "roles"), + "/_plugins/_security/api/roles", params=params, headers=headers, body=body, @@ -325,6 +370,8 @@ class SecurityClient(NamespacedClient): async def get_role_mapping(self, role, params=None, headers=None): """ Retrieves one role mapping. + + """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -340,10 +387,11 @@ class SecurityClient(NamespacedClient): async def get_role_mappings(self, params=None, headers=None): """ Retrieves all role mappings. + """ return await self.transport.perform_request( "GET", - _make_path("_plugins", "_security", "api", "rolesmapping"), + "/_plugins/_security/api/rolesmapping", params=params, headers=headers, ) @@ -352,6 +400,8 @@ class SecurityClient(NamespacedClient): async def delete_role_mapping(self, role, params=None, headers=None): """ Deletes the specified role mapping. + + """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -367,6 +417,8 @@ class SecurityClient(NamespacedClient): async def create_role_mapping(self, role, body, params=None, headers=None): """ Creates or replaces the specified role mapping. + + """ for param in (role, body): if param in SKIP_IN_PATH: @@ -384,6 +436,8 @@ class SecurityClient(NamespacedClient): async def patch_role_mapping(self, role, body, params=None, headers=None): """ Updates individual attributes of a role mapping. + + """ for param in (role, body): if param in SKIP_IN_PATH: @@ -401,13 +455,15 @@ class SecurityClient(NamespacedClient): async def patch_role_mappings(self, body, params=None, headers=None): """ Creates or updates multiple role mappings in a single call. + + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return await self.transport.perform_request( "PATCH", - _make_path("_plugins", "_security", "api", "rolesmapping"), + "/_plugins/_security/api/rolesmapping", params=params, headers=headers, body=body, @@ -417,6 +473,8 @@ class SecurityClient(NamespacedClient): async def get_tenant(self, tenant, params=None, headers=None): """ Retrieves one tenant. + + """ if tenant in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'tenant'.") @@ -432,18 +490,18 @@ class SecurityClient(NamespacedClient): async def get_tenants(self, params=None, headers=None): """ Retrieves all tenants. + """ return await self.transport.perform_request( - "GET", - _make_path("_plugins", "_security", "api", "tenants"), - params=params, - headers=headers, + "GET", "/_plugins/_security/api/tenants/", params=params, headers=headers ) @query_params() async def delete_tenant(self, tenant, params=None, headers=None): """ - Deletes the specified tenant. + Delete the specified tenant. + + """ if tenant in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'tenant'.") @@ -459,6 +517,8 @@ class SecurityClient(NamespacedClient): async def create_tenant(self, tenant, body, params=None, headers=None): """ Creates or replaces the specified tenant. + + """ for param in (tenant, body): if param in SKIP_IN_PATH: @@ -476,6 +536,8 @@ class SecurityClient(NamespacedClient): async def patch_tenant(self, tenant, body, params=None, headers=None): """ Add, delete, or modify a single tenant. + + """ for param in (tenant, body): if param in SKIP_IN_PATH: @@ -493,13 +555,15 @@ class SecurityClient(NamespacedClient): async def patch_tenants(self, body, params=None, headers=None): """ Add, delete, or modify multiple tenants in a single call. + + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return await self.transport.perform_request( "PATCH", - _make_path("_plugins", "_security", "api", "tenants"), + "/_plugins/_security/api/tenants/", params=params, headers=headers, body=body, @@ -508,11 +572,12 @@ class SecurityClient(NamespacedClient): @query_params() async def get_configuration(self, params=None, headers=None): """ - Retrieves the current Security plugin configuration in JSON format. + Returns the current Security plugin configuration in JSON format. + """ return await self.transport.perform_request( "GET", - _make_path("_plugins", "_security", "api", "securityconfig"), + "/_plugins/_security/api/securityconfig", params=params, headers=headers, ) @@ -520,14 +585,16 @@ class SecurityClient(NamespacedClient): @query_params() async def update_configuration(self, body, params=None, headers=None): """ - Retrieves the current Security plugin configuration in JSON format. + Adds or updates the existing configuration using the REST API. + + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return await self.transport.perform_request( "PUT", - _make_path("_plugins", "_security", "api", "securityconfig", "config"), + "/_plugins/_security/api/securityconfig/config", params=params, headers=headers, body=body, @@ -536,14 +603,16 @@ class SecurityClient(NamespacedClient): @query_params() async def patch_configuration(self, body, params=None, headers=None): """ - Updates the existing configuration using the REST API. + A PATCH call is used to update the existing configuration using the REST API. + + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return await self.transport.perform_request( "PATCH", - _make_path("_plugins", "_security", "api", "securityconfig"), + "/_plugins/_security/api/securityconfig", params=params, headers=headers, body=body, @@ -555,6 +624,8 @@ class SecurityClient(NamespacedClient): ): """ Retrieves all distinguished names in the allow list. + + """ return await self.transport.perform_request( "GET", @@ -565,14 +636,18 @@ class SecurityClient(NamespacedClient): @query_params() async def update_distinguished_names( - self, cluster_name, body, params=None, headers=None + self, cluster_name, body=None, params=None, headers=None ): """ - Adds or updates the specified distinguished names in the cluster's or node's allow list. + Adds or updates the specified distinguished names in the cluster’s or node’s + allow list. + + """ - for param in (cluster_name, body): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") + if cluster_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'cluster_name'." + ) return await self.transport.perform_request( "PUT", @@ -585,11 +660,14 @@ class SecurityClient(NamespacedClient): @query_params() async def delete_distinguished_names(self, cluster_name, params=None, headers=None): """ - Deletes all distinguished names in the specified cluster's or node's allow list. + Deletes all distinguished names in the specified cluster’s or node’s allow + list. + + """ if cluster_name in SKIP_IN_PATH: raise ValueError( - "Empty value passed for a required argument 'cluster-name'." + "Empty value passed for a required argument 'cluster_name'." ) return await self.transport.perform_request( @@ -602,25 +680,22 @@ class SecurityClient(NamespacedClient): @query_params() async def get_certificates(self, params=None, headers=None): """ - Retrieves the cluster's security certificates. + Retrieves the cluster’s security certificates. + """ return await self.transport.perform_request( - "GET", - _make_path("_plugins", "_security", "api", "ssl", "certs"), - params=params, - headers=headers, + "GET", "/_plugins/_security/api/ssl/certs", params=params, headers=headers ) @query_params() async def reload_transport_certificates(self, params=None, headers=None): """ - Reloads SSL certificates that are about to expire without restarting the OpenSearch node. + Reload transport layer communication certificates. + """ return await self.transport.perform_request( "PUT", - _make_path( - "_opendistro", "_security", "api", "ssl", "transport", "reloadcerts" - ), + "/_plugins/_security/api/ssl/transport/reloadcerts", params=params, headers=headers, ) @@ -628,11 +703,12 @@ class SecurityClient(NamespacedClient): @query_params() async def reload_http_certificates(self, params=None, headers=None): """ - Reloads SSL certificates that are about to expire without restarting the OpenSearch node. + Reload HTTP layer communication certificates. + """ return await self.transport.perform_request( "PUT", - _make_path("_opendistro", "_security", "api", "ssl", "http", "reloadcerts"), + "/_plugins/_security/api/ssl/http/reloadcerts", params=params, headers=headers, ) @@ -641,12 +717,10 @@ class SecurityClient(NamespacedClient): async def flush_cache(self, params=None, headers=None): """ Flushes the Security plugin user, authentication, and authorization cache. + """ return await self.transport.perform_request( - "DELETE", - _make_path("_plugins", "_security", "api", "cache"), - params=params, - headers=headers, + "DELETE", "/_plugins/_security/api/cache", params=params, headers=headers ) @query_params() @@ -662,13 +736,11 @@ class SecurityClient(NamespacedClient): @query_params() async def get_audit_configuration(self, params=None, headers=None): """ - A GET call retrieves the audit configuration. + Retrieves the audit configuration. + """ return await self.transport.perform_request( - "GET", - _make_path("_opendistro", "_security", "api", "audit"), - params=params, - headers=headers, + "GET", "/_plugins/_security/api/audit", params=params, headers=headers ) @query_params() @@ -676,6 +748,7 @@ class SecurityClient(NamespacedClient): """ Updates the audit configuration. + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -692,13 +765,33 @@ class SecurityClient(NamespacedClient): async def patch_audit_configuration(self, body, params=None, headers=None): """ A PATCH call is used to update specified fields in the audit configuration. + + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return await self.transport.perform_request( "PATCH", - _make_path("_opendistro", "_security", "api", "audit"), + "/_plugins/_security/api/audit", + params=params, + headers=headers, + body=body, + ) + + @query_params() + async def patch_distinguished_names(self, body, params=None, headers=None): + """ + Bulk update of distinguished names. + + + """ + if body in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'body'.") + + return await self.transport.perform_request( + "PATCH", + "/_plugins/_security/api/nodesdn", params=params, headers=headers, body=body, diff --git a/opensearchpy/_async/client/security.pyi b/opensearchpy/_async/client/security.pyi index 7840445a..182d06c4 100644 --- a/opensearchpy/_async/client/security.pyi +++ b/opensearchpy/_async/client/security.pyi @@ -6,191 +6,734 @@ # # Modifications Copyright OpenSearch Contributors. See # GitHub history for details. + +# ---------------------------------------------------- +# THIS CODE IS GENERATED AND MANUAL EDITS WILL BE LOST. +# +# To contribute, kindly make essential modifications through either the "opensearch-py client generator": +# https://github.com/opensearch-project/opensearch-py/blob/main/utils/generate-api.py +# or the "OpenSearch API specification" available at: +# https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json +# ----------------------------------------------------- + from typing import Any, Collection, MutableMapping, Optional, Tuple, Union -from .utils import NamespacedClient as NamespacedClient +from .utils import NamespacedClient class SecurityClient(NamespacedClient): async def get_account_details( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def change_password( self, + *, body: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def get_action_group( self, action_group: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def get_action_groups( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def delete_action_group( self, action_group: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def create_action_group( self, action_group: Any, + *, body: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def patch_action_group( self, action_group: Any, + *, body: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def patch_action_groups( - self, body: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def get_user( self, username: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def get_users( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def delete_user( self, username: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def create_user( self, username: Any, + *, body: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def patch_user( self, username: Any, + *, body: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def patch_users( - self, body: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def get_role( - self, role: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + role: Any, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def get_roles( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def delete_role( - self, role: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + role: Any, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def create_role( - self, role: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + role: Any, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def patch_role( - self, role: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + role: Any, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def patch_roles( - self, body: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def get_role_mapping( - self, role: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + role: Any, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def get_role_mappings( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def delete_role_mapping( - self, role: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + role: Any, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def create_role_mapping( - self, role: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + role: Any, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def patch_role_mapping( - self, role: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + role: Any, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def patch_role_mappings( - self, body: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def get_tenant( self, tenant: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def get_tenants( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def delete_tenant( self, tenant: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def create_tenant( self, tenant: Any, + *, body: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def patch_tenant( self, tenant: Any, + *, body: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def patch_tenants( - self, body: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def get_configuration( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def update_configuration( - self, body: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def patch_configuration( - self, body: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def get_distinguished_names( self, - cluster_name: Union[Any, None] = ..., - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., + *, + cluster_name: Optional[Any] = ..., + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def update_distinguished_names( self, cluster_name: Any, - body: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., + *, + body: Optional[Any] = ..., + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def delete_distinguished_names( self, cluster_name: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def get_certificates( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def reload_transport_certificates( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def reload_http_certificates( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def flush_cache( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def health( self, @@ -209,7 +752,20 @@ class SecurityClient(NamespacedClient): headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def get_audit_configuration( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def update_audit_configuration( self, @@ -229,5 +785,36 @@ class SecurityClient(NamespacedClient): headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... async def patch_audit_configuration( - self, body: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... + self, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... + async def patch_distinguished_names( + self, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... diff --git a/opensearchpy/_async/client/snapshot.py b/opensearchpy/_async/client/snapshot.py index 4f2acd6a..37f46820 100644 --- a/opensearchpy/_async/client/snapshot.py +++ b/opensearchpy/_async/client/snapshot.py @@ -25,25 +25,36 @@ # under the License. +# ---------------------------------------------------- +# THIS CODE IS GENERATED AND MANUAL EDITS WILL BE LOST. +# +# To contribute, kindly make essential modifications through either the "opensearch-py client generator": +# https://github.com/opensearch-project/opensearch-py/blob/main/utils/generate-api.py +# or the "OpenSearch API specification" available at: +# https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json +# ----------------------------------------------------- + + from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params class SnapshotClient(NamespacedClient): - @query_params("master_timeout", "cluster_manager_timeout", "wait_for_completion") + @query_params("cluster_manager_timeout", "master_timeout", "wait_for_completion") async def create(self, repository, snapshot, body=None, params=None, headers=None): """ Creates a snapshot in a repository. - :arg repository: A repository name - :arg snapshot: A snapshot name + :arg repository: Repository name. + :arg snapshot: Snapshot name. :arg body: The snapshot definition - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg wait_for_completion: Should this request wait until the - operation has completed before returning + operation has completed before returning. Default is false. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -57,18 +68,19 @@ class SnapshotClient(NamespacedClient): body=body, ) - @query_params("master_timeout", "cluster_manager_timeout") + @query_params("cluster_manager_timeout", "master_timeout") async def delete(self, repository, snapshot, params=None, headers=None): """ Deletes a snapshot. - :arg repository: A repository name - :arg snapshot: A snapshot name - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + :arg repository: Repository name. + :arg snapshot: Snapshot name. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -82,33 +94,25 @@ class SnapshotClient(NamespacedClient): ) @query_params( - "ignore_unavailable", - "include_repository", - "index_details", - "master_timeout", - "cluster_manager_timeout", - "verbose", + "cluster_manager_timeout", "ignore_unavailable", "master_timeout", "verbose" ) async def get(self, repository, snapshot, params=None, headers=None): """ Returns information about a snapshot. - :arg repository: A repository name - :arg snapshot: A comma-separated list of snapshot names + :arg repository: Repository name. + :arg snapshot: Comma-separated list of snapshot names. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg ignore_unavailable: Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is - thrown - :arg include_repository: Whether to include the repository name - in the snapshot info. Defaults to true. - :arg index_details: Whether to include details of each index in - the snapshot, if those details are available. Defaults to false. - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + thrown. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg verbose: Whether to show verbose snapshot info or only show - the basic info found in the repository index blob + the basic info found in the repository index blob. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -121,7 +125,7 @@ class SnapshotClient(NamespacedClient): headers=headers, ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") async def delete_repository(self, repository, params=None, headers=None): """ Deletes a repository. @@ -129,11 +133,12 @@ class SnapshotClient(NamespacedClient): :arg repository: Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported. - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node - :arg timeout: Explicit operation timeout + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -145,38 +150,40 @@ class SnapshotClient(NamespacedClient): headers=headers, ) - @query_params("local", "master_timeout", "cluster_manager_timeout") + @query_params("cluster_manager_timeout", "local", "master_timeout") async def get_repository(self, repository=None, params=None, headers=None): """ Returns information about a repository. - :arg repository: A comma-separated list of repository names + :arg repository: Comma-separated list of repository names. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + from cluster-manager node. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return await self.transport.perform_request( "GET", _make_path("_snapshot", repository), params=params, headers=headers ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout", "verify") + @query_params("cluster_manager_timeout", "master_timeout", "timeout", "verify") async def create_repository(self, repository, body, params=None, headers=None): """ Creates a repository. - :arg repository: A repository name + :arg repository: Repository name. :arg body: The repository definition - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node - :arg timeout: Explicit operation timeout - :arg verify: Whether to verify the repository after creation + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. + :arg verify: Whether to verify the repository after creation. """ for param in (repository, body): if param in SKIP_IN_PATH: @@ -190,21 +197,22 @@ class SnapshotClient(NamespacedClient): body=body, ) - @query_params("master_timeout", "cluster_manager_timeout", "wait_for_completion") + @query_params("cluster_manager_timeout", "master_timeout", "wait_for_completion") async def restore(self, repository, snapshot, body=None, params=None, headers=None): """ Restores a snapshot. - :arg repository: A repository name - :arg snapshot: A snapshot name + :arg repository: Repository name. + :arg snapshot: Snapshot name. :arg body: Details of what to restore - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg wait_for_completion: Should this request wait until the - operation has completed before returning + operation has completed before returning. Default is false. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -218,21 +226,22 @@ class SnapshotClient(NamespacedClient): body=body, ) - @query_params("ignore_unavailable", "master_timeout", "cluster_manager_timeout") + @query_params("cluster_manager_timeout", "ignore_unavailable", "master_timeout") async def status(self, repository=None, snapshot=None, params=None, headers=None): """ Returns information about the status of a snapshot. - :arg repository: A repository name - :arg snapshot: A comma-separated list of snapshot names + :arg repository: Repository name. + :arg snapshot: Comma-separated list of snapshot names. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg ignore_unavailable: Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is - thrown - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + thrown. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return await self.transport.perform_request( "GET", @@ -241,18 +250,19 @@ class SnapshotClient(NamespacedClient): headers=headers, ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") async def verify_repository(self, repository, params=None, headers=None): """ Verifies a repository. - :arg repository: A repository name - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node - :arg timeout: Explicit operation timeout + :arg repository: Repository name. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -264,18 +274,19 @@ class SnapshotClient(NamespacedClient): headers=headers, ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") async def cleanup_repository(self, repository, params=None, headers=None): """ Removes stale data from repository. - :arg repository: A repository name - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node - :arg timeout: Explicit operation timeout + :arg repository: Repository name. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -287,7 +298,7 @@ class SnapshotClient(NamespacedClient): headers=headers, ) - @query_params("master_timeout", "cluster_manager_timeout") + @query_params("cluster_manager_timeout", "master_timeout") async def clone( self, repository, snapshot, target_snapshot, body, params=None, headers=None ): @@ -295,14 +306,15 @@ class SnapshotClient(NamespacedClient): Clones indices 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 repository: Repository name. + :arg snapshot: Snapshot name. + :arg target_snapshot: The name of the cloned snapshot to create. :arg body: The snapshot clone definition - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ for param in (repository, snapshot, target_snapshot, body): if param in SKIP_IN_PATH: @@ -315,56 +327,3 @@ class SnapshotClient(NamespacedClient): headers=headers, body=body, ) - - @query_params( - "blob_count", - "concurrency", - "detailed", - "early_read_node_count", - "max_blob_size", - "max_total_data_size", - "rare_action_probability", - "rarely_abort_writes", - "read_node_count", - "seed", - "timeout", - ) - async def repository_analyze(self, repository, params=None, headers=None): - """ - Analyzes a repository for correctness and performance - - - :arg repository: A repository name - :arg blob_count: Number of blobs to create during the test. - Defaults to 100. - :arg concurrency: Number of operations to run concurrently - during the test. Defaults to 10. - :arg detailed: Whether to return detailed results or a summary. - Defaults to 'false' so that only the summary is returned. - :arg early_read_node_count: Number of nodes on which to perform - an early read on a blob, i.e. before writing has completed. Early reads - are rare actions so the 'rare_action_probability' parameter is also - relevant. Defaults to 2. - :arg max_blob_size: Maximum size of a blob to create during the - test, e.g '1gb' or '100mb'. Defaults to '10mb'. - :arg max_total_data_size: Maximum total size of all blobs to - create during the test, e.g '1tb' or '100gb'. Defaults to '1gb'. - :arg rare_action_probability: Probability of taking a rare - action such as an early read or an overwrite. Defaults to 0.02. - :arg rarely_abort_writes: Whether to rarely abort writes before - they complete. Defaults to 'true'. - :arg read_node_count: Number of nodes on which to read a blob - after writing. Defaults to 10. - :arg seed: Seed for the random number generator used to create - the test workload. Defaults to a random value. - :arg timeout: Explicit operation timeout. Defaults to '30s'. - """ - if repository in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'repository'.") - - return await self.transport.perform_request( - "POST", - _make_path("_snapshot", repository, "_analyze"), - params=params, - headers=headers, - ) diff --git a/opensearchpy/_async/client/snapshot.pyi b/opensearchpy/_async/client/snapshot.pyi index 2167c97f..b065e86b 100644 --- a/opensearchpy/_async/client/snapshot.pyi +++ b/opensearchpy/_async/client/snapshot.pyi @@ -24,6 +24,15 @@ # specific language governing permissions and limitations # under the License. +# ---------------------------------------------------- +# THIS CODE IS GENERATED AND MANUAL EDITS WILL BE LOST. +# +# To contribute, kindly make essential modifications through either the "opensearch-py client generator": +# https://github.com/opensearch-project/opensearch-py/blob/main/utils/generate-api.py +# or the "OpenSearch API specification" available at: +# https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json +# ----------------------------------------------------- + from typing import Any, Collection, MutableMapping, Optional, Tuple, Union from .utils import NamespacedClient @@ -35,8 +44,8 @@ class SnapshotClient(NamespacedClient): snapshot: Any, *, body: Optional[Any] = ..., - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., wait_for_completion: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -56,8 +65,8 @@ class SnapshotClient(NamespacedClient): repository: Any, snapshot: Any, *, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -76,11 +85,9 @@ class SnapshotClient(NamespacedClient): repository: Any, snapshot: Any, *, - ignore_unavailable: Optional[Any] = ..., - include_repository: Optional[Any] = ..., - index_details: Optional[Any] = ..., - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + ignore_unavailable: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., verbose: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -99,8 +106,8 @@ class SnapshotClient(NamespacedClient): self, repository: Any, *, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -119,9 +126,9 @@ class SnapshotClient(NamespacedClient): self, *, repository: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., local: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -140,8 +147,8 @@ class SnapshotClient(NamespacedClient): repository: Any, *, body: Any, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., verify: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -163,8 +170,8 @@ class SnapshotClient(NamespacedClient): snapshot: Any, *, body: Optional[Any] = ..., - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., wait_for_completion: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -184,9 +191,9 @@ class SnapshotClient(NamespacedClient): *, repository: Optional[Any] = ..., snapshot: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -204,8 +211,8 @@ class SnapshotClient(NamespacedClient): self, repository: Any, *, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -224,8 +231,8 @@ class SnapshotClient(NamespacedClient): self, repository: Any, *, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -247,36 +254,8 @@ class SnapshotClient(NamespacedClient): target_snapshot: Any, *, body: Any, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - async def repository_analyze( - self, - repository: Any, - *, - blob_count: Optional[Any] = ..., - concurrency: Optional[Any] = ..., - detailed: Optional[Any] = ..., - early_read_node_count: Optional[Any] = ..., - max_blob_size: Optional[Any] = ..., - max_total_data_size: Optional[Any] = ..., - rare_action_probability: Optional[Any] = ..., - rarely_abort_writes: Optional[Any] = ..., - read_node_count: Optional[Any] = ..., - seed: Optional[Any] = ..., - timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., diff --git a/opensearchpy/_async/client/tasks.py b/opensearchpy/_async/client/tasks.py index 212b9e56..2bf73c6d 100644 --- a/opensearchpy/_async/client/tasks.py +++ b/opensearchpy/_async/client/tasks.py @@ -57,9 +57,10 @@ class TasksClient(NamespacedClient): :arg actions: Comma-separated list of actions that should be returned. Leave empty to return all. - :arg detailed: Return detailed task information. + :arg detailed: Return detailed task information. Default is + false. :arg group_by: Group tasks by nodes or parent/child - relationships. Valid choices: nodes, parents, none + relationships. Valid choices are nodes, parents, none. :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 @@ -68,7 +69,7 @@ class TasksClient(NamespacedClient): (node_id:task_number). Set to -1 to return all. :arg timeout: Operation timeout. :arg wait_for_completion: Should this request wait until the - operation has completed before returning. + operation has completed before returning. Default is false. """ return await self.transport.perform_request( "GET", "/_tasks", params=params, headers=headers @@ -91,7 +92,7 @@ class TasksClient(NamespacedClient): :arg parent_task_id: Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. :arg wait_for_completion: Should this request wait until the - operation has completed before returning. + operation has completed before returning. Default is false. """ return await self.transport.perform_request( "POST", @@ -110,7 +111,7 @@ class TasksClient(NamespacedClient): (node_id:task_number). :arg timeout: Operation timeout. :arg wait_for_completion: Should this request wait until the - operation has completed before returning. + operation has completed before returning. Default is false. """ if task_id in SKIP_IN_PATH: warnings.warn( diff --git a/opensearchpy/client/__init__.py b/opensearchpy/client/__init__.py index 8f976879..25a779fd 100644 --- a/opensearchpy/client/__init__.py +++ b/opensearchpy/client/__init__.py @@ -26,6 +26,16 @@ # under the License. +# ---------------------------------------------------- +# THIS CODE IS GENERATED AND MANUAL EDITS WILL BE LOST. +# +# To contribute, kindly make essential modifications through either the "opensearch-py client generator": +# https://github.com/opensearch-project/opensearch-py/blob/main/utils/generate-api.py +# or the "OpenSearch API specification" available at: +# https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json +# ----------------------------------------------------- + + from __future__ import unicode_literals import logging @@ -275,25 +285,25 @@ class OpenSearch(object): with a same ID already exists in the index. - :arg index: The name of the index - :arg id: Document ID + :arg index: Index name. + :arg id: Document ID. :arg body: The document :arg pipeline: The pipeline id to preprocess incoming documents - with + with. :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for - :arg routing: Specific routing value - :arg timeout: Explicit operation timeout - :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: - internal, external, external_gte + do nothing with refreshes. Valid choices are true, false, wait_for. + :arg routing: Routing value. + :arg timeout: Operation timeout. + :arg version: Explicit version number for concurrency control. + :arg version_type: Specific version type. Valid choices are + internal, external, external_gte, force. :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the index operation. Defaults - to 1, meaning the primary shard only. Set to `all` for all shard copies, + that must be active before proceeding with the operation. Defaults to 1, + meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1) + number of copies for the shard (number of replicas + 1). Default is 1. """ for param in (index, id, body): if param in SKIP_IN_PATH: @@ -320,49 +330,45 @@ class OpenSearch(object): ) def index(self, index, body, id=None, params=None, headers=None): """ - Creates or overwrites a document in an index. + Creates or updates a document in an index. - :arg index: The name of the index + :arg index: Index name. :arg body: The document - :arg id: Document ID - :arg if_primary_term: only perform the index operation if the - last operation that has changed the document has the specified primary - term - :arg if_seq_no: only perform the index operation if the last - operation that has changed the document has the specified sequence - number + :arg id: Document ID. + :arg if_primary_term: only perform the operation if the last + operation that has changed the document has the specified primary term. + :arg if_seq_no: only perform the operation if the last operation + that has changed the document has the specified sequence number. :arg op_type: Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests - without an explicit document ID Valid choices: index, create + without an explicit document ID. Valid choices are index, create. :arg pipeline: The pipeline id to preprocess incoming documents - with + with. :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for + do nothing with refreshes. Valid choices are true, false, wait_for. :arg require_alias: When true, requires destination to be an - alias. Default is false - :arg routing: Specific routing value - :arg timeout: Explicit operation timeout - :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: - internal, external, external_gte + alias. Default is false. + :arg routing: Routing value. + :arg timeout: Operation timeout. + :arg version: Explicit version number for concurrency control. + :arg version_type: Specific version type. Valid choices are + internal, external, external_gte, force. :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the index operation. Defaults - to 1, meaning the primary shard only. Set to `all` for all shard copies, + that must be active before proceeding with the operation. Defaults to 1, + meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1) + number of copies for the shard (number of replicas + 1). Default is 1. """ for param in (index, body): if param in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument.") - doc_type = "_doc" - return self.transport.perform_request( "POST" if id in SKIP_IN_PATH else "PUT", - _make_path(index, doc_type, id), + _make_path(index, "_doc", id), params=params, headers=headers, body=body, @@ -386,29 +392,29 @@ class OpenSearch(object): :arg body: The operation definition and data (action-data pairs), separated by newlines - :arg index: Default index for items which don't provide one + :arg index: Default index for items which don't provide one. :arg _source: True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub- - request + request. :arg _source_excludes: Default list of fields to exclude from - the returned _source field, can be overridden on each sub-request + the returned _source field, can be overridden on each sub-request. :arg _source_includes: Default list of fields to extract and - return from the _source field, can be overridden on each sub-request + return from the _source field, can be overridden on each sub-request. :arg pipeline: The pipeline id to preprocess incoming documents - with + with. :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for + do nothing with refreshes. Valid choices are true, false, wait_for. :arg require_alias: Sets require_alias for all incoming - documents. Defaults to unset (false) - :arg routing: Specific routing value - :arg timeout: Explicit operation timeout + documents. Default is false. + :arg routing: Routing value. + :arg timeout: Operation timeout. :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the bulk operation. Defaults - to 1, meaning the primary shard only. Set to `all` for all shard copies, + that must be active before proceeding with the operation. Defaults to 1, + meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total - number of copies for the shard (number of replicas + 1) + number of copies for the shard (number of replicas + 1). Default is 1. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -428,9 +434,9 @@ class OpenSearch(object): Explicitly clears the search context for a scroll. - :arg body: A comma-separated list of scroll IDs to clear if none + :arg body: Comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter - :arg scroll_id: A comma-separated list of scroll IDs to clear + :arg scroll_id: Comma-separated list of scroll IDs to clear. """ if scroll_id in SKIP_IN_PATH and body in SKIP_IN_PATH: raise ValueError("You need to supply scroll_id or body.") @@ -464,37 +470,38 @@ class OpenSearch(object): Returns number of documents matching a query. - :arg body: A query to restrict the results specified with the + :arg body: Query to restrict the results specified with the Query DSL (optional) - :arg index: A comma-separated list of indices to restrict the - results + :arg index: Comma-separated list of indices to restrict the + results. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed (default: false) - :arg analyzer: The analyzer to use for the query string + queries should be analyzed. Default is false. + :arg analyzer: The analyzer to use for the query string. :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR). Valid choices are AND, OR. :arg df: The field to use as default where no field prefix is - given in the query string + given in the query string. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_throttled: Whether specified concrete, expanded or - aliased indices should be ignored when throttled + aliased indices should be ignored when throttled. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored + as providing text to a numeric field) should be ignored. :arg min_score: Include only documents with a specific `_score` - value in the result + value in the result. :arg preference: Specify the node or shard the operation should - be performed on (default: random) - :arg q: Query in the Lucene query string syntax - :arg routing: A comma-separated list of specific routing values - :arg terminate_after: The maximum count for each shard, upon - reaching which the query execution will terminate early + be performed on. Default is random. + :arg q: Query in the Lucene query string syntax. + :arg routing: Comma-separated list of specific routing values. + :arg terminate_after: The maximum number of documents to collect + for each shard, upon reaching which the query execution will terminate + early. """ return self.transport.perform_request( "POST", @@ -519,37 +526,33 @@ class OpenSearch(object): Removes a document from the index. - :arg index: The name of the index - :arg id: The document ID - :arg if_primary_term: only perform the delete operation if the - last operation that has changed the document has the specified primary - term - :arg if_seq_no: only perform the delete operation if the last - operation that has changed the document has the specified sequence - number + :arg index: Index name. + :arg id: Document ID. + :arg if_primary_term: only perform the operation if the last + operation that has changed the document has the specified primary term. + :arg if_seq_no: only perform the operation if the last operation + that has changed the document has the specified sequence number. :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for - :arg routing: Specific routing value - :arg timeout: Explicit operation timeout - :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: - internal, external, external_gte, force + do nothing with refreshes. Valid choices are true, false, wait_for. + :arg routing: Routing value. + :arg timeout: Operation timeout. + :arg version: Explicit version number for concurrency control. + :arg version_type: Specific version type. Valid choices are + internal, external, external_gte, force. :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the delete operation. - Defaults to 1, meaning the primary shard only. Set to `all` for all - shard copies, otherwise set to any non-negative value less than or equal - to the total number of copies for the shard (number of replicas + 1) + that must be active before proceeding with the operation. Defaults to 1, + meaning the primary shard only. Set to `all` for all shard copies, + otherwise set to any non-negative value less than or equal to the total + number of copies for the shard (number of replicas + 1). Default is 1. """ for param in (index, id): if param in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument.") - doc_type = "_doc" - return self.transport.perform_request( - "DELETE", _make_path(index, doc_type, id), params=params, headers=headers + "DELETE", _make_path(index, "_doc", id), params=params, headers=headers ) @query_params( @@ -592,76 +595,76 @@ class OpenSearch(object): Deletes documents matching the provided query. - :arg index: A comma-separated list of index names to search; use - `_all` or empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg body: The search definition using the Query DSL :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed (default: false) - :arg analyzer: The analyzer to use for the query string - :arg conflicts: What to do when the delete by query hits version - conflicts? Valid choices: abort, proceed Default: abort + queries should be analyzed. Default is false. + :arg analyzer: The analyzer to use for the query string. + :arg conflicts: What to do when the operation encounters version + conflicts?. Valid choices are abort, proceed. :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR). Valid choices are AND, OR. :arg df: The field to use as default where no field prefix is - given in the query string + given in the query string. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg from_: Starting offset (default: 0) + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg from_: Starting offset. Default is 0. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored + as providing text to a numeric field) should be ignored. :arg max_docs: Maximum number of documents to process (default: - all documents) + all documents). :arg preference: Specify the node or shard the operation should - be performed on (default: random) - :arg q: Query in the Lucene query string syntax - :arg refresh: Should the effected indexes be refreshed? + be performed on. Default is random. + :arg q: Query in the Lucene query string syntax. + :arg refresh: Refresh the shard containing the document before + performing the operation. :arg request_cache: Specify if request cache should be used for - this request or not, defaults to index level setting + this request or not, defaults to index level setting. :arg requests_per_second: The throttle for this request in sub- - requests per second. -1 means no throttle. - :arg routing: A comma-separated list of specific routing values + requests per second. -1 means no throttle. Default is 0. + :arg routing: Comma-separated list of specific routing values. :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search - :arg scroll_size: Size on the scroll request powering the delete - by query Default: 100 + should be maintained for scrolled search. + :arg scroll_size: Size on the scroll request powering the + operation. Default is 100. :arg search_timeout: Explicit timeout for each search request. Defaults to no timeout. - :arg search_type: Search operation type Valid choices: - query_then_fetch, dfs_query_then_fetch - :arg size: Deprecated, please use `max_docs` instead + :arg search_type: Search operation type. Valid choices are + query_then_fetch, dfs_query_then_fetch. + :arg size: Deprecated, please use `max_docs` instead. :arg slices: The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default: 1 - :arg sort: A comma-separated list of : pairs + set to `auto`. Default is 1. + :arg sort: Comma-separated list of : pairs. :arg stats: Specific 'tag' of the request for logging and - statistical purposes + statistical purposes. :arg terminate_after: The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default: 1m - :arg version: Specify whether to return document version as part - of a hit + shards that are unavailable. Default is 1m. + :arg version: Whether to return document version as part of a + hit. :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the delete by query - operation. Defaults to 1, meaning the primary shard only. Set to `all` - for all shard copies, otherwise set to any non-negative value less than - or equal to the total number of copies for the shard (number of replicas - + 1) - :arg wait_for_completion: Should the request should block until - the delete by query is complete. Default: True + that must be active before proceeding with the operation. Defaults to 1, + meaning the primary shard only. Set to `all` for all shard copies, + otherwise set to any non-negative value less than or equal to the total + number of copies for the shard (number of replicas + 1). Default is 1. + :arg wait_for_completion: Should this request wait until the + operation has completed before returning. Default is True. """ # from is a reserved word so it cannot be used, use from_ instead if "from_" in params: @@ -686,9 +689,9 @@ class OpenSearch(object): operation. - :arg task_id: The task id to rethrottle - :arg requests_per_second: The throttle to set on this request in - floating sub-requests per second. -1 means set no throttle. + :arg task_id: The task id to rethrottle. + :arg requests_per_second: The throttle for this request in sub- + requests per second. -1 means no throttle. """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'task_id'.") @@ -700,16 +703,19 @@ class OpenSearch(object): headers=headers, ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") def delete_script(self, id, params=None, headers=None): """ Deletes a script. - :arg id: Script ID - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + :arg id: Script ID. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'id'.") @@ -735,35 +741,33 @@ class OpenSearch(object): Returns information about whether a document exists in an index. - :arg index: The name of the index - :arg id: The document ID + :arg index: Index name. + :arg id: Document ID. :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. :arg preference: Specify the node or shard the operation should - be performed on (default: random) + be performed on. Default is random. :arg realtime: Specify whether to perform the operation in - realtime or search mode + realtime or search mode. :arg refresh: Refresh the shard containing the document before - performing the operation - :arg routing: Specific routing value - :arg stored_fields: A comma-separated list of stored fields to - return in the response - :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: - internal, external, external_gte, force + performing the operation. + :arg routing: Routing value. + :arg stored_fields: Comma-separated list of stored fields to + return. + :arg version: Explicit version number for concurrency control. + :arg version_type: Specific version type. Valid choices are + internal, external, external_gte, force. """ for param in (index, id): if param in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument.") - doc_type = "_doc" - return self.transport.perform_request( - "HEAD", _make_path(index, doc_type, id), params=params, headers=headers + "HEAD", _make_path(index, "_doc", id), params=params, headers=headers ) @query_params( @@ -782,24 +786,24 @@ class OpenSearch(object): Returns information about whether a document source exists in an index. - :arg index: The name of the index - :arg id: The document ID + :arg index: Index name. + :arg id: Document ID. :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. :arg preference: Specify the node or shard the operation should - be performed on (default: random) + be performed on. Default is random. :arg realtime: Specify whether to perform the operation in - realtime or search mode + realtime or search mode. :arg refresh: Refresh the shard containing the document before - performing the operation - :arg routing: Specific routing value - :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: - internal, external, external_gte, force + performing the operation. + :arg routing: Routing value. + :arg version: Explicit version number for concurrency control. + :arg version_type: Specific version type. Valid choices are + internal, external, external_gte, force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -830,30 +834,30 @@ class OpenSearch(object): Returns information about why a specific matches (or doesn't match) a query. - :arg index: The name of the index - :arg id: The document ID + :arg index: Index name. + :arg id: Document ID. :arg body: The query definition using the Query DSL :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. :arg analyze_wildcard: Specify whether wildcards and prefix - queries in the query string query should be analyzed (default: false) - :arg analyzer: The analyzer for the query string query + queries in the query string query should be analyzed. Default is false. + :arg analyzer: The analyzer to use for the query string. :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR - :arg df: The default field for query string query (default: - _all) + query (AND or OR). Valid choices are AND, OR. + :arg df: The default field for query string query. Default is + _all. :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored + as providing text to a numeric field) should be ignored. :arg preference: Specify the node or shard the operation should - be performed on (default: random) - :arg q: Query in the Lucene query string syntax - :arg routing: Specific routing value - :arg stored_fields: A comma-separated list of stored fields to - return in the response + be performed on. Default is random. + :arg q: Query in the Lucene query string syntax. + :arg routing: Routing value. + :arg stored_fields: Comma-separated list of stored fields to + return. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -879,19 +883,19 @@ class OpenSearch(object): :arg body: An index filter specified with the Query DSL - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg fields: A comma-separated list of field names + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg fields: Comma-separated list of field names. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg include_unmapped: Indicates whether unmapped fields should - be included in the response. + be included in the response. Default is false. """ return self.transport.perform_request( "POST", @@ -918,46 +922,47 @@ class OpenSearch(object): Returns a document. - :arg index: The name of the index - :arg id: The document ID + :arg index: Index name. + :arg id: Document ID. :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. :arg preference: Specify the node or shard the operation should - be performed on (default: random) + be performed on. Default is random. :arg realtime: Specify whether to perform the operation in - realtime or search mode + realtime or search mode. :arg refresh: Refresh the shard containing the document before - performing the operation - :arg routing: Specific routing value - :arg stored_fields: A comma-separated list of stored fields to - return in the response - :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: - internal, external, external_gte, force + performing the operation. + :arg routing: Routing value. + :arg stored_fields: Comma-separated list of stored fields to + return. + :arg version: Explicit version number for concurrency control. + :arg version_type: Specific version type. Valid choices are + internal, external, external_gte, force. """ for param in (index, id): if param in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument.") - doc_type = "_doc" - return self.transport.perform_request( - "GET", _make_path(index, doc_type, id), params=params, headers=headers + "GET", _make_path(index, "_doc", id), params=params, headers=headers ) - @query_params("master_timeout", "cluster_manager_timeout") + @query_params("cluster_manager_timeout", "master_timeout") def get_script(self, id, params=None, headers=None): """ Returns a script. - :arg id: Script ID - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + :arg id: Script ID. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ if id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'id'.") @@ -982,24 +987,24 @@ class OpenSearch(object): Returns the source of a document. - :arg index: The name of the index - :arg id: The document ID + :arg index: Index name. + :arg id: Document ID. :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. :arg preference: Specify the node or shard the operation should - be performed on (default: random) + be performed on. Default is random. :arg realtime: Specify whether to perform the operation in - realtime or search mode + realtime or search mode. :arg refresh: Refresh the shard containing the document before - performing the operation - :arg routing: Specific routing value - :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: - internal, external, external_gte, force + performing the operation. + :arg routing: Routing value. + :arg version: Explicit version number for concurrency control. + :arg version_type: Specific version type. Valid choices are + internal, external, external_gte, force. """ for param in (index, id): if param in SKIP_IN_PATH: @@ -1027,24 +1032,24 @@ class OpenSearch(object): :arg body: Document identifiers; can be either `docs` - (containing full document information) or `ids` (when index and type is - provided in the URL. - :arg index: The name of the index + (containing full document information) or `ids` (when index is provided + in the URL. + :arg index: Index name. :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. :arg preference: Specify the node or shard the operation should - be performed on (default: random) + be performed on. Default is random. :arg realtime: Specify whether to perform the operation in - realtime or search mode + realtime or search mode. :arg refresh: Refresh the shard containing the document before - performing the operation - :arg routing: Specific routing value - :arg stored_fields: A comma-separated list of stored fields to - return in the response + performing the operation. + :arg routing: Routing value. + :arg stored_fields: Comma-separated list of stored fields to + return. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1073,30 +1078,31 @@ class OpenSearch(object): :arg body: The request definitions (metadata-search request definition pairs), separated by newlines - :arg index: A comma-separated list of index names to use as - default + :arg index: Comma-separated list of indices to use as default. :arg ccs_minimize_roundtrips: Indicates whether network round- trips should be minimized as part of cross-cluster search requests - execution Default: true + execution. Default is True. :arg max_concurrent_searches: Controls the maximum number of - concurrent searches the multi search api will execute + concurrent searches the multi search api will execute. :arg max_concurrent_shard_requests: The number of concurrent shard requests each sub search executes concurrently per node. This value should be used to limit the impact of the search on the cluster in - order to limit the number of concurrent shard requests Default: 5 - :arg pre_filter_shard_size: A threshold that enforces a pre- - filter roundtrip to prefilter search shards based on query rewriting if - the number of shards the search request expands to exceeds the - threshold. This filter roundtrip can limit the number of shards - significantly if for instance a shard can not match any documents based - on its rewrite method ie. if date filters are mandatory to match but the - shard bounds and the query are disjoint. + order to limit the number of concurrent shard requests. Default is 5. + :arg pre_filter_shard_size: Threshold that enforces a pre-filter + round-trip to prefilter search shards based on query rewriting if the + number of shards the search request expands to exceeds the threshold. + This filter round-trip can limit the number of shards significantly if + for instance a shard can not match any documents based on its rewrite + method ie. if date filters are mandatory to match but the shard bounds + and the query are disjoint. :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response - :arg search_type: Search operation type Valid choices: - query_then_fetch, dfs_query_then_fetch + be rendered as an integer or an object in the rest search response. + Default is false. + :arg search_type: Search operation type. Valid choices are + query_then_fetch, query_and_fetch, dfs_query_then_fetch, + dfs_query_and_fetch. :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response + should be prefixed by their respective types in the response. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1124,19 +1130,20 @@ class OpenSearch(object): :arg body: The request definitions (metadata-search request definition pairs), separated by newlines - :arg index: A comma-separated list of index names to use as - default + :arg index: Comma-separated list of indices to use as default. :arg ccs_minimize_roundtrips: Indicates whether network round- trips should be minimized as part of cross-cluster search requests - execution Default: true + execution. Default is True. :arg max_concurrent_searches: Controls the maximum number of - concurrent searches the multi search api will execute + concurrent searches the multi search api will execute. :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response - :arg search_type: Search operation type Valid choices: - query_then_fetch, dfs_query_then_fetch + be rendered as an integer or an object in the rest search response. + Default is false. + :arg search_type: Search operation type. Valid choices are + query_then_fetch, query_and_fetch, dfs_query_then_fetch, + dfs_query_and_fetch. :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response + should be prefixed by their respective types in the response. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1176,34 +1183,34 @@ class OpenSearch(object): :arg field_statistics: Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified - in body "params" or "docs". Default: True - :arg fields: A comma-separated list of fields to return. Applies - to all returned documents unless otherwise specified in body "params" or - "docs". - :arg ids: A comma-separated list of documents ids. You must - define ids as parameter or set "ids" or "docs" in the request body + in body 'params' or 'docs'. Default is True. + :arg fields: Comma-separated list of fields to return. Applies + to all returned documents unless otherwise specified in body 'params' or + 'docs'. + :arg ids: Comma-separated list of documents ids. You must define + ids as parameter or set 'ids' or 'docs' in the request body. :arg offsets: Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body - "params" or "docs". Default: True + 'params' or 'docs'. Default is True. :arg payloads: Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body - "params" or "docs". Default: True + 'params' or 'docs'. Default is True. :arg positions: Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body - "params" or "docs". Default: True + 'params' or 'docs'. Default is True. :arg preference: Specify the node or shard the operation should - be performed on (default: random) .Applies to all returned documents - unless otherwise specified in body "params" or "docs". + be performed on. Applies to all returned documents unless otherwise + specified in body 'params' or 'docs'. Default is random. :arg realtime: Specifies if requests are real-time as opposed to - near-real-time (default: true). - :arg routing: Specific routing value. Applies to all returned - documents unless otherwise specified in body "params" or "docs". + near-real-time. Default is True. + :arg routing: Routing value. Applies to all returned documents + unless otherwise specified in body 'params' or 'docs'. :arg term_statistics: Specifies if total term frequency and document frequency should be returned. Applies to all returned documents - unless otherwise specified in body "params" or "docs". - :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: - internal, external, external_gte, force + unless otherwise specified in body 'params' or 'docs'. Default is false. + :arg version: Explicit version number for concurrency control. + :arg version_type: Specific version type. Valid choices are + internal, external, external_gte, force. """ path = _make_path(index, "_mtermvectors") @@ -1211,18 +1218,21 @@ class OpenSearch(object): "POST", path, params=params, headers=headers, body=body ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") def put_script(self, id, body, context=None, params=None, headers=None): """ Creates or updates a script. - :arg id: Script ID + :arg id: Script ID. :arg body: The document - :arg context: Context name to compile script against - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + :arg context: Script context. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ for param in (id, body): if param in SKIP_IN_PATH: @@ -1242,28 +1252,23 @@ class OpenSearch(object): def rank_eval(self, body, index=None, params=None, headers=None): """ Allows to evaluate the quality of ranked search results over a set of typical - search queries + search queries. - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg body: The ranking evaluation search definition, including search requests, document ratings and ranking metric definition. - :arg index: A comma-separated list of index names to search; use - `_all` or empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg search_type: Search operation type Valid choices: - query_then_fetch, dfs_query_then_fetch + should be ignored when unavailable (missing or closed). + :arg search_type: Search operation type. Valid choices are + query_then_fetch, dfs_query_then_fetch. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1296,24 +1301,24 @@ class OpenSearch(object): :arg body: The search definition using the Query DSL and the prototype for the index request. :arg max_docs: Maximum number of documents to process (default: - all documents) - :arg refresh: Should the affected indexes be refreshed? - :arg requests_per_second: The throttle to set on this request in - sub-requests per second. -1 means no throttle. - :arg scroll: Control how long to keep the search context alive - Default: 5m + all documents). + :arg refresh: Should the affected indexes be refreshed?. + :arg requests_per_second: The throttle for this request in sub- + requests per second. -1 means no throttle. Default is 0. + :arg scroll: Specify how long a consistent view of the index + should be maintained for scrolled search. :arg slices: The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default: 1 + set to `auto`. Default is 1. :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default: 1m + shards that are unavailable. Default is 1m. :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the reindex operation. - Defaults to 1, meaning the primary shard only. Set to `all` for all - shard copies, otherwise set to any non-negative value less than or equal - to the total number of copies for the shard (number of replicas + 1) - :arg wait_for_completion: Should the request should block until - the reindex is complete. Default: True + that must be active before proceeding with the operation. Defaults to 1, + meaning the primary shard only. Set to `all` for all shard copies, + otherwise set to any non-negative value less than or equal to the total + number of copies for the shard (number of replicas + 1). Default is 1. + :arg wait_for_completion: Should this request wait until the + operation has completed before returning. Default is True. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1328,9 +1333,9 @@ class OpenSearch(object): Changes the number of requests per second for a particular Reindex operation. - :arg task_id: The task id to rethrottle - :arg requests_per_second: The throttle to set on this request in - floating sub-requests per second. -1 means set no throttle. + :arg task_id: The task id to rethrottle. + :arg requests_per_second: The throttle for this request in sub- + requests per second. -1 means no throttle. """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'task_id'.") @@ -1349,7 +1354,7 @@ class OpenSearch(object): :arg body: The search definition template and its params - :arg id: The id of the stored search template + :arg id: The id of the stored search template. """ return self.transport.perform_request( "POST", @@ -1362,14 +1367,9 @@ class OpenSearch(object): @query_params() def scripts_painless_execute(self, body=None, params=None, headers=None): """ - Allows an arbitrary script to be executed and a result to be returned + Allows an arbitrary script to be executed and a result to be returned. - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - :arg body: The script to execute """ return self.transport.perform_request( @@ -1388,11 +1388,12 @@ class OpenSearch(object): :arg body: The scroll ID if not passed by URL or query parameter. - :arg scroll_id: The scroll ID for scrolled search + :arg scroll_id: Scroll ID. :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response + be rendered as an integer or an object in the rest search response. + Default is false. :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search + should be maintained for scrolled search. """ if scroll_id in SKIP_IN_PATH and body in SKIP_IN_PATH: raise ValueError("You need to supply scroll_id or body.") @@ -1425,7 +1426,6 @@ class OpenSearch(object): "ignore_unavailable", "lenient", "max_concurrent_shard_requests", - "min_compatible_shard_node", "pre_filter_shard_size", "preference", "q", @@ -1456,101 +1456,99 @@ class OpenSearch(object): :arg body: The search definition using the Query DSL - :arg index: A comma-separated list of index names to search; use - `_all` or empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg allow_partial_search_results: Indicate if an error should - be returned if there is a partial search failure or timeout Default: - True + be returned if there is a partial search failure or timeout. Default is + True. :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed (default: false) - :arg analyzer: The analyzer to use for the query string + queries should be analyzed. Default is false. + :arg analyzer: The analyzer to use for the query string. :arg batched_reduce_size: The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. - Default: 512 + Default is 512. :arg ccs_minimize_roundtrips: Indicates whether network round- trips should be minimized as part of cross-cluster search requests - execution Default: true + execution. Default is True. :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR). Valid choices are AND, OR. :arg df: The field to use as default where no field prefix is - given in the query string - :arg docvalue_fields: A comma-separated list of fields to return - as the docvalue representation of a field for each hit + given in the query string. + :arg docvalue_fields: Comma-separated list of fields to return + as the docvalue representation of a field for each hit. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg explain: Specify whether to return detailed information - about score computation as part of a hit - :arg from_: Starting offset (default: 0) + about score computation as part of a hit. + :arg from_: Starting offset. Default is 0. :arg ignore_throttled: Whether specified concrete, expanded or - aliased indices should be ignored when throttled + aliased indices should be ignored when throttled. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored + as providing text to a numeric field) should be ignored. :arg max_concurrent_shard_requests: The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order - to limit the number of concurrent shard requests Default: 5 - :arg min_compatible_shard_node: The minimum compatible version - that all shards involved in search should have for this request to be - successful - :arg pre_filter_shard_size: A threshold that enforces a pre- - filter roundtrip to prefilter search shards based on query rewriting if - the number of shards the search request expands to exceeds the - threshold. This filter roundtrip can limit the number of shards - significantly if for instance a shard can not match any documents based - on its rewrite method ie. if date filters are mandatory to match but the - shard bounds and the query are disjoint. + to limit the number of concurrent shard requests. Default is 5. + :arg pre_filter_shard_size: Threshold that enforces a pre-filter + round-trip to prefilter search shards based on query rewriting if the + number of shards the search request expands to exceeds the threshold. + This filter round-trip can limit the number of shards significantly if + for instance a shard can not match any documents based on its rewrite + method ie. if date filters are mandatory to match but the shard bounds + and the query are disjoint. :arg preference: Specify the node or shard the operation should - be performed on (default: random) - :arg q: Query in the Lucene query string syntax + be performed on. Default is random. + :arg q: Query in the Lucene query string syntax. :arg request_cache: Specify if request cache should be used for - this request or not, defaults to index level setting + this request or not, defaults to index level setting. :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response - :arg routing: A comma-separated list of specific routing values + be rendered as an integer or an object in the rest search response. + Default is false. + :arg routing: Comma-separated list of specific routing values. :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search - :arg search_type: Search operation type Valid choices: - query_then_fetch, dfs_query_then_fetch + should be maintained for scrolled search. + :arg search_type: Search operation type. Valid choices are + query_then_fetch, dfs_query_then_fetch. :arg seq_no_primary_term: Specify whether to return sequence - number and primary term of the last modification of each hit - :arg size: Number of hits to return (default: 10) - :arg sort: A comma-separated list of : pairs + number and primary term of the last modification of each hit. + :arg size: Number of hits to return. Default is 10. + :arg sort: Comma-separated list of : pairs. :arg stats: Specific 'tag' of the request for logging and - statistical purposes - :arg stored_fields: A comma-separated list of stored fields to - return as part of a hit - :arg suggest_field: Specify which field to use for suggestions - :arg suggest_mode: Specify suggest mode Valid choices: missing, - popular, always Default: missing - :arg suggest_size: How many suggestions to return in response + statistical purposes. + :arg stored_fields: Comma-separated list of stored fields to + return. + :arg suggest_field: Specify which field to use for suggestions. + :arg suggest_mode: Specify suggest mode. Valid choices are + missing, popular, always. + :arg suggest_size: How many suggestions to return in response. :arg suggest_text: The source text for which the suggestions - should be returned + should be returned. :arg terminate_after: The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - :arg timeout: Explicit operation timeout + :arg timeout: Operation timeout. :arg track_scores: Whether to calculate and return scores even - if they are not used for sorting + if they are not used for sorting. :arg track_total_hits: Indicate if the number of documents that - match the query should be tracked + match the query should be tracked. :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response - :arg version: Specify whether to return document version as part - of a hit + should be prefixed by their respective types in the response. + :arg version: Whether to return document version as part of a + hit. """ # from is a reserved word so it cannot be used, use from_ instead if "from_" in params: @@ -1578,21 +1576,21 @@ class OpenSearch(object): executed against. - :arg index: A comma-separated list of index names to search; use - `_all` or empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) + from cluster-manager node. Default is false. :arg preference: Specify the node or shard the operation should - be performed on (default: random) - :arg routing: Specific routing value + be performed on. Default is random. + :arg routing: Routing value. """ return self.transport.perform_request( "GET", _make_path(index, "_search_shards"), params=params, headers=headers @@ -1619,35 +1617,37 @@ class OpenSearch(object): :arg body: The search definition template and its params - :arg index: A comma-separated list of index names to search; use - `_all` or empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg ccs_minimize_roundtrips: Indicates whether network round- trips should be minimized as part of cross-cluster search requests - execution Default: true + execution. Default is True. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg explain: Specify whether to return detailed information - about score computation as part of a hit + about score computation as part of a hit. :arg ignore_throttled: Whether specified concrete, expanded or - aliased indices should be ignored when throttled + aliased indices should be ignored when throttled. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg preference: Specify the node or shard the operation should - be performed on (default: random) - :arg profile: Specify whether to profile the query execution + be performed on. Default is random. + :arg profile: Specify whether to profile the query execution. :arg rest_total_hits_as_int: Indicates whether hits.total should - be rendered as an integer or an object in the rest search response - :arg routing: A comma-separated list of specific routing values + be rendered as an integer or an object in the rest search response. + Default is false. + :arg routing: Comma-separated list of specific routing values. :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search - :arg search_type: Search operation type Valid choices: - query_then_fetch, dfs_query_then_fetch + should be maintained for scrolled search. + :arg search_type: Search operation type. Valid choices are + query_then_fetch, query_and_fetch, dfs_query_then_fetch, + dfs_query_and_fetch. :arg typed_keys: Specify whether aggregation and suggester names - should be prefixed by their respective types in the response + should be prefixed by their respective types in the response. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -1682,28 +1682,28 @@ class OpenSearch(object): :arg index: The index in which the document resides. :arg body: Define parameters and or supply a document to get termvectors for. See documentation. - :arg id: The id of the document, when not specified a doc param - should be supplied. + :arg id: Document ID. When not specified a doc param should be + supplied. :arg field_statistics: Specifies if document count, sum of document frequencies and sum of total term frequencies should be - returned. Default: True - :arg fields: A comma-separated list of fields to return. + returned. Default is True. + :arg fields: Comma-separated list of fields to return. :arg offsets: Specifies if term offsets should be returned. - Default: True + Default is True. :arg payloads: Specifies if term payloads should be returned. - Default: True + Default is True. :arg positions: Specifies if term positions should be returned. - Default: True + Default is True. :arg preference: Specify the node or shard the operation should - be performed on (default: random). + be performed on. Default is random. :arg realtime: Specifies if request is real-time as opposed to - near-real-time (default: true). - :arg routing: Specific routing value. + near-real-time. Default is True. + :arg routing: Routing value. :arg term_statistics: Specifies if total term frequency and - document frequency should be returned. - :arg version: Explicit version number for concurrency control - :arg version_type: Specific version type Valid choices: - internal, external, external_gte, force + document frequency should be returned. Default is false. + :arg version: Explicit version number for concurrency control. + :arg version_type: Specific version type. Valid choices are + internal, external, external_gte, force. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -1733,38 +1733,36 @@ class OpenSearch(object): Updates a document with a script or partial document. - :arg index: The name of the index - :arg id: Document ID + :arg index: Index name. + :arg id: Document ID. :arg body: The request definition requires either `script` or partial `doc` :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field - :arg if_primary_term: only perform the update operation if the - last operation that has changed the document has the specified primary - term - :arg if_seq_no: only perform the update operation if the last - operation that has changed the document has the specified sequence - number - :arg lang: The script language (default: painless) + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. + :arg if_primary_term: only perform the operation if the last + operation that has changed the document has the specified primary term. + :arg if_seq_no: only perform the operation if the last operation + that has changed the document has the specified sequence number. + :arg lang: The script language. Default is painless. :arg refresh: If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then - do nothing with refreshes. Valid choices: true, false, wait_for - :arg require_alias: When true, requires destination is an alias. - Default is false + do nothing with refreshes. Valid choices are true, false, wait_for. + :arg require_alias: When true, requires destination to be an + alias. Default is false. :arg retry_on_conflict: Specify how many times should the - operation be retried when a conflict occurs (default: 0) - :arg routing: Specific routing value - :arg timeout: Explicit operation timeout + operation be retried when a conflict occurs. Default is 0. + :arg routing: Routing value. + :arg timeout: Operation timeout. :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the update operation. - Defaults to 1, meaning the primary shard only. Set to `all` for all - shard copies, otherwise set to any non-negative value less than or equal - to the total number of copies for the shard (number of replicas + 1) + that must be active before proceeding with the operation. Defaults to 1, + meaning the primary shard only. Set to `all` for all shard copies, + otherwise set to any non-negative value less than or equal to the total + number of copies for the shard (number of replicas + 1). Default is 1. """ for param in (index, id, body): if param in SKIP_IN_PATH: @@ -1809,7 +1807,6 @@ class OpenSearch(object): "terminate_after", "timeout", "version", - "version_type", "wait_for_active_shards", "wait_for_completion", ) @@ -1819,81 +1816,77 @@ class OpenSearch(object): for example to pick up a mapping change. - :arg index: A comma-separated list of index names to search; use - `_all` or empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg body: The search definition using the Query DSL - search; leave empty to perform the operation on all types :arg _source: True or false to return the _source field or not, - or a list of fields to return - :arg _source_excludes: A list of fields to exclude from the - returned _source field - :arg _source_includes: A list of fields to extract and return - from the _source field + or a list of fields to return. + :arg _source_excludes: List of fields to exclude from the + returned _source field. + :arg _source_includes: List of fields to extract and return from + the _source field. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed (default: false) - :arg analyzer: The analyzer to use for the query string - :arg conflicts: What to do when the update by query hits version - conflicts? Valid choices: abort, proceed Default: abort + queries should be analyzed. Default is false. + :arg analyzer: The analyzer to use for the query string. + :arg conflicts: What to do when the operation encounters version + conflicts?. Valid choices are abort, proceed. :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR). Valid choices are AND, OR. :arg df: The field to use as default where no field prefix is - given in the query string + given in the query string. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg from_: Starting offset (default: 0) + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg from_: Starting offset. Default is 0. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored + as providing text to a numeric field) should be ignored. :arg max_docs: Maximum number of documents to process (default: - all documents) - :arg pipeline: Ingest pipeline to set on index requests made by - this action. (default: none) + all documents). + :arg pipeline: The pipeline id to preprocess incoming documents + with. :arg preference: Specify the node or shard the operation should - be performed on (default: random) - :arg q: Query in the Lucene query string syntax - :arg refresh: Should the affected indexes be refreshed? + be performed on. Default is random. + :arg q: Query in the Lucene query string syntax. + :arg refresh: Should the affected indexes be refreshed?. :arg request_cache: Specify if request cache should be used for - this request or not, defaults to index level setting - :arg requests_per_second: The throttle to set on this request in - sub-requests per second. -1 means no throttle. - :arg routing: A comma-separated list of specific routing values + this request or not, defaults to index level setting. + :arg requests_per_second: The throttle for this request in sub- + requests per second. -1 means no throttle. Default is 0. + :arg routing: Comma-separated list of specific routing values. :arg scroll: Specify how long a consistent view of the index - should be maintained for scrolled search - :arg scroll_size: Size on the scroll request powering the update - by query Default: 100 + should be maintained for scrolled search. + :arg scroll_size: Size on the scroll request powering the + operation. Default is 100. :arg search_timeout: Explicit timeout for each search request. Defaults to no timeout. - :arg search_type: Search operation type Valid choices: - query_then_fetch, dfs_query_then_fetch - :arg size: Deprecated, please use `max_docs` instead + :arg search_type: Search operation type. Valid choices are + query_then_fetch, dfs_query_then_fetch. + :arg size: Deprecated, please use `max_docs` instead. :arg slices: The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be - set to `auto`. Default: 1 - :arg sort: A comma-separated list of : pairs + set to `auto`. Default is 1. + :arg sort: Comma-separated list of : pairs. :arg stats: Specific 'tag' of the request for logging and - statistical purposes + statistical purposes. :arg terminate_after: The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. :arg timeout: Time each individual bulk request should wait for - shards that are unavailable. Default: 1m - :arg version: Specify whether to return document version as part - of a hit - :arg version_type: Should the document increment the version - number (internal) on hit or not (reindex) + shards that are unavailable. Default is 1m. + :arg version: Whether to return document version as part of a + hit. :arg wait_for_active_shards: Sets the number of shard copies - that must be active before proceeding with the update by query - operation. Defaults to 1, meaning the primary shard only. Set to `all` - for all shard copies, otherwise set to any non-negative value less than - or equal to the total number of copies for the shard (number of replicas - + 1) - :arg wait_for_completion: Should the request should block until - the update by query operation is complete. Default: True + that must be active before proceeding with the operation. Defaults to 1, + meaning the primary shard only. Set to `all` for all shard copies, + otherwise set to any non-negative value less than or equal to the total + number of copies for the shard (number of replicas + 1). Default is 1. + :arg wait_for_completion: Should this request wait until the + operation has completed before returning. Default is True. """ # from is a reserved word so it cannot be used, use from_ instead if "from_" in params: @@ -1917,9 +1910,9 @@ class OpenSearch(object): operation. - :arg task_id: The task id to rethrottle - :arg requests_per_second: The throttle to set on this request in - floating sub-requests per second. -1 means set no throttle. + :arg task_id: The task id to rethrottle. + :arg requests_per_second: The throttle for this request in sub- + requests per second. -1 means no throttle. """ if task_id in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'task_id'.") @@ -1936,11 +1929,6 @@ class OpenSearch(object): """ Returns all script contexts. - - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version """ return self.transport.perform_request( "GET", "/_script_context", params=params, headers=headers @@ -1949,13 +1937,8 @@ class OpenSearch(object): @query_params() def get_script_languages(self, params=None, headers=None): """ - Returns available script types, languages and contexts + Returns available script types, languages and contexts. - - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version """ return self.transport.perform_request( "GET", "/_script_language", params=params, headers=headers @@ -1978,11 +1961,11 @@ class OpenSearch(object): :arg allow_partial_pit_creation: Allow if point in time can be created with partial failures. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: all, - open, closed, hidden, none + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg keep_alive: Specify the keep alive for point in time. :arg preference: Specify the node or shard the operation should - be performed on. + be performed on. Default is random. :arg routing: Comma-separated list of specific routing values. """ if index in SKIP_IN_PATH: @@ -2011,7 +1994,7 @@ class OpenSearch(object): Deletes one or more point in time searches based on the IDs passed. - :arg body: a point-in-time id to delete + :arg body: The point-in-time ids to be deleted """ return self.transport.perform_request( "DELETE", @@ -2025,36 +2008,8 @@ class OpenSearch(object): def get_all_pits(self, params=None, headers=None): """ Lists all active point in time searches. + """ return self.transport.perform_request( "GET", "/_search/point_in_time/_all", params=params, headers=headers ) - - @query_params() - def terms_enum(self, index, body=None, params=None, headers=None): - """ - The terms enum API can be used to discover terms in the index that begin with - the provided string. It is designed for low-latency look-ups used in auto- - complete scenarios. - - - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - - :arg index: A comma-separated list of index names to search; use - `_all` or empty string to perform the operation on all indices - :arg body: field name, string which is the prefix expected in - matching terms, timeout and size for max number of results - """ - if index in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'index'.") - - return self.transport.perform_request( - "POST", - _make_path(index, "_terms_enum"), - params=params, - headers=headers, - body=body, - ) diff --git a/opensearchpy/client/__init__.pyi b/opensearchpy/client/__init__.pyi index e1d1e359..5bf53ec7 100644 --- a/opensearchpy/client/__init__.pyi +++ b/opensearchpy/client/__init__.pyi @@ -25,6 +25,15 @@ # specific language governing permissions and limitations # under the License. +# ---------------------------------------------------- +# THIS CODE IS GENERATED AND MANUAL EDITS WILL BE LOST. +# +# To contribute, kindly make essential modifications through either the "opensearch-py client generator": +# https://github.com/opensearch-project/opensearch-py/blob/main/utils/generate-api.py +# or the "OpenSearch API specification" available at: +# https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json +# ----------------------------------------------------- + from __future__ import unicode_literals import logging @@ -59,7 +68,10 @@ class OpenSearch(object): snapshot: SnapshotClient tasks: TasksClient def __init__( - self, hosts: Any = ..., transport_class: Type[Transport] = ..., **kwargs: Any + self, + hosts: Any = ..., + transport_class: Type[Transport] = ..., + **kwargs: Any, ) -> None: ... def __repr__(self) -> str: ... def __enter__(self) -> "OpenSearch": ... @@ -330,8 +342,8 @@ class OpenSearch(object): self, id: Any, *, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -487,8 +499,8 @@ class OpenSearch(object): self, id: Any, *, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -639,8 +651,8 @@ class OpenSearch(object): *, body: Any, context: Optional[Any] = ..., - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -799,7 +811,6 @@ class OpenSearch(object): ignore_unavailable: Optional[Any] = ..., lenient: Optional[Any] = ..., max_concurrent_shard_requests: Optional[Any] = ..., - min_compatible_shard_node: Optional[Any] = ..., pre_filter_shard_size: Optional[Any] = ..., preference: Optional[Any] = ..., q: Optional[Any] = ..., @@ -988,7 +999,6 @@ class OpenSearch(object): terminate_after: Optional[Any] = ..., timeout: Optional[Any] = ..., version: Optional[Any] = ..., - version_type: Optional[Any] = ..., wait_for_active_shards: Optional[Any] = ..., wait_for_completion: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -1125,21 +1135,3 @@ class OpenSearch(object): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... - def terms_enum( - self, - index: Any, - *, - body: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... diff --git a/opensearchpy/client/_patch.pyi b/opensearchpy/client/_patch.pyi index be6e12a0..b01423b9 100644 --- a/opensearchpy/client/_patch.pyi +++ b/opensearchpy/client/_patch.pyi @@ -6,6 +6,7 @@ # # Modifications Copyright OpenSearch Contributors. See # GitHub history for details. + from typing import Any, Collection, MutableMapping, Optional, Tuple, Type, Union def list_all_point_in_time( diff --git a/opensearchpy/client/cat.py b/opensearchpy/client/cat.py index 8dac68cd..cd0c42cf 100644 --- a/opensearchpy/client/cat.py +++ b/opensearchpy/client/cat.py @@ -48,17 +48,17 @@ class CatClient(NamespacedClient): :arg name: Comma-separated list of alias names. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: all, - open, closed, hidden, none + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", _make_path("_cat", "aliases", name), params=params, headers=headers @@ -83,22 +83,22 @@ class CatClient(NamespacedClient): :arg node_id: Comma-separated list of node IDs or names to limit the returned information. - :arg bytes: The unit in which to display byte values. Valid - choices: b, k, kb, m, mb, g, gb, t, tb, p, pb + :arg bytes: The unit in which to display byte values. Valid + choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", @@ -119,10 +119,10 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", _make_path("_cat", "count", index), params=params, headers=headers @@ -137,13 +137,13 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices: d, h, m, s, ms, micros, nanos - :arg ts: Set to false to disable timestamping. (default: True) - :arg v: Verbose mode. Display column headers. (default: false) + :arg time: The unit in which to display time values. Valid + choices are d, h, m, s, ms, micros, nanos. + :arg ts: Set to false to disable timestamping. Default is True. + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", "/_cat/health", params=params, headers=headers @@ -155,7 +155,7 @@ class CatClient(NamespacedClient): Returns help for the Cat APIs. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg s: Comma-separated list of column names or column aliases to sort by. """ @@ -187,35 +187,35 @@ class CatClient(NamespacedClient): :arg index: Comma-separated list of indices to limit the returned information. - :arg bytes: The unit in which to display byte values. Valid - choices: b, k, kb, m, mb, g, gb, t, tb, p, pb + :arg bytes: The unit in which to display byte values. Valid + choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: all, - open, closed, hidden, none + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. :arg health: Health status ('green', 'yellow', or 'red') to - filter only indices matching the specified health status. Valid - choices: green, yellow, red - :arg help: Return help information. (default: false) + filter only indices matching the specified health status. Valid choices + are green, yellow, red. + :arg help: Return help information. Default is false. :arg include_unloaded_segments: If set to true segment stats will include stats for segments that are not currently loaded into - memory. (default: false) + memory. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg pri: Set to true to return stats only for primary shards. - (default: false) + Default is false. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices: d, h, m, s, ms, micros, nanos - :arg v: Verbose mode. Display column headers. (default: false) + :arg time: The unit in which to display time values. Valid + choices are d, h, m, s, ms, micros, nanos. + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", _make_path("_cat", "indices", index), params=params, headers=headers @@ -241,15 +241,15 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ from warnings import warn @@ -280,15 +280,15 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", "/_cat/cluster_manager", params=params, headers=headers @@ -312,27 +312,27 @@ class CatClient(NamespacedClient): Returns basic statistics about performance of cluster nodes. - :arg bytes: The unit in which to display byte values. Valid - choices: b, k, kb, m, mb, g, gb, t, tb, p, pb + :arg bytes: The unit in which to display byte values. Valid + choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg format: A short version of the Accept header, e.g. json, yaml. :arg full_id: Return the full node ID instead of the shortened - version. (default: false) + version. Default is false. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local (Deprecated: This parameter does not cause this API - to act locally): Return local information, do not retrieve the state - from cluster-manager node. (default: false) + to act locally.): Return local information, do not retrieve the state + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices: d, h, m, s, ms, micros, nanos - :arg v: Verbose mode. Display column headers. (default: false) + :arg time: The unit in which to display time values. Valid + choices are d, h, m, s, ms, micros, nanos. + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", "/_cat/nodes", params=params, headers=headers @@ -349,20 +349,20 @@ class CatClient(NamespacedClient): :arg index: Comma-separated list or wildcard expression of index names to limit the returned information. :arg active_only: If `true`, the response only includes ongoing - shard recoveries. (default: false) - :arg bytes: The unit in which to display byte values. Valid - choices: b, k, kb, m, mb, g, gb, t, tb, p, pb + shard recoveries. Default is false. + :arg bytes: The unit in which to display byte values. Valid + choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg detailed: If `true`, the response includes detailed - information about shard recoveries. (default: false) + information about shard recoveries. Default is false. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices: d, h, m, s, ms, micros, nanos - :arg v: Verbose mode. Display column headers. (default: false) + :arg time: The unit in which to display time values. Valid + choices are d, h, m, s, ms, micros, nanos. + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", _make_path("_cat", "recovery", index), params=params, headers=headers @@ -387,24 +387,24 @@ class CatClient(NamespacedClient): :arg index: Comma-separated list of indices to limit the returned information. - :arg bytes: The unit in which to display byte values. Valid - choices: b, k, kb, m, mb, g, gb, t, tb, p, pb + :arg bytes: The unit in which to display byte values. Valid + choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices: d, h, m, s, ms, micros, nanos - :arg v: Verbose mode. Display column headers. (default: false) + :arg time: The unit in which to display time values. Valid + choices are d, h, m, s, ms, micros, nanos. + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", _make_path("_cat", "shards", index), params=params, headers=headers @@ -427,20 +427,20 @@ class CatClient(NamespacedClient): :arg index: Comma-separated list of indices to limit the returned information. - :arg bytes: The unit in which to display byte values. Valid - choices: b, k, kb, m, mb, g, gb, t, tb, p, pb + :arg bytes: The unit in which to display byte values. Valid + choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", _make_path("_cat", "segments", index), params=params, headers=headers @@ -467,17 +467,17 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices: d, h, m, s, ms, micros, nanos - :arg v: Verbose mode. Display column headers. (default: false) + :arg time: The unit in which to display time values. Valid + choices are d, h, m, s, ms, micros, nanos. + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", "/_cat/pending_tasks", params=params, headers=headers @@ -507,16 +507,16 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. :arg size: The multiplier in which to display values. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", @@ -534,15 +534,15 @@ class CatClient(NamespacedClient): :arg fields: Comma-separated list of fields to return in the output. - :arg bytes: The unit in which to display byte values. Valid - choices: b, k, kb, m, mb, g, gb, t, tb, p, pb + :arg bytes: The unit in which to display byte values. Valid + choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", @@ -571,15 +571,15 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", "/_cat/plugins", params=params, headers=headers @@ -605,15 +605,15 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", "/_cat/nodeattrs", params=params, headers=headers @@ -639,15 +639,15 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", "/_cat/repositories", params=params, headers=headers @@ -675,17 +675,18 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed). (default: false) + should be ignored when unavailable (missing or closed). Default is + false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices: d, h, m, s, ms, micros, nanos - :arg v: Verbose mode. Display column headers. (default: false) + :arg time: The unit in which to display time values. Valid + choices are d, h, m, s, ms, micros, nanos. + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", @@ -714,12 +715,12 @@ class CatClient(NamespacedClient): :arg actions: Comma-separated list of actions that should be returned. Leave empty to return all. - :arg detailed: Return detailed task information. (default: - false) + :arg detailed: Return detailed task information. Default is + false. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :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 @@ -728,9 +729,9 @@ class CatClient(NamespacedClient): (node_id:task_number). Set to -1 to return all. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg time: The unit in which to display time values. Valid - choices: d, h, m, s, ms, micros, nanos - :arg v: Verbose mode. Display column headers. (default: false) + :arg time: The unit in which to display time values. Valid + choices are d, h, m, s, ms, micros, nanos. + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", "/_cat/tasks", params=params, headers=headers @@ -757,15 +758,15 @@ class CatClient(NamespacedClient): :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg s: Comma-separated list of column names or column aliases to sort by. - :arg v: Verbose mode. Display column headers. (default: false) + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", _make_path("_cat", "templates", name), params=params, headers=headers @@ -787,7 +788,6 @@ class CatClient(NamespacedClient): List segments for one or several PITs. - :arg body: """ return self.transport.perform_request( "GET", "/_cat/pit_segments", params=params, headers=headers, body=body @@ -815,23 +815,23 @@ class CatClient(NamespacedClient): :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: false) - :arg bytes: The unit in which to display byte values. Valid - choices: b, k, kb, m, mb, g, gb, t, tb, p, pb + segment replication events. Default is false. + :arg bytes: The unit in which to display byte values. Valid + choices are b, k, kb, m, mb, g, gb, t, tb, p, pb. :arg completed_only: If `true`, the response only includes - latest completed segment replication events. (default: false) + latest completed segment replication events. Default is false. :arg detailed: If `true`, the response includes detailed - information about segment replications. (default: false) + information about segment replications. Default is false. :arg format: A short version of the Accept header, e.g. json, yaml. :arg h: Comma-separated list of column names to display. - :arg help: Return help information. (default: false) + :arg help: Return help information. Default is false. :arg s: Comma-separated list of column names or column aliases to sort by. :arg shards: Comma-separated list of shards to display. - :arg time: The unit in which to display time values. Valid - choices: d, h, m, s, ms, micros, nanos - :arg v: Verbose mode. Display column headers. (default: false) + :arg time: The unit in which to display time values. Valid + choices are d, h, m, s, ms, micros, nanos. + :arg v: Verbose mode. Display column headers. Default is false. """ return self.transport.perform_request( "GET", diff --git a/opensearchpy/client/cluster.py b/opensearchpy/client/cluster.py index 28f1f0e8..f2276261 100644 --- a/opensearchpy/client/cluster.py +++ b/opensearchpy/client/cluster.py @@ -65,22 +65,22 @@ class ClusterClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: all, - open, closed, hidden, none + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg level: Specify the level of detail for returned - information. Valid choices: cluster, indices, shards, - awareness_attributes + information. Valid choices are cluster, indices, shards, + awareness_attributes. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg timeout: Operation timeout. :arg wait_for_active_shards: Wait until the specified number of shards is active. :arg wait_for_events: Wait until all currently queued events - with the given priority are processed. Valid choices: immediate, - urgent, high, normal, low, languid + with the given priority are processed. Valid choices are immediate, + urgent, high, normal, low, languid. :arg wait_for_no_initializing_shards: Whether to wait until there are no initializing shards in the cluster. :arg wait_for_no_relocating_shards: Whether to wait until there @@ -88,7 +88,7 @@ class ClusterClient(NamespacedClient): :arg wait_for_nodes: Wait until the specified number of nodes is available. :arg wait_for_status: Wait until cluster is in a specific state. - Valid choices: green, yellow, red + Valid choices are green, yellow, red. """ return self.transport.perform_request( "GET", @@ -107,10 +107,10 @@ class ClusterClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return self.transport.perform_request( "GET", "/_cluster/pending_tasks", params=params, headers=headers @@ -133,8 +133,8 @@ class ClusterClient(NamespacedClient): :arg metric: Limit the information returned to the specified - metrics. Valid choices: _all, blocks, metadata, nodes, routing_table, - routing_nodes, master_node, cluster_manager_node, version + metrics. Valid choices are _all, blocks, metadata, nodes, routing_table, + routing_nodes, master_node, cluster_manager_node, version. :arg index: Comma-separated list of indices; use `_all` or empty string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices @@ -143,17 +143,17 @@ class ClusterClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: all, - open, closed, hidden, none - :arg flat_settings: Return settings in flat format. (default: - false) + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg flat_settings: Return settings in flat format. Default is + false. :arg ignore_unavailable: Whether specified concrete indices should be ignored when unavailable (missing or closed). :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg wait_for_metadata_version: Wait for the metadata version to be equal or greater than the specified metadata version. :arg wait_for_timeout: The maximum time to wait for @@ -179,8 +179,8 @@ class ClusterClient(NamespacedClient): the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes. - :arg flat_settings: Return settings in flat format. (default: - false) + :arg flat_settings: Return settings in flat format. Default is + false. :arg timeout: Operation timeout. """ return self.transport.perform_request( @@ -215,8 +215,8 @@ class ClusterClient(NamespacedClient): :arg explain: Return an explanation of why the commands can or cannot be executed. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg metric: Limit the information returned to the specified metrics. Defaults to all but metadata. :arg retry_failed: Retries allocation of shards that are blocked @@ -241,13 +241,13 @@ class ClusterClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. (default: - false) + :arg flat_settings: Return settings in flat format. Default is + false. :arg include_defaults: Whether to return all default clusters - setting. (default: false) + setting. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg timeout: Operation timeout. """ return self.transport.perform_request( @@ -266,11 +266,11 @@ class ClusterClient(NamespacedClient): or `persistent` (survives cluster restart). :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. - :arg flat_settings: Return settings in flat format. (default: - false) + :arg flat_settings: Return settings in flat format. Default is + false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg timeout: Operation timeout. """ if body in SKIP_IN_PATH: @@ -299,9 +299,9 @@ class ClusterClient(NamespacedClient): :arg body: The index, shard, and primary flag to explain. Empty means 'explain the first unassigned shard' :arg include_disk_info: Return information about disk usage and - shard sizes. (default: false) + shard sizes. Default is false. :arg include_yes_decisions: Return 'YES' decisions in - explanation. (default: false) + explanation. Default is false. """ return self.transport.perform_request( "POST", @@ -321,8 +321,8 @@ class ClusterClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg timeout: Operation timeout. """ if name in SKIP_IN_PATH: @@ -345,10 +345,10 @@ class ClusterClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return self.transport.perform_request( "GET", @@ -368,10 +368,10 @@ class ClusterClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg create: Whether the index template should only be added if - new or can also replace an existing one. (default: false) + new or can also replace an existing one. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg timeout: Operation timeout. """ for param in (name, body): @@ -386,18 +386,20 @@ class ClusterClient(NamespacedClient): body=body, ) - @query_params("local", "master_timeout") + @query_params("cluster_manager_timeout", "local", "master_timeout") def exists_component_template(self, name, params=None, headers=None): """ Returns information about whether a particular component template exist. :arg name: The name of the template. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg local: Return local information, do not retrieve the state - from cluster-manager node. (default: false) + from cluster-manager node. Default is false. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -417,7 +419,7 @@ class ClusterClient(NamespacedClient): :arg wait_for_removal: Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting - configuration exclusions list. (default: True) + configuration exclusions list. Default is True. """ return self.transport.perform_request( "DELETE", diff --git a/opensearchpy/client/cluster.pyi b/opensearchpy/client/cluster.pyi index ccc3737a..7ea5016f 100644 --- a/opensearchpy/client/cluster.pyi +++ b/opensearchpy/client/cluster.pyi @@ -300,6 +300,7 @@ class ClusterClient(NamespacedClient): self, name: Any, *, + cluster_manager_timeout: Optional[Any] = ..., local: Optional[Any] = ..., master_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., diff --git a/opensearchpy/client/dangling_indices.py b/opensearchpy/client/dangling_indices.py index b04698ad..7cb3ea34 100644 --- a/opensearchpy/client/dangling_indices.py +++ b/opensearchpy/client/dangling_indices.py @@ -53,8 +53,8 @@ class DanglingIndicesClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg timeout: Operation timeout. """ if index_uuid in SKIP_IN_PATH: @@ -81,8 +81,8 @@ class DanglingIndicesClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg timeout: Operation timeout. """ if index_uuid in SKIP_IN_PATH: diff --git a/opensearchpy/client/indices.py b/opensearchpy/client/indices.py index 138692e1..9db06dd6 100644 --- a/opensearchpy/client/indices.py +++ b/opensearchpy/client/indices.py @@ -25,6 +25,16 @@ # under the License. +# ---------------------------------------------------- +# THIS CODE IS GENERATED AND MANUAL EDITS WILL BE LOST. +# +# To contribute, kindly make essential modifications through either the "opensearch-py client generator": +# https://github.com/opensearch-project/opensearch-py/blob/main/utils/generate-api.py +# or the "OpenSearch API specification" available at: +# https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json +# ----------------------------------------------------- + + from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params @@ -38,7 +48,7 @@ class IndicesClient(NamespacedClient): :arg body: Define analyzer/tokenizer parameters and the text on which the analysis should be performed - :arg index: The name of the index to scope the operation + :arg index: The name of the index to scope the operation. """ return self.transport.perform_request( "POST", @@ -54,16 +64,16 @@ class IndicesClient(NamespacedClient): Performs the refresh operation in one or more indices. - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). """ return self.transport.perform_request( "POST", _make_path(index, "_refresh"), params=params, headers=headers @@ -81,44 +91,47 @@ class IndicesClient(NamespacedClient): Performs the flush operation on one or more indices. - :arg index: A comma-separated list of index names; use `_all` or - empty string for all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg force: Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as - internal) + internal). :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg wait_if_ongoing: If set to true the flush operation will block until the flush can be executed if another flush operation is - already executing. The default is true. If set to false the flush will - be skipped iff if another flush operation is already running. + already executing. If set to false the flush will be skipped iff if + another flush operation is already running. Default is True. """ return self.transport.perform_request( "POST", _make_path(index, "_flush"), params=params, headers=headers ) @query_params( - "master_timeout", "cluster_manager_timeout", "timeout", "wait_for_active_shards" + "cluster_manager_timeout", "master_timeout", "timeout", "wait_for_active_shards" ) def create(self, index, body=None, params=None, headers=None): """ Creates an index with optional settings and mappings. - :arg index: The name of the index + :arg index: Index name. :arg body: The configuration for the index (`settings` and `mappings`) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. :arg wait_for_active_shards: Set the number of active shards to wait for before the operation returns. """ @@ -130,20 +143,23 @@ class IndicesClient(NamespacedClient): ) @query_params( - "master_timeout", "cluster_manager_timeout", "timeout", "wait_for_active_shards" + "cluster_manager_timeout", "master_timeout", "timeout", "wait_for_active_shards" ) def clone(self, index, target, body=None, params=None, headers=None): """ - Clones an index + Clones an index. - :arg index: The name of the source index to clone - :arg target: The name of the target index to clone into + :arg index: The name of the source index to clone. + :arg target: The name of the target index. :arg body: The configuration for the target index (`settings` and `aliases`) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. :arg wait_for_active_shards: Set the number of active shards to wait for on the cloned index before the operation returns. """ @@ -161,35 +177,40 @@ class IndicesClient(NamespacedClient): @query_params( "allow_no_indices", + "cluster_manager_timeout", "expand_wildcards", "flat_settings", "ignore_unavailable", "include_defaults", "local", "master_timeout", - "cluster_manager_timeout", ) def get(self, index, params=None, headers=None): """ Returns information about one or more indices. - :arg index: A comma-separated list of index names - :arg allow_no_indices: Ignore if a wildcard expression resolves - to no concrete indices (default: false) - :arg expand_wildcards: Whether wildcard expressions should get - expanded to open or closed indices (default: open) Valid choices: open, - closed, hidden, none, all Default: open - :arg flat_settings: Return settings in flat format (default: - false) - :arg ignore_unavailable: Ignore unavailable indexes (default: - false) + :arg index: Comma-separated list of indices. + :arg allow_no_indices: Whether to ignore if a wildcard indices + expression resolves into no concrete indices. (This includes `_all` + string or when no indices have been specified). Default is false. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg expand_wildcards: Whether to expand wildcard expression to + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg flat_settings: Return settings in flat format. Default is + false. + :arg ignore_unavailable: Whether specified concrete indices + should be ignored when unavailable (missing or closed). Default is + false. :arg include_defaults: Whether to return all default setting for - each of the indices. + each of the indices. Default is false. :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + from cluster-manager node. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -200,10 +221,10 @@ class IndicesClient(NamespacedClient): @query_params( "allow_no_indices", + "cluster_manager_timeout", "expand_wildcards", "ignore_unavailable", "master_timeout", - "cluster_manager_timeout", "timeout", "wait_for_active_shards", ) @@ -212,18 +233,21 @@ class IndicesClient(NamespacedClient): Opens an index. - :arg index: A comma separated list of indices to open + :arg index: Comma-separated list of indices to open. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: closed + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + should be ignored when unavailable (missing or closed). + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. :arg wait_for_active_shards: Sets the number of active shards to wait for before the operation returns. """ @@ -236,10 +260,10 @@ class IndicesClient(NamespacedClient): @query_params( "allow_no_indices", + "cluster_manager_timeout", "expand_wildcards", "ignore_unavailable", "master_timeout", - "cluster_manager_timeout", "timeout", "wait_for_active_shards", ) @@ -248,22 +272,23 @@ class IndicesClient(NamespacedClient): Closes an index. - :arg index: A comma separated list of indices to close + :arg index: Comma-separated list of indices to close. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + should be ignored when unavailable (missing or closed). + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. :arg wait_for_active_shards: Sets the number of active shards to - wait for before the operation returns. Set to `index-setting` to wait - according to the index setting `index.write.wait_for_active_shards`, or - `all` to wait for all shards, or an integer. Defaults to `0`. + wait for before the operation returns. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -274,10 +299,10 @@ class IndicesClient(NamespacedClient): @query_params( "allow_no_indices", + "cluster_manager_timeout", "expand_wildcards", "ignore_unavailable", "master_timeout", - "cluster_manager_timeout", "timeout", ) def delete(self, index, params=None, headers=None): @@ -285,18 +310,23 @@ class IndicesClient(NamespacedClient): Deletes an index. - :arg index: A comma-separated list of indices to delete; use - `_all` or `*` string to delete all indices - :arg allow_no_indices: Ignore if a wildcard expression resolves - to no concrete indices (default: false) - :arg expand_wildcards: Whether wildcard expressions should get - expanded to open or closed indices (default: open) Valid choices: open, - closed, hidden, none, all Default: open - :arg ignore_unavailable: Ignore unavailable indexes (default: - false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + :arg index: Comma-separated list of indices to delete; use + `_all` or `*` string to delete all indices. + :arg allow_no_indices: Whether to ignore if a wildcard indices + expression resolves into no concrete indices. (This includes `_all` + string or when no indices have been specified). Default is false. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg expand_wildcards: Whether to expand wildcard expression to + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg ignore_unavailable: Whether specified concrete indices + should be ignored when unavailable (missing or closed). Default is + false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -318,20 +348,22 @@ class IndicesClient(NamespacedClient): Returns information about whether a particular index exists. - :arg index: A comma-separated list of index names - :arg allow_no_indices: Ignore if a wildcard expression resolves - to no concrete indices (default: false) - :arg expand_wildcards: Whether wildcard expressions should get - expanded to open or closed indices (default: open) Valid choices: open, - closed, hidden, none, all Default: open - :arg flat_settings: Return settings in flat format (default: - false) - :arg ignore_unavailable: Ignore unavailable indexes (default: - false) + :arg index: Comma-separated list of indices. + :arg allow_no_indices: Whether to ignore if a wildcard indices + expression resolves into no concrete indices. (This includes `_all` + string or when no indices have been specified). Default is false. + :arg expand_wildcards: Whether to expand wildcard expression to + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg flat_settings: Return settings in flat format. Default is + false. + :arg ignore_unavailable: Whether specified concrete indices + should be ignored when unavailable (missing or closed). Default is + false. :arg include_defaults: Whether to return all default setting for - each of the indices. + each of the indices. Default is false. :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) + from cluster-manager node. Default is false. """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") @@ -342,10 +374,10 @@ class IndicesClient(NamespacedClient): @query_params( "allow_no_indices", + "cluster_manager_timeout", "expand_wildcards", "ignore_unavailable", "master_timeout", - "cluster_manager_timeout", "timeout", "write_index_only", ) @@ -355,22 +387,24 @@ class IndicesClient(NamespacedClient): :arg body: The mapping definition - :arg index: A comma-separated list of index names the mapping - should be added to (supports wildcards); use `_all` or omit to add the - mapping on all indices. + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + should be ignored when unavailable (missing or closed). + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. :arg write_index_only: When true, applies mappings only to the - write index of an alias or data stream + write index of an alias or data stream. Default is false. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -388,36 +422,37 @@ class IndicesClient(NamespacedClient): @query_params( "allow_no_indices", + "cluster_manager_timeout", "expand_wildcards", "ignore_unavailable", "local", "master_timeout", - "cluster_manager_timeout", ) def get_mapping(self, index=None, params=None, headers=None): """ Returns mappings for one or more indices. - :arg index: A comma-separated list of index names + :arg index: Comma-separated list of indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + should be ignored when unavailable (missing or closed). + :arg local (Deprecated: This parameter is a no-op and field + mappings are always retrieved locally.): Return local information, do + not retrieve the state from cluster-manager node. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return self.transport.perform_request( - "GET", - _make_path(index, "_mapping"), - params=params, - headers=headers, + "GET", _make_path(index, "_mapping"), params=params, headers=headers ) @query_params( @@ -432,20 +467,20 @@ class IndicesClient(NamespacedClient): Returns mapping for one or more fields. - :arg fields: A comma-separated list of fields - :arg index: A comma-separated list of index names + :arg fields: Comma-separated list of fields. + :arg index: Comma-separated list of indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg include_defaults: Whether the default mapping values should - be returned as well + be returned as well. :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) + from cluster-manager node. Default is false. """ if fields in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'fields'.") @@ -457,21 +492,23 @@ class IndicesClient(NamespacedClient): headers=headers, ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") def put_alias(self, index, name, body=None, params=None, headers=None): """ Creates or updates an alias. - :arg index: A comma-separated list of index names the alias - should point to (supports wildcards); use `_all` to perform the - operation on all indices. - :arg name: The name of the alias to be created or updated + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. + :arg name: The name of the alias to be created or updated. :arg body: The settings for the alias, such as `routing` or `filter` - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit timestamp for the document + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ for param in (index, name): if param in SKIP_IN_PATH: @@ -491,19 +528,18 @@ class IndicesClient(NamespacedClient): Returns information about whether a particular alias exists. - :arg name: A comma-separated list of alias names to return - :arg index: A comma-separated list of index names to filter - aliases + :arg name: Comma-separated list of alias names. + :arg index: Comma-separated list of indices to filter aliases. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: all + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) + from cluster-manager node. Default is false. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -518,34 +554,36 @@ class IndicesClient(NamespacedClient): Returns an alias. - :arg index: A comma-separated list of index names to filter - aliases - :arg name: A comma-separated list of alias names to return + :arg index: Comma-separated list of indices to filter aliases. + :arg name: Comma-separated list of alias names. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: all + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) + from cluster-manager node. Default is false. """ return self.transport.perform_request( "GET", _make_path(index, "_alias", name), params=params, headers=headers ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") def update_aliases(self, body, params=None, headers=None): """ Updates index aliases. :arg body: The definition of `actions` to perform - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Request timeout + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -554,19 +592,22 @@ class IndicesClient(NamespacedClient): "POST", "/_aliases", params=params, headers=headers, body=body ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") def delete_alias(self, index, name, params=None, headers=None): """ Deletes an alias. - :arg index: A comma-separated list of index names (supports - wildcards); use `_all` for all indices - :arg name: A comma-separated list of aliases to delete (supports + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. + :arg name: Comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit timestamp for the document + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ for param in (index, name): if param in SKIP_IN_PATH: @@ -576,21 +617,24 @@ class IndicesClient(NamespacedClient): "DELETE", _make_path(index, "_alias", name), params=params, headers=headers ) - @query_params("create", "master_timeout", "cluster_manager_timeout", "order") + @query_params("cluster_manager_timeout", "create", "master_timeout", "order") def put_template(self, name, body, params=None, headers=None): """ Creates or updates an index template. - :arg name: The name of the template + :arg name: The name of the template. :arg body: The template definition + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg create: Whether the index template should only be added if - new or can also replace an existing one - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + new or can also replace an existing one. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg order: The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower - numbers) + numbers). """ for param in (name, body): if param in SKIP_IN_PATH: @@ -604,21 +648,22 @@ class IndicesClient(NamespacedClient): body=body, ) - @query_params("flat_settings", "local", "master_timeout", "cluster_manager_timeout") + @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") def exists_template(self, name, params=None, headers=None): """ Returns information about whether a particular index template exists. - :arg name: The comma separated names of the index templates - :arg flat_settings: Return settings in flat format (default: - false) + :arg name: Comma-separated names of the index templates. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg flat_settings: Return settings in flat format. Default is + false. :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + from cluster-manager node. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -627,36 +672,40 @@ class IndicesClient(NamespacedClient): "HEAD", _make_path("_template", name), params=params, headers=headers ) - @query_params("flat_settings", "local", "master_timeout", "cluster_manager_timeout") + @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") def get_template(self, name=None, params=None, headers=None): """ Returns an index template. - :arg name: The comma separated names of the index templates - :arg flat_settings: Return settings in flat format (default: - false) + :arg name: Comma-separated names of the index templates. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg flat_settings: Return settings in flat format. Default is + false. :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + from cluster-manager node. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return self.transport.perform_request( "GET", _make_path("_template", name), params=params, headers=headers ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") def delete_template(self, name, params=None, headers=None): """ Deletes an index template. - :arg name: The name of the template - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + :arg name: The name of the template. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -667,38 +716,41 @@ class IndicesClient(NamespacedClient): @query_params( "allow_no_indices", + "cluster_manager_timeout", "expand_wildcards", "flat_settings", "ignore_unavailable", "include_defaults", "local", "master_timeout", - "cluster_manager_timeout", ) def get_settings(self, index=None, name=None, params=None, headers=None): """ Returns settings for one or more indices. - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices - :arg name: The name of the settings that should be included + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. + :arg name: Comma-separated list of settings. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: all - :arg flat_settings: Return settings in flat format (default: - false) + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg flat_settings: Return settings in flat format. Default is + false. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg include_defaults: Whether to return all default setting for - each of the indices. + each of the indices. Default is false. :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + from cluster-manager node. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return self.transport.perform_request( "GET", _make_path(index, "_settings", name), params=params, headers=headers @@ -706,11 +758,11 @@ class IndicesClient(NamespacedClient): @query_params( "allow_no_indices", + "cluster_manager_timeout", "expand_wildcards", "flat_settings", "ignore_unavailable", "master_timeout", - "cluster_manager_timeout", "preserve_existing", "timeout", ) @@ -720,24 +772,27 @@ class IndicesClient(NamespacedClient): :arg body: The index settings to be updated - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg flat_settings: Return settings in flat format (default: - false) + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg flat_settings: Return settings in flat format. Default is + false. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + should be ignored when unavailable (missing or closed). + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg preserve_existing: Whether to update existing settings. If - set to `true` existing settings on an index remain unchanged, the - default is `false` - :arg timeout: Explicit operation timeout + set to `true` existing settings on an index remain unchanged. Default is + false. + :arg timeout: Operation timeout. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -760,43 +815,40 @@ class IndicesClient(NamespacedClient): "include_segment_file_sizes", "include_unloaded_segments", "level", - "types", ) def stats(self, index=None, metric=None, params=None, headers=None): """ Provides statistics on operations happening in an index. - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg metric: Limit the information returned the specific - metrics. Valid choices: _all, completion, docs, fielddata, query_cache, - flush, get, indexing, merge, request_cache, refresh, search, segments, - store, warmer, suggest - :arg completion_fields: A comma-separated list of fields for - `fielddata` and `suggest` index metric (supports wildcards) + metrics. Valid choices are _all, store, indexing, get, search, merge, + flush, refresh, query_cache, fielddata, docs, warmer, completion, + segments, translog, suggest, request_cache, recovery. + :arg completion_fields: Comma-separated list of fields for + `fielddata` and `suggest` index metric (supports wildcards). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg fielddata_fields: A comma-separated list of fields for - `fielddata` index metric (supports wildcards) - :arg fields: A comma-separated list of fields for `fielddata` - and `completion` index metric (supports wildcards) + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg fielddata_fields: Comma-separated list of fields for + `fielddata` index metric (supports wildcards). + :arg fields: Comma-separated list of fields for `fielddata` and + `completion` index metric (supports wildcards). :arg forbid_closed_indices: If set to false stats will also collected from closed indices if explicitly specified or if - expand_wildcards expands to closed indices Default: True - :arg groups: A comma-separated list of search groups for - `search` index metric + expand_wildcards expands to closed indices. Default is True. + :arg groups: Comma-separated list of search groups for `search` + index metric. :arg include_segment_file_sizes: Whether to report the aggregated disk usage of each one of the Lucene index files (only - applies if segment stats are requested) + applies if segment stats are requested). Default is false. :arg include_unloaded_segments: If set to true segment stats will include stats for segments that are not currently loaded into - memory + memory. Default is false. :arg level: Return stats aggregated at cluster, index or shard - level Valid choices: cluster, indices, shards Default: indices - :arg types: A comma-separated list of document types for the - `indexing` index metric + level. Valid choices are cluster, indices, shards. """ return self.transport.perform_request( "GET", _make_path(index, "_stats", metric), params=params, headers=headers @@ -810,17 +862,18 @@ class IndicesClient(NamespacedClient): Provides low-level information about segments in a Lucene index. - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg verbose: Includes detailed memory usage by Lucene. + should be ignored when unavailable (missing or closed). + :arg verbose: Includes detailed memory usage by Lucene. Default + is false. """ return self.transport.perform_request( "GET", _make_path(index, "_segments"), params=params, headers=headers @@ -846,32 +899,29 @@ class IndicesClient(NamespacedClient): :arg body: The query definition specified with the Query DSL - :arg index: A comma-separated list of index names to restrict - the operation; use `_all` or empty string to perform the operation on - all indices - restrict the operation; leave empty to perform the operation on all - types + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg all_shards: Execute validation on all shards instead of one - random shard per index + random shard per index. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg analyze_wildcard: Specify whether wildcard and prefix - queries should be analyzed (default: false) - :arg analyzer: The analyzer to use for the query string + queries should be analyzed. Default is false. + :arg analyzer: The analyzer to use for the query string. :arg default_operator: The default operator for query string - query (AND or OR) Valid choices: AND, OR Default: OR + query (AND or OR). Valid choices are AND, OR. :arg df: The field to use as default where no field prefix is - given in the query string + given in the query string. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg explain: Return detailed information about the error + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg explain: Return detailed information about the error. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg lenient: Specify whether format-based query failures (such - as providing text to a numeric field) should be ignored - :arg q: Query in the Lucene query string syntax + as providing text to a numeric field) should be ignored. + :arg q: Query in the Lucene query string syntax. :arg rewrite: Provide a more detailed explanation showing the actual Lucene query that will be executed. """ @@ -897,21 +947,21 @@ class IndicesClient(NamespacedClient): Clears all or specific caches for one or more indices. - :arg index: A comma-separated list of index name to limit the - operation + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg fielddata: Clear field data - :arg fields: A comma-separated list of fields to clear when - using the `fielddata` parameter (default: all) + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. + :arg fielddata: Clear field data. + :arg fields: Comma-separated list of fields to clear when using + the `fielddata` parameter (default: all). :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg query: Clear query caches - :arg request: Clear request cache + should be ignored when unavailable (missing or closed). + :arg query: Clear query caches. + :arg request: Clear request cache. """ return self.transport.perform_request( "POST", _make_path(index, "_cache", "clear"), params=params, headers=headers @@ -923,12 +973,12 @@ class IndicesClient(NamespacedClient): Returns information about ongoing index shard recoveries. - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg active_only: Display only those recoveries that are - currently on-going + currently on-going. Default is false. :arg detailed: Whether to display detailed information about - shard recovery + shard recovery. Default is false. """ return self.transport.perform_request( "GET", _make_path(index, "_recovery"), params=params, headers=headers @@ -943,23 +993,23 @@ class IndicesClient(NamespacedClient): ) def upgrade(self, index=None, params=None, headers=None): """ - DEPRECATED Upgrades to the current version of Lucene. + The _upgrade API is no longer useful and will be removed. - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg only_ancient_segments: If true, only ancient (an older - Lucene major release) segments will be upgraded - :arg wait_for_completion: Specify whether the request should - block until the all segments are upgraded (default: false) + Lucene major release) segments will be upgraded. + :arg wait_for_completion: Should this request wait until the + operation has completed before returning. Default is false. """ return self.transport.perform_request( "POST", _make_path(index, "_upgrade"), params=params, headers=headers @@ -968,49 +1018,24 @@ class IndicesClient(NamespacedClient): @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") def get_upgrade(self, index=None, params=None, headers=None): """ - DEPRECATED Returns a progress status of current upgrade. + The _upgrade API is no longer useful and will be removed. - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). """ return self.transport.perform_request( "GET", _make_path(index, "_upgrade"), params=params, headers=headers ) - @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") - def flush_synced(self, index=None, params=None, headers=None): - """ - Performs a synced flush operation on one or more indices. Synced flush is - deprecated. Use flush instead - - - :arg index: A comma-separated list of index names; use `_all` or - empty string for all indices - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, none, all Default: open - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - """ - return self.transport.perform_request( - "POST", - _make_path(index, "_flush", "synced"), - params=params, - headers=headers, - ) - @query_params( "allow_no_indices", "expand_wildcards", "ignore_unavailable", "status" ) @@ -1019,19 +1044,18 @@ class IndicesClient(NamespacedClient): Provides store information for shard copies of indices. - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg status: A comma-separated list of statuses used to filter - on shards to get store information for Valid choices: green, yellow, - red, all + should be ignored when unavailable (missing or closed). + :arg status: Comma-separated list of statuses used to filter on + shards to get store information for. """ return self.transport.perform_request( "GET", _make_path(index, "_shard_stores"), params=params, headers=headers @@ -1050,31 +1074,31 @@ class IndicesClient(NamespacedClient): Performs the force merge operation on one or more indices. - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices + :arg index: Comma-separated list of indices; use `_all` or empty + string to perform the operation on all indices. :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg flush: Specify whether the index should be flushed after - performing the operation (default: true) + performing the operation. Default is True. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) + should be ignored when unavailable (missing or closed). :arg max_num_segments: The number of segments the index should - be merged into (default: dynamic) + be merged into (default: dynamic). :arg only_expunge_deletes: Specify whether the operation should - only expunge deleted documents + only expunge deleted documents. """ return self.transport.perform_request( "POST", _make_path(index, "_forcemerge"), params=params, headers=headers ) @query_params( + "cluster_manager_timeout", "copy_settings", "master_timeout", - "cluster_manager_timeout", "timeout", "wait_for_active_shards", ) @@ -1083,15 +1107,18 @@ class IndicesClient(NamespacedClient): Allow to shrink an existing index into a new index with fewer primary shards. - :arg index: The name of the source index to shrink - :arg target: The name of the target index to shrink into + :arg index: The name of the source index to shrink. + :arg target: The name of the target index. :arg body: The configuration for the target index (`settings` and `aliases`) + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg copy_settings: whether or not to copy settings from the - source index (defaults to false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + source index. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. :arg wait_for_active_shards: Set the number of active shards to wait for on the shrunken index before the operation returns. """ @@ -1108,9 +1135,9 @@ class IndicesClient(NamespacedClient): ) @query_params( + "cluster_manager_timeout", "copy_settings", "master_timeout", - "cluster_manager_timeout", "timeout", "wait_for_active_shards", ) @@ -1120,15 +1147,18 @@ class IndicesClient(NamespacedClient): shards. - :arg index: The name of the source index to split - :arg target: The name of the target index to split into + :arg index: The name of the source index to split. + :arg target: The name of the target index. :arg body: The configuration for the target index (`settings` and `aliases`) + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg copy_settings: whether or not to copy settings from the - source index (defaults to false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + source index. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. :arg wait_for_active_shards: Set the number of active shards to wait for on the shrunken index before the operation returns. """ @@ -1145,9 +1175,9 @@ class IndicesClient(NamespacedClient): ) @query_params( + "cluster_manager_timeout", "dry_run", "master_timeout", - "cluster_manager_timeout", "timeout", "wait_for_active_shards", ) @@ -1157,16 +1187,19 @@ class IndicesClient(NamespacedClient): to be too large or too old. - :arg alias: The name of the alias to rollover + :arg alias: The name of the alias to rollover. :arg body: The conditions that needs to be met for executing rollover - :arg new_index: The name of the rollover index + :arg new_index: The name of the rollover index. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg dry_run: If set to true the rollover action will only be - validated but not actually performed even if a condition matches. The - default is false - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + validated but not actually performed even if a condition matches. + Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. :arg wait_for_active_shards: Set the number of active shards to wait for on the newly created rollover index before the operation returns. @@ -1182,133 +1215,34 @@ class IndicesClient(NamespacedClient): body=body, ) - @query_params( - "allow_no_indices", - "expand_wildcards", - "ignore_unavailable", - "master_timeout", - "cluster_manager_timeout", - "timeout", - "wait_for_active_shards", - ) - def freeze(self, index, params=None, headers=None): - """ - Freezes an index. A frozen index has almost no overhead on the cluster (except - for maintaining its metadata in memory) and is read-only. - - - :arg index: The name of the index to freeze - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: closed - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout - :arg wait_for_active_shards: Sets the number of active shards to - wait for before the operation returns. - """ - if index in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'index'.") - - return self.transport.perform_request( - "POST", _make_path(index, "_freeze"), params=params, headers=headers - ) - - @query_params( - "allow_no_indices", - "expand_wildcards", - "ignore_unavailable", - "master_timeout", - "cluster_manager_timeout", - "timeout", - "wait_for_active_shards", - ) - def unfreeze(self, index, params=None, headers=None): - """ - Unfreezes an index. When a frozen index is unfrozen, the index goes through the - normal recovery process and becomes writeable again. - - - :arg index: The name of the index to unfreeze - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: closed - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout - :arg wait_for_active_shards: Sets the number of active shards to - wait for before the operation returns. - """ - if index in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'index'.") - - return self.transport.perform_request( - "POST", _make_path(index, "_unfreeze"), params=params, headers=headers - ) - - @query_params("allow_no_indices", "expand_wildcards", "ignore_unavailable") - def reload_search_analyzers(self, index, params=None, headers=None): - """ - Reloads an index's search analyzers and their resources. - - - :arg index: A comma-separated list of index names to reload - analyzers for - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - """ - if index in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'index'.") - - return self.transport.perform_request( - "GET", - _make_path(index, "_reload_search_analyzers"), - params=params, - headers=headers, - ) - @query_params() - def create_data_stream(self, name, params=None, headers=None): + def create_data_stream(self, name, body=None, params=None, headers=None): """ - Creates a data stream + Creates or updates a data stream. - :arg name: The name of the data stream + :arg name: The name of the data stream. + :arg body: The data stream definition """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") return self.transport.perform_request( - "PUT", _make_path("_data_stream", name), params=params, headers=headers + "PUT", + _make_path("_data_stream", name), + params=params, + headers=headers, + body=body, ) - @query_params("expand_wildcards") + @query_params() def delete_data_stream(self, name, params=None, headers=None): """ Deletes a data stream. - :arg name: A comma-separated list of data streams to delete; use - `*` to delete all data streams - :arg expand_wildcards: Whether wildcard expressions should get - expanded to open or closed indices (default: open) Valid choices: open, - closed, hidden, none, all Default: open + :arg name: Comma-separated list of data streams; use `_all` or + empty string to perform the operation on all data streams. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1317,16 +1251,19 @@ class IndicesClient(NamespacedClient): "DELETE", _make_path("_data_stream", name), params=params, headers=headers ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") def delete_index_template(self, name, params=None, headers=None): """ Deletes an index template. - :arg name: The name of the template - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + :arg name: The name of the template. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1338,21 +1275,22 @@ class IndicesClient(NamespacedClient): headers=headers, ) - @query_params("flat_settings", "local", "master_timeout", "cluster_manager_timeout") + @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") def exists_index_template(self, name, params=None, headers=None): """ Returns information about whether a particular index template exists. - :arg name: The name of the template - :arg flat_settings: Return settings in flat format (default: - false) + :arg name: The name of the template. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg flat_settings: Return settings in flat format. Default is + false. :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + from cluster-manager node. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1361,40 +1299,44 @@ class IndicesClient(NamespacedClient): "HEAD", _make_path("_index_template", name), params=params, headers=headers ) - @query_params("flat_settings", "local", "master_timeout", "cluster_manager_timeout") + @query_params("cluster_manager_timeout", "flat_settings", "local", "master_timeout") def get_index_template(self, name=None, params=None, headers=None): """ Returns an index template. - :arg name: The comma separated names of the index templates - :arg flat_settings: Return settings in flat format (default: - false) + :arg name: Comma-separated names of the index templates. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg flat_settings: Return settings in flat format. Default is + false. :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + from cluster-manager node. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return self.transport.perform_request( "GET", _make_path("_index_template", name), params=params, headers=headers ) - @query_params("cause", "create", "master_timeout", "cluster_manager_timeout") + @query_params("cause", "cluster_manager_timeout", "create", "master_timeout") def put_index_template(self, name, body, params=None, headers=None): """ Creates or updates an index template. - :arg name: The name of the template + :arg name: The name of the template. :arg body: The template definition :arg cause: User defined reason for creating/updating the index - template + template. Default is false. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg create: Whether the index template should only be added if - new or can also replace an existing one - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + new or can also replace an existing one. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ for param in (name, body): if param in SKIP_IN_PATH: @@ -1408,24 +1350,27 @@ class IndicesClient(NamespacedClient): body=body, ) - @query_params("cause", "create", "master_timeout", "cluster_manager_timeout") + @query_params("cause", "cluster_manager_timeout", "create", "master_timeout") def simulate_index_template(self, name, body=None, params=None, headers=None): """ Simulate matching the given index name against the index templates in the - system + system. :arg name: The name of the index (it must be a concrete index - name) + name). :arg body: New index template definition, which will be included in the simulation, as if it already exists in the system :arg cause: User defined reason for dry-run creating the new - template for simulation purposes + template for simulation purposes. Default is false. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg create: Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an - existing one - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + existing one. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1438,38 +1383,38 @@ class IndicesClient(NamespacedClient): body=body, ) - @query_params("expand_wildcards") + @query_params() def get_data_stream(self, name=None, params=None, headers=None): """ Returns data streams. - :arg name: A comma-separated list of data streams to get; use - `*` to get all data streams - :arg expand_wildcards: Whether wildcard expressions should get - expanded to open or closed indices (default: open) Valid choices: open, - closed, hidden, none, all Default: open + :arg name: Comma-separated list of data streams; use `_all` or + empty string to perform the operation on all data streams. """ return self.transport.perform_request( "GET", _make_path("_data_stream", name), params=params, headers=headers ) - @query_params("cause", "create", "master_timeout", "cluster_manager_timeout") + @query_params("cause", "cluster_manager_timeout", "create", "master_timeout") def simulate_template(self, body=None, name=None, params=None, headers=None): """ - Simulate resolving the given template name or body + Simulate resolving the given template name or body. :arg body: New index template definition to be simulated, if no index template name is specified - :arg name: The name of the index template + :arg name: The name of the template. :arg cause: User defined reason for dry-run creating the new - template for simulation purposes + template for simulation purposes. Default is false. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg create: Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an - existing one - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager + existing one. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return self.transport.perform_request( "POST", @@ -1482,19 +1427,14 @@ class IndicesClient(NamespacedClient): @query_params("expand_wildcards") def resolve_index(self, name, params=None, headers=None): """ - Returns information about any matching indices, aliases, and data streams + Returns information about any matching indices, aliases, and data streams. - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - - :arg name: A comma-separated list of names or wildcard - expressions - :arg expand_wildcards: Whether wildcard expressions should get - expanded to open or closed indices (default: open) Valid choices: open, - closed, hidden, none, all Default: open + :arg name: Comma-separated list of names or wildcard + expressions. + :arg expand_wildcards: Whether to expand wildcard expression to + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. """ if name in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'name'.") @@ -1505,10 +1445,10 @@ class IndicesClient(NamespacedClient): @query_params( "allow_no_indices", + "cluster_manager_timeout", "expand_wildcards", "ignore_unavailable", "master_timeout", - "cluster_manager_timeout", "timeout", ) def add_block(self, index, block, params=None, headers=None): @@ -1516,20 +1456,23 @@ class IndicesClient(NamespacedClient): Adds a block to an index. - :arg index: A comma separated list of indices to add a block to + :arg index: Comma-separated list of indices to add a block to. :arg block: The block to add (one of read, write, read_only or - metadata) + metadata). :arg allow_no_indices: Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) + string or when no indices have been specified). + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open + concrete indices that are open, closed or both. Valid choices are all, + open, closed, hidden, none. :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Specify timeout for connection to master - :arg cluster_manager_timeout: Specify timeout for connection to cluster_manager - :arg timeout: Explicit operation timeout + should be ignored when unavailable (missing or closed). + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ for param in (index, block): if param in SKIP_IN_PATH: @@ -1545,8 +1488,8 @@ class IndicesClient(NamespacedClient): Provides statistics on operations happening in a data stream. - :arg name: A comma-separated list of data stream names; use - `_all` or empty string to perform the operation on all data streams + :arg name: Comma-separated list of data streams; use `_all` or + empty string to perform the operation on all data streams. """ return self.transport.perform_request( "GET", @@ -1554,115 +1497,3 @@ class IndicesClient(NamespacedClient): params=params, headers=headers, ) - - @query_params() - def promote_data_stream(self, name, params=None, headers=None): - """ - Promotes a data stream from a replicated data stream managed by CCR to a - regular data stream - - - :arg name: The name of the data stream - """ - if name in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'name'.") - - return self.transport.perform_request( - "POST", - _make_path("_data_stream", "_promote", name), - params=params, - headers=headers, - ) - - @query_params() - def migrate_to_data_stream(self, name, params=None, headers=None): - """ - Migrates an alias to a data stream - - - :arg name: The name of the alias to migrate - """ - if name in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'name'.") - - return self.transport.perform_request( - "POST", - _make_path("_data_stream", "_migrate", name), - params=params, - headers=headers, - ) - - @query_params( - "allow_no_indices", - "expand_wildcards", - "flush", - "ignore_unavailable", - "run_expensive_tasks", - ) - def disk_usage(self, index, params=None, headers=None): - """ - Analyzes the disk usage of each field of an index or data stream - - - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - - :arg index: Comma-separated list of indices or data streams to - analyze the disk usage - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg flush: Whether flush or not before analyzing the index disk - usage. Defaults to true - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - :arg run_expensive_tasks: Must be set to [true] in order for the - task to be performed. Defaults to false. - """ - if index in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'index'.") - - return self.transport.perform_request( - "POST", _make_path(index, "_disk_usage"), params=params, headers=headers - ) - - @query_params( - "allow_no_indices", "expand_wildcards", "fields", "ignore_unavailable" - ) - def field_usage_stats(self, index, params=None, headers=None): - """ - Returns the field usage stats for each field of an index - - - .. warning:: - - This API is **experimental** so may include breaking changes - or be removed in a future version - - :arg index: A comma-separated list of index names; use `_all` or - empty string to perform the operation on all indices - :arg allow_no_indices: Whether to ignore if a wildcard indices - expression resolves into no concrete indices. (This includes `_all` - string or when no indices have been specified) - :arg expand_wildcards: Whether to expand wildcard expression to - concrete indices that are open, closed or both. Valid choices: open, - closed, hidden, none, all Default: open - :arg fields: A comma-separated list of fields to include in the - stats if only a subset of fields should be returned (supports wildcards) - :arg ignore_unavailable: Whether specified concrete indices - should be ignored when unavailable (missing or closed) - """ - if index in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'index'.") - - return self.transport.perform_request( - "GET", - _make_path(index, "_field_usage_stats"), - params=params, - headers=headers, - ) diff --git a/opensearchpy/client/indices.pyi b/opensearchpy/client/indices.pyi index 2393537a..51751d53 100644 --- a/opensearchpy/client/indices.pyi +++ b/opensearchpy/client/indices.pyi @@ -24,6 +24,15 @@ # specific language governing permissions and limitations # under the License. +# ---------------------------------------------------- +# THIS CODE IS GENERATED AND MANUAL EDITS WILL BE LOST. +# +# To contribute, kindly make essential modifications through either the "opensearch-py client generator": +# https://github.com/opensearch-project/opensearch-py/blob/main/utils/generate-api.py +# or the "OpenSearch API specification" available at: +# https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json +# ----------------------------------------------------- + from typing import Any, Collection, MutableMapping, Optional, Tuple, Union from .utils import NamespacedClient @@ -94,8 +103,8 @@ class IndicesClient(NamespacedClient): index: Any, *, body: Optional[Any] = ..., - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., wait_for_active_shards: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -117,8 +126,8 @@ class IndicesClient(NamespacedClient): target: Any, *, body: Optional[Any] = ..., - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., wait_for_active_shards: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -139,13 +148,13 @@ class IndicesClient(NamespacedClient): index: Any, *, allow_no_indices: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., expand_wildcards: Optional[Any] = ..., flat_settings: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., include_defaults: Optional[Any] = ..., local: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -164,10 +173,10 @@ class IndicesClient(NamespacedClient): index: Any, *, allow_no_indices: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., expand_wildcards: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., wait_for_active_shards: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -188,10 +197,10 @@ class IndicesClient(NamespacedClient): index: Any, *, allow_no_indices: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., expand_wildcards: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., wait_for_active_shards: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -212,10 +221,10 @@ class IndicesClient(NamespacedClient): index: Any, *, allow_no_indices: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., expand_wildcards: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -259,10 +268,10 @@ class IndicesClient(NamespacedClient): body: Any, index: Optional[Any] = ..., allow_no_indices: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., expand_wildcards: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., write_index_only: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -283,11 +292,11 @@ class IndicesClient(NamespacedClient): *, index: Optional[Any] = ..., allow_no_indices: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., expand_wildcards: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., local: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -330,8 +339,8 @@ class IndicesClient(NamespacedClient): name: Any, *, body: Optional[Any] = ..., - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -394,8 +403,8 @@ class IndicesClient(NamespacedClient): self, *, body: Any, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -415,8 +424,8 @@ class IndicesClient(NamespacedClient): index: Any, name: Any, *, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -436,9 +445,9 @@ class IndicesClient(NamespacedClient): name: Any, *, body: Any, + cluster_manager_timeout: Optional[Any] = ..., create: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., order: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -457,10 +466,10 @@ class IndicesClient(NamespacedClient): self, name: Any, *, + cluster_manager_timeout: Optional[Any] = ..., flat_settings: Optional[Any] = ..., local: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -478,10 +487,10 @@ class IndicesClient(NamespacedClient): self, *, name: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., flat_settings: Optional[Any] = ..., local: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -499,8 +508,8 @@ class IndicesClient(NamespacedClient): self, name: Any, *, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -521,13 +530,13 @@ class IndicesClient(NamespacedClient): index: Optional[Any] = ..., name: Optional[Any] = ..., allow_no_indices: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., expand_wildcards: Optional[Any] = ..., flat_settings: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., include_defaults: Optional[Any] = ..., local: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -547,11 +556,11 @@ class IndicesClient(NamespacedClient): body: Any, index: Optional[Any] = ..., allow_no_indices: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., expand_wildcards: Optional[Any] = ..., flat_settings: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., preserve_existing: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -581,7 +590,6 @@ class IndicesClient(NamespacedClient): include_segment_file_sizes: Optional[Any] = ..., include_unloaded_segments: Optional[Any] = ..., level: Optional[Any] = ..., - types: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -731,26 +739,6 @@ class IndicesClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... - def flush_synced( - self, - *, - index: Optional[Any] = ..., - allow_no_indices: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., - ignore_unavailable: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... def shard_stores( self, *, @@ -801,9 +789,9 @@ class IndicesClient(NamespacedClient): target: Any, *, body: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., copy_settings: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., wait_for_active_shards: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -825,9 +813,9 @@ class IndicesClient(NamespacedClient): target: Any, *, body: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., copy_settings: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., wait_for_active_shards: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -849,9 +837,9 @@ class IndicesClient(NamespacedClient): *, body: Optional[Any] = ..., new_index: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., dry_run: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., wait_for_active_shards: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -867,78 +855,11 @@ class IndicesClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... - def freeze( - self, - index: Any, - *, - allow_no_indices: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., - ignore_unavailable: Optional[Any] = ..., - master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., - timeout: Optional[Any] = ..., - wait_for_active_shards: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - def unfreeze( - self, - index: Any, - *, - allow_no_indices: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., - ignore_unavailable: Optional[Any] = ..., - master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., - timeout: Optional[Any] = ..., - wait_for_active_shards: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - def reload_search_analyzers( - self, - index: Any, - *, - allow_no_indices: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., - ignore_unavailable: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... def create_data_stream( self, name: Any, *, + body: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -956,7 +877,6 @@ class IndicesClient(NamespacedClient): self, name: Any, *, - expand_wildcards: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -974,8 +894,8 @@ class IndicesClient(NamespacedClient): self, name: Any, *, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -994,10 +914,10 @@ class IndicesClient(NamespacedClient): self, name: Any, *, + cluster_manager_timeout: Optional[Any] = ..., flat_settings: Optional[Any] = ..., local: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -1015,10 +935,10 @@ class IndicesClient(NamespacedClient): self, *, name: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., flat_settings: Optional[Any] = ..., local: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -1038,9 +958,9 @@ class IndicesClient(NamespacedClient): *, body: Any, cause: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., create: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -1060,9 +980,9 @@ class IndicesClient(NamespacedClient): *, body: Optional[Any] = ..., cause: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., create: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -1080,7 +1000,6 @@ class IndicesClient(NamespacedClient): self, *, name: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -1100,9 +1019,9 @@ class IndicesClient(NamespacedClient): body: Optional[Any] = ..., name: Optional[Any] = ..., cause: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., create: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -1140,10 +1059,10 @@ class IndicesClient(NamespacedClient): block: Any, *, allow_no_indices: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., expand_wildcards: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -1175,80 +1094,3 @@ class IndicesClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... - def promote_data_stream( - self, - name: Any, - *, - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - def migrate_to_data_stream( - self, - name: Any, - *, - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - def disk_usage( - self, - index: Any, - *, - allow_no_indices: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., - flush: Optional[Any] = ..., - ignore_unavailable: Optional[Any] = ..., - run_expensive_tasks: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - def field_usage_stats( - self, - index: Any, - *, - allow_no_indices: Optional[Any] = ..., - expand_wildcards: Optional[Any] = ..., - fields: Optional[Any] = ..., - ignore_unavailable: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... diff --git a/opensearchpy/client/ingest.py b/opensearchpy/client/ingest.py index fb9d4f79..a14bc0f6 100644 --- a/opensearchpy/client/ingest.py +++ b/opensearchpy/client/ingest.py @@ -50,8 +50,8 @@ class IngestClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return self.transport.perform_request( "GET", _make_path("_ingest", "pipeline", id), params=params, headers=headers @@ -68,8 +68,8 @@ class IngestClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg timeout: Operation timeout. """ for param in (id, body): @@ -94,8 +94,8 @@ class IngestClient(NamespacedClient): :arg cluster_manager_timeout: Operation timeout for connection to cluster-manager node. :arg master_timeout (Deprecated: To promote inclusive language, - use 'cluster_manager_timeout' instead): Operation timeout for connection - to master node. + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg timeout: Operation timeout. """ if id in SKIP_IN_PATH: @@ -117,7 +117,7 @@ class IngestClient(NamespacedClient): :arg body: The simulate definition :arg id: Pipeline ID. :arg verbose: Verbose mode. Display data output for each - processor in executed pipeline. + processor in executed pipeline. Default is false. """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") diff --git a/opensearchpy/client/nodes.py b/opensearchpy/client/nodes.py index 9dc1e1ab..6b73177b 100644 --- a/opensearchpy/client/nodes.py +++ b/opensearchpy/client/nodes.py @@ -73,10 +73,10 @@ class NodesClient(NamespacedClient): node you're connecting to, leave empty to get information from all nodes. :arg metric: Comma-separated list of metrics you wish returned. - Leave empty to return all. Valid choices: settings, os, process, jvm, - thread_pool, transport, http, plugins, ingest - :arg flat_settings: Return settings in flat format. (default: - false) + Leave empty to return all. Valid choices are settings, os, process, jvm, + thread_pool, transport, http, plugins, ingest. + :arg flat_settings: Return settings in flat format. Default is + false. :arg timeout: Operation timeout. """ return self.transport.perform_request( @@ -105,13 +105,13 @@ class NodesClient(NamespacedClient): node you're connecting to, leave empty to get information from all nodes. :arg metric: Limit the information returned to the specified - metrics. Valid choices: _all, breaker, fs, http, indices, jvm, os, - process, thread_pool, transport, discovery, indexing_pressure + metrics. Valid choices are _all, breaker, fs, http, indices, jvm, os, + process, thread_pool, transport, discovery, indexing_pressure. :arg index_metric: Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) - metric isn't specified. Valid choices: _all, store, indexing, get, + metric isn't specified. Valid choices are _all, store, indexing, get, search, merge, flush, refresh, query_cache, fielddata, docs, warmer, - completion, segments, translog, suggest, request_cache, recovery + completion, segments, translog, suggest, request_cache, recovery. :arg completion_fields: Comma-separated list of fields for `fielddata` and `suggest` index metric (supports wildcards). :arg fielddata_fields: Comma-separated list of fields for @@ -122,9 +122,9 @@ class NodesClient(NamespacedClient): index metric. :arg include_segment_file_sizes: Whether to report the aggregated disk usage of each one of the Lucene index files (only - applies if segment stats are requested). (default: false) + applies if segment stats are requested). Default is false. :arg level: Return indices stats aggregated at index, node or - shard level. Valid choices: indices, node, shards + shard level. Valid choices are indices, node, shards. :arg timeout: Operation timeout. :arg types: Comma-separated list of document types for the `indexing` index metric. @@ -148,16 +148,16 @@ class NodesClient(NamespacedClient): 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: cpu, wait, - block + :arg doc_type: The type to sample. Valid choices are cpu, wait, + block. :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: True) + task queue. Default is True. :arg interval: The interval for the second sampling of threads. - :arg snapshots: Number of samples of thread stacktrace. - (default: 10) + :arg snapshots: Number of samples of thread stacktrace. Default + is 10. :arg threads: Specify the number of threads to provide - information for. (default: 3) + information for. Default is 3. :arg timeout: Operation timeout. """ # type is a reserved word so it cannot be used, use doc_type instead @@ -182,7 +182,7 @@ class NodesClient(NamespacedClient): node you're connecting to, leave empty to get information from all nodes. :arg metric: Limit the information returned to the specified - metrics. Valid choices: _all, rest_actions + metrics. Valid choices are _all, rest_actions. :arg timeout: Operation timeout. """ return self.transport.perform_request( diff --git a/opensearchpy/client/security.py b/opensearchpy/client/security.py index 32a362b3..1af50448 100644 --- a/opensearchpy/client/security.py +++ b/opensearchpy/client/security.py @@ -7,6 +7,17 @@ # Modifications Copyright OpenSearch Contributors. See # GitHub history for details. + +# ---------------------------------------------------- +# THIS CODE IS GENERATED AND MANUAL EDITS WILL BE LOST. +# +# To contribute, kindly make essential modifications through either the "opensearch-py client generator": +# https://github.com/opensearch-project/opensearch-py/blob/main/utils/generate-api.py +# or the "OpenSearch API specification" available at: +# https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json +# ----------------------------------------------------- + + from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params @@ -17,25 +28,25 @@ class SecurityClient(NamespacedClient): def get_account_details(self, params=None, headers=None): """ Returns account details for the current user. + """ return self.transport.perform_request( - "GET", - _make_path("_plugins", "_security", "api", "account"), - params=params, - headers=headers, + "GET", "/_plugins/_security/api/account", params=params, headers=headers ) @query_params() def change_password(self, body, params=None, headers=None): """ Changes the password for the current user. + + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return self.transport.perform_request( "PUT", - _make_path("_plugins", "_security", "api", "account"), + "/_plugins/_security/api/account", params=params, headers=headers, body=body, @@ -45,10 +56,13 @@ class SecurityClient(NamespacedClient): def get_action_group(self, action_group, params=None, headers=None): """ Retrieves one action group. + + + :arg action_group: Action group to retrieve. """ if action_group in SKIP_IN_PATH: raise ValueError( - "Empty value passed for a required argument 'action-group'." + "Empty value passed for a required argument 'action_group'." ) return self.transport.perform_request( @@ -62,10 +76,11 @@ class SecurityClient(NamespacedClient): def get_action_groups(self, params=None, headers=None): """ Retrieves all action groups. + """ return self.transport.perform_request( "GET", - _make_path("_plugins", "_security", "api", "actiongroups"), + "/_plugins/_security/api/actiongroups/", params=params, headers=headers, ) @@ -73,11 +88,14 @@ class SecurityClient(NamespacedClient): @query_params() def delete_action_group(self, action_group, params=None, headers=None): """ - Deletes the specified action group. + Delete a specified action group. + + + :arg action_group: Action group to delete. """ if action_group in SKIP_IN_PATH: raise ValueError( - "Empty value passed for a required argument 'action-group'." + "Empty value passed for a required argument 'action_group'." ) return self.transport.perform_request( @@ -91,6 +109,10 @@ class SecurityClient(NamespacedClient): def create_action_group(self, action_group, body, params=None, headers=None): """ Creates or replaces the specified action group. + + + :arg action_group: The name of the action group to create or + replace """ for param in (action_group, body): if param in SKIP_IN_PATH: @@ -108,6 +130,8 @@ class SecurityClient(NamespacedClient): def patch_action_group(self, action_group, body, params=None, headers=None): """ Updates individual attributes of an action group. + + """ for param in (action_group, body): if param in SKIP_IN_PATH: @@ -125,13 +149,15 @@ class SecurityClient(NamespacedClient): def patch_action_groups(self, body, params=None, headers=None): """ Creates, updates, or deletes multiple action groups in a single call. + + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return self.transport.perform_request( "PATCH", - _make_path("_plugins", "_security", "api", "actiongroups"), + "/_plugins/_security/api/actiongroups", params=params, headers=headers, body=body, @@ -140,7 +166,9 @@ class SecurityClient(NamespacedClient): @query_params() def get_user(self, username, params=None, headers=None): """ - Retrieves one user. + Retrieve one internal user. + + """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'username'.") @@ -155,11 +183,12 @@ class SecurityClient(NamespacedClient): @query_params() def get_users(self, params=None, headers=None): """ - Retrieves all users. + Retrieve all internal users. + """ return self.transport.perform_request( "GET", - _make_path("_plugins", "_security", "api", "internalusers"), + "/_plugins/_security/api/internalusers", params=params, headers=headers, ) @@ -167,7 +196,9 @@ class SecurityClient(NamespacedClient): @query_params() def delete_user(self, username, params=None, headers=None): """ - Deletes the specified user. + Delete the specified user. + + """ if username in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'username'.") @@ -183,6 +214,8 @@ class SecurityClient(NamespacedClient): def create_user(self, username, body, params=None, headers=None): """ Creates or replaces the specified user. + + """ for param in (username, body): if param in SKIP_IN_PATH: @@ -200,6 +233,8 @@ class SecurityClient(NamespacedClient): def patch_user(self, username, body, params=None, headers=None): """ Updates individual attributes of an internal user. + + """ for param in (username, body): if param in SKIP_IN_PATH: @@ -217,13 +252,15 @@ class SecurityClient(NamespacedClient): def patch_users(self, body, params=None, headers=None): """ Creates, updates, or deletes multiple internal users in a single call. + + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return self.transport.perform_request( "PATCH", - _make_path("_plugins", "_security", "api", "internalusers"), + "/_plugins/_security/api/internalusers", params=params, headers=headers, body=body, @@ -233,6 +270,8 @@ class SecurityClient(NamespacedClient): def get_role(self, role, params=None, headers=None): """ Retrieves one role. + + """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -248,18 +287,18 @@ class SecurityClient(NamespacedClient): def get_roles(self, params=None, headers=None): """ Retrieves all roles. + """ return self.transport.perform_request( - "GET", - _make_path("_plugins", "_security", "api", "roles"), - params=params, - headers=headers, + "GET", "/_plugins/_security/api/roles/", params=params, headers=headers ) @query_params() def delete_role(self, role, params=None, headers=None): """ - Deletes the specified role. + Delete the specified role. + + """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -275,6 +314,8 @@ class SecurityClient(NamespacedClient): def create_role(self, role, body, params=None, headers=None): """ Creates or replaces the specified role. + + """ for param in (role, body): if param in SKIP_IN_PATH: @@ -292,6 +333,8 @@ class SecurityClient(NamespacedClient): def patch_role(self, role, body, params=None, headers=None): """ Updates individual attributes of a role. + + """ for param in (role, body): if param in SKIP_IN_PATH: @@ -309,13 +352,15 @@ class SecurityClient(NamespacedClient): def patch_roles(self, body, params=None, headers=None): """ Creates, updates, or deletes multiple roles in a single call. + + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return self.transport.perform_request( "PATCH", - _make_path("_plugins", "_security", "api", "roles"), + "/_plugins/_security/api/roles", params=params, headers=headers, body=body, @@ -325,6 +370,8 @@ class SecurityClient(NamespacedClient): def get_role_mapping(self, role, params=None, headers=None): """ Retrieves one role mapping. + + """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -340,10 +387,11 @@ class SecurityClient(NamespacedClient): def get_role_mappings(self, params=None, headers=None): """ Retrieves all role mappings. + """ return self.transport.perform_request( "GET", - _make_path("_plugins", "_security", "api", "rolesmapping"), + "/_plugins/_security/api/rolesmapping", params=params, headers=headers, ) @@ -352,6 +400,8 @@ class SecurityClient(NamespacedClient): def delete_role_mapping(self, role, params=None, headers=None): """ Deletes the specified role mapping. + + """ if role in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'role'.") @@ -367,6 +417,8 @@ class SecurityClient(NamespacedClient): def create_role_mapping(self, role, body, params=None, headers=None): """ Creates or replaces the specified role mapping. + + """ for param in (role, body): if param in SKIP_IN_PATH: @@ -384,6 +436,8 @@ class SecurityClient(NamespacedClient): def patch_role_mapping(self, role, body, params=None, headers=None): """ Updates individual attributes of a role mapping. + + """ for param in (role, body): if param in SKIP_IN_PATH: @@ -401,13 +455,15 @@ class SecurityClient(NamespacedClient): def patch_role_mappings(self, body, params=None, headers=None): """ Creates or updates multiple role mappings in a single call. + + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return self.transport.perform_request( "PATCH", - _make_path("_plugins", "_security", "api", "rolesmapping"), + "/_plugins/_security/api/rolesmapping", params=params, headers=headers, body=body, @@ -417,6 +473,8 @@ class SecurityClient(NamespacedClient): def get_tenant(self, tenant, params=None, headers=None): """ Retrieves one tenant. + + """ if tenant in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'tenant'.") @@ -432,18 +490,18 @@ class SecurityClient(NamespacedClient): def get_tenants(self, params=None, headers=None): """ Retrieves all tenants. + """ return self.transport.perform_request( - "GET", - _make_path("_plugins", "_security", "api", "tenants"), - params=params, - headers=headers, + "GET", "/_plugins/_security/api/tenants/", params=params, headers=headers ) @query_params() def delete_tenant(self, tenant, params=None, headers=None): """ - Deletes the specified tenant. + Delete the specified tenant. + + """ if tenant in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'tenant'.") @@ -459,6 +517,8 @@ class SecurityClient(NamespacedClient): def create_tenant(self, tenant, body, params=None, headers=None): """ Creates or replaces the specified tenant. + + """ for param in (tenant, body): if param in SKIP_IN_PATH: @@ -476,6 +536,8 @@ class SecurityClient(NamespacedClient): def patch_tenant(self, tenant, body, params=None, headers=None): """ Add, delete, or modify a single tenant. + + """ for param in (tenant, body): if param in SKIP_IN_PATH: @@ -493,13 +555,15 @@ class SecurityClient(NamespacedClient): def patch_tenants(self, body, params=None, headers=None): """ Add, delete, or modify multiple tenants in a single call. + + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return self.transport.perform_request( "PATCH", - _make_path("_plugins", "_security", "api", "tenants"), + "/_plugins/_security/api/tenants/", params=params, headers=headers, body=body, @@ -508,11 +572,12 @@ class SecurityClient(NamespacedClient): @query_params() def get_configuration(self, params=None, headers=None): """ - Retrieves the current Security plugin configuration in JSON format. + Returns the current Security plugin configuration in JSON format. + """ return self.transport.perform_request( "GET", - _make_path("_plugins", "_security", "api", "securityconfig"), + "/_plugins/_security/api/securityconfig", params=params, headers=headers, ) @@ -520,14 +585,16 @@ class SecurityClient(NamespacedClient): @query_params() def update_configuration(self, body, params=None, headers=None): """ - Retrieves the current Security plugin configuration in JSON format. + Adds or updates the existing configuration using the REST API. + + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return self.transport.perform_request( "PUT", - _make_path("_plugins", "_security", "api", "securityconfig", "config"), + "/_plugins/_security/api/securityconfig/config", params=params, headers=headers, body=body, @@ -536,14 +603,16 @@ class SecurityClient(NamespacedClient): @query_params() def patch_configuration(self, body, params=None, headers=None): """ - Updates the existing configuration using the REST API. + A PATCH call is used to update the existing configuration using the REST API. + + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return self.transport.perform_request( "PATCH", - _make_path("_plugins", "_security", "api", "securityconfig"), + "/_plugins/_security/api/securityconfig", params=params, headers=headers, body=body, @@ -553,6 +622,8 @@ class SecurityClient(NamespacedClient): def get_distinguished_names(self, cluster_name=None, params=None, headers=None): """ Retrieves all distinguished names in the allow list. + + """ return self.transport.perform_request( "GET", @@ -562,13 +633,19 @@ class SecurityClient(NamespacedClient): ) @query_params() - def update_distinguished_names(self, cluster_name, body, params=None, headers=None): + def update_distinguished_names( + self, cluster_name, body=None, params=None, headers=None + ): """ - Adds or updates the specified distinguished names in the cluster's or node's allow list. + Adds or updates the specified distinguished names in the cluster’s or node’s + allow list. + + """ - for param in (cluster_name, body): - if param in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument.") + if cluster_name in SKIP_IN_PATH: + raise ValueError( + "Empty value passed for a required argument 'cluster_name'." + ) return self.transport.perform_request( "PUT", @@ -581,11 +658,14 @@ class SecurityClient(NamespacedClient): @query_params() def delete_distinguished_names(self, cluster_name, params=None, headers=None): """ - Deletes all distinguished names in the specified cluster's or node's allow list. + Deletes all distinguished names in the specified cluster’s or node’s allow + list. + + """ if cluster_name in SKIP_IN_PATH: raise ValueError( - "Empty value passed for a required argument 'cluster-name'." + "Empty value passed for a required argument 'cluster_name'." ) return self.transport.perform_request( @@ -598,25 +678,22 @@ class SecurityClient(NamespacedClient): @query_params() def get_certificates(self, params=None, headers=None): """ - Retrieves the cluster's security certificates. + Retrieves the cluster’s security certificates. + """ return self.transport.perform_request( - "GET", - _make_path("_plugins", "_security", "api", "ssl", "certs"), - params=params, - headers=headers, + "GET", "/_plugins/_security/api/ssl/certs", params=params, headers=headers ) @query_params() def reload_transport_certificates(self, params=None, headers=None): """ - Reloads SSL certificates that are about to expire without restarting the OpenSearch node. + Reload transport layer communication certificates. + """ return self.transport.perform_request( "PUT", - _make_path( - "_opendistro", "_security", "api", "ssl", "transport", "reloadcerts" - ), + "/_plugins/_security/api/ssl/transport/reloadcerts", params=params, headers=headers, ) @@ -624,11 +701,12 @@ class SecurityClient(NamespacedClient): @query_params() def reload_http_certificates(self, params=None, headers=None): """ - Reloads SSL certificates that are about to expire without restarting the OpenSearch node. + Reload HTTP layer communication certificates. + """ return self.transport.perform_request( "PUT", - _make_path("_opendistro", "_security", "api", "ssl", "http", "reloadcerts"), + "/_plugins/_security/api/ssl/http/reloadcerts", params=params, headers=headers, ) @@ -637,12 +715,10 @@ class SecurityClient(NamespacedClient): def flush_cache(self, params=None, headers=None): """ Flushes the Security plugin user, authentication, and authorization cache. + """ return self.transport.perform_request( - "DELETE", - _make_path("_plugins", "_security", "api", "cache"), - params=params, - headers=headers, + "DELETE", "/_plugins/_security/api/cache", params=params, headers=headers ) @query_params() @@ -658,13 +734,11 @@ class SecurityClient(NamespacedClient): @query_params() def get_audit_configuration(self, params=None, headers=None): """ - A GET call retrieves the audit configuration. + Retrieves the audit configuration. + """ return self.transport.perform_request( - "GET", - _make_path("_opendistro", "_security", "api", "audit"), - params=params, - headers=headers, + "GET", "/_plugins/_security/api/audit", params=params, headers=headers ) @query_params() @@ -672,6 +746,7 @@ class SecurityClient(NamespacedClient): """ Updates the audit configuration. + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") @@ -688,13 +763,33 @@ class SecurityClient(NamespacedClient): def patch_audit_configuration(self, body, params=None, headers=None): """ A PATCH call is used to update specified fields in the audit configuration. + + """ if body in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'body'.") return self.transport.perform_request( "PATCH", - _make_path("_opendistro", "_security", "api", "audit"), + "/_plugins/_security/api/audit", + params=params, + headers=headers, + body=body, + ) + + @query_params() + def patch_distinguished_names(self, body, params=None, headers=None): + """ + Bulk update of distinguished names. + + + """ + if body in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'body'.") + + return self.transport.perform_request( + "PATCH", + "/_plugins/_security/api/nodesdn", params=params, headers=headers, body=body, diff --git a/opensearchpy/client/security.pyi b/opensearchpy/client/security.pyi index c729d5d3..dbcc1179 100644 --- a/opensearchpy/client/security.pyi +++ b/opensearchpy/client/security.pyi @@ -6,192 +6,735 @@ # # Modifications Copyright OpenSearch Contributors. See # GitHub history for details. + +# ---------------------------------------------------- +# THIS CODE IS GENERATED AND MANUAL EDITS WILL BE LOST. +# +# To contribute, kindly make essential modifications through either the "opensearch-py client generator": +# https://github.com/opensearch-project/opensearch-py/blob/main/utils/generate-api.py +# or the "OpenSearch API specification" available at: +# https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json +# ----------------------------------------------------- + from typing import Any, Collection, MutableMapping, Optional, Tuple, Union -from .utils import NamespacedClient as NamespacedClient +from .utils import NamespacedClient class SecurityClient(NamespacedClient): def get_account_details( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def change_password( self, + *, body: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., - ) -> Union[bool, Any]: ... + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def get_action_group( self, action_group: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., - ) -> Union[bool, Any]: ... + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def get_action_groups( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def delete_action_group( self, action_group: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., - ) -> Union[bool, Any]: ... + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def create_action_group( self, action_group: Any, + *, body: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., - ) -> Union[bool, Any]: ... + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def patch_action_group( self, action_group: Any, + *, body: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., - ) -> Union[bool, Any]: ... + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def patch_action_groups( - self, body: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def get_user( self, username: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., - ) -> Union[bool, Any]: ... + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def get_users( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def delete_user( self, username: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., - ) -> Union[bool, Any]: ... + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def create_user( self, username: Any, + *, body: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., - ) -> Union[bool, Any]: ... + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def patch_user( self, username: Any, + *, body: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., - ) -> Union[bool, Any]: ... + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def patch_users( - self, body: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def get_role( - self, role: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + role: Any, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def get_roles( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def delete_role( - self, role: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + role: Any, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def create_role( - self, role: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + role: Any, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def patch_role( - self, role: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + role: Any, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def patch_roles( - self, body: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def get_role_mapping( - self, role: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + role: Any, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def get_role_mappings( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def delete_role_mapping( - self, role: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + role: Any, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def create_role_mapping( - self, role: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + role: Any, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def patch_role_mapping( - self, role: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + role: Any, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def patch_role_mappings( - self, body: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def get_tenant( self, tenant: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., - ) -> Union[bool, Any]: ... + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def get_tenants( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def delete_tenant( self, tenant: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., - ) -> Union[bool, Any]: ... + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def create_tenant( self, tenant: Any, + *, body: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., - ) -> Union[bool, Any]: ... + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def patch_tenant( self, tenant: Any, + *, body: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., - ) -> Union[bool, Any]: ... + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def patch_tenants( - self, body: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def get_configuration( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def update_configuration( - self, body: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def patch_configuration( - self, body: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def get_distinguished_names( self, - cluster_name: Union[Any, None] = ..., - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., - ) -> Union[bool, Any]: ... + *, + cluster_name: Optional[Any] = ..., + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def update_distinguished_names( self, cluster_name: Any, - body: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., - ) -> Union[bool, Any]: ... + *, + body: Optional[Any] = ..., + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def delete_distinguished_names( self, cluster_name: Any, - params: Union[Any, None] = ..., - headers: Union[Any, None] = ..., - ) -> Union[bool, Any]: ... + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def get_certificates( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def reload_transport_certificates( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def reload_http_certificates( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def flush_cache( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def health( self, *, @@ -209,8 +752,21 @@ class SecurityClient(NamespacedClient): headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... def get_audit_configuration( - self, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... def update_audit_configuration( self, *, @@ -229,5 +785,36 @@ class SecurityClient(NamespacedClient): headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... def patch_audit_configuration( - self, body: Any, params: Union[Any, None] = ..., headers: Union[Any, None] = ... - ) -> Union[bool, Any]: ... + self, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... + def patch_distinguished_names( + self, + *, + body: Any, + pretty: Optional[bool] = ..., + human: Optional[bool] = ..., + error_trace: Optional[bool] = ..., + format: Optional[str] = ..., + filter_path: Optional[Union[str, Collection[str]]] = ..., + request_timeout: Optional[Union[int, float]] = ..., + ignore: Optional[Union[int, Collection[int]]] = ..., + opaque_id: Optional[str] = ..., + http_auth: Optional[Union[str, Tuple[str, str]]] = ..., + api_key: Optional[Union[str, Tuple[str, str]]] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... diff --git a/opensearchpy/client/snapshot.py b/opensearchpy/client/snapshot.py index 200fff96..ac0683a5 100644 --- a/opensearchpy/client/snapshot.py +++ b/opensearchpy/client/snapshot.py @@ -25,25 +25,36 @@ # under the License. +# ---------------------------------------------------- +# THIS CODE IS GENERATED AND MANUAL EDITS WILL BE LOST. +# +# To contribute, kindly make essential modifications through either the "opensearch-py client generator": +# https://github.com/opensearch-project/opensearch-py/blob/main/utils/generate-api.py +# or the "OpenSearch API specification" available at: +# https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json +# ----------------------------------------------------- + + from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params class SnapshotClient(NamespacedClient): - @query_params("master_timeout", "cluster_manager_timeout", "wait_for_completion") + @query_params("cluster_manager_timeout", "master_timeout", "wait_for_completion") def create(self, repository, snapshot, body=None, params=None, headers=None): """ Creates a snapshot in a repository. - :arg repository: A repository name - :arg snapshot: A snapshot name + :arg repository: Repository name. + :arg snapshot: Snapshot name. :arg body: The snapshot definition - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg wait_for_completion: Should this request wait until the - operation has completed before returning + operation has completed before returning. Default is false. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -57,18 +68,19 @@ class SnapshotClient(NamespacedClient): body=body, ) - @query_params("master_timeout", "cluster_manager_timeout") + @query_params("cluster_manager_timeout", "master_timeout") def delete(self, repository, snapshot, params=None, headers=None): """ Deletes a snapshot. - :arg repository: A repository name - :arg snapshot: A snapshot name - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + :arg repository: Repository name. + :arg snapshot: Snapshot name. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -82,33 +94,25 @@ class SnapshotClient(NamespacedClient): ) @query_params( - "ignore_unavailable", - "include_repository", - "index_details", - "master_timeout", - "cluster_manager_timeout", - "verbose", + "cluster_manager_timeout", "ignore_unavailable", "master_timeout", "verbose" ) def get(self, repository, snapshot, params=None, headers=None): """ Returns information about a snapshot. - :arg repository: A repository name - :arg snapshot: A comma-separated list of snapshot names + :arg repository: Repository name. + :arg snapshot: Comma-separated list of snapshot names. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg ignore_unavailable: Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is - thrown - :arg include_repository: Whether to include the repository name - in the snapshot info. Defaults to true. - :arg index_details: Whether to include details of each index in - the snapshot, if those details are available. Defaults to false. - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + thrown. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg verbose: Whether to show verbose snapshot info or only show - the basic info found in the repository index blob + the basic info found in the repository index blob. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -121,7 +125,7 @@ class SnapshotClient(NamespacedClient): headers=headers, ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") def delete_repository(self, repository, params=None, headers=None): """ Deletes a repository. @@ -129,11 +133,12 @@ class SnapshotClient(NamespacedClient): :arg repository: Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported. - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node - :arg timeout: Explicit operation timeout + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -145,38 +150,40 @@ class SnapshotClient(NamespacedClient): headers=headers, ) - @query_params("local", "master_timeout", "cluster_manager_timeout") + @query_params("cluster_manager_timeout", "local", "master_timeout") def get_repository(self, repository=None, params=None, headers=None): """ Returns information about a repository. - :arg repository: A comma-separated list of repository names + :arg repository: Comma-separated list of repository names. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg local: Return local information, do not retrieve the state - from cluster_manager node (default: false) - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + from cluster-manager node. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return self.transport.perform_request( "GET", _make_path("_snapshot", repository), params=params, headers=headers ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout", "verify") + @query_params("cluster_manager_timeout", "master_timeout", "timeout", "verify") def create_repository(self, repository, body, params=None, headers=None): """ Creates a repository. - :arg repository: A repository name + :arg repository: Repository name. :arg body: The repository definition - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node - :arg timeout: Explicit operation timeout - :arg verify: Whether to verify the repository after creation + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. + :arg verify: Whether to verify the repository after creation. """ for param in (repository, body): if param in SKIP_IN_PATH: @@ -190,21 +197,22 @@ class SnapshotClient(NamespacedClient): body=body, ) - @query_params("master_timeout", "cluster_manager_timeout", "wait_for_completion") + @query_params("cluster_manager_timeout", "master_timeout", "wait_for_completion") def restore(self, repository, snapshot, body=None, params=None, headers=None): """ Restores a snapshot. - :arg repository: A repository name - :arg snapshot: A snapshot name + :arg repository: Repository name. + :arg snapshot: Snapshot name. :arg body: Details of what to restore - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. :arg wait_for_completion: Should this request wait until the - operation has completed before returning + operation has completed before returning. Default is false. """ for param in (repository, snapshot): if param in SKIP_IN_PATH: @@ -218,21 +226,22 @@ class SnapshotClient(NamespacedClient): body=body, ) - @query_params("ignore_unavailable", "master_timeout", "cluster_manager_timeout") + @query_params("cluster_manager_timeout", "ignore_unavailable", "master_timeout") def status(self, repository=None, snapshot=None, params=None, headers=None): """ Returns information about the status of a snapshot. - :arg repository: A repository name - :arg snapshot: A comma-separated list of snapshot names + :arg repository: Repository name. + :arg snapshot: Comma-separated list of snapshot names. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. :arg ignore_unavailable: Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is - thrown - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + thrown. Default is false. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ return self.transport.perform_request( "GET", @@ -241,18 +250,19 @@ class SnapshotClient(NamespacedClient): headers=headers, ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") def verify_repository(self, repository, params=None, headers=None): """ Verifies a repository. - :arg repository: A repository name - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node - :arg timeout: Explicit operation timeout + :arg repository: Repository name. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -264,18 +274,19 @@ class SnapshotClient(NamespacedClient): headers=headers, ) - @query_params("master_timeout", "cluster_manager_timeout", "timeout") + @query_params("cluster_manager_timeout", "master_timeout", "timeout") def cleanup_repository(self, repository, params=None, headers=None): """ Removes stale data from repository. - :arg repository: A repository name - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node - :arg timeout: Explicit operation timeout + :arg repository: Repository name. + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. + :arg timeout: Operation timeout. """ if repository in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'repository'.") @@ -287,7 +298,7 @@ class SnapshotClient(NamespacedClient): headers=headers, ) - @query_params("master_timeout", "cluster_manager_timeout") + @query_params("cluster_manager_timeout", "master_timeout") def clone( self, repository, snapshot, target_snapshot, body, params=None, headers=None ): @@ -295,14 +306,15 @@ class SnapshotClient(NamespacedClient): Clones indices 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 repository: Repository name. + :arg snapshot: Snapshot name. + :arg target_snapshot: The name of the cloned snapshot to create. :arg body: The snapshot clone definition - :arg master_timeout (Deprecated: use cluster_manager_timeout): Explicit operation timeout for connection - to master node - :arg cluster_manager_timeout: Explicit operation timeout for connection - to cluster_manager node + :arg cluster_manager_timeout: Operation timeout for connection + to cluster-manager node. + :arg master_timeout (Deprecated: To promote inclusive language, + use 'cluster_manager_timeout' instead.): Operation timeout for + connection to master node. """ for param in (repository, snapshot, target_snapshot, body): if param in SKIP_IN_PATH: @@ -315,56 +327,3 @@ class SnapshotClient(NamespacedClient): headers=headers, body=body, ) - - @query_params( - "blob_count", - "concurrency", - "detailed", - "early_read_node_count", - "max_blob_size", - "max_total_data_size", - "rare_action_probability", - "rarely_abort_writes", - "read_node_count", - "seed", - "timeout", - ) - def repository_analyze(self, repository, params=None, headers=None): - """ - Analyzes a repository for correctness and performance - - - :arg repository: A repository name - :arg blob_count: Number of blobs to create during the test. - Defaults to 100. - :arg concurrency: Number of operations to run concurrently - during the test. Defaults to 10. - :arg detailed: Whether to return detailed results or a summary. - Defaults to 'false' so that only the summary is returned. - :arg early_read_node_count: Number of nodes on which to perform - an early read on a blob, i.e. before writing has completed. Early reads - are rare actions so the 'rare_action_probability' parameter is also - relevant. Defaults to 2. - :arg max_blob_size: Maximum size of a blob to create during the - test, e.g '1gb' or '100mb'. Defaults to '10mb'. - :arg max_total_data_size: Maximum total size of all blobs to - create during the test, e.g '1tb' or '100gb'. Defaults to '1gb'. - :arg rare_action_probability: Probability of taking a rare - action such as an early read or an overwrite. Defaults to 0.02. - :arg rarely_abort_writes: Whether to rarely abort writes before - they complete. Defaults to 'true'. - :arg read_node_count: Number of nodes on which to read a blob - after writing. Defaults to 10. - :arg seed: Seed for the random number generator used to create - the test workload. Defaults to a random value. - :arg timeout: Explicit operation timeout. Defaults to '30s'. - """ - if repository in SKIP_IN_PATH: - raise ValueError("Empty value passed for a required argument 'repository'.") - - return self.transport.perform_request( - "POST", - _make_path("_snapshot", repository, "_analyze"), - params=params, - headers=headers, - ) diff --git a/opensearchpy/client/snapshot.pyi b/opensearchpy/client/snapshot.pyi index b1db95c0..8d50f086 100644 --- a/opensearchpy/client/snapshot.pyi +++ b/opensearchpy/client/snapshot.pyi @@ -24,6 +24,15 @@ # specific language governing permissions and limitations # under the License. +# ---------------------------------------------------- +# THIS CODE IS GENERATED AND MANUAL EDITS WILL BE LOST. +# +# To contribute, kindly make essential modifications through either the "opensearch-py client generator": +# https://github.com/opensearch-project/opensearch-py/blob/main/utils/generate-api.py +# or the "OpenSearch API specification" available at: +# https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json +# ----------------------------------------------------- + from typing import Any, Collection, MutableMapping, Optional, Tuple, Union from .utils import NamespacedClient @@ -35,8 +44,8 @@ class SnapshotClient(NamespacedClient): snapshot: Any, *, body: Optional[Any] = ..., - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., wait_for_completion: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -56,8 +65,8 @@ class SnapshotClient(NamespacedClient): repository: Any, snapshot: Any, *, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -76,11 +85,9 @@ class SnapshotClient(NamespacedClient): repository: Any, snapshot: Any, *, - ignore_unavailable: Optional[Any] = ..., - include_repository: Optional[Any] = ..., - index_details: Optional[Any] = ..., - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + ignore_unavailable: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., verbose: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -99,8 +106,8 @@ class SnapshotClient(NamespacedClient): self, repository: Any, *, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -119,9 +126,9 @@ class SnapshotClient(NamespacedClient): self, *, repository: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., local: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -140,8 +147,8 @@ class SnapshotClient(NamespacedClient): repository: Any, *, body: Any, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., verify: Optional[Any] = ..., pretty: Optional[bool] = ..., @@ -163,8 +170,8 @@ class SnapshotClient(NamespacedClient): snapshot: Any, *, body: Optional[Any] = ..., - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., wait_for_completion: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -184,9 +191,9 @@ class SnapshotClient(NamespacedClient): *, repository: Optional[Any] = ..., snapshot: Optional[Any] = ..., + cluster_manager_timeout: Optional[Any] = ..., ignore_unavailable: Optional[Any] = ..., master_timeout: Optional[Any] = ..., - cluster_manager_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., @@ -204,8 +211,8 @@ class SnapshotClient(NamespacedClient): self, repository: Any, *, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -224,8 +231,8 @@ class SnapshotClient(NamespacedClient): self, repository: Any, *, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., @@ -247,36 +254,8 @@ class SnapshotClient(NamespacedClient): target_snapshot: Any, *, body: Any, - master_timeout: Optional[Any] = ..., cluster_manager_timeout: Optional[Any] = ..., - pretty: Optional[bool] = ..., - human: Optional[bool] = ..., - error_trace: Optional[bool] = ..., - format: Optional[str] = ..., - filter_path: Optional[Union[str, Collection[str]]] = ..., - request_timeout: Optional[Union[int, float]] = ..., - ignore: Optional[Union[int, Collection[int]]] = ..., - opaque_id: Optional[str] = ..., - http_auth: Optional[Union[str, Tuple[str, str]]] = ..., - api_key: Optional[Union[str, Tuple[str, str]]] = ..., - params: Optional[MutableMapping[str, Any]] = ..., - headers: Optional[MutableMapping[str, str]] = ..., - ) -> Any: ... - def repository_analyze( - self, - repository: Any, - *, - blob_count: Optional[Any] = ..., - concurrency: Optional[Any] = ..., - detailed: Optional[Any] = ..., - early_read_node_count: Optional[Any] = ..., - max_blob_size: Optional[Any] = ..., - max_total_data_size: Optional[Any] = ..., - rare_action_probability: Optional[Any] = ..., - rarely_abort_writes: Optional[Any] = ..., - read_node_count: Optional[Any] = ..., - seed: Optional[Any] = ..., - timeout: Optional[Any] = ..., + master_timeout: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., diff --git a/opensearchpy/client/tasks.py b/opensearchpy/client/tasks.py index ff76a3a6..0cc7a4b2 100644 --- a/opensearchpy/client/tasks.py +++ b/opensearchpy/client/tasks.py @@ -57,9 +57,10 @@ class TasksClient(NamespacedClient): :arg actions: Comma-separated list of actions that should be returned. Leave empty to return all. - :arg detailed: Return detailed task information. + :arg detailed: Return detailed task information. Default is + false. :arg group_by: Group tasks by nodes or parent/child - relationships. Valid choices: nodes, parents, none + relationships. Valid choices are nodes, parents, none. :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 @@ -68,7 +69,7 @@ class TasksClient(NamespacedClient): (node_id:task_number). Set to -1 to return all. :arg timeout: Operation timeout. :arg wait_for_completion: Should this request wait until the - operation has completed before returning. + operation has completed before returning. Default is false. """ return self.transport.perform_request( "GET", "/_tasks", params=params, headers=headers @@ -91,7 +92,7 @@ class TasksClient(NamespacedClient): :arg parent_task_id: Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. :arg wait_for_completion: Should this request wait until the - operation has completed before returning. + operation has completed before returning. Default is false. """ return self.transport.perform_request( "POST", @@ -110,7 +111,7 @@ class TasksClient(NamespacedClient): (node_id:task_number). :arg timeout: Operation timeout. :arg wait_for_completion: Should this request wait until the - operation has completed before returning. + operation has completed before returning. Default is false. """ if task_id in SKIP_IN_PATH: warnings.warn( diff --git a/utils/generate-api.py b/utils/generate-api.py index fffd0e82..2cc95013 100644 --- a/utils/generate-api.py +++ b/utils/generate-api.py @@ -301,9 +301,10 @@ class API: parts.update(url.get("parts", {})) for p in parts: - parts[p]["required"] = all( - p in url.get("parts", {}) for url in self._def["url"]["paths"] - ) + if "required" not in parts[p]: + parts[p]["required"] = all( + p in url.get("parts", {}) for url in self._def["url"]["paths"] + ) parts[p]["type"] = "Any" # This piece of logic corresponds to calling @@ -555,6 +556,8 @@ def read_modules(): # Group the data in the current group by the "path" key paths = [] + all_paths_have_deprecation = True + for key2, value2 in groupby(value, key=itemgetter("path")): # Extract the HTTP methods from the data in the current subgroup methods = [] @@ -567,8 +570,10 @@ def read_modules(): documentation = {"description": z["description"]} api.update({"documentation": documentation}) - if "deprecation_message" not in api and "x-deprecation-message" in z: - api.update({"deprecation_message": z["x-deprecation-message"]}) + if "x-deprecation-message" in z: + x_deprecation_message = z["x-deprecation-message"] + else: + all_paths_have_deprecation = False if "params" not in api and "params" in z: api.update({"params": z["params"]}) @@ -637,6 +642,11 @@ def read_modules(): paths.append({"path": key2, "methods": methods}) api.update({"url": {"paths": paths}}) + if all_paths_have_deprecation and x_deprecation_message is not None: + api.update({"deprecation_message": x_deprecation_message}) + + if namespace == "indices" and name == "put_mapping": + api["url"]["paths"][0]["parts"]["index"].update({"required": False}) if namespace not in modules: modules[namespace] = Module(namespace) diff --git a/utils/templates/base b/utils/templates/base index 47bb5956..bf270aee 100644 --- a/utils/templates/base +++ b/utils/templates/base @@ -20,11 +20,13 @@ {% if api.params|list|length %} {% for p, info in api.params %} + {% if info.description %} {% filter wordwrap(72, wrapstring="\n ") %} - :arg {{ p }}{% if info.deprecated %} (Deprecated: {{ info['deprecation_message'][:-1] }}){% endif %}: {{ info.description }}{% if info.options %} Valid choices: {{ info.options|join(", ") }}{% endif %} - {% if info.default is defined %}{% if info.default is not none %}{% if info.default is sameas(false) %} (default: false){% else %} (default: {{ info.default }}){% endif %}{% endif %}{% endif %} + :arg {{ p }}{% if info.deprecated %} (Deprecated: {{ info['deprecation_message'][:-1] }}.){% endif %}: {{ info.description }} {% if info.options %}Valid choices are {{ info.options|join(", ") }}.{% endif %} + {% if info.default is defined %}{% if info.default is not none %}{% if info.default is sameas(false) %}Default is false.{% else %}Default is {{ info.default }}.{% endif %}{% endif %}{% endif %} {% endfilter %} + {% endif %} {% endfor %} {% endif %} """