Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Console] Autocomplete definitions (manual backport) #105086

Merged
merged 5 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@
/src/plugins/es_ui_shared/ @elastic/kibana-stack-management
/x-pack/plugins/cross_cluster_replication/ @elastic/kibana-stack-management
/x-pack/plugins/index_lifecycle_management/ @elastic/kibana-stack-management
/x-pack/plugins/console_extensions/ @elastic/kibana-stack-management
/x-pack/plugins/grokdebugger/ @elastic/kibana-stack-management
/x-pack/plugins/index_management/ @elastic/kibana-stack-management
/x-pack/plugins/license_api_guard/ @elastic/kibana-stack-management
Expand All @@ -330,7 +329,6 @@
/x-pack/plugins/ingest_pipelines/ @elastic/kibana-stack-management
/packages/kbn-ace/ @elastic/kibana-stack-management
/packages/kbn-monaco/ @elastic/kibana-stack-management
#CC# /x-pack/plugins/console_extensions/ @elastic/kibana-stack-management
#CC# /x-pack/plugins/cross_cluster_replication/ @elastic/kibana-stack-management

# Security Solution
Expand Down
4 changes: 0 additions & 4 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,6 @@ The plugin exposes the static DefaultEditorController class to consume.
The client-side plugin configures following values:


|{kib-repo}blob/{branch}/x-pack/plugins/console_extensions/README.md[consoleExtensions]
|This plugin provides autocomplete definitions of licensed APIs to the OSS Console plugin.


|{kib-repo}blob/{branch}/x-pack/plugins/cross_cluster_replication/README.md[crossClusterReplication]
|You can run a local cluster and simulate a remote cluster within a single Kibana directory.

Expand Down
5 changes: 0 additions & 5 deletions packages/kbn-spec-to-console/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,10 @@ git pull --depth=1 origin master

### Usage

You need to run the command twice: once for the **OSS** specs and once for the **X-Pack** specs
At the root of the Kibana repository, run the following commands:

```sh
# OSS
yarn spec_to_console -g "<ELASTICSEARCH-REPO-FOLDER>/rest-api-spec/src/main/resources/rest-api-spec/api/*" -d "src/plugins/console/server/lib/spec_definitions/json/generated"

# X-pack
yarn spec_to_console -g "<ELASTICSEARCH-REPO-FOLDER>/x-pack/plugin/src/test/resources/rest-api-spec/api/*" -d "x-pack/plugins/console_extensions/server/lib/spec_definitions/json/generated"
```

### Information used in Console that is not available in the REST spec
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-spec-to-console/lib/convert/params.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module.exports = (params) => {
case 'string':
case 'number':
case 'number|string':
case 'boolean|long':
result[param] = defaultValue || '';
break;
case 'list':
Expand Down
45 changes: 41 additions & 4 deletions src/plugins/console/server/lib/spec_definitions/js/ingest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,29 @@ const dropProcessorDefinition = {
},
};

