diff --git a/x-pack/plugins/maps/common/types.ts b/x-pack/plugins/maps/common/types.ts index 404697ee77f693..806eac597ac57b 100644 --- a/x-pack/plugins/maps/common/types.ts +++ b/x-pack/plugins/maps/common/types.ts @@ -5,7 +5,7 @@ * 2.0. */ -export interface CreateIndexSourceResp { +export interface CreateDocSourceResp { success: boolean; error?: Error; } diff --git a/x-pack/plugins/maps/server/create_index_source.ts b/x-pack/plugins/maps/server/create_doc_source.ts similarity index 93% rename from x-pack/plugins/maps/server/create_index_source.ts rename to x-pack/plugins/maps/server/create_doc_source.ts index 385dcf2b56edbd..641a2acf42384e 100644 --- a/x-pack/plugins/maps/server/create_index_source.ts +++ b/x-pack/plugins/maps/server/create_doc_source.ts @@ -8,7 +8,7 @@ import { ElasticsearchClient, IScopedClusterClient } from 'kibana/server'; import { INDEX_META_DATA_CREATED_BY, - CreateIndexSourceResp, + CreateDocSourceResp, IndexSourceMappings, BodySettings, } from '../common'; @@ -21,12 +21,12 @@ const DEFAULT_MAPPINGS = { }, }; -export async function createIndexSource( +export async function createDocSource( index: string, mappings: IndexSourceMappings, { asCurrentUser }: IScopedClusterClient, indexPatternsService: IndexPatternsService -): Promise { +): Promise { try { await createIndex(index, mappings, asCurrentUser); await indexPatternsService.createAndSave( diff --git a/x-pack/plugins/maps/server/routes.js b/x-pack/plugins/maps/server/routes.js index 34f694e420af34..d4c0652fa535c3 100644 --- a/x-pack/plugins/maps/server/routes.js +++ b/x-pack/plugins/maps/server/routes.js @@ -34,7 +34,7 @@ import { schema } from '@kbn/config-schema'; import fs from 'fs'; import path from 'path'; import { initMVTRoutes } from './mvt/mvt_routes'; -import { createIndexSource } from './create_index_source'; +import { createDocSource } from './create_doc_source'; const EMPTY_EMS_CLIENT = { async getFileLayers() { @@ -619,7 +619,7 @@ export async function initRoutes( context.core.savedObjects.client, context.core.elasticsearch.client.asCurrentUser ); - const result = await createIndexSource( + const result = await createDocSource( index, mappings, context.core.elasticsearch.client, diff --git a/x-pack/test/api_integration/apis/maps/create_index_and_pattern.js b/x-pack/test/api_integration/apis/maps/create_doc_source.js similarity index 95% rename from x-pack/test/api_integration/apis/maps/create_index_and_pattern.js rename to x-pack/test/api_integration/apis/maps/create_doc_source.js index 792d1fe29d79bb..759862de4a0985 100644 --- a/x-pack/test/api_integration/apis/maps/create_index_and_pattern.js +++ b/x-pack/test/api_integration/apis/maps/create_doc_source.js @@ -10,7 +10,7 @@ import expect from '@kbn/expect'; export default function ({ getService }) { const supertest = getService('supertest'); - describe('index and pattern creation', () => { + describe('doc source creation', () => { it('should create an index and pattern', async () => { const resp = await supertest .post(`/api/maps/docSource`) diff --git a/x-pack/test/api_integration/apis/maps/index.js b/x-pack/test/api_integration/apis/maps/index.js index 11b91b5d3c4b8a..898c3d56ecc2fc 100644 --- a/x-pack/test/api_integration/apis/maps/index.js +++ b/x-pack/test/api_integration/apis/maps/index.js @@ -14,7 +14,7 @@ export default function ({ loadTestFile, getService }) { }); describe('', () => { - loadTestFile(require.resolve('./create_index_and_pattern')); + loadTestFile(require.resolve('./create_doc_source')); loadTestFile(require.resolve('./fonts_api')); loadTestFile(require.resolve('./index_settings')); loadTestFile(require.resolve('./migrations'));