-
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
[Rollups] Server NP migration #55606
Changes from 15 commits
7be7447
8524ce5
ed8e4e9
323927a
186c901
41e3fdb
57a3a8f
b2432e1
760d75c
7cb95c3
d0ba3bf
906ab1d
2c99beb
6d1a0db
9dfe043
95a5562
b90d0a9
792946f
941ccd7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"id": "rollup", | ||
"version": "kibana", | ||
"requiredPlugins": [ | ||
"home", | ||
"index_management", | ||
"metrics" | ||
], | ||
"optionalPlugins": [ | ||
"usageCollection" | ||
], | ||
"server": true, | ||
"ui": false | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* 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 { ElasticsearchServiceSetup } from 'kibana/server'; | ||
import { once } from 'lodash'; | ||
import { elasticsearchJsPlugin } from '../../client/elasticsearch_rollup'; | ||
|
||
const callWithRequest = once((elasticsearchService: ElasticsearchServiceSetup) => { | ||
const config = { plugins: [elasticsearchJsPlugin] }; | ||
return elasticsearchService.createClient('rollup', config); | ||
}); | ||
|
||
export const callWithRequestFactory = ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need this factory? In my PR, I've used it directly from the router context https://github.com/elastic/kibana/pull/56829/files#diff-178c0726cd4b1e7299f257e5069b4a42R28 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for sharing! I'm going to leave as is for now, but will consider changing this in my next PR. |
||
elasticsearchService: ElasticsearchServiceSetup, | ||
request: any | ||
) => { | ||
return (...args: any[]) => { | ||
return ( | ||
callWithRequest(elasticsearchService) | ||
.asScoped(request) | ||
// @ts-ignore | ||
.callAsCurrentUser(...args) | ||
); | ||
}; | ||
}; |
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.
Is this used anywhere? couldn't find a reference.
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.
Good catch. You're right, it's not needed anymore.