Skip to content

Commit

Permalink
TEMP commit: test Kibana API action
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonelizabeth committed Apr 22, 2021
1 parent edbc2a4 commit 480b6cd
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/plugins/timelion/server/deprecations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ export async function getDeprecations({
'In the toolbar, click Save.',
'On the Save visualization window, enter the visualization Title, then click Save and return.',
],
api: {
method: 'POST',
path: '/api/upgrade_assistant/test',
},
},
});
}
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/upgrade_assistant/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { registerReindexIndicesRoutes, createReindexWorker } from './routes/rein
import { registerTelemetryRoutes } from './routes/telemetry';
import { registerUpdateSettingsRoute } from './routes/update_index_settings';
import { telemetrySavedObjectType, reindexOperationSavedObjectType } from './saved_object_types';
import { registerTestRoutes } from './routes/test';

import { RouteDependencies } from './types';

Expand Down Expand Up @@ -113,6 +114,7 @@ export class UpgradeAssistantServerPlugin implements Plugin {
// Bootstrap the needed routes and the collector for the telemetry
registerTelemetryRoutes(dependencies);
registerUpdateSettingsRoute(dependencies);
registerTestRoutes(dependencies);

if (usageCollection) {
getStartServices().then(([{ savedObjects: savedObjectsService, elasticsearch }]) => {
Expand Down
35 changes: 35 additions & 0 deletions x-pack/plugins/upgrade_assistant/server/routes/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { API_BASE_PATH } from '../../common/constants';
import { versionCheckHandlerWrapper } from '../lib/es_version_precheck';
import { RouteDependencies } from '../types';

export function registerTestRoutes({ router }: RouteDependencies) {
router.post(
{
path: `${API_BASE_PATH}/test`,
validate: false,
},
versionCheckHandlerWrapper(
async (
{
core: {
savedObjects: { client: savedObjectsClient },
elasticsearch: { client },
},
},
request,
response
) => {
return response.ok({
body: {},
});
}
)
);
}

0 comments on commit 480b6cd

Please sign in to comment.