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

Index lifecycle #25553

Merged
merged 152 commits into from
Dec 10, 2018
Merged
Show file tree
Hide file tree
Changes from 117 commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
25cfc88
[WIP] Index lifecycle (#25071)
bmcconaghy Nov 12, 2018
d71d35c
removing console.log statements
bmcconaghy Nov 12, 2018
7118608
adding key for banner extensions
bmcconaghy Nov 12, 2018
a1055f8
fixing bad import for FormattedMessage
bmcconaghy Nov 12, 2018
9869f83
add link to edit index lifecycle policy from index management index s…
bmcconaghy Nov 12, 2018
05f0da7
adding key for map of summary extensions
bmcconaghy Nov 12, 2018
9fffdcb
adding proper icon for retry lifecycle action
bmcconaghy Nov 12, 2018
a9565b7
factoring out common min age component
bmcconaghy Nov 13, 2018
7c7c220
factoring out common NodeAllocation component
bmcconaghy Nov 13, 2018
3d16e96
add copy to clipboard for json policy flyout
bmcconaghy Nov 13, 2018
bbf797d
adding validation rules for policy names to match ES rules
bmcconaghy Nov 14, 2018
72e414c
fixing issues with policy names with non-alphabetic characters like &…
bmcconaghy Nov 14, 2018
c227d13
moving create policy button to top right and adding fill
bmcconaghy Nov 14, 2018
ec97734
adding better empty state for policy list
bmcconaghy Nov 14, 2018
c327036
moving shrink and force merge titles and descriptions to the left
bmcconaghy Nov 14, 2018
1861141
Merge branch 'master' of github.com:elastic/kibana into feature/index…
bmcconaghy Nov 14, 2018
f1cec95
moving show JSON button to right and limiting width of JSON flyout
bmcconaghy Nov 14, 2018
f6c7801
fixing warning about lifecycle prop type for JSON flyout
bmcconaghy Nov 14, 2018
2c80733
fixing issue with warning on prop isShowingErrors
bmcconaghy Nov 14, 2018
fa44132
removing outdated README
bmcconaghy Nov 14, 2018
889a618
simplifying constants
bmcconaghy Nov 14, 2018
cac732a
moving components to more logical places
bmcconaghy Nov 14, 2018
e6ed714
moving lib and api files to services
bmcconaghy Nov 14, 2018
d71f8a0
renaming provider to enricher
bmcconaghy Nov 14, 2018
4a63330
factoring out common data enricher behavior
bmcconaghy Nov 14, 2018
6e081b1
consolidating index management extension code
bmcconaghy Nov 14, 2018
1971280
removing unnecessary colon
bmcconaghy Nov 14, 2018
e73966f
Revert "removing unnecessary colon"
bmcconaghy Nov 14, 2018
18a0a1d
removing unnecessary colon
bmcconaghy Nov 14, 2018
cadea13
adding callout to ilm summary for errors
bmcconaghy Nov 14, 2018
7f5196c
better formatting for banner extensions
bmcconaghy Nov 14, 2018
6d0f208
Revert "disabling UI for index management when enabled is false in ki…
bmcconaghy Nov 14, 2018
ef390e7
removing unnecessary code for detecting disabled plugin
bmcconaghy Nov 14, 2018
a4ee97d
adding config prefix of xpack.index_lifecycle_management
bmcconaghy Nov 14, 2018
89aa0e1
making policy link use href and consolidating link encoding logic
bmcconaghy Nov 14, 2018
80902c8
removed outdated comment
bmcconaghy Nov 14, 2018
8c4029d
removed outdated comment
bmcconaghy Nov 14, 2018
eaa941f
better solution for policy name in URI
bmcconaghy Nov 15, 2018
717106e
Merge branch 'master' of github.com:elastic/kibana into feature/index…
bmcconaghy Nov 15, 2018
11c8c59
fixing issue with index management being disabled and index_lifecycle…
bmcconaghy Nov 15, 2018
7ca4507
adding link to index management list filtered to policy name from ind…
bmcconaghy Nov 15, 2018
e92aef1
Merge branch 'master' of github.com:elastic/kibana into feature/index…
bmcconaghy Nov 15, 2018
664ae58
fixing tests
bmcconaghy Nov 16, 2018
2f0e6f7
adding popover for stack trace for ilm errors
bmcconaghy Nov 16, 2018
fe047a1
adding stack trace and phase definition popovers to ilm summary in in…
bmcconaghy Nov 16, 2018
b04de6d
adding to blacklist for node attributes and not showing node allocati…
bmcconaghy Nov 16, 2018
a652e9b
not showing create policy button in upper right for empty state
bmcconaghy Nov 17, 2018
fdc0034
moving policy name form field to right to be consistent with the rest…
bmcconaghy Nov 17, 2018
f89af82
moving save button to left and using secondary color
bmcconaghy Nov 17, 2018
5e5ebfe
added copied to clipboard toast message
bmcconaghy Nov 17, 2018
b855b18
moving activate/deactivate buttons to left on edit policy page
bmcconaghy Nov 17, 2018
bd9df3a
deleting unnecessary less file
bmcconaghy Nov 17, 2018
a26015e
using spacer instead of style
bmcconaghy Nov 17, 2018
e197ba1
translating success message for edit policy save
bmcconaghy Nov 19, 2018
3200cc4
fixing missing props warnings for EuiDescribedFormGroup usages
bmcconaghy Nov 19, 2018
627e782
better error handling borrowed from rollups
bmcconaghy Nov 19, 2018
b63ff0a
disabling delete when a policy is attached to indices
bmcconaghy Nov 19, 2018
4a3077d
Merge branch 'master' of github.com:elastic/kibana into feature/index…
bmcconaghy Nov 19, 2018
48ca9be
adding remove lifecycle policy action
bmcconaghy Nov 19, 2018
7c3c9d7
fixing issue with remove ilm policy showing for non-managed indices`
bmcconaghy Nov 19, 2018
e1afabb
adding add lifecycle policy action to index management extensions in …
bmcconaghy Nov 20, 2018
1a95ec4
adding confirm modal for remove lifecycle policy
bmcconaghy Nov 20, 2018
753e13e
fixing validation
bmcconaghy Nov 20, 2018
a2b396d
fixing issue with back button and edit policy retaining old policy
bmcconaghy Nov 21, 2018
198fd26
Merge branch 'master' of github.com:elastic/kibana into feature/index…
bmcconaghy Nov 21, 2018
955c395
removing console.log
bmcconaghy Nov 21, 2018
2e89680
making no policy modal for add lifecycle policy make more sense (no a…
bmcconaghy Nov 21, 2018
0d171ee
Calling reloadIndices when a lifecycle policy gets added or removed
bmcconaghy Nov 21, 2018
cb7fbfb
fixing logic issue with spinner showing
bmcconaghy Nov 21, 2018
bb0d3f2
refactoring confirm modal on policy list page
bmcconaghy Nov 21, 2018
445804c
adding an add to index template button on policy list page
bmcconaghy Nov 26, 2018
960ef2c
fixing console warning about select value being null
bmcconaghy Nov 26, 2018
80443bd
fixing issue with modal not opening from index management table manag…
bmcconaghy Nov 26, 2018
3f41730
changing app title and adding i18n for it
bmcconaghy Nov 26, 2018
aa8ce1d
more naming changes and adding beta badge
bmcconaghy Nov 26, 2018
b61d2f2
Merge branch 'master' of github.com:elastic/kibana into feature/index…
bmcconaghy Nov 26, 2018
bd22a00
Merge branch 'master' of github.com:elastic/kibana into feature/index…
bmcconaghy Nov 27, 2018
4d1f3dc
adding filter extension to index management and using it to add filte…
bmcconaghy Nov 27, 2018
4cb443b
fixing broken jest test
bmcconaghy Nov 27, 2018
525a7ac
Merge branch 'master' of github.com:elastic/kibana into feature/index…
bmcconaghy Nov 28, 2018
90cce7f
fixing issue with banners appearing/disappearing based on filters
bmcconaghy Nov 28, 2018
94e1d5a
adding xpack.ilm.ui.enabled to allow cloud to disable the ui
bmcconaghy Nov 28, 2018
ce1d8b2
add ability to configure list of node attributes to ignore in kibana.…
bmcconaghy Nov 28, 2018
e50924d
filtering out reserved system templates from fetch route list
bmcconaghy Nov 28, 2018
fb72e67
adding warning when user tries to add a policy to a template that alr…
bmcconaghy Nov 28, 2018
4d7af88
fixing a11y issues on edit policy form
bmcconaghy Nov 29, 2018
6af1d0c
incorporating docs team feedback on copy
bmcconaghy Nov 29, 2018
9eb7b1c
adding learn more link to add policy to index template modal
bmcconaghy Nov 29, 2018
73e13e0
Merge branch 'master' of github.com:elastic/kibana into feature/index…
bmcconaghy Nov 29, 2018
2606b4b
Merge branch 'master' of github.com:elastic/kibana into feature/index…
bmcconaghy Nov 30, 2018
a777230
fixing app order for management
bmcconaghy Nov 30, 2018
1e1bfce
fixing breadcrumb issue by adding redirect for BASE_PATH (and adding …
bmcconaghy Nov 30, 2018
8855a3b
making version and covered indices column smaller and adding horizont…
bmcconaghy Nov 30, 2018
bb6d539
right align actions and better width solution for columns
bmcconaghy Nov 30, 2018
4caff44
bigger spacer under callout for no node attributes
bmcconaghy Nov 30, 2018
67a7e47
restricting width of edit page
bmcconaghy Nov 30, 2018
9520690
fixing typo
bmcconaghy Nov 30, 2018
6a0a286
removing unnecessary store code for index templates
bmcconaghy Nov 30, 2018
b85d2d9
fixing react warning about boolean type
bmcconaghy Nov 30, 2018
c7fda8e
moving beta badge in line with title on policies screen
bmcconaghy Nov 30, 2018
f748192
better UI for show JSON for edit policy
bmcconaghy Nov 30, 2018
0b9108c
commenting on the memory leak fix for React Router redirects
bmcconaghy Nov 30, 2018
79c7a01
fixing fatal error with node allocation flyout
bmcconaghy Nov 30, 2018
8543150
Merge branch 'master' of github.com:elastic/kibana into feature/index…
bmcconaghy Dec 1, 2018
a9bca53
Merge branch 'master' of github.com:elastic/kibana into feature/index…
bmcconaghy Dec 3, 2018
a0434e6
fixing issue with banner not showing
bmcconaghy Dec 3, 2018
cdec345
moving unmanaged/managed filter to filter group to make it clearer wh…
bmcconaghy Dec 3, 2018
b765b82
Merge branch 'master' of github.com:elastic/kibana into feature/index…
bmcconaghy Dec 3, 2018
84acff7
removing unused code
bmcconaghy Dec 3, 2018
11aa4e1
copy changes
bmcconaghy Dec 3, 2018
df39f2b
adding context menu for policy table instead of icon buttons
bmcconaghy Dec 3, 2018
361e8ad
adding fix errors badge for phases
bmcconaghy Dec 3, 2018
4f45d68
removing unnecessary close button in flyout footer
bmcconaghy Dec 3, 2018
c9a2c31
adding spinner when nodeOptions are not present
bmcconaghy Dec 3, 2018
7e7e34d
moving view a list button below input
bmcconaghy Dec 3, 2018
acceb13
adding more explanation to add policy to index template modal
bmcconaghy Dec 3, 2018
e72ac43
adding documentation link for main ILM docs in ES
bmcconaghy Dec 3, 2018
a602c60
only showing view nodes link when node attributes are selected
bmcconaghy Dec 4, 2018
e325412
removing colon from flyout title
bmcconaghy Dec 4, 2018
f644847
fixing layout for view nodes button for attributes
bmcconaghy Dec 4, 2018
fc800c2
making loading spinner larger for node attributes select
bmcconaghy Dec 4, 2018
e04ea81
fixing issue with button going off end of table
bmcconaghy Dec 4, 2018
621f76c
removing title from empty prompt for policy table
bmcconaghy Dec 4, 2018
7bf0f1e
fixing max width for edit policy page
bmcconaghy Dec 4, 2018
f2396fd
copy edits
bmcconaghy Dec 4, 2018
2091c82
don't show pager when number of policies is less than minimum page size
bmcconaghy Dec 4, 2018
e8e8d7e
making number of replicas optional and adding optional label
bmcconaghy Dec 4, 2018
449f8cf
fixing sort for policy table
bmcconaghy Dec 4, 2018
8708783
Merge branch 'master' of github.com:elastic/kibana into feature/index…
bmcconaghy Dec 4, 2018
ba2bdde
fixing flicker for node allocation
bmcconaghy Dec 5, 2018
c316924
removing redundant message for index policies defined
bmcconaghy Dec 5, 2018
e219e27
fixing spacing/alignment issues on error display for summary
bmcconaghy Dec 5, 2018
b1c218e
fixing issues with pager not showing and controls disappearing when f…
bmcconaghy Dec 5, 2018
5b41501
adding tests for policy table
bmcconaghy Dec 5, 2018
ae4f7ef
more test additions
bmcconaghy Dec 5, 2018
fb319d4
making search bar incremental for index management
bmcconaghy Dec 5, 2018
cee9893
Merge branch 'master' of github.com:elastic/kibana into feature/index…
bmcconaghy Dec 6, 2018
7a84207
making JSON policy flyout show ES request JSON not internal represent…
bmcconaghy Dec 6, 2018
f056efb
adding error message when user tries to submit add policy to index wi…
bmcconaghy Dec 6, 2018
50c9edb
adding validation for missing template on add policy to index templat…
bmcconaghy Dec 6, 2018
26d6838
adding tests for ilm index management extensions
bmcconaghy Dec 7, 2018
23b0db4
adding tests for edit policy
bmcconaghy Dec 7, 2018
5a02830
removing learn about node attributes link until docs come
bmcconaghy Dec 7, 2018
05a7f91
fixing prop type warning
bmcconaghy Dec 10, 2018
adbc6cd
adding missing translations
bmcconaghy Dec 10, 2018
9ee24db
better tests for edit policy
bmcconaghy Dec 10, 2018
00f3aa8
adding tests for node attribute inputs
bmcconaghy Dec 10, 2018
92972ef
better tests for node attributes
bmcconaghy Dec 10, 2018
7d91d6a
fixing policy table test
bmcconaghy Dec 10, 2018
eae092a
fixing bad i18n id
bmcconaghy Dec 10, 2018
5990be0
Merge branch 'master' of github.com:elastic/kibana into feature/index…
bmcconaghy Dec 10, 2018
345ddf8
updating snapshot
bmcconaghy Dec 10, 2018
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
2 changes: 2 additions & 0 deletions x-pack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { apm } from './plugins/apm';
import { licenseManagement } from './plugins/license_management';
import { cloud } from './plugins/cloud';
import { indexManagement } from './plugins/index_management';
import { indexLifecycleManagement } from './plugins/index_lifecycle_management';
import { consoleExtensions } from './plugins/console_extensions';
import { spaces } from './plugins/spaces';
import { notifications } from './plugins/notifications';
Expand Down Expand Up @@ -52,6 +53,7 @@ module.exports = function (kibana) {
indexManagement(kibana),
consoleExtensions(kibana),
notifications(kibana),
indexLifecycleManagement(kibana),
kueryAutocomplete(kibana),
infra(kibana),
rollup(kibana),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* 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.
*/

export const BASE_PATH = '/management/elasticsearch/index_lifecycle_management/';
export const PLUGIN_ID = 'index_lifecycle_management';
63 changes: 63 additions & 0 deletions x-pack/plugins/index_lifecycle_management/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* 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.
*/

import { resolve } from 'path';
import { registerTemplatesRoutes } from './server/routes/api/templates';
import { registerNodesRoutes } from './server/routes/api/nodes';
import { registerPoliciesRoutes } from './server/routes/api/policies';
import { registerLifecycleRoutes } from './server/routes/api/lifecycle';
import { registerIndexRoutes } from './server/routes/api/index';
import { registerLicenseChecker } from './server/lib/register_license_checker';
import { PLUGIN_ID } from './common/constants';
import { indexLifecycleDataEnricher } from './index_lifecycle_data';
export function indexLifecycleManagement(kibana) {
return new kibana.Plugin({
config: (Joi) => {
return Joi.object({
enabled: Joi.boolean().default(true),
ui: Joi.object({
enabled: Joi.boolean().default(true),
}).default(),
filteredNodeAttributes: Joi.array().items(Joi.string()).default([])
}).default();
},
id: PLUGIN_ID,
publicDir: resolve(__dirname, 'public'),
bmcconaghy marked this conversation as resolved.
Show resolved Hide resolved
configPrefix: 'xpack.ilm',
require: ['kibana', 'elasticsearch', 'xpack_main', 'index_management'],
uiExports: {
styleSheetPaths: `${__dirname}/public/index.scss`,
managementSections: ['plugins/index_lifecycle_management'],
injectDefaultVars(server) {
const config = server.config();
return {
ilmUiEnabled: config.get('xpack.ilm.ui.enabled')
};
},
},
isEnabled(config) {
return (
config.get('xpack.ilm.enabled') &&
config.has('index_management.enabled') &&
config.get('index_management.enabled')
);
},
init: function (server) {
registerLicenseChecker(server);
registerTemplatesRoutes(server);
registerNodesRoutes(server);
registerPoliciesRoutes(server);
registerLifecycleRoutes(server);
registerIndexRoutes(server);
if (
server.plugins.index_management &&
server.plugins.index_management.addIndexManagementDataEnricher
) {
server.plugins.index_management.addIndexManagementDataEnricher(indexLifecycleDataEnricher);
}
},
});
}
22 changes: 22 additions & 0 deletions x-pack/plugins/index_lifecycle_management/index_lifecycle_data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* 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.
*/

export const indexLifecycleDataEnricher = async (indicesList, callWithRequest) => {
if (!indicesList || !indicesList.length) {
return;
}
const params = {
path: '/*/_ilm/explain',
method: 'GET',
};
const { indices: ilmIndicesData } = await callWithRequest('transport.request', params);
return indicesList.map(index => {
return {
...index,
ilm: { ...(ilmIndicesData[index.name] || {}) },
};
});
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.policyTable__horizontalScrollContainer {
overflow-x: auto;
max-width: 100%;
height: 100vh;
}
.policyTable__horizontalScroll {
min-width: 800px;
width: 100%;
}
.ilmEditPolicyPageContent {
max-width: 1200px;
}
21 changes: 21 additions & 0 deletions x-pack/plugins/index_lifecycle_management/public/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* 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.
*/

import React from 'react';
import { HashRouter, Switch, Route, Redirect } from 'react-router-dom';
import { EditPolicy } from './sections/edit_policy';
import { PolicyTable } from './sections/policy_table';
import { BASE_PATH } from '../common/constants';

export const App = () => (
<HashRouter>
<Switch>
<Redirect exact from={`${BASE_PATH}`} to={`${BASE_PATH}policies`}/>
<Route exact path={`${BASE_PATH}policies`} component={PolicyTable}/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clicking Index Lifecycle Management from the top nav breadcrumb goes to #/management/elasticsearch/index_lifecycle_management, which is blank. add redirect to fix:

Suggested change
<Route exact path={`${BASE_PATH}policies`} component={PolicyTable}/>
<Route exact path={`${BASE_PATH}policies`} component={PolicyTable}/>
<Redirect exact from={`${BASE_PATH}`} to={`${BASE_PATH}policies`} />

<Route path={`${BASE_PATH}policies/edit/:policyName?`} component={EditPolicy}/>
</Switch>
</HashRouter>
);
Loading