-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Ingest Manager] expose method to get agent and list agents to other plugins #70087
Changes from all commits
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 |
---|---|---|
|
@@ -4,8 +4,8 @@ | |
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { SavedObjectsClientContract } from 'kibana/server'; | ||
import { AgentStatus } from '../types'; | ||
import { SavedObjectsClientContract, KibanaRequest } from 'kibana/server'; | ||
import { AgentStatus, Agent } from '../types'; | ||
import * as settingsService from './settings'; | ||
export { ESIndexPatternSavedObjectService } from './es_index_pattern'; | ||
|
||
|
@@ -24,12 +24,38 @@ export interface ESIndexPatternService { | |
* A service that provides exported functions that return information about an Agent | ||
*/ | ||
export interface AgentService { | ||
/** | ||
* Get an Agent by id | ||
*/ | ||
getAgent(soClient: SavedObjectsClientContract, agentId: string): Promise<Agent>; | ||
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. When we use this method, we will have to look at the active property of the agent to know if it is unenrolled? 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. Yes it's correct |
||
/** | ||
* Authenticate an agent with access toekn | ||
*/ | ||
authenticateAgentWithAccessToken( | ||
soClient: SavedObjectsClientContract, | ||
request: KibanaRequest | ||
): Promise<Agent>; | ||
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. 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method is used for the endpoint artifact API, to authenticate user, the method is already used it was just not typed correctly |
||
/** | ||
* Return the status by the Agent's id | ||
* @param soClient | ||
* @param agentId | ||
*/ | ||
getAgentStatusById(soClient: SavedObjectsClientContract, agentId: string): Promise<AgentStatus>; | ||
/** | ||
* List agents | ||
*/ | ||
listAgents( | ||
soClient: SavedObjectsClientContract, | ||
options: { | ||
page: number; | ||
perPage: number; | ||
kuery?: string; | ||
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. @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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the For the kuery to get unenrolled agent that have an endpoint integration it will be something like this (if this get merged #69731)
if this is not merged you will have to provide the config id
Also I am working on adding an 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. I prefer the first one. I can start coding against the API once you merge. |
||
showInactive: boolean; | ||
} | ||
): Promise<{ | ||
agents: Agent[]; | ||
total: number; | ||
page: number; | ||
perPage: number; | ||
}>; | ||
} | ||
|
||
// Saved object services | ||
|
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.
👍