Skip to content

Commit

Permalink
[ML] Adding indices_options to datafeed (elastic#59119)
Browse files Browse the repository at this point in the history
* [ML] Adding indices_options to datafeed

* adding extra checks to the schema

* updating expand_wildcards
  • Loading branch information
jgowdyelastic committed Mar 3, 2020
1 parent 81f9195 commit 4beeda6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface Datafeed {
script_fields?: object;
scroll_size?: number;
delayed_data_check_config?: object;
indices_options?: IndicesOptions;
}

export interface ChunkingConfig {
Expand All @@ -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;
}
15 changes: 14 additions & 1 deletion x-pack/plugins/ml/server/routes/schemas/datafeeds_schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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())),
Expand All @@ -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()),
})
),
});

0 comments on commit 4beeda6

Please sign in to comment.