-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 management] Server-side NP ready #56829
Merged
sebelga
merged 32 commits into
elastic:master
from
sebelga:np-migration/index-management
Feb 11, 2020
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
b22e9ab
Move server code to "np_ready" folder
sebelga ee474e8
Add reload() api route
sebelga 88192c5
Add indexClose() & indexOpen() api route
sebelga 65f1ec2
Add indexRefresh() api route
sebelga bd74ed2
Add freeze() & unfreeze() api route
sebelga a69e7f8
Add flush() & forceMerge() api route
sebelga ba2c389
Add deleteIndex() api route
sebelga 55a1c78
Add indexMapping() api route
sebelga 7e53791
Add index settings Api routes
sebelga 09542fe
Add indexStats() api route
sebelga 8425911
Add get template(s) api routes
sebelga c212847
Clean-up server plugin dependencies
sebelga 59ac5da
Add create & update template api routes
sebelga d5e6177
Use data client instead of admin client
sebelga 3f7ffe5
Add delete template api routes and bring in wrapEsError helper
sebelga d4616bb
Use class to declare ApiRoutes
sebelga 38e038c
Create License service to check license on routes
sebelga 12c3723
Add route guard to License service
sebelga 81410f1
Guard all api route with license checker
sebelga 77188c8
Remove constructor from License and move to setup() call
sebelga 3aa9d3b
Move IndexDataEnricher to its own class
sebelga a6e227e
Add missing license route guard
sebelga fec69db
Add missing "rollover_alias" prop to ilmPolicy schema object
sebelga 78340e6
Refactor var name plugin public api
sebelga 5e1b5e7
Remove "np_ready" folder for server side
sebelga 7f8d305
Add readonly to Server plugin class
sebelga 5861ab0
Add lib helpers in route dependencies
sebelga 5da8c81
Wrap all server api response in try catch and return ES errors
sebelga 30a7494
Fix API integration tests
sebelga fc96fed
Merge branch 'master' into np-migration/index-management
sebelga 167f075
Fix API integration test (2)
sebelga 1e902eb
Merge remote-tracking branch 'upstream/master' into np-migration/inde…
sebelga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* 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 { PLUGIN, API_BASE_PATH } from './constants'; |
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
15 changes: 0 additions & 15 deletions
15
x-pack/legacy/plugins/index_management/server/index_management_data.ts
This file was deleted.
Oops, something went wrong.
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
13 changes: 13 additions & 0 deletions
13
x-pack/legacy/plugins/index_management/server/lib/is_es_error.ts
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 @@ | ||
/* | ||
* 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 * as legacyElasticsearch from 'elasticsearch'; | ||
|
||
const esErrorsParent = legacyElasticsearch.errors._Abstract; | ||
|
||
export function isEsError(err: Error) { | ||
return err instanceof esErrorsParent; | ||
} |
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
9 changes: 9 additions & 0 deletions
9
x-pack/legacy/plugins/index_management/server/routes/api/index.ts
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,9 @@ | ||
/* | ||
* 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 { API_BASE_PATH } from '../../../common'; | ||
|
||
export const addBasePath = (uri: string): string => API_BASE_PATH + uri; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I like this idea.
It's nice to see how the different plugin phases can be tagged in services so we build on the established plugin pattern.
My question is; what benefits do we get from have instances of the services live on the plugin as opposed to constructing them at setup time and passing them into our other components? Is it mainly for naming or do we see these services often also having
start
phase concerns?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seemed more logical to me to instantiate them outside, no real benefit. But as you said, this patterns allows us to call
.start()
and.stop()
if needed.