diff --git a/packages/kbn-apm-synthtrace/src/lib/entities/entities_synthtrace_kibana_client.ts b/packages/kbn-apm-synthtrace/src/lib/entities/entities_synthtrace_kibana_client.ts index 677b69f0ae759..05158e0df4a87 100644 --- a/packages/kbn-apm-synthtrace/src/lib/entities/entities_synthtrace_kibana_client.ts +++ b/packages/kbn-apm-synthtrace/src/lib/entities/entities_synthtrace_kibana_client.ts @@ -42,7 +42,7 @@ export class EntitiesSynthtraceKibanaClient { this.logger.debug('Entity definitions are already defined'); } else { this.logger.debug('Installing Entity definitions'); - const entityEnablementUrl = `${this.target}/internal/entities/managed/enablement?installOnly=true`; + const entityEnablementUrl = `${this.target}/api/entities/managed/enablement?installOnly=true`; await fetch(entityEnablementUrl, { method: 'PUT', headers: kibanaHeaders(), @@ -52,7 +52,7 @@ export class EntitiesSynthtraceKibanaClient { } async uninstallEntityIndexPatterns() { - const url = `${this.target}/internal/entities/managed/enablement`; + const url = `${this.target}/api/entities/managed/enablement`; await fetch(url, { method: 'DELETE', headers: kibanaHeaders(), diff --git a/x-pack/plugins/entity_manager/public/lib/entity_client.ts b/x-pack/plugins/entity_manager/public/lib/entity_client.ts index dc22a0b991b0d..08f5cfbd3c6b0 100644 --- a/x-pack/plugins/entity_manager/public/lib/entity_client.ts +++ b/x-pack/plugins/entity_manager/public/lib/entity_client.ts @@ -27,12 +27,12 @@ type QueryParamOf = Exclude[ type DeleteEntityDefinitionQuery = QueryParamOf< ClientRequestParamsOf< EntityManagerRouteRepository, - 'DELETE /internal/entities/managed/enablement' + 'DELETE /api/entities/managed/enablement' > >; type CreateEntityDefinitionQuery = QueryParamOf< - ClientRequestParamsOf + ClientRequestParamsOf >; export class EntityClient { @@ -43,14 +43,14 @@ export class EntityClient { } async isManagedEntityDiscoveryEnabled(): Promise { - return await this.repositoryClient('GET /internal/entities/managed/enablement'); + return await this.repositoryClient('GET /api/entities/managed/enablement'); } async enableManagedEntityDiscovery( query?: CreateEntityDefinitionQuery ): Promise { try { - return await this.repositoryClient('PUT /internal/entities/managed/enablement', { + return await this.repositoryClient('PUT /api/entities/managed/enablement', { params: { query: { installOnly: query?.installOnly, @@ -69,7 +69,7 @@ export class EntityClient { query?: DeleteEntityDefinitionQuery ): Promise { try { - return await this.repositoryClient('DELETE /internal/entities/managed/enablement', { + return await this.repositoryClient('DELETE /api/entities/managed/enablement', { params: { query: { deleteData: query?.deleteData, diff --git a/x-pack/plugins/entity_manager/server/routes/enablement/check.ts b/x-pack/plugins/entity_manager/server/routes/enablement/check.ts index 1c67643c5c902..fb6f74a4b618a 100644 --- a/x-pack/plugins/entity_manager/server/routes/enablement/check.ts +++ b/x-pack/plugins/entity_manager/server/routes/enablement/check.ts @@ -22,7 +22,7 @@ import { createEntityManagerServerRoute } from '../create_entity_manager_server_ /** * @openapi - * /internal/entities/managed/enablement: + * /api/entities/managed/enablement: * get: * description: Check if managed (built-in) entity discovery is enabled. Enabled entity discovery requires a valid api key and the latest version of the builtin definitions installed and running. * tags: @@ -44,7 +44,7 @@ import { createEntityManagerServerRoute } from '../create_entity_manager_server_ * example: api_key_not_found */ export const checkEntityDiscoveryEnabledRoute = createEntityManagerServerRoute({ - endpoint: 'GET /internal/entities/managed/enablement', + endpoint: 'GET /api/entities/managed/enablement', handler: async ({ response, logger, server }) => { try { logger.debug('reading entity discovery API key from saved object'); diff --git a/x-pack/plugins/entity_manager/server/routes/enablement/disable.ts b/x-pack/plugins/entity_manager/server/routes/enablement/disable.ts index 01208fe19d7a0..4b6f42a5e97db 100644 --- a/x-pack/plugins/entity_manager/server/routes/enablement/disable.ts +++ b/x-pack/plugins/entity_manager/server/routes/enablement/disable.ts @@ -15,7 +15,7 @@ import { createEntityManagerServerRoute } from '../create_entity_manager_server_ /** * @openapi - * /internal/entities/managed/enablement: + * /api/entities/managed/enablement: * delete: * description: Disable managed (built-in) entity discovery. This stops and deletes the transforms, ingest pipelines, definitions saved objects, and index templates for this entity definition, as well as the stored API key for entity discovery management. * tags: @@ -43,7 +43,7 @@ import { createEntityManagerServerRoute } from '../create_entity_manager_server_ * description: The current user does not have the required permissions to disable entity discovery */ export const disableEntityDiscoveryRoute = createEntityManagerServerRoute({ - endpoint: 'DELETE /internal/entities/managed/enablement', + endpoint: 'DELETE /api/entities/managed/enablement', params: z.object({ query: z.object({ deleteData: z.optional(BooleanFromString).default(false), diff --git a/x-pack/plugins/entity_manager/server/routes/enablement/enable.ts b/x-pack/plugins/entity_manager/server/routes/enablement/enable.ts index 9a851e08b5673..39cadc449415a 100644 --- a/x-pack/plugins/entity_manager/server/routes/enablement/enable.ts +++ b/x-pack/plugins/entity_manager/server/routes/enablement/enable.ts @@ -27,7 +27,7 @@ import { startTransforms } from '../../lib/entities/start_transforms'; /** * @openapi - * /internal/entities/managed/enablement: + * /api/entities/managed/enablement: * put: * description: Enable managed (built-in) entity discovery. * tags: @@ -62,7 +62,7 @@ import { startTransforms } from '../../lib/entities/start_transforms'; * description: The current user does not have the required permissions to enable entity discovery */ export const enableEntityDiscoveryRoute = createEntityManagerServerRoute({ - endpoint: 'PUT /internal/entities/managed/enablement', + endpoint: 'PUT /api/entities/managed/enablement', params: z.object({ query: createEntityDefinitionQuerySchema, }), diff --git a/x-pack/plugins/observability_solution/inventory/e2e/cypress/e2e/home.cy.ts b/x-pack/plugins/observability_solution/inventory/e2e/cypress/e2e/home.cy.ts index c18f8866475ab..86089aaa79cd3 100644 --- a/x-pack/plugins/observability_solution/inventory/e2e/cypress/e2e/home.cy.ts +++ b/x-pack/plugins/observability_solution/inventory/e2e/cypress/e2e/home.cy.ts @@ -27,7 +27,7 @@ describe('Home page', () => { describe('When EEM is enabled', () => { describe('When there is no entities', () => { it('Shows inventory page with empty message', () => { - cy.intercept('GET', '/internal/entities/managed/enablement', { + cy.intercept('GET', '/api/entities/managed/enablement', { fixture: 'eem_enabled.json', }).as('getEEMStatus'); cy.visitKibana('/app/inventory'); @@ -60,7 +60,7 @@ describe('Home page', () => { }); it('Shows inventory page with entities', () => { - cy.intercept('GET', '/internal/entities/managed/enablement', { + cy.intercept('GET', '/api/entities/managed/enablement', { fixture: 'eem_enabled.json', }).as('getEEMStatus'); cy.visitKibana('/app/inventory'); @@ -74,7 +74,7 @@ describe('Home page', () => { }); it('Navigates to apm when clicking on a service type entity', () => { - cy.intercept('GET', '/internal/entities/managed/enablement', { + cy.intercept('GET', '/api/entities/managed/enablement', { fixture: 'eem_enabled.json', }).as('getEEMStatus'); cy.visitKibana('/app/inventory'); @@ -84,7 +84,7 @@ describe('Home page', () => { }); it('Navigates to hosts when clicking on a host type entity', () => { - cy.intercept('GET', '/internal/entities/managed/enablement', { + cy.intercept('GET', '/api/entities/managed/enablement', { fixture: 'eem_enabled.json', }).as('getEEMStatus'); cy.visitKibana('/app/inventory'); @@ -94,7 +94,7 @@ describe('Home page', () => { }); it('Navigates to infra when clicking on a container type entity', () => { - cy.intercept('GET', '/internal/entities/managed/enablement', { + cy.intercept('GET', '/api/entities/managed/enablement', { fixture: 'eem_enabled.json', }).as('getEEMStatus'); cy.visitKibana('/app/inventory'); @@ -104,7 +104,7 @@ describe('Home page', () => { }); it('Filters entities by service type', () => { - cy.intercept('GET', '/internal/entities/managed/enablement', { + cy.intercept('GET', '/api/entities/managed/enablement', { fixture: 'eem_enabled.json', }).as('getEEMStatus'); cy.intercept('GET', '/internal/inventory/entities*').as('getEntitites'); @@ -121,7 +121,7 @@ describe('Home page', () => { }); it('Filters entities by host type', () => { - cy.intercept('GET', '/internal/entities/managed/enablement', { + cy.intercept('GET', '/api/entities/managed/enablement', { fixture: 'eem_enabled.json', }).as('getEEMStatus'); cy.intercept('GET', '/internal/inventory/entities*').as('getEntitites'); @@ -138,7 +138,7 @@ describe('Home page', () => { }); it('Filters entities by container type', () => { - cy.intercept('GET', '/internal/entities/managed/enablement', { + cy.intercept('GET', '/api/entities/managed/enablement', { fixture: 'eem_enabled.json', }).as('getEEMStatus'); cy.intercept('GET', '/internal/inventory/entities*').as('getEntitites'); diff --git a/x-pack/test/api_integration/apis/entity_manager/builtin_definitions.ts b/x-pack/test/api_integration/apis/entity_manager/builtin_definitions.ts index 66ca29c10cc9d..4a726bde2e1eb 100644 --- a/x-pack/test/api_integration/apis/entity_manager/builtin_definitions.ts +++ b/x-pack/test/api_integration/apis/entity_manager/builtin_definitions.ts @@ -24,7 +24,7 @@ export default function ({ getService }: FtrProviderContext) { const enablementRequest = (method: 'get' | 'put' | 'delete') => async (auth: Auth, expectedCode: number, query: { [key: string]: any } = {}) => { - const response = await supertestWithoutAuth[method]('/internal/entities/managed/enablement') + const response = await supertestWithoutAuth[method]('/api/entities/managed/enablement') .auth(auth.username, auth.password) .query(query) .set('kbn-xsrf', 'xxx')