Skip to content

Commit

Permalink
[8.x] [OpenAPI][Fleet] Add missing operation summaries (#199548) (#19…
Browse files Browse the repository at this point in the history
…9569)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[OpenAPI][Fleet] Add missing operation summaries
(#199548)](#199548)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Lisa
Cawley","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-08T22:13:10Z","message":"[OpenAPI][Fleet]
Add missing operation summaries
(#199548)","sha":"ef0428ffec3084777a8ff82c7191f754bad5705f","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","docs","v8.16.0","backport:version","v8.17.0"],"number":199548,"url":"https://github.com/elastic/kibana/pull/199548","mergeCommit":{"message":"[OpenAPI][Fleet]
Add missing operation summaries
(#199548)","sha":"ef0428ffec3084777a8ff82c7191f754bad5705f"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199548","number":199548,"mergeCommit":{"message":"[OpenAPI][Fleet]
Add missing operation summaries
(#199548)","sha":"ef0428ffec3084777a8ff82c7191f754bad5705f"}},{"branch":"8.16","label":"v8.16.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","labelRegex":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
  • Loading branch information
lcawl authored Nov 14, 2024
1 parent 61354f0 commit 50c4990
Show file tree
Hide file tree
Showing 15 changed files with 416 additions and 21 deletions.
101 changes: 101 additions & 0 deletions x-pack/plugins/fleet/server/routes/agent/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { readAgents: true },
},
summary: `Get an agent`,
description: `Get an agent by ID.`,
options: {
tags: ['oas-tag:Elastic Agents'],
},
})
.addVersion(
{
Expand All @@ -97,6 +102,11 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { allAgents: true },
},
summary: `Update an agent`,
description: `Update an agent by ID.`,
options: {
tags: ['oas-tag:Elastic Agents'],
},
})
.addVersion(
{
Expand All @@ -113,6 +123,10 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { allAgents: true },
},
summary: `Bulk update agent tags`,
options: {
tags: ['oas-tag:Elastic Agent actions'],
},
})
.addVersion(
{
Expand All @@ -129,6 +143,11 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { allAgents: true },
},
summary: `Delete an agent`,
description: `Delete an agent by ID.`,
options: {
tags: ['oas-tag:Elastic Agents'],
},
})
.addVersion(
{
Expand All @@ -146,6 +165,10 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { readAgents: true },
},
summary: `Get agents`,
options: {
tags: ['oas-tag:Elastic Agents'],
},
})
.addVersion(
{
Expand All @@ -162,6 +185,10 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { readAgents: true },
},
summary: `Get agent tags`,
options: {
tags: ['oas-tag:Elastic Agents'],
},
})
.addVersion(
{
Expand All @@ -178,6 +205,10 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { allAgents: true },
},
summary: `Create an agent action`,
options: {
tags: ['oas-tag:Elastic Agent actions'],
},
})
.addVersion(
{
Expand All @@ -198,6 +229,10 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { allAgents: true },
},
summary: `Cancel an agent action`,
options: {
tags: ['oas-tag:Elastic Agent actions'],
},
})
.addVersion(
{
Expand All @@ -219,6 +254,10 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { readAgents: true },
},
summary: `Get agents by action ids`,
options: {
tags: ['oas-tag:Elastic Agents'],
},
})
.addVersion(
{
Expand All @@ -234,6 +273,10 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { allAgents: true },
},
summary: `Unenroll an agent`,
options: {
tags: ['oas-tag:Elastic Agent actions'],
},
})
.addVersion(
{
Expand Down Expand Up @@ -265,6 +308,10 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { allAgents: true },
},
summary: `Reassign an agent`,
options: {
tags: ['oas-tag:Elastic Agent actions'],
},
})
.addVersion(
{
Expand All @@ -280,6 +327,10 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { readAgents: true },
},
summary: `Request agent diagnostics`,
options: {
tags: ['oas-tag:Elastic Agent actions'],
},
})
.addVersion(
{
Expand All @@ -295,6 +346,10 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { readAgents: true },
},
summary: `Bulk request diagnostics from agents`,
options: {
tags: ['oas-tag:Elastic Agent actions'],
},
})
.addVersion(
{
Expand All @@ -310,6 +365,10 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { readAgents: true },
},
summary: `Get agent uploads`,
options: {
tags: ['oas-tag:Elastic Agents'],
},
})
.addVersion(
{
Expand All @@ -325,6 +384,11 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { readAgents: true },
},
summary: `Get an uploaded file`,
description: `Get a file uploaded by an agent.`,
options: {
tags: ['oas-tag:Elastic Agents'],
},
})
.addVersion(
{
Expand All @@ -340,6 +404,11 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { allAgents: true },
},
summary: `Delete an uploaded file`,
description: `Delete a file uploaded by an agent.`,
options: {
tags: ['oas-tag:Elastic Agents'],
},
})
.addVersion(
{
Expand All @@ -358,6 +427,10 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz,
getRouteRequiredAuthz('get', AGENT_API_ROUTES.STATUS_PATTERN)
).granted,
summary: `Get an agent status summary`,
options: {
tags: ['oas-tag:Elastic Agent status'],
},
})
.addVersion(
{
Expand Down Expand Up @@ -387,6 +460,10 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { readAgents: true },
},
summary: `Get incoming agent data`,
options: {
tags: ['oas-tag:Elastic Agents'],
},
})
.addVersion(
{
Expand All @@ -403,6 +480,10 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { allAgents: true },
},
summary: `Upgrade an agent`,
options: {
tags: ['oas-tag:Elastic Agent actions'],
},
})
.addVersion(
{
Expand All @@ -418,6 +499,10 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { allAgents: true },
},
summary: `Bulk upgrade agents`,
options: {
tags: ['oas-tag:Elastic Agent actions'],
},
})
.addVersion(
{
Expand All @@ -434,6 +519,10 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { readAgents: true },
},
summary: `Get an agent action status`,
options: {
tags: ['oas-tag:Elastic Agent actions'],
},
})
.addVersion(
{
Expand All @@ -450,6 +539,10 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { allAgents: true },
},
summary: `Bulk reassign agents`,
options: {
tags: ['oas-tag:Elastic Agent actions'],
},
})
.addVersion(
{
Expand All @@ -466,6 +559,10 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { allAgents: true },
},
summary: `Bulk unenroll agents`,
options: {
tags: ['oas-tag:Elastic Agent actions'],
},
})
.addVersion(
{
Expand All @@ -482,6 +579,10 @@ export const registerAPIRoutes = (router: FleetAuthzRouter, config: FleetConfigT
fleetAuthz: {
fleet: { readAgents: true },
},
summary: `Get available agent versions`,
options: {
tags: ['oas-tag:Elastic Agents'],
},
})
.addVersion(
{
Expand Down
Loading

0 comments on commit 50c4990

Please sign in to comment.