Skip to content

Commit 3eb605e

Browse files
committed
Update APIs to 7.x-SNAPSHOT
1 parent 12aa997 commit 3eb605e

File tree

4 files changed

+78
-0
lines changed

4 files changed

+78
-0
lines changed

elasticsearch/_async/client/ml.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,3 +1755,24 @@ async def find_file_structure(self, body, params=None, headers=None):
17551755
headers=headers,
17561756
body=body,
17571757
)
1758+
1759+
@query_params("wait_for_completion")
1760+
async def reset_job(self, job_id, params=None, headers=None):
1761+
"""
1762+
Resets an existing anomaly detection job.
1763+
1764+
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ml-reset-job.html>`_
1765+
1766+
:arg job_id: The ID of the job to reset
1767+
:arg wait_for_completion: Should this request wait until the
1768+
operation has completed before returning Default: True
1769+
"""
1770+
if job_id in SKIP_IN_PATH:
1771+
raise ValueError("Empty value passed for a required argument 'job_id'.")
1772+
1773+
return await self.transport.perform_request(
1774+
"POST",
1775+
_make_path("_ml", "anomaly_detectors", job_id, "_reset"),
1776+
params=params,
1777+
headers=headers,
1778+
)

elasticsearch/_async/client/ml.pyi

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,3 +1291,21 @@ class MlClient(NamespacedClient):
12911291
params: Optional[MutableMapping[str, Any]] = ...,
12921292
headers: Optional[MutableMapping[str, str]] = ...,
12931293
) -> Any: ...
1294+
async def reset_job(
1295+
self,
1296+
job_id: Any,
1297+
*,
1298+
wait_for_completion: Optional[Any] = ...,
1299+
pretty: Optional[bool] = ...,
1300+
human: Optional[bool] = ...,
1301+
error_trace: Optional[bool] = ...,
1302+
format: Optional[str] = ...,
1303+
filter_path: Optional[Union[str, Collection[str]]] = ...,
1304+
request_timeout: Optional[Union[int, float]] = ...,
1305+
ignore: Optional[Union[int, Collection[int]]] = ...,
1306+
opaque_id: Optional[str] = ...,
1307+
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
1308+
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
1309+
params: Optional[MutableMapping[str, Any]] = ...,
1310+
headers: Optional[MutableMapping[str, str]] = ...,
1311+
) -> Any: ...

elasticsearch/client/ml.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,3 +1735,24 @@ def find_file_structure(self, body, params=None, headers=None):
17351735
headers=headers,
17361736
body=body,
17371737
)
1738+
1739+
@query_params("wait_for_completion")
1740+
def reset_job(self, job_id, params=None, headers=None):
1741+
"""
1742+
Resets an existing anomaly detection job.
1743+
1744+
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ml-reset-job.html>`_
1745+
1746+
:arg job_id: The ID of the job to reset
1747+
:arg wait_for_completion: Should this request wait until the
1748+
operation has completed before returning Default: True
1749+
"""
1750+
if job_id in SKIP_IN_PATH:
1751+
raise ValueError("Empty value passed for a required argument 'job_id'.")
1752+
1753+
return self.transport.perform_request(
1754+
"POST",
1755+
_make_path("_ml", "anomaly_detectors", job_id, "_reset"),
1756+
params=params,
1757+
headers=headers,
1758+
)

elasticsearch/client/ml.pyi

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,3 +1291,21 @@ class MlClient(NamespacedClient):
12911291
params: Optional[MutableMapping[str, Any]] = ...,
12921292
headers: Optional[MutableMapping[str, str]] = ...,
12931293
) -> Any: ...
1294+
def reset_job(
1295+
self,
1296+
job_id: Any,
1297+
*,
1298+
wait_for_completion: Optional[Any] = ...,
1299+
pretty: Optional[bool] = ...,
1300+
human: Optional[bool] = ...,
1301+
error_trace: Optional[bool] = ...,
1302+
format: Optional[str] = ...,
1303+
filter_path: Optional[Union[str, Collection[str]]] = ...,
1304+
request_timeout: Optional[Union[int, float]] = ...,
1305+
ignore: Optional[Union[int, Collection[int]]] = ...,
1306+
opaque_id: Optional[str] = ...,
1307+
http_auth: Optional[Union[str, Tuple[str, str]]] = ...,
1308+
api_key: Optional[Union[str, Tuple[str, str]]] = ...,
1309+
params: Optional[MutableMapping[str, Any]] = ...,
1310+
headers: Optional[MutableMapping[str, str]] = ...,
1311+
) -> Any: ...

0 commit comments

Comments
 (0)