Skip to content

Commit d9958cf

Browse files
[codegen] 7.x synchronization (#5727)
Co-authored-by: Mpdreamz <Mpdreamz@users.noreply.github.com>
1 parent 9fe1b57 commit d9958cf

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"ml.reset_job":{
3+
"documentation":{
4+
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-reset-job.html",
5+
"description":"Resets an existing anomaly detection job."
6+
},
7+
"stability":"stable",
8+
"visibility":"public",
9+
"headers":{
10+
"accept": [ "application/json"]
11+
},
12+
"url":{
13+
"paths":[
14+
{
15+
"path":"/_ml/anomaly_detectors/{job_id}/_reset",
16+
"methods":[
17+
"POST"
18+
],
19+
"parts":{
20+
"job_id":{
21+
"type":"string",
22+
"description":"The ID of the job to reset"
23+
}
24+
}
25+
}
26+
]
27+
},
28+
"params":{
29+
"wait_for_completion":{
30+
"type":"boolean",
31+
"description":"Should this request wait until the operation has completed before returning",
32+
"default":true
33+
}
34+
}
35+
}
36+
}

src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.MachineLearning.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,19 @@ public bool? Reassign
777777
}
778778
}
779779

780+
///<summary>Request options for ResetJob <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-reset-job.html</para></summary>
781+
public class ResetJobRequestParameters : RequestParameters<ResetJobRequestParameters>
782+
{
783+
public override HttpMethod DefaultHttpMethod => HttpMethod.POST;
784+
public override bool SupportsBody => false;
785+
///<summary>Should this request wait until the operation has completed before returning</summary>
786+
public bool? WaitForCompletion
787+
{
788+
get => Q<bool? >("wait_for_completion");
789+
set => Q("wait_for_completion", value);
790+
}
791+
}
792+
780793
///<summary>Request options for RevertModelSnapshot <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html</para></summary>
781794
public class RevertModelSnapshotRequestParameters : RequestParameters<RevertModelSnapshotRequestParameters>
782795
{

src/Elasticsearch.Net/ElasticLowLevelClient.MachineLearning.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,17 @@ public TResponse PutTrainedModelAlias<TResponse>(string modelId, string modelAli
820820
[MapsApi("ml.put_trained_model_alias", "model_id, model_alias")]
821821
public Task<TResponse> PutTrainedModelAliasAsync<TResponse>(string modelId, string modelAlias, PutTrainedModelAliasRequestParameters requestParameters = null, CancellationToken ctx = default)
822822
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(PUT, Url($"_ml/trained_models/{modelId:modelId}/model_aliases/{modelAlias:modelAlias}"), ctx, null, RequestParams(requestParameters));
823+
///<summary>POST on /_ml/anomaly_detectors/{job_id}/_reset <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-reset-job.html</para></summary>
824+
///<param name = "jobId">The ID of the job to reset</param>
825+
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
826+
public TResponse ResetJob<TResponse>(string jobId, ResetJobRequestParameters requestParameters = null)
827+
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(POST, Url($"_ml/anomaly_detectors/{jobId:jobId}/_reset"), null, RequestParams(requestParameters));
828+
///<summary>POST on /_ml/anomaly_detectors/{job_id}/_reset <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-reset-job.html</para></summary>
829+
///<param name = "jobId">The ID of the job to reset</param>
830+
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
831+
[MapsApi("ml.reset_job", "job_id")]
832+
public Task<TResponse> ResetJobAsync<TResponse>(string jobId, ResetJobRequestParameters requestParameters = null, CancellationToken ctx = default)
833+
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, Url($"_ml/anomaly_detectors/{jobId:jobId}/_reset"), ctx, null, RequestParams(requestParameters));
823834
///<summary>POST on /_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_revert <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html</para></summary>
824835
///<param name = "jobId">The ID of the job to fetch</param>
825836
///<param name = "snapshotId">The ID of the snapshot to revert to</param>

0 commit comments

Comments
 (0)