diff --git a/elasticsearch/_async/client/__init__.py b/elasticsearch/_async/client/__init__.py index 69c91dc5..485a0a09 100644 --- a/elasticsearch/_async/client/__init__.py +++ b/elasticsearch/_async/client/__init__.py @@ -1190,8 +1190,7 @@ class AsyncElasticsearch(object): :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, query_and_fetch, dfs_query_then_fetch, - dfs_query_and_fetch + query_then_fetch, dfs_query_then_fetch :arg typed_keys: Specify whether aggregation and suggester names should be prefixed by their respective types in the response """ @@ -1236,8 +1235,7 @@ class AsyncElasticsearch(object): :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, query_and_fetch, dfs_query_then_fetch, - dfs_query_and_fetch + query_then_fetch, dfs_query_then_fetch :arg typed_keys: Specify whether aggregation and suggester names should be prefixed by their respective types in the response """ @@ -1774,8 +1772,7 @@ class AsyncElasticsearch(object): :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, query_and_fetch, dfs_query_then_fetch, - dfs_query_and_fetch + query_then_fetch, dfs_query_then_fetch :arg typed_keys: Specify whether aggregation and suggester names should be prefixed by their respective types in the response """ diff --git a/elasticsearch/_async/client/fleet.py b/elasticsearch/_async/client/fleet.py index 3f98b968..9149de48 100644 --- a/elasticsearch/_async/client/fleet.py +++ b/elasticsearch/_async/client/fleet.py @@ -19,7 +19,7 @@ from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params class FleetClient(NamespacedClient): - @query_params("checkpoints", "timeout", "wait_for_advance") + @query_params("checkpoints", "timeout", "wait_for_advance", "wait_for_index") async def global_checkpoints(self, index, params=None, headers=None): """ Returns the current global checkpoints for an index. This API is design for @@ -36,6 +36,8 @@ class FleetClient(NamespacedClient): Default: 30s :arg wait_for_advance: Whether to wait for the global checkpoint to advance past the specified current checkpoints Default: false + :arg wait_for_index: Whether to wait for the target index to + exist and all primary shards be active Default: false """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") diff --git a/elasticsearch/_async/client/fleet.pyi b/elasticsearch/_async/client/fleet.pyi index 77878bd9..77b884a6 100644 --- a/elasticsearch/_async/client/fleet.pyi +++ b/elasticsearch/_async/client/fleet.pyi @@ -27,6 +27,7 @@ class FleetClient(NamespacedClient): checkpoints: Optional[Any] = ..., timeout: Optional[Any] = ..., wait_for_advance: Optional[Any] = ..., + wait_for_index: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., diff --git a/elasticsearch/_async/client/ml.py b/elasticsearch/_async/client/ml.py index 76d68a3c..0a0be4e2 100644 --- a/elasticsearch/_async/client/ml.py +++ b/elasticsearch/_async/client/ml.py @@ -1234,11 +1234,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg id: The ID of the data frame analytics to delete :arg force: True if the job should be forcefully deleted :arg timeout: Controls the time to wait until a job is deleted. @@ -1261,11 +1256,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg body: The evaluation definition """ if body in SKIP_IN_PATH: @@ -1286,11 +1276,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg id: The ID of the data frame analytics to fetch :arg allow_no_match: Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no @@ -1319,11 +1304,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg id: The ID of the data frame analytics stats to fetch :arg allow_no_match: Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no @@ -1351,11 +1331,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg id: The ID of the data frame analytics to create :arg body: The data frame analytics configuration """ @@ -1380,11 +1355,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg id: The ID of the data frame analytics to start :arg body: The start data frame analytics parameters :arg timeout: Controls the time to wait until the task has @@ -1408,11 +1378,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg id: The ID of the data frame analytics to stop :arg body: The stop data frame analytics parameters :arg allow_no_match: Whether to ignore if a wildcard expression @@ -1442,11 +1407,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg model_id: The ID of the trained model to delete """ if model_id in SKIP_IN_PATH: @@ -1468,11 +1428,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg body: The data frame analytics config to explain :arg id: The ID of the data frame analytics to explain """ @@ -1500,11 +1455,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg model_id: The ID of the trained models to fetch :arg allow_no_match: Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no @@ -1544,11 +1494,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg model_id: The ID of the trained models stats to fetch :arg allow_no_match: Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no @@ -1575,11 +1520,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg model_id: The ID of the trained models to store :arg body: The trained model configuration """ @@ -1623,11 +1563,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg id: The ID of the data frame analytics to update :arg body: The data frame analytics settings to update """ @@ -1686,11 +1621,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg model_id: The trained model where the model alias is assigned :arg model_alias: The trained model alias to delete @@ -1715,11 +1645,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg body: The data frame analytics config to preview :arg id: The ID of the data frame analytics to preview """ @@ -1741,11 +1666,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg model_id: The trained model where the model alias should be assigned :arg model_alias: The trained model alias to update diff --git a/elasticsearch/_async/client/searchable_snapshots.py b/elasticsearch/_async/client/searchable_snapshots.py index e5c59c70..83cd5d73 100644 --- a/elasticsearch/_async/client/searchable_snapshots.py +++ b/elasticsearch/_async/client/searchable_snapshots.py @@ -112,7 +112,7 @@ class SearchableSnapshotsClient(NamespacedClient): @query_params("level") async def stats(self, index=None, params=None, headers=None): """ - Retrieve various statistics about searchable snapshots. + Retrieve shard-level statistics about searchable snapshots. ``_ @@ -131,3 +131,27 @@ class SearchableSnapshotsClient(NamespacedClient): params=params, headers=headers, ) + + @query_params() + async def cache_stats(self, node_id=None, params=None, headers=None): + """ + Retrieve node-level cache statistics about searchable snapshots. + + ``_ + + .. warning:: + + This API is **experimental** so may include breaking changes + or be removed in a future version + + :arg node_id: A comma-separated list of node IDs or names to + limit the returned information; use `_local` to return information from + the node you're connecting to, leave empty to get information from all + nodes + """ + return await self.transport.perform_request( + "GET", + _make_path("_searchable_snapshots", node_id, "cache", "stats"), + params=params, + headers=headers, + ) diff --git a/elasticsearch/_async/client/searchable_snapshots.pyi b/elasticsearch/_async/client/searchable_snapshots.pyi index d675a01a..05b2016c 100644 --- a/elasticsearch/_async/client/searchable_snapshots.pyi +++ b/elasticsearch/_async/client/searchable_snapshots.pyi @@ -97,3 +97,20 @@ class SearchableSnapshotsClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... + async def cache_stats( + self, + *, + node_id: 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/elasticsearch/_async/client/security.py b/elasticsearch/_async/client/security.py index 75a7283f..93cc4ac8 100644 --- a/elasticsearch/_async/client/security.py +++ b/elasticsearch/_async/client/security.py @@ -601,3 +601,164 @@ class SecurityClient(NamespacedClient): headers=headers, body=body, ) + + @query_params() + async def clear_cached_service_tokens( + self, namespace, service, name, params=None, headers=None + ): + """ + Evicts tokens from the service account token caches. + + ``_ + + .. warning:: + + This API is **beta** so may include breaking changes + or be removed in a future version + + :arg namespace: An identifier for the namespace + :arg service: An identifier for the service name + :arg name: A comma-separated list of service token names + """ + for param in (namespace, service, name): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return await self.transport.perform_request( + "POST", + _make_path( + "_security", + "service", + namespace, + service, + "credential", + "token", + name, + "_clear_cache", + ), + params=params, + headers=headers, + ) + + @query_params("refresh") + async def create_service_token( + self, namespace, service, name=None, params=None, headers=None + ): + """ + Creates a service account token for access without requiring basic + authentication. + + ``_ + + .. warning:: + + This API is **beta** so may include breaking changes + or be removed in a future version + + :arg namespace: An identifier for the namespace + :arg service: An identifier for the service name + :arg name: An identifier for the token name + :arg refresh: If `true` then refresh the affected shards to make + this operation visible to search, if `wait_for` (the default) then wait + for a refresh to make this operation visible to search, if `false` then + do nothing with refreshes. Valid choices: true, false, wait_for + """ + for param in (namespace, service): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return await self.transport.perform_request( + "PUT", + _make_path( + "_security", "service", namespace, service, "credential", "token", name + ), + params=params, + headers=headers, + ) + + @query_params("refresh") + async def delete_service_token( + self, namespace, service, name, params=None, headers=None + ): + """ + Deletes a service account token. + + ``_ + + .. warning:: + + This API is **beta** so may include breaking changes + or be removed in a future version + + :arg namespace: An identifier for the namespace + :arg service: An identifier for the service name + :arg name: An identifier for the token name + :arg refresh: If `true` then refresh the affected shards to make + this operation visible to search, if `wait_for` (the default) then wait + for a refresh to make this operation visible to search, if `false` then + do nothing with refreshes. Valid choices: true, false, wait_for + """ + for param in (namespace, service, name): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return await self.transport.perform_request( + "DELETE", + _make_path( + "_security", "service", namespace, service, "credential", "token", name + ), + params=params, + headers=headers, + ) + + @query_params() + async def get_service_accounts( + self, namespace=None, service=None, params=None, headers=None + ): + """ + Retrieves information about service accounts. + + ``_ + + .. warning:: + + This API is **beta** so may include breaking changes + or be removed in a future version + + :arg namespace: An identifier for the namespace + :arg service: An identifier for the service name + """ + return await self.transport.perform_request( + "GET", + _make_path("_security", "service", namespace, service), + params=params, + headers=headers, + ) + + @query_params() + async def get_service_credentials( + self, namespace, service, params=None, headers=None + ): + """ + Retrieves information of all service credentials for a service account. + + ``_ + + .. warning:: + + This API is **beta** so may include breaking changes + or be removed in a future version + + :arg namespace: An identifier for the namespace + :arg service: An identifier for the service name + """ + for param in (namespace, service): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return await self.transport.perform_request( + "GET", + _make_path("_security", "service", namespace, service, "credential"), + params=params, + headers=headers, + ) diff --git a/elasticsearch/_async/client/security.pyi b/elasticsearch/_async/client/security.pyi index 03bd3851..31492975 100644 --- a/elasticsearch/_async/client/security.pyi +++ b/elasticsearch/_async/client/security.pyi @@ -535,3 +535,98 @@ class SecurityClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... + async def clear_cached_service_tokens( + self, + namespace: Any, + service: Any, + 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 create_service_token( + self, + namespace: Any, + service: Any, + *, + name: Optional[Any] = ..., + refresh: 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_service_token( + self, + namespace: Any, + service: Any, + name: Any, + *, + refresh: 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 get_service_accounts( + self, + *, + namespace: Optional[Any] = ..., + service: 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 get_service_credentials( + self, + namespace: Any, + service: 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/elasticsearch/_async/client/snapshot.py b/elasticsearch/_async/client/snapshot.py index 65f96bc1..42c35bcd 100644 --- a/elasticsearch/_async/client/snapshot.py +++ b/elasticsearch/_async/client/snapshot.py @@ -69,7 +69,7 @@ class SnapshotClient(NamespacedClient): headers=headers, ) - @query_params("ignore_unavailable", "master_timeout", "verbose") + @query_params("ignore_unavailable", "index_details", "master_timeout", "verbose") async def get(self, repository, snapshot, params=None, headers=None): """ Returns information about a snapshot. @@ -81,6 +81,8 @@ class SnapshotClient(NamespacedClient): :arg ignore_unavailable: Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown + :arg index_details: Whether to include details of each index in + the snapshot, if those details are available. Defaults to false. :arg master_timeout: Explicit operation timeout for connection to master node :arg verbose: Whether to show verbose snapshot info or only show diff --git a/elasticsearch/_async/client/snapshot.pyi b/elasticsearch/_async/client/snapshot.pyi index f685c025..6bf733a9 100644 --- a/elasticsearch/_async/client/snapshot.pyi +++ b/elasticsearch/_async/client/snapshot.pyi @@ -66,6 +66,7 @@ class SnapshotClient(NamespacedClient): snapshot: Any, *, ignore_unavailable: Optional[Any] = ..., + index_details: Optional[Any] = ..., master_timeout: Optional[Any] = ..., verbose: Optional[Any] = ..., pretty: Optional[bool] = ..., diff --git a/elasticsearch/client/__init__.py b/elasticsearch/client/__init__.py index b0f1407f..f6ec7cf1 100644 --- a/elasticsearch/client/__init__.py +++ b/elasticsearch/client/__init__.py @@ -1182,8 +1182,7 @@ class Elasticsearch(object): :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, query_and_fetch, dfs_query_then_fetch, - dfs_query_and_fetch + query_then_fetch, dfs_query_then_fetch :arg typed_keys: Specify whether aggregation and suggester names should be prefixed by their respective types in the response """ @@ -1228,8 +1227,7 @@ class Elasticsearch(object): :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, query_and_fetch, dfs_query_then_fetch, - dfs_query_and_fetch + query_then_fetch, dfs_query_then_fetch :arg typed_keys: Specify whether aggregation and suggester names should be prefixed by their respective types in the response """ @@ -1762,8 +1760,7 @@ class Elasticsearch(object): :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, query_and_fetch, dfs_query_then_fetch, - dfs_query_and_fetch + query_then_fetch, dfs_query_then_fetch :arg typed_keys: Specify whether aggregation and suggester names should be prefixed by their respective types in the response """ diff --git a/elasticsearch/client/fleet.py b/elasticsearch/client/fleet.py index bba0f5a9..633cdbb6 100644 --- a/elasticsearch/client/fleet.py +++ b/elasticsearch/client/fleet.py @@ -19,7 +19,7 @@ from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params class FleetClient(NamespacedClient): - @query_params("checkpoints", "timeout", "wait_for_advance") + @query_params("checkpoints", "timeout", "wait_for_advance", "wait_for_index") def global_checkpoints(self, index, params=None, headers=None): """ Returns the current global checkpoints for an index. This API is design for @@ -36,6 +36,8 @@ class FleetClient(NamespacedClient): Default: 30s :arg wait_for_advance: Whether to wait for the global checkpoint to advance past the specified current checkpoints Default: false + :arg wait_for_index: Whether to wait for the target index to + exist and all primary shards be active Default: false """ if index in SKIP_IN_PATH: raise ValueError("Empty value passed for a required argument 'index'.") diff --git a/elasticsearch/client/fleet.pyi b/elasticsearch/client/fleet.pyi index a1e5d5b9..2515bdd5 100644 --- a/elasticsearch/client/fleet.pyi +++ b/elasticsearch/client/fleet.pyi @@ -27,6 +27,7 @@ class FleetClient(NamespacedClient): checkpoints: Optional[Any] = ..., timeout: Optional[Any] = ..., wait_for_advance: Optional[Any] = ..., + wait_for_index: Optional[Any] = ..., pretty: Optional[bool] = ..., human: Optional[bool] = ..., error_trace: Optional[bool] = ..., diff --git a/elasticsearch/client/ml.py b/elasticsearch/client/ml.py index 2a3c7f6c..2645e873 100644 --- a/elasticsearch/client/ml.py +++ b/elasticsearch/client/ml.py @@ -1220,11 +1220,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg id: The ID of the data frame analytics to delete :arg force: True if the job should be forcefully deleted :arg timeout: Controls the time to wait until a job is deleted. @@ -1247,11 +1242,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg body: The evaluation definition """ if body in SKIP_IN_PATH: @@ -1272,11 +1262,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg id: The ID of the data frame analytics to fetch :arg allow_no_match: Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no @@ -1305,11 +1290,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg id: The ID of the data frame analytics stats to fetch :arg allow_no_match: Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no @@ -1337,11 +1317,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg id: The ID of the data frame analytics to create :arg body: The data frame analytics configuration """ @@ -1364,11 +1339,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg id: The ID of the data frame analytics to start :arg body: The start data frame analytics parameters :arg timeout: Controls the time to wait until the task has @@ -1392,11 +1362,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg id: The ID of the data frame analytics to stop :arg body: The stop data frame analytics parameters :arg allow_no_match: Whether to ignore if a wildcard expression @@ -1426,11 +1391,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg model_id: The ID of the trained model to delete """ if model_id in SKIP_IN_PATH: @@ -1452,11 +1412,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg body: The data frame analytics config to explain :arg id: The ID of the data frame analytics to explain """ @@ -1484,11 +1439,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg model_id: The ID of the trained models to fetch :arg allow_no_match: Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no @@ -1528,11 +1478,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg model_id: The ID of the trained models stats to fetch :arg allow_no_match: Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no @@ -1559,11 +1504,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg model_id: The ID of the trained models to store :arg body: The trained model configuration """ @@ -1607,11 +1547,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg id: The ID of the data frame analytics to update :arg body: The data frame analytics settings to update """ @@ -1668,11 +1603,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg model_id: The trained model where the model alias is assigned :arg model_alias: The trained model alias to delete @@ -1697,11 +1627,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg body: The data frame analytics config to preview :arg id: The ID of the data frame analytics to preview """ @@ -1721,11 +1646,6 @@ class MlClient(NamespacedClient): ``_ - .. warning:: - - This API is **beta** so may include breaking changes - or be removed in a future version - :arg model_id: The trained model where the model alias should be assigned :arg model_alias: The trained model alias to update diff --git a/elasticsearch/client/searchable_snapshots.py b/elasticsearch/client/searchable_snapshots.py index 8b828447..2bca5746 100644 --- a/elasticsearch/client/searchable_snapshots.py +++ b/elasticsearch/client/searchable_snapshots.py @@ -112,7 +112,7 @@ class SearchableSnapshotsClient(NamespacedClient): @query_params("level") def stats(self, index=None, params=None, headers=None): """ - Retrieve various statistics about searchable snapshots. + Retrieve shard-level statistics about searchable snapshots. ``_ @@ -131,3 +131,27 @@ class SearchableSnapshotsClient(NamespacedClient): params=params, headers=headers, ) + + @query_params() + def cache_stats(self, node_id=None, params=None, headers=None): + """ + Retrieve node-level cache statistics about searchable snapshots. + + ``_ + + .. warning:: + + This API is **experimental** so may include breaking changes + or be removed in a future version + + :arg node_id: A comma-separated list of node IDs or names to + limit the returned information; use `_local` to return information from + the node you're connecting to, leave empty to get information from all + nodes + """ + return self.transport.perform_request( + "GET", + _make_path("_searchable_snapshots", node_id, "cache", "stats"), + params=params, + headers=headers, + ) diff --git a/elasticsearch/client/searchable_snapshots.pyi b/elasticsearch/client/searchable_snapshots.pyi index a26decae..54790a8d 100644 --- a/elasticsearch/client/searchable_snapshots.pyi +++ b/elasticsearch/client/searchable_snapshots.pyi @@ -97,3 +97,20 @@ class SearchableSnapshotsClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... + def cache_stats( + self, + *, + node_id: 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/elasticsearch/client/security.py b/elasticsearch/client/security.py index 0b1c4c39..1adb591e 100644 --- a/elasticsearch/client/security.py +++ b/elasticsearch/client/security.py @@ -599,3 +599,160 @@ class SecurityClient(NamespacedClient): headers=headers, body=body, ) + + @query_params() + def clear_cached_service_tokens( + self, namespace, service, name, params=None, headers=None + ): + """ + Evicts tokens from the service account token caches. + + ``_ + + .. warning:: + + This API is **beta** so may include breaking changes + or be removed in a future version + + :arg namespace: An identifier for the namespace + :arg service: An identifier for the service name + :arg name: A comma-separated list of service token names + """ + for param in (namespace, service, name): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return self.transport.perform_request( + "POST", + _make_path( + "_security", + "service", + namespace, + service, + "credential", + "token", + name, + "_clear_cache", + ), + params=params, + headers=headers, + ) + + @query_params("refresh") + def create_service_token( + self, namespace, service, name=None, params=None, headers=None + ): + """ + Creates a service account token for access without requiring basic + authentication. + + ``_ + + .. warning:: + + This API is **beta** so may include breaking changes + or be removed in a future version + + :arg namespace: An identifier for the namespace + :arg service: An identifier for the service name + :arg name: An identifier for the token name + :arg refresh: If `true` then refresh the affected shards to make + this operation visible to search, if `wait_for` (the default) then wait + for a refresh to make this operation visible to search, if `false` then + do nothing with refreshes. Valid choices: true, false, wait_for + """ + for param in (namespace, service): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return self.transport.perform_request( + "PUT", + _make_path( + "_security", "service", namespace, service, "credential", "token", name + ), + params=params, + headers=headers, + ) + + @query_params("refresh") + def delete_service_token(self, namespace, service, name, params=None, headers=None): + """ + Deletes a service account token. + + ``_ + + .. warning:: + + This API is **beta** so may include breaking changes + or be removed in a future version + + :arg namespace: An identifier for the namespace + :arg service: An identifier for the service name + :arg name: An identifier for the token name + :arg refresh: If `true` then refresh the affected shards to make + this operation visible to search, if `wait_for` (the default) then wait + for a refresh to make this operation visible to search, if `false` then + do nothing with refreshes. Valid choices: true, false, wait_for + """ + for param in (namespace, service, name): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return self.transport.perform_request( + "DELETE", + _make_path( + "_security", "service", namespace, service, "credential", "token", name + ), + params=params, + headers=headers, + ) + + @query_params() + def get_service_accounts( + self, namespace=None, service=None, params=None, headers=None + ): + """ + Retrieves information about service accounts. + + ``_ + + .. warning:: + + This API is **beta** so may include breaking changes + or be removed in a future version + + :arg namespace: An identifier for the namespace + :arg service: An identifier for the service name + """ + return self.transport.perform_request( + "GET", + _make_path("_security", "service", namespace, service), + params=params, + headers=headers, + ) + + @query_params() + def get_service_credentials(self, namespace, service, params=None, headers=None): + """ + Retrieves information of all service credentials for a service account. + + ``_ + + .. warning:: + + This API is **beta** so may include breaking changes + or be removed in a future version + + :arg namespace: An identifier for the namespace + :arg service: An identifier for the service name + """ + for param in (namespace, service): + if param in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument.") + + return self.transport.perform_request( + "GET", + _make_path("_security", "service", namespace, service, "credential"), + params=params, + headers=headers, + ) diff --git a/elasticsearch/client/security.pyi b/elasticsearch/client/security.pyi index 82876e23..d3b268d3 100644 --- a/elasticsearch/client/security.pyi +++ b/elasticsearch/client/security.pyi @@ -535,3 +535,98 @@ class SecurityClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... + def clear_cached_service_tokens( + self, + namespace: Any, + service: Any, + 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 create_service_token( + self, + namespace: Any, + service: Any, + *, + name: Optional[Any] = ..., + refresh: 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_service_token( + self, + namespace: Any, + service: Any, + name: Any, + *, + refresh: 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 get_service_accounts( + self, + *, + namespace: Optional[Any] = ..., + service: 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 get_service_credentials( + self, + namespace: Any, + service: 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/elasticsearch/client/snapshot.py b/elasticsearch/client/snapshot.py index a007d2dd..e72c002d 100644 --- a/elasticsearch/client/snapshot.py +++ b/elasticsearch/client/snapshot.py @@ -69,7 +69,7 @@ class SnapshotClient(NamespacedClient): headers=headers, ) - @query_params("ignore_unavailable", "master_timeout", "verbose") + @query_params("ignore_unavailable", "index_details", "master_timeout", "verbose") def get(self, repository, snapshot, params=None, headers=None): """ Returns information about a snapshot. @@ -81,6 +81,8 @@ class SnapshotClient(NamespacedClient): :arg ignore_unavailable: Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown + :arg index_details: Whether to include details of each index in + the snapshot, if those details are available. Defaults to false. :arg master_timeout: Explicit operation timeout for connection to master node :arg verbose: Whether to show verbose snapshot info or only show diff --git a/elasticsearch/client/snapshot.pyi b/elasticsearch/client/snapshot.pyi index 0f9038da..2b8d9064 100644 --- a/elasticsearch/client/snapshot.pyi +++ b/elasticsearch/client/snapshot.pyi @@ -66,6 +66,7 @@ class SnapshotClient(NamespacedClient): snapshot: Any, *, ignore_unavailable: Optional[Any] = ..., + index_details: Optional[Any] = ..., master_timeout: Optional[Any] = ..., verbose: Optional[Any] = ..., pretty: Optional[bool] = ...,