Skip to content
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

[8.16] [OpenAPI][Fleet] Add missing operation summaries (#199548) #199570

Merged
merged 4 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading