From 1fd718c225f18c2cdd7eacbe4c37b4df28a89fab Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Wed, 16 Oct 2024 09:41:25 +0200 Subject: [PATCH] Auto-generated code for main (#2660) --- elasticsearch/_async/client/cluster.py | 8 +- elasticsearch/_async/client/esql.py | 9 ++- elasticsearch/_async/client/ilm.py | 6 +- elasticsearch/_async/client/ingest.py | 6 +- .../_async/client/search_application.py | 19 +++-- elasticsearch/_async/client/security.py | 10 ++- elasticsearch/_async/client/snapshot.py | 78 +++++++++++++++++++ elasticsearch/_async/client/sql.py | 6 +- elasticsearch/_async/client/xpack.py | 4 +- elasticsearch/_sync/client/cluster.py | 8 +- elasticsearch/_sync/client/esql.py | 9 ++- elasticsearch/_sync/client/ilm.py | 6 +- elasticsearch/_sync/client/ingest.py | 6 +- .../_sync/client/search_application.py | 19 +++-- elasticsearch/_sync/client/security.py | 10 ++- elasticsearch/_sync/client/snapshot.py | 78 +++++++++++++++++++ elasticsearch/_sync/client/sql.py | 6 +- elasticsearch/_sync/client/xpack.py | 4 +- 18 files changed, 254 insertions(+), 38 deletions(-) diff --git a/elasticsearch/_async/client/cluster.py b/elasticsearch/_async/client/cluster.py index dfd44b588..806a3d8bd 100644 --- a/elasticsearch/_async/client/cluster.py +++ b/elasticsearch/_async/client/cluster.py @@ -1053,8 +1053,8 @@ async def stats( node_id: t.Optional[t.Union[str, t.Sequence[str]]] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, - flat_settings: t.Optional[bool] = None, human: t.Optional[bool] = None, + include_remotes: t.Optional[bool] = None, pretty: t.Optional[bool] = None, timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None, ) -> ObjectApiResponse[t.Any]: @@ -1067,7 +1067,7 @@ async def stats( :param node_id: Comma-separated list of node filters used to limit returned information. Defaults to all nodes in the cluster. - :param flat_settings: If `true`, returns settings in flat format. + :param include_remotes: Include remote cluster data into the response :param timeout: Period to wait for each node to respond. If a node does not respond before its timeout expires, the response does not include its stats. However, timed out nodes are included in the response’s `_nodes.failed` property. @@ -1085,10 +1085,10 @@ async def stats( __query["error_trace"] = error_trace if filter_path is not None: __query["filter_path"] = filter_path - if flat_settings is not None: - __query["flat_settings"] = flat_settings if human is not None: __query["human"] = human + if include_remotes is not None: + __query["include_remotes"] = include_remotes if pretty is not None: __query["pretty"] = pretty if timeout is not None: diff --git a/elasticsearch/_async/client/esql.py b/elasticsearch/_async/client/esql.py index d0849643e..f708a1a12 100644 --- a/elasticsearch/_async/client/esql.py +++ b/elasticsearch/_async/client/esql.py @@ -47,7 +47,14 @@ async def query( error_trace: t.Optional[bool] = None, filter: t.Optional[t.Mapping[str, t.Any]] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, - format: t.Optional[str] = None, + format: t.Optional[ + t.Union[ + str, + t.Literal[ + "arrow", "cbor", "csv", "json", "smile", "tsv", "txt", "yaml" + ], + ] + ] = None, human: t.Optional[bool] = None, locale: t.Optional[str] = None, params: t.Optional[ diff --git a/elasticsearch/_async/client/ilm.py b/elasticsearch/_async/client/ilm.py index 9a644f797..9422f6be4 100644 --- a/elasticsearch/_async/client/ilm.py +++ b/elasticsearch/_async/client/ilm.py @@ -304,10 +304,10 @@ async def move_to_step( *, index: str, current_step: t.Optional[t.Mapping[str, t.Any]] = None, + next_step: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, - next_step: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, body: t.Optional[t.Dict[str, t.Any]] = None, ) -> ObjectApiResponse[t.Any]: @@ -322,6 +322,10 @@ async def move_to_step( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") + if current_step is None and body is None: + raise ValueError("Empty value passed for parameter 'current_step'") + if next_step is None and body is None: + raise ValueError("Empty value passed for parameter 'next_step'") __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/_ilm/move/{__path_parts["index"]}' __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_async/client/ingest.py b/elasticsearch/_async/client/ingest.py index c98e11b2a..f8fa9d3a3 100644 --- a/elasticsearch/_async/client/ingest.py +++ b/elasticsearch/_async/client/ingest.py @@ -40,7 +40,7 @@ async def delete_geoip_database( """ Deletes a geoip database configuration. - ``_ + ``_ :param id: A comma-separated list of geoip database configurations to delete :param master_timeout: Period to wait for a connection to the master node. If @@ -177,7 +177,7 @@ async def get_geoip_database( """ Returns information about one or more geoip database configurations. - ``_ + ``_ :param id: Comma-separated list of database configuration IDs to retrieve. Wildcard (`*`) expressions are supported. To get all database configurations, omit @@ -327,7 +327,7 @@ async def put_geoip_database( """ Returns information about one or more geoip database configurations. - ``_ + ``_ :param id: ID of the database configuration to create or update. :param maxmind: The configuration necessary to identify which IP geolocation diff --git a/elasticsearch/_async/client/search_application.py b/elasticsearch/_async/client/search_application.py index 73fc36897..f35714b39 100644 --- a/elasticsearch/_async/client/search_application.py +++ b/elasticsearch/_async/client/search_application.py @@ -36,7 +36,8 @@ async def delete( pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ - Deletes a search application. + Delete a search application. Remove a search application and its associated alias. + Indices attached to the search application are not removed. ``_ @@ -76,7 +77,8 @@ async def delete_behavioral_analytics( pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ - Delete a behavioral analytics collection. + Delete a behavioral analytics collection. The associated data stream is also + deleted. ``_ @@ -116,7 +118,7 @@ async def get( pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ - Returns the details about a search application + Get search application details. ``_ @@ -156,7 +158,7 @@ async def get_behavioral_analytics( pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ - Returns the existing behavioral analytics collections. + Get behavioral analytics collections. ``_ @@ -254,7 +256,7 @@ async def put( pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ - Creates or updates a search application. + Create or update a search application. ``_ @@ -307,7 +309,7 @@ async def put_behavioral_analytics( pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ - Creates a behavioral analytics collection. + Create a behavioral analytics collection. ``_ @@ -353,7 +355,10 @@ async def search( body: t.Optional[t.Dict[str, t.Any]] = None, ) -> ObjectApiResponse[t.Any]: """ - Perform a search against a search application. + Run a search application search. Generate and run an Elasticsearch query that + uses the specified query parameteter and the search template associated with + the search application or default template. Unspecified template parameters are + assigned their default values if applicable. ``_ diff --git a/elasticsearch/_async/client/security.py b/elasticsearch/_async/client/security.py index e8edd8f44..b330942a7 100644 --- a/elasticsearch/_async/client/security.py +++ b/elasticsearch/_async/client/security.py @@ -2285,6 +2285,7 @@ async def put_privileges( "global_", "indices", "metadata", + "remote_indices", "run_as", "transient_metadata", ), @@ -2373,6 +2374,7 @@ async def put_role( refresh: t.Optional[ t.Union[bool, str, t.Literal["false", "true", "wait_for"]] ] = None, + remote_indices: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, run_as: t.Optional[t.Sequence[str]] = None, transient_metadata: t.Optional[t.Mapping[str, t.Any]] = None, body: t.Optional[t.Dict[str, t.Any]] = None, @@ -2384,7 +2386,10 @@ async def put_role( ``_ - :param name: The name of the role. + :param name: The name of the role that is being created or updated. On Elasticsearch + Serverless, the role name must begin with a letter or digit and can only + contain letters, digits and the characters '_', '-', and '.'. Each role must + have a unique name, as this will serve as the identifier for that role. :param applications: A list of application privilege entries. :param cluster: A list of cluster privileges. These privileges define the cluster-level actions for users with this role. @@ -2398,6 +2403,7 @@ async def put_role( :param refresh: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. + :param remote_indices: A list of remote indices permissions entries. :param run_as: A list of users that the owners of this role can impersonate. *Note*: in Serverless, the run-as feature is disabled. For API compatibility, you can still specify an empty `run_as` field, but a non-empty list will @@ -2438,6 +2444,8 @@ async def put_role( __body["indices"] = indices if metadata is not None: __body["metadata"] = metadata + if remote_indices is not None: + __body["remote_indices"] = remote_indices if run_as is not None: __body["run_as"] = run_as if transient_metadata is not None: diff --git a/elasticsearch/_async/client/snapshot.py b/elasticsearch/_async/client/snapshot.py index 6f2d6bcbf..3f66d60fb 100644 --- a/elasticsearch/_async/client/snapshot.py +++ b/elasticsearch/_async/client/snapshot.py @@ -616,6 +616,84 @@ async def get_repository( path_parts=__path_parts, ) + @_rewrite_parameters() + async def repository_verify_integrity( + self, + *, + name: t.Union[str, t.Sequence[str]], + blob_thread_pool_concurrency: t.Optional[int] = None, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, + human: t.Optional[bool] = None, + index_snapshot_verification_concurrency: t.Optional[int] = None, + index_verification_concurrency: t.Optional[int] = None, + max_bytes_per_sec: t.Optional[str] = None, + max_failed_shard_snapshots: t.Optional[int] = None, + meta_thread_pool_concurrency: t.Optional[int] = None, + pretty: t.Optional[bool] = None, + snapshot_verification_concurrency: t.Optional[int] = None, + verify_blob_contents: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Verifies the integrity of the contents of a snapshot repository + + ``_ + + :param name: A repository name + :param blob_thread_pool_concurrency: Number of threads to use for reading blob + contents + :param index_snapshot_verification_concurrency: Number of snapshots to verify + concurrently within each index + :param index_verification_concurrency: Number of indices to verify concurrently + :param max_bytes_per_sec: Rate limit for individual blob verification + :param max_failed_shard_snapshots: Maximum permitted number of failed shard snapshots + :param meta_thread_pool_concurrency: Number of threads to use for reading metadata + :param snapshot_verification_concurrency: Number of snapshots to verify concurrently + :param verify_blob_contents: Whether to verify the contents of individual blobs + """ + if name in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'name'") + __path_parts: t.Dict[str, str] = {"repository": _quote(name)} + __path = f'/_snapshot/{__path_parts["repository"]}/_verify_integrity' + __query: t.Dict[str, t.Any] = {} + if blob_thread_pool_concurrency is not None: + __query["blob_thread_pool_concurrency"] = blob_thread_pool_concurrency + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if index_snapshot_verification_concurrency is not None: + __query["index_snapshot_verification_concurrency"] = ( + index_snapshot_verification_concurrency + ) + if index_verification_concurrency is not None: + __query["index_verification_concurrency"] = index_verification_concurrency + if max_bytes_per_sec is not None: + __query["max_bytes_per_sec"] = max_bytes_per_sec + if max_failed_shard_snapshots is not None: + __query["max_failed_shard_snapshots"] = max_failed_shard_snapshots + if meta_thread_pool_concurrency is not None: + __query["meta_thread_pool_concurrency"] = meta_thread_pool_concurrency + if pretty is not None: + __query["pretty"] = pretty + if snapshot_verification_concurrency is not None: + __query["snapshot_verification_concurrency"] = ( + snapshot_verification_concurrency + ) + if verify_blob_contents is not None: + __query["verify_blob_contents"] = verify_blob_contents + __headers = {"accept": "application/json"} + return await self.perform_request( # type: ignore[return-value] + "POST", + __path, + params=__query, + headers=__headers, + endpoint_id="snapshot.repository_verify_integrity", + path_parts=__path_parts, + ) + @_rewrite_parameters( body_fields=( "feature_states", diff --git a/elasticsearch/_async/client/sql.py b/elasticsearch/_async/client/sql.py index c089ed495..a376d5296 100644 --- a/elasticsearch/_async/client/sql.py +++ b/elasticsearch/_async/client/sql.py @@ -251,7 +251,11 @@ async def query( field_multi_value_leniency: t.Optional[bool] = None, filter: t.Optional[t.Mapping[str, t.Any]] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, - format: t.Optional[str] = None, + format: t.Optional[ + t.Union[ + str, t.Literal["cbor", "csv", "json", "smile", "tsv", "txt", "yaml"] + ] + ] = None, human: t.Optional[bool] = None, index_using_frozen: t.Optional[bool] = None, keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None, diff --git a/elasticsearch/_async/client/xpack.py b/elasticsearch/_async/client/xpack.py index a0c5042fe..ab1396e58 100644 --- a/elasticsearch/_async/client/xpack.py +++ b/elasticsearch/_async/client/xpack.py @@ -34,7 +34,9 @@ async def info( self, *, accept_enterprise: t.Optional[bool] = None, - categories: t.Optional[t.Sequence[str]] = None, + categories: t.Optional[ + t.Sequence[t.Union[str, t.Literal["build", "features", "license"]]] + ] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, diff --git a/elasticsearch/_sync/client/cluster.py b/elasticsearch/_sync/client/cluster.py index 19dc76b99..2df719b90 100644 --- a/elasticsearch/_sync/client/cluster.py +++ b/elasticsearch/_sync/client/cluster.py @@ -1053,8 +1053,8 @@ def stats( node_id: t.Optional[t.Union[str, t.Sequence[str]]] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, - flat_settings: t.Optional[bool] = None, human: t.Optional[bool] = None, + include_remotes: t.Optional[bool] = None, pretty: t.Optional[bool] = None, timeout: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None, ) -> ObjectApiResponse[t.Any]: @@ -1067,7 +1067,7 @@ def stats( :param node_id: Comma-separated list of node filters used to limit returned information. Defaults to all nodes in the cluster. - :param flat_settings: If `true`, returns settings in flat format. + :param include_remotes: Include remote cluster data into the response :param timeout: Period to wait for each node to respond. If a node does not respond before its timeout expires, the response does not include its stats. However, timed out nodes are included in the response’s `_nodes.failed` property. @@ -1085,10 +1085,10 @@ def stats( __query["error_trace"] = error_trace if filter_path is not None: __query["filter_path"] = filter_path - if flat_settings is not None: - __query["flat_settings"] = flat_settings if human is not None: __query["human"] = human + if include_remotes is not None: + __query["include_remotes"] = include_remotes if pretty is not None: __query["pretty"] = pretty if timeout is not None: diff --git a/elasticsearch/_sync/client/esql.py b/elasticsearch/_sync/client/esql.py index 844223895..19d8c71d5 100644 --- a/elasticsearch/_sync/client/esql.py +++ b/elasticsearch/_sync/client/esql.py @@ -47,7 +47,14 @@ def query( error_trace: t.Optional[bool] = None, filter: t.Optional[t.Mapping[str, t.Any]] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, - format: t.Optional[str] = None, + format: t.Optional[ + t.Union[ + str, + t.Literal[ + "arrow", "cbor", "csv", "json", "smile", "tsv", "txt", "yaml" + ], + ] + ] = None, human: t.Optional[bool] = None, locale: t.Optional[str] = None, params: t.Optional[ diff --git a/elasticsearch/_sync/client/ilm.py b/elasticsearch/_sync/client/ilm.py index 48a68fa2a..674b47f39 100644 --- a/elasticsearch/_sync/client/ilm.py +++ b/elasticsearch/_sync/client/ilm.py @@ -304,10 +304,10 @@ def move_to_step( *, index: str, current_step: t.Optional[t.Mapping[str, t.Any]] = None, + next_step: t.Optional[t.Mapping[str, t.Any]] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None, - next_step: t.Optional[t.Mapping[str, t.Any]] = None, pretty: t.Optional[bool] = None, body: t.Optional[t.Dict[str, t.Any]] = None, ) -> ObjectApiResponse[t.Any]: @@ -322,6 +322,10 @@ def move_to_step( """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for parameter 'index'") + if current_step is None and body is None: + raise ValueError("Empty value passed for parameter 'current_step'") + if next_step is None and body is None: + raise ValueError("Empty value passed for parameter 'next_step'") __path_parts: t.Dict[str, str] = {"index": _quote(index)} __path = f'/_ilm/move/{__path_parts["index"]}' __query: t.Dict[str, t.Any] = {} diff --git a/elasticsearch/_sync/client/ingest.py b/elasticsearch/_sync/client/ingest.py index d88d12f97..2874acea5 100644 --- a/elasticsearch/_sync/client/ingest.py +++ b/elasticsearch/_sync/client/ingest.py @@ -40,7 +40,7 @@ def delete_geoip_database( """ Deletes a geoip database configuration. - ``_ + ``_ :param id: A comma-separated list of geoip database configurations to delete :param master_timeout: Period to wait for a connection to the master node. If @@ -177,7 +177,7 @@ def get_geoip_database( """ Returns information about one or more geoip database configurations. - ``_ + ``_ :param id: Comma-separated list of database configuration IDs to retrieve. Wildcard (`*`) expressions are supported. To get all database configurations, omit @@ -327,7 +327,7 @@ def put_geoip_database( """ Returns information about one or more geoip database configurations. - ``_ + ``_ :param id: ID of the database configuration to create or update. :param maxmind: The configuration necessary to identify which IP geolocation diff --git a/elasticsearch/_sync/client/search_application.py b/elasticsearch/_sync/client/search_application.py index e6483fe8e..69a186eb0 100644 --- a/elasticsearch/_sync/client/search_application.py +++ b/elasticsearch/_sync/client/search_application.py @@ -36,7 +36,8 @@ def delete( pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ - Deletes a search application. + Delete a search application. Remove a search application and its associated alias. + Indices attached to the search application are not removed. ``_ @@ -76,7 +77,8 @@ def delete_behavioral_analytics( pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ - Delete a behavioral analytics collection. + Delete a behavioral analytics collection. The associated data stream is also + deleted. ``_ @@ -116,7 +118,7 @@ def get( pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ - Returns the details about a search application + Get search application details. ``_ @@ -156,7 +158,7 @@ def get_behavioral_analytics( pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ - Returns the existing behavioral analytics collections. + Get behavioral analytics collections. ``_ @@ -254,7 +256,7 @@ def put( pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ - Creates or updates a search application. + Create or update a search application. ``_ @@ -307,7 +309,7 @@ def put_behavioral_analytics( pretty: t.Optional[bool] = None, ) -> ObjectApiResponse[t.Any]: """ - Creates a behavioral analytics collection. + Create a behavioral analytics collection. ``_ @@ -353,7 +355,10 @@ def search( body: t.Optional[t.Dict[str, t.Any]] = None, ) -> ObjectApiResponse[t.Any]: """ - Perform a search against a search application. + Run a search application search. Generate and run an Elasticsearch query that + uses the specified query parameteter and the search template associated with + the search application or default template. Unspecified template parameters are + assigned their default values if applicable. ``_ diff --git a/elasticsearch/_sync/client/security.py b/elasticsearch/_sync/client/security.py index 28b98fdba..b6ed81d56 100644 --- a/elasticsearch/_sync/client/security.py +++ b/elasticsearch/_sync/client/security.py @@ -2285,6 +2285,7 @@ def put_privileges( "global_", "indices", "metadata", + "remote_indices", "run_as", "transient_metadata", ), @@ -2373,6 +2374,7 @@ def put_role( refresh: t.Optional[ t.Union[bool, str, t.Literal["false", "true", "wait_for"]] ] = None, + remote_indices: t.Optional[t.Sequence[t.Mapping[str, t.Any]]] = None, run_as: t.Optional[t.Sequence[str]] = None, transient_metadata: t.Optional[t.Mapping[str, t.Any]] = None, body: t.Optional[t.Dict[str, t.Any]] = None, @@ -2384,7 +2386,10 @@ def put_role( ``_ - :param name: The name of the role. + :param name: The name of the role that is being created or updated. On Elasticsearch + Serverless, the role name must begin with a letter or digit and can only + contain letters, digits and the characters '_', '-', and '.'. Each role must + have a unique name, as this will serve as the identifier for that role. :param applications: A list of application privilege entries. :param cluster: A list of cluster privileges. These privileges define the cluster-level actions for users with this role. @@ -2398,6 +2403,7 @@ def put_role( :param refresh: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. + :param remote_indices: A list of remote indices permissions entries. :param run_as: A list of users that the owners of this role can impersonate. *Note*: in Serverless, the run-as feature is disabled. For API compatibility, you can still specify an empty `run_as` field, but a non-empty list will @@ -2438,6 +2444,8 @@ def put_role( __body["indices"] = indices if metadata is not None: __body["metadata"] = metadata + if remote_indices is not None: + __body["remote_indices"] = remote_indices if run_as is not None: __body["run_as"] = run_as if transient_metadata is not None: diff --git a/elasticsearch/_sync/client/snapshot.py b/elasticsearch/_sync/client/snapshot.py index bb5297e26..1dc982ee5 100644 --- a/elasticsearch/_sync/client/snapshot.py +++ b/elasticsearch/_sync/client/snapshot.py @@ -616,6 +616,84 @@ def get_repository( path_parts=__path_parts, ) + @_rewrite_parameters() + def repository_verify_integrity( + self, + *, + name: t.Union[str, t.Sequence[str]], + blob_thread_pool_concurrency: t.Optional[int] = None, + error_trace: t.Optional[bool] = None, + filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, + human: t.Optional[bool] = None, + index_snapshot_verification_concurrency: t.Optional[int] = None, + index_verification_concurrency: t.Optional[int] = None, + max_bytes_per_sec: t.Optional[str] = None, + max_failed_shard_snapshots: t.Optional[int] = None, + meta_thread_pool_concurrency: t.Optional[int] = None, + pretty: t.Optional[bool] = None, + snapshot_verification_concurrency: t.Optional[int] = None, + verify_blob_contents: t.Optional[bool] = None, + ) -> ObjectApiResponse[t.Any]: + """ + Verifies the integrity of the contents of a snapshot repository + + ``_ + + :param name: A repository name + :param blob_thread_pool_concurrency: Number of threads to use for reading blob + contents + :param index_snapshot_verification_concurrency: Number of snapshots to verify + concurrently within each index + :param index_verification_concurrency: Number of indices to verify concurrently + :param max_bytes_per_sec: Rate limit for individual blob verification + :param max_failed_shard_snapshots: Maximum permitted number of failed shard snapshots + :param meta_thread_pool_concurrency: Number of threads to use for reading metadata + :param snapshot_verification_concurrency: Number of snapshots to verify concurrently + :param verify_blob_contents: Whether to verify the contents of individual blobs + """ + if name in SKIP_IN_PATH: + raise ValueError("Empty value passed for parameter 'name'") + __path_parts: t.Dict[str, str] = {"repository": _quote(name)} + __path = f'/_snapshot/{__path_parts["repository"]}/_verify_integrity' + __query: t.Dict[str, t.Any] = {} + if blob_thread_pool_concurrency is not None: + __query["blob_thread_pool_concurrency"] = blob_thread_pool_concurrency + if error_trace is not None: + __query["error_trace"] = error_trace + if filter_path is not None: + __query["filter_path"] = filter_path + if human is not None: + __query["human"] = human + if index_snapshot_verification_concurrency is not None: + __query["index_snapshot_verification_concurrency"] = ( + index_snapshot_verification_concurrency + ) + if index_verification_concurrency is not None: + __query["index_verification_concurrency"] = index_verification_concurrency + if max_bytes_per_sec is not None: + __query["max_bytes_per_sec"] = max_bytes_per_sec + if max_failed_shard_snapshots is not None: + __query["max_failed_shard_snapshots"] = max_failed_shard_snapshots + if meta_thread_pool_concurrency is not None: + __query["meta_thread_pool_concurrency"] = meta_thread_pool_concurrency + if pretty is not None: + __query["pretty"] = pretty + if snapshot_verification_concurrency is not None: + __query["snapshot_verification_concurrency"] = ( + snapshot_verification_concurrency + ) + if verify_blob_contents is not None: + __query["verify_blob_contents"] = verify_blob_contents + __headers = {"accept": "application/json"} + return self.perform_request( # type: ignore[return-value] + "POST", + __path, + params=__query, + headers=__headers, + endpoint_id="snapshot.repository_verify_integrity", + path_parts=__path_parts, + ) + @_rewrite_parameters( body_fields=( "feature_states", diff --git a/elasticsearch/_sync/client/sql.py b/elasticsearch/_sync/client/sql.py index 3635bfc0b..bd8afc05e 100644 --- a/elasticsearch/_sync/client/sql.py +++ b/elasticsearch/_sync/client/sql.py @@ -251,7 +251,11 @@ def query( field_multi_value_leniency: t.Optional[bool] = None, filter: t.Optional[t.Mapping[str, t.Any]] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, - format: t.Optional[str] = None, + format: t.Optional[ + t.Union[ + str, t.Literal["cbor", "csv", "json", "smile", "tsv", "txt", "yaml"] + ] + ] = None, human: t.Optional[bool] = None, index_using_frozen: t.Optional[bool] = None, keep_alive: t.Optional[t.Union[str, t.Literal[-1], t.Literal[0]]] = None, diff --git a/elasticsearch/_sync/client/xpack.py b/elasticsearch/_sync/client/xpack.py index 8ff48f904..ddcdc3c54 100644 --- a/elasticsearch/_sync/client/xpack.py +++ b/elasticsearch/_sync/client/xpack.py @@ -34,7 +34,9 @@ def info( self, *, accept_enterprise: t.Optional[bool] = None, - categories: t.Optional[t.Sequence[str]] = None, + categories: t.Optional[ + t.Sequence[t.Union[str, t.Literal["build", "features", "license"]]] + ] = None, error_trace: t.Optional[bool] = None, filter_path: t.Optional[t.Union[str, t.Sequence[str]]] = None, human: t.Optional[bool] = None,