Skip to content

Commit

Permalink
[HTTP/OAS] Add Fleet API descriptions (#184613)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored Jun 3, 2024
1 parent ce97741 commit 74ae374
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions x-pack/plugins/fleet/server/routes/agent_policy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
// Allow to retrieve agent policies metadata (no full) for user with only read agents permissions
return authz.fleet.readAgentPolicies || authz.fleet.readAgents;
},
description: `Get agent policies`,
})
.addVersion(
{
Expand Down Expand Up @@ -80,6 +81,7 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
// Allow to retrieve agent policies metadata (no full) for user with only read agents permissions
return authz.fleet.readAgentPolicies || authz.fleet.readAgents;
},
description: `Get an agent policy by ID`,
})
.addVersion(
{
Expand All @@ -96,6 +98,7 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
fleetAuthz: {
fleet: { allAgentPolicies: true },
},
description: `Create an agent policy`,
})
.addVersion(
{
Expand All @@ -112,6 +115,7 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
fleetAuthz: {
fleet: { allAgentPolicies: true },
},
description: `Update an agent policy by ID`,
})
.addVersion(
{
Expand All @@ -128,6 +132,7 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
fleetAuthz: {
fleet: { allAgentPolicies: true },
},
description: `Copy an agent policy by ID`,
})
.addVersion(
{
Expand Down Expand Up @@ -160,6 +165,7 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
fleetAuthz: {
fleet: { readAgentPolicies: true },
},
description: `Get a full agent policy by ID`,
})
.addVersion(
{
Expand All @@ -177,6 +183,7 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
fleet: { readAgentPolicies: true },
},
enableQueryVersion: true,
description: `Download an agent policy by ID`,
})
.addVersion(
{
Expand All @@ -193,6 +200,7 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
fleetAuthz: {
fleet: { readAgentPolicies: true },
},
description: `Get full K8s agent manifest`,
})
.addVersion(
{
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/fleet/server/routes/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
fleetAuthz: {
fleet: { allAgents: true },
},
description: `Create a service token`,
})
.addVersion(
{
Expand All @@ -175,6 +176,7 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
fleetAuthz: {
fleet: { allAgents: true },
},
description: `Create a service token`,
})
.addVersion(
{
Expand Down
5 changes: 5 additions & 0 deletions x-pack/plugins/fleet/server/routes/epm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
.get({
path: EPM_API_ROUTES.CATEGORIES_PATTERN,
fleetAuthz: READ_PACKAGE_INFO_AUTHZ,
description: `Get package categories`,
})
.addVersion(
{
Expand All @@ -99,6 +100,7 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
.get({
path: EPM_API_ROUTES.LIST_PATTERN,
fleetAuthz: READ_PACKAGE_INFO_AUTHZ,
description: `Get list of packages`,
})
.addVersion(
{
Expand All @@ -125,6 +127,7 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
.get({
path: EPM_API_ROUTES.LIMITED_LIST_PATTERN,
fleetAuthz: READ_PACKAGE_INFO_AUTHZ,
description: `Get limited package list`,
})
.addVersion(
{
Expand Down Expand Up @@ -287,6 +290,7 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
.get({
path: EPM_API_ROUTES.VERIFICATION_KEY_ID,
fleetAuthz: READ_PACKAGE_INFO_AUTHZ,
description: `Get a package signature verification key ID`,
})
.addVersion(
{
Expand All @@ -313,6 +317,7 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
.post({
path: EPM_API_ROUTES.BULK_ASSETS_PATTERN,
fleetAuthz: READ_PACKAGE_INFO_AUTHZ,
description: `Get bulk assets`,
})
.addVersion(
{
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/fleet/server/routes/health_check/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
fleetAuthz: {
fleet: { all: true },
},
description: `Check Fleet Server health`,
})
.addVersion(
{
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/fleet/server/routes/settings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
fleetAuthz: {
fleet: { readSettings: true },
},
description: `Get settings`,
})
.addVersion(
{
Expand All @@ -92,6 +93,7 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
fleetAuthz: {
fleet: { allSettings: true },
},
description: `Update settings`,
})
.addVersion(
{
Expand All @@ -106,6 +108,7 @@ export const registerRoutes = (router: FleetAuthzRouter) => {
fleetAuthz: (authz) => {
return authz.fleet.addAgents || authz.fleet.addFleetServers;
},
description: `Get enrollment settings`,
})
.addVersion(
{
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/fleet/server/routes/setup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const registerFleetSetupRoute = (router: FleetAuthzRouter) => {
fleetAuthz: {
fleet: { setup: true },
},
description: `Initiate Fleet setup`,
})
.addVersion(
{
Expand Down

0 comments on commit 74ae374

Please sign in to comment.