Skip to content

Commit

Permalink
[OpenAPI][Fleet] Add missing operation summaries (elastic#199548)
Browse files Browse the repository at this point in the history
(cherry picked from commit ef0428f)
  • Loading branch information
lcawl committed Nov 8, 2024
1 parent 401b00d commit 115dd18
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 115dd18

Please sign in to comment.