Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b2b30d9
Adding initial autocomplete rules for Ingest APIs
ycombinator Jan 27, 2017
adc3af0
Fixing append processor autocomplete rules
ycombinator Jan 27, 2017
1290560
Adding autocomplete rules for Convert processor
ycombinator Jan 27, 2017
008d3ec
Adding autocomplete rules for the Date processor
ycombinator Jan 27, 2017
39895ff
Adding references to docs
ycombinator Jan 27, 2017
8609026
Adding autocomplete rules for Date Index Name processor
ycombinator Jan 27, 2017
52e8f25
AAdding autocomplete rules for the Fail processor
ycombinator Jan 27, 2017
3105651
Adding autocomplete rules for Foreach processor
ycombinator Jan 27, 2017
77e5126
Adding autocomplete rules for Grok processor
ycombinator Jan 27, 2017
6b0018d
Adding autocomplete rules for gsub processor
ycombinator Jan 27, 2017
b27ff7f
Fixing autocomplete rules for Gsub processor
ycombinator Jan 27, 2017
35c1405
Adding autocomplete rules for the Join processor
ycombinator Jan 27, 2017
7117041
Adding autocomplete rules for JSON processor
ycombinator Jan 27, 2017
d8c83b0
Adding autocomplete rules for the KV processor
ycombinator Jan 27, 2017
8bd9b98
Adding autocomplete rules for Lowercase processor
ycombinator Jan 27, 2017
65392b6
Adding autocomplete rules for the Remove processor
ycombinator Jan 27, 2017
3a97ec7
Adding autocomplete rules for the Rename processor
ycombinator Jan 27, 2017
3ae6a09
Adding autocomplete rules for the Script processor
ycombinator Jan 27, 2017
bb5e58f
Adding autocomplete rules for the Set processor
ycombinator Jan 27, 2017
14c47bd
Adding autocomplete rules for the Split processor
ycombinator Jan 27, 2017
db316bb
Adding autcomplete rules for the Sort processor
ycombinator Jan 27, 2017
4e98a7d
Fixing definition of Sort processor
ycombinator Jan 27, 2017
25d735b
Adding autocomplete rules for the Trim processor
ycombinator Jan 27, 2017
8a41d9b
Adding autocomplete rules for the Uppercase processor
ycombinator Jan 27, 2017
fcab90f
Adding autocomplete rules for Dot Expander processor
ycombinator Jan 27, 2017
18c80bc
Fixing autocomplete rules for Dot Expander processor
ycombinator Jan 27, 2017
3c6ef24
Fixing forward reference problem
ycombinator Jan 27, 2017
1bec111
Removing TODO note
ycombinator Jan 27, 2017
ff8b27e
Enable (recursive) autocomplete on foreach processor's "processor" field
ycombinator Jan 30, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/core_plugins/console/api_server/es_5_0.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ let parts = [
require('./es_5_0/nodes'),
require('./es_5_0/globals'),
require('./es_5_0/indices'),
require('./es_5_0/ingest'),
require('./es_5_0/mappings'),
require('./es_5_0/percolator'),
require('./es_5_0/query'),
Expand Down
386 changes: 386 additions & 0 deletions src/core_plugins/console/api_server/es_5_0/ingest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,386 @@
// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/append-processor.html
const appendProcessorDefinition = {
append: {
__template: {
field: '',
value: []
},
field: '',
value: []
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/convert-processor.html
const convertProcessorDefinition = {
convert: {
__template: {
field: '',
type: ''
},
field: '',
type: {
__one_of: [ 'integer', 'float', 'string', 'boolean', 'auto' ]
},
target_field: '',
ignore_missing: {
__one_of: [ false, true ]
}
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/date-processor.html
const dateProcessorDefinition = {
date: {
__template: {
field: '',
formats: []
},
field: '',
target_field: '@timestamp',
formats: [],
timezone: 'UTC',
locale: 'ENGLISH'
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/date-index-name-processor.html
const dateIndexNameProcessorDefinition = {
date_index_name: {
__template: {
field: '',
date_rounding: ''
},
field: '',
date_rounding: {
__one_of: [ 'y', 'M', 'w', 'd', 'h', 'm', 's' ]
},
date_formats: [],
timezone: 'UTC',
locale: 'ENGLISH',
index_name_format: 'yyyy-MM-dd'
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/fail-processor.html
const failProcessorDefinition = {
fail: {
__template: {
message: ''
},
message: ''
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/foreach-processor.html
const foreachProcessorDefinition = {
foreach: {
__template: {
field: '',
processor: {}
},
field: '',
processor: {
__scope_link: '_processor'
}
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html
const grokProcessorDefinition = {
grok: {
__template: {
field: '',
patterns: []
},
field: '',
patterns: [],
pattern_definitions: {},
trace_match: {
__one_of: [ false, true ]
},
ignore_missing: {
__one_of: [ false, true ]
}
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/gsub-processor.html
const gsubProcessorDefinition = {
gsub: {
__template: {
field: '',
pattern: '',
replacement: ''
},
field: '',
pattern: '',
replacement: ''
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/join-processor.html
const joinProcessorDefinition = {
join: {
__template: {
field: '',
separator: ''
},
field: '',
separator: ''
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/json-processor.html
const jsonProcessorDefinition = {
json: {
__template: {
field: ''
},
field: '',
target_field: '',
add_to_root: {
__one_of: [ false, true ]
}
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/kv-processor.html
const kvProcessorDefinition = {
kv: {
__template: {
field: '',
field_split: '',
value_split: ''
},
field: '',
field_split: '',
value_split: '',
target_field: '',
include_keys: [],
ignore_missing: {
__one_of: [ false, true ]
}
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/lowercase-processor.html
const lowercaseProcessorDefinition = {
lowercase: {
__template: {
field: ''
},
field: '',
ignore_missing: {
__one_of: [ false, true ]
}
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/remove-processor.html
const removeProcessorDefinition = {
remove: {
__template: {
field: ''
},
field: ''
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/rename-processor.html
const renameProcessorDefinition = {
rename: {
__template: {
field: '',
target_field: ''
},
field: '',
target_field: '',
ignore_missing: {
__one_of: [ false, true ]
}
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/script-processor.html
const scriptProcessorDefinition = {
script: {
__template: {},
lang: 'painless',
file: '',
id: '',
inline: '',
params: {}
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/set-processor.html
const setProcessorDefinition = {
set: {
__template: {
field: '',
value: ''
},
field: '',
value: '',
override: {
__one_of: [ true, false ]
}
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/split-processor.html
const splitProcessorDefinition = {
split: {
__template: {
field: '',
separator: ''
},
field: '',
separator: '',
ignore_missing: {
__one_of: [ false, true ]
}
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/sort-processor.html
const sortProcessorDefinition = {
sort: {
__template: {
field: ''
},
field: '',
order: 'asc'
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/trim-processor.html
const trimProcessorDefinition = {
trim: {
__template: {
field: ''
},
field: '',
ignore_missing: {
__one_of: [ false, true ]
}
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/uppercase-processor.html
const uppercaseProcessorDefinition = {
uppercase: {
__template: {
field: ''
},
field: '',
ignore_missing: {
__one_of: [ false, true ]
}
}
};

// Based on https://www.elastic.co/guide/en/elasticsearch/reference/master/dot-expand-processor.html
const dotExpanderProcessorDefinition = {
dot_expander: {
__template: {
field: ''
},
field: '',
path: ''
}
};

const processorDefinition = {
__one_of: [
appendProcessorDefinition,
convertProcessorDefinition,
dateProcessorDefinition,
dateIndexNameProcessorDefinition,
failProcessorDefinition,
foreachProcessorDefinition,
grokProcessorDefinition,
gsubProcessorDefinition,
joinProcessorDefinition,
jsonProcessorDefinition,
kvProcessorDefinition,
lowercaseProcessorDefinition,
removeProcessorDefinition,
renameProcessorDefinition,
scriptProcessorDefinition,
setProcessorDefinition,
splitProcessorDefinition,
sortProcessorDefinition,
trimProcessorDefinition,
uppercaseProcessorDefinition,
dotExpanderProcessorDefinition
]
};

const pipelineDefinition = {
description: '',
processors: [
processorDefinition
],
version: 123,
};

const simulateUrlParamsDefinition = {
"verbose": "__flag__"
};

module.exports = function (api) {

// Note: this isn't an actual API endpoint. It exists so the forEach processor's "processor" field
// may recursively use the autocomplete rules for any processor.
api.addEndpointDescription('_processor', {
data_autocomplete_rules: processorDefinition
});

api.addEndpointDescription('_put_ingest_pipeline', {
methods: ['PUT'],
patterns: [
'_ingest/pipeline/{name}'
],
data_autocomplete_rules: pipelineDefinition
});

api.addEndpointDescription('_get_ingest_pipeline', {
methods: ['GET'],
patterns: [
'_ingest/pipeline/{id}'
]
});

api.addEndpointDescription('_delete_ingest_pipeline', {
methods: ['DELETE'],
patterns: [
'_ingest/pipeline/{id}'
]
});

api.addEndpointDescription('_simulate_new_ingest_pipeline', {
methods: ['POST'],
patterns: [
'_ingest/pipeline/_simulate'
],
url_params: simulateUrlParamsDefinition,
data_autocomplete_rules: {
pipeline: pipelineDefinition,
docs: [
]
}
});

api.addEndpointDescription('_simulate_existing_ingest_pipeline', {
methods: ['POST'],
patterns: [
'_ingest/pipeline/{name}/_simulate'
],
url_params: simulateUrlParamsDefinition,
data_autocomplete_rules: {
docs: [
]
}
});
};