Skip to content

Commit d376690

Browse files
[codegen] master synchronization (#5726)
Co-authored-by: Mpdreamz <[email protected]>
1 parent 5e59014 commit d376690

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed
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

+11
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,17 @@ public bool? Reassign
685685
}
686686
}
687687

688+
///<summary>Request options for ResetJob <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-reset-job.html</para></summary>
689+
public class ResetJobRequestParameters : RequestParameters<ResetJobRequestParameters>
690+
{
691+
///<summary>Should this request wait until the operation has completed before returning</summary>
692+
public bool? WaitForCompletion
693+
{
694+
get => Q<bool? >("wait_for_completion");
695+
set => Q("wait_for_completion", value);
696+
}
697+
}
698+
688699
///<summary>Request options for RevertModelSnapshot <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html</para></summary>
689700
public class RevertModelSnapshotRequestParameters : RequestParameters<RevertModelSnapshotRequestParameters>
690701
{

src/Elasticsearch.Net/ElasticLowLevelClient.MachineLearning.cs

+11
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,17 @@ public TResponse PutTrainedModelAlias<TResponse>(string modelId, string modelAli
834834
[MapsApi("ml.put_trained_model_alias", "model_id, model_alias")]
835835
public Task<TResponse> PutTrainedModelAliasAsync<TResponse>(string modelId, string modelAlias, PutTrainedModelAliasRequestParameters requestParameters = null, CancellationToken ctx = default)
836836
where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(PUT, Url($"_ml/trained_models/{modelId:modelId}/model_aliases/{modelAlias:modelAlias}"), ctx, null, RequestParams(requestParameters));
837+
///<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>
838+
///<param name = "jobId">The ID of the job to reset</param>
839+
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
840+
public TResponse ResetJob<TResponse>(string jobId, ResetJobRequestParameters requestParameters = null)
841+
where TResponse : class, ITransportResponse, new() => DoRequest<TResponse>(POST, Url($"_ml/anomaly_detectors/{jobId:jobId}/_reset"), null, RequestParams(requestParameters));
842+
///<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>
843+
///<param name = "jobId">The ID of the job to reset</param>
844+
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
845+
[MapsApi("ml.reset_job", "job_id")]
846+
public Task<TResponse> ResetJobAsync<TResponse>(string jobId, ResetJobRequestParameters requestParameters = null, CancellationToken ctx = default)
847+
where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(POST, Url($"_ml/anomaly_detectors/{jobId:jobId}/_reset"), ctx, null, RequestParams(requestParameters));
837848
///<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>
838849
///<param name = "jobId">The ID of the job to fetch</param>
839850
///<param name = "snapshotId">The ID of the snapshot to revert to</param>

0 commit comments

Comments
 (0)