parent
e2ec868588
commit
bc1405b7d6
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch B.V. under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch B.V. licenses this file to you under
|
||||
* the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns valid configuration for a beat.yml file for adding the space id
|
||||
* if there is an active space and that space is not the default one.
|
||||
*
|
||||
* @param {object} context - Context object generated from tutorial factory (see #22760)
|
||||
*/
|
||||
export function getSpaceIdForBeatsTutorial(context) {
|
||||
if (!context || !context.spaceId || context.isInDefaultSpace) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return ` space.id: "${context.spaceId}"`;
|
||||
}
|
|
@ -20,8 +20,9 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { INSTRUCTION_VARIANT } from './instruction_variant';
|
||||
import { createTrycloudOption1, createTrycloudOption2 } from './onprem_cloud_instructions';
|
||||
import { getSpaceIdForBeatsTutorial } from '../lib/get_space_id_for_beats_tutorial';
|
||||
|
||||
export const createFilebeatInstructions = () => ({
|
||||
export const createFilebeatInstructions = context => ({
|
||||
INSTALL: {
|
||||
OSX: {
|
||||
title: i18n.translate('kbn.common.tutorials.filebeatInstructions.install.osxTitle', {
|
||||
|
@ -181,6 +182,7 @@ export const createFilebeatInstructions = () => ({
|
|||
' password: "<password>"',
|
||||
'setup.kibana:',
|
||||
' host: "<kibana_url>"',
|
||||
getSpaceIdForBeatsTutorial(context)
|
||||
],
|
||||
textPost: i18n.translate('kbn.common.tutorials.filebeatInstructions.config.osxTextPost', {
|
||||
defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \
|
||||
|
@ -209,6 +211,7 @@ and {kibanaUrlTemplate} is the URL of Kibana.',
|
|||
' password: "<password>"',
|
||||
'setup.kibana:',
|
||||
' host: "<kibana_url>"',
|
||||
getSpaceIdForBeatsTutorial(context)
|
||||
],
|
||||
textPost: i18n.translate('kbn.common.tutorials.filebeatInstructions.config.debTextPost', {
|
||||
defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \
|
||||
|
@ -237,6 +240,7 @@ and {kibanaUrlTemplate} is the URL of Kibana.',
|
|||
' password: "<password>"',
|
||||
'setup.kibana:',
|
||||
' host: "<kibana_url>"',
|
||||
getSpaceIdForBeatsTutorial(context)
|
||||
],
|
||||
textPost: i18n.translate('kbn.common.tutorials.filebeatInstructions.config.rpmTextPost', {
|
||||
defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \
|
||||
|
@ -265,6 +269,7 @@ and {kibanaUrlTemplate} is the URL of Kibana.',
|
|||
' password: "<password>"',
|
||||
'setup.kibana:',
|
||||
' host: "<kibana_url>"',
|
||||
getSpaceIdForBeatsTutorial(context)
|
||||
],
|
||||
textPost: i18n.translate('kbn.common.tutorials.filebeatInstructions.config.windowsTextPost', {
|
||||
defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \
|
||||
|
@ -484,8 +489,8 @@ export function filebeatStatusCheck(moduleName) {
|
|||
};
|
||||
}
|
||||
|
||||
export function onPremInstructions(moduleName, platforms, geoipRequired, uaRequired) {
|
||||
const FILEBEAT_INSTRUCTIONS = createFilebeatInstructions();
|
||||
export function onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context) {
|
||||
const FILEBEAT_INSTRUCTIONS = createFilebeatInstructions(context);
|
||||
|
||||
const variants = [];
|
||||
for (let i = 0; i < platforms.length; i++) {
|
||||
|
|
|
@ -20,8 +20,9 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { INSTRUCTION_VARIANT } from './instruction_variant';
|
||||
import { createTrycloudOption1, createTrycloudOption2 } from './onprem_cloud_instructions';
|
||||
import { getSpaceIdForBeatsTutorial } from '../lib/get_space_id_for_beats_tutorial';
|
||||
|
||||
export const createMetricbeatInstructions = () => ({
|
||||
export const createMetricbeatInstructions = context => ({
|
||||
INSTALL: {
|
||||
OSX: {
|
||||
title: i18n.translate('kbn.common.tutorials.metricbeatInstructions.install.osxTitle', {
|
||||
|
@ -168,6 +169,7 @@ export const createMetricbeatInstructions = () => ({
|
|||
' password: "<password>"',
|
||||
'setup.kibana:',
|
||||
' host: "<kibana_url>"',
|
||||
getSpaceIdForBeatsTutorial(context)
|
||||
],
|
||||
textPost: i18n.translate('kbn.common.tutorials.metricbeatInstructions.config.osxTextPost', {
|
||||
defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \
|
||||
|
@ -196,6 +198,7 @@ and {kibanaUrlTemplate} is the URL of Kibana.',
|
|||
' password: "<password>"',
|
||||
'setup.kibana:',
|
||||
' host: "<kibana_url>"',
|
||||
getSpaceIdForBeatsTutorial(context)
|
||||
],
|
||||
textPost: i18n.translate('kbn.common.tutorials.metricbeatInstructions.config.debTextPost', {
|
||||
defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \
|
||||
|
@ -224,6 +227,7 @@ and {kibanaUrlTemplate} is the URL of Kibana.',
|
|||
' password: "<password>"',
|
||||
'setup.kibana:',
|
||||
' host: "<kibana_url>"',
|
||||
getSpaceIdForBeatsTutorial(context)
|
||||
],
|
||||
textPost: i18n.translate('kbn.common.tutorials.metricbeatInstructions.config.rpmTextPost', {
|
||||
defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \
|
||||
|
@ -252,6 +256,7 @@ and {kibanaUrlTemplate} is the URL of Kibana.',
|
|||
' password: "<password>"',
|
||||
'setup.kibana:',
|
||||
' host: "<kibana_url>"',
|
||||
getSpaceIdForBeatsTutorial(context)
|
||||
],
|
||||
textPost: i18n.translate('kbn.common.tutorials.metricbeatInstructions.config.windowsTextPost', {
|
||||
defaultMessage: 'Where {passwordTemplate} is the password of the `elastic` user, {esUrlTemplate} is the URL of Elasticsearch, \
|
||||
|
@ -444,8 +449,8 @@ export function metricbeatStatusCheck(moduleName) {
|
|||
};
|
||||
}
|
||||
|
||||
export function onPremInstructions(moduleName) {
|
||||
const METRICBEAT_INSTRUCTIONS = createMetricbeatInstructions();
|
||||
export function onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context) {
|
||||
const METRICBEAT_INSTRUCTIONS = createMetricbeatInstructions(context);
|
||||
|
||||
return {
|
||||
instructionSets: [
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function aerospikeMetricsSpecProvider() {
|
||||
export function aerospikeMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'aerospike';
|
||||
return {
|
||||
id: 'aerospikeMetrics',
|
||||
|
@ -53,7 +53,7 @@ export function aerospikeMetricsSpecProvider() {
|
|||
}
|
||||
},
|
||||
completionTimeMinutes: 10,
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/filebeat_instructions';
|
||||
|
||||
export function apacheLogsSpecProvider() {
|
||||
export function apacheLogsSpecProvider(server, context) {
|
||||
const moduleName = 'apache2';
|
||||
const geoipRequired = true;
|
||||
const uaRequired = true;
|
||||
|
@ -59,7 +59,7 @@ export function apacheLogsSpecProvider() {
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
previewImagePath: '/plugins/kibana/home/tutorial_resources/apache_logs/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired),
|
||||
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
|
||||
elasticCloud: cloudInstructions(moduleName, platforms),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function apacheMetricsSpecProvider() {
|
||||
export function apacheMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'apache';
|
||||
return {
|
||||
id: 'apacheMetrics',
|
||||
|
@ -56,7 +56,7 @@ export function apacheMetricsSpecProvider() {
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
previewImagePath: '/plugins/kibana/home/tutorial_resources/apache_metrics/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function cephMetricsSpecProvider() {
|
||||
export function cephMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'ceph';
|
||||
return {
|
||||
id: 'cephMetrics',
|
||||
|
@ -53,7 +53,7 @@ export function cephMetricsSpecProvider() {
|
|||
}
|
||||
},
|
||||
completionTimeMinutes: 10,
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function couchbaseMetricsSpecProvider() {
|
||||
export function couchbaseMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'couchbase';
|
||||
return {
|
||||
id: 'couchbaseMetrics',
|
||||
|
@ -53,7 +53,7 @@ export function couchbaseMetricsSpecProvider() {
|
|||
}
|
||||
},
|
||||
completionTimeMinutes: 10,
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function dockerMetricsSpecProvider() {
|
||||
export function dockerMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'docker';
|
||||
return {
|
||||
id: 'dockerMetrics',
|
||||
|
@ -56,7 +56,7 @@ export function dockerMetricsSpecProvider() {
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
previewImagePath: '/plugins/kibana/home/tutorial_resources/docker_metrics/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function dropwizardMetricsSpecProvider() {
|
||||
export function dropwizardMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'dropwizard';
|
||||
return {
|
||||
id: 'dropwizardMetrics',
|
||||
|
@ -53,7 +53,7 @@ export function dropwizardMetricsSpecProvider() {
|
|||
}
|
||||
},
|
||||
completionTimeMinutes: 10,
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function elasticsearchMetricsSpecProvider() {
|
||||
export function elasticsearchMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'elasticsearch';
|
||||
return {
|
||||
id: 'elasticsearchMetrics',
|
||||
|
@ -54,7 +54,7 @@ export function elasticsearchMetricsSpecProvider() {
|
|||
}
|
||||
},
|
||||
completionTimeMinutes: 10,
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function etcdMetricsSpecProvider() {
|
||||
export function etcdMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'etcd';
|
||||
return {
|
||||
id: 'etcdMetrics',
|
||||
|
@ -53,7 +53,7 @@ export function etcdMetricsSpecProvider() {
|
|||
}
|
||||
},
|
||||
completionTimeMinutes: 10,
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function golangMetricsSpecProvider() {
|
||||
export function golangMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'golang';
|
||||
return {
|
||||
id: moduleName + 'Metrics',
|
||||
|
@ -56,7 +56,7 @@ export function golangMetricsSpecProvider() {
|
|||
}
|
||||
},
|
||||
completionTimeMinutes: 10,
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function haproxyMetricsSpecProvider() {
|
||||
export function haproxyMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'haproxy';
|
||||
return {
|
||||
id: 'haproxyMetrics',
|
||||
|
@ -53,7 +53,7 @@ export function haproxyMetricsSpecProvider() {
|
|||
}
|
||||
},
|
||||
completionTimeMinutes: 10,
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/filebeat_instructions';
|
||||
|
||||
export function kafkaLogsSpecProvider() {
|
||||
export function kafkaLogsSpecProvider(server, context) {
|
||||
const moduleName = 'kafka';
|
||||
const geoipRequired = false;
|
||||
const uaRequired = false;
|
||||
|
@ -59,7 +59,7 @@ export function kafkaLogsSpecProvider() {
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
previewImagePath: '/plugins/kibana/home/tutorial_resources/kafka_logs/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired),
|
||||
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
|
||||
elasticCloud: cloudInstructions(moduleName, platforms),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function kafkaMetricsSpecProvider() {
|
||||
export function kafkaMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'kafka';
|
||||
return {
|
||||
id: 'kafkaMetrics',
|
||||
|
@ -53,7 +53,7 @@ export function kafkaMetricsSpecProvider() {
|
|||
}
|
||||
},
|
||||
completionTimeMinutes: 10,
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function kibanaMetricsSpecProvider() {
|
||||
export function kibanaMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'kibana';
|
||||
return {
|
||||
id: 'kibanaMetrics',
|
||||
|
@ -54,7 +54,7 @@ export function kibanaMetricsSpecProvider() {
|
|||
}
|
||||
},
|
||||
completionTimeMinutes: 10,
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function kubernetesMetricsSpecProvider() {
|
||||
export function kubernetesMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'kubernetes';
|
||||
return {
|
||||
id: 'kubernetesMetrics',
|
||||
|
@ -56,7 +56,7 @@ export function kubernetesMetricsSpecProvider() {
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
previewImagePath: '/plugins/kibana/home/tutorial_resources/kubernetes_metrics/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function logstashMetricsSpecProvider() {
|
||||
export function logstashMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'logstash';
|
||||
return {
|
||||
id: moduleName + 'Metrics',
|
||||
|
@ -55,7 +55,7 @@ export function logstashMetricsSpecProvider() {
|
|||
}
|
||||
},
|
||||
completionTimeMinutes: 10,
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function memcachedMetricsSpecProvider() {
|
||||
export function memcachedMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'memcached';
|
||||
return {
|
||||
id: 'memcachedMetrics',
|
||||
|
@ -53,7 +53,7 @@ export function memcachedMetricsSpecProvider() {
|
|||
}
|
||||
},
|
||||
completionTimeMinutes: 10,
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function mongodbMetricsSpecProvider() {
|
||||
export function mongodbMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'mongodb';
|
||||
return {
|
||||
id: 'mongodbMetrics',
|
||||
|
@ -56,7 +56,7 @@ export function mongodbMetricsSpecProvider() {
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
previewImagePath: '/plugins/kibana/home/tutorial_resources/mongodb_metrics/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function muninMetricsSpecProvider() {
|
||||
export function muninMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'munin';
|
||||
return {
|
||||
id: 'muninMetrics',
|
||||
|
@ -53,7 +53,7 @@ export function muninMetricsSpecProvider() {
|
|||
}
|
||||
},
|
||||
completionTimeMinutes: 10,
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/filebeat_instructions';
|
||||
|
||||
export function mysqlLogsSpecProvider() {
|
||||
export function mysqlLogsSpecProvider(server, context) {
|
||||
const moduleName = 'mysql';
|
||||
const geoipRequired = false;
|
||||
const uaRequired = false;
|
||||
|
@ -59,7 +59,7 @@ export function mysqlLogsSpecProvider() {
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
previewImagePath: '/plugins/kibana/home/tutorial_resources/mysql_logs/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired),
|
||||
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
|
||||
elasticCloud: cloudInstructions(moduleName, platforms),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function mysqlMetricsSpecProvider() {
|
||||
export function mysqlMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'mysql';
|
||||
return {
|
||||
id: 'mysqlMetrics',
|
||||
|
@ -56,7 +56,7 @@ export function mysqlMetricsSpecProvider() {
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
previewImagePath: '/plugins/kibana/home/tutorial_resources/mysql_metrics/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/filebeat_instructions';
|
||||
|
||||
export function nginxLogsSpecProvider() {
|
||||
export function nginxLogsSpecProvider(server, context) {
|
||||
const moduleName = 'nginx';
|
||||
const geoipRequired = true;
|
||||
const uaRequired = true;
|
||||
|
@ -59,7 +59,7 @@ export function nginxLogsSpecProvider() {
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
previewImagePath: '/plugins/kibana/home/tutorial_resources/nginx_logs/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired),
|
||||
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
|
||||
elasticCloud: cloudInstructions(moduleName, platforms),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function nginxMetricsSpecProvider() {
|
||||
export function nginxMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'nginx';
|
||||
return {
|
||||
id: 'nginxMetrics',
|
||||
|
@ -60,7 +60,7 @@ which must be enabled in your Nginx installation. \
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
previewImagePath: '/plugins/kibana/home/tutorial_resources/nginx_metrics/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/filebeat_instructions';
|
||||
|
||||
export function osqueryLogsSpecProvider() {
|
||||
export function osqueryLogsSpecProvider(server, context) {
|
||||
const moduleName = 'osquery';
|
||||
const geoipRequired = false;
|
||||
const uaRequired = false;
|
||||
|
@ -59,7 +59,7 @@ export function osqueryLogsSpecProvider() {
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
previewImagePath: '/plugins/kibana/home/tutorial_resources/osquery_logs/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired),
|
||||
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
|
||||
elasticCloud: cloudInstructions(moduleName, platforms),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function phpfpmMetricsSpecProvider() {
|
||||
export function phpfpmMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'php_fpm';
|
||||
return {
|
||||
id: 'phpfpmMetrics',
|
||||
|
@ -55,7 +55,7 @@ export function phpfpmMetricsSpecProvider() {
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
//previewImagePath: '/plugins/kibana/home/tutorial_resources/php_fpm_metrics/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function postgresqlMetricsSpecProvider() {
|
||||
export function postgresqlMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'postgresql';
|
||||
return {
|
||||
id: 'postgresqlMetrics',
|
||||
|
@ -57,7 +57,7 @@ export function postgresqlMetricsSpecProvider() {
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
//previewImagePath: '/plugins/kibana/home/tutorial_resources/postgresql_metrics/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function prometheusMetricsSpecProvider() {
|
||||
export function prometheusMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'prometheus';
|
||||
return {
|
||||
id: moduleName + 'Metrics',
|
||||
|
@ -54,7 +54,7 @@ export function prometheusMetricsSpecProvider() {
|
|||
}
|
||||
},
|
||||
completionTimeMinutes: 10,
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function rabbitmqMetricsSpecProvider() {
|
||||
export function rabbitmqMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'rabbitmq';
|
||||
return {
|
||||
id: 'rabbitmqMetrics',
|
||||
|
@ -57,7 +57,7 @@ export function rabbitmqMetricsSpecProvider() {
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
previewImagePath: '/plugins/kibana/home/tutorial_resources/rabbitmq_metrics/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/filebeat_instructions';
|
||||
|
||||
export function redisLogsSpecProvider() {
|
||||
export function redisLogsSpecProvider(server, context) {
|
||||
const moduleName = 'redis';
|
||||
const geoipRequired = false;
|
||||
const uaRequired = false;
|
||||
|
@ -65,7 +65,7 @@ Note that the `slowlog` fileset is experimental. \
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
previewImagePath: '/plugins/kibana/home/tutorial_resources/redis_logs/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired),
|
||||
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
|
||||
elasticCloud: cloudInstructions(moduleName, platforms),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function redisMetricsSpecProvider() {
|
||||
export function redisMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'redis';
|
||||
return {
|
||||
id: 'redisMetrics',
|
||||
|
@ -56,7 +56,7 @@ export function redisMetricsSpecProvider() {
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
previewImagePath: '/plugins/kibana/home/tutorial_resources/redis_metrics/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/filebeat_instructions';
|
||||
|
||||
export function systemLogsSpecProvider() {
|
||||
export function systemLogsSpecProvider(server, context) {
|
||||
const moduleName = 'system';
|
||||
const geoipRequired = true;
|
||||
const uaRequired = false;
|
||||
|
@ -59,7 +59,7 @@ Unix/Linux based distributions. This module is not available on Windows. \
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
previewImagePath: '/plugins/kibana/home/tutorial_resources/system_logs/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired),
|
||||
onPrem: onPremInstructions(moduleName, platforms, geoipRequired, uaRequired, context),
|
||||
elasticCloud: cloudInstructions(moduleName, platforms),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName, platforms)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function systemMetricsSpecProvider() {
|
||||
export function systemMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'system';
|
||||
return {
|
||||
id: 'systemMetrics',
|
||||
|
@ -56,7 +56,7 @@ It collects system wide statistics and statistics per process and filesystem. \
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
previewImagePath: '/plugins/kibana/home/tutorial_resources/system_metrics/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function uwsgiMetricsSpecProvider() {
|
||||
export function uwsgiMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'uwsgi';
|
||||
return {
|
||||
id: 'uwsgiMetrics',
|
||||
|
@ -57,7 +57,7 @@ export function uwsgiMetricsSpecProvider() {
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
previewImagePath: '/plugins/kibana/home/tutorial_resources/uwsgi_metrics/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function vSphereMetricsSpecProvider() {
|
||||
export function vSphereMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'vsphere';
|
||||
return {
|
||||
id: 'vsphereMetrics',
|
||||
|
@ -54,7 +54,7 @@ export function vSphereMetricsSpecProvider() {
|
|||
},
|
||||
completionTimeMinutes: 10,
|
||||
//previewImagePath: '/plugins/kibana/home/tutorial_resources/vsphere_metrics/screenshot.png',
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function windowsMetricsSpecProvider() {
|
||||
export function windowsMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'windows';
|
||||
return {
|
||||
id: 'windowsMetrics',
|
||||
|
@ -53,7 +53,7 @@ export function windowsMetricsSpecProvider() {
|
|||
}
|
||||
},
|
||||
completionTimeMinutes: 10,
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
|
||||
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';
|
||||
|
||||
export function zookeeperMetricsSpecProvider() {
|
||||
export function zookeeperMetricsSpecProvider(server, context) {
|
||||
const moduleName = 'zookeeper';
|
||||
return {
|
||||
id: moduleName + 'Metrics',
|
||||
|
@ -54,7 +54,7 @@ export function zookeeperMetricsSpecProvider() {
|
|||
}
|
||||
},
|
||||
completionTimeMinutes: 10,
|
||||
onPrem: onPremInstructions(moduleName),
|
||||
onPrem: onPremInstructions(moduleName, null, null, null, context),
|
||||
elasticCloud: cloudInstructions(moduleName),
|
||||
onPremElasticCloud: onPremCloudInstructions(moduleName)
|
||||
};
|
||||
|
|
|
@ -52,3 +52,23 @@ test(`returns the id for the current space when a server basepath is defined`, (
|
|||
const service = createSpacesService(server);
|
||||
expect(service.getSpaceId(request)).toEqual('my-space-context');
|
||||
});
|
||||
|
||||
test(`returns true if the current space is the default one`, () => {
|
||||
const request = createRequest(DEFAULT_SPACE_ID, '/foo');
|
||||
const server = createMockServer({
|
||||
'server.basePath': '/foo',
|
||||
});
|
||||
|
||||
const service = createSpacesService(server);
|
||||
expect(service.isInDefaultSpace(request)).toEqual(true);
|
||||
});
|
||||
|
||||
test(`returns false if the current space is not the default one`, () => {
|
||||
const request = createRequest('my-space-context', '/foo');
|
||||
const server = createMockServer({
|
||||
'server.basePath': '/foo',
|
||||
});
|
||||
|
||||
const service = createSpacesService(server);
|
||||
expect(service.isInDefaultSpace(request)).toEqual(false);
|
||||
});
|
||||
|
|
|
@ -4,9 +4,11 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import { DEFAULT_SPACE_ID } from '../../common/constants';
|
||||
import { getSpaceIdFromPath } from './spaces_url_parser';
|
||||
|
||||
export interface SpacesService {
|
||||
isInDefaultSpace: (req: any) => boolean;
|
||||
getSpaceId: (req: any) => string;
|
||||
}
|
||||
|
||||
|
@ -24,15 +26,25 @@ export function createSpacesService(server: any): SpacesService {
|
|||
return spaceId;
|
||||
}
|
||||
|
||||
function isInDefaultSpace(request: any) {
|
||||
if (!contextCache.has(request)) {
|
||||
populateCache(request);
|
||||
}
|
||||
|
||||
return contextCache.get(request).isInDefaultSpace;
|
||||
}
|
||||
|
||||
function populateCache(request: any) {
|
||||
const spaceId = getSpaceIdFromPath(request.getBasePath(), serverBasePath);
|
||||
|
||||
contextCache.set(request, {
|
||||
spaceId,
|
||||
isInDefaultSpace: spaceId === DEFAULT_SPACE_ID,
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
getSpaceId,
|
||||
isInDefaultSpace,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ describe('createSpacesTutorialContextFactory', () => {
|
|||
|
||||
expect(contextFactory(request)).toEqual({
|
||||
spaceId: 'my-space-id',
|
||||
isInDefaultSpace: false,
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -50,6 +51,7 @@ describe('createSpacesTutorialContextFactory', () => {
|
|||
|
||||
expect(contextFactory(request)).toEqual({
|
||||
spaceId: DEFAULT_SPACE_ID,
|
||||
isInDefaultSpace: true,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -10,6 +10,7 @@ export function createSpacesTutorialContextFactory(spacesService: SpacesService)
|
|||
return function spacesTutorialContextFactory(request: any) {
|
||||
return {
|
||||
spaceId: spacesService.getSpaceId(request),
|
||||
isInDefaultSpace: spacesService.isInDefaultSpace(request),
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue