Skip to content
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

Ml calendar apis #3569

Merged
merged 11 commits into from
Mar 6, 2019
9 changes: 0 additions & 9 deletions src/CodeGeneration/ApiGenerator/ApiGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,7 @@ public class ApiGenerator
"rank_eval.json",

// these API's are new and need to be mapped
"xpack.ml.delete_calendar.json",
"xpack.ml.delete_calendar_event.json",
"xpack.ml.delete_calendar_job.json",
"xpack.ml.get_calendar_events.json",
"xpack.ml.get_calendars.json",
"xpack.ml.info.json",
"xpack.ml.post_calendar_events.json",
"xpack.ml.put_calendar.json",
"xpack.ml.put_calendar_job.json",
"xpack.ml.get_calendar_job.json",
"xpack.ml.delete_forecast.json",
"xpack.ml.find_file_structure.json",
"delete_by_query_rethrottle.json",
Expand Down
2 changes: 2 additions & 0 deletions src/CodeGeneration/ApiGenerator/Domain/ApiUrlPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public string ClrTypeName
case "type": return Type == "string" ? "TypeName" : "Types";
case "watch_id":
case "job_id":
case "calendar_id":
case "event_id":
case "datafeed_id":
case "snapshot_id":
case "filter_id":
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Collections.Generic;

namespace ApiGenerator.Overrides.Endpoints
{
public class GetCalendarEventsOverrides : EndpointOverridesBase
{
public override IEnumerable<string> SkipQueryStringParams => new[]
{
"from",
"size"
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Collections.Generic;

namespace ApiGenerator.Overrides.Endpoints
{
public class GetCalendarsOverrides : EndpointOverridesBase
{
public override IEnumerable<string> SkipQueryStringParams => new[]
{
"from",
"size"
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"xpack.ml.get_calendars": {
"body": {
"description" : "Calendar selection details if not provided in URI"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2311,6 +2311,21 @@ public partial class CloseJobRequestParameters : RequestParameters<CloseJobReque
///<summary>Controls the time to wait until a job has closed. Default to 30 minutes</summary>
public TimeSpan Timeout { get => Q<TimeSpan>("timeout"); set => Q("timeout", value); }
}
///<summary>Request options for XpackMlDeleteCalendar<pre></pre></summary>
public partial class DeleteCalendarRequestParameters : RequestParameters<DeleteCalendarRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.DELETE;
}
///<summary>Request options for XpackMlDeleteCalendarEvent<pre></pre></summary>
public partial class DeleteCalendarEventRequestParameters : RequestParameters<DeleteCalendarEventRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.DELETE;
}
///<summary>Request options for XpackMlDeleteCalendarJob<pre></pre></summary>
public partial class DeleteCalendarJobRequestParameters : RequestParameters<DeleteCalendarJobRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.DELETE;
}
///<summary>Request options for XpackMlDeleteDatafeed<pre>http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html</pre></summary>
public partial class DeleteDatafeedRequestParameters : RequestParameters<DeleteDatafeedRequestParameters>
{
Expand Down Expand Up @@ -2354,6 +2369,22 @@ public partial class GetBucketsRequestParameters : RequestParameters<GetBucketsR
{
public override HttpMethod DefaultHttpMethod => HttpMethod.POST;
}
///<summary>Request options for XpackMlGetCalendars<pre></pre></summary>
public partial class GetCalendarsRequestParameters : RequestParameters<GetCalendarsRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.POST;
}
///<summary>Request options for XpackMlGetCalendarEvents<pre></pre></summary>
public partial class GetCalendarEventsRequestParameters : RequestParameters<GetCalendarEventsRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.GET;
///<summary>Get events for the job. When this option is used calendar_id must be '_all'</summary>
public string JobId { get => Q<string>("job_id"); set => Q("job_id", value); }
///<summary>Get events after this time</summary>
public string Start { get => Q<string>("start"); set => Q("start", value); }
///<summary>Get events before this time</summary>
public DateTimeOffset? End { get => Q<DateTimeOffset?>("end"); set => Q("end", value); }
}
///<summary>Request options for XpackMlGetCategories<pre>http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html</pre></summary>
public partial class GetCategoriesRequestParameters : RequestParameters<GetCategoriesRequestParameters>
{
Expand Down Expand Up @@ -2412,6 +2443,11 @@ public partial class OpenJobRequestParameters : RequestParameters<OpenJobRequest
{
public override HttpMethod DefaultHttpMethod => HttpMethod.POST;
}
///<summary>Request options for XpackMlPostCalendarEvents<pre></pre></summary>
public partial class PostCalendarEventsRequestParameters : RequestParameters<PostCalendarEventsRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.POST;
}
///<summary>Request options for XpackMlPostData<pre>http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html</pre></summary>
public partial class PostJobDataRequestParameters : RequestParameters<PostJobDataRequestParameters>
{
Expand All @@ -2426,6 +2462,16 @@ public partial class PreviewDatafeedRequestParameters : RequestParameters<Previe
{
public override HttpMethod DefaultHttpMethod => HttpMethod.GET;
}
///<summary>Request options for XpackMlPutCalendar<pre></pre></summary>
public partial class PutCalendarRequestParameters : RequestParameters<PutCalendarRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.PUT;
}
///<summary>Request options for XpackMlPutCalendarJob<pre></pre></summary>
public partial class PutCalendarJobRequestParameters : RequestParameters<PutCalendarJobRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.PUT;
}
///<summary>Request options for XpackMlPutDatafeed<pre>http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html</pre></summary>
public partial class PutDatafeedRequestParameters : RequestParameters<PutDatafeedRequestParameters>
{
Expand Down
Loading