Increase the maximum duration to ~10 years (3650 days).
This commit is contained in:
parent
5f9382acc2
commit
f6779de2b7
|
@ -48,8 +48,8 @@ public class ForecastJobAction extends Action<ForecastJobAction.Response> {
|
|||
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);
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue