From 3eb605ed9fea17322f80cecbe05b54cc3b1723a9 Mon Sep 17 00:00:00 2001 From: Seth Michael Larson Date: Mon, 21 Jun 2021 11:55:24 -0500 Subject: [PATCH] Update APIs to 7.x-SNAPSHOT --- elasticsearch/_async/client/ml.py | 21 +++++++++++++++++++++ elasticsearch/_async/client/ml.pyi | 18 ++++++++++++++++++ elasticsearch/client/ml.py | 21 +++++++++++++++++++++ elasticsearch/client/ml.pyi | 18 ++++++++++++++++++ 4 files changed, 78 insertions(+) diff --git a/elasticsearch/_async/client/ml.py b/elasticsearch/_async/client/ml.py index 0a0be4e2..5d932ff6 100644 --- a/elasticsearch/_async/client/ml.py +++ b/elasticsearch/_async/client/ml.py @@ -1755,3 +1755,24 @@ class MlClient(NamespacedClient): headers=headers, body=body, ) + + @query_params("wait_for_completion") + async def reset_job(self, job_id, params=None, headers=None): + """ + Resets an existing anomaly detection job. + + ``_ + + :arg job_id: The ID of the job to reset + :arg wait_for_completion: Should this request wait until the + operation has completed before returning Default: True + """ + if job_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'job_id'.") + + return await self.transport.perform_request( + "POST", + _make_path("_ml", "anomaly_detectors", job_id, "_reset"), + params=params, + headers=headers, + ) diff --git a/elasticsearch/_async/client/ml.pyi b/elasticsearch/_async/client/ml.pyi index 3367b208..8524ce85 100644 --- a/elasticsearch/_async/client/ml.pyi +++ b/elasticsearch/_async/client/ml.pyi @@ -1291,3 +1291,21 @@ class MlClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... + async def reset_job( + self, + job_id: Any, + *, + wait_for_completion: 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/ml.py b/elasticsearch/client/ml.py index 2645e873..131e1c80 100644 --- a/elasticsearch/client/ml.py +++ b/elasticsearch/client/ml.py @@ -1735,3 +1735,24 @@ class MlClient(NamespacedClient): headers=headers, body=body, ) + + @query_params("wait_for_completion") + def reset_job(self, job_id, params=None, headers=None): + """ + Resets an existing anomaly detection job. + + ``_ + + :arg job_id: The ID of the job to reset + :arg wait_for_completion: Should this request wait until the + operation has completed before returning Default: True + """ + if job_id in SKIP_IN_PATH: + raise ValueError("Empty value passed for a required argument 'job_id'.") + + return self.transport.perform_request( + "POST", + _make_path("_ml", "anomaly_detectors", job_id, "_reset"), + params=params, + headers=headers, + ) diff --git a/elasticsearch/client/ml.pyi b/elasticsearch/client/ml.pyi index 73bb793b..9ebbedfe 100644 --- a/elasticsearch/client/ml.pyi +++ b/elasticsearch/client/ml.pyi @@ -1291,3 +1291,21 @@ class MlClient(NamespacedClient): params: Optional[MutableMapping[str, Any]] = ..., headers: Optional[MutableMapping[str, str]] = ..., ) -> Any: ... + def reset_job( + self, + job_id: Any, + *, + wait_for_completion: 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: ...