diff --git a/elasticsearch/_async/client/ml.py b/elasticsearch/_async/client/ml.py index f4e394cf..c9add184 100644 --- a/elasticsearch/_async/client/ml.py +++ b/elasticsearch/_async/client/ml.py @@ -1413,7 +1413,7 @@ class MlClient(NamespacedClient): """ Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. - ``_ + ``_ :arg model_id: The ID of the trained model to delete """ @@ -1422,7 +1422,7 @@ class MlClient(NamespacedClient): return await self.transport.perform_request( "DELETE", - _make_path("_ml", "inference", model_id), + _make_path("_ml", "trained_models", model_id), params=params, headers=headers, ) @@ -1459,7 +1459,7 @@ class MlClient(NamespacedClient): async def get_trained_models(self, model_id=None, params=None, headers=None): """ Retrieves configuration information for a trained inference model. - ``_ + ``_ :arg model_id: The ID of the trained models to fetch :arg allow_no_match: Whether to ignore if a wildcard expression @@ -1488,7 +1488,7 @@ class MlClient(NamespacedClient): return await self.transport.perform_request( "GET", - _make_path("_ml", "inference", model_id), + _make_path("_ml", "trained_models", model_id), params=params, headers=headers, ) @@ -1497,7 +1497,7 @@ class MlClient(NamespacedClient): async def get_trained_models_stats(self, model_id=None, params=None, headers=None): """ Retrieves usage information for trained inference models. - ``_ + ``_ :arg model_id: The ID of the trained models stats to fetch :arg allow_no_match: Whether to ignore if a wildcard expression @@ -1513,7 +1513,7 @@ class MlClient(NamespacedClient): return await self.transport.perform_request( "GET", - _make_path("_ml", "inference", model_id, "_stats"), + _make_path("_ml", "trained_models", model_id, "_stats"), params=params, headers=headers, ) @@ -1522,7 +1522,7 @@ class MlClient(NamespacedClient): async def put_trained_model(self, model_id, body, params=None, headers=None): """ Creates an inference trained model. - ``_ + ``_ :arg model_id: The ID of the trained models to store :arg body: The trained model configuration @@ -1533,7 +1533,7 @@ class MlClient(NamespacedClient): return await self.transport.perform_request( "PUT", - _make_path("_ml", "inference", model_id), + _make_path("_ml", "trained_models", model_id), params=params, headers=headers, body=body, diff --git a/elasticsearch/_async/client/security.py b/elasticsearch/_async/client/security.py index f805d5c0..552e390f 100644 --- a/elasticsearch/_async/client/security.py +++ b/elasticsearch/_async/client/security.py @@ -530,3 +530,22 @@ class SecurityClient(NamespacedClient): params=params, headers=headers, ) + + @query_params() + async def clear_api_key_cache(self, ids, params=None, headers=None): + """ + Clear a subset or all entries from the API key cache. + ``_ + + :arg ids: A comma-separated list of IDs of API keys to clear + from the cache + """ + if ids in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'ids'.") + + return await self.transport.perform_request( + "POST", + _make_path("_security", "api_key", ids, "_clear_cache"), + params=params, + headers=headers, + ) diff --git a/elasticsearch/_async/client/security.pyi b/elasticsearch/_async/client/security.pyi index a62d8893..35a29fdc 100644 --- a/elasticsearch/_async/client/security.pyi +++ b/elasticsearch/_async/client/security.pyi @@ -418,3 +418,17 @@ class SecurityClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... + async def clear_api_key_cache( + self, + ids: 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] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ... diff --git a/elasticsearch/client/ml.py b/elasticsearch/client/ml.py index 45d88f1c..bea50a20 100644 --- a/elasticsearch/client/ml.py +++ b/elasticsearch/client/ml.py @@ -1399,7 +1399,7 @@ class MlClient(NamespacedClient): """ Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. - ``_ + ``_ :arg model_id: The ID of the trained model to delete """ @@ -1408,7 +1408,7 @@ class MlClient(NamespacedClient): return self.transport.perform_request( "DELETE", - _make_path("_ml", "inference", model_id), + _make_path("_ml", "trained_models", model_id), params=params, headers=headers, ) @@ -1445,7 +1445,7 @@ class MlClient(NamespacedClient): def get_trained_models(self, model_id=None, params=None, headers=None): """ Retrieves configuration information for a trained inference model. - ``_ + ``_ :arg model_id: The ID of the trained models to fetch :arg allow_no_match: Whether to ignore if a wildcard expression @@ -1474,7 +1474,7 @@ class MlClient(NamespacedClient): return self.transport.perform_request( "GET", - _make_path("_ml", "inference", model_id), + _make_path("_ml", "trained_models", model_id), params=params, headers=headers, ) @@ -1483,7 +1483,7 @@ class MlClient(NamespacedClient): def get_trained_models_stats(self, model_id=None, params=None, headers=None): """ Retrieves usage information for trained inference models. - ``_ + ``_ :arg model_id: The ID of the trained models stats to fetch :arg allow_no_match: Whether to ignore if a wildcard expression @@ -1499,7 +1499,7 @@ class MlClient(NamespacedClient): return self.transport.perform_request( "GET", - _make_path("_ml", "inference", model_id, "_stats"), + _make_path("_ml", "trained_models", model_id, "_stats"), params=params, headers=headers, ) @@ -1508,7 +1508,7 @@ class MlClient(NamespacedClient): def put_trained_model(self, model_id, body, params=None, headers=None): """ Creates an inference trained model. - ``_ + ``_ :arg model_id: The ID of the trained models to store :arg body: The trained model configuration @@ -1519,7 +1519,7 @@ class MlClient(NamespacedClient): return self.transport.perform_request( "PUT", - _make_path("_ml", "inference", model_id), + _make_path("_ml", "trained_models", model_id), params=params, headers=headers, body=body, diff --git a/elasticsearch/client/security.py b/elasticsearch/client/security.py index 059cc0d4..7274aa9d 100644 --- a/elasticsearch/client/security.py +++ b/elasticsearch/client/security.py @@ -528,3 +528,22 @@ class SecurityClient(NamespacedClient): params=params, headers=headers, ) + + @query_params() + def clear_api_key_cache(self, ids, params=None, headers=None): + """ + Clear a subset or all entries from the API key cache. + ``_ + + :arg ids: A comma-separated list of IDs of API keys to clear + from the cache + """ + if ids in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'ids'.") + + return self.transport.perform_request( + "POST", + _make_path("_security", "api_key", ids, "_clear_cache"), + params=params, + headers=headers, + ) diff --git a/elasticsearch/client/security.pyi b/elasticsearch/client/security.pyi index 14d7e53e..7d34f7ac 100644 --- a/elasticsearch/client/security.pyi +++ b/elasticsearch/client/security.pyi @@ -418,3 +418,17 @@ class SecurityClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... + def clear_api_key_cache( + self, + ids: 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] = ..., + params: Optional[MutableMapping[str, Any]] = ..., + headers: Optional[MutableMapping[str, str]] = ..., + ) -> Any: ...