Skip to content

[codegen] master synchronization #5726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions src/ApiGenerator/RestSpecification/Core/ml.reset_job.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"ml.reset_job":{
"documentation":{
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-reset-job.html",
"description":"Resets an existing anomaly detection job."
},
"stability":"stable",
"visibility":"public",
"headers":{
"accept": [ "application/json"]
},
"url":{
"paths":[
{
"path":"/_ml/anomaly_detectors/{job_id}/_reset",
"methods":[
"POST"
],
"parts":{
"job_id":{
"type":"string",
"description":"The ID of the job to reset"
}
}
}
]
},
"params":{
"wait_for_completion":{
"type":"boolean",
"description":"Should this request wait until the operation has completed before returning",
"default":true
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,17 @@ public bool? Reassign
}
}

///<summary>Request options for ResetJob <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-reset-job.html</para></summary>
public class ResetJobRequestParameters : RequestParameters<ResetJobRequestParameters>
{
///<summary>Should this request wait until the operation has completed before returning</summary>
public bool? WaitForCompletion
{
get => Q<bool? >("wait_for_completion");
set => Q("wait_for_completion", value);
}
}

///<summary>Request options for RevertModelSnapshot <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html</para></summary>
public class RevertModelSnapshotRequestParameters : RequestParameters<RevertModelSnapshotRequestParameters>
{
Expand Down
11 changes: 11 additions & 0 deletions src/Elasticsearch.Net/ElasticLowLevelClient.MachineLearning.cs
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,17 @@ public TResponse PutTrainedModelAlias<TResponse>(string modelId, string modelAli
[MapsApi("ml.put_trained_model_alias", "model_id, model_alias")]
public Task<TResponse> PutTrainedModelAliasAsync<TResponse>(string modelId, string modelAlias, PutTrainedModelAliasRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(PUT, Url($"_ml/trained_models/{modelId:modelId}/model_aliases/{modelAlias:modelAlias}"), ctx, null, RequestParams(requestParameters));
///<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>
///<param name = "jobId">The ID of the job to reset</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
public TResponse ResetJob<TResponse>(string jobId, ResetJobRequestParameters requestParameters = null)
where TResponse : class, ITransportResponse, new() => DoRequest<TResponse>(POST, Url($"_ml/anomaly_detectors/{jobId:jobId}/_reset"), null, RequestParams(requestParameters));
///<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>
///<param name = "jobId">The ID of the job to reset</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
[MapsApi("ml.reset_job", "job_id")]
public Task<TResponse> ResetJobAsync<TResponse>(string jobId, ResetJobRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(POST, Url($"_ml/anomaly_detectors/{jobId:jobId}/_reset"), ctx, null, RequestParams(requestParameters));
///<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>
///<param name = "jobId">The ID of the job to fetch</param>
///<param name = "snapshotId">The ID of the snapshot to revert to</param>
Expand Down