-
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
[Fleet] Remove deprecated APIs for agents endpoints #198313
[Fleet] Remove deprecated APIs for agents endpoints #198313
Conversation
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/fleet --update'
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/fleet --update'
…kibana into feature-remove-deprecated-apis
Pinging @elastic/fleet (Team:Fleet) |
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/fleet --update'
@criamico @juliaElastic it seems |
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.
@elastic/security-defend-workflows relevant changes: active
is used instead of the now removed total
from the response of GET /agent_status
, and based on the code snippet below, they are the same, so the related changes look good! thanks for updating the code 🙌
kibana/x-pack/plugins/fleet/server/services/agents/status.ts
Lines 166 to 177 in 7dea07f
const allActive = allStatuses - combinedStatuses.unenrolled - combinedStatuses.inactive; | |
return { | |
...combinedStatuses, | |
all: allStatuses, | |
active: allActive, | |
/* @deprecated no agents will have other status */ | |
other: 0, | |
/* @deprecated Agent events do not exists anymore */ | |
events: 0, | |
/* @deprecated use active instead */ | |
total: allActive, | |
}; |
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/fleet --update'
As discussed in slack, this deprecation was firstly introduced as preliminary work for #161064, but it was then decided to keep the kuery parameter, as highlighted in the PR description. This deprecation was then mistakenly kept, but seeing that it's still used and useful I think it's ok to keep it. |
@elasticmachine merge upstream |
@@ -218,8 +217,10 @@ export function useFetchAgentsData() { | |||
getStatusSummary: true, | |||
withMetrics: displayAgentMetrics, | |||
}), | |||
sendGetAgentStatus({ | |||
sendGetAgents({ |
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.
As we are not going to deprecate usage of kuery
in agent_status
, is this change still needed? Or you prefer to change it anyway?
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.
I will remove those changes 👍
@@ -135,10 +135,11 @@ export const AgentUpgradeAgentModal: React.FunctionComponent<AgentUpgradeAgentMo | |||
|
|||
// if selection is a query, do an api call to get updating agents | |||
try { | |||
const res = await sendGetAgentStatus({ | |||
const res = await sendGetAgentsQuery({ |
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.
Same as above
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.
cloud_defend and cloud_security_posture changes lgtm
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.
LGTM 🚀
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/fleet --update'
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
cc @nchaulet |
Summary
Related to #189746
Remove API endpoints
POST /service-tokens
in favor ofPOST /service_tokens
GET /agent-status
in favorGET /agent_status
PUT /agents/:agentid/reassign
in favor ofPOST /agents/:agentid/reassign
Remove deprecated parameters or response
total
fromGET /agent_status
responselist
fromGET /agents
responseOur UI was still consuming the
total
field in some places, I made the changes to not use anymore, this could cause some errors during the upgrade if two kibana version are running but it seems code handle that missing field well.To keep those removal PR readable and easy to review I will do separate similar PR for epm endpoints and enrollment api keys endpoints
Did some manual testing of Fleet, nothing seems to be broken and looking at telemetry those deletions seems relatively safe.