Skip to content

Commit

Permalink
Update APIs to 7.x-SNAPSHOT
Browse files Browse the repository at this point in the history
  • Loading branch information
sethmlarson committed Jun 21, 2021
1 parent 12aa997 commit 3eb605e
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 0 deletions.
21 changes: 21 additions & 0 deletions elasticsearch/_async/client/ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -1755,3 +1755,24 @@ async def find_file_structure(self, body, params=None, headers=None):
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.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ml-reset-job.html>`_
: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,
)
18 changes: 18 additions & 0 deletions elasticsearch/_async/client/ml.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
21 changes: 21 additions & 0 deletions elasticsearch/client/ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -1735,3 +1735,24 @@ def find_file_structure(self, body, params=None, headers=None):
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.
`<https://www.elastic.co/guide/en/elasticsearch/reference/7.x/ml-reset-job.html>`_
: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,
)
18 changes: 18 additions & 0 deletions elasticsearch/client/ml.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...

0 comments on commit 3eb605e

Please sign in to comment.