From 27c3f48be3e50e3a56ff983a40b0f21ade012fe8 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Wed, 30 Oct 2024 14:57:40 -0400 Subject: [PATCH 01/25] [Fleet] Remove deprecated epm APIs --- .../plugins/fleet/common/constants/routes.ts | 9 +- .../plugins/fleet/server/routes/epm/index.ts | 219 +++++++----------- .../services/security/route_required_authz.ts | 2 +- .../fleet/server/types/rest_spec/epm.ts | 50 +--- .../public/management/mocks/fleet_mocks.ts | 2 +- 5 files changed, 94 insertions(+), 188 deletions(-) diff --git a/x-pack/plugins/fleet/common/constants/routes.ts b/x-pack/plugins/fleet/common/constants/routes.ts index c071c6feecbf8..8bfb6e6cf106e 100644 --- a/x-pack/plugins/fleet/common/constants/routes.ts +++ b/x-pack/plugins/fleet/common/constants/routes.ts @@ -23,19 +23,22 @@ export const LIMITED_CONCURRENCY_ROUTE_TAG = 'ingest:limited-concurrency'; const EPM_PACKAGES_MANY = `${EPM_API_ROOT}/packages`; const EPM_PACKAGES_INSTALLED = `${EPM_API_ROOT}/packages/installed`; const EPM_PACKAGES_BULK = `${EPM_PACKAGES_MANY}/_bulk`; -const EPM_PACKAGES_ONE_DEPRECATED = `${EPM_PACKAGES_MANY}/{pkgkey}`; +const EPM_PACKAGES_ONE_WITHOUT_VERSION = `${EPM_PACKAGES_MANY}/{pkgName}`; const EPM_PACKAGES_ONE = `${EPM_PACKAGES_MANY}/{pkgName}/{pkgVersion}`; export const EPM_API_ROUTES = { BULK_INSTALL_PATTERN: EPM_PACKAGES_BULK, LIST_PATTERN: EPM_PACKAGES_MANY, INSTALLED_LIST_PATTERN: EPM_PACKAGES_INSTALLED, LIMITED_LIST_PATTERN: `${EPM_PACKAGES_MANY}/limited`, + INFO_WITHOUT_VERSION_PATTERN: EPM_PACKAGES_ONE_WITHOUT_VERSION, INFO_PATTERN: EPM_PACKAGES_ONE, DATA_STREAMS_PATTERN: `${EPM_API_ROOT}/data_streams`, INSTALL_FROM_REGISTRY_PATTERN: EPM_PACKAGES_ONE, + INSTALL_FROM_REGISTRY_WITHOUT_VERSION_PATTERN: EPM_PACKAGES_ONE_WITHOUT_VERSION, INSTALL_BY_UPLOAD_PATTERN: EPM_PACKAGES_MANY, CUSTOM_INTEGRATIONS_PATTERN: `${EPM_API_ROOT}/custom_integrations`, DELETE_PATTERN: EPM_PACKAGES_ONE, + DELETE_PATTERN_WITHOUT_VERSION_PATTERN: EPM_PACKAGES_ONE_WITHOUT_VERSION, INSTALL_KIBANA_ASSETS_PATTERN: `${EPM_PACKAGES_ONE}/kibana_assets`, DELETE_KIBANA_ASSETS_PATTERN: `${EPM_PACKAGES_ONE}/kibana_assets`, FILEPATH_PATTERN: `${EPM_PACKAGES_ONE}/{filePath*}`, @@ -45,10 +48,6 @@ export const EPM_API_ROUTES = { BULK_ASSETS_PATTERN: `${EPM_API_ROOT}/bulk_assets`, INPUTS_PATTERN: `${EPM_API_ROOT}/templates/{pkgName}/{pkgVersion}/inputs`, - INFO_PATTERN_DEPRECATED: EPM_PACKAGES_ONE_DEPRECATED, - INSTALL_FROM_REGISTRY_PATTERN_DEPRECATED: EPM_PACKAGES_ONE_DEPRECATED, - DELETE_PATTERN_DEPRECATED: EPM_PACKAGES_ONE_DEPRECATED, - REAUTHORIZE_TRANSFORMS: `${EPM_PACKAGES_ONE}/transforms/authorize`, }; diff --git a/x-pack/plugins/fleet/server/routes/epm/index.ts b/x-pack/plugins/fleet/server/routes/epm/index.ts index 0e3c5e76eb825..7f92d0284292f 100644 --- a/x-pack/plugins/fleet/server/routes/epm/index.ts +++ b/x-pack/plugins/fleet/server/routes/epm/index.ts @@ -5,8 +5,6 @@ * 2.0. */ -import type { IKibanaResponse } from '@kbn/core/server'; - import { parseExperimentalConfigValue } from '../../../common/experimental_features'; import { API_VERSIONS } from '../../../common/constants'; @@ -20,32 +18,20 @@ import { } from '../../services/security'; import type { FleetAuthzRouteConfig } from '../../services/security/types'; -import type { - DeletePackageResponse, - GetInfoResponse, - InstallPackageResponse, - UpdatePackageResponse, -} from '../../../common/types'; - import { EPM_API_ROUTES } from '../../constants'; -import { splitPkgKey } from '../../services/epm/registry'; import { GetCategoriesRequestSchema, GetPackagesRequestSchema, GetInstalledPackagesRequestSchema, GetFileRequestSchema, GetInfoRequestSchema, - GetInfoRequestSchemaDeprecated, GetBulkAssetsRequestSchema, InstallPackageFromRegistryRequestSchema, - InstallPackageFromRegistryRequestSchemaDeprecated, InstallPackageByUploadRequestSchema, DeletePackageRequestSchema, - DeletePackageRequestSchemaDeprecated, BulkInstallPackagesFromRegistryRequestSchema, GetStatsRequestSchema, UpdatePackageRequestSchema, - UpdatePackageRequestSchemaDeprecated, ReauthorizeTransformRequestSchema, GetDataStreamsRequestSchema, CreateCustomIntegrationRequestSchema, @@ -301,6 +287,37 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType getFileHandler ); + router.versioned + .get({ + path: EPM_API_ROUTES.INFO_WITHOUT_VERSION_PATTERN, + fleetAuthz: (fleetAuthz: FleetAuthz): boolean => + calculateRouteAuthz( + fleetAuthz, + getRouteRequiredAuthz('get', EPM_API_ROUTES.INFO_WITHOUT_VERSION_PATTERN) + ).granted, + description: `Get package`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, + }) + .addVersion( + { + version: API_VERSIONS.public.v1, + validate: { + request: GetInfoRequestSchema, + response: { + 200: { + body: () => GetInfoResponseSchema, + }, + 400: { + body: genericErrorResponse, + }, + }, + }, + }, + getInfoHandler + ); + router.versioned .get({ path: EPM_API_ROUTES.INFO_PATTERN, @@ -358,6 +375,32 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType }, updatePackageHandler ); + router.versioned + .post({ + path: EPM_API_ROUTES.INSTALL_FROM_REGISTRY_WITHOUT_VERSION_PATTERN, + fleetAuthz: INSTALL_PACKAGES_AUTHZ, + description: `Install package from registry`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, + }) + .addVersion( + { + version: API_VERSIONS.public.v1, + validate: { + request: InstallPackageFromRegistryRequestSchema, + response: { + 200: { + body: () => InstallPackageResponseSchema, + }, + 400: { + body: genericErrorResponse, + }, + }, + }, + }, + installPackageFromRegistryHandler + ); router.versioned .post({ @@ -537,6 +580,36 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType createCustomIntegrationHandler ); + router.versioned + .delete({ + path: EPM_API_ROUTES.DELETE_PATTERN_WITHOUT_VERSION_PATTERN, + fleetAuthz: { + integrations: { removePackages: true }, + }, + description: `Delete package`, + options: { + tags: ['oas-tag:Elastic Package Manager (EPM)'], + }, + }) + .addVersion( + { + version: API_VERSIONS.public.v1, + validate: { + request: DeletePackageRequestSchema, + response: { + 200: { + body: () => DeletePackageResponseSchema, + }, + 400: { + body: genericErrorResponse, + }, + }, + }, + }, + + deletePackageHandler + ); + router.versioned .delete({ path: EPM_API_ROUTES.DELETE_PATTERN, @@ -648,124 +721,6 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType getBulkAssetsHandler ); - // deprecated since 8.0 - // This endpoint should be marked as internal but the router selects this endpoint over the new GET one - // For now keeping it public - router.versioned - .get({ - path: EPM_API_ROUTES.INFO_PATTERN_DEPRECATED, - fleetAuthz: (fleetAuthz: FleetAuthz): boolean => - calculateRouteAuthz( - fleetAuthz, - getRouteRequiredAuthz('get', EPM_API_ROUTES.INFO_PATTERN_DEPRECATED) - ).granted, - // @ts-expect-error TODO(https://github.com/elastic/kibana/issues/196095): Replace {RouteDeprecationInfo} - deprecated: true, - }) - .addVersion( - { - version: API_VERSIONS.public.v1, - validate: { request: GetInfoRequestSchemaDeprecated }, - }, - async (context, request, response) => { - const newRequest = { ...request, params: splitPkgKey(request.params.pkgkey) } as any; - const resp: IKibanaResponse = await getInfoHandler( - context, - newRequest, - response - ); - if (resp.payload?.item) { - // returning item as well here, because pkgVersion is optional in new GET endpoint, and if not specified, the router selects the deprecated route - return response.ok({ body: { item: resp.payload.item, response: resp.payload.item } }); - } - return resp; - } - ); - - router.versioned - .put({ - path: EPM_API_ROUTES.INFO_PATTERN_DEPRECATED, - fleetAuthz: { - integrations: { writePackageSettings: true }, - }, - // @ts-expect-error TODO(https://github.com/elastic/kibana/issues/196095): Replace {RouteDeprecationInfo} - deprecated: true, - }) - .addVersion( - { - version: API_VERSIONS.public.v1, - validate: { request: UpdatePackageRequestSchemaDeprecated }, - }, - async (context, request, response) => { - const newRequest = { ...request, params: splitPkgKey(request.params.pkgkey) } as any; - const resp: IKibanaResponse = await updatePackageHandler( - context, - newRequest, - response - ); - if (resp.payload?.item) { - return response.ok({ body: { response: resp.payload.item } }); - } - return resp; - } - ); - - // This endpoint should be marked as internal but the router selects this endpoint over the new POST - router.versioned - .post({ - path: EPM_API_ROUTES.INSTALL_FROM_REGISTRY_PATTERN_DEPRECATED, - fleetAuthz: INSTALL_PACKAGES_AUTHZ, - // @ts-expect-error TODO(https://github.com/elastic/kibana/issues/196095): Replace {RouteDeprecationInfo} - deprecated: true, - }) - .addVersion( - { - version: API_VERSIONS.public.v1, - validate: { request: InstallPackageFromRegistryRequestSchemaDeprecated }, - }, - async (context, request, response) => { - const newRequest = { - ...request, - params: splitPkgKey(request.params.pkgkey), - query: request.query, - } as any; - const resp: IKibanaResponse = - await installPackageFromRegistryHandler(context, newRequest, response); - if (resp.payload?.items) { - return response.ok({ body: { ...resp.payload, response: resp.payload.items } }); - } - return resp; - } - ); - - router.versioned - .delete({ - path: EPM_API_ROUTES.DELETE_PATTERN_DEPRECATED, - fleetAuthz: { - integrations: { removePackages: true }, - }, - // @ts-expect-error TODO(https://github.com/elastic/kibana/issues/196095): Replace {RouteDeprecationInfo} - deprecated: true, - }) - .addVersion( - { - version: API_VERSIONS.public.v1, - validate: { request: DeletePackageRequestSchemaDeprecated }, - }, - async (context, request, response) => { - const newRequest = { ...request, params: splitPkgKey(request.params.pkgkey) } as any; - const resp: IKibanaResponse = await deletePackageHandler( - context, - newRequest, - response - ); - if (resp.payload?.items) { - return response.ok({ body: { response: resp.payload.items } }); - } - return resp; - } - ); - // Update transforms with es-secondary-authorization headers, // append authorized_by to transform's _meta, and start transforms router.versioned diff --git a/x-pack/plugins/fleet/server/services/security/route_required_authz.ts b/x-pack/plugins/fleet/server/services/security/route_required_authz.ts index bbc1b07010fb7..37ab96b96afb7 100644 --- a/x-pack/plugins/fleet/server/services/security/route_required_authz.ts +++ b/x-pack/plugins/fleet/server/services/security/route_required_authz.ts @@ -164,7 +164,7 @@ const ROUTE_AUTHZ_REQUIREMENTS = deepFreeze Date: Thu, 31 Oct 2024 11:43:47 -0400 Subject: [PATCH 02/25] fix types --- .../fleet/server/services/epm/packages/remove.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/fleet/server/services/epm/packages/remove.ts b/x-pack/plugins/fleet/server/services/epm/packages/remove.ts index ac3f5def5d09c..396ba430ceacb 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/remove.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/remove.ts @@ -57,14 +57,18 @@ const MAX_ASSETS_TO_DELETE = 1000; export async function removeInstallation(options: { savedObjectsClient: SavedObjectsClientContract; pkgName: string; - pkgVersion: string; + pkgVersion?: string; esClient: ElasticsearchClient; force?: boolean; }): Promise { const { savedObjectsClient, pkgName, pkgVersion, esClient } = options; const installation = await getInstallation({ savedObjectsClient, pkgName }); - if (!installation) throw new PackageRemovalError(`${pkgName} is not installed`); - + if (!installation) { + throw new PackageRemovalError(`${pkgName} is not installed`); + } + if (pkgVersion && installation.version !== pkgVersion) { + throw new PackageRemovalError(`${pkgName} ${pkgVersion} is not installed`); + } const { total, items } = await packagePolicyService.list( appContextService.getInternalUserSOClientWithoutSpaceExtension(), { @@ -115,7 +119,7 @@ export async function removeInstallation(options: { // a fresh copy from the registry deletePackageCache({ name: pkgName, - version: pkgVersion, + version: installation.version, }); await removeArchiveEntries({ savedObjectsClient, refs: installation.package_assets }); From e36f1f821efed23574c5652d85eeb9274a759896 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Thu, 31 Oct 2024 12:45:08 -0400 Subject: [PATCH 03/25] remove experimental from GET /epm/categories --- x-pack/plugins/fleet/common/types/rest_spec/epm.ts | 2 -- x-pack/plugins/fleet/server/types/rest_spec/epm.ts | 1 - 2 files changed, 3 deletions(-) diff --git a/x-pack/plugins/fleet/common/types/rest_spec/epm.ts b/x-pack/plugins/fleet/common/types/rest_spec/epm.ts index e8dee14e40b30..52eb071be995d 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/epm.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/epm.ts @@ -25,8 +25,6 @@ import type { export interface GetCategoriesRequest { query: { - // deprecated in 8.6 - experimental?: boolean; prerelease?: boolean; include_policy_templates?: boolean; }; diff --git a/x-pack/plugins/fleet/server/types/rest_spec/epm.ts b/x-pack/plugins/fleet/server/types/rest_spec/epm.ts index 227753541e81d..57ffe95621b63 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/epm.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/epm.ts @@ -12,7 +12,6 @@ import { ExperimentalDataStreamFeaturesSchema } from '../models/package_policy'; export const GetCategoriesRequestSchema = { query: schema.object({ prerelease: schema.maybe(schema.boolean()), - experimental: schema.maybe(schema.boolean()), // deprecated include_policy_templates: schema.maybe(schema.boolean()), }), }; From ac9b09ce263955d1b4a89bd8529845335aae45e6 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Thu, 31 Oct 2024 13:26:04 -0400 Subject: [PATCH 04/25] fix tests --- .../plugins/fleet/common/constants/routes.ts | 9 +- .../plugins/fleet/common/services/routes.ts | 33 +++++-- .../plugins/fleet/server/routes/epm/index.ts | 87 ------------------- .../delete_endpoint_fleet_package.ts | 4 +- .../delete_prebuilt_rules_fleet_package.ts | 6 +- 5 files changed, 32 insertions(+), 107 deletions(-) diff --git a/x-pack/plugins/fleet/common/constants/routes.ts b/x-pack/plugins/fleet/common/constants/routes.ts index 8bfb6e6cf106e..fc6dec0d285b8 100644 --- a/x-pack/plugins/fleet/common/constants/routes.ts +++ b/x-pack/plugins/fleet/common/constants/routes.ts @@ -25,20 +25,19 @@ const EPM_PACKAGES_INSTALLED = `${EPM_API_ROOT}/packages/installed`; const EPM_PACKAGES_BULK = `${EPM_PACKAGES_MANY}/_bulk`; const EPM_PACKAGES_ONE_WITHOUT_VERSION = `${EPM_PACKAGES_MANY}/{pkgName}`; const EPM_PACKAGES_ONE = `${EPM_PACKAGES_MANY}/{pkgName}/{pkgVersion}`; +const EPM_PACKAGES_ONE_WITH_OPTIONAL_VERSION = `${EPM_PACKAGES_MANY}/{pkgName}/{pkgVersion?}`; export const EPM_API_ROUTES = { BULK_INSTALL_PATTERN: EPM_PACKAGES_BULK, LIST_PATTERN: EPM_PACKAGES_MANY, INSTALLED_LIST_PATTERN: EPM_PACKAGES_INSTALLED, LIMITED_LIST_PATTERN: `${EPM_PACKAGES_MANY}/limited`, INFO_WITHOUT_VERSION_PATTERN: EPM_PACKAGES_ONE_WITHOUT_VERSION, - INFO_PATTERN: EPM_PACKAGES_ONE, + INFO_PATTERN: EPM_PACKAGES_ONE_WITH_OPTIONAL_VERSION, DATA_STREAMS_PATTERN: `${EPM_API_ROOT}/data_streams`, - INSTALL_FROM_REGISTRY_PATTERN: EPM_PACKAGES_ONE, - INSTALL_FROM_REGISTRY_WITHOUT_VERSION_PATTERN: EPM_PACKAGES_ONE_WITHOUT_VERSION, + INSTALL_FROM_REGISTRY_PATTERN: EPM_PACKAGES_ONE_WITH_OPTIONAL_VERSION, INSTALL_BY_UPLOAD_PATTERN: EPM_PACKAGES_MANY, CUSTOM_INTEGRATIONS_PATTERN: `${EPM_API_ROOT}/custom_integrations`, - DELETE_PATTERN: EPM_PACKAGES_ONE, - DELETE_PATTERN_WITHOUT_VERSION_PATTERN: EPM_PACKAGES_ONE_WITHOUT_VERSION, + DELETE_PATTERN: EPM_PACKAGES_ONE_WITH_OPTIONAL_VERSION, INSTALL_KIBANA_ASSETS_PATTERN: `${EPM_PACKAGES_ONE}/kibana_assets`, DELETE_KIBANA_ASSETS_PATTERN: `${EPM_PACKAGES_ONE}/kibana_assets`, FILEPATH_PATTERN: `${EPM_PACKAGES_ONE}/{filePath*}`, diff --git a/x-pack/plugins/fleet/common/services/routes.ts b/x-pack/plugins/fleet/common/services/routes.ts index 520a71e1bdc0a..c7acb92c58d1a 100644 --- a/x-pack/plugins/fleet/common/services/routes.ts +++ b/x-pack/plugins/fleet/common/services/routes.ts @@ -47,11 +47,14 @@ export const epmRouteService = { getInfoPath: (pkgName: string, pkgVersion?: string) => { if (pkgVersion) { return EPM_API_ROUTES.INFO_PATTERN.replace('{pkgName}', pkgName).replace( - '{pkgVersion}', + '{pkgVersion?}', pkgVersion ); } else { - return EPM_API_ROUTES.INFO_PATTERN.replace('{pkgName}', pkgName).replace('/{pkgVersion}', ''); + return EPM_API_ROUTES.INFO_PATTERN.replace('{pkgName}', pkgName).replace( + '/{pkgVersion?}', + '' + ); } }, @@ -64,19 +67,31 @@ export const epmRouteService = { }, getInstallPath: (pkgName: string, pkgVersion: string) => { - return EPM_API_ROUTES.INSTALL_FROM_REGISTRY_PATTERN.replace('{pkgName}', pkgName) - .replace('{pkgVersion}', pkgVersion) - .replace(/\/$/, ''); // trim trailing slash + if (pkgVersion) { + return EPM_API_ROUTES.INSTALL_FROM_REGISTRY_PATTERN.replace('{pkgName}', pkgName) + .replace('{pkgVersion?}', pkgVersion) + .replace(/\/$/, ''); // trim trailing slash + } else { + return EPM_API_ROUTES.INSTALL_FROM_REGISTRY_PATTERN.replace('{pkgName}', pkgName) + .replace('/{pkgVersion?}', '') + .replace(/\/$/, ''); // trim trailing slash + } }, getBulkInstallPath: () => { return EPM_API_ROUTES.BULK_INSTALL_PATTERN; }, - getRemovePath: (pkgName: string, pkgVersion: string) => { - return EPM_API_ROUTES.DELETE_PATTERN.replace('{pkgName}', pkgName) - .replace('{pkgVersion}', pkgVersion) - .replace(/\/$/, ''); // trim trailing slash + getRemovePath: (pkgName: string, pkgVersion?: string) => { + if (pkgVersion) { + return EPM_API_ROUTES.DELETE_PATTERN.replace('{pkgName}', pkgName) + .replace('/{pkgVersion?}', pkgVersion) + .replace(/\/$/, ''); // trim trailing slash + } else { + return EPM_API_ROUTES.DELETE_PATTERN.replace('{pkgName}', pkgName) + .replace('{pkgVersion?}', '') + .replace(/\/$/, ''); // trim trailing slash + } }, getInstallKibanaAssetsPath: (pkgName: string, pkgVersion: string) => { diff --git a/x-pack/plugins/fleet/server/routes/epm/index.ts b/x-pack/plugins/fleet/server/routes/epm/index.ts index 7f92d0284292f..283f8d6a1b0a0 100644 --- a/x-pack/plugins/fleet/server/routes/epm/index.ts +++ b/x-pack/plugins/fleet/server/routes/epm/index.ts @@ -287,37 +287,6 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType getFileHandler ); - router.versioned - .get({ - path: EPM_API_ROUTES.INFO_WITHOUT_VERSION_PATTERN, - fleetAuthz: (fleetAuthz: FleetAuthz): boolean => - calculateRouteAuthz( - fleetAuthz, - getRouteRequiredAuthz('get', EPM_API_ROUTES.INFO_WITHOUT_VERSION_PATTERN) - ).granted, - description: `Get package`, - options: { - tags: ['oas-tag:Elastic Package Manager (EPM)'], - }, - }) - .addVersion( - { - version: API_VERSIONS.public.v1, - validate: { - request: GetInfoRequestSchema, - response: { - 200: { - body: () => GetInfoResponseSchema, - }, - 400: { - body: genericErrorResponse, - }, - }, - }, - }, - getInfoHandler - ); - router.versioned .get({ path: EPM_API_ROUTES.INFO_PATTERN, @@ -375,32 +344,6 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType }, updatePackageHandler ); - router.versioned - .post({ - path: EPM_API_ROUTES.INSTALL_FROM_REGISTRY_WITHOUT_VERSION_PATTERN, - fleetAuthz: INSTALL_PACKAGES_AUTHZ, - description: `Install package from registry`, - options: { - tags: ['oas-tag:Elastic Package Manager (EPM)'], - }, - }) - .addVersion( - { - version: API_VERSIONS.public.v1, - validate: { - request: InstallPackageFromRegistryRequestSchema, - response: { - 200: { - body: () => InstallPackageResponseSchema, - }, - 400: { - body: genericErrorResponse, - }, - }, - }, - }, - installPackageFromRegistryHandler - ); router.versioned .post({ @@ -580,36 +523,6 @@ export const registerRoutes = (router: FleetAuthzRouter, config: FleetConfigType createCustomIntegrationHandler ); - router.versioned - .delete({ - path: EPM_API_ROUTES.DELETE_PATTERN_WITHOUT_VERSION_PATTERN, - fleetAuthz: { - integrations: { removePackages: true }, - }, - description: `Delete package`, - options: { - tags: ['oas-tag:Elastic Package Manager (EPM)'], - }, - }) - .addVersion( - { - version: API_VERSIONS.public.v1, - validate: { - request: DeletePackageRequestSchema, - response: { - 200: { - body: () => DeletePackageResponseSchema, - }, - 400: { - body: genericErrorResponse, - }, - }, - }, - }, - - deletePackageHandler - ); - router.versioned .delete({ path: EPM_API_ROUTES.DELETE_PATTERN, diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/rules/prebuilt_rules/delete_endpoint_fleet_package.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/rules/prebuilt_rules/delete_endpoint_fleet_package.ts index e53e24f98de3b..cea8363d9085c 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/rules/prebuilt_rules/delete_endpoint_fleet_package.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/rules/prebuilt_rules/delete_endpoint_fleet_package.ts @@ -21,9 +21,9 @@ export async function deleteEndpointFleetPackage(supertest: SuperTest.Agent) { .set('elastic-api-version', '2023-10-31') .send(); - if (resp.status === 200 && resp.body.response.status === 'installed') { + if (resp.status === 200 && resp.body.item.status === 'installed') { await supertest - .delete(epmRouteService.getRemovePath(ENDPOINT_PACKAGE_NAME, resp.body.response.version)) + .delete(epmRouteService.getRemovePath(ENDPOINT_PACKAGE_NAME, resp.body.item.version)) .set('kbn-xsrf', 'true') .send({ force: true }); } diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/rules/prebuilt_rules/delete_prebuilt_rules_fleet_package.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/rules/prebuilt_rules/delete_prebuilt_rules_fleet_package.ts index 930c9d39757f4..084d59c55df0d 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/rules/prebuilt_rules/delete_prebuilt_rules_fleet_package.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/rules/prebuilt_rules/delete_prebuilt_rules_fleet_package.ts @@ -21,11 +21,9 @@ export async function deletePrebuiltRulesFleetPackage(supertest: SuperTest.Agent .set('elastic-api-version', '2023-10-31') .send(); - if (resp.status === 200 && resp.body.response.status === 'installed') { + if (resp.status === 200 && resp.body.item.status === 'installed') { await supertest - .delete( - epmRouteService.getRemovePath(PREBUILT_RULES_PACKAGE_NAME, resp.body.response.version) - ) + .delete(epmRouteService.getRemovePath(PREBUILT_RULES_PACKAGE_NAME, resp.body.item.version)) .set('kbn-xsrf', 'true') .send({ force: true }); } From 8a30d4e066f641e446e65e67446ad7ed49aa663d Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 31 Oct 2024 18:09:46 +0000 Subject: [PATCH 05/25] [CI] Auto-commit changed files from 'node scripts/capture_oas_snapshot --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/fleet --update' --- oas_docs/bundle.json | 283 +------------------------------- oas_docs/bundle.serverless.json | 283 +------------------------------- 2 files changed, 16 insertions(+), 550 deletions(-) diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index b036295af656d..66ec9d11820be 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -18275,14 +18275,6 @@ "type": "boolean" } }, - { - "in": "query", - "name": "experimental", - "required": false, - "schema": { - "type": "boolean" - } - }, { "in": "query", "name": "include_policy_templates", @@ -20971,7 +20963,7 @@ "/api/fleet/epm/packages/{pkgName}/{pkgVersion}": { "delete": { "description": "Delete package", - "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7BpkgName%7D%2F%7BpkgVersion%7D#3", + "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7BpkgName%7D%2F%7BpkgVersion%3F%7D#3", "parameters": [ { "description": "The version of the API to use", @@ -21006,7 +20998,7 @@ { "in": "path", "name": "pkgVersion", - "required": true, + "required": false, "schema": { "type": "string" } @@ -21233,7 +21225,7 @@ }, "get": { "description": "Get package", - "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7BpkgName%7D%2F%7BpkgVersion%7D#0", + "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7BpkgName%7D%2F%7BpkgVersion%3F%7D#0", "parameters": [ { "description": "The version of the API to use", @@ -21258,7 +21250,7 @@ { "in": "path", "name": "pkgVersion", - "required": true, + "required": false, "schema": { "type": "string" } @@ -22497,7 +22489,7 @@ }, "post": { "description": "Install package from registry", - "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7BpkgName%7D%2F%7BpkgVersion%7D#2", + "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7BpkgName%7D%2F%7BpkgVersion%3F%7D#2", "parameters": [ { "description": "The version of the API to use", @@ -22532,7 +22524,7 @@ { "in": "path", "name": "pkgVersion", - "required": true, + "required": false, "schema": { "type": "string" } @@ -22792,7 +22784,7 @@ }, "put": { "description": "Update package settings", - "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7BpkgName%7D%2F%7BpkgVersion%7D#1", + "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7BpkgName%7D%2F%7BpkgVersion%3F%7D#1", "parameters": [ { "description": "The version of the API to use", @@ -22827,7 +22819,7 @@ { "in": "path", "name": "pkgVersion", - "required": true, + "required": false, "schema": { "type": "string" } @@ -24264,265 +24256,6 @@ ] } }, - "/api/fleet/epm/packages/{pkgkey}": { - "delete": { - "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#3", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "description": "A required header to protect against CSRF attacks", - "in": "header", - "name": "kbn-xsrf", - "required": true, - "schema": { - "example": "true", - "type": "string" - } - }, - { - "in": "path", - "name": "pkgkey", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "nullable": true, - "properties": { - "force": { - "type": "boolean" - } - }, - "required": [ - "force" - ], - "type": "object" - } - } - } - }, - "responses": {}, - "summary": "", - "tags": [] - }, - "get": { - "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#0", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "in": "path", - "name": "pkgkey", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "ignoreUnverified", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "prerelease", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "full", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "withMetadata", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } - } - ], - "responses": {}, - "summary": "", - "tags": [] - }, - "post": { - "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#2", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "description": "A required header to protect against CSRF attacks", - "in": "header", - "name": "kbn-xsrf", - "required": true, - "schema": { - "example": "true", - "type": "string" - } - }, - { - "in": "path", - "name": "pkgkey", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "prerelease", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "ignoreMappingUpdateErrors", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } - }, - { - "in": "query", - "name": "skipDataStreamRollover", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } - } - ], - "requestBody": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "nullable": true, - "properties": { - "force": { - "type": "boolean" - } - }, - "required": [ - "force" - ], - "type": "object" - } - } - } - }, - "responses": {}, - "summary": "", - "tags": [] - }, - "put": { - "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#1", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "description": "A required header to protect against CSRF attacks", - "in": "header", - "name": "kbn-xsrf", - "required": true, - "schema": { - "example": "true", - "type": "string" - } - }, - { - "in": "path", - "name": "pkgkey", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "properties": { - "keepPoliciesUpToDate": { - "type": "boolean" - } - }, - "required": [ - "keepPoliciesUpToDate" - ], - "type": "object" - } - } - } - }, - "responses": {}, - "summary": "", - "tags": [] - } - }, "/api/fleet/epm/templates/{pkgName}/{pkgVersion}/inputs": { "get": { "description": "Get inputs template", diff --git a/oas_docs/bundle.serverless.json b/oas_docs/bundle.serverless.json index 0f97deca38824..003b69a9dc12d 100644 --- a/oas_docs/bundle.serverless.json +++ b/oas_docs/bundle.serverless.json @@ -18275,14 +18275,6 @@ "type": "boolean" } }, - { - "in": "query", - "name": "experimental", - "required": false, - "schema": { - "type": "boolean" - } - }, { "in": "query", "name": "include_policy_templates", @@ -20971,7 +20963,7 @@ "/api/fleet/epm/packages/{pkgName}/{pkgVersion}": { "delete": { "description": "Delete package", - "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7BpkgName%7D%2F%7BpkgVersion%7D#3", + "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7BpkgName%7D%2F%7BpkgVersion%3F%7D#3", "parameters": [ { "description": "The version of the API to use", @@ -21006,7 +20998,7 @@ { "in": "path", "name": "pkgVersion", - "required": true, + "required": false, "schema": { "type": "string" } @@ -21233,7 +21225,7 @@ }, "get": { "description": "Get package", - "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7BpkgName%7D%2F%7BpkgVersion%7D#0", + "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7BpkgName%7D%2F%7BpkgVersion%3F%7D#0", "parameters": [ { "description": "The version of the API to use", @@ -21258,7 +21250,7 @@ { "in": "path", "name": "pkgVersion", - "required": true, + "required": false, "schema": { "type": "string" } @@ -22497,7 +22489,7 @@ }, "post": { "description": "Install package from registry", - "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7BpkgName%7D%2F%7BpkgVersion%7D#2", + "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7BpkgName%7D%2F%7BpkgVersion%3F%7D#2", "parameters": [ { "description": "The version of the API to use", @@ -22532,7 +22524,7 @@ { "in": "path", "name": "pkgVersion", - "required": true, + "required": false, "schema": { "type": "string" } @@ -22792,7 +22784,7 @@ }, "put": { "description": "Update package settings", - "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7BpkgName%7D%2F%7BpkgVersion%7D#1", + "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7BpkgName%7D%2F%7BpkgVersion%3F%7D#1", "parameters": [ { "description": "The version of the API to use", @@ -22827,7 +22819,7 @@ { "in": "path", "name": "pkgVersion", - "required": true, + "required": false, "schema": { "type": "string" } @@ -24264,265 +24256,6 @@ ] } }, - "/api/fleet/epm/packages/{pkgkey}": { - "delete": { - "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#3", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "description": "A required header to protect against CSRF attacks", - "in": "header", - "name": "kbn-xsrf", - "required": true, - "schema": { - "example": "true", - "type": "string" - } - }, - { - "in": "path", - "name": "pkgkey", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "nullable": true, - "properties": { - "force": { - "type": "boolean" - } - }, - "required": [ - "force" - ], - "type": "object" - } - } - } - }, - "responses": {}, - "summary": "", - "tags": [] - }, - "get": { - "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#0", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "in": "path", - "name": "pkgkey", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "ignoreUnverified", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "prerelease", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "full", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "withMetadata", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } - } - ], - "responses": {}, - "summary": "", - "tags": [] - }, - "post": { - "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#2", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "description": "A required header to protect against CSRF attacks", - "in": "header", - "name": "kbn-xsrf", - "required": true, - "schema": { - "example": "true", - "type": "string" - } - }, - { - "in": "path", - "name": "pkgkey", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "prerelease", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "ignoreMappingUpdateErrors", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } - }, - { - "in": "query", - "name": "skipDataStreamRollover", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } - } - ], - "requestBody": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "nullable": true, - "properties": { - "force": { - "type": "boolean" - } - }, - "required": [ - "force" - ], - "type": "object" - } - } - } - }, - "responses": {}, - "summary": "", - "tags": [] - }, - "put": { - "operationId": "%2Fapi%2Ffleet%2Fepm%2Fpackages%2F%7Bpkgkey%7D#1", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "description": "A required header to protect against CSRF attacks", - "in": "header", - "name": "kbn-xsrf", - "required": true, - "schema": { - "example": "true", - "type": "string" - } - }, - { - "in": "path", - "name": "pkgkey", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "properties": { - "keepPoliciesUpToDate": { - "type": "boolean" - } - }, - "required": [ - "keepPoliciesUpToDate" - ], - "type": "object" - } - } - } - }, - "responses": {}, - "summary": "", - "tags": [] - } - }, "/api/fleet/epm/templates/{pkgName}/{pkgVersion}/inputs": { "get": { "description": "Get inputs template", From 1ebe34e3753e71261a0606dc0891a800680a0998 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Thu, 31 Oct 2024 15:08:29 -0400 Subject: [PATCH 06/25] fix test --- x-pack/plugins/fleet/server/services/epm/packages/remove.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/x-pack/plugins/fleet/server/services/epm/packages/remove.ts b/x-pack/plugins/fleet/server/services/epm/packages/remove.ts index 396ba430ceacb..649ef4d09ced8 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/remove.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/remove.ts @@ -61,14 +61,11 @@ export async function removeInstallation(options: { esClient: ElasticsearchClient; force?: boolean; }): Promise { - const { savedObjectsClient, pkgName, pkgVersion, esClient } = options; + const { savedObjectsClient, pkgName, esClient } = options; const installation = await getInstallation({ savedObjectsClient, pkgName }); if (!installation) { throw new PackageRemovalError(`${pkgName} is not installed`); } - if (pkgVersion && installation.version !== pkgVersion) { - throw new PackageRemovalError(`${pkgName} ${pkgVersion} is not installed`); - } const { total, items } = await packagePolicyService.list( appContextService.getInternalUserSOClientWithoutSpaceExtension(), { From 98eae361266f082da72d1dce9349455e7df07fe7 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Thu, 31 Oct 2024 15:31:02 -0400 Subject: [PATCH 07/25] fix tests --- x-pack/plugins/fleet/common/services/routes.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/fleet/common/services/routes.ts b/x-pack/plugins/fleet/common/services/routes.ts index c7acb92c58d1a..020f7c2fc25b8 100644 --- a/x-pack/plugins/fleet/common/services/routes.ts +++ b/x-pack/plugins/fleet/common/services/routes.ts @@ -85,11 +85,11 @@ export const epmRouteService = { getRemovePath: (pkgName: string, pkgVersion?: string) => { if (pkgVersion) { return EPM_API_ROUTES.DELETE_PATTERN.replace('{pkgName}', pkgName) - .replace('/{pkgVersion?}', pkgVersion) + .replace('{pkgVersion?}', pkgVersion) .replace(/\/$/, ''); // trim trailing slash } else { return EPM_API_ROUTES.DELETE_PATTERN.replace('{pkgName}', pkgName) - .replace('{pkgVersion?}', '') + .replace('/{pkgVersion?}', '') .replace(/\/$/, ''); // trim trailing slash } }, From 68c57bfef8bcd7caee9d8388090f8478b79c8e28 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Fri, 1 Nov 2024 08:01:51 -0400 Subject: [PATCH 08/25] remove response from categories endpoint --- x-pack/plugins/fleet/common/types/rest_spec/epm.ts | 2 -- x-pack/plugins/fleet/server/routes/epm/handlers.ts | 5 ++--- x-pack/plugins/fleet/server/types/rest_spec/epm.ts | 3 --- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/x-pack/plugins/fleet/common/types/rest_spec/epm.ts b/x-pack/plugins/fleet/common/types/rest_spec/epm.ts index 52eb071be995d..b99318c417f71 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/epm.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/epm.ts @@ -32,8 +32,6 @@ export interface GetCategoriesRequest { export interface GetCategoriesResponse { items: CategorySummaryList; - // deprecated in 8.0 - response?: CategorySummaryList; } export interface GetPackagesRequest { diff --git a/x-pack/plugins/fleet/server/routes/epm/handlers.ts b/x-pack/plugins/fleet/server/routes/epm/handlers.ts index 7d7fea6d693a7..f16befb275dce 100644 --- a/x-pack/plugins/fleet/server/routes/epm/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/epm/handlers.ts @@ -98,12 +98,11 @@ export const getCategoriesHandler: FleetRequestHandler< TypeOf > = async (context, request, response) => { try { - const res = await getCategories({ + const items = await getCategories({ ...request.query, }); const body: GetCategoriesResponse = { - items: res, - response: res, + items, }; return response.ok({ body, headers: { ...CACHE_CONTROL_10_MINUTES_HEADER } }); } catch (error) { diff --git a/x-pack/plugins/fleet/server/types/rest_spec/epm.ts b/x-pack/plugins/fleet/server/types/rest_spec/epm.ts index 57ffe95621b63..0a002dab06141 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/epm.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/epm.ts @@ -26,9 +26,6 @@ const CategorySummaryItemSchema = schema.object({ export const GetCategoriesResponseSchema = schema.object({ items: schema.arrayOf(CategorySummaryItemSchema), - response: schema.maybe( - schema.arrayOf(CategorySummaryItemSchema.extends({}, { meta: { deprecated: true } })) - ), }); export const GetPackagesRequestSchema = { From daae4d0f1daaea4af12f30ac2bd14012bdc75cc3 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Fri, 1 Nov 2024 09:48:10 -0400 Subject: [PATCH 09/25] remove response and experimental parameter --- x-pack/plugins/fleet/common/types/rest_spec/epm.ts | 4 ---- x-pack/plugins/fleet/server/routes/epm/handlers.ts | 1 - x-pack/plugins/fleet/server/routes/epm/index.test.ts | 2 -- x-pack/plugins/fleet/server/types/rest_spec/epm.ts | 4 ---- 4 files changed, 11 deletions(-) diff --git a/x-pack/plugins/fleet/common/types/rest_spec/epm.ts b/x-pack/plugins/fleet/common/types/rest_spec/epm.ts index b99318c417f71..39ea9f6c7ea69 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/epm.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/epm.ts @@ -37,8 +37,6 @@ export interface GetCategoriesResponse { export interface GetPackagesRequest { query: { category?: string; - // deprecated in 8.6 - experimental?: boolean; prerelease?: boolean; excludeInstallStatus?: boolean; }; @@ -46,8 +44,6 @@ export interface GetPackagesRequest { export interface GetPackagesResponse { items: PackageList; - // deprecated in 8.0 - response?: PackageList; } export interface InstalledPackage { diff --git a/x-pack/plugins/fleet/server/routes/epm/handlers.ts b/x-pack/plugins/fleet/server/routes/epm/handlers.ts index f16befb275dce..faf0498d95310 100644 --- a/x-pack/plugins/fleet/server/routes/epm/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/epm/handlers.ts @@ -123,7 +123,6 @@ export const getListHandler: FleetRequestHandler< const flattenedRes = res.map((pkg) => soToInstallationInfo(pkg)) as PackageList; const body: GetPackagesResponse = { items: flattenedRes, - response: res, }; return response.ok({ body, diff --git a/x-pack/plugins/fleet/server/routes/epm/index.test.ts b/x-pack/plugins/fleet/server/routes/epm/index.test.ts index a054b02aae1d1..32cd7751fb8fa 100644 --- a/x-pack/plugins/fleet/server/routes/epm/index.test.ts +++ b/x-pack/plugins/fleet/server/routes/epm/index.test.ts @@ -323,7 +323,6 @@ describe('schema validation', () => { }; const expectedResponse: GetCategoriesResponse = { items: [category], - response: [category], }; (getCategoriesHandler as jest.Mock).mockImplementation((ctx, request, res) => { return res.ok({ body: expectedResponse }); @@ -386,7 +385,6 @@ describe('schema validation', () => { }; const expectedResponse: GetPackagesResponse = { items: [packageItem], - response: [packageItem], }; (getListHandler as jest.Mock).mockImplementation((ctx, request, res) => { return res.ok({ body: expectedResponse }); diff --git a/x-pack/plugins/fleet/server/types/rest_spec/epm.ts b/x-pack/plugins/fleet/server/types/rest_spec/epm.ts index 0a002dab06141..7d2954a1eb48a 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/epm.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/epm.ts @@ -32,7 +32,6 @@ export const GetPackagesRequestSchema = { query: schema.object({ category: schema.maybe(schema.string()), prerelease: schema.maybe(schema.boolean()), - experimental: schema.maybe(schema.boolean()), // deprecated excludeInstallStatus: schema.maybe(schema.boolean({ defaultValue: false })), }), }; @@ -212,9 +211,6 @@ export const PackageListItemSchema = PackageInfoSchema.extends({ export const GetPackagesResponseSchema = schema.object({ items: schema.arrayOf(PackageListItemSchema), - response: schema.maybe( - schema.arrayOf(PackageListItemSchema.extends({}, { meta: { deprecated: true } })) - ), }); export const InstalledPackageSchema = schema.object({ From bf961e82ab5d2f7ac66806fde7a71a401ac957be Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Fri, 1 Nov 2024 10:18:08 -0400 Subject: [PATCH 10/25] fix types --- .../components/home_integration/tutorial_module_notice.tsx | 4 ++-- x-pack/plugins/fleet/public/search_provider.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/fleet/public/components/home_integration/tutorial_module_notice.tsx b/x-pack/plugins/fleet/public/components/home_integration/tutorial_module_notice.tsx index 905f2c82e85c7..f3b7b0cb77f84 100644 --- a/x-pack/plugins/fleet/public/components/home_integration/tutorial_module_notice.tsx +++ b/x-pack/plugins/fleet/public/components/home_integration/tutorial_module_notice.tsx @@ -23,8 +23,8 @@ const TutorialModuleNotice: TutorialModuleNoticeComponent = memo(({ moduleName } const pkgInfo = !isLoading && - packagesData?.response && - packagesData.response.find((pkg) => pkg.name === moduleName && pkg.name !== FLEET_APM_PACKAGE); // APM needs special handling + packagesData?.items && + packagesData.items.find((pkg) => pkg.name === moduleName && pkg.name !== FLEET_APM_PACKAGE); // APM needs special handling if (hasIntegrationsPermissions && pkgInfo) { return ( diff --git a/x-pack/plugins/fleet/public/search_provider.ts b/x-pack/plugins/fleet/public/search_provider.ts index ce1ddd10ac5a2..a6810633c428e 100644 --- a/x-pack/plugins/fleet/public/search_provider.ts +++ b/x-pack/plugins/fleet/public/search_provider.ts @@ -30,7 +30,7 @@ const createPackages$ = () => if (error) { throw error; } - return data?.response ?? []; + return data?.items ?? []; }), shareReplay(1) ); @@ -86,7 +86,7 @@ export const createPackageSearchProvider = (core: CoreSetup): GlobalSearchResult shareReplay(1) ); - let packages$: undefined | Observable; + let packages$: undefined | Observable; const getPackages$ = () => { if (!packages$) { From 557bb51577a2231c51953d1677463a2e94aac17e Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Fri, 1 Nov 2024 10:33:44 -0400 Subject: [PATCH 11/25] add more tests --- .../fleet/common/services/route.test.ts | 43 +++++++++++++++++++ .../plugins/fleet/common/services/routes.ts | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 x-pack/plugins/fleet/common/services/route.test.ts diff --git a/x-pack/plugins/fleet/common/services/route.test.ts b/x-pack/plugins/fleet/common/services/route.test.ts new file mode 100644 index 0000000000000..1075f4f2605ea --- /dev/null +++ b/x-pack/plugins/fleet/common/services/route.test.ts @@ -0,0 +1,43 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { epmRouteService } from './routes'; + +describe('Route services', () => { + describe('epmRouteService', () => { + describe('getInfoPath', () => { + it('should generate path with pkgVersion', () => { + expect(epmRouteService.getInfoPath('test', '1.0.0')).toBe( + '/api/fleet/epm/packages/test/1.0.0' + ); + }); + it('should generate path without pkgVersion', () => { + expect(epmRouteService.getInfoPath('test')).toBe('/api/fleet/epm/packages/test'); + }); + }); + describe('getInstallPath', () => { + it('should generate path with pkgVersion', () => { + expect(epmRouteService.getInstallPath('test', '1.0.0')).toBe( + '/api/fleet/epm/packages/test/1.0.0' + ); + }); + it('should generate path without pkgVersion', () => { + expect(epmRouteService.getInstallPath('test')).toBe('/api/fleet/epm/packages/test'); + }); + }); + describe('getRemovePath', () => { + it('should generate path with pkgVersion', () => { + expect(epmRouteService.getRemovePath('test', '1.0.0')).toBe( + '/api/fleet/epm/packages/test/1.0.0' + ); + }); + it('should generate path without pkgVersion', () => { + expect(epmRouteService.getRemovePath('test')).toBe('/api/fleet/epm/packages/test'); + }); + }); + }); +}); diff --git a/x-pack/plugins/fleet/common/services/routes.ts b/x-pack/plugins/fleet/common/services/routes.ts index 020f7c2fc25b8..56f7096cf9766 100644 --- a/x-pack/plugins/fleet/common/services/routes.ts +++ b/x-pack/plugins/fleet/common/services/routes.ts @@ -66,7 +66,7 @@ export const epmRouteService = { return `${EPM_API_ROOT}${filePath.replace('/package', '/packages')}`; }, - getInstallPath: (pkgName: string, pkgVersion: string) => { + getInstallPath: (pkgName: string, pkgVersion?: string) => { if (pkgVersion) { return EPM_API_ROUTES.INSTALL_FROM_REGISTRY_PATTERN.replace('{pkgName}', pkgName) .replace('{pkgVersion?}', pkgVersion) From 202e28c14aea5d1e7e4bcf2a3f4ef0b79f0e9a11 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 1 Nov 2024 14:55:03 +0000 Subject: [PATCH 12/25] [CI] Auto-commit changed files from 'node scripts/capture_oas_snapshot --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/fleet --update' --- oas_docs/bundle.json | 1246 ++++++------------------------- oas_docs/bundle.serverless.json | 1246 ++++++------------------------- 2 files changed, 454 insertions(+), 2038 deletions(-) diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index fd2a7bbe22de0..0b2d7d5a38557 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -17768,14 +17768,6 @@ "type": "boolean" } }, - { - "in": "query", - "name": "experimental", - "required": false, - "schema": { - "type": "boolean" - } - }, { "in": "query", "name": "include_policy_templates", @@ -17820,36 +17812,6 @@ "type": "object" }, "type": "array" - }, - "response": { - "items": { - "additionalProperties": false, - "deprecated": true, - "properties": { - "count": { - "type": "number" - }, - "id": { - "type": "string" - }, - "parent_id": { - "type": "string" - }, - "parent_title": { - "type": "string" - }, - "title": { - "type": "string" - } - }, - "required": [ - "id", - "title", - "count" - ], - "type": "object" - }, - "type": "array" } }, "required": [ @@ -18112,741 +18074,246 @@ "component_template", "ingest_pipeline", "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - } - ] - }, - "type": "array" - } - }, - "required": [ - "items", - "_meta" - ], - "type": "object" - } - } - } - }, - "400": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "description": "Generic Error", - "properties": { - "error": { - "type": "string" - }, - "message": { - "type": "string" - }, - "statusCode": { - "type": "number" - } - }, - "required": [ - "message" - ], - "type": "object" - } - } - } - } - }, - "summary": "", - "tags": [ - "Elastic Package Manager (EPM)" - ] - } - }, - "/api/fleet/epm/data_streams": { - "get": { - "description": "List data streams", - "operationId": "get-fleet-epm-data-streams", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "in": "query", - "name": "type", - "required": false, - "schema": { - "enum": [ - "logs", - "metrics", - "traces", - "synthetics", - "profiling" - ], - "type": "string" - } - }, - { - "in": "query", - "name": "datasetQuery", - "required": false, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "sortOrder", - "required": false, - "schema": { - "default": "asc", - "enum": [ - "asc", - "desc" - ], - "type": "string" - } - }, - { - "in": "query", - "name": "uncategorisedOnly", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } - } - ], - "responses": { - "200": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "properties": { - "items": { - "items": { - "additionalProperties": false, - "properties": { - "name": { - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - } - }, - "required": [ - "items" - ], - "type": "object" - } - } - } - }, - "400": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "description": "Generic Error", - "properties": { - "error": { - "type": "string" - }, - "message": { - "type": "string" - }, - "statusCode": { - "type": "number" - } - }, - "required": [ - "message" - ], - "type": "object" - } - } - } - } - }, - "summary": "", - "tags": [ - "Data streams" - ] - } - }, - "/api/fleet/epm/packages": { - "get": { - "description": "List packages", - "operationId": "get-fleet-epm-packages", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "in": "query", - "name": "category", - "required": false, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "prerelease", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "experimental", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "excludeInstallStatus", - "required": false, - "schema": { - "type": "boolean" - } - } - ], - "responses": { - "200": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "properties": { - "items": { - "items": { - "additionalProperties": true, - "properties": { - "categories": { - "items": { - "type": "string" - }, - "type": "array" - }, - "conditions": { - "additionalProperties": true, - "properties": { - "elastic": { - "additionalProperties": true, - "properties": { - "capabilities": { - "items": { - "type": "string" - }, - "type": "array" - }, - "subscription": { - "type": "string" - } - }, - "type": "object" - }, - "kibana": { - "additionalProperties": true, - "properties": { - "version": { - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "data_streams": { - "items": { - "additionalProperties": {}, - "type": "object" - }, - "type": "array" - }, - "description": { - "type": "string" - }, - "discovery": { - "additionalProperties": true, - "properties": { - "fields": { - "items": { - "additionalProperties": true, - "properties": { - "name": { - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "download": { - "type": "string" - }, - "format_version": { - "type": "string" - }, - "icons": { - "items": { - "additionalProperties": true, - "properties": { - "dark_mode": { - "type": "boolean" - }, - "path": { - "type": "string" - }, - "size": { - "type": "string" - }, - "src": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "required": [ - "src" - ], - "type": "object" - }, - "type": "array" - }, - "id": { - "type": "string" - }, - "installationInfo": { - "additionalProperties": true, - "properties": { - "additional_spaces_installed_kibana": { - "additionalProperties": { - "items": { - "additionalProperties": true, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - "type": "array" - }, - "type": "object" - }, - "created_at": { - "type": "string" - }, - "experimental_data_stream_features": { - "items": { - "additionalProperties": true, - "properties": { - "data_stream": { - "type": "string" - }, - "features": { - "additionalProperties": true, - "properties": { - "doc_value_only_numeric": { - "type": "boolean" - }, - "doc_value_only_other": { - "type": "boolean" - }, - "synthetic_source": { - "type": "boolean" - }, - "tsdb": { - "type": "boolean" - } - }, - "type": "object" - } - }, - "required": [ - "data_stream", - "features" - ], - "type": "object" - }, - "type": "array" - }, - "install_format_schema_version": { - "type": "string" - }, - "install_source": { - "enum": [ - "registry", - "upload", - "bundled", - "custom" - ], - "type": "string" - }, - "install_status": { - "enum": [ - "installed", - "installing", - "install_failed" - ], - "type": "string" - }, - "installed_es": { - "items": { - "additionalProperties": true, - "properties": { - "deferred": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "type": { - "enum": [ - "index", - "index_template", - "component_template", - "ingest_pipeline", - "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - "type": "array" - }, - "installed_kibana": { - "items": { - "additionalProperties": true, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - "type": "array" - }, - "installed_kibana_space_id": { - "type": "string" - }, - "latest_executed_state": { - "additionalProperties": true, - "properties": { - "error": { - "type": "string" - }, - "name": { - "type": "string" - }, - "started_at": { - "type": "string" - } - }, - "required": [ - "name", - "started_at" - ], - "type": "object" - }, - "latest_install_failed_attempts": { - "items": { - "additionalProperties": true, - "properties": { - "created_at": { - "type": "string" - }, - "error": { - "additionalProperties": true, - "properties": { - "message": { - "type": "string" - }, - "name": { - "type": "string" - }, - "stack": { - "type": "string" - } - }, - "required": [ - "name", - "message" - ], - "type": "object" - }, - "target_version": { - "type": "string" - } - }, - "required": [ - "created_at", - "target_version", - "error" - ], - "type": "object" - }, - "type": "array" - }, - "name": { - "type": "string" - }, - "namespaces": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type": { - "type": "string" - }, - "updated_at": { - "type": "string" - }, - "verification_key_id": { - "nullable": true, - "type": "string" - }, - "verification_status": { - "enum": [ - "unverified", - "verified", - "unknown" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "type", - "installed_kibana", - "installed_es", - "name", - "version", - "install_status", - "install_source", - "verification_status" - ], - "type": "object" - }, - "integration": { - "type": "string" - }, - "internal": { - "type": "boolean" - }, - "latestVersion": { - "type": "string" - }, - "name": { - "type": "string" - }, - "owner": { - "additionalProperties": true, - "properties": { - "github": { - "type": "string" - }, - "type": { - "enum": [ - "elastic", - "partner", - "community" - ], - "type": "string" - } - }, - "type": "object" - }, - "path": { - "type": "string" - }, - "policy_templates": { - "items": { - "additionalProperties": {}, - "type": "object" - }, - "type": "array" - }, - "readme": { - "type": "string" - }, - "release": { - "enum": [ - "ga", - "beta", - "experimental" - ], - "type": "string" - }, - "savedObject": {}, - "signature_path": { - "type": "string" - }, - "source": { - "additionalProperties": true, - "properties": { - "license": { + "data_stream_ilm_policy", + "transform", + "ml_model" + ], + "type": "string" + }, + "version": { "type": "string" } }, "required": [ - "license" + "id", + "type" ], "type": "object" - }, - "status": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "enum": [ - "integration", - "input", - "content" - ], - "type": "string" - }, - "vars": { - "items": { - "additionalProperties": {}, - "type": "object" - }, - "type": "array" - }, - "version": { + } + ] + }, + "type": "array" + } + }, + "required": [ + "items", + "_meta" + ], + "type": "object" + } + } + } + }, + "400": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "description": "Generic Error", + "properties": { + "error": { + "type": "string" + }, + "message": { + "type": "string" + }, + "statusCode": { + "type": "number" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "summary": "", + "tags": [ + "Elastic Package Manager (EPM)" + ] + } + }, + "/api/fleet/epm/data_streams": { + "get": { + "description": "List data streams", + "operationId": "get-fleet-epm-data-streams", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "in": "query", + "name": "type", + "required": false, + "schema": { + "enum": [ + "logs", + "metrics", + "traces", + "synthetics", + "profiling" + ], + "type": "string" + } + }, + { + "in": "query", + "name": "datasetQuery", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "sortOrder", + "required": false, + "schema": { + "default": "asc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "in": "query", + "name": "uncategorisedOnly", + "required": false, + "schema": { + "default": false, + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "items": { + "items": { + "additionalProperties": false, + "properties": { + "name": { "type": "string" } }, "required": [ - "savedObject", - "name", - "version", - "title", - "id" + "name" ], "type": "object" }, "type": "array" + } + }, + "required": [ + "items" + ], + "type": "object" + } + } + } + }, + "400": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "description": "Generic Error", + "properties": { + "error": { + "type": "string" }, - "response": { + "message": { + "type": "string" + }, + "statusCode": { + "type": "number" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "summary": "", + "tags": [ + "Data streams" + ] + } + }, + "/api/fleet/epm/packages": { + "get": { + "description": "List packages", + "operationId": "get-fleet-epm-packages", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "in": "query", + "name": "category", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "prerelease", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "excludeInstallStatus", + "required": false, + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "items": { "items": { "additionalProperties": true, - "deprecated": true, "properties": { "categories": { "items": { @@ -20499,7 +19966,7 @@ { "in": "path", "name": "pkgVersion", - "required": true, + "required": false, "schema": { "type": "string" } @@ -20751,7 +20218,7 @@ { "in": "path", "name": "pkgVersion", - "required": true, + "required": false, "schema": { "type": "string" } @@ -22025,7 +21492,7 @@ { "in": "path", "name": "pkgVersion", - "required": true, + "required": false, "schema": { "type": "string" } @@ -22320,7 +21787,7 @@ { "in": "path", "name": "pkgVersion", - "required": true, + "required": false, "schema": { "type": "string" } @@ -23757,265 +23224,6 @@ ] } }, - "/api/fleet/epm/packages/{pkgkey}": { - "delete": { - "operationId": "delete-fleet-epm-packages-pkgkey", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "description": "A required header to protect against CSRF attacks", - "in": "header", - "name": "kbn-xsrf", - "required": true, - "schema": { - "example": "true", - "type": "string" - } - }, - { - "in": "path", - "name": "pkgkey", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "nullable": true, - "properties": { - "force": { - "type": "boolean" - } - }, - "required": [ - "force" - ], - "type": "object" - } - } - } - }, - "responses": {}, - "summary": "", - "tags": [] - }, - "get": { - "operationId": "get-fleet-epm-packages-pkgkey", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "in": "path", - "name": "pkgkey", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "ignoreUnverified", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "prerelease", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "full", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "withMetadata", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } - } - ], - "responses": {}, - "summary": "", - "tags": [] - }, - "post": { - "operationId": "post-fleet-epm-packages-pkgkey", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "description": "A required header to protect against CSRF attacks", - "in": "header", - "name": "kbn-xsrf", - "required": true, - "schema": { - "example": "true", - "type": "string" - } - }, - { - "in": "path", - "name": "pkgkey", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "prerelease", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "ignoreMappingUpdateErrors", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } - }, - { - "in": "query", - "name": "skipDataStreamRollover", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } - } - ], - "requestBody": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "nullable": true, - "properties": { - "force": { - "type": "boolean" - } - }, - "required": [ - "force" - ], - "type": "object" - } - } - } - }, - "responses": {}, - "summary": "", - "tags": [] - }, - "put": { - "operationId": "put-fleet-epm-packages-pkgkey", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "description": "A required header to protect against CSRF attacks", - "in": "header", - "name": "kbn-xsrf", - "required": true, - "schema": { - "example": "true", - "type": "string" - } - }, - { - "in": "path", - "name": "pkgkey", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "properties": { - "keepPoliciesUpToDate": { - "type": "boolean" - } - }, - "required": [ - "keepPoliciesUpToDate" - ], - "type": "object" - } - } - } - }, - "responses": {}, - "summary": "", - "tags": [] - } - }, "/api/fleet/epm/templates/{pkgName}/{pkgVersion}/inputs": { "get": { "description": "Get inputs template", diff --git a/oas_docs/bundle.serverless.json b/oas_docs/bundle.serverless.json index f171dadde991a..a3627b45d8686 100644 --- a/oas_docs/bundle.serverless.json +++ b/oas_docs/bundle.serverless.json @@ -17768,14 +17768,6 @@ "type": "boolean" } }, - { - "in": "query", - "name": "experimental", - "required": false, - "schema": { - "type": "boolean" - } - }, { "in": "query", "name": "include_policy_templates", @@ -17820,36 +17812,6 @@ "type": "object" }, "type": "array" - }, - "response": { - "items": { - "additionalProperties": false, - "deprecated": true, - "properties": { - "count": { - "type": "number" - }, - "id": { - "type": "string" - }, - "parent_id": { - "type": "string" - }, - "parent_title": { - "type": "string" - }, - "title": { - "type": "string" - } - }, - "required": [ - "id", - "title", - "count" - ], - "type": "object" - }, - "type": "array" } }, "required": [ @@ -18112,741 +18074,246 @@ "component_template", "ingest_pipeline", "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - } - ] - }, - "type": "array" - } - }, - "required": [ - "items", - "_meta" - ], - "type": "object" - } - } - } - }, - "400": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "description": "Generic Error", - "properties": { - "error": { - "type": "string" - }, - "message": { - "type": "string" - }, - "statusCode": { - "type": "number" - } - }, - "required": [ - "message" - ], - "type": "object" - } - } - } - } - }, - "summary": "", - "tags": [ - "Elastic Package Manager (EPM)" - ] - } - }, - "/api/fleet/epm/data_streams": { - "get": { - "description": "List data streams", - "operationId": "get-fleet-epm-data-streams", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "in": "query", - "name": "type", - "required": false, - "schema": { - "enum": [ - "logs", - "metrics", - "traces", - "synthetics", - "profiling" - ], - "type": "string" - } - }, - { - "in": "query", - "name": "datasetQuery", - "required": false, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "sortOrder", - "required": false, - "schema": { - "default": "asc", - "enum": [ - "asc", - "desc" - ], - "type": "string" - } - }, - { - "in": "query", - "name": "uncategorisedOnly", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } - } - ], - "responses": { - "200": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "properties": { - "items": { - "items": { - "additionalProperties": false, - "properties": { - "name": { - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - } - }, - "required": [ - "items" - ], - "type": "object" - } - } - } - }, - "400": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "description": "Generic Error", - "properties": { - "error": { - "type": "string" - }, - "message": { - "type": "string" - }, - "statusCode": { - "type": "number" - } - }, - "required": [ - "message" - ], - "type": "object" - } - } - } - } - }, - "summary": "", - "tags": [ - "Data streams" - ] - } - }, - "/api/fleet/epm/packages": { - "get": { - "description": "List packages", - "operationId": "get-fleet-epm-packages", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "in": "query", - "name": "category", - "required": false, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "prerelease", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "experimental", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "excludeInstallStatus", - "required": false, - "schema": { - "type": "boolean" - } - } - ], - "responses": { - "200": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "properties": { - "items": { - "items": { - "additionalProperties": true, - "properties": { - "categories": { - "items": { - "type": "string" - }, - "type": "array" - }, - "conditions": { - "additionalProperties": true, - "properties": { - "elastic": { - "additionalProperties": true, - "properties": { - "capabilities": { - "items": { - "type": "string" - }, - "type": "array" - }, - "subscription": { - "type": "string" - } - }, - "type": "object" - }, - "kibana": { - "additionalProperties": true, - "properties": { - "version": { - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "data_streams": { - "items": { - "additionalProperties": {}, - "type": "object" - }, - "type": "array" - }, - "description": { - "type": "string" - }, - "discovery": { - "additionalProperties": true, - "properties": { - "fields": { - "items": { - "additionalProperties": true, - "properties": { - "name": { - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "download": { - "type": "string" - }, - "format_version": { - "type": "string" - }, - "icons": { - "items": { - "additionalProperties": true, - "properties": { - "dark_mode": { - "type": "boolean" - }, - "path": { - "type": "string" - }, - "size": { - "type": "string" - }, - "src": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "required": [ - "src" - ], - "type": "object" - }, - "type": "array" - }, - "id": { - "type": "string" - }, - "installationInfo": { - "additionalProperties": true, - "properties": { - "additional_spaces_installed_kibana": { - "additionalProperties": { - "items": { - "additionalProperties": true, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - "type": "array" - }, - "type": "object" - }, - "created_at": { - "type": "string" - }, - "experimental_data_stream_features": { - "items": { - "additionalProperties": true, - "properties": { - "data_stream": { - "type": "string" - }, - "features": { - "additionalProperties": true, - "properties": { - "doc_value_only_numeric": { - "type": "boolean" - }, - "doc_value_only_other": { - "type": "boolean" - }, - "synthetic_source": { - "type": "boolean" - }, - "tsdb": { - "type": "boolean" - } - }, - "type": "object" - } - }, - "required": [ - "data_stream", - "features" - ], - "type": "object" - }, - "type": "array" - }, - "install_format_schema_version": { - "type": "string" - }, - "install_source": { - "enum": [ - "registry", - "upload", - "bundled", - "custom" - ], - "type": "string" - }, - "install_status": { - "enum": [ - "installed", - "installing", - "install_failed" - ], - "type": "string" - }, - "installed_es": { - "items": { - "additionalProperties": true, - "properties": { - "deferred": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "type": { - "enum": [ - "index", - "index_template", - "component_template", - "ingest_pipeline", - "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - "type": "array" - }, - "installed_kibana": { - "items": { - "additionalProperties": true, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - "type": "array" - }, - "installed_kibana_space_id": { - "type": "string" - }, - "latest_executed_state": { - "additionalProperties": true, - "properties": { - "error": { - "type": "string" - }, - "name": { - "type": "string" - }, - "started_at": { - "type": "string" - } - }, - "required": [ - "name", - "started_at" - ], - "type": "object" - }, - "latest_install_failed_attempts": { - "items": { - "additionalProperties": true, - "properties": { - "created_at": { - "type": "string" - }, - "error": { - "additionalProperties": true, - "properties": { - "message": { - "type": "string" - }, - "name": { - "type": "string" - }, - "stack": { - "type": "string" - } - }, - "required": [ - "name", - "message" - ], - "type": "object" - }, - "target_version": { - "type": "string" - } - }, - "required": [ - "created_at", - "target_version", - "error" - ], - "type": "object" - }, - "type": "array" - }, - "name": { - "type": "string" - }, - "namespaces": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type": { - "type": "string" - }, - "updated_at": { - "type": "string" - }, - "verification_key_id": { - "nullable": true, - "type": "string" - }, - "verification_status": { - "enum": [ - "unverified", - "verified", - "unknown" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "type", - "installed_kibana", - "installed_es", - "name", - "version", - "install_status", - "install_source", - "verification_status" - ], - "type": "object" - }, - "integration": { - "type": "string" - }, - "internal": { - "type": "boolean" - }, - "latestVersion": { - "type": "string" - }, - "name": { - "type": "string" - }, - "owner": { - "additionalProperties": true, - "properties": { - "github": { - "type": "string" - }, - "type": { - "enum": [ - "elastic", - "partner", - "community" - ], - "type": "string" - } - }, - "type": "object" - }, - "path": { - "type": "string" - }, - "policy_templates": { - "items": { - "additionalProperties": {}, - "type": "object" - }, - "type": "array" - }, - "readme": { - "type": "string" - }, - "release": { - "enum": [ - "ga", - "beta", - "experimental" - ], - "type": "string" - }, - "savedObject": {}, - "signature_path": { - "type": "string" - }, - "source": { - "additionalProperties": true, - "properties": { - "license": { + "data_stream_ilm_policy", + "transform", + "ml_model" + ], + "type": "string" + }, + "version": { "type": "string" } }, "required": [ - "license" + "id", + "type" ], "type": "object" - }, - "status": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "enum": [ - "integration", - "input", - "content" - ], - "type": "string" - }, - "vars": { - "items": { - "additionalProperties": {}, - "type": "object" - }, - "type": "array" - }, - "version": { + } + ] + }, + "type": "array" + } + }, + "required": [ + "items", + "_meta" + ], + "type": "object" + } + } + } + }, + "400": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "description": "Generic Error", + "properties": { + "error": { + "type": "string" + }, + "message": { + "type": "string" + }, + "statusCode": { + "type": "number" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "summary": "", + "tags": [ + "Elastic Package Manager (EPM)" + ] + } + }, + "/api/fleet/epm/data_streams": { + "get": { + "description": "List data streams", + "operationId": "get-fleet-epm-data-streams", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "in": "query", + "name": "type", + "required": false, + "schema": { + "enum": [ + "logs", + "metrics", + "traces", + "synthetics", + "profiling" + ], + "type": "string" + } + }, + { + "in": "query", + "name": "datasetQuery", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "sortOrder", + "required": false, + "schema": { + "default": "asc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "in": "query", + "name": "uncategorisedOnly", + "required": false, + "schema": { + "default": false, + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "items": { + "items": { + "additionalProperties": false, + "properties": { + "name": { "type": "string" } }, "required": [ - "savedObject", - "name", - "version", - "title", - "id" + "name" ], "type": "object" }, "type": "array" + } + }, + "required": [ + "items" + ], + "type": "object" + } + } + } + }, + "400": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "description": "Generic Error", + "properties": { + "error": { + "type": "string" }, - "response": { + "message": { + "type": "string" + }, + "statusCode": { + "type": "number" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "summary": "", + "tags": [ + "Data streams" + ] + } + }, + "/api/fleet/epm/packages": { + "get": { + "description": "List packages", + "operationId": "get-fleet-epm-packages", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "in": "query", + "name": "category", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "prerelease", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "excludeInstallStatus", + "required": false, + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "items": { "items": { "additionalProperties": true, - "deprecated": true, "properties": { "categories": { "items": { @@ -20499,7 +19966,7 @@ { "in": "path", "name": "pkgVersion", - "required": true, + "required": false, "schema": { "type": "string" } @@ -20751,7 +20218,7 @@ { "in": "path", "name": "pkgVersion", - "required": true, + "required": false, "schema": { "type": "string" } @@ -22025,7 +21492,7 @@ { "in": "path", "name": "pkgVersion", - "required": true, + "required": false, "schema": { "type": "string" } @@ -22320,7 +21787,7 @@ { "in": "path", "name": "pkgVersion", - "required": true, + "required": false, "schema": { "type": "string" } @@ -23757,265 +23224,6 @@ ] } }, - "/api/fleet/epm/packages/{pkgkey}": { - "delete": { - "operationId": "delete-fleet-epm-packages-pkgkey", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "description": "A required header to protect against CSRF attacks", - "in": "header", - "name": "kbn-xsrf", - "required": true, - "schema": { - "example": "true", - "type": "string" - } - }, - { - "in": "path", - "name": "pkgkey", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "nullable": true, - "properties": { - "force": { - "type": "boolean" - } - }, - "required": [ - "force" - ], - "type": "object" - } - } - } - }, - "responses": {}, - "summary": "", - "tags": [] - }, - "get": { - "operationId": "get-fleet-epm-packages-pkgkey", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "in": "path", - "name": "pkgkey", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "ignoreUnverified", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "prerelease", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "full", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "withMetadata", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } - } - ], - "responses": {}, - "summary": "", - "tags": [] - }, - "post": { - "operationId": "post-fleet-epm-packages-pkgkey", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "description": "A required header to protect against CSRF attacks", - "in": "header", - "name": "kbn-xsrf", - "required": true, - "schema": { - "example": "true", - "type": "string" - } - }, - { - "in": "path", - "name": "pkgkey", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "prerelease", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "ignoreMappingUpdateErrors", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } - }, - { - "in": "query", - "name": "skipDataStreamRollover", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } - } - ], - "requestBody": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "nullable": true, - "properties": { - "force": { - "type": "boolean" - } - }, - "required": [ - "force" - ], - "type": "object" - } - } - } - }, - "responses": {}, - "summary": "", - "tags": [] - }, - "put": { - "operationId": "put-fleet-epm-packages-pkgkey", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "description": "A required header to protect against CSRF attacks", - "in": "header", - "name": "kbn-xsrf", - "required": true, - "schema": { - "example": "true", - "type": "string" - } - }, - { - "in": "path", - "name": "pkgkey", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "properties": { - "keepPoliciesUpToDate": { - "type": "boolean" - } - }, - "required": [ - "keepPoliciesUpToDate" - ], - "type": "object" - } - } - } - }, - "responses": {}, - "summary": "", - "tags": [] - } - }, "/api/fleet/epm/templates/{pkgName}/{pkgVersion}/inputs": { "get": { "description": "Get inputs template", From a920902a650972419d73fc9b9ab9980ab80ad51d Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 1 Nov 2024 15:46:36 +0000 Subject: [PATCH 13/25] [CI] Auto-commit changed files from 'make api-docs' --- oas_docs/output/kibana.serverless.yaml | 717 +++---------------------- oas_docs/output/kibana.yaml | 717 +++---------------------- 2 files changed, 168 insertions(+), 1266 deletions(-) diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index afb7d8bbd5f4d..e782ad94cd142 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -18383,11 +18383,6 @@ paths: required: false schema: type: boolean - - in: query - name: experimental - required: false - schema: - type: boolean - in: query name: include_policy_templates required: false @@ -18421,27 +18416,6 @@ paths: - title - count type: array - response: - items: - additionalProperties: false - deprecated: true - type: object - properties: - count: - type: number - id: - type: string - parent_id: - type: string - parent_title: - type: string - title: - type: string - required: - - id - - title - - count - type: array required: - items '400': @@ -18695,444 +18669,92 @@ paths: default: asc enum: - asc - - desc - type: string - - in: query - name: uncategorisedOnly - required: false - schema: - default: false - type: boolean - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - type: object - properties: - items: - items: - additionalProperties: false - type: object - properties: - name: - type: string - required: - - name - type: array - required: - - items - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - description: Generic Error - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - required: - - message - summary: '' - tags: - - Data streams - /api/fleet/epm/packages: - get: - description: List packages - operationId: get-fleet-epm-packages - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - - in: query - name: category - required: false - schema: - type: string - - in: query - name: prerelease - required: false - schema: - type: boolean - - in: query - name: experimental - required: false - schema: - type: boolean - - in: query - name: excludeInstallStatus - required: false - schema: - type: boolean - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - type: object - properties: - items: - items: - additionalProperties: true - type: object - properties: - categories: - items: - type: string - type: array - conditions: - additionalProperties: true - type: object - properties: - elastic: - additionalProperties: true - type: object - properties: - capabilities: - items: - type: string - type: array - subscription: - type: string - kibana: - additionalProperties: true - type: object - properties: - version: - type: string - data_streams: - items: - additionalProperties: {} - type: object - type: array - description: - type: string - discovery: - additionalProperties: true - type: object - properties: - fields: - items: - additionalProperties: true - type: object - properties: - name: - type: string - required: - - name - type: array - download: - type: string - format_version: - type: string - icons: - items: - additionalProperties: true - type: object - properties: - dark_mode: - type: boolean - path: - type: string - size: - type: string - src: - type: string - title: - type: string - type: - type: string - required: - - src - type: array - id: - type: string - installationInfo: - additionalProperties: true - type: object - properties: - additional_spaces_installed_kibana: - additionalProperties: - items: - additionalProperties: true - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - type: array - type: object - created_at: - type: string - experimental_data_stream_features: - items: - additionalProperties: true - type: object - properties: - data_stream: - type: string - features: - additionalProperties: true - type: object - properties: - doc_value_only_numeric: - type: boolean - doc_value_only_other: - type: boolean - synthetic_source: - type: boolean - tsdb: - type: boolean - required: - - data_stream - - features - type: array - install_format_schema_version: - type: string - install_source: - enum: - - registry - - upload - - bundled - - custom - type: string - install_status: - enum: - - installed - - installing - - install_failed - type: string - installed_es: - items: - additionalProperties: true - type: object - properties: - deferred: - type: boolean - id: - type: string - type: - enum: - - index - - index_template - - component_template - - ingest_pipeline - - ilm_policy - - data_stream_ilm_policy - - transform - - ml_model - type: string - version: - type: string - required: - - id - - type - type: array - installed_kibana: - items: - additionalProperties: true - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - type: array - installed_kibana_space_id: - type: string - latest_executed_state: - additionalProperties: true - type: object - properties: - error: - type: string - name: - type: string - started_at: - type: string - required: - - name - - started_at - latest_install_failed_attempts: - items: - additionalProperties: true - type: object - properties: - created_at: - type: string - error: - additionalProperties: true - type: object - properties: - message: - type: string - name: - type: string - stack: - type: string - required: - - name - - message - target_version: - type: string - required: - - created_at - - target_version - - error - type: array - name: - type: string - namespaces: - items: - type: string - type: array - type: - type: string - updated_at: - type: string - verification_key_id: - nullable: true - type: string - verification_status: - enum: - - unverified - - verified - - unknown - type: string - version: - type: string - required: - - type - - installed_kibana - - installed_es - - name - - version - - install_status - - install_source - - verification_status - integration: - type: string - internal: - type: boolean - latestVersion: - type: string - name: - type: string - owner: - additionalProperties: true - type: object - properties: - github: - type: string - type: - enum: - - elastic - - partner - - community - type: string - path: - type: string - policy_templates: - items: - additionalProperties: {} - type: object - type: array - readme: - type: string - release: - enum: - - ga - - beta - - experimental - type: string - savedObject: {} - signature_path: - type: string - source: - additionalProperties: true - type: object - properties: - license: - type: string - required: - - license - status: - type: string - title: - type: string - type: - enum: - - integration - - input - - content - type: string - vars: - items: - additionalProperties: {} - type: object - type: array - version: + - desc + type: string + - in: query + name: uncategorisedOnly + required: false + schema: + default: false + type: boolean + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + type: object + properties: + items: + items: + additionalProperties: false + type: object + properties: + name: type: string required: - - savedObject - name - - version - - title - - id type: array - response: + required: + - items + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + description: Generic Error + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + required: + - message + summary: '' + tags: + - Data streams + /api/fleet/epm/packages: + get: + description: List packages + operationId: get-fleet-epm-packages + parameters: + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - in: query + name: category + required: false + schema: + type: string + - in: query + name: prerelease + required: false + schema: + type: boolean + - in: query + name: excludeInstallStatus + required: false + schema: + type: boolean + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + type: object + properties: + items: items: additionalProperties: true - deprecated: true type: object properties: categories: @@ -19960,177 +19582,6 @@ paths: summary: '' tags: - Elastic Package Manager (EPM) - /api/fleet/epm/packages/{pkgkey}: - delete: - operationId: delete-fleet-epm-packages-pkgkey - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - in: path - name: pkgkey - required: true - schema: - type: string - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - nullable: true - type: object - properties: - force: - type: boolean - required: - - force - responses: {} - summary: '' - tags: [] - get: - operationId: get-fleet-epm-packages-pkgkey - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - - in: path - name: pkgkey - required: true - schema: - type: string - - in: query - name: ignoreUnverified - required: false - schema: - type: boolean - - in: query - name: prerelease - required: false - schema: - type: boolean - - in: query - name: full - required: false - schema: - type: boolean - - in: query - name: withMetadata - required: false - schema: - default: false - type: boolean - responses: {} - summary: '' - tags: [] - post: - operationId: post-fleet-epm-packages-pkgkey - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - in: path - name: pkgkey - required: true - schema: - type: string - - in: query - name: prerelease - required: false - schema: - type: boolean - - in: query - name: ignoreMappingUpdateErrors - required: false - schema: - default: false - type: boolean - - in: query - name: skipDataStreamRollover - required: false - schema: - default: false - type: boolean - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - nullable: true - type: object - properties: - force: - type: boolean - required: - - force - responses: {} - summary: '' - tags: [] - put: - operationId: put-fleet-epm-packages-pkgkey - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - in: path - name: pkgkey - required: true - schema: - type: string - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - type: object - properties: - keepPoliciesUpToDate: - type: boolean - required: - - keepPoliciesUpToDate - responses: {} - summary: '' - tags: [] /api/fleet/epm/packages/{pkgName}/{pkgVersion}: delete: description: Delete package @@ -20158,7 +19609,7 @@ paths: type: string - in: path name: pkgVersion - required: true + required: false schema: type: string - in: query @@ -20331,7 +19782,7 @@ paths: type: string - in: path name: pkgVersion - required: true + required: false schema: type: string - in: query @@ -21223,7 +20674,7 @@ paths: type: string - in: path name: pkgVersion - required: true + required: false schema: type: string - in: query @@ -21426,7 +20877,7 @@ paths: type: string - in: path name: pkgVersion - required: true + required: false schema: type: string requestBody: diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index 5bbc65ad80bc4..3dc564913f3a4 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -21816,11 +21816,6 @@ paths: required: false schema: type: boolean - - in: query - name: experimental - required: false - schema: - type: boolean - in: query name: include_policy_templates required: false @@ -21854,27 +21849,6 @@ paths: - title - count type: array - response: - items: - additionalProperties: false - deprecated: true - type: object - properties: - count: - type: number - id: - type: string - parent_id: - type: string - parent_title: - type: string - title: - type: string - required: - - id - - title - - count - type: array required: - items '400': @@ -22128,444 +22102,92 @@ paths: default: asc enum: - asc - - desc - type: string - - in: query - name: uncategorisedOnly - required: false - schema: - default: false - type: boolean - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - type: object - properties: - items: - items: - additionalProperties: false - type: object - properties: - name: - type: string - required: - - name - type: array - required: - - items - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - description: Generic Error - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - required: - - message - summary: '' - tags: - - Data streams - /api/fleet/epm/packages: - get: - description: List packages - operationId: get-fleet-epm-packages - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - - in: query - name: category - required: false - schema: - type: string - - in: query - name: prerelease - required: false - schema: - type: boolean - - in: query - name: experimental - required: false - schema: - type: boolean - - in: query - name: excludeInstallStatus - required: false - schema: - type: boolean - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - type: object - properties: - items: - items: - additionalProperties: true - type: object - properties: - categories: - items: - type: string - type: array - conditions: - additionalProperties: true - type: object - properties: - elastic: - additionalProperties: true - type: object - properties: - capabilities: - items: - type: string - type: array - subscription: - type: string - kibana: - additionalProperties: true - type: object - properties: - version: - type: string - data_streams: - items: - additionalProperties: {} - type: object - type: array - description: - type: string - discovery: - additionalProperties: true - type: object - properties: - fields: - items: - additionalProperties: true - type: object - properties: - name: - type: string - required: - - name - type: array - download: - type: string - format_version: - type: string - icons: - items: - additionalProperties: true - type: object - properties: - dark_mode: - type: boolean - path: - type: string - size: - type: string - src: - type: string - title: - type: string - type: - type: string - required: - - src - type: array - id: - type: string - installationInfo: - additionalProperties: true - type: object - properties: - additional_spaces_installed_kibana: - additionalProperties: - items: - additionalProperties: true - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - type: array - type: object - created_at: - type: string - experimental_data_stream_features: - items: - additionalProperties: true - type: object - properties: - data_stream: - type: string - features: - additionalProperties: true - type: object - properties: - doc_value_only_numeric: - type: boolean - doc_value_only_other: - type: boolean - synthetic_source: - type: boolean - tsdb: - type: boolean - required: - - data_stream - - features - type: array - install_format_schema_version: - type: string - install_source: - enum: - - registry - - upload - - bundled - - custom - type: string - install_status: - enum: - - installed - - installing - - install_failed - type: string - installed_es: - items: - additionalProperties: true - type: object - properties: - deferred: - type: boolean - id: - type: string - type: - enum: - - index - - index_template - - component_template - - ingest_pipeline - - ilm_policy - - data_stream_ilm_policy - - transform - - ml_model - type: string - version: - type: string - required: - - id - - type - type: array - installed_kibana: - items: - additionalProperties: true - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - type: array - installed_kibana_space_id: - type: string - latest_executed_state: - additionalProperties: true - type: object - properties: - error: - type: string - name: - type: string - started_at: - type: string - required: - - name - - started_at - latest_install_failed_attempts: - items: - additionalProperties: true - type: object - properties: - created_at: - type: string - error: - additionalProperties: true - type: object - properties: - message: - type: string - name: - type: string - stack: - type: string - required: - - name - - message - target_version: - type: string - required: - - created_at - - target_version - - error - type: array - name: - type: string - namespaces: - items: - type: string - type: array - type: - type: string - updated_at: - type: string - verification_key_id: - nullable: true - type: string - verification_status: - enum: - - unverified - - verified - - unknown - type: string - version: - type: string - required: - - type - - installed_kibana - - installed_es - - name - - version - - install_status - - install_source - - verification_status - integration: - type: string - internal: - type: boolean - latestVersion: - type: string - name: - type: string - owner: - additionalProperties: true - type: object - properties: - github: - type: string - type: - enum: - - elastic - - partner - - community - type: string - path: - type: string - policy_templates: - items: - additionalProperties: {} - type: object - type: array - readme: - type: string - release: - enum: - - ga - - beta - - experimental - type: string - savedObject: {} - signature_path: - type: string - source: - additionalProperties: true - type: object - properties: - license: - type: string - required: - - license - status: - type: string - title: - type: string - type: - enum: - - integration - - input - - content - type: string - vars: - items: - additionalProperties: {} - type: object - type: array - version: + - desc + type: string + - in: query + name: uncategorisedOnly + required: false + schema: + default: false + type: boolean + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + type: object + properties: + items: + items: + additionalProperties: false + type: object + properties: + name: type: string required: - - savedObject - name - - version - - title - - id type: array - response: + required: + - items + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + description: Generic Error + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + required: + - message + summary: '' + tags: + - Data streams + /api/fleet/epm/packages: + get: + description: List packages + operationId: get-fleet-epm-packages + parameters: + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - in: query + name: category + required: false + schema: + type: string + - in: query + name: prerelease + required: false + schema: + type: boolean + - in: query + name: excludeInstallStatus + required: false + schema: + type: boolean + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + type: object + properties: + items: items: additionalProperties: true - deprecated: true type: object properties: categories: @@ -23393,177 +23015,6 @@ paths: summary: '' tags: - Elastic Package Manager (EPM) - /api/fleet/epm/packages/{pkgkey}: - delete: - operationId: delete-fleet-epm-packages-pkgkey - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - in: path - name: pkgkey - required: true - schema: - type: string - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - nullable: true - type: object - properties: - force: - type: boolean - required: - - force - responses: {} - summary: '' - tags: [] - get: - operationId: get-fleet-epm-packages-pkgkey - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - - in: path - name: pkgkey - required: true - schema: - type: string - - in: query - name: ignoreUnverified - required: false - schema: - type: boolean - - in: query - name: prerelease - required: false - schema: - type: boolean - - in: query - name: full - required: false - schema: - type: boolean - - in: query - name: withMetadata - required: false - schema: - default: false - type: boolean - responses: {} - summary: '' - tags: [] - post: - operationId: post-fleet-epm-packages-pkgkey - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - in: path - name: pkgkey - required: true - schema: - type: string - - in: query - name: prerelease - required: false - schema: - type: boolean - - in: query - name: ignoreMappingUpdateErrors - required: false - schema: - default: false - type: boolean - - in: query - name: skipDataStreamRollover - required: false - schema: - default: false - type: boolean - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - nullable: true - type: object - properties: - force: - type: boolean - required: - - force - responses: {} - summary: '' - tags: [] - put: - operationId: put-fleet-epm-packages-pkgkey - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - in: path - name: pkgkey - required: true - schema: - type: string - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - type: object - properties: - keepPoliciesUpToDate: - type: boolean - required: - - keepPoliciesUpToDate - responses: {} - summary: '' - tags: [] /api/fleet/epm/packages/{pkgName}/{pkgVersion}: delete: description: Delete package @@ -23591,7 +23042,7 @@ paths: type: string - in: path name: pkgVersion - required: true + required: false schema: type: string - in: query @@ -23764,7 +23215,7 @@ paths: type: string - in: path name: pkgVersion - required: true + required: false schema: type: string - in: query @@ -24656,7 +24107,7 @@ paths: type: string - in: path name: pkgVersion - required: true + required: false schema: type: string - in: query @@ -24859,7 +24310,7 @@ paths: type: string - in: path name: pkgVersion - required: true + required: false schema: type: string requestBody: From dc731192148072dc8d3760fecf3294228e4afcd7 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Fri, 1 Nov 2024 12:52:43 -0400 Subject: [PATCH 14/25] fix tests --- .../plugins/fleet/public/search_provider.test.ts | 14 +++++++------- .../test/fleet_api_integration/apis/fleet_setup.ts | 2 +- .../test/functional/services/ml/test_resources.ts | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/x-pack/plugins/fleet/public/search_provider.test.ts b/x-pack/plugins/fleet/public/search_provider.test.ts index 5f95eef60546c..68ba3042a8e76 100644 --- a/x-pack/plugins/fleet/public/search_provider.test.ts +++ b/x-pack/plugins/fleet/public/search_provider.test.ts @@ -133,7 +133,7 @@ describe('Package search provider', () => { test('returns formatted results', () => { getTestScheduler().run(({ expectObservable, hot }) => { mockSendGetPackages.mockReturnValue( - hot('--(a|)', { a: { data: { response: testResponse } } }) + hot('--(a|)', { a: { data: { items: testResponse } } }) ); setupMock.getStartServices.mockReturnValue( hot('--(a|)', { a: [coreMock.createStart()] }) as any @@ -217,7 +217,7 @@ describe('Package search provider', () => { test('calls EPR once only', () => { getTestScheduler().run(({ hot }) => { - mockSendGetPackages.mockReturnValue(hot('--(a|)', { a: { data: { response: [] } } })); + mockSendGetPackages.mockReturnValue(hot('--(a|)', { a: { data: { items: [] } } })); setupMock.getStartServices.mockReturnValue( hot('--(a|)', { a: [coreMock.createStart()] }) as any ); @@ -237,7 +237,7 @@ describe('Package search provider', () => { test('completes without returning results if aborted', () => { getTestScheduler().run(({ expectObservable, hot }) => { - mockSendGetPackages.mockReturnValue(hot('--(a|)', { a: { data: { response: [] } } })); + mockSendGetPackages.mockReturnValue(hot('--(a|)', { a: { data: { items: [] } } })); setupMock.getStartServices.mockReturnValue( hot('--(a|)', { a: [coreMock.createStart()] }) as any ); @@ -258,7 +258,7 @@ describe('Package search provider', () => { test('respect maximum results', () => { getTestScheduler().run(({ hot, expectObservable }) => { mockSendGetPackages.mockReturnValue( - hot('--(a|)', { a: { data: { response: testResponse } } }) + hot('--(a|)', { a: { data: { items: testResponse } } }) ); setupMock.getStartServices.mockReturnValue( hot('--(a|)', { a: [coreMock.createStart()] }) as any @@ -292,7 +292,7 @@ describe('Package search provider', () => { test('without packages tag, without search term', () => { getTestScheduler().run(({ hot, expectObservable }) => { mockSendGetPackages.mockReturnValue( - hot('--(a|)', { a: { data: { response: testResponse } } }) + hot('--(a|)', { a: { data: { items: testResponse } } }) ); setupMock.getStartServices.mockReturnValue( hot('--(a|)', { a: [coreMock.createStart()] }) as any @@ -314,7 +314,7 @@ describe('Package search provider', () => { test('with integration tag, with no search term', () => { getTestScheduler().run(({ hot, expectObservable }) => { mockSendGetPackages.mockReturnValue( - hot('--(a|)', { a: { data: { response: testResponse } } }) + hot('--(a|)', { a: { data: { items: testResponse } } }) ); setupMock.getStartServices.mockReturnValue( hot('--(a|)', { a: [coreMock.createStart()] }) as any @@ -397,7 +397,7 @@ describe('Package search provider', () => { test('with integration tag, with search term', () => { getTestScheduler().run(({ hot, expectObservable }) => { mockSendGetPackages.mockReturnValue( - hot('--(a|)', { a: { data: { response: testResponse } } }) + hot('--(a|)', { a: { data: { items: testResponse } } }) ); setupMock.getStartServices.mockReturnValue( hot('--(a|)', { a: [coreMock.createStart()] }) as any diff --git a/x-pack/test/fleet_api_integration/apis/fleet_setup.ts b/x-pack/test/fleet_api_integration/apis/fleet_setup.ts index ae196f13d9dc3..844ab3a82bcd8 100644 --- a/x-pack/test/fleet_api_integration/apis/fleet_setup.ts +++ b/x-pack/test/fleet_api_integration/apis/fleet_setup.ts @@ -61,7 +61,7 @@ export default function (providerContext: FtrProviderContext) { const { body: apiResponse } = await supertest .get(`/api/fleet/epm/packages?prerelease=true`) .expect(200); - const installedPackages = apiResponse.response + const installedPackages = apiResponse.items .filter((p: any) => p.status === 'installed') .map((p: any) => p.name) .sort(); diff --git a/x-pack/test/functional/services/ml/test_resources.ts b/x-pack/test/functional/services/ml/test_resources.ts index 5035b6844b9c3..17eb9830b0ebc 100644 --- a/x-pack/test/functional/services/ml/test_resources.ts +++ b/x-pack/test/functional/services/ml/test_resources.ts @@ -594,7 +594,7 @@ export function MachineLearningTestResourcesProvider( await retry.tryForTime(10 * 1000, async () => { const { body, status } = await supertest - .get(`/api/fleet/epm/packages?experimental=true`) + .get(`/api/fleet/epm/packages?prerelease=true`) .set(getCommonRequestHeader(`${API_VERSIONS.public.v1}`)); mlApi.assertResponseStatusCode(200, status, body); From b5d439cf7ea98f33daaa212e29c12d4a98a3d0d7 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Fri, 1 Nov 2024 14:16:12 -0400 Subject: [PATCH 15/25] remove more deprecated response body --- .../plugins/fleet/common/types/models/epm.ts | 1 - .../fleet/common/types/rest_spec/epm.ts | 20 --------- .../fleet/cypress.config.space_awareness.d.ts | 3 ++ .../fleet/cypress.config.space_awareness.js | 42 +++++++++++++++++++ .../fleet/server/routes/epm/handlers.ts | 8 +--- .../fleet/server/routes/epm/index.test.ts | 11 ----- .../fleet/server/types/rest_spec/epm.ts | 9 ---- .../functional/services/ml/test_resources.ts | 2 +- 8 files changed, 48 insertions(+), 48 deletions(-) create mode 100644 x-pack/plugins/fleet/cypress.config.space_awareness.d.ts create mode 100644 x-pack/plugins/fleet/cypress.config.space_awareness.js diff --git a/x-pack/plugins/fleet/common/types/models/epm.ts b/x-pack/plugins/fleet/common/types/models/epm.ts index 3aa65dc3adcd4..4a0a8307586ec 100644 --- a/x-pack/plugins/fleet/common/types/models/epm.ts +++ b/x-pack/plugins/fleet/common/types/models/epm.ts @@ -532,7 +532,6 @@ export type PackageListItem = Installable & { id: string; integration?: string; installationInfo?: InstallationInfo; - savedObject?: InstallableSavedObject; }; export type PackagesGroupedByStatus = Record, PackageList>; export type PackageInfo = diff --git a/x-pack/plugins/fleet/common/types/rest_spec/epm.ts b/x-pack/plugins/fleet/common/types/rest_spec/epm.ts index 39ea9f6c7ea69..68c09eeb5e9dc 100644 --- a/x-pack/plugins/fleet/common/types/rest_spec/epm.ts +++ b/x-pack/plugins/fleet/common/types/rest_spec/epm.ts @@ -71,8 +71,6 @@ export interface GetEpmDataStreamsResponse { } export interface GetLimitedPackagesResponse { items: string[]; - // deprecated in 8.0 - response?: string[]; } export interface GetFileRequest { @@ -85,8 +83,6 @@ export interface GetFileRequest { export interface GetInfoRequest { params: { - // deprecated in 8.0 - pkgkey?: string; pkgName: string; pkgVersion: string; }; @@ -95,14 +91,10 @@ export interface GetInfoRequest { export interface GetInfoResponse { item: PackageInfo; metadata?: PackageMetadata; - // deprecated in 8.0 - response?: PackageInfo; } export interface UpdatePackageRequest { params: { - // deprecated in 8.0 - pkgkey?: string; pkgName: string; pkgVersion: string; }; @@ -113,8 +105,6 @@ export interface UpdatePackageRequest { export interface UpdatePackageResponse { item: PackageInfo; - // deprecated in 8.0 - response?: PackageInfo; } export interface GetStatsRequest { @@ -129,8 +119,6 @@ export interface GetStatsResponse { export interface InstallPackageRequest { params: { - // deprecated in 8.0 - pkgkey?: string; pkgName: string; pkgVersion: string; }; @@ -141,8 +129,6 @@ export interface InstallPackageResponse { _meta: { install_source: InstallSource; }; - // deprecated in 8.0 - response?: AssetReference[]; } export interface IBulkInstallPackageHTTPError { @@ -167,8 +153,6 @@ export interface BulkInstallPackageInfo { export interface BulkInstallPackagesResponse { items: Array; - // deprecated in 8.0 - response?: Array; } export interface BulkInstallPackagesRequest { @@ -183,8 +167,6 @@ export interface MessageResponse { export interface DeletePackageRequest { params: { - // deprecated in 8.0 - pkgkey?: string; pkgName: string; pkgVersion: string; }; @@ -194,8 +176,6 @@ export interface DeletePackageRequest { } export interface DeletePackageResponse { - // deprecated in 8.0 - response?: AssetReference[]; items: AssetReference[]; } export interface GetVerificationKeyIdResponse { diff --git a/x-pack/plugins/fleet/cypress.config.space_awareness.d.ts b/x-pack/plugins/fleet/cypress.config.space_awareness.d.ts new file mode 100644 index 0000000000000..42cd75f66e3c9 --- /dev/null +++ b/x-pack/plugins/fleet/cypress.config.space_awareness.d.ts @@ -0,0 +1,3 @@ +/// +declare const _default: Cypress.ConfigOptions; +export default _default; diff --git a/x-pack/plugins/fleet/cypress.config.space_awareness.js b/x-pack/plugins/fleet/cypress.config.space_awareness.js new file mode 100644 index 0000000000000..af73ef0134420 --- /dev/null +++ b/x-pack/plugins/fleet/cypress.config.space_awareness.js @@ -0,0 +1,42 @@ +"use strict"; +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +const cypress_config_1 = require("@kbn/cypress-config"); +// eslint-disable-next-line import/no-default-export +exports.default = (0, cypress_config_1.defineCypressConfig)({ + defaultCommandTimeout: 60000, + requestTimeout: 60000, + responseTimeout: 60000, + execTimeout: 120000, + pageLoadTimeout: 120000, + retries: { + runMode: 2, + }, + env: { + grepFilterSpecs: false, + }, + screenshotsFolder: '../../../target/kibana-fleet/cypress/screenshots', + trashAssetsBeforeRuns: false, + video: false, + videosFolder: '../../../target/kibana-fleet/cypress/videos', + viewportHeight: 900, + viewportWidth: 1440, + screenshotOnRunFailure: true, + e2e: { + baseUrl: 'http://localhost:5601', + experimentalRunAllSpecs: true, + experimentalMemoryManagement: true, + numTestsKeptInMemory: 3, + specPattern: './cypress/e2e/space_awareness/**/*.cy.ts', + supportFile: './cypress/support/e2e.ts', + setupNodeEvents(on, config) { + // eslint-disable-next-line @typescript-eslint/no-var-requires, @kbn/imports/no_boundary_crossing + return require('./cypress/plugins')(on, config); + }, + }, +}); diff --git a/x-pack/plugins/fleet/server/routes/epm/handlers.ts b/x-pack/plugins/fleet/server/routes/epm/handlers.ts index faf0498d95310..c708bd2fd5e0c 100644 --- a/x-pack/plugins/fleet/server/routes/epm/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/epm/handlers.ts @@ -9,7 +9,7 @@ import type { TypeOf } from '@kbn/config-schema'; import semverValid from 'semver/functions/valid'; import type { HttpResponseOptions } from '@kbn/core/server'; -import { pick } from 'lodash'; +import { omit, pick } from 'lodash'; import { PACKAGE_POLICY_SAVED_OBJECT_TYPE } from '../../../common'; @@ -197,7 +197,6 @@ export const getLimitedListHandler: FleetRequestHandler< }); const body: GetLimitedPackagesResponse = { items: res, - response: res, }; return response.ok({ body, @@ -458,7 +457,6 @@ export const bulkInstallPackagesFromRegistryHandler: FleetRequestHandler< const payload = bulkInstalledResponses.map(bulkInstallServiceResponseToHttpEntry); const body: BulkInstallPackagesResponse = { items: payload, - response: payload, }; return response.ok({ body }); }; @@ -492,7 +490,6 @@ export const installPackageByUploadHandler: FleetRequestHandler< if (!res.error) { const body: InstallPackageResponse = { items: res.assets || [], - response: res.assets || [], _meta: { install_source: res.installSource ?? installSource, }, @@ -674,8 +671,7 @@ const soToInstallationInfo = (pkg: PackageListItem | PackageInfo) => { }; return { - // When savedObject gets removed, replace `pkg` with `...omit(pkg, 'savedObject')` - ...pkg, + ...omit(pkg, 'savedObject'), installationInfo, }; } diff --git a/x-pack/plugins/fleet/server/routes/epm/index.test.ts b/x-pack/plugins/fleet/server/routes/epm/index.test.ts index 32cd7751fb8fa..d736cb7c318ba 100644 --- a/x-pack/plugins/fleet/server/routes/epm/index.test.ts +++ b/x-pack/plugins/fleet/server/routes/epm/index.test.ts @@ -442,7 +442,6 @@ describe('schema validation', () => { it('get limited packages should return valid response', async () => { const expectedResponse: GetLimitedPackagesResponse = { items: ['test'], - response: ['test'], }; (getLimitedListHandler as jest.Mock).mockImplementation((ctx, request, res) => { return res.ok({ body: expectedResponse }); @@ -511,7 +510,6 @@ describe('schema validation', () => { metadata: { has_policies: true, }, - response: packageInfo, }; (getInfoHandler as jest.Mock).mockImplementation((ctx, request, res) => { return res.ok({ body: expectedResponse }); @@ -528,7 +526,6 @@ describe('schema validation', () => { it('update package should return valid response', async () => { const expectedResponse: UpdatePackageResponse = { item: packageInfo, - response: packageInfo, }; (updatePackageHandler as jest.Mock).mockImplementation((ctx, request, res) => { return res.ok({ body: expectedResponse }); @@ -554,13 +551,6 @@ describe('schema validation', () => { _meta: { install_source: 'registry', }, - response: [ - { - id: 'test', - type: KibanaSavedObjectType.dashboard, - originId: 'test', - }, - ], }; (installPackageFromRegistryHandler as jest.Mock).mockImplementation((ctx, request, res) => { return res.ok({ body: expectedResponse }); @@ -610,7 +600,6 @@ describe('schema validation', () => { }; const expectedResponse: BulkInstallPackagesResponse = { items: [item, { name: 'test', statusCode: 400, error: 'test' }], - response: [item], }; (bulkInstallPackagesFromRegistryHandler as jest.Mock).mockImplementation( (ctx, request, res) => { diff --git a/x-pack/plugins/fleet/server/types/rest_spec/epm.ts b/x-pack/plugins/fleet/server/types/rest_spec/epm.ts index 7d2954a1eb48a..cf7eb832d38de 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/epm.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/epm.ts @@ -137,7 +137,6 @@ const PackageIconSchema = schema.object({ export const PackageInfoSchema = schema .object({ status: schema.maybe(schema.string()), - savedObject: schema.maybe(schema.any({ meta: { deprecated: true } })), installationInfo: schema.maybe(InstallationInfoSchema), name: schema.string(), version: schema.string(), @@ -246,7 +245,6 @@ export const GetInstalledPackagesResponseSchema = schema.object({ export const GetLimitedPackagesResponseSchema = schema.object({ items: schema.arrayOf(schema.string()), - response: schema.maybe(schema.arrayOf(schema.string(), { meta: { deprecated: true } })), }); export const GetStatsResponseSchema = schema.object({ @@ -319,12 +317,10 @@ export const GetPackageInfoSchema = PackageInfoSchema.extends({ export const GetInfoResponseSchema = schema.object({ item: GetPackageInfoSchema, metadata: schema.maybe(PackageMetadataSchema), - response: schema.maybe(GetPackageInfoSchema.extends({}, { meta: { deprecated: true } })), }); export const UpdatePackageResponseSchema = schema.object({ item: GetPackageInfoSchema, - response: schema.maybe(GetPackageInfoSchema.extends({}, { meta: { deprecated: true } })), }); export const AssetReferenceSchema = schema.oneOf([ @@ -337,7 +333,6 @@ export const InstallPackageResponseSchema = schema.object({ _meta: schema.object({ install_source: schema.string(), }), - response: schema.maybe(schema.arrayOf(AssetReferenceSchema, { meta: { deprecated: true } })), }); export const InstallKibanaAssetsResponseSchema = schema.object({ @@ -367,14 +362,10 @@ export const BulkInstallPackagesResponseItemSchema = schema.oneOf([ export const BulkInstallPackagesFromRegistryResponseSchema = schema.object({ items: schema.arrayOf(BulkInstallPackagesResponseItemSchema), - response: schema.maybe( - schema.arrayOf(BulkInstallPackagesResponseItemSchema, { meta: { deprecated: true } }) - ), }); export const DeletePackageResponseSchema = schema.object({ items: schema.arrayOf(AssetReferenceSchema), - response: schema.maybe(schema.arrayOf(AssetReferenceSchema, { meta: { deprecated: true } })), }); export const GetVerificationKeyIdResponseSchema = schema.object({ diff --git a/x-pack/test/functional/services/ml/test_resources.ts b/x-pack/test/functional/services/ml/test_resources.ts index 17eb9830b0ebc..915060b152f24 100644 --- a/x-pack/test/functional/services/ml/test_resources.ts +++ b/x-pack/test/functional/services/ml/test_resources.ts @@ -599,7 +599,7 @@ export function MachineLearningTestResourcesProvider( mlApi.assertResponseStatusCode(200, status, body); packageVersion = - body.response.find( + body.items.find( ({ name, version }: { name: string; version: string }) => name === packageName && version )?.version ?? ''; From c0206e0b8f04a7138679137eb1a02088691ab30f Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Fri, 1 Nov 2024 14:33:47 -0400 Subject: [PATCH 16/25] fix typo --- .../fleet/cypress.config.space_awareness.d.ts | 3 -- .../fleet/cypress.config.space_awareness.js | 42 ------------------- 2 files changed, 45 deletions(-) delete mode 100644 x-pack/plugins/fleet/cypress.config.space_awareness.d.ts delete mode 100644 x-pack/plugins/fleet/cypress.config.space_awareness.js diff --git a/x-pack/plugins/fleet/cypress.config.space_awareness.d.ts b/x-pack/plugins/fleet/cypress.config.space_awareness.d.ts deleted file mode 100644 index 42cd75f66e3c9..0000000000000 --- a/x-pack/plugins/fleet/cypress.config.space_awareness.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/// -declare const _default: Cypress.ConfigOptions; -export default _default; diff --git a/x-pack/plugins/fleet/cypress.config.space_awareness.js b/x-pack/plugins/fleet/cypress.config.space_awareness.js deleted file mode 100644 index af73ef0134420..0000000000000 --- a/x-pack/plugins/fleet/cypress.config.space_awareness.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -const cypress_config_1 = require("@kbn/cypress-config"); -// eslint-disable-next-line import/no-default-export -exports.default = (0, cypress_config_1.defineCypressConfig)({ - defaultCommandTimeout: 60000, - requestTimeout: 60000, - responseTimeout: 60000, - execTimeout: 120000, - pageLoadTimeout: 120000, - retries: { - runMode: 2, - }, - env: { - grepFilterSpecs: false, - }, - screenshotsFolder: '../../../target/kibana-fleet/cypress/screenshots', - trashAssetsBeforeRuns: false, - video: false, - videosFolder: '../../../target/kibana-fleet/cypress/videos', - viewportHeight: 900, - viewportWidth: 1440, - screenshotOnRunFailure: true, - e2e: { - baseUrl: 'http://localhost:5601', - experimentalRunAllSpecs: true, - experimentalMemoryManagement: true, - numTestsKeptInMemory: 3, - specPattern: './cypress/e2e/space_awareness/**/*.cy.ts', - supportFile: './cypress/support/e2e.ts', - setupNodeEvents(on, config) { - // eslint-disable-next-line @typescript-eslint/no-var-requires, @kbn/imports/no_boundary_crossing - return require('./cypress/plugins')(on, config); - }, - }, -}); From 4e0771c72f879d59fd15d2624320f69a9fee8f2f Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Fri, 1 Nov 2024 15:44:42 -0400 Subject: [PATCH 17/25] remove body for delete package apis --- x-pack/plugins/fleet/server/routes/epm/handlers.ts | 3 +-- x-pack/plugins/fleet/server/types/rest_spec/epm.ts | 6 ------ .../api/get_all_integrations/extract_integrations.ts | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/x-pack/plugins/fleet/server/routes/epm/handlers.ts b/x-pack/plugins/fleet/server/routes/epm/handlers.ts index c708bd2fd5e0c..1fcd0e26a6ef0 100644 --- a/x-pack/plugins/fleet/server/routes/epm/handlers.ts +++ b/x-pack/plugins/fleet/server/routes/epm/handlers.ts @@ -514,8 +514,7 @@ export const installPackageByUploadHandler: FleetRequestHandler< export const deletePackageHandler: FleetRequestHandler< TypeOf, - TypeOf, - TypeOf + TypeOf > = async (context, request, response) => { try { const { pkgName, pkgVersion } = request.params; diff --git a/x-pack/plugins/fleet/server/types/rest_spec/epm.ts b/x-pack/plugins/fleet/server/types/rest_spec/epm.ts index cf7eb832d38de..827ffb2404a1b 100644 --- a/x-pack/plugins/fleet/server/types/rest_spec/epm.ts +++ b/x-pack/plugins/fleet/server/types/rest_spec/epm.ts @@ -579,12 +579,6 @@ export const DeletePackageRequestSchema = { query: schema.object({ force: schema.maybe(schema.boolean()), }), - // body is deprecated on delete request - body: schema.nullable( - schema.object({ - force: schema.boolean(), - }) - ), }; export const InstallKibanaAssetsRequestSchema = { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.ts index 065d307fe1f76..7f42e13b9bd22 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.ts @@ -21,7 +21,7 @@ export function extractIntegrations( const packageTitle = fleetPackage.title; const isPackageInstalled = fleetPackage.status === 'installed'; // Actual `installed_version` is buried in SO, root `version` is latest package version available - const installedPackageVersion = fleetPackage.savedObject?.attributes.install_version; + const installedPackageVersion = fleetPackage.installationInfo?.version; // Policy templates correspond to package's integrations. const packagePolicyTemplates = fleetPackage.policy_templates ?? []; From 87c54b3b6070cefeea0aa4aebf165f244f2e9730 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 1 Nov 2024 20:20:20 +0000 Subject: [PATCH 18/25] [CI] Auto-commit changed files from 'node scripts/capture_oas_snapshot --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/fleet --update' --- oas_docs/bundle.json | 2270 +++++-------------------------- oas_docs/bundle.serverless.json | 2270 +++++-------------------------- 2 files changed, 660 insertions(+), 3880 deletions(-) diff --git a/oas_docs/bundle.json b/oas_docs/bundle.json index 0b2d7d5a38557..46666eb5903b0 100644 --- a/oas_docs/bundle.json +++ b/oas_docs/bundle.json @@ -18020,79 +18020,6 @@ ] }, "type": "array" - }, - "response": { - "deprecated": true, - "items": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "deferred": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "type": { - "enum": [ - "index", - "index_template", - "component_template", - "ingest_pipeline", - "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - } - ] - }, - "type": "array" } }, "required": [ @@ -18745,7 +18672,6 @@ ], "type": "string" }, - "savedObject": {}, "signature_path": { "type": "string" }, @@ -18787,7 +18713,6 @@ } }, "required": [ - "savedObject", "name", "version", "title", @@ -18982,79 +18907,6 @@ ] }, "type": "array" - }, - "response": { - "deprecated": true, - "items": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "deferred": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "type": { - "enum": [ - "index", - "index_template", - "component_template", - "ingest_pipeline", - "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - } - ] - }, - "type": "array" } }, "required": [ @@ -19334,171 +19186,25 @@ ] }, "type": "array" - }, - "response": { - "deprecated": true, - "items": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "name": { - "type": "string" - }, - "result": { - "additionalProperties": false, - "properties": { - "assets": { - "items": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "deferred": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "type": { - "enum": [ - "index", - "index_template", - "component_template", - "ingest_pipeline", - "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - } - ] - }, - "type": "array" - }, - "error": {}, - "installSource": { - "type": "string" - }, - "installType": { - "type": "string" - }, - "status": { - "enum": [ - "installed", - "already_installed" - ], - "type": "string" - } - }, - "required": [ - "error", - "installType" - ], - "type": "object" - }, - "version": { - "type": "string" - } - }, - "required": [ - "name", - "version", - "result" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "error": { - "anyOf": [ - { - "type": "string" - }, - {} - ] - }, - "name": { - "type": "string" - }, - "statusCode": { - "type": "number" - } - }, - "required": [ - "name", - "statusCode", - "error" - ], - "type": "object" - } - ] - }, - "type": "array" - } - }, - "required": [ - "items" - ], - "type": "object" - } - } - } - }, - "400": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "description": "Generic Error", - "properties": { - "error": { - "type": "string" + } + }, + "required": [ + "items" + ], + "type": "object" + } + } + } + }, + "400": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "description": "Generic Error", + "properties": { + "error": { + "type": "string" }, "message": { "type": "string" @@ -19793,13 +19499,6 @@ "type": "string" }, "type": "array" - }, - "response": { - "deprecated": true, - "items": { - "type": "string" - }, - "type": "array" } }, "required": [ @@ -19980,25 +19679,6 @@ } } ], - "requestBody": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "nullable": true, - "properties": { - "force": { - "type": "boolean" - } - }, - "required": [ - "force" - ], - "type": "object" - } - } - } - }, "responses": { "200": { "content": { @@ -20077,79 +19757,6 @@ ] }, "type": "array" - }, - "response": { - "deprecated": true, - "items": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "deferred": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "type": { - "enum": [ - "index", - "index_template", - "component_template", - "ingest_pipeline", - "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - } - ] - }, - "type": "array" } }, "required": [ @@ -20753,7 +20360,6 @@ ], "type": "string" }, - "savedObject": {}, "screenshots": { "items": { "additionalProperties": false, @@ -20825,7 +20431,6 @@ } }, "required": [ - "savedObject", "name", "version", "title", @@ -20844,1552 +20449,339 @@ "has_policies" ], "type": "object" + } + }, + "required": [ + "item" + ], + "type": "object" + } + } + } + }, + "400": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "description": "Generic Error", + "properties": { + "error": { + "type": "string" }, - "response": { - "additionalProperties": true, - "deprecated": true, - "properties": { - "agent": { - "additionalProperties": false, - "properties": { - "privileges": { - "additionalProperties": false, - "properties": { - "root": { - "type": "boolean" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "asset_tags": { - "items": { - "additionalProperties": false, - "properties": { - "asset_ids": { - "items": { - "type": "string" - }, - "type": "array" - }, - "asset_types": { - "items": { - "type": "string" - }, - "type": "array" - }, - "text": { - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - }, - "type": "array" - }, - "assets": { - "additionalProperties": {}, - "type": "object" - }, - "categories": { - "items": { - "type": "string" - }, - "type": "array" - }, - "conditions": { - "additionalProperties": true, - "properties": { - "elastic": { - "additionalProperties": true, - "properties": { - "capabilities": { - "items": { - "type": "string" - }, - "type": "array" - }, - "subscription": { - "type": "string" - } - }, - "type": "object" - }, - "kibana": { - "additionalProperties": true, - "properties": { - "version": { - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "data_streams": { - "items": { - "additionalProperties": {}, - "type": "object" - }, - "type": "array" - }, - "description": { - "type": "string" - }, - "discovery": { - "additionalProperties": true, - "properties": { - "fields": { - "items": { - "additionalProperties": true, - "properties": { - "name": { - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "download": { - "type": "string" - }, - "elasticsearch": { - "additionalProperties": {}, - "type": "object" - }, - "format_version": { - "type": "string" - }, - "icons": { - "items": { - "additionalProperties": true, - "properties": { - "dark_mode": { - "type": "boolean" - }, - "path": { - "type": "string" - }, - "size": { - "type": "string" - }, - "src": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "required": [ - "src" - ], - "type": "object" - }, - "type": "array" - }, - "installationInfo": { - "additionalProperties": true, - "properties": { - "additional_spaces_installed_kibana": { - "additionalProperties": { - "items": { - "additionalProperties": true, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - "type": "array" - }, - "type": "object" - }, - "created_at": { - "type": "string" - }, - "experimental_data_stream_features": { - "items": { - "additionalProperties": true, - "properties": { - "data_stream": { - "type": "string" - }, - "features": { - "additionalProperties": true, - "properties": { - "doc_value_only_numeric": { - "type": "boolean" - }, - "doc_value_only_other": { - "type": "boolean" - }, - "synthetic_source": { - "type": "boolean" - }, - "tsdb": { - "type": "boolean" - } - }, - "type": "object" - } - }, - "required": [ - "data_stream", - "features" - ], - "type": "object" - }, - "type": "array" - }, - "install_format_schema_version": { - "type": "string" - }, - "install_source": { - "enum": [ - "registry", - "upload", - "bundled", - "custom" - ], - "type": "string" - }, - "install_status": { - "enum": [ - "installed", - "installing", - "install_failed" - ], - "type": "string" - }, - "installed_es": { - "items": { - "additionalProperties": true, - "properties": { - "deferred": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "type": { - "enum": [ - "index", - "index_template", - "component_template", - "ingest_pipeline", - "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - "type": "array" - }, - "installed_kibana": { - "items": { - "additionalProperties": true, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - "type": "array" - }, - "installed_kibana_space_id": { - "type": "string" - }, - "latest_executed_state": { - "additionalProperties": true, - "properties": { - "error": { - "type": "string" - }, - "name": { - "type": "string" - }, - "started_at": { - "type": "string" - } - }, - "required": [ - "name", - "started_at" - ], - "type": "object" - }, - "latest_install_failed_attempts": { - "items": { - "additionalProperties": true, - "properties": { - "created_at": { - "type": "string" - }, - "error": { - "additionalProperties": true, - "properties": { - "message": { - "type": "string" - }, - "name": { - "type": "string" - }, - "stack": { - "type": "string" - } - }, - "required": [ - "name", - "message" - ], - "type": "object" - }, - "target_version": { - "type": "string" - } - }, - "required": [ - "created_at", - "target_version", - "error" - ], - "type": "object" - }, - "type": "array" - }, - "name": { - "type": "string" - }, - "namespaces": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type": { - "type": "string" - }, - "updated_at": { - "type": "string" - }, - "verification_key_id": { - "nullable": true, - "type": "string" - }, - "verification_status": { - "enum": [ - "unverified", - "verified", - "unknown" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "type", - "installed_kibana", - "installed_es", - "name", - "version", - "install_status", - "install_source", - "verification_status" - ], - "type": "object" - }, - "internal": { - "type": "boolean" - }, - "keepPoliciesUpToDate": { - "type": "boolean" - }, - "latestVersion": { - "type": "string" - }, - "license": { - "type": "string" - }, - "licensePath": { - "type": "string" - }, - "name": { - "type": "string" - }, - "notice": { - "type": "string" - }, - "owner": { - "additionalProperties": true, - "properties": { - "github": { - "type": "string" - }, - "type": { - "enum": [ - "elastic", - "partner", - "community" - ], - "type": "string" - } - }, - "type": "object" - }, - "path": { - "type": "string" - }, - "policy_templates": { - "items": { - "additionalProperties": {}, - "type": "object" - }, - "type": "array" - }, - "readme": { - "type": "string" - }, - "release": { - "enum": [ - "ga", - "beta", - "experimental" - ], - "type": "string" - }, - "savedObject": {}, - "screenshots": { - "items": { - "additionalProperties": false, - "properties": { - "dark_mode": { - "type": "boolean" - }, - "path": { - "type": "string" - }, - "size": { - "type": "string" - }, - "src": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "required": [ - "src" - ], - "type": "object" - }, - "type": "array" - }, - "signature_path": { - "type": "string" - }, - "source": { - "additionalProperties": true, - "properties": { - "license": { - "type": "string" - } - }, - "required": [ - "license" - ], - "type": "object" - }, - "status": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "enum": [ - "integration", - "input", - "content" - ], - "type": "string" - }, - "vars": { - "items": { - "additionalProperties": {}, - "type": "object" - }, - "type": "array" - }, - "version": { - "type": "string" - } - }, - "required": [ - "savedObject", - "name", - "version", - "title", - "assets" - ], - "type": "object" - } - }, - "required": [ - "item" - ], - "type": "object" - } - } - } - }, - "400": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "description": "Generic Error", - "properties": { - "error": { - "type": "string" - }, - "message": { - "type": "string" - }, - "statusCode": { - "type": "number" - } - }, - "required": [ - "message" - ], - "type": "object" - } - } - } - } - }, - "summary": "", - "tags": [ - "Elastic Package Manager (EPM)" - ] - }, - "post": { - "description": "Install package from registry", - "operationId": "post-fleet-epm-packages-pkgname-pkgversion", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "description": "A required header to protect against CSRF attacks", - "in": "header", - "name": "kbn-xsrf", - "required": true, - "schema": { - "example": "true", - "type": "string" - } - }, - { - "in": "path", - "name": "pkgName", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "pkgVersion", - "required": false, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "prerelease", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "ignoreMappingUpdateErrors", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } - }, - { - "in": "query", - "name": "skipDataStreamRollover", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } - } - ], - "requestBody": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "nullable": true, - "properties": { - "force": { - "default": false, - "type": "boolean" - }, - "ignore_constraints": { - "default": false, - "type": "boolean" - } - }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "properties": { - "_meta": { - "additionalProperties": false, - "properties": { - "install_source": { - "type": "string" - } - }, - "required": [ - "install_source" - ], - "type": "object" - }, - "items": { - "items": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "deferred": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "type": { - "enum": [ - "index", - "index_template", - "component_template", - "ingest_pipeline", - "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - } - ] - }, - "type": "array" - }, - "response": { - "deprecated": true, - "items": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "deferred": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "type": { - "enum": [ - "index", - "index_template", - "component_template", - "ingest_pipeline", - "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - } - ] - }, - "type": "array" - } - }, - "required": [ - "items", - "_meta" - ], - "type": "object" - } - } - } - }, - "400": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "description": "Generic Error", - "properties": { - "error": { - "type": "string" - }, - "message": { - "type": "string" - }, - "statusCode": { - "type": "number" - } - }, - "required": [ - "message" - ], - "type": "object" - } - } - } - } - }, - "summary": "", - "tags": [ - "Elastic Package Manager (EPM)" - ] - }, - "put": { - "description": "Update package settings", - "operationId": "put-fleet-epm-packages-pkgname-pkgversion", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "description": "A required header to protect against CSRF attacks", - "in": "header", - "name": "kbn-xsrf", - "required": true, - "schema": { - "example": "true", - "type": "string" - } - }, - { - "in": "path", - "name": "pkgName", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "pkgVersion", - "required": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "properties": { - "keepPoliciesUpToDate": { - "type": "boolean" - } - }, - "required": [ - "keepPoliciesUpToDate" - ], - "type": "object" - } - } - } - }, - "responses": { - "200": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "properties": { - "item": { - "additionalProperties": true, - "properties": { - "agent": { - "additionalProperties": false, - "properties": { - "privileges": { - "additionalProperties": false, - "properties": { - "root": { - "type": "boolean" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "asset_tags": { - "items": { - "additionalProperties": false, - "properties": { - "asset_ids": { - "items": { - "type": "string" - }, - "type": "array" - }, - "asset_types": { - "items": { - "type": "string" - }, - "type": "array" - }, - "text": { - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - }, - "type": "array" - }, - "assets": { - "additionalProperties": {}, - "type": "object" - }, - "categories": { - "items": { - "type": "string" - }, - "type": "array" - }, - "conditions": { - "additionalProperties": true, - "properties": { - "elastic": { - "additionalProperties": true, - "properties": { - "capabilities": { - "items": { - "type": "string" - }, - "type": "array" - }, - "subscription": { - "type": "string" - } - }, - "type": "object" - }, - "kibana": { - "additionalProperties": true, - "properties": { - "version": { - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "data_streams": { - "items": { - "additionalProperties": {}, - "type": "object" - }, - "type": "array" - }, - "description": { - "type": "string" - }, - "discovery": { - "additionalProperties": true, - "properties": { - "fields": { - "items": { - "additionalProperties": true, - "properties": { - "name": { - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "download": { - "type": "string" - }, - "elasticsearch": { - "additionalProperties": {}, - "type": "object" - }, - "format_version": { - "type": "string" - }, - "icons": { - "items": { - "additionalProperties": true, - "properties": { - "dark_mode": { - "type": "boolean" - }, - "path": { - "type": "string" - }, - "size": { - "type": "string" - }, - "src": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "required": [ - "src" - ], - "type": "object" - }, - "type": "array" - }, - "installationInfo": { - "additionalProperties": true, - "properties": { - "additional_spaces_installed_kibana": { - "additionalProperties": { - "items": { - "additionalProperties": true, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - "type": "array" - }, - "type": "object" - }, - "created_at": { - "type": "string" - }, - "experimental_data_stream_features": { - "items": { - "additionalProperties": true, - "properties": { - "data_stream": { - "type": "string" - }, - "features": { - "additionalProperties": true, - "properties": { - "doc_value_only_numeric": { - "type": "boolean" - }, - "doc_value_only_other": { - "type": "boolean" - }, - "synthetic_source": { - "type": "boolean" - }, - "tsdb": { - "type": "boolean" - } - }, - "type": "object" - } - }, - "required": [ - "data_stream", - "features" - ], - "type": "object" - }, - "type": "array" - }, - "install_format_schema_version": { - "type": "string" - }, - "install_source": { - "enum": [ - "registry", - "upload", - "bundled", - "custom" - ], - "type": "string" - }, - "install_status": { - "enum": [ - "installed", - "installing", - "install_failed" - ], - "type": "string" - }, - "installed_es": { - "items": { - "additionalProperties": true, - "properties": { - "deferred": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "type": { - "enum": [ - "index", - "index_template", - "component_template", - "ingest_pipeline", - "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - "type": "array" - }, - "installed_kibana": { - "items": { - "additionalProperties": true, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - "type": "array" - }, - "installed_kibana_space_id": { - "type": "string" - }, - "latest_executed_state": { - "additionalProperties": true, - "properties": { - "error": { - "type": "string" - }, - "name": { - "type": "string" - }, - "started_at": { - "type": "string" - } - }, - "required": [ - "name", - "started_at" - ], - "type": "object" - }, - "latest_install_failed_attempts": { - "items": { - "additionalProperties": true, - "properties": { - "created_at": { - "type": "string" - }, - "error": { - "additionalProperties": true, - "properties": { - "message": { - "type": "string" - }, - "name": { - "type": "string" - }, - "stack": { - "type": "string" - } - }, - "required": [ - "name", - "message" - ], - "type": "object" - }, - "target_version": { - "type": "string" - } - }, - "required": [ - "created_at", - "target_version", - "error" - ], - "type": "object" - }, - "type": "array" - }, - "name": { - "type": "string" - }, - "namespaces": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type": { - "type": "string" - }, - "updated_at": { - "type": "string" - }, - "verification_key_id": { - "nullable": true, - "type": "string" - }, - "verification_status": { - "enum": [ - "unverified", - "verified", - "unknown" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "type", - "installed_kibana", - "installed_es", - "name", - "version", - "install_status", - "install_source", - "verification_status" - ], - "type": "object" - }, - "internal": { - "type": "boolean" - }, - "keepPoliciesUpToDate": { - "type": "boolean" - }, - "latestVersion": { - "type": "string" - }, - "license": { - "type": "string" - }, - "licensePath": { - "type": "string" - }, - "name": { - "type": "string" - }, - "notice": { - "type": "string" - }, - "owner": { - "additionalProperties": true, - "properties": { - "github": { - "type": "string" - }, - "type": { - "enum": [ - "elastic", - "partner", - "community" - ], - "type": "string" - } - }, - "type": "object" - }, - "path": { - "type": "string" - }, - "policy_templates": { - "items": { - "additionalProperties": {}, - "type": "object" - }, - "type": "array" - }, - "readme": { - "type": "string" - }, - "release": { - "enum": [ - "ga", - "beta", - "experimental" - ], + "message": { + "type": "string" + }, + "statusCode": { + "type": "number" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "summary": "", + "tags": [ + "Elastic Package Manager (EPM)" + ] + }, + "post": { + "description": "Install package from registry", + "operationId": "post-fleet-epm-packages-pkgname-pkgversion", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "in": "path", + "name": "pkgName", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "pkgVersion", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "prerelease", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "ignoreMappingUpdateErrors", + "required": false, + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "in": "query", + "name": "skipDataStreamRollover", + "required": false, + "schema": { + "default": false, + "type": "boolean" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "nullable": true, + "properties": { + "force": { + "default": false, + "type": "boolean" + }, + "ignore_constraints": { + "default": false, + "type": "boolean" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "_meta": { + "additionalProperties": false, + "properties": { + "install_source": { "type": "string" - }, - "savedObject": {}, - "screenshots": { - "items": { + } + }, + "required": [ + "install_source" + ], + "type": "object" + }, + "items": { + "items": { + "anyOf": [ + { "additionalProperties": false, "properties": { - "dark_mode": { - "type": "boolean" - }, - "path": { + "id": { "type": "string" }, - "size": { + "originId": { "type": "string" }, - "src": { + "type": { + "enum": [ + "dashboard", + "lens", + "visualization", + "search", + "index-pattern", + "map", + "ml-module", + "security-rule", + "csp-rule-template", + "osquery-pack-asset", + "osquery-saved-query", + "tag" + ], "type": "string" + } + }, + "required": [ + "id", + "type" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "deferred": { + "type": "boolean" }, - "title": { + "id": { "type": "string" }, "type": { + "enum": [ + "index", + "index_template", + "component_template", + "ingest_pipeline", + "ilm_policy", + "data_stream_ilm_policy", + "transform", + "ml_model" + ], + "type": "string" + }, + "version": { "type": "string" } }, "required": [ - "src" + "id", + "type" ], "type": "object" - }, - "type": "array" - }, - "signature_path": { - "type": "string" - }, - "source": { - "additionalProperties": true, - "properties": { - "license": { - "type": "string" - } - }, - "required": [ - "license" - ], - "type": "object" - }, - "status": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "enum": [ - "integration", - "input", - "content" - ], - "type": "string" - }, - "vars": { - "items": { - "additionalProperties": {}, - "type": "object" - }, - "type": "array" - }, - "version": { - "type": "string" - } + } + ] }, - "required": [ - "savedObject", - "name", - "version", - "title", - "assets" - ], - "type": "object" + "type": "array" + } + }, + "required": [ + "items", + "_meta" + ], + "type": "object" + } + } + } + }, + "400": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "description": "Generic Error", + "properties": { + "error": { + "type": "string" }, - "response": { + "message": { + "type": "string" + }, + "statusCode": { + "type": "number" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "summary": "", + "tags": [ + "Elastic Package Manager (EPM)" + ] + }, + "put": { + "description": "Update package settings", + "operationId": "put-fleet-epm-packages-pkgname-pkgversion", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "in": "path", + "name": "pkgName", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "pkgVersion", + "required": false, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "keepPoliciesUpToDate": { + "type": "boolean" + } + }, + "required": [ + "keepPoliciesUpToDate" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "item": { "additionalProperties": true, - "deprecated": true, "properties": { "agent": { "additionalProperties": false, @@ -22877,7 +21269,6 @@ ], "type": "string" }, - "savedObject": {}, "screenshots": { "items": { "additionalProperties": false, @@ -22949,7 +21340,6 @@ } }, "required": [ - "savedObject", "name", "version", "title", diff --git a/oas_docs/bundle.serverless.json b/oas_docs/bundle.serverless.json index a3627b45d8686..a3ec12e034cc8 100644 --- a/oas_docs/bundle.serverless.json +++ b/oas_docs/bundle.serverless.json @@ -18020,79 +18020,6 @@ ] }, "type": "array" - }, - "response": { - "deprecated": true, - "items": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "deferred": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "type": { - "enum": [ - "index", - "index_template", - "component_template", - "ingest_pipeline", - "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - } - ] - }, - "type": "array" } }, "required": [ @@ -18745,7 +18672,6 @@ ], "type": "string" }, - "savedObject": {}, "signature_path": { "type": "string" }, @@ -18787,7 +18713,6 @@ } }, "required": [ - "savedObject", "name", "version", "title", @@ -18982,79 +18907,6 @@ ] }, "type": "array" - }, - "response": { - "deprecated": true, - "items": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "deferred": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "type": { - "enum": [ - "index", - "index_template", - "component_template", - "ingest_pipeline", - "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - } - ] - }, - "type": "array" } }, "required": [ @@ -19334,171 +19186,25 @@ ] }, "type": "array" - }, - "response": { - "deprecated": true, - "items": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "name": { - "type": "string" - }, - "result": { - "additionalProperties": false, - "properties": { - "assets": { - "items": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "deferred": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "type": { - "enum": [ - "index", - "index_template", - "component_template", - "ingest_pipeline", - "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - } - ] - }, - "type": "array" - }, - "error": {}, - "installSource": { - "type": "string" - }, - "installType": { - "type": "string" - }, - "status": { - "enum": [ - "installed", - "already_installed" - ], - "type": "string" - } - }, - "required": [ - "error", - "installType" - ], - "type": "object" - }, - "version": { - "type": "string" - } - }, - "required": [ - "name", - "version", - "result" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "error": { - "anyOf": [ - { - "type": "string" - }, - {} - ] - }, - "name": { - "type": "string" - }, - "statusCode": { - "type": "number" - } - }, - "required": [ - "name", - "statusCode", - "error" - ], - "type": "object" - } - ] - }, - "type": "array" - } - }, - "required": [ - "items" - ], - "type": "object" - } - } - } - }, - "400": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "description": "Generic Error", - "properties": { - "error": { - "type": "string" + } + }, + "required": [ + "items" + ], + "type": "object" + } + } + } + }, + "400": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "description": "Generic Error", + "properties": { + "error": { + "type": "string" }, "message": { "type": "string" @@ -19793,13 +19499,6 @@ "type": "string" }, "type": "array" - }, - "response": { - "deprecated": true, - "items": { - "type": "string" - }, - "type": "array" } }, "required": [ @@ -19980,25 +19679,6 @@ } } ], - "requestBody": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "nullable": true, - "properties": { - "force": { - "type": "boolean" - } - }, - "required": [ - "force" - ], - "type": "object" - } - } - } - }, "responses": { "200": { "content": { @@ -20077,79 +19757,6 @@ ] }, "type": "array" - }, - "response": { - "deprecated": true, - "items": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "deferred": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "type": { - "enum": [ - "index", - "index_template", - "component_template", - "ingest_pipeline", - "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - } - ] - }, - "type": "array" } }, "required": [ @@ -20753,7 +20360,6 @@ ], "type": "string" }, - "savedObject": {}, "screenshots": { "items": { "additionalProperties": false, @@ -20825,7 +20431,6 @@ } }, "required": [ - "savedObject", "name", "version", "title", @@ -20844,1552 +20449,339 @@ "has_policies" ], "type": "object" + } + }, + "required": [ + "item" + ], + "type": "object" + } + } + } + }, + "400": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "description": "Generic Error", + "properties": { + "error": { + "type": "string" }, - "response": { - "additionalProperties": true, - "deprecated": true, - "properties": { - "agent": { - "additionalProperties": false, - "properties": { - "privileges": { - "additionalProperties": false, - "properties": { - "root": { - "type": "boolean" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "asset_tags": { - "items": { - "additionalProperties": false, - "properties": { - "asset_ids": { - "items": { - "type": "string" - }, - "type": "array" - }, - "asset_types": { - "items": { - "type": "string" - }, - "type": "array" - }, - "text": { - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - }, - "type": "array" - }, - "assets": { - "additionalProperties": {}, - "type": "object" - }, - "categories": { - "items": { - "type": "string" - }, - "type": "array" - }, - "conditions": { - "additionalProperties": true, - "properties": { - "elastic": { - "additionalProperties": true, - "properties": { - "capabilities": { - "items": { - "type": "string" - }, - "type": "array" - }, - "subscription": { - "type": "string" - } - }, - "type": "object" - }, - "kibana": { - "additionalProperties": true, - "properties": { - "version": { - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "data_streams": { - "items": { - "additionalProperties": {}, - "type": "object" - }, - "type": "array" - }, - "description": { - "type": "string" - }, - "discovery": { - "additionalProperties": true, - "properties": { - "fields": { - "items": { - "additionalProperties": true, - "properties": { - "name": { - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "download": { - "type": "string" - }, - "elasticsearch": { - "additionalProperties": {}, - "type": "object" - }, - "format_version": { - "type": "string" - }, - "icons": { - "items": { - "additionalProperties": true, - "properties": { - "dark_mode": { - "type": "boolean" - }, - "path": { - "type": "string" - }, - "size": { - "type": "string" - }, - "src": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "required": [ - "src" - ], - "type": "object" - }, - "type": "array" - }, - "installationInfo": { - "additionalProperties": true, - "properties": { - "additional_spaces_installed_kibana": { - "additionalProperties": { - "items": { - "additionalProperties": true, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - "type": "array" - }, - "type": "object" - }, - "created_at": { - "type": "string" - }, - "experimental_data_stream_features": { - "items": { - "additionalProperties": true, - "properties": { - "data_stream": { - "type": "string" - }, - "features": { - "additionalProperties": true, - "properties": { - "doc_value_only_numeric": { - "type": "boolean" - }, - "doc_value_only_other": { - "type": "boolean" - }, - "synthetic_source": { - "type": "boolean" - }, - "tsdb": { - "type": "boolean" - } - }, - "type": "object" - } - }, - "required": [ - "data_stream", - "features" - ], - "type": "object" - }, - "type": "array" - }, - "install_format_schema_version": { - "type": "string" - }, - "install_source": { - "enum": [ - "registry", - "upload", - "bundled", - "custom" - ], - "type": "string" - }, - "install_status": { - "enum": [ - "installed", - "installing", - "install_failed" - ], - "type": "string" - }, - "installed_es": { - "items": { - "additionalProperties": true, - "properties": { - "deferred": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "type": { - "enum": [ - "index", - "index_template", - "component_template", - "ingest_pipeline", - "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - "type": "array" - }, - "installed_kibana": { - "items": { - "additionalProperties": true, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - "type": "array" - }, - "installed_kibana_space_id": { - "type": "string" - }, - "latest_executed_state": { - "additionalProperties": true, - "properties": { - "error": { - "type": "string" - }, - "name": { - "type": "string" - }, - "started_at": { - "type": "string" - } - }, - "required": [ - "name", - "started_at" - ], - "type": "object" - }, - "latest_install_failed_attempts": { - "items": { - "additionalProperties": true, - "properties": { - "created_at": { - "type": "string" - }, - "error": { - "additionalProperties": true, - "properties": { - "message": { - "type": "string" - }, - "name": { - "type": "string" - }, - "stack": { - "type": "string" - } - }, - "required": [ - "name", - "message" - ], - "type": "object" - }, - "target_version": { - "type": "string" - } - }, - "required": [ - "created_at", - "target_version", - "error" - ], - "type": "object" - }, - "type": "array" - }, - "name": { - "type": "string" - }, - "namespaces": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type": { - "type": "string" - }, - "updated_at": { - "type": "string" - }, - "verification_key_id": { - "nullable": true, - "type": "string" - }, - "verification_status": { - "enum": [ - "unverified", - "verified", - "unknown" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "type", - "installed_kibana", - "installed_es", - "name", - "version", - "install_status", - "install_source", - "verification_status" - ], - "type": "object" - }, - "internal": { - "type": "boolean" - }, - "keepPoliciesUpToDate": { - "type": "boolean" - }, - "latestVersion": { - "type": "string" - }, - "license": { - "type": "string" - }, - "licensePath": { - "type": "string" - }, - "name": { - "type": "string" - }, - "notice": { - "type": "string" - }, - "owner": { - "additionalProperties": true, - "properties": { - "github": { - "type": "string" - }, - "type": { - "enum": [ - "elastic", - "partner", - "community" - ], - "type": "string" - } - }, - "type": "object" - }, - "path": { - "type": "string" - }, - "policy_templates": { - "items": { - "additionalProperties": {}, - "type": "object" - }, - "type": "array" - }, - "readme": { - "type": "string" - }, - "release": { - "enum": [ - "ga", - "beta", - "experimental" - ], - "type": "string" - }, - "savedObject": {}, - "screenshots": { - "items": { - "additionalProperties": false, - "properties": { - "dark_mode": { - "type": "boolean" - }, - "path": { - "type": "string" - }, - "size": { - "type": "string" - }, - "src": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "required": [ - "src" - ], - "type": "object" - }, - "type": "array" - }, - "signature_path": { - "type": "string" - }, - "source": { - "additionalProperties": true, - "properties": { - "license": { - "type": "string" - } - }, - "required": [ - "license" - ], - "type": "object" - }, - "status": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "enum": [ - "integration", - "input", - "content" - ], - "type": "string" - }, - "vars": { - "items": { - "additionalProperties": {}, - "type": "object" - }, - "type": "array" - }, - "version": { - "type": "string" - } - }, - "required": [ - "savedObject", - "name", - "version", - "title", - "assets" - ], - "type": "object" - } - }, - "required": [ - "item" - ], - "type": "object" - } - } - } - }, - "400": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "description": "Generic Error", - "properties": { - "error": { - "type": "string" - }, - "message": { - "type": "string" - }, - "statusCode": { - "type": "number" - } - }, - "required": [ - "message" - ], - "type": "object" - } - } - } - } - }, - "summary": "", - "tags": [ - "Elastic Package Manager (EPM)" - ] - }, - "post": { - "description": "Install package from registry", - "operationId": "post-fleet-epm-packages-pkgname-pkgversion", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "description": "A required header to protect against CSRF attacks", - "in": "header", - "name": "kbn-xsrf", - "required": true, - "schema": { - "example": "true", - "type": "string" - } - }, - { - "in": "path", - "name": "pkgName", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "pkgVersion", - "required": false, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "prerelease", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "in": "query", - "name": "ignoreMappingUpdateErrors", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } - }, - { - "in": "query", - "name": "skipDataStreamRollover", - "required": false, - "schema": { - "default": false, - "type": "boolean" - } - } - ], - "requestBody": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "nullable": true, - "properties": { - "force": { - "default": false, - "type": "boolean" - }, - "ignore_constraints": { - "default": false, - "type": "boolean" - } - }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "properties": { - "_meta": { - "additionalProperties": false, - "properties": { - "install_source": { - "type": "string" - } - }, - "required": [ - "install_source" - ], - "type": "object" - }, - "items": { - "items": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "deferred": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "type": { - "enum": [ - "index", - "index_template", - "component_template", - "ingest_pipeline", - "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - } - ] - }, - "type": "array" - }, - "response": { - "deprecated": true, - "items": { - "anyOf": [ - { - "additionalProperties": false, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - { - "additionalProperties": false, - "properties": { - "deferred": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "type": { - "enum": [ - "index", - "index_template", - "component_template", - "ingest_pipeline", - "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - } - ] - }, - "type": "array" - } - }, - "required": [ - "items", - "_meta" - ], - "type": "object" - } - } - } - }, - "400": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "description": "Generic Error", - "properties": { - "error": { - "type": "string" - }, - "message": { - "type": "string" - }, - "statusCode": { - "type": "number" - } - }, - "required": [ - "message" - ], - "type": "object" - } - } - } - } - }, - "summary": "", - "tags": [ - "Elastic Package Manager (EPM)" - ] - }, - "put": { - "description": "Update package settings", - "operationId": "put-fleet-epm-packages-pkgname-pkgversion", - "parameters": [ - { - "description": "The version of the API to use", - "in": "header", - "name": "elastic-api-version", - "schema": { - "default": "2023-10-31", - "enum": [ - "2023-10-31" - ], - "type": "string" - } - }, - { - "description": "A required header to protect against CSRF attacks", - "in": "header", - "name": "kbn-xsrf", - "required": true, - "schema": { - "example": "true", - "type": "string" - } - }, - { - "in": "path", - "name": "pkgName", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "pkgVersion", - "required": false, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "properties": { - "keepPoliciesUpToDate": { - "type": "boolean" - } - }, - "required": [ - "keepPoliciesUpToDate" - ], - "type": "object" - } - } - } - }, - "responses": { - "200": { - "content": { - "application/json; Elastic-Api-Version=2023-10-31": { - "schema": { - "additionalProperties": false, - "properties": { - "item": { - "additionalProperties": true, - "properties": { - "agent": { - "additionalProperties": false, - "properties": { - "privileges": { - "additionalProperties": false, - "properties": { - "root": { - "type": "boolean" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "asset_tags": { - "items": { - "additionalProperties": false, - "properties": { - "asset_ids": { - "items": { - "type": "string" - }, - "type": "array" - }, - "asset_types": { - "items": { - "type": "string" - }, - "type": "array" - }, - "text": { - "type": "string" - } - }, - "required": [ - "text" - ], - "type": "object" - }, - "type": "array" - }, - "assets": { - "additionalProperties": {}, - "type": "object" - }, - "categories": { - "items": { - "type": "string" - }, - "type": "array" - }, - "conditions": { - "additionalProperties": true, - "properties": { - "elastic": { - "additionalProperties": true, - "properties": { - "capabilities": { - "items": { - "type": "string" - }, - "type": "array" - }, - "subscription": { - "type": "string" - } - }, - "type": "object" - }, - "kibana": { - "additionalProperties": true, - "properties": { - "version": { - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "data_streams": { - "items": { - "additionalProperties": {}, - "type": "object" - }, - "type": "array" - }, - "description": { - "type": "string" - }, - "discovery": { - "additionalProperties": true, - "properties": { - "fields": { - "items": { - "additionalProperties": true, - "properties": { - "name": { - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "download": { - "type": "string" - }, - "elasticsearch": { - "additionalProperties": {}, - "type": "object" - }, - "format_version": { - "type": "string" - }, - "icons": { - "items": { - "additionalProperties": true, - "properties": { - "dark_mode": { - "type": "boolean" - }, - "path": { - "type": "string" - }, - "size": { - "type": "string" - }, - "src": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "required": [ - "src" - ], - "type": "object" - }, - "type": "array" - }, - "installationInfo": { - "additionalProperties": true, - "properties": { - "additional_spaces_installed_kibana": { - "additionalProperties": { - "items": { - "additionalProperties": true, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - "type": "array" - }, - "type": "object" - }, - "created_at": { - "type": "string" - }, - "experimental_data_stream_features": { - "items": { - "additionalProperties": true, - "properties": { - "data_stream": { - "type": "string" - }, - "features": { - "additionalProperties": true, - "properties": { - "doc_value_only_numeric": { - "type": "boolean" - }, - "doc_value_only_other": { - "type": "boolean" - }, - "synthetic_source": { - "type": "boolean" - }, - "tsdb": { - "type": "boolean" - } - }, - "type": "object" - } - }, - "required": [ - "data_stream", - "features" - ], - "type": "object" - }, - "type": "array" - }, - "install_format_schema_version": { - "type": "string" - }, - "install_source": { - "enum": [ - "registry", - "upload", - "bundled", - "custom" - ], - "type": "string" - }, - "install_status": { - "enum": [ - "installed", - "installing", - "install_failed" - ], - "type": "string" - }, - "installed_es": { - "items": { - "additionalProperties": true, - "properties": { - "deferred": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "type": { - "enum": [ - "index", - "index_template", - "component_template", - "ingest_pipeline", - "ilm_policy", - "data_stream_ilm_policy", - "transform", - "ml_model" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - "type": "array" - }, - "installed_kibana": { - "items": { - "additionalProperties": true, - "properties": { - "id": { - "type": "string" - }, - "originId": { - "type": "string" - }, - "type": { - "enum": [ - "dashboard", - "lens", - "visualization", - "search", - "index-pattern", - "map", - "ml-module", - "security-rule", - "csp-rule-template", - "osquery-pack-asset", - "osquery-saved-query", - "tag" - ], - "type": "string" - } - }, - "required": [ - "id", - "type" - ], - "type": "object" - }, - "type": "array" - }, - "installed_kibana_space_id": { - "type": "string" - }, - "latest_executed_state": { - "additionalProperties": true, - "properties": { - "error": { - "type": "string" - }, - "name": { - "type": "string" - }, - "started_at": { - "type": "string" - } - }, - "required": [ - "name", - "started_at" - ], - "type": "object" - }, - "latest_install_failed_attempts": { - "items": { - "additionalProperties": true, - "properties": { - "created_at": { - "type": "string" - }, - "error": { - "additionalProperties": true, - "properties": { - "message": { - "type": "string" - }, - "name": { - "type": "string" - }, - "stack": { - "type": "string" - } - }, - "required": [ - "name", - "message" - ], - "type": "object" - }, - "target_version": { - "type": "string" - } - }, - "required": [ - "created_at", - "target_version", - "error" - ], - "type": "object" - }, - "type": "array" - }, - "name": { - "type": "string" - }, - "namespaces": { - "items": { - "type": "string" - }, - "type": "array" - }, - "type": { - "type": "string" - }, - "updated_at": { - "type": "string" - }, - "verification_key_id": { - "nullable": true, - "type": "string" - }, - "verification_status": { - "enum": [ - "unverified", - "verified", - "unknown" - ], - "type": "string" - }, - "version": { - "type": "string" - } - }, - "required": [ - "type", - "installed_kibana", - "installed_es", - "name", - "version", - "install_status", - "install_source", - "verification_status" - ], - "type": "object" - }, - "internal": { - "type": "boolean" - }, - "keepPoliciesUpToDate": { - "type": "boolean" - }, - "latestVersion": { - "type": "string" - }, - "license": { - "type": "string" - }, - "licensePath": { - "type": "string" - }, - "name": { - "type": "string" - }, - "notice": { - "type": "string" - }, - "owner": { - "additionalProperties": true, - "properties": { - "github": { - "type": "string" - }, - "type": { - "enum": [ - "elastic", - "partner", - "community" - ], - "type": "string" - } - }, - "type": "object" - }, - "path": { - "type": "string" - }, - "policy_templates": { - "items": { - "additionalProperties": {}, - "type": "object" - }, - "type": "array" - }, - "readme": { - "type": "string" - }, - "release": { - "enum": [ - "ga", - "beta", - "experimental" - ], + "message": { + "type": "string" + }, + "statusCode": { + "type": "number" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "summary": "", + "tags": [ + "Elastic Package Manager (EPM)" + ] + }, + "post": { + "description": "Install package from registry", + "operationId": "post-fleet-epm-packages-pkgname-pkgversion", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "in": "path", + "name": "pkgName", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "pkgVersion", + "required": false, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "prerelease", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "ignoreMappingUpdateErrors", + "required": false, + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "in": "query", + "name": "skipDataStreamRollover", + "required": false, + "schema": { + "default": false, + "type": "boolean" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "nullable": true, + "properties": { + "force": { + "default": false, + "type": "boolean" + }, + "ignore_constraints": { + "default": false, + "type": "boolean" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "_meta": { + "additionalProperties": false, + "properties": { + "install_source": { "type": "string" - }, - "savedObject": {}, - "screenshots": { - "items": { + } + }, + "required": [ + "install_source" + ], + "type": "object" + }, + "items": { + "items": { + "anyOf": [ + { "additionalProperties": false, "properties": { - "dark_mode": { - "type": "boolean" - }, - "path": { + "id": { "type": "string" }, - "size": { + "originId": { "type": "string" }, - "src": { + "type": { + "enum": [ + "dashboard", + "lens", + "visualization", + "search", + "index-pattern", + "map", + "ml-module", + "security-rule", + "csp-rule-template", + "osquery-pack-asset", + "osquery-saved-query", + "tag" + ], "type": "string" + } + }, + "required": [ + "id", + "type" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "deferred": { + "type": "boolean" }, - "title": { + "id": { "type": "string" }, "type": { + "enum": [ + "index", + "index_template", + "component_template", + "ingest_pipeline", + "ilm_policy", + "data_stream_ilm_policy", + "transform", + "ml_model" + ], + "type": "string" + }, + "version": { "type": "string" } }, "required": [ - "src" + "id", + "type" ], "type": "object" - }, - "type": "array" - }, - "signature_path": { - "type": "string" - }, - "source": { - "additionalProperties": true, - "properties": { - "license": { - "type": "string" - } - }, - "required": [ - "license" - ], - "type": "object" - }, - "status": { - "type": "string" - }, - "title": { - "type": "string" - }, - "type": { - "enum": [ - "integration", - "input", - "content" - ], - "type": "string" - }, - "vars": { - "items": { - "additionalProperties": {}, - "type": "object" - }, - "type": "array" - }, - "version": { - "type": "string" - } + } + ] }, - "required": [ - "savedObject", - "name", - "version", - "title", - "assets" - ], - "type": "object" + "type": "array" + } + }, + "required": [ + "items", + "_meta" + ], + "type": "object" + } + } + } + }, + "400": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "description": "Generic Error", + "properties": { + "error": { + "type": "string" }, - "response": { + "message": { + "type": "string" + }, + "statusCode": { + "type": "number" + } + }, + "required": [ + "message" + ], + "type": "object" + } + } + } + } + }, + "summary": "", + "tags": [ + "Elastic Package Manager (EPM)" + ] + }, + "put": { + "description": "Update package settings", + "operationId": "put-fleet-epm-packages-pkgname-pkgversion", + "parameters": [ + { + "description": "The version of the API to use", + "in": "header", + "name": "elastic-api-version", + "schema": { + "default": "2023-10-31", + "enum": [ + "2023-10-31" + ], + "type": "string" + } + }, + { + "description": "A required header to protect against CSRF attacks", + "in": "header", + "name": "kbn-xsrf", + "required": true, + "schema": { + "example": "true", + "type": "string" + } + }, + { + "in": "path", + "name": "pkgName", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "pkgVersion", + "required": false, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "keepPoliciesUpToDate": { + "type": "boolean" + } + }, + "required": [ + "keepPoliciesUpToDate" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json; Elastic-Api-Version=2023-10-31": { + "schema": { + "additionalProperties": false, + "properties": { + "item": { "additionalProperties": true, - "deprecated": true, "properties": { "agent": { "additionalProperties": false, @@ -22877,7 +21269,6 @@ ], "type": "string" }, - "savedObject": {}, "screenshots": { "items": { "additionalProperties": false, @@ -22949,7 +21340,6 @@ } }, "required": [ - "savedObject", "name", "version", "title", From a6c5fb8373675b58fc229ce0383e466113d3ad58 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Fri, 1 Nov 2024 18:07:25 -0400 Subject: [PATCH 19/25] fix tests --- .../extract_integrations.test.ts | 54 +++++++------------ .../fleet_api_integration/apis/epm/setup.ts | 4 +- .../apis/package_policy/update.ts | 6 +-- 3 files changed, 23 insertions(+), 41 deletions(-) diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.test.ts index c4c2668f710f3..9352639de1272 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.test.ts @@ -163,10 +163,8 @@ describe('extractIntegrations', () => { title: 'Integration B', }, ], - savedObject: { - attributes: { - install_version: '1.0.0', - }, + installationInfo: { + install_version: '1.0.0', }, }, ] as PackageList; @@ -204,10 +202,8 @@ describe('extractIntegrations', () => { title: 'Integration B', }, ], - savedObject: { - attributes: { - install_version: '1.0.0', - }, + installationInfo: { + version: '1.0.0', }, }, ] as PackageList; @@ -262,10 +258,8 @@ describe('extractIntegrations', () => { title: 'Integration B', }, ], - savedObject: { - attributes: { - install_version: '1.0.0', - }, + installationInfo: { + version: '1.0.0', }, }, ] as PackageList; @@ -516,10 +510,8 @@ describe('extractIntegrations', () => { title: 'Integration A', }, ], - savedObject: { - attributes: { - install_version: '1.0.0', - }, + installationInfo: { + version: '1.0.0', }, }, ] as PackageList; @@ -551,10 +543,8 @@ describe('extractIntegrations', () => { title: 'Integration A', }, ], - savedObject: { - attributes: { - install_version: '1.0.0', - }, + installationInfo: { + version: '1.0.0', }, }, ] as PackageList; @@ -599,10 +589,8 @@ describe('extractIntegrations', () => { title: 'Integration A', }, ], - savedObject: { - attributes: { - install_version: '1.0.0', - }, + installationInfo: { + version: '1.0.0', }, }, ] as PackageList; @@ -716,10 +704,8 @@ describe('extractIntegrations', () => { title: 'Package A', version: '1.1.1', status: 'installed', - savedObject: { - attributes: { - install_version: '1.0.0', - }, + installationInfo: { + version: '1.0.0', }, }, ] as PackageList; @@ -741,10 +727,8 @@ describe('extractIntegrations', () => { title: 'Package A', version: '1.1.1', status: 'installed', - savedObject: { - attributes: { - install_version: '1.0.0', - }, + installationInfo: { + version: '1.0.0', }, }, ] as PackageList; @@ -774,10 +758,8 @@ describe('extractIntegrations', () => { title: 'Package A', version: '1.1.1', status: 'installed', - savedObject: { - attributes: { - install_version: '1.0.0', - }, + installationInfo: { + version: '1.0.0', }, }, ] as PackageList; diff --git a/x-pack/test/fleet_api_integration/apis/epm/setup.ts b/x-pack/test/fleet_api_integration/apis/epm/setup.ts index 9c42b254f9578..8d0b78e8688fb 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/setup.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/setup.ts @@ -61,8 +61,8 @@ export default function (providerContext: FtrProviderContext) { ({ body } = await supertest .get(`/api/fleet/epm/packages/endpoint/${latestEndpointVersion}`) .expect(200)); - expect(body.item).to.have.property('savedObject'); - expect((body.item as InstalledRegistry).savedObject?.attributes.install_version).to.eql( + expect(body.item).to.have.property('installationInfo'); + expect((body.item as InstalledRegistry).installationInfo?.version).to.eql( latestEndpointVersion ); }); diff --git a/x-pack/test/fleet_api_integration/apis/package_policy/update.ts b/x-pack/test/fleet_api_integration/apis/package_policy/update.ts index 273f051dfcec6..229876fd9bc8e 100644 --- a/x-pack/test/fleet_api_integration/apis/package_policy/update.ts +++ b/x-pack/test/fleet_api_integration/apis/package_policy/update.ts @@ -28,9 +28,9 @@ export default function (providerContext: FtrProviderContext) { expect(sortBy(arr1, 'id')).to.eql(sortBy(arr2, 'id')); }; - const getInstallationSavedObject = async (name: string, version: string) => { + const getInstallationInfo = async (name: string, version: string) => { const res = await supertest.get(`/api/fleet/epm/packages/${name}/${version}`).expect(200); - return res.body.item.savedObject.attributes; + return res.body.item.installationInfo; }; const getPackagePolicyById = async (id: string) => { @@ -935,7 +935,7 @@ export default function (providerContext: FtrProviderContext) { }) .expect(200); - const installation = await getInstallationSavedObject('integration_to_input', '2.0.0'); + const installation = await getInstallationInfo('integration_to_input', '2.0.0'); expectIdArraysEqual(installation.installed_es, [ // assets from version 1.0.0 From 447e599699f9036dd2c5dd4e91e4fa5beb49d6e9 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Fri, 1 Nov 2024 18:43:13 -0400 Subject: [PATCH 20/25] fix tests --- .../api/get_all_integrations/extract_integrations.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.test.ts index 9352639de1272..7db3cc8c5fc9e 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.test.ts @@ -164,7 +164,7 @@ describe('extractIntegrations', () => { }, ], installationInfo: { - install_version: '1.0.0', + version: '1.0.0', }, }, ] as PackageList; From d435587e757ee2ee96a26cef4c2f8d0380b34e29 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 1 Nov 2024 23:22:18 +0000 Subject: [PATCH 21/25] [CI] Auto-commit changed files from 'make api-docs' --- oas_docs/output/kibana.serverless.yaml | 1609 ++++-------------------- oas_docs/output/kibana.yaml | 1609 ++++-------------------- 2 files changed, 468 insertions(+), 2750 deletions(-) diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index e782ad94cd142..9def354918f6a 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -18558,59 +18558,6 @@ paths: - id - type type: array - response: - deprecated: true - items: - anyOf: - - additionalProperties: false - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - - additionalProperties: false - type: object - properties: - deferred: - type: boolean - id: - type: string - type: - enum: - - index - - index_template - - component_template - - ingest_pipeline - - ilm_policy - - data_stream_ilm_policy - - transform - - ml_model - type: string - version: - type: string - required: - - id - - type - type: array required: - items - _meta @@ -19063,7 +19010,6 @@ paths: - beta - experimental type: string - savedObject: {} signature_path: type: string source: @@ -19092,7 +19038,6 @@ paths: version: type: string required: - - savedObject - name - version - title @@ -19224,59 +19169,6 @@ paths: - id - type type: array - response: - deprecated: true - items: - anyOf: - - additionalProperties: false - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - - additionalProperties: false - type: object - properties: - deferred: - type: boolean - id: - type: string - type: - enum: - - index - - index_template - - component_template - - ingest_pipeline - - ilm_policy - - data_stream_ilm_policy - - transform - - ml_model - type: string - version: - type: string - required: - - id - - type - type: array required: - items - _meta @@ -19461,106 +19353,6 @@ paths: - statusCode - error type: array - response: - deprecated: true - items: - anyOf: - - additionalProperties: false - type: object - properties: - name: - type: string - result: - additionalProperties: false - type: object - properties: - assets: - items: - anyOf: - - additionalProperties: false - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - - additionalProperties: false - type: object - properties: - deferred: - type: boolean - id: - type: string - type: - enum: - - index - - index_template - - component_template - - ingest_pipeline - - ilm_policy - - data_stream_ilm_policy - - transform - - ml_model - type: string - version: - type: string - required: - - id - - type - type: array - error: {} - installSource: - type: string - installType: - type: string - status: - enum: - - installed - - already_installed - type: string - required: - - error - - installType - version: - type: string - required: - - name - - version - - result - - additionalProperties: false - type: object - properties: - error: - anyOf: - - type: string - - {} - name: - type: string - statusCode: - type: number - required: - - name - - statusCode - - error - type: array required: - items '400': @@ -19617,18 +19409,6 @@ paths: required: false schema: type: boolean - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - nullable: true - type: object - properties: - force: - type: boolean - required: - - force responses: '200': content: @@ -19689,59 +19469,6 @@ paths: - id - type type: array - response: - deprecated: true - items: - anyOf: - - additionalProperties: false - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - - additionalProperties: false - type: object - properties: - deferred: - type: boolean - id: - type: string - type: - enum: - - index - - index_template - - component_template - - ingest_pipeline - - ilm_policy - - data_stream_ilm_policy - - transform - - ml_model - type: string - version: - type: string - required: - - id - - type - type: array required: - items '400': @@ -19797,1100 +19524,15 @@ paths: type: boolean - in: query name: full - required: false - schema: - type: boolean - - in: query - name: withMetadata - required: false - schema: - default: false - type: boolean - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - type: object - properties: - item: - additionalProperties: true - type: object - properties: - agent: - additionalProperties: false - type: object - properties: - privileges: - additionalProperties: false - type: object - properties: - root: - type: boolean - asset_tags: - items: - additionalProperties: false - type: object - properties: - asset_ids: - items: - type: string - type: array - asset_types: - items: - type: string - type: array - text: - type: string - required: - - text - type: array - assets: - additionalProperties: {} - type: object - categories: - items: - type: string - type: array - conditions: - additionalProperties: true - type: object - properties: - elastic: - additionalProperties: true - type: object - properties: - capabilities: - items: - type: string - type: array - subscription: - type: string - kibana: - additionalProperties: true - type: object - properties: - version: - type: string - data_streams: - items: - additionalProperties: {} - type: object - type: array - description: - type: string - discovery: - additionalProperties: true - type: object - properties: - fields: - items: - additionalProperties: true - type: object - properties: - name: - type: string - required: - - name - type: array - download: - type: string - elasticsearch: - additionalProperties: {} - type: object - format_version: - type: string - icons: - items: - additionalProperties: true - type: object - properties: - dark_mode: - type: boolean - path: - type: string - size: - type: string - src: - type: string - title: - type: string - type: - type: string - required: - - src - type: array - installationInfo: - additionalProperties: true - type: object - properties: - additional_spaces_installed_kibana: - additionalProperties: - items: - additionalProperties: true - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - type: array - type: object - created_at: - type: string - experimental_data_stream_features: - items: - additionalProperties: true - type: object - properties: - data_stream: - type: string - features: - additionalProperties: true - type: object - properties: - doc_value_only_numeric: - type: boolean - doc_value_only_other: - type: boolean - synthetic_source: - type: boolean - tsdb: - type: boolean - required: - - data_stream - - features - type: array - install_format_schema_version: - type: string - install_source: - enum: - - registry - - upload - - bundled - - custom - type: string - install_status: - enum: - - installed - - installing - - install_failed - type: string - installed_es: - items: - additionalProperties: true - type: object - properties: - deferred: - type: boolean - id: - type: string - type: - enum: - - index - - index_template - - component_template - - ingest_pipeline - - ilm_policy - - data_stream_ilm_policy - - transform - - ml_model - type: string - version: - type: string - required: - - id - - type - type: array - installed_kibana: - items: - additionalProperties: true - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - type: array - installed_kibana_space_id: - type: string - latest_executed_state: - additionalProperties: true - type: object - properties: - error: - type: string - name: - type: string - started_at: - type: string - required: - - name - - started_at - latest_install_failed_attempts: - items: - additionalProperties: true - type: object - properties: - created_at: - type: string - error: - additionalProperties: true - type: object - properties: - message: - type: string - name: - type: string - stack: - type: string - required: - - name - - message - target_version: - type: string - required: - - created_at - - target_version - - error - type: array - name: - type: string - namespaces: - items: - type: string - type: array - type: - type: string - updated_at: - type: string - verification_key_id: - nullable: true - type: string - verification_status: - enum: - - unverified - - verified - - unknown - type: string - version: - type: string - required: - - type - - installed_kibana - - installed_es - - name - - version - - install_status - - install_source - - verification_status - internal: - type: boolean - keepPoliciesUpToDate: - type: boolean - latestVersion: - type: string - license: - type: string - licensePath: - type: string - name: - type: string - notice: - type: string - owner: - additionalProperties: true - type: object - properties: - github: - type: string - type: - enum: - - elastic - - partner - - community - type: string - path: - type: string - policy_templates: - items: - additionalProperties: {} - type: object - type: array - readme: - type: string - release: - enum: - - ga - - beta - - experimental - type: string - savedObject: {} - screenshots: - items: - additionalProperties: false - type: object - properties: - dark_mode: - type: boolean - path: - type: string - size: - type: string - src: - type: string - title: - type: string - type: - type: string - required: - - src - type: array - signature_path: - type: string - source: - additionalProperties: true - type: object - properties: - license: - type: string - required: - - license - status: - type: string - title: - type: string - type: - enum: - - integration - - input - - content - type: string - vars: - items: - additionalProperties: {} - type: object - type: array - version: - type: string - required: - - savedObject - - name - - version - - title - - assets - metadata: - additionalProperties: false - type: object - properties: - has_policies: - type: boolean - required: - - has_policies - response: - additionalProperties: true - deprecated: true - type: object - properties: - agent: - additionalProperties: false - type: object - properties: - privileges: - additionalProperties: false - type: object - properties: - root: - type: boolean - asset_tags: - items: - additionalProperties: false - type: object - properties: - asset_ids: - items: - type: string - type: array - asset_types: - items: - type: string - type: array - text: - type: string - required: - - text - type: array - assets: - additionalProperties: {} - type: object - categories: - items: - type: string - type: array - conditions: - additionalProperties: true - type: object - properties: - elastic: - additionalProperties: true - type: object - properties: - capabilities: - items: - type: string - type: array - subscription: - type: string - kibana: - additionalProperties: true - type: object - properties: - version: - type: string - data_streams: - items: - additionalProperties: {} - type: object - type: array - description: - type: string - discovery: - additionalProperties: true - type: object - properties: - fields: - items: - additionalProperties: true - type: object - properties: - name: - type: string - required: - - name - type: array - download: - type: string - elasticsearch: - additionalProperties: {} - type: object - format_version: - type: string - icons: - items: - additionalProperties: true - type: object - properties: - dark_mode: - type: boolean - path: - type: string - size: - type: string - src: - type: string - title: - type: string - type: - type: string - required: - - src - type: array - installationInfo: - additionalProperties: true - type: object - properties: - additional_spaces_installed_kibana: - additionalProperties: - items: - additionalProperties: true - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - type: array - type: object - created_at: - type: string - experimental_data_stream_features: - items: - additionalProperties: true - type: object - properties: - data_stream: - type: string - features: - additionalProperties: true - type: object - properties: - doc_value_only_numeric: - type: boolean - doc_value_only_other: - type: boolean - synthetic_source: - type: boolean - tsdb: - type: boolean - required: - - data_stream - - features - type: array - install_format_schema_version: - type: string - install_source: - enum: - - registry - - upload - - bundled - - custom - type: string - install_status: - enum: - - installed - - installing - - install_failed - type: string - installed_es: - items: - additionalProperties: true - type: object - properties: - deferred: - type: boolean - id: - type: string - type: - enum: - - index - - index_template - - component_template - - ingest_pipeline - - ilm_policy - - data_stream_ilm_policy - - transform - - ml_model - type: string - version: - type: string - required: - - id - - type - type: array - installed_kibana: - items: - additionalProperties: true - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - type: array - installed_kibana_space_id: - type: string - latest_executed_state: - additionalProperties: true - type: object - properties: - error: - type: string - name: - type: string - started_at: - type: string - required: - - name - - started_at - latest_install_failed_attempts: - items: - additionalProperties: true - type: object - properties: - created_at: - type: string - error: - additionalProperties: true - type: object - properties: - message: - type: string - name: - type: string - stack: - type: string - required: - - name - - message - target_version: - type: string - required: - - created_at - - target_version - - error - type: array - name: - type: string - namespaces: - items: - type: string - type: array - type: - type: string - updated_at: - type: string - verification_key_id: - nullable: true - type: string - verification_status: - enum: - - unverified - - verified - - unknown - type: string - version: - type: string - required: - - type - - installed_kibana - - installed_es - - name - - version - - install_status - - install_source - - verification_status - internal: - type: boolean - keepPoliciesUpToDate: - type: boolean - latestVersion: - type: string - license: - type: string - licensePath: - type: string - name: - type: string - notice: - type: string - owner: - additionalProperties: true - type: object - properties: - github: - type: string - type: - enum: - - elastic - - partner - - community - type: string - path: - type: string - policy_templates: - items: - additionalProperties: {} - type: object - type: array - readme: - type: string - release: - enum: - - ga - - beta - - experimental - type: string - savedObject: {} - screenshots: - items: - additionalProperties: false - type: object - properties: - dark_mode: - type: boolean - path: - type: string - size: - type: string - src: - type: string - title: - type: string - type: - type: string - required: - - src - type: array - signature_path: - type: string - source: - additionalProperties: true - type: object - properties: - license: - type: string - required: - - license - status: - type: string - title: - type: string - type: - enum: - - integration - - input - - content - type: string - vars: - items: - additionalProperties: {} - type: object - type: array - version: - type: string - required: - - savedObject - - name - - version - - title - - assets - required: - - item - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - description: Generic Error - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - required: - - message - summary: '' - tags: - - Elastic Package Manager (EPM) - post: - description: Install package from registry - operationId: post-fleet-epm-packages-pkgname-pkgversion - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - in: path - name: pkgName - required: true - schema: - type: string - - in: path - name: pkgVersion - required: false - schema: - type: string - - in: query - name: prerelease - required: false - schema: - type: boolean - - in: query - name: ignoreMappingUpdateErrors - required: false - schema: - default: false - type: boolean - - in: query - name: skipDataStreamRollover - required: false - schema: - default: false - type: boolean - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - nullable: true - type: object - properties: - force: - default: false - type: boolean - ignore_constraints: - default: false - type: boolean - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - type: object - properties: - _meta: - additionalProperties: false - type: object - properties: - install_source: - type: string - required: - - install_source - items: - items: - anyOf: - - additionalProperties: false - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - - additionalProperties: false - type: object - properties: - deferred: - type: boolean - id: - type: string - type: - enum: - - index - - index_template - - component_template - - ingest_pipeline - - ilm_policy - - data_stream_ilm_policy - - transform - - ml_model - type: string - version: - type: string - required: - - id - - type - type: array - response: - deprecated: true - items: - anyOf: - - additionalProperties: false - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - - additionalProperties: false - type: object - properties: - deferred: - type: boolean - id: - type: string - type: - enum: - - index - - index_template - - component_template - - ingest_pipeline - - ilm_policy - - data_stream_ilm_policy - - transform - - ml_model - type: string - version: - type: string - required: - - id - - type - type: array - required: - - items - - _meta - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - description: Generic Error - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - required: - - message - summary: '' - tags: - - Elastic Package Manager (EPM) - put: - description: Update package settings - operationId: put-fleet-epm-packages-pkgname-pkgversion - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - in: path - name: pkgName - required: true + required: false schema: - type: string - - in: path - name: pkgVersion + type: boolean + - in: query + name: withMetadata required: false schema: - type: string - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - type: object - properties: - keepPoliciesUpToDate: - type: boolean - required: - - keepPoliciesUpToDate + default: false + type: boolean responses: '200': content: @@ -21247,7 +19889,6 @@ paths: - beta - experimental type: string - savedObject: {} screenshots: items: additionalProperties: false @@ -21296,14 +19937,239 @@ paths: version: type: string required: - - savedObject - name - version - title - assets - response: + metadata: + additionalProperties: false + type: object + properties: + has_policies: + type: boolean + required: + - has_policies + required: + - item + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + description: Generic Error + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + required: + - message + summary: '' + tags: + - Elastic Package Manager (EPM) + post: + description: Install package from registry + operationId: post-fleet-epm-packages-pkgname-pkgversion + parameters: + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - in: path + name: pkgName + required: true + schema: + type: string + - in: path + name: pkgVersion + required: false + schema: + type: string + - in: query + name: prerelease + required: false + schema: + type: boolean + - in: query + name: ignoreMappingUpdateErrors + required: false + schema: + default: false + type: boolean + - in: query + name: skipDataStreamRollover + required: false + schema: + default: false + type: boolean + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + nullable: true + type: object + properties: + force: + default: false + type: boolean + ignore_constraints: + default: false + type: boolean + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + type: object + properties: + _meta: + additionalProperties: false + type: object + properties: + install_source: + type: string + required: + - install_source + items: + items: + anyOf: + - additionalProperties: false + type: object + properties: + id: + type: string + originId: + type: string + type: + enum: + - dashboard + - lens + - visualization + - search + - index-pattern + - map + - ml-module + - security-rule + - csp-rule-template + - osquery-pack-asset + - osquery-saved-query + - tag + type: string + required: + - id + - type + - additionalProperties: false + type: object + properties: + deferred: + type: boolean + id: + type: string + type: + enum: + - index + - index_template + - component_template + - ingest_pipeline + - ilm_policy + - data_stream_ilm_policy + - transform + - ml_model + type: string + version: + type: string + required: + - id + - type + type: array + required: + - items + - _meta + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + description: Generic Error + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + required: + - message + summary: '' + tags: + - Elastic Package Manager (EPM) + put: + description: Update package settings + operationId: put-fleet-epm-packages-pkgname-pkgversion + parameters: + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - in: path + name: pkgName + required: true + schema: + type: string + - in: path + name: pkgVersion + required: false + schema: + type: string + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + type: object + properties: + keepPoliciesUpToDate: + type: boolean + required: + - keepPoliciesUpToDate + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + type: object + properties: + item: additionalProperties: true - deprecated: true type: object properties: agent: @@ -21650,7 +20516,6 @@ paths: - beta - experimental type: string - savedObject: {} screenshots: items: additionalProperties: false @@ -21699,7 +20564,6 @@ paths: version: type: string required: - - savedObject - name - version - title @@ -22104,11 +20968,6 @@ paths: items: type: string type: array - response: - deprecated: true - items: - type: string - type: array required: - items '400': diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index 3dc564913f3a4..1f6614936c48c 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -21991,59 +21991,6 @@ paths: - id - type type: array - response: - deprecated: true - items: - anyOf: - - additionalProperties: false - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - - additionalProperties: false - type: object - properties: - deferred: - type: boolean - id: - type: string - type: - enum: - - index - - index_template - - component_template - - ingest_pipeline - - ilm_policy - - data_stream_ilm_policy - - transform - - ml_model - type: string - version: - type: string - required: - - id - - type - type: array required: - items - _meta @@ -22496,7 +22443,6 @@ paths: - beta - experimental type: string - savedObject: {} signature_path: type: string source: @@ -22525,7 +22471,6 @@ paths: version: type: string required: - - savedObject - name - version - title @@ -22657,59 +22602,6 @@ paths: - id - type type: array - response: - deprecated: true - items: - anyOf: - - additionalProperties: false - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - - additionalProperties: false - type: object - properties: - deferred: - type: boolean - id: - type: string - type: - enum: - - index - - index_template - - component_template - - ingest_pipeline - - ilm_policy - - data_stream_ilm_policy - - transform - - ml_model - type: string - version: - type: string - required: - - id - - type - type: array required: - items - _meta @@ -22894,106 +22786,6 @@ paths: - statusCode - error type: array - response: - deprecated: true - items: - anyOf: - - additionalProperties: false - type: object - properties: - name: - type: string - result: - additionalProperties: false - type: object - properties: - assets: - items: - anyOf: - - additionalProperties: false - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - - additionalProperties: false - type: object - properties: - deferred: - type: boolean - id: - type: string - type: - enum: - - index - - index_template - - component_template - - ingest_pipeline - - ilm_policy - - data_stream_ilm_policy - - transform - - ml_model - type: string - version: - type: string - required: - - id - - type - type: array - error: {} - installSource: - type: string - installType: - type: string - status: - enum: - - installed - - already_installed - type: string - required: - - error - - installType - version: - type: string - required: - - name - - version - - result - - additionalProperties: false - type: object - properties: - error: - anyOf: - - type: string - - {} - name: - type: string - statusCode: - type: number - required: - - name - - statusCode - - error - type: array required: - items '400': @@ -23050,18 +22842,6 @@ paths: required: false schema: type: boolean - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - nullable: true - type: object - properties: - force: - type: boolean - required: - - force responses: '200': content: @@ -23122,59 +22902,6 @@ paths: - id - type type: array - response: - deprecated: true - items: - anyOf: - - additionalProperties: false - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - - additionalProperties: false - type: object - properties: - deferred: - type: boolean - id: - type: string - type: - enum: - - index - - index_template - - component_template - - ingest_pipeline - - ilm_policy - - data_stream_ilm_policy - - transform - - ml_model - type: string - version: - type: string - required: - - id - - type - type: array required: - items '400': @@ -23230,1100 +22957,15 @@ paths: type: boolean - in: query name: full - required: false - schema: - type: boolean - - in: query - name: withMetadata - required: false - schema: - default: false - type: boolean - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - type: object - properties: - item: - additionalProperties: true - type: object - properties: - agent: - additionalProperties: false - type: object - properties: - privileges: - additionalProperties: false - type: object - properties: - root: - type: boolean - asset_tags: - items: - additionalProperties: false - type: object - properties: - asset_ids: - items: - type: string - type: array - asset_types: - items: - type: string - type: array - text: - type: string - required: - - text - type: array - assets: - additionalProperties: {} - type: object - categories: - items: - type: string - type: array - conditions: - additionalProperties: true - type: object - properties: - elastic: - additionalProperties: true - type: object - properties: - capabilities: - items: - type: string - type: array - subscription: - type: string - kibana: - additionalProperties: true - type: object - properties: - version: - type: string - data_streams: - items: - additionalProperties: {} - type: object - type: array - description: - type: string - discovery: - additionalProperties: true - type: object - properties: - fields: - items: - additionalProperties: true - type: object - properties: - name: - type: string - required: - - name - type: array - download: - type: string - elasticsearch: - additionalProperties: {} - type: object - format_version: - type: string - icons: - items: - additionalProperties: true - type: object - properties: - dark_mode: - type: boolean - path: - type: string - size: - type: string - src: - type: string - title: - type: string - type: - type: string - required: - - src - type: array - installationInfo: - additionalProperties: true - type: object - properties: - additional_spaces_installed_kibana: - additionalProperties: - items: - additionalProperties: true - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - type: array - type: object - created_at: - type: string - experimental_data_stream_features: - items: - additionalProperties: true - type: object - properties: - data_stream: - type: string - features: - additionalProperties: true - type: object - properties: - doc_value_only_numeric: - type: boolean - doc_value_only_other: - type: boolean - synthetic_source: - type: boolean - tsdb: - type: boolean - required: - - data_stream - - features - type: array - install_format_schema_version: - type: string - install_source: - enum: - - registry - - upload - - bundled - - custom - type: string - install_status: - enum: - - installed - - installing - - install_failed - type: string - installed_es: - items: - additionalProperties: true - type: object - properties: - deferred: - type: boolean - id: - type: string - type: - enum: - - index - - index_template - - component_template - - ingest_pipeline - - ilm_policy - - data_stream_ilm_policy - - transform - - ml_model - type: string - version: - type: string - required: - - id - - type - type: array - installed_kibana: - items: - additionalProperties: true - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - type: array - installed_kibana_space_id: - type: string - latest_executed_state: - additionalProperties: true - type: object - properties: - error: - type: string - name: - type: string - started_at: - type: string - required: - - name - - started_at - latest_install_failed_attempts: - items: - additionalProperties: true - type: object - properties: - created_at: - type: string - error: - additionalProperties: true - type: object - properties: - message: - type: string - name: - type: string - stack: - type: string - required: - - name - - message - target_version: - type: string - required: - - created_at - - target_version - - error - type: array - name: - type: string - namespaces: - items: - type: string - type: array - type: - type: string - updated_at: - type: string - verification_key_id: - nullable: true - type: string - verification_status: - enum: - - unverified - - verified - - unknown - type: string - version: - type: string - required: - - type - - installed_kibana - - installed_es - - name - - version - - install_status - - install_source - - verification_status - internal: - type: boolean - keepPoliciesUpToDate: - type: boolean - latestVersion: - type: string - license: - type: string - licensePath: - type: string - name: - type: string - notice: - type: string - owner: - additionalProperties: true - type: object - properties: - github: - type: string - type: - enum: - - elastic - - partner - - community - type: string - path: - type: string - policy_templates: - items: - additionalProperties: {} - type: object - type: array - readme: - type: string - release: - enum: - - ga - - beta - - experimental - type: string - savedObject: {} - screenshots: - items: - additionalProperties: false - type: object - properties: - dark_mode: - type: boolean - path: - type: string - size: - type: string - src: - type: string - title: - type: string - type: - type: string - required: - - src - type: array - signature_path: - type: string - source: - additionalProperties: true - type: object - properties: - license: - type: string - required: - - license - status: - type: string - title: - type: string - type: - enum: - - integration - - input - - content - type: string - vars: - items: - additionalProperties: {} - type: object - type: array - version: - type: string - required: - - savedObject - - name - - version - - title - - assets - metadata: - additionalProperties: false - type: object - properties: - has_policies: - type: boolean - required: - - has_policies - response: - additionalProperties: true - deprecated: true - type: object - properties: - agent: - additionalProperties: false - type: object - properties: - privileges: - additionalProperties: false - type: object - properties: - root: - type: boolean - asset_tags: - items: - additionalProperties: false - type: object - properties: - asset_ids: - items: - type: string - type: array - asset_types: - items: - type: string - type: array - text: - type: string - required: - - text - type: array - assets: - additionalProperties: {} - type: object - categories: - items: - type: string - type: array - conditions: - additionalProperties: true - type: object - properties: - elastic: - additionalProperties: true - type: object - properties: - capabilities: - items: - type: string - type: array - subscription: - type: string - kibana: - additionalProperties: true - type: object - properties: - version: - type: string - data_streams: - items: - additionalProperties: {} - type: object - type: array - description: - type: string - discovery: - additionalProperties: true - type: object - properties: - fields: - items: - additionalProperties: true - type: object - properties: - name: - type: string - required: - - name - type: array - download: - type: string - elasticsearch: - additionalProperties: {} - type: object - format_version: - type: string - icons: - items: - additionalProperties: true - type: object - properties: - dark_mode: - type: boolean - path: - type: string - size: - type: string - src: - type: string - title: - type: string - type: - type: string - required: - - src - type: array - installationInfo: - additionalProperties: true - type: object - properties: - additional_spaces_installed_kibana: - additionalProperties: - items: - additionalProperties: true - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - type: array - type: object - created_at: - type: string - experimental_data_stream_features: - items: - additionalProperties: true - type: object - properties: - data_stream: - type: string - features: - additionalProperties: true - type: object - properties: - doc_value_only_numeric: - type: boolean - doc_value_only_other: - type: boolean - synthetic_source: - type: boolean - tsdb: - type: boolean - required: - - data_stream - - features - type: array - install_format_schema_version: - type: string - install_source: - enum: - - registry - - upload - - bundled - - custom - type: string - install_status: - enum: - - installed - - installing - - install_failed - type: string - installed_es: - items: - additionalProperties: true - type: object - properties: - deferred: - type: boolean - id: - type: string - type: - enum: - - index - - index_template - - component_template - - ingest_pipeline - - ilm_policy - - data_stream_ilm_policy - - transform - - ml_model - type: string - version: - type: string - required: - - id - - type - type: array - installed_kibana: - items: - additionalProperties: true - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - type: array - installed_kibana_space_id: - type: string - latest_executed_state: - additionalProperties: true - type: object - properties: - error: - type: string - name: - type: string - started_at: - type: string - required: - - name - - started_at - latest_install_failed_attempts: - items: - additionalProperties: true - type: object - properties: - created_at: - type: string - error: - additionalProperties: true - type: object - properties: - message: - type: string - name: - type: string - stack: - type: string - required: - - name - - message - target_version: - type: string - required: - - created_at - - target_version - - error - type: array - name: - type: string - namespaces: - items: - type: string - type: array - type: - type: string - updated_at: - type: string - verification_key_id: - nullable: true - type: string - verification_status: - enum: - - unverified - - verified - - unknown - type: string - version: - type: string - required: - - type - - installed_kibana - - installed_es - - name - - version - - install_status - - install_source - - verification_status - internal: - type: boolean - keepPoliciesUpToDate: - type: boolean - latestVersion: - type: string - license: - type: string - licensePath: - type: string - name: - type: string - notice: - type: string - owner: - additionalProperties: true - type: object - properties: - github: - type: string - type: - enum: - - elastic - - partner - - community - type: string - path: - type: string - policy_templates: - items: - additionalProperties: {} - type: object - type: array - readme: - type: string - release: - enum: - - ga - - beta - - experimental - type: string - savedObject: {} - screenshots: - items: - additionalProperties: false - type: object - properties: - dark_mode: - type: boolean - path: - type: string - size: - type: string - src: - type: string - title: - type: string - type: - type: string - required: - - src - type: array - signature_path: - type: string - source: - additionalProperties: true - type: object - properties: - license: - type: string - required: - - license - status: - type: string - title: - type: string - type: - enum: - - integration - - input - - content - type: string - vars: - items: - additionalProperties: {} - type: object - type: array - version: - type: string - required: - - savedObject - - name - - version - - title - - assets - required: - - item - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - description: Generic Error - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - required: - - message - summary: '' - tags: - - Elastic Package Manager (EPM) - post: - description: Install package from registry - operationId: post-fleet-epm-packages-pkgname-pkgversion - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - in: path - name: pkgName - required: true - schema: - type: string - - in: path - name: pkgVersion - required: false - schema: - type: string - - in: query - name: prerelease - required: false - schema: - type: boolean - - in: query - name: ignoreMappingUpdateErrors - required: false - schema: - default: false - type: boolean - - in: query - name: skipDataStreamRollover - required: false - schema: - default: false - type: boolean - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - nullable: true - type: object - properties: - force: - default: false - type: boolean - ignore_constraints: - default: false - type: boolean - responses: - '200': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - type: object - properties: - _meta: - additionalProperties: false - type: object - properties: - install_source: - type: string - required: - - install_source - items: - items: - anyOf: - - additionalProperties: false - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - - additionalProperties: false - type: object - properties: - deferred: - type: boolean - id: - type: string - type: - enum: - - index - - index_template - - component_template - - ingest_pipeline - - ilm_policy - - data_stream_ilm_policy - - transform - - ml_model - type: string - version: - type: string - required: - - id - - type - type: array - response: - deprecated: true - items: - anyOf: - - additionalProperties: false - type: object - properties: - id: - type: string - originId: - type: string - type: - enum: - - dashboard - - lens - - visualization - - search - - index-pattern - - map - - ml-module - - security-rule - - csp-rule-template - - osquery-pack-asset - - osquery-saved-query - - tag - type: string - required: - - id - - type - - additionalProperties: false - type: object - properties: - deferred: - type: boolean - id: - type: string - type: - enum: - - index - - index_template - - component_template - - ingest_pipeline - - ilm_policy - - data_stream_ilm_policy - - transform - - ml_model - type: string - version: - type: string - required: - - id - - type - type: array - required: - - items - - _meta - '400': - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - description: Generic Error - type: object - properties: - error: - type: string - message: - type: string - statusCode: - type: number - required: - - message - summary: '' - tags: - - Elastic Package Manager (EPM) - put: - description: Update package settings - operationId: put-fleet-epm-packages-pkgname-pkgversion - parameters: - - description: The version of the API to use - in: header - name: elastic-api-version - schema: - default: '2023-10-31' - enum: - - '2023-10-31' - type: string - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - in: path - name: pkgName - required: true + required: false schema: - type: string - - in: path - name: pkgVersion + type: boolean + - in: query + name: withMetadata required: false schema: - type: string - requestBody: - content: - application/json; Elastic-Api-Version=2023-10-31: - schema: - additionalProperties: false - type: object - properties: - keepPoliciesUpToDate: - type: boolean - required: - - keepPoliciesUpToDate + default: false + type: boolean responses: '200': content: @@ -24680,7 +23322,6 @@ paths: - beta - experimental type: string - savedObject: {} screenshots: items: additionalProperties: false @@ -24729,14 +23370,239 @@ paths: version: type: string required: - - savedObject - name - version - title - assets - response: + metadata: + additionalProperties: false + type: object + properties: + has_policies: + type: boolean + required: + - has_policies + required: + - item + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + description: Generic Error + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + required: + - message + summary: '' + tags: + - Elastic Package Manager (EPM) + post: + description: Install package from registry + operationId: post-fleet-epm-packages-pkgname-pkgversion + parameters: + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - in: path + name: pkgName + required: true + schema: + type: string + - in: path + name: pkgVersion + required: false + schema: + type: string + - in: query + name: prerelease + required: false + schema: + type: boolean + - in: query + name: ignoreMappingUpdateErrors + required: false + schema: + default: false + type: boolean + - in: query + name: skipDataStreamRollover + required: false + schema: + default: false + type: boolean + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + nullable: true + type: object + properties: + force: + default: false + type: boolean + ignore_constraints: + default: false + type: boolean + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + type: object + properties: + _meta: + additionalProperties: false + type: object + properties: + install_source: + type: string + required: + - install_source + items: + items: + anyOf: + - additionalProperties: false + type: object + properties: + id: + type: string + originId: + type: string + type: + enum: + - dashboard + - lens + - visualization + - search + - index-pattern + - map + - ml-module + - security-rule + - csp-rule-template + - osquery-pack-asset + - osquery-saved-query + - tag + type: string + required: + - id + - type + - additionalProperties: false + type: object + properties: + deferred: + type: boolean + id: + type: string + type: + enum: + - index + - index_template + - component_template + - ingest_pipeline + - ilm_policy + - data_stream_ilm_policy + - transform + - ml_model + type: string + version: + type: string + required: + - id + - type + type: array + required: + - items + - _meta + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + description: Generic Error + type: object + properties: + error: + type: string + message: + type: string + statusCode: + type: number + required: + - message + summary: '' + tags: + - Elastic Package Manager (EPM) + put: + description: Update package settings + operationId: put-fleet-epm-packages-pkgname-pkgversion + parameters: + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: A required header to protect against CSRF attacks + in: header + name: kbn-xsrf + required: true + schema: + example: 'true' + type: string + - in: path + name: pkgName + required: true + schema: + type: string + - in: path + name: pkgVersion + required: false + schema: + type: string + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + type: object + properties: + keepPoliciesUpToDate: + type: boolean + required: + - keepPoliciesUpToDate + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + additionalProperties: false + type: object + properties: + item: additionalProperties: true - deprecated: true type: object properties: agent: @@ -25083,7 +23949,6 @@ paths: - beta - experimental type: string - savedObject: {} screenshots: items: additionalProperties: false @@ -25132,7 +23997,6 @@ paths: version: type: string required: - - savedObject - name - version - title @@ -25537,11 +24401,6 @@ paths: items: type: string type: array - response: - deprecated: true - items: - type: string - type: array required: - items '400': From aee8acf02230dde37bff28714d12862ae87979fd Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Fri, 1 Nov 2024 21:34:45 -0400 Subject: [PATCH 22/25] fix type --- .../plugins/fleet/common/types/models/epm.ts | 1 + .../extract_integrations.test.ts | 54 ++++++++++++------- .../extract_integrations.ts | 2 +- 3 files changed, 38 insertions(+), 19 deletions(-) diff --git a/x-pack/plugins/fleet/common/types/models/epm.ts b/x-pack/plugins/fleet/common/types/models/epm.ts index 4a0a8307586ec..68cfecf74f57a 100644 --- a/x-pack/plugins/fleet/common/types/models/epm.ts +++ b/x-pack/plugins/fleet/common/types/models/epm.ts @@ -531,6 +531,7 @@ export type PackageList = PackageListItem[]; export type PackageListItem = Installable & { id: string; integration?: string; + savedObject?: InstallableSavedObject; installationInfo?: InstallationInfo; }; export type PackagesGroupedByStatus = Record, PackageList>; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.test.ts index 7db3cc8c5fc9e..c4c2668f710f3 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.test.ts @@ -163,8 +163,10 @@ describe('extractIntegrations', () => { title: 'Integration B', }, ], - installationInfo: { - version: '1.0.0', + savedObject: { + attributes: { + install_version: '1.0.0', + }, }, }, ] as PackageList; @@ -202,8 +204,10 @@ describe('extractIntegrations', () => { title: 'Integration B', }, ], - installationInfo: { - version: '1.0.0', + savedObject: { + attributes: { + install_version: '1.0.0', + }, }, }, ] as PackageList; @@ -258,8 +262,10 @@ describe('extractIntegrations', () => { title: 'Integration B', }, ], - installationInfo: { - version: '1.0.0', + savedObject: { + attributes: { + install_version: '1.0.0', + }, }, }, ] as PackageList; @@ -510,8 +516,10 @@ describe('extractIntegrations', () => { title: 'Integration A', }, ], - installationInfo: { - version: '1.0.0', + savedObject: { + attributes: { + install_version: '1.0.0', + }, }, }, ] as PackageList; @@ -543,8 +551,10 @@ describe('extractIntegrations', () => { title: 'Integration A', }, ], - installationInfo: { - version: '1.0.0', + savedObject: { + attributes: { + install_version: '1.0.0', + }, }, }, ] as PackageList; @@ -589,8 +599,10 @@ describe('extractIntegrations', () => { title: 'Integration A', }, ], - installationInfo: { - version: '1.0.0', + savedObject: { + attributes: { + install_version: '1.0.0', + }, }, }, ] as PackageList; @@ -704,8 +716,10 @@ describe('extractIntegrations', () => { title: 'Package A', version: '1.1.1', status: 'installed', - installationInfo: { - version: '1.0.0', + savedObject: { + attributes: { + install_version: '1.0.0', + }, }, }, ] as PackageList; @@ -727,8 +741,10 @@ describe('extractIntegrations', () => { title: 'Package A', version: '1.1.1', status: 'installed', - installationInfo: { - version: '1.0.0', + savedObject: { + attributes: { + install_version: '1.0.0', + }, }, }, ] as PackageList; @@ -758,8 +774,10 @@ describe('extractIntegrations', () => { title: 'Package A', version: '1.1.1', status: 'installed', - installationInfo: { - version: '1.0.0', + savedObject: { + attributes: { + install_version: '1.0.0', + }, }, }, ] as PackageList; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.ts index 7f42e13b9bd22..065d307fe1f76 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/fleet_integrations/api/get_all_integrations/extract_integrations.ts @@ -21,7 +21,7 @@ export function extractIntegrations( const packageTitle = fleetPackage.title; const isPackageInstalled = fleetPackage.status === 'installed'; // Actual `installed_version` is buried in SO, root `version` is latest package version available - const installedPackageVersion = fleetPackage.installationInfo?.version; + const installedPackageVersion = fleetPackage.savedObject?.attributes.install_version; // Policy templates correspond to package's integrations. const packagePolicyTemplates = fleetPackage.policy_templates ?? []; From 0a0caeb905b86a38b2eccf52c46da92f1b28a422 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Mon, 4 Nov 2024 09:50:46 -0500 Subject: [PATCH 23/25] fix tests --- .../apis/package_policy/helper.ts | 13 +++++++++++++ .../package_policy/input_package_create_upgrade.ts | 14 +++++--------- .../apis/package_policy/input_package_rollback.ts | 8 ++------ .../apis/package_policy/upgrade.ts | 12 ++++++------ 4 files changed, 26 insertions(+), 21 deletions(-) create mode 100644 x-pack/test/fleet_api_integration/apis/package_policy/helper.ts diff --git a/x-pack/test/fleet_api_integration/apis/package_policy/helper.ts b/x-pack/test/fleet_api_integration/apis/package_policy/helper.ts new file mode 100644 index 0000000000000..2c53248905521 --- /dev/null +++ b/x-pack/test/fleet_api_integration/apis/package_policy/helper.ts @@ -0,0 +1,13 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { Agent } from 'supertest'; + +export async function getInstallationInfo(supertest: Agent, name: string, version: string) { + const res = await supertest.get(`/api/fleet/epm/packages/${name}/${version}`).expect(200); + return res.body.item.installationInfo; +} diff --git a/x-pack/test/fleet_api_integration/apis/package_policy/input_package_create_upgrade.ts b/x-pack/test/fleet_api_integration/apis/package_policy/input_package_create_upgrade.ts index 481f4e09c68d9..bbd55641ce916 100644 --- a/x-pack/test/fleet_api_integration/apis/package_policy/input_package_create_upgrade.ts +++ b/x-pack/test/fleet_api_integration/apis/package_policy/input_package_create_upgrade.ts @@ -8,6 +8,7 @@ import expect from '@kbn/expect'; import { sortBy } from 'lodash'; import { FtrProviderContext } from '../../../api_integration/ftr_provider_context'; import { skipIfNoDockerRegistry } from '../../helpers'; +import { getInstallationInfo } from './helper'; const PACKAGE_NAME = 'input_package_upgrade'; const START_VERSION = '1.0.0'; const UPGRADE_VERSION = '1.1.0'; @@ -33,11 +34,6 @@ export default function (providerContext: FtrProviderContext) { .expect(200); }; - const getInstallationSavedObject = async (name: string, version: string) => { - const res = await supertest.get(`/api/fleet/epm/packages/${name}/${version}`).expect(200); - return res.body.item.savedObject.attributes; - }; - const createPackagePolicyWithDataset = async ( agentPolicyId: string, dataset: string, @@ -195,13 +191,13 @@ export default function (providerContext: FtrProviderContext) { }); it('should not have created any ES assets on install', async () => { - const installation = await getInstallationSavedObject(PACKAGE_NAME, START_VERSION); + const installation = await getInstallationInfo(supertest, PACKAGE_NAME, START_VERSION); expect(installation.installed_es).to.eql([]); }); it('should create index templates and update installed_es on package policy creation', async () => { await createPackagePolicyWithDataset(agentPolicyId, 'dataset1'); - const installation = await getInstallationSavedObject(PACKAGE_NAME, START_VERSION); + const installation = await getInstallationInfo(supertest, PACKAGE_NAME, START_VERSION); expectIdArraysEqual(installation.installed_es, [ { id: 'logs-dataset1-1.0.0', type: 'ingest_pipeline' }, { id: 'logs-dataset1', type: 'index_template' }, @@ -249,7 +245,7 @@ export default function (providerContext: FtrProviderContext) { it('should create index templates and update installed_es on second package policy creation', async () => { await createPackagePolicyWithDataset(agentPolicyId, 'dataset2'); - const installation = await getInstallationSavedObject(PACKAGE_NAME, START_VERSION); + const installation = await getInstallationInfo(supertest, PACKAGE_NAME, START_VERSION); let found = 0; [ { id: 'logs-dataset2-1.0.0', type: 'ingest_pipeline' }, @@ -268,7 +264,7 @@ export default function (providerContext: FtrProviderContext) { await createFakeFleetDataStream('dataset3'); await createPackagePolicyWithDataset(agentPolicyId, 'dataset3'); - const installation = await getInstallationSavedObject(PACKAGE_NAME, START_VERSION); + const installation = await getInstallationInfo(supertest, PACKAGE_NAME, START_VERSION); let found = 0; [ { id: 'logs-dataset3-1.0.0', type: 'ingest_pipeline' }, diff --git a/x-pack/test/fleet_api_integration/apis/package_policy/input_package_rollback.ts b/x-pack/test/fleet_api_integration/apis/package_policy/input_package_rollback.ts index 2ea9c64ee2507..7ccd2fad8bdde 100644 --- a/x-pack/test/fleet_api_integration/apis/package_policy/input_package_rollback.ts +++ b/x-pack/test/fleet_api_integration/apis/package_policy/input_package_rollback.ts @@ -8,6 +8,7 @@ import expect from '@kbn/expect'; import { sortBy } from 'lodash'; import { FtrProviderContext } from '../../../api_integration/ftr_provider_context'; import { skipIfNoDockerRegistry } from '../../helpers'; +import { getInstallationInfo } from './helper'; const PACKAGE_NAME = 'input_package_upgrade'; const START_VERSION = '1.0.0'; @@ -31,11 +32,6 @@ export default function (providerContext: FtrProviderContext) { .expect(200); }; - const getInstallationSavedObject = async (name: string, version: string) => { - const res = await supertest.get(`/api/fleet/epm/packages/${name}/${version}`).expect(200); - return res.body.item.savedObject.attributes; - }; - const getPackage = async (name: string, version: string) => { const res = await supertest.get(`/api/fleet/epm/packages/${name}/${version}`).expect(200); return res.body.item; @@ -131,7 +127,7 @@ export default function (providerContext: FtrProviderContext) { await installPackage(PACKAGE_NAME, START_VERSION); await createPackagePolicyWithDataset(agentPolicyId, 'test*', 400); - const installation = await getInstallationSavedObject(PACKAGE_NAME, START_VERSION); + const installation = await getInstallationInfo(supertest, PACKAGE_NAME, START_VERSION); expectIdArraysEqual(installation.installed_es, []); await uninstallPackage(PACKAGE_NAME, START_VERSION); diff --git a/x-pack/test/fleet_api_integration/apis/package_policy/upgrade.ts b/x-pack/test/fleet_api_integration/apis/package_policy/upgrade.ts index 021eebcdcc0c1..e0fbddb578a91 100644 --- a/x-pack/test/fleet_api_integration/apis/package_policy/upgrade.ts +++ b/x-pack/test/fleet_api_integration/apis/package_policy/upgrade.ts @@ -12,6 +12,7 @@ import { import { sortBy } from 'lodash'; import { FtrProviderContext } from '../../../api_integration/ftr_provider_context'; import { skipIfNoDockerRegistry } from '../../helpers'; +import { getInstallationInfo } from './helper'; const expectIdArraysEqual = (arr1: any[], arr2: any[]) => { expect(sortBy(arr1, 'id')).to.eql(sortBy(arr2, 'id')); @@ -36,11 +37,6 @@ export default function (providerContext: FtrProviderContext) { }); } - const getInstallationSavedObject = async (name: string, version: string) => { - const res = await supertest.get(`/api/fleet/epm/packages/${name}/${version}`).expect(200); - return res.body.item.savedObject.attributes; - }; - const getComponentTemplate = async (name: string) => { try { const { component_templates: templates } = await es.cluster.getComponentTemplate({ name }); @@ -1358,7 +1354,11 @@ export default function (providerContext: FtrProviderContext) { }) .expect(200); - const installation = await getInstallationSavedObject('integration_to_input', '3.0.0'); + const installation = await getInstallationInfo( + supertest, + 'integration_to_input', + '3.0.0' + ); expectIdArraysEqual(installation.installed_es, expectedAssets); const expectedComponentTemplates = expectedAssets.filter( From b40a8ab0e0813c002074e7fa992255485ce70813 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Mon, 4 Nov 2024 09:57:49 -0500 Subject: [PATCH 24/25] fix more tests --- .../test/fleet_api_integration/apis/epm/bulk_get_assets.ts | 7 ++----- .../apis/epm/install_error_rollback.ts | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/x-pack/test/fleet_api_integration/apis/epm/bulk_get_assets.ts b/x-pack/test/fleet_api_integration/apis/epm/bulk_get_assets.ts index 3fa96c96018e1..16515df902185 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/bulk_get_assets.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/bulk_get_assets.ts @@ -48,15 +48,12 @@ export default function (providerContext: FtrProviderContext) { const packageInfo = await supertest .get(`/api/fleet/epm/packages/${pkgName}/${pkgVersion}`) .expect(200); - const packageSOAttributes = packageInfo.body.item.savedObject.attributes; + const installationInfo = packageInfo.body.item.installationInfo; const { body }: { body: GetBulkAssetsResponse } = await supertest .post(`/api/fleet/epm/bulk_assets`) .set('kbn-xsrf', 'xxxx') .send({ - assetIds: [ - ...packageSOAttributes.installed_es, - ...packageSOAttributes.installed_kibana, - ], + assetIds: [...installationInfo.installed_es, ...installationInfo.installed_kibana], }) .expect(200); diff --git a/x-pack/test/fleet_api_integration/apis/epm/install_error_rollback.ts b/x-pack/test/fleet_api_integration/apis/epm/install_error_rollback.ts index 30d20498c9559..7bb3bca9aa16e 100644 --- a/x-pack/test/fleet_api_integration/apis/epm/install_error_rollback.ts +++ b/x-pack/test/fleet_api_integration/apis/epm/install_error_rollback.ts @@ -73,7 +73,7 @@ export default function (providerContext: FtrProviderContext) { expect(JSON.parse(goodPkgInfoResponse.text).item.status).to.be('installed'); expect(JSON.parse(goodPkgInfoResponse.text).item.version).to.be('0.1.0'); const latestInstallFailedAttempts = - goodPkgInfoResponse.body.item.savedObject.attributes.latest_install_failed_attempts; + goodPkgInfoResponse.body.item.installationInfo.latest_install_failed_attempts; expect(latestInstallFailedAttempts).to.have.length(1); expect(latestInstallFailedAttempts[0].target_version).to.be('0.2.0'); expect(latestInstallFailedAttempts[0].error.message).to.contain( @@ -90,7 +90,7 @@ export default function (providerContext: FtrProviderContext) { expect(JSON.parse(goodPkgInfoResponse.text).item.status).to.be('installed'); expect(JSON.parse(goodPkgInfoResponse.text).item.version).to.be('0.3.0'); const latestInstallFailedAttempts = - goodPkgInfoResponse.body.item.savedObject.attributes.latest_install_failed_attempts; + goodPkgInfoResponse.body.item.installationInfo.latest_install_failed_attempts; expect(latestInstallFailedAttempts).to.have.length(0); }); }); From ce150a3e746b10e35bb48e542d6753a13d4ae877 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Tue, 5 Nov 2024 16:07:13 -0500 Subject: [PATCH 25/25] fix after review --- .../fleet_api_integration/apis/package_policy/update.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/x-pack/test/fleet_api_integration/apis/package_policy/update.ts b/x-pack/test/fleet_api_integration/apis/package_policy/update.ts index 229876fd9bc8e..619ddeb0544e7 100644 --- a/x-pack/test/fleet_api_integration/apis/package_policy/update.ts +++ b/x-pack/test/fleet_api_integration/apis/package_policy/update.ts @@ -15,6 +15,7 @@ import { enableSecrets, } from '../../helpers'; import { testUsers } from '../test_users'; +import { getInstallationInfo } from './helper'; export default function (providerContext: FtrProviderContext) { const { getService } = providerContext; @@ -28,11 +29,6 @@ export default function (providerContext: FtrProviderContext) { expect(sortBy(arr1, 'id')).to.eql(sortBy(arr2, 'id')); }; - const getInstallationInfo = async (name: string, version: string) => { - const res = await supertest.get(`/api/fleet/epm/packages/${name}/${version}`).expect(200); - return res.body.item.installationInfo; - }; - const getPackagePolicyById = async (id: string) => { const { body } = await supertest.get(`/api/fleet/package_policies/${id}`); return body; @@ -935,7 +931,7 @@ export default function (providerContext: FtrProviderContext) { }) .expect(200); - const installation = await getInstallationInfo('integration_to_input', '2.0.0'); + const installation = await getInstallationInfo(supertest, 'integration_to_input', '2.0.0'); expectIdArraysEqual(installation.installed_es, [ // assets from version 1.0.0