From b444fc19ea43d7041c24b1e98d434446003e22d9 Mon Sep 17 00:00:00 2001 From: chrisronline Date: Thu, 1 Oct 2020 15:27:18 -0400 Subject: [PATCH] Remove this check --- .../elasticsearch/verify_ccs_availability.js | 25 ------------------- .../server/routes/api/v1/cluster/cluster.js | 2 -- .../server/routes/api/v1/cluster/clusters.js | 2 -- 3 files changed, 29 deletions(-) delete mode 100644 x-pack/plugins/monitoring/server/lib/elasticsearch/verify_ccs_availability.js diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/verify_ccs_availability.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/verify_ccs_availability.js deleted file mode 100644 index ed9094dbb22fb5..00000000000000 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/verify_ccs_availability.js +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ - -import Boom from 'boom'; - -export async function verifyCcsAvailability(req) { - const { callWithRequest } = req.server.plugins.elasticsearch.getCluster('monitoring'); - - const response = await callWithRequest(req, 'cluster.remoteInfo'); - for (const remoteName in response) { - if (!response.hasOwnProperty(remoteName)) { - continue; - } - const remoteInfo = response[remoteName]; - if (!remoteInfo.connected) { - throw Boom.serverUnavailable( - `There seems to be some issues with ${remoteName} ` + - `cluster. Please make sure it's connected and has at least one node.` - ); - } - } -} diff --git a/x-pack/plugins/monitoring/server/routes/api/v1/cluster/cluster.js b/x-pack/plugins/monitoring/server/routes/api/v1/cluster/cluster.js index 0035411d92f668..92e1257576d93e 100644 --- a/x-pack/plugins/monitoring/server/routes/api/v1/cluster/cluster.js +++ b/x-pack/plugins/monitoring/server/routes/api/v1/cluster/cluster.js @@ -8,7 +8,6 @@ import { schema } from '@kbn/config-schema'; import { getClustersFromRequest } from '../../../../lib/cluster/get_clusters_from_request'; import { handleError } from '../../../../lib/errors'; import { getIndexPatterns } from '../../../../lib/cluster/get_index_patterns'; -import { verifyCcsAvailability } from '../../../../lib/elasticsearch/verify_ccs_availability'; export function clusterRoute(server) { /* @@ -34,7 +33,6 @@ export function clusterRoute(server) { }, handler: async (req) => { const config = server.config(); - await verifyCcsAvailability(req); const indexPatterns = getIndexPatterns(server, { filebeatIndexPattern: config.get('monitoring.ui.logs.index'), diff --git a/x-pack/plugins/monitoring/server/routes/api/v1/cluster/clusters.js b/x-pack/plugins/monitoring/server/routes/api/v1/cluster/clusters.js index 67de8d79df95d8..acc40796058eea 100644 --- a/x-pack/plugins/monitoring/server/routes/api/v1/cluster/clusters.js +++ b/x-pack/plugins/monitoring/server/routes/api/v1/cluster/clusters.js @@ -7,7 +7,6 @@ import { schema } from '@kbn/config-schema'; import { getClustersFromRequest } from '../../../../lib/cluster/get_clusters_from_request'; import { verifyMonitoringAuth } from '../../../../lib/elasticsearch/verify_monitoring_auth'; -import { verifyCcsAvailability } from '../../../../lib/elasticsearch/verify_ccs_availability'; import { handleError } from '../../../../lib/errors'; import { getIndexPatterns } from '../../../../lib/cluster/get_index_patterns'; @@ -39,7 +38,6 @@ export function clustersRoute(server) { // the monitoring data. `try/catch` makes it a little more explicit. try { await verifyMonitoringAuth(req); - await verifyCcsAvailability(req); const indexPatterns = getIndexPatterns(server, { filebeatIndexPattern: config.get('monitoring.ui.logs.index'), });