From 50c4990f43b5cbf41c323f7b87de8b472dab2493 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Thu, 14 Nov 2024 10:10:45 -0800 Subject: [PATCH] [8.x] [OpenAPI][Fleet] Add missing operation summaries (#199548) (#199569) # Backport This will backport the following commits from `main` to `8.x`: - [[OpenAPI][Fleet] Add missing operation summaries (#199548)](https://github.com/elastic/kibana/pull/199548) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) --- .../fleet/server/routes/agent/index.ts | 101 ++++++++++++++++++ .../fleet/server/routes/agent_policy/index.ts | 58 ++++++++-- .../plugins/fleet/server/routes/app/index.ts | 9 +- .../fleet/server/routes/data_streams/index.ts | 4 + .../server/routes/enrollment_api_key/index.ts | 18 ++++ .../plugins/fleet/server/routes/epm/index.ts | 79 +++++++++++++- .../server/routes/fleet_proxies/index.ts | 23 ++++ .../server/routes/fleet_server_hosts/index.ts | 23 ++++ .../fleet/server/routes/health_check/index.ts | 5 +- .../routes/message_signing_service/index.ts | 4 + .../fleet/server/routes/output/index.ts | 31 ++++++ .../server/routes/package_policy/index.ts | 40 +++++++ .../fleet/server/routes/settings/index.ts | 19 +++- .../fleet/server/routes/setup/index.ts | 13 ++- .../server/routes/uninstall_token/index.ts | 10 ++ 15 files changed, 416 insertions(+), 21 deletions(-) diff --git a/x-pack/plugins/fleet/server/routes/agent/index.ts b/x-pack/plugins/fleet/server/routes/agent/index.ts index 7d64bf365f74..0e0744d5b809 100644 --- a/x-pack/plugins/fleet/server/routes/agent/index.ts +++ b/x-pack/plugins/fleet/server/routes/agent/index.ts @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { @@ -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( { diff --git a/x-pack/plugins/fleet/server/routes/agent_policy/index.ts b/x-pack/plugins/fleet/server/routes/agent_policy/index.ts index 0ff76addd1b1..5a1b2d262998 100644 --- a/x-pack/plugins/fleet/server/routes/agent_policy/index.ts +++ b/x-pack/plugins/fleet/server/routes/agent_policy/index.ts @@ -47,7 +47,10 @@ 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`, + summary: `Get agent policies`, + options: { + tags: ['oas-tag:Elastic Agent policies'], + }, }) .addVersion( { @@ -65,6 +68,10 @@ 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; }, + summary: `Bulk get agent policies`, + options: { + tags: ['oas-tag:Elastic Agent policies'], + }, }) .addVersion( { @@ -82,7 +89,11 @@ 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`, + summary: `Get an agent policy`, + description: `Get an agent policy by ID.`, + options: { + tags: ['oas-tag:Elastic Agent policies'], + }, }) .addVersion( { @@ -99,7 +110,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { allAgentPolicies: true }, }, - description: `Create an agent policy`, + summary: `Create an agent policy`, + options: { + tags: ['oas-tag:Elastic Agent policies'], + }, }) .addVersion( { @@ -116,7 +130,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { allAgentPolicies: true }, }, - description: `Update an agent policy by ID`, + summary: `Update an agent policy`, + description: `Update an agent policy by ID.`, + options: { + tags: ['oas-tag:Elastic Agent policies'], + }, }) .addVersion( { @@ -133,7 +151,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { allAgentPolicies: true }, }, - description: `Copy an agent policy by ID`, + summary: `Copy an agent policy`, + description: `Copy an agent policy by ID.`, + options: { + tags: ['oas-tag:Elastic Agent policies'], + }, }) .addVersion( { @@ -150,6 +172,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { allAgentPolicies: true }, }, + summary: `Delete an agent policy`, + description: `Delete an agent policy by ID.`, + options: { + tags: ['oas-tag:Elastic Agent policies'], + }, }) .addVersion( { @@ -166,7 +193,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { readAgentPolicies: true }, }, - description: `Get a full agent policy by ID`, + summary: `Get a full agent policy`, + description: `Get a full agent policy by ID.`, + options: { + tags: ['oas-tag:Elastic Agent policies'], + }, }) .addVersion( { @@ -184,7 +215,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleet: { readAgentPolicies: true }, }, enableQueryVersion: true, - description: `Download an agent policy by ID`, + summary: `Download an agent policy`, + description: `Download an agent policy by ID.`, + options: { + tags: ['oas-tag:Elastic Agent policies'], + }, }) .addVersion( { @@ -201,7 +236,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { readAgentPolicies: true }, }, - description: `Get full K8s agent manifest`, + summary: `Get a full K8s agent manifest`, + options: { + tags: ['oas-tag:Elastic Agent policies'], + }, }) .addVersion( { @@ -219,6 +257,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleet: { readAgentPolicies: true }, }, enableQueryVersion: true, + summary: `Download an agent manifest`, + options: { + tags: ['oas-tag:Elastic Agent policies'], + }, }) .addVersion( { diff --git a/x-pack/plugins/fleet/server/routes/app/index.ts b/x-pack/plugins/fleet/server/routes/app/index.ts index 994348f6d996..bedd5ba1967a 100644 --- a/x-pack/plugins/fleet/server/routes/app/index.ts +++ b/x-pack/plugins/fleet/server/routes/app/index.ts @@ -212,6 +212,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType router.versioned .get({ path: APP_API_ROUTES.CHECK_PERMISSIONS_PATTERN, + summary: `Check permissions`, + options: { + tags: ['oas-tag:Fleet internals'], + }, }) .addVersion( { @@ -243,7 +247,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType fleetAuthz: { fleet: { allAgents: true }, }, - description: `Create a service token`, + summary: `Create a service token`, + options: { + tags: ['oas-tag:Fleet service tokens'], + }, }) .addVersion( { diff --git a/x-pack/plugins/fleet/server/routes/data_streams/index.ts b/x-pack/plugins/fleet/server/routes/data_streams/index.ts index cb2af8be110f..b7444274192f 100644 --- a/x-pack/plugins/fleet/server/routes/data_streams/index.ts +++ b/x-pack/plugins/fleet/server/routes/data_streams/index.ts @@ -21,6 +21,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { all: true }, }, + summary: `Get data streams`, + options: { + tags: ['oas-tag:Data streams'], + }, }) .addVersion( { diff --git a/x-pack/plugins/fleet/server/routes/enrollment_api_key/index.ts b/x-pack/plugins/fleet/server/routes/enrollment_api_key/index.ts index 4797fa2ef562..b4a458de2879 100644 --- a/x-pack/plugins/fleet/server/routes/enrollment_api_key/index.ts +++ b/x-pack/plugins/fleet/server/routes/enrollment_api_key/index.ts @@ -31,6 +31,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { readEnrollmentTokens: true }, }, + summary: `Get an enrollment API key`, + description: `Get an enrollment API key by ID.`, + options: { + tags: ['oas-tag:Fleet enrollment API keys'], + }, }) .addVersion( { @@ -46,6 +51,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { allAgents: true }, }, + summary: `Revoke an enrollment API key`, + description: `Revoke an enrollment API key by ID by marking it as inactive.`, + options: { + tags: ['oas-tag:Fleet enrollment API keys'], + }, }) .addVersion( { @@ -61,6 +71,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { readEnrollmentTokens: true }, }, + summary: `Get enrollment API keys`, + options: { + tags: ['oas-tag:Fleet enrollment API keys'], + }, }) .addVersion( { @@ -76,6 +90,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { allAgents: true }, }, + summary: `Create an enrollment API key`, + options: { + tags: ['oas-tag:Fleet enrollment API keys'], + }, }) .addVersion( { diff --git a/x-pack/plugins/fleet/server/routes/epm/index.ts b/x-pack/plugins/fleet/server/routes/epm/index.ts index 8f62dbe88d6a..7001ee0c3743 100644 --- a/x-pack/plugins/fleet/server/routes/epm/index.ts +++ b/x-pack/plugins/fleet/server/routes/epm/index.ts @@ -97,7 +97,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType .get({ path: EPM_API_ROUTES.CATEGORIES_PATTERN, fleetAuthz: READ_PACKAGE_INFO_AUTHZ, - description: `Get package categories`, + summary: `Get package categories`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, }) .addVersion( { @@ -111,7 +114,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType .get({ path: EPM_API_ROUTES.LIST_PATTERN, fleetAuthz: READ_PACKAGE_INFO_AUTHZ, - description: `Get list of packages`, + summary: `Get packages`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, }) .addVersion( { @@ -125,6 +131,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType .get({ path: EPM_API_ROUTES.INSTALLED_LIST_PATTERN, fleetAuthz: READ_PACKAGE_INFO_AUTHZ, + summary: `Get installed packages`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, }) .addVersion( { @@ -138,7 +148,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType .get({ path: EPM_API_ROUTES.LIMITED_LIST_PATTERN, fleetAuthz: READ_PACKAGE_INFO_AUTHZ, - description: `Get limited package list`, + summary: `Get a limited package list`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, }) .addVersion( { @@ -152,6 +165,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType .get({ path: EPM_API_ROUTES.STATS_PATTERN, fleetAuthz: READ_PACKAGE_INFO_AUTHZ, + summary: `Get package stats`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, }) .addVersion( { @@ -165,6 +182,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType .get({ path: EPM_API_ROUTES.INPUTS_PATTERN, fleetAuthz: READ_PACKAGE_INFO_AUTHZ, + summary: `Get an inputs template`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, }) .addVersion( { @@ -178,6 +199,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType .get({ path: EPM_API_ROUTES.FILEPATH_PATTERN, fleetAuthz: READ_PACKAGE_INFO_AUTHZ, + summary: `Get a package file`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, }) .addVersion( { @@ -193,6 +218,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType fleetAuthz: (fleetAuthz: FleetAuthz): boolean => calculateRouteAuthz(fleetAuthz, getRouteRequiredAuthz('get', EPM_API_ROUTES.INFO_PATTERN)) .granted, + summary: `Get a package`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, }) .addVersion( { @@ -208,6 +237,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType fleetAuthz: { integrations: { writePackageSettings: true }, }, + summary: `Update package settings`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, }) .addVersion( { @@ -221,6 +254,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType .post({ path: EPM_API_ROUTES.INSTALL_FROM_REGISTRY_PATTERN, fleetAuthz: INSTALL_PACKAGES_AUTHZ, + summary: `Install a package from the registry`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, }) .addVersion( { @@ -237,6 +274,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType fleetAuthz: { integrations: { installPackages: true }, }, + summary: `Install Kibana assets for a package`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, }) .addVersion( { @@ -252,6 +293,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType fleetAuthz: { integrations: { installPackages: true }, }, + summary: `Delete Kibana assets for a package`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, }) .addVersion( { @@ -268,6 +313,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType fleetAuthz: { integrations: { installPackages: true, upgradePackages: true }, }, + summary: `Bulk install packages`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, }) .addVersion( { @@ -291,6 +340,7 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType fleetAuthz: { integrations: { uploadPackages: true }, }, + summary: `Install a package by upload`, }) .addVersion( { @@ -304,6 +354,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType .post({ path: EPM_API_ROUTES.CUSTOM_INTEGRATIONS_PATTERN, fleetAuthz: INSTALL_PACKAGES_AUTHZ, + summary: `Create a custom integration`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, }) .addVersion( { @@ -319,6 +373,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType fleetAuthz: { integrations: { removePackages: true }, }, + summary: `Delete a package`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, }) .addVersion( { @@ -333,7 +391,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType .get({ path: EPM_API_ROUTES.VERIFICATION_KEY_ID, fleetAuthz: READ_PACKAGE_INFO_AUTHZ, - description: `Get a package signature verification key ID`, + summary: `Get a package signature verification key ID`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, }) .addVersion( { @@ -347,6 +408,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType .get({ path: EPM_API_ROUTES.DATA_STREAMS_PATTERN, fleetAuthz: READ_PACKAGE_INFO_AUTHZ, + summary: `Get data streams`, + options: { + tags: ['oas-tag:Data streams'], + }, }) .addVersion( { @@ -360,7 +425,7 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType .post({ path: EPM_API_ROUTES.BULK_ASSETS_PATTERN, fleetAuthz: READ_PACKAGE_INFO_AUTHZ, - description: `Get bulk assets`, + summary: `Get bulk assets`, }) .addVersion( { @@ -499,6 +564,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType }, }, }, + summary: `Authorize transforms`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, }) .addVersion( { diff --git a/x-pack/plugins/fleet/server/routes/fleet_proxies/index.ts b/x-pack/plugins/fleet/server/routes/fleet_proxies/index.ts index 5100ae77c237..1a7bda626dfe 100644 --- a/x-pack/plugins/fleet/server/routes/fleet_proxies/index.ts +++ b/x-pack/plugins/fleet/server/routes/fleet_proxies/index.ts @@ -29,6 +29,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { readSettings: true }, }, + summary: `Get proxies`, + options: { + tags: ['oas-tag:Fleet proxies'], + }, }) .addVersion( { @@ -44,6 +48,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { allSettings: true }, }, + summary: `Create a proxy`, + options: { + tags: ['oas-tag:Fleet proxies'], + }, }) .addVersion( { @@ -59,6 +67,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { allSettings: true }, }, + summary: `Update a proxy`, + description: `Update a proxy by ID.`, + options: { + tags: ['oas-tag:Fleet proxies'], + }, }) .addVersion( { @@ -74,6 +87,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { readSettings: true }, }, + summary: `Get a proxy`, + description: `Get a proxy by ID.`, + options: { + tags: ['oas-tag:Fleet proxies'], + }, }) .addVersion( { @@ -89,6 +107,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { allSettings: true }, }, + summary: `Delete a proxy`, + description: `Delete a proxy by ID`, + options: { + tags: ['oas-tag:Fleet proxies'], + }, }) .addVersion( { diff --git a/x-pack/plugins/fleet/server/routes/fleet_server_hosts/index.ts b/x-pack/plugins/fleet/server/routes/fleet_server_hosts/index.ts index 05fd0ab90f9e..1e58a3fb5567 100644 --- a/x-pack/plugins/fleet/server/routes/fleet_server_hosts/index.ts +++ b/x-pack/plugins/fleet/server/routes/fleet_server_hosts/index.ts @@ -32,6 +32,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: (authz) => { return authz.fleet.addAgents || authz.fleet.addFleetServers || authz.fleet.readSettings; }, + summary: `Get Fleet Server hosts`, + options: { + tags: ['oas-tag:Fleet Server hosts'], + }, }) .addVersion( { @@ -46,6 +50,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { allSettings: true }, }, + summary: `Create a Fleet Server host`, + options: { + tags: ['oas-tag:Fleet Server hosts'], + }, }) .addVersion( { @@ -60,6 +68,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { readSettings: true }, }, + summary: `Get a Fleet Server host`, + description: `Get a Fleet Server host by ID.`, + options: { + tags: ['oas-tag:Fleet Server hosts'], + }, }) .addVersion( { @@ -74,6 +87,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { allSettings: true }, }, + summary: `Delete a Fleet Server host`, + description: `Delete a Fleet Server host by ID.`, + options: { + tags: ['oas-tag:Fleet Server hosts'], + }, }) .addVersion( { @@ -88,6 +106,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { allSettings: true }, }, + summary: `Update a Fleet Server host`, + description: `Update a Fleet Server host by ID.`, + options: { + tags: ['oas-tag:Fleet Server hosts'], + }, }) .addVersion( { diff --git a/x-pack/plugins/fleet/server/routes/health_check/index.ts b/x-pack/plugins/fleet/server/routes/health_check/index.ts index f980f0795902..051cad347e04 100644 --- a/x-pack/plugins/fleet/server/routes/health_check/index.ts +++ b/x-pack/plugins/fleet/server/routes/health_check/index.ts @@ -27,7 +27,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { allSettings: true }, }, - description: `Check Fleet Server health`, + summary: `Check Fleet Server health`, + options: { + tags: ['oas-tag:Fleet internals'], + }, }) .addVersion( { diff --git a/x-pack/plugins/fleet/server/routes/message_signing_service/index.ts b/x-pack/plugins/fleet/server/routes/message_signing_service/index.ts index c2d7f125bd08..7c6e9cec5238 100644 --- a/x-pack/plugins/fleet/server/routes/message_signing_service/index.ts +++ b/x-pack/plugins/fleet/server/routes/message_signing_service/index.ts @@ -20,6 +20,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { all: true }, }, + summary: 'Rotate a Fleet message signing key pair', + options: { + tags: ['oas-tag:Message Signing Service'], + }, }) .addVersion( { diff --git a/x-pack/plugins/fleet/server/routes/output/index.ts b/x-pack/plugins/fleet/server/routes/output/index.ts index 3fef95556637..a6c8c574bb07 100644 --- a/x-pack/plugins/fleet/server/routes/output/index.ts +++ b/x-pack/plugins/fleet/server/routes/output/index.ts @@ -36,6 +36,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: (authz) => { return authz.fleet.readSettings || authz.fleet.readAgentPolicies; }, + summary: 'Get outputs', + options: { + tags: ['oas-tag:Fleet outputs'], + }, }) .addVersion( { @@ -50,6 +54,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: (authz) => { return authz.fleet.readSettings || authz.fleet.readAgentPolicies; }, + summary: 'Get output', + description: 'Get output by ID.', + options: { + tags: ['oas-tag:Fleet outputs'], + }, }) .addVersion( { @@ -64,6 +73,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: (authz) => { return authz.fleet.allSettings || authz.fleet.allAgentPolicies; }, + summary: 'Update output', + description: 'Update output by ID.', + options: { + tags: ['oas-tag:Fleet outputs'], + }, }) .addVersion( { @@ -79,6 +93,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { allSettings: true }, }, + summary: 'Create output', + options: { + tags: ['oas-tag:Fleet outputs'], + }, }) .addVersion( { @@ -94,6 +112,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { allSettings: true }, }, + summary: 'Delete output', + description: 'Delete output by ID.', + options: { + tags: ['oas-tag:Fleet outputs'], + }, }) .addVersion( { @@ -109,6 +132,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { allSettings: true }, }, + summary: 'Generate a Logstash API key', + options: { + tags: ['oas-tag:Fleet outputs'], + }, }) .addVersion( { @@ -124,6 +151,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { readSettings: true }, }, + summary: 'Get the latest output health', + options: { + tags: ['oas-tag:Fleet outputs'], + }, }) .addVersion( { diff --git a/x-pack/plugins/fleet/server/routes/package_policy/index.ts b/x-pack/plugins/fleet/server/routes/package_policy/index.ts index 893eb37a9b1b..3367c7c0d5fc 100644 --- a/x-pack/plugins/fleet/server/routes/package_policy/index.ts +++ b/x-pack/plugins/fleet/server/routes/package_policy/index.ts @@ -48,6 +48,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz, getRouteRequiredAuthz('get', PACKAGE_POLICY_API_ROUTES.LIST_PATTERN) ).granted, + summary: 'Get package policies', + options: { + tags: ['oas-tag:Fleet package policies'], + }, }) .addVersion( { @@ -66,6 +70,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz, getRouteRequiredAuthz('post', PACKAGE_POLICY_API_ROUTES.BULK_GET_PATTERN) ).granted, + summary: 'Bulk get package policies', + options: { + tags: ['oas-tag:Fleet package policies'], + }, }) .addVersion( { @@ -84,6 +92,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz, getRouteRequiredAuthz('get', PACKAGE_POLICY_API_ROUTES.INFO_PATTERN) ).granted, + summary: 'Get a package policy', + description: 'Get a package policy by ID.', + options: { + tags: ['oas-tag:Fleet package policies'], + }, }) .addVersion( { @@ -112,6 +125,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { router.versioned .post({ path: PACKAGE_POLICY_API_ROUTES.CREATE_PATTERN, + summary: 'Create a package policy', + options: { + tags: ['oas-tag:Fleet package policies'], + }, }) .addVersion( { @@ -130,6 +147,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz, getRouteRequiredAuthz('put', PACKAGE_POLICY_API_ROUTES.UPDATE_PATTERN) ).granted, + summary: 'Update a package policy', + description: 'Update a package policy by ID.', + options: { + tags: ['oas-tag:Fleet package policies'], + }, }) .addVersion( { @@ -147,6 +169,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { integrations: { writeIntegrationPolicies: true }, }, + summary: 'Bulk delete package policies', + options: { + tags: ['oas-tag:Fleet package policies'], + }, }) .addVersion( { @@ -162,6 +188,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { integrations: { writeIntegrationPolicies: true }, }, + summary: 'Delete a package policy', + description: 'Delete a package policy by ID.', + options: { + tags: ['oas-tag:Fleet package policies'], + }, }) .addVersion( { @@ -178,6 +209,11 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { integrations: { writeIntegrationPolicies: true }, }, + summary: 'Upgrade a package policy', + description: 'Upgrade a package policy to a newer package version.', + options: { + tags: ['oas-tag:Fleet package policies'], + }, }) .addVersion( { @@ -194,6 +230,10 @@ export const registerRoutes = (router: FleetAuthzRouter) => { fleetAuthz: { integrations: { readIntegrationPolicies: true }, }, + summary: 'Dry run a package policy upgrade', + options: { + tags: ['oas-tag:Fleet package policies'], + }, }) .addVersion( { diff --git a/x-pack/plugins/fleet/server/routes/settings/index.ts b/x-pack/plugins/fleet/server/routes/settings/index.ts index b9f672627daa..5dbb6d312797 100644 --- a/x-pack/plugins/fleet/server/routes/settings/index.ts +++ b/x-pack/plugins/fleet/server/routes/settings/index.ts @@ -40,7 +40,7 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType authz.fleet.allAgentPolicies ); }, - description: `Get space settings`, + summary: `Get space settings`, }) .addVersion( { @@ -56,7 +56,7 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType fleetAuthz: { fleet: { allSettings: true }, }, - description: `Put space settings`, + summary: `Create space settings`, }) .addVersion( { @@ -73,7 +73,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType fleetAuthz: { fleet: { readSettings: true }, }, - description: `Get settings`, + summary: `Get settings`, + options: { + tags: ['oas-tag:Fleet internals'], + }, }) .addVersion( { @@ -88,7 +91,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType fleetAuthz: { fleet: { allSettings: true }, }, - description: `Update settings`, + summary: `Update settings`, + options: { + tags: ['oas-tag:Fleet internals'], + }, }) .addVersion( { @@ -103,7 +109,10 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType fleetAuthz: (authz) => { return authz.fleet.addAgents || authz.fleet.addFleetServers; }, - description: `Get enrollment settings`, + summary: `Get enrollment settings`, + options: { + tags: ['oas-tag:Fleet internals'], + }, }) .addVersion( { diff --git a/x-pack/plugins/fleet/server/routes/setup/index.ts b/x-pack/plugins/fleet/server/routes/setup/index.ts index 7052aacfc329..7759db911280 100644 --- a/x-pack/plugins/fleet/server/routes/setup/index.ts +++ b/x-pack/plugins/fleet/server/routes/setup/index.ts @@ -21,7 +21,10 @@ export const registerFleetSetupRoute = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { setup: true }, }, - description: `Initiate Fleet setup`, + summary: `Initiate Fleet setup`, + options: { + tags: ['oas-tag:Fleet internals'], + }, }) .addVersion( { @@ -40,6 +43,10 @@ export const registerCreateFleetSetupRoute = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { setup: true }, }, + summary: `Initiate agent setup`, + options: { + tags: ['oas-tag:Elastic Agents'], + }, }) .addVersion( { @@ -57,6 +64,10 @@ export const registerGetFleetStatusRoute = (router: FleetAuthzRouter) => { fleetAuthz: { fleet: { setup: true }, }, + summary: `Get agent setup info`, + options: { + tags: ['oas-tag:Elastic Agents'], + }, }) .addVersion( { diff --git a/x-pack/plugins/fleet/server/routes/uninstall_token/index.ts b/x-pack/plugins/fleet/server/routes/uninstall_token/index.ts index 9fb91b45fa37..c9349df37d3c 100644 --- a/x-pack/plugins/fleet/server/routes/uninstall_token/index.ts +++ b/x-pack/plugins/fleet/server/routes/uninstall_token/index.ts @@ -26,6 +26,11 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType fleetAuthz: { fleet: { allAgents: true }, }, + summary: 'Get metadata for latest uninstall tokens', + description: 'List the metadata for the latest uninstall tokens per agent policy.', + options: { + tags: ['oas-tag:Fleet uninstall tokens'], + }, }) .addVersion( { @@ -41,6 +46,11 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType fleetAuthz: { fleet: { allAgents: true }, }, + summary: 'Get a decrypted uninstall token', + description: 'Get one decrypted uninstall token by its ID.', + options: { + tags: ['oas-tag:Fleet uninstall tokens'], + }, }) .addVersion( {