Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe('Fleet - packageToPackagePolicy', () => {
index_pattern: [],
map: [],
lens: [],
ml_module: [],
},
elasticsearch: {
ingest_pipeline: [],
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/fleet/common/types/models/epm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export enum KibanaAssetType {
indexPattern = 'index_pattern',
map = 'map',
lens = 'lens',
mlModule = 'ml_module',
}

/*
Expand All @@ -62,6 +63,7 @@ export enum KibanaSavedObjectType {
indexPattern = 'index-pattern',
map = 'map',
lens = 'lens',
mlModule = 'ml-module',
}

export enum ElasticsearchAssetType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const AssetTitleMap: Record<AssetType, string> = {
map: 'Map',
data_stream_ilm_policy: 'Data Stream ILM Policy',
lens: 'Lens',
ml_module: 'ML Module',
};

export const ServiceTitleMap: Record<ServiceName, string> = {
Expand All @@ -47,6 +48,7 @@ export const AssetIcons: Record<KibanaAssetType, IconType> = {
visualization: 'visualizeApp',
map: 'emsApp',
lens: 'lensApp',
ml_module: 'mlApp',
};

export const ServiceIcons: Record<ServiceName, IconType> = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const KibanaSavedObjectTypeMapping: Record<KibanaAssetType, KibanaSavedObjectTyp
[KibanaAssetType.search]: KibanaSavedObjectType.search,
[KibanaAssetType.visualization]: KibanaSavedObjectType.visualization,
[KibanaAssetType.lens]: KibanaSavedObjectType.lens,
[KibanaAssetType.mlModule]: KibanaSavedObjectType.mlModule,
};

// Define how each asset type will be installed
Expand All @@ -53,6 +54,7 @@ const AssetInstallers: Record<
[KibanaAssetType.search]: installKibanaSavedObjects,
[KibanaAssetType.visualization]: installKibanaSavedObjects,
[KibanaAssetType.lens]: installKibanaSavedObjects,
[KibanaAssetType.mlModule]: installKibanaSavedObjects,
};

export async function getKibanaAsset(key: string): Promise<ArchiveAsset> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,11 @@ const expectAssetsInstalled = ({
id: 'sample_lens',
});
expect(resLens.id).equal('sample_lens');
const resMlModule = await kibanaServer.savedObjects.get({
type: 'ml-module',
id: 'sample_ml_module',
});
expect(resMlModule.id).equal('sample_ml_module');
const resIndexPattern = await kibanaServer.savedObjects.get({
type: 'index-pattern',
id: 'test-*',
Expand Down Expand Up @@ -459,6 +464,10 @@ const expectAssetsInstalled = ({
id: 'sample_lens',
type: 'lens',
},
{
id: 'sample_ml_module',
type: 'ml-module',
},
{
id: 'sample_search',
type: 'search',
Expand Down Expand Up @@ -526,6 +535,7 @@ const expectAssetsInstalled = ({
{ id: '47758dc2-979d-5fbe-a2bd-9eded68a5a43', type: 'epm-packages-assets' },
{ id: '318959c9-997b-5a14-b328-9fc7355b4b74', type: 'epm-packages-assets' },
{ id: 'e21b59b5-eb76-5ab0-bef2-1c8e379e6197', type: 'epm-packages-assets' },
{ id: '4c758d70-ecf1-56b3-b704-6d8374841b34', type: 'epm-packages-assets' },
{ id: 'e786cbd9-0f3b-5a0b-82a6-db25145ebf58', type: 'epm-packages-assets' },
{ id: '53c94591-aa33-591d-8200-cd524c2a0561', type: 'epm-packages-assets' },
{ id: 'b658d2d4-752e-54b8-afc2-4c76155c1466', type: 'epm-packages-assets' },
Expand Down
5 changes: 5 additions & 0 deletions x-pack/test/fleet_api_integration/apis/epm/update_assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ export default function (providerContext: FtrProviderContext) {
id: 'sample_lens',
type: 'lens',
},
{
id: 'sample_ml_module',
type: 'ml-module',
},
],
installed_es: [
{
Expand Down Expand Up @@ -344,6 +348,7 @@ export default function (providerContext: FtrProviderContext) {
{ id: '48e582df-b1d2-5f88-b6ea-ba1fafd3a569', type: 'epm-packages-assets' },
{ id: 'bf3b0b65-9fdc-53c6-a9ca-e76140e56490', type: 'epm-packages-assets' },
{ id: '7f4c5aca-b4f5-5f0a-95af-051da37513fc', type: 'epm-packages-assets' },
{ id: '4281a436-45a8-54ab-9724-fda6849f789d', type: 'epm-packages-assets' },
{ id: '2e56f08b-1d06-55ed-abee-4708e1ccf0aa', type: 'epm-packages-assets' },
{ id: 'c7bf1a39-e057-58a0-afde-fb4b48751d8c', type: 'epm-packages-assets' },
{ id: '8c665f28-a439-5f43-b5fd-8fda7b576735', type: 'epm-packages-assets' },
Expand Down
Loading