Skip to content

Commit

Permalink
[EPM] Use index templates v2 (#64305)
Browse files Browse the repository at this point in the history
* Install prebuilt index templates as v2

* Correctly handle pre-build v1 index templates

* Generate index templates v2 during package install

* Update unit tests for index template v2

* Fix imports.

* Fix types.

* Use index template v2 API for template deletion

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
skh and elasticmachine committed Apr 28, 2020
1 parent da89856 commit 512e097
Show file tree
Hide file tree
Showing 6 changed files with 1,590 additions and 1,475 deletions.
15 changes: 11 additions & 4 deletions x-pack/plugins/ingest_manager/common/types/models/epm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export enum KibanaAssetType {
}

export enum ElasticsearchAssetType {
componentTemplate = 'component-template',
ingestPipeline = 'ingest-pipeline',
indexTemplate = 'index-template',
ilmPolicy = 'ilm-policy',
Expand Down Expand Up @@ -246,6 +247,7 @@ export enum IngestAssetType {
DataFrameTransform = 'data-frame-transform',
IlmPolicy = 'ilm-policy',
IndexTemplate = 'index-template',
ComponentTemplate = 'component-template',
IngestPipeline = 'ingest-pipeline',
MlJob = 'ml-job',
RollupJob = 'rollup-job',
Expand All @@ -261,12 +263,17 @@ export interface IndexTemplateMappings {
properties: any;
}

// This is an index template v2, see https://github.com/elastic/elasticsearch/issues/53101
// until "proper" documentation of the new format is available.
// Ingest Manager does not use nor support the legacy index template v1 format at all
export interface IndexTemplate {
order: number;
priority: number;
index_patterns: string[];
settings: any;
mappings: object;
aliases: object;
template: {
settings: any;
mappings: object;
aliases: object;
};
}

export interface TemplateRef {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const AssetTitleMap: Record<AssetType, string> = {
'ingest-pipeline': 'Ingest Pipeline',
'index-pattern': 'Index Pattern',
'index-template': 'Index Template',
'component-template': 'Component Template',
search: 'Saved Search',
visualization: 'Visualization',
input: 'Agent input',
Expand Down
Loading

0 comments on commit 512e097

Please sign in to comment.