-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add enrich policy endpoint definitions and support for registering X-…
…Pack processors to Console (#48258) (#48358) * Add template to put enrich policy override. * Expose addProcessorDefinition method on Console plugin API. * Add enrichProcessorDefinition.
- Loading branch information
Showing
12 changed files
with
148 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
x-pack/legacy/plugins/console_extensions/spec/generated/enrich.delete_policy.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"enrich.delete_policy": { | ||
"methods": [ | ||
"DELETE" | ||
], | ||
"patterns": [ | ||
"_enrich/policy/{name}" | ||
] | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
x-pack/legacy/plugins/console_extensions/spec/generated/enrich.execute_policy.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"enrich.execute_policy": { | ||
"url_params": { | ||
"wait_for_completion": "__flag__" | ||
}, | ||
"methods": [ | ||
"PUT" | ||
], | ||
"patterns": [ | ||
"_enrich/policy/{name}/_execute" | ||
] | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
x-pack/legacy/plugins/console_extensions/spec/generated/enrich.get_policy.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"enrich.get_policy": { | ||
"methods": [ | ||
"GET" | ||
], | ||
"patterns": [ | ||
"_enrich/policy/{name}", | ||
"_enrich/policy" | ||
] | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
x-pack/legacy/plugins/console_extensions/spec/generated/enrich.put_policy.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"enrich.put_policy": { | ||
"methods": [ | ||
"PUT" | ||
], | ||
"patterns": [ | ||
"_enrich/policy/{name}" | ||
] | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
x-pack/legacy/plugins/console_extensions/spec/generated/enrich.stats.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"enrich.stats": { | ||
"methods": [ | ||
"GET" | ||
], | ||
"patterns": [ | ||
"_enrich/_stats" | ||
] | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
x-pack/legacy/plugins/console_extensions/spec/ingest/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
// NOTE: This is copy-pasted from es_6_0/ingest.js in OSS Console. | ||
const commonPipelineParams = { | ||
on_failure: [], | ||
ignore_failure: { | ||
__one_of: [ false, true ] | ||
}, | ||
if: '', | ||
tag: '' | ||
}; | ||
|
||
// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/enrich-processor.html | ||
const enrichProcessorDefinition = { | ||
enrich: { | ||
__template: { | ||
policy_name: '', | ||
field: '', | ||
target_field: '', | ||
}, | ||
policy_name: '', | ||
field: '', | ||
target_field: '', | ||
ignore_missing: { | ||
__one_of: [ false, true ] | ||
}, | ||
override: { | ||
__one_of: [ true, false ] | ||
}, | ||
max_matches: 1, | ||
shape_relation: 'INTERSECTS', | ||
...commonPipelineParams | ||
} | ||
}; | ||
|
||
export const processors = [ | ||
enrichProcessorDefinition, | ||
]; |
26 changes: 26 additions & 0 deletions
26
x-pack/legacy/plugins/console_extensions/spec/overrides/enrich.put_policy.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"enrich.put_policy": { | ||
"data_autocomplete_rules": { | ||
"geo_match": { | ||
"__template": { | ||
"indices": "", | ||
"match_field": "", | ||
"enrich_fields": [] | ||
}, | ||
"indices": "", | ||
"match_field": "", | ||
"enrich_fields": [] | ||
}, | ||
"match": { | ||
"__template": { | ||
"indices": "", | ||
"match_field": "", | ||
"enrich_fields": [] | ||
}, | ||
"indices": "", | ||
"match_field": "", | ||
"enrich_fields": [] | ||
} | ||
} | ||
} | ||
} |