diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/create.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/create.ts index a49f3e42c50f8..e2cf97dd094a9 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/create.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/create.ts @@ -11,7 +11,10 @@ import { v4 as uuidV4 } from 'uuid'; import type { RuleMigration } from '../../../../../common/siem_migrations/model/rule_migration.gen'; import type { CreateRuleMigrationResponse } from '../../../../../common/siem_migrations/model/api/rules/rules_migration.gen'; import { CreateRuleMigrationRequestBody } from '../../../../../common/siem_migrations/model/api/rules/rules_migration.gen'; -import { SIEM_RULE_MIGRATIONS_PATH } from '../../../../../common/siem_migrations/constants'; +import { + SIEM_RULE_MIGRATIONS_PATH, + SiemMigrationsStatus, +} from '../../../../../common/siem_migrations/constants'; import type { SecuritySolutionPluginRouter } from '../../../../types'; export const registerSiemRuleMigrationsCreateRoute = ( @@ -45,7 +48,7 @@ export const registerSiemRuleMigrationsCreateRoute = ( '@timestamp': timestamp, migration_id: migrationId, original_rule: originalRule, - status: 'pending', + status: SiemMigrationsStatus.PENDING, })); await siemMigrationClient.rules.create(ruleMigrations); diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/index.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/index.ts index 74e6277493d6c..0de49eb7df92b 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/index.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/index.ts @@ -14,5 +14,4 @@ export const registerSiemRuleMigrationsRoutes = ( logger: Logger ) => { registerSiemRuleMigrationsCreateRoute(router, logger); - // TODO: registerSiemRuleMigrationsGetRoute(router, logger); }; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data_stream/rule_migrations_data_stream.test.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data_stream/rule_migrations_data_stream.test.ts index 23fdec280cdce..56510da48f1bb 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data_stream/rule_migrations_data_stream.test.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data_stream/rule_migrations_data_stream.test.ts @@ -78,7 +78,7 @@ describe('SiemRuleMigrationsDataStream', () => { }); describe('installSpace', () => { - it('should install space', async () => { + it('should install space data stream', async () => { const dataStream = new RuleMigrationsDataStream({ kibanaVersion: '8.13.0' }); const params: InstallParams = { esClient, @@ -95,7 +95,7 @@ describe('SiemRuleMigrationsDataStream', () => { expect(dataStreamSpacesAdapter.installSpace).toHaveBeenCalledWith('space1'); }); - it('should not install space if install not executed', async () => { + it('should not install space data stream if install not executed', async () => { const dataStream = new RuleMigrationsDataStream({ kibanaVersion: '8.13.0' }); await expect(dataStream.installSpace('space1')).rejects.toThrowError(); }); diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data_stream/rule_migrations_data_stream.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data_stream/rule_migrations_data_stream.ts index 640257532db5e..83eb471e0cee3 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data_stream/rule_migrations_data_stream.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data_stream/rule_migrations_data_stream.ts @@ -38,10 +38,7 @@ export class RuleMigrationsDataStream { this.installPromise = this.dataStream.install(params); await this.installPromise; } catch (err) { - params.logger.error( - `Error installing siem rule migrations data stream. Data quality dashboard persistence may be impacted.- ${err.message}`, - err - ); + params.logger.error(`Error installing siem rule migrations data stream. ${err.message}`, err); } }