Skip to content

Commit 363f31b

Browse files
[codegen] master synchronization (#5486)
Co-authored-by: Mpdreamz <Mpdreamz@users.noreply.github.com>
1 parent 011a723 commit 363f31b

File tree

219 files changed

+35
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+35
-10
lines changed

src/ApiGenerator/RestSpecification/XPack/ml.preview_datafeed.json renamed to src/ApiGenerator/RestSpecification/Core/ml.preview_datafeed.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,28 @@
1414
{
1515
"path":"/_ml/datafeeds/{datafeed_id}/_preview",
1616
"methods":[
17-
"GET"
17+
"GET",
18+
"POST"
1819
],
1920
"parts":{
2021
"datafeed_id":{
2122
"type":"string",
2223
"description":"The ID of the datafeed to preview"
2324
}
2425
}
26+
},
27+
{
28+
"path":"/_ml/datafeeds/_preview",
29+
"methods":[
30+
"GET",
31+
"POST"
32+
]
2533
}
2634
]
35+
},
36+
"body":{
37+
"description":"The datafeed config and job config with which to execute the preview",
38+
"required":false
2739
}
2840
}
2941
}

src/Elasticsearch.Net/ElasticLowLevelClient.MachineLearning.cs

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -722,17 +722,30 @@ public TResponse PreviewDataFrameAnalytics<TResponse>(string id, PostData body,
722722
[MapsApi("ml.preview_data_frame_analytics", "id, body")]
723723
public Task<TResponse> PreviewDataFrameAnalyticsAsync<TResponse>(string id, PostData body, PreviewDataFrameAnalyticsRequestParameters requestParameters = null, CancellationToken ctx = default)
724724
where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(POST, Url($"_ml/data_frame/analytics/{id:id}/_preview"), ctx, body, RequestParams(requestParameters));
725-
///<summary>GET on /_ml/datafeeds/{datafeed_id}/_preview <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html</para></summary>
725+
///<summary>POST on /_ml/datafeeds/{datafeed_id}/_preview <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html</para></summary>
726726
///<param name = "datafeedId">The ID of the datafeed to preview</param>
727+
///<param name = "body">The datafeed config and job config with which to execute the preview</param>
727728
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
728-
public TResponse PreviewDatafeed<TResponse>(string datafeedId, PreviewDatafeedRequestParameters requestParameters = null)
729-
where TResponse : class, ITransportResponse, new() => DoRequest<TResponse>(GET, Url($"_ml/datafeeds/{datafeedId:datafeedId}/_preview"), null, RequestParams(requestParameters));
730-
///<summary>GET on /_ml/datafeeds/{datafeed_id}/_preview <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html</para></summary>
729+
public TResponse PreviewDatafeed<TResponse>(string datafeedId, PostData body, PreviewDatafeedRequestParameters requestParameters = null)
730+
where TResponse : class, ITransportResponse, new() => DoRequest<TResponse>(POST, Url($"_ml/datafeeds/{datafeedId:datafeedId}/_preview"), body, RequestParams(requestParameters));
731+
///<summary>POST on /_ml/datafeeds/{datafeed_id}/_preview <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html</para></summary>
731732
///<param name = "datafeedId">The ID of the datafeed to preview</param>
732-
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
733-
[MapsApi("ml.preview_datafeed", "datafeed_id")]
734-
public Task<TResponse> PreviewDatafeedAsync<TResponse>(string datafeedId, PreviewDatafeedRequestParameters requestParameters = null, CancellationToken ctx = default)
735-
where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(GET, Url($"_ml/datafeeds/{datafeedId:datafeedId}/_preview"), ctx, null, RequestParams(requestParameters));
733+
///<param name = "body">The datafeed config and job config with which to execute the preview</param>
734+
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
735+
[MapsApi("ml.preview_datafeed", "datafeed_id, body")]
736+
public Task<TResponse> PreviewDatafeedAsync<TResponse>(string datafeedId, PostData body, PreviewDatafeedRequestParameters requestParameters = null, CancellationToken ctx = default)
737+
where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(POST, Url($"_ml/datafeeds/{datafeedId:datafeedId}/_preview"), ctx, body, RequestParams(requestParameters));
738+
///<summary>POST on /_ml/datafeeds/_preview <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html</para></summary>
739+
///<param name = "body">The datafeed config and job config with which to execute the preview</param>
740+
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
741+
public TResponse PreviewDatafeed<TResponse>(PostData body, PreviewDatafeedRequestParameters requestParameters = null)
742+
where TResponse : class, ITransportResponse, new() => DoRequest<TResponse>(POST, "_ml/datafeeds/_preview", body, RequestParams(requestParameters));
743+
///<summary>POST on /_ml/datafeeds/_preview <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html</para></summary>
744+
///<param name = "body">The datafeed config and job config with which to execute the preview</param>
745+
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
746+
[MapsApi("ml.preview_datafeed", "body")]
747+
public Task<TResponse> PreviewDatafeedAsync<TResponse>(PostData body, PreviewDatafeedRequestParameters requestParameters = null, CancellationToken ctx = default)
748+
where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(POST, "_ml/datafeeds/_preview", ctx, body, RequestParams(requestParameters));
736749
///<summary>PUT on /_ml/calendars/{calendar_id} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar.html</para></summary>
737750
///<param name = "calendarId">The ID of the calendar to create</param>
738751
///<param name = "body">The calendar details</param>

src/Nest/_Generated/ApiUrlsLookup.generated.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ internal static class ApiUrlsLookups
195195
internal static ApiUrls MachineLearningOpenJob = new ApiUrls(new[]{"_ml/anomaly_detectors/{job_id}/_open"});
196196
internal static ApiUrls MachineLearningPostCalendarEvents = new ApiUrls(new[]{"_ml/calendars/{calendar_id}/events"});
197197
internal static ApiUrls MachineLearningPostJobData = new ApiUrls(new[]{"_ml/anomaly_detectors/{job_id}/_data"});
198-
internal static ApiUrls MachineLearningPreviewDatafeed = new ApiUrls(new[]{"_ml/datafeeds/{datafeed_id}/_preview"});
198+
internal static ApiUrls MachineLearningPreviewDatafeed = new ApiUrls(new[]{"_ml/datafeeds/{datafeed_id}/_preview", "_ml/datafeeds/_preview"});
199199
internal static ApiUrls MachineLearningPutCalendar = new ApiUrls(new[]{"_ml/calendars/{calendar_id}"});
200200
internal static ApiUrls MachineLearningPutCalendarJob = new ApiUrls(new[]{"_ml/calendars/{calendar_id}/jobs/{job_id}"});
201201
internal static ApiUrls MachineLearningPutDatafeed = new ApiUrls(new[]{"_ml/datafeeds/{datafeed_id}"});

0 commit comments

Comments
 (0)