[Ingest Manager] expose method to get agent and list agents to other plugins#70087
Conversation
|
Pinging @elastic/ingest-management (Team:Ingest Management) |
| encryptedSavedObjects: EncryptedSavedObjectsPluginStart; | ||
| } | ||
| ) { | ||
| ): Promise<IngestManagerStartContract> { |
| options: { | ||
| page: number; | ||
| perPage: number; | ||
| kuery?: string; |
There was a problem hiding this comment.
@nchaulet thanks for making this change. So we must page through the data? What is the relationship between showInactive and kuery? And do you have an example of the kuery to get a the unenrolled agent that have or had an Endpoint Integration?
There was a problem hiding this comment.
the showInactive allow to show inactive agent (unenrolled), kuery allow to filter on other fields
For the kuery to get unenrolled agent that have an endpoint integration it will be something like this (if this get merged #69731)
listAgents(soClient, {
showInactive: true,
kuery: `fleet-agents.package:endpoint`
});
if this is not merged you will have to provide the config id
listAgents(soClient, {
showInactive: true,
kuery: `fleet-agents.config_id:config_with_endpoint_1 or fleet-agents.config_id:config_with_endpoint_1`
});
Also I am working on adding an unrolled_at field so you can filter by date after.
There was a problem hiding this comment.
I prefer the first one. I can start coding against the API once you merge.
| authenticateAgentWithAccessToken( | ||
| soClient: SavedObjectsClientContract, | ||
| request: KibanaRequest | ||
| ): Promise<Agent>; |
There was a problem hiding this comment.
Why do we need this method and why do we pass the whole request? Can we pass what is needed incase the request is not compatible from Security Solution to Ingest Manager.
There was a problem hiding this comment.
This method is used for the endpoint artifact API, to authenticate user, the method is already used it was just not typed correctly
| /** | ||
| * Get an Agent by id | ||
| */ | ||
| getAgent(soClient: SavedObjectsClientContract, agentId: string): Promise<Agent>; |
There was a problem hiding this comment.
When we use this method, we will have to look at the active property of the agent to know if it is unenrolled?
|
@elasticmachine merge upstream |
💚 Build SucceededBuild metricspage load asset sizebeta
History
To update your PR or re-run it, just comment with: |
Description
Expose methods to list and get agents to other plugins (endpoint is going to use).
The
agentServicein ingest manager plugin start now expose alistAgentsmethod and agetAgentThe
listAgentsmethod support akueryparameter that make most of the endpoint queries possible,If some fields are not queriable with kuery, I will make the changes in a follow up PR.