// 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,
},
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/fail-processor.html
const failProcessorDefinition = {
fail: {
Expand Down Expand Up @@ -279,13 +302,26 @@ const inferenceProcessorDefinition = {
inference: {
__template: {
model_id: '',
field_map: {},
inference_config: {},
field_mappings: {},
},
model_id: '',
field_map: {},
inference_config: {},
target_field: '',
model_id: '',
field_mappings: {
__template: {},
},
inference_config: {
regression: {
__template: {},
results_field: '',
},
classification: {
__template: {},
results_field: '',
num_top_classes: 2,
top_classes_results_field: '',
},
},
...commonPipelineParams,
},
};
Expand Down Expand Up @@ -530,6 +566,7 @@ const processorDefinition = {
dissectProcessorDefinition,
dotExpanderProcessorDefinition,
dropProcessorDefinition,
enrichProcessorDefinition,
failProcessorDefinition,
foreachProcessorDefinition,
geoipProcessorDefinition,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"async_search.get": {
"url_params": {
"wait_for_completion": "",
"wait_for_completion_timeout": "",
"keep_alive": "",
"typed_keys": "__flag__"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"async_search.status": {
"methods": [
"GET"
],
"patterns": [
"_async_search/status/{id}"
],
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html"
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"async_search.submit": {
"url_params": {
"wait_for_completion": "",
"clean_on_completion": "__flag__",
"wait_for_completion_timeout": "",
"keep_on_completion": "__flag__",
"keep_alive": "",
"batched_reduce_size": "",
"request_cache": "__flag__",
Expand All @@ -23,6 +23,7 @@
"expand_wildcards": [
"open",
"closed",
"hidden",
"none",
"all"
],
Expand Down Expand Up @@ -51,7 +52,7 @@
"suggest_text": "",
"timeout": "",
"track_scores": "__flag__",
"track_total_hits": "__flag__",
"track_total_hits": "",
"allow_partial_search_results": "__flag__",
"typed_keys": "__flag__",
"version": "__flag__",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"autoscaling.delete_autoscaling_policy": {
"methods": [
"DELETE"
],
"patterns": [
"_autoscaling/policy/{name}"
],
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-delete-autoscaling-policy.html"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"autoscaling.get_autoscaling_capacity": {
"methods": [
"GET"
],
"patterns": [
"_autoscaling/capacity"
],
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-capacity.html"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"autoscaling.get_autoscaling_policy": {
"methods": [
"GET"
],
"patterns": [
"_autoscaling/policy/{name}"
],
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-get-autoscaling-policy.html"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"autoscaling.put_autoscaling_policy": {
"methods": [
"PUT"
],
"patterns": [
"_autoscaling/policy/{name}"
],
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/autoscaling-put-autoscaling-policy.html"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"_source": [],
"_source_excludes": [],
"_source_includes": [],
"pipeline": ""
"pipeline": "",
"require_alias": "__flag__"
},
"methods": [
"POST",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"p",
"pb"
],
"local": "__flag__",
"master_timeout": "",
"h": [],
"health": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.ml_datafeeds": {
"url_params": {
"allow_no_match": "__flag__",
"allow_no_datafeeds": "__flag__",
"format": "",
"h": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cat.ml_jobs": {
"url_params": {
"allow_no_match": "__flag__",
"allow_no_jobs": "__flag__",
"bytes": [
"b",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
],
"format": "",
"full_id": "__flag__",
"local": "__flag__",
"master_timeout": "",
"h": [],
"help": "__flag__",
Expand All @@ -30,7 +29,8 @@
"micros",
"nanos"
],
"v": "__flag__"
"v": "__flag__",
"include_unloaded_segments": "__flag__"
},
"methods": [
"GET"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"master_timeout": "",
"h": [],
"help": "__flag__",
"include_bootstrap": "__flag__",
"s": [],
"v": "__flag__"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"p",
"pb"
],
"local": "__flag__",
"master_timeout": "",
"h": [],
"help": "__flag__",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"cat.tasks": {
"url_params": {
"format": "",
"node_id": [],
"nodes": [],
"actions": [],
"detailed": "__flag__",
"parent_task": "",
"parent_task_id": "",
"h": [],
"help": "__flag__",
"s": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
"cat.thread_pool": {
"url_params": {
"format": "",
"size": [
"",
"k",
"time": [
"d",
"h",
"m",
"g",
"t",
"p"
"s",
"ms",
"micros",
"nanos"
],
"local": "__flag__",
"master_timeout": "",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"cat.transforms": {
"url_params": {
"from": 0,
"size": 0,
"allow_no_match": "__flag__",
"format": "",
"h": [],
"help": "__flag__",
"s": [],
"time": [
"d",
"h",
"m",
"s",
"ms",
"micros",
"nanos"
],
"v": "__flag__"
},
"methods": [
"GET"
],
"patterns": [
"_cat/transforms",
"_cat/transforms/{transform_id}"
],
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-transforms.html"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"patterns": [
"_search/scroll"
],
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#_clear_scroll_api"
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-scroll-api.html"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"close_point_in_time": {
"methods": [
"DELETE"
],
"patterns": [
"_pit"
],
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/point-in-time-api.html"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"patterns": [
"_component_template/{name}"
],
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-templates.html"
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-component-template.html"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"cluster.delete_voting_config_exclusions": {
"url_params": {
"wait_for_removal": "__flag__"
},
"methods": [
"DELETE"
],
"patterns": [
"_cluster/voting_config_exclusions"
],
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/master/voting-config-exclusions.html"
}
}
Loading