diff --git a/x-pack/legacy/plugins/ml/public/application/jobs/new_job/common/job_creator/configs/datafeed.ts b/x-pack/legacy/plugins/ml/public/application/jobs/new_job/common/job_creator/configs/datafeed.ts index e35f3056ce43..538b225926f6 100644 --- a/x-pack/legacy/plugins/ml/public/application/jobs/new_job/common/job_creator/configs/datafeed.ts +++ b/x-pack/legacy/plugins/ml/public/application/jobs/new_job/common/job_creator/configs/datafeed.ts @@ -25,6 +25,7 @@ export interface Datafeed { script_fields?: object; scroll_size?: number; delayed_data_check_config?: object; + indices_options?: IndicesOptions; } export interface ChunkingConfig { @@ -42,3 +43,10 @@ interface Aggregation { aggs?: { [key: string]: any }; }; } + +interface IndicesOptions { + expand_wildcards?: 'all' | 'open' | 'closed' | 'hidden' | 'none'; + ignore_unavailable?: boolean; + allow_no_indices?: boolean; + ignore_throttled?: boolean; +} diff --git a/x-pack/plugins/ml/server/routes/schemas/datafeeds_schema.ts b/x-pack/plugins/ml/server/routes/schemas/datafeeds_schema.ts index 02677dcb107c..ee49da653846 100644 --- a/x-pack/plugins/ml/server/routes/schemas/datafeeds_schema.ts +++ b/x-pack/plugins/ml/server/routes/schemas/datafeeds_schema.ts @@ -17,7 +17,12 @@ export const datafeedConfigSchema = schema.object({ feed_id: schema.maybe(schema.string()), aggregations: schema.maybe(schema.any()), aggs: schema.maybe(schema.any()), - chunking_config: schema.maybe(schema.any()), + chunking_config: schema.maybe( + schema.object({ + mode: schema.maybe(schema.string()), + time_span: schema.maybe(schema.string()), + }) + ), frequency: schema.maybe(schema.string()), indices: schema.arrayOf(schema.string()), indexes: schema.maybe(schema.arrayOf(schema.string())), @@ -28,4 +33,12 @@ export const datafeedConfigSchema = schema.object({ script_fields: schema.maybe(schema.any()), scroll_size: schema.maybe(schema.number()), delayed_data_check_config: schema.maybe(schema.any()), + indices_options: schema.maybe( + schema.object({ + expand_wildcards: schema.maybe(schema.arrayOf(schema.string())), + ignore_unavailable: schema.maybe(schema.boolean()), + allow_no_indices: schema.maybe(schema.boolean()), + ignore_throttled: schema.maybe(schema.boolean()), + }) + ), });