[ML] Set createTime if not specified in validate api too

Original commit: elastic/x-pack-elasticsearch@477fb0fc52
This commit is contained in:
Martijn van Groningen 2017-02-22 21:03:55 +01:00
parent f856a79ef3
commit 9da18a14c5
1 changed files with 3 additions and 0 deletions

View File

@ -68,6 +68,9 @@ extends Action<ValidateJobConfigAction.Request, ValidateJobConfigAction.Response
// When jobs are PUT their ID must be supplied in the URL - assume this will // When jobs are PUT their ID must be supplied in the URL - assume this will
// be valid unless an invalid job ID is specified in the JSON to be validated // be valid unless an invalid job ID is specified in the JSON to be validated
job.setId(job.getId() != null ? job.getId() : "ok"); job.setId(job.getId() != null ? job.getId() : "ok");
if (job.getCreateTime() == null) {
job.setCreateTime(new Date());
}
return new Request(job.build()); return new Request(job.build());
} }