Skip to content

Commit

Permalink
making endpoints internal
Browse files Browse the repository at this point in the history
  • Loading branch information
jgowdyelastic committed Apr 12, 2021
1 parent e0d2d2f commit 0aa4952
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions x-pack/plugins/file_upload/public/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export async function analyzeFile(
const body = JSON.stringify(file);
const fileUploadModules = await lazyLoadFileUploadModules();
return await fileUploadModules.getHttp().fetch<any>({
path: `/api/file_upload/analyze_file`,
path: `/internal/file_upload/analyze_file`,
method: 'POST',
body,
query: params,
Expand All @@ -81,7 +81,7 @@ export async function checkIndexExists(
const body = JSON.stringify({ index });
const fileUploadModules = await lazyLoadFileUploadModules();
return await fileUploadModules.getHttp().fetch<any>({
path: `/api/file_upload/index_exists`,
path: `/internal/file_upload/index_exists`,
method: 'POST',
body,
query: params,
Expand All @@ -101,7 +101,7 @@ export async function getTimeFieldRange({

const fileUploadModules = await lazyLoadFileUploadModules();
return await fileUploadModules.getHttp().fetch<GetTimeFieldRangeResponse>({
path: `/api/file_upload/time_field_range`,
path: `/internal/file_upload/time_field_range`,
method: 'POST',
body,
});
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/file_upload/public/importer/importer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export function callImportRoute({
});

return getHttp().fetch<ImportResponse>({
path: `/api/file_upload/import`,
path: `/internal/file_upload/import`,
method: 'POST',
query,
body,
Expand Down
16 changes: 8 additions & 8 deletions x-pack/plugins/file_upload/server/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ export function fileUploadRoutes(coreSetup: CoreSetup<StartDeps, unknown>, logge
/**
* @apiGroup FileDataVisualizer
*
* @api {post} /api/file_upload/analyze_file Analyze file data
* @api {post} /internal/file_upload/analyze_file Analyze file data
* @apiName AnalyzeFile
* @apiDescription Performs analysis of the file data.
*
* @apiSchema (query) analyzeFileQuerySchema
*/
router.post(
{
path: '/api/file_upload/analyze_file',
path: '/internal/file_upload/analyze_file',
validate: {
body: schema.any(),
query: analyzeFileQuerySchema,
Expand Down Expand Up @@ -131,7 +131,7 @@ export function fileUploadRoutes(coreSetup: CoreSetup<StartDeps, unknown>, logge
/**
* @apiGroup FileDataVisualizer
*
* @api {post} /api/file_upload/import Import file data
* @api {post} /internal/file_upload/import Import file data
* @apiName ImportFile
* @apiDescription Imports file data into elasticsearch index.
*
Expand All @@ -140,7 +140,7 @@ export function fileUploadRoutes(coreSetup: CoreSetup<StartDeps, unknown>, logge
*/
router.post(
{
path: '/api/file_upload/import',
path: '/internal/file_upload/import',
validate: {
query: importFileQuerySchema,
body: importFileBodySchema,
Expand Down Expand Up @@ -185,12 +185,12 @@ export function fileUploadRoutes(coreSetup: CoreSetup<StartDeps, unknown>, logge
/**
* @apiGroup FileDataVisualizer
*
* @api {post} /api/file_upload/index_exists ES Field caps wrapper checks if index exists
* @api {post} /internal/file_upload/index_exists ES Field caps wrapper checks if index exists
* @apiName IndexExists
*/
router.post(
{
path: '/api/file_upload/index_exists',
path: '/internal/file_upload/index_exists',
validate: {
body: schema.object({ index: schema.string() }),
},
Expand Down Expand Up @@ -223,7 +223,7 @@ export function fileUploadRoutes(coreSetup: CoreSetup<StartDeps, unknown>, logge
/**
* @apiGroup FileDataVisualizer
*
* @api {post} /api/file_upload/time_field_range Get time field range
* @api {post} /internal/file_upload/time_field_range Get time field range
* @apiName GetTimeFieldRange
* @apiDescription Returns the time range for the given index and query using the specified time range.
*
Expand All @@ -234,7 +234,7 @@ export function fileUploadRoutes(coreSetup: CoreSetup<StartDeps, unknown>, logge
*/
router.post(
{
path: '/api/file_upload/time_field_range',
path: '/internal/file_upload/time_field_range',
validate: {
body: schema.object({
/** Index or indexes for which to return the time range. */
Expand Down

0 comments on commit 0aa4952

Please sign in to comment.