Skip to content

Commit

Permalink
Increase maximum forecast interval to 10 years. (elastic#41082) (elas…
Browse files Browse the repository at this point in the history
…tic#42710)

Increase the maximum duration to ~10 years (3650 days).
  • Loading branch information
przemekwitek authored May 31, 2019
1 parent 5f9382a commit f6779de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public static class Request extends JobTaskRequest<Request> implements ToXConten
public static final ParseField DURATION = new ParseField("duration");
public static final ParseField EXPIRES_IN = new ParseField("expires_in");

// Max allowed duration: 8 weeks
private static final TimeValue MAX_DURATION = TimeValue.parseTimeValue("56d", "");
// Max allowed duration: 10 years
private static final TimeValue MAX_DURATION = TimeValue.parseTimeValue("3650d", "");

private static final ObjectParser<Request, Void> PARSER = new ObjectParser<>(NAME, Request::new);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ setup:
job_id: "forecast-job"
duration: "-1s"

---
"Test forecast given duration is too large":
- do:
catch: /\[duration\] must be 3650d or less[:] \[3651d\]/
ml.forecast:
job_id: "forecast-job"
duration: "3651d"

---
"Test forecast given expires_in is negative":
- do:
Expand Down

0 comments on commit f6779de

Please sign in to comment.