Skip to content

Commit b426c29

Browse files
[codegen] 7.16 synchronization (#6071)
Co-authored-by: Mpdreamz <[email protected]>
1 parent 71ea9a0 commit b426c29

File tree

6 files changed

+95
-16
lines changed

6 files changed

+95
-16
lines changed

src/ApiGenerator/RestSpecification/Core/eql.search.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"description": "Returns results matching a query expressed in Event Query Language (EQL)"
66
},
77
"stability": "stable",
8-
"visibility":"feature_flag",
9-
"feature_flag":"es.eql_feature_flag_registered",
8+
"visibility":"public",
109
"headers":{
1110
"accept": [ "application/json"],
1211
"content_type": ["application/json"]

src/ApiGenerator/RestSpecification/Core/ml.forecast.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"stability":"stable",
88
"visibility":"public",
99
"headers":{
10-
"accept": [ "application/json"]
10+
"accept": [ "application/json"],
11+
"content_type": ["application/json"]
1112
},
1213
"url":{
1314
"paths":[
@@ -41,6 +42,10 @@
4142
"required":false,
4243
"description":"The max memory able to be used by the forecast. Default is 20mb."
4344
}
45+
},
46+
"body":{
47+
"description": "Query parameters can be specified in the body",
48+
"required":false
4449
}
4550
}
4651
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"ml.get_model_snapshot_upgrade_stats":{
3+
"documentation":{
4+
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-model-snapshot-upgrade-stats.html",
5+
"description":"Gets stats for anomaly detection job model snapshot upgrades that are in progress."
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}/model_snapshots/{snapshot_id}/_upgrade/_stats",
16+
"methods":[
17+
"GET"
18+
],
19+
"parts":{
20+
"job_id":{
21+
"type":"string",
22+
"description":"The ID of the job. May be a wildcard, comma separated list or `_all`."
23+
},
24+
"snapshot_id":{
25+
"type":"string",
26+
"description":"The ID of the snapshot. May be a wildcard, comma separated list or `_all`."
27+
}
28+
}
29+
}
30+
]
31+
},
32+
"params":{
33+
"allow_no_match":{
34+
"type":"boolean",
35+
"required":false,
36+
"description":"Whether to ignore if a wildcard expression matches no jobs or no snapshots. (This includes the `_all` string.)"
37+
}
38+
}
39+
}
40+
}

src/ApiGenerator/RestSpecification/Core/ml.open_job.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"stability":"stable",
88
"visibility":"public",
99
"headers":{
10-
"accept": [ "application/json"]
10+
"accept": [ "application/json"],
11+
"content_type": ["application/json"]
1112
},
1213
"url":{
1314
"paths":[
@@ -24,6 +25,10 @@
2425
}
2526
}
2627
]
28+
},
29+
"body":{
30+
"description": "Query parameters can be specified in the body",
31+
"required":false
2732
}
2833
}
2934
}

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public string SkipTime
242242
public class ForecastJobRequestParameters : RequestParameters<ForecastJobRequestParameters>
243243
{
244244
public override HttpMethod DefaultHttpMethod => HttpMethod.POST;
245-
public override bool SupportsBody => false;
245+
public override bool SupportsBody => true;
246246
///<summary>The max memory able to be used by the forecast. Default is 20mb.</summary>
247247
public string MaxModelMemory
248248
{
@@ -507,6 +507,19 @@ public bool? ExcludeGenerated
507507
}
508508
}
509509

510+
///<summary>Request options for GetModelSnapshotUpgradeStats <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-model-snapshot-upgrade-stats.html</para></summary>
511+
public class GetModelSnapshotUpgradeStatsRequestParameters : RequestParameters<GetModelSnapshotUpgradeStatsRequestParameters>
512+
{
513+
public override HttpMethod DefaultHttpMethod => HttpMethod.GET;
514+
public override bool SupportsBody => false;
515+
///<summary>Whether to ignore if a wildcard expression matches no jobs or no snapshots. (This includes the `_all` string.)</summary>
516+
public bool? AllowNoMatch
517+
{
518+
get => Q<bool? >("allow_no_match");
519+
set => Q("allow_no_match", value);
520+
}
521+
}
522+
510523
///<summary>Request options for GetModelSnapshots <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html</para></summary>
511524
public class GetModelSnapshotsRequestParameters : RequestParameters<GetModelSnapshotsRequestParameters>
512525
{
@@ -644,7 +657,7 @@ public class MachineLearningInfoRequestParameters : RequestParameters<MachineLea
644657
public class OpenJobRequestParameters : RequestParameters<OpenJobRequestParameters>
645658
{
646659
public override HttpMethod DefaultHttpMethod => HttpMethod.POST;
647-
public override bool SupportsBody => false;
660+
public override bool SupportsBody => true;
648661
}
649662

650663
///<summary>Request options for PostCalendarEvents <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-calendar-event.html</para></summary>

src/Elasticsearch.Net/ElasticLowLevelClient.MachineLearning.cs

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -275,15 +275,17 @@ public Task<TResponse> FlushJobAsync<TResponse>(string jobId, PostData body, Flu
275275
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, Url($"_ml/anomaly_detectors/{jobId:jobId}/_flush"), ctx, body, RequestParams(requestParameters));
276276
///<summary>POST on /_ml/anomaly_detectors/{job_id}/_forecast <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-forecast.html</para></summary>
277277
///<param name = "jobId">The ID of the job to forecast for</param>
278+
///<param name = "body">Query parameters can be specified in the body</param>
278279
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
279-
public TResponse ForecastJob<TResponse>(string jobId, ForecastJobRequestParameters requestParameters = null)
280-
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(POST, Url($"_ml/anomaly_detectors/{jobId:jobId}/_forecast"), null, RequestParams(requestParameters));
280+
public TResponse ForecastJob<TResponse>(string jobId, PostData body, ForecastJobRequestParameters requestParameters = null)
281+
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(POST, Url($"_ml/anomaly_detectors/{jobId:jobId}/_forecast"), body, RequestParams(requestParameters));
281282
///<summary>POST on /_ml/anomaly_detectors/{job_id}/_forecast <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-forecast.html</para></summary>
282283
///<param name = "jobId">The ID of the job to forecast for</param>
284+
///<param name = "body">Query parameters can be specified in the body</param>
283285
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
284-
[MapsApi("ml.forecast", "job_id")]
285-
public Task<TResponse> ForecastJobAsync<TResponse>(string jobId, ForecastJobRequestParameters requestParameters = null, CancellationToken ctx = default)
286-
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, Url($"_ml/anomaly_detectors/{jobId:jobId}/_forecast"), ctx, null, RequestParams(requestParameters));
286+
[MapsApi("ml.forecast", "job_id, body")]
287+
public Task<TResponse> ForecastJobAsync<TResponse>(string jobId, PostData body, ForecastJobRequestParameters requestParameters = null, CancellationToken ctx = default)
288+
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, Url($"_ml/anomaly_detectors/{jobId:jobId}/_forecast"), ctx, body, RequestParams(requestParameters));
287289
///<summary>POST on /_ml/anomaly_detectors/{job_id}/results/buckets/{timestamp} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html</para></summary>
288290
///<param name = "jobId">ID of the job to get bucket results from</param>
289291
///<param name = "timestamp">The timestamp of the desired single bucket result</param>
@@ -528,6 +530,19 @@ public TResponse GetJobs<TResponse>(GetJobsRequestParameters requestParameters =
528530
[MapsApi("ml.get_jobs", "")]
529531
public Task<TResponse> GetJobsAsync<TResponse>(GetJobsRequestParameters requestParameters = null, CancellationToken ctx = default)
530532
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, "_ml/anomaly_detectors", ctx, null, RequestParams(requestParameters));
533+
///<summary>GET on /_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_upgrade/_stats <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-model-snapshot-upgrade-stats.html</para></summary>
534+
///<param name = "jobId">The ID of the job. May be a wildcard, comma separated list or `_all`.</param>
535+
///<param name = "snapshotId">The ID of the snapshot. May be a wildcard, comma separated list or `_all`.</param>
536+
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
537+
public TResponse GetModelSnapshotUpgradeStats<TResponse>(string jobId, string snapshotId, GetModelSnapshotUpgradeStatsRequestParameters requestParameters = null)
538+
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, Url($"_ml/anomaly_detectors/{jobId:jobId}/model_snapshots/{snapshotId:snapshotId}/_upgrade/_stats"), null, RequestParams(requestParameters));
539+
///<summary>GET on /_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_upgrade/_stats <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-model-snapshot-upgrade-stats.html</para></summary>
540+
///<param name = "jobId">The ID of the job. May be a wildcard, comma separated list or `_all`.</param>
541+
///<param name = "snapshotId">The ID of the snapshot. May be a wildcard, comma separated list or `_all`.</param>
542+
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
543+
[MapsApi("ml.get_model_snapshot_upgrade_stats", "job_id, snapshot_id")]
544+
public Task<TResponse> GetModelSnapshotUpgradeStatsAsync<TResponse>(string jobId, string snapshotId, GetModelSnapshotUpgradeStatsRequestParameters requestParameters = null, CancellationToken ctx = default)
545+
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, Url($"_ml/anomaly_detectors/{jobId:jobId}/model_snapshots/{snapshotId:snapshotId}/_upgrade/_stats"), ctx, null, RequestParams(requestParameters));
531546
///<summary>POST on /_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html</para></summary>
532547
///<param name = "jobId">The ID of the job to fetch</param>
533548
///<param name = "snapshotId">The ID of the snapshot to fetch</param>
@@ -633,15 +648,17 @@ public Task<TResponse> InfoAsync<TResponse>(MachineLearningInfoRequestParameters
633648
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, "_ml/info", ctx, null, RequestParams(requestParameters));
634649
///<summary>POST on /_ml/anomaly_detectors/{job_id}/_open <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html</para></summary>
635650
///<param name = "jobId">The ID of the job to open</param>
651+
///<param name = "body">Query parameters can be specified in the body</param>
636652
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
637-
public TResponse OpenJob<TResponse>(string jobId, OpenJobRequestParameters requestParameters = null)
638-
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(POST, Url($"_ml/anomaly_detectors/{jobId:jobId}/_open"), null, RequestParams(requestParameters));
653+
public TResponse OpenJob<TResponse>(string jobId, PostData body, OpenJobRequestParameters requestParameters = null)
654+
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(POST, Url($"_ml/anomaly_detectors/{jobId:jobId}/_open"), body, RequestParams(requestParameters));
639655
///<summary>POST on /_ml/anomaly_detectors/{job_id}/_open <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html</para></summary>
640656
///<param name = "jobId">The ID of the job to open</param>
657+
///<param name = "body">Query parameters can be specified in the body</param>
641658
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
642-
[MapsApi("ml.open_job", "job_id")]
643-
public Task<TResponse> OpenJobAsync<TResponse>(string jobId, OpenJobRequestParameters requestParameters = null, CancellationToken ctx = default)
644-
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, Url($"_ml/anomaly_detectors/{jobId:jobId}/_open"), ctx, null, RequestParams(requestParameters));
659+
[MapsApi("ml.open_job", "job_id, body")]
660+
public Task<TResponse> OpenJobAsync<TResponse>(string jobId, PostData body, OpenJobRequestParameters requestParameters = null, CancellationToken ctx = default)
661+
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, Url($"_ml/anomaly_detectors/{jobId:jobId}/_open"), ctx, body, RequestParams(requestParameters));
645662
///<summary>POST on /_ml/calendars/{calendar_id}/events <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-calendar-event.html</para></summary>
646663
///<param name = "calendarId">The ID of the calendar to modify</param>
647664
///<param name = "body">A list of events</param>

0 commit comments

Comments
 (0)