Skip to content

Commit 4ef594c

Browse files
[ML] Adding indices_options to datafeed (#59119)
* [ML] Adding indices_options to datafeed * adding extra checks to the schema * updating expand_wildcards
1 parent e5362d3 commit 4ef594c

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

x-pack/legacy/plugins/ml/public/application/jobs/new_job/common/job_creator/configs/datafeed.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export interface Datafeed {
2525
script_fields?: object;
2626
scroll_size?: number;
2727
delayed_data_check_config?: object;
28+
indices_options?: IndicesOptions;
2829
}
2930

3031
export interface ChunkingConfig {
@@ -42,3 +43,10 @@ interface Aggregation {
4243
aggs?: { [key: string]: any };
4344
};
4445
}
46+
47+
interface IndicesOptions {
48+
expand_wildcards?: 'all' | 'open' | 'closed' | 'hidden' | 'none';
49+
ignore_unavailable?: boolean;
50+
allow_no_indices?: boolean;
51+
ignore_throttled?: boolean;
52+
}

x-pack/plugins/ml/server/routes/schemas/datafeeds_schema.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ export const datafeedConfigSchema = schema.object({
1717
feed_id: schema.maybe(schema.string()),
1818
aggregations: schema.maybe(schema.any()),
1919
aggs: schema.maybe(schema.any()),
20-
chunking_config: schema.maybe(schema.any()),
20+
chunking_config: schema.maybe(
21+
schema.object({
22+
mode: schema.maybe(schema.string()),
23+
time_span: schema.maybe(schema.string()),
24+
})
25+
),
2126
frequency: schema.maybe(schema.string()),
2227
indices: schema.arrayOf(schema.string()),
2328
indexes: schema.maybe(schema.arrayOf(schema.string())),
@@ -28,4 +33,12 @@ export const datafeedConfigSchema = schema.object({
2833
script_fields: schema.maybe(schema.any()),
2934
scroll_size: schema.maybe(schema.number()),
3035
delayed_data_check_config: schema.maybe(schema.any()),
36+
indices_options: schema.maybe(
37+
schema.object({
38+
expand_wildcards: schema.maybe(schema.arrayOf(schema.string())),
39+
ignore_unavailable: schema.maybe(schema.boolean()),
40+
allow_no_indices: schema.maybe(schema.boolean()),
41+
ignore_throttled: schema.maybe(schema.boolean()),
42+
})
43+
),
3144
});

0 commit comments

Comments
 (0)