diff --git a/.ci/Jenkinsfile_coverage b/.ci/Jenkinsfile_coverage index 6b8dc31bab34e..f2a58e7b6a7ac 100644 --- a/.ci/Jenkinsfile_coverage +++ b/.ci/Jenkinsfile_coverage @@ -44,7 +44,7 @@ kibanaPipeline(timeoutMinutes: 180) { 'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10), ]), ]) - workers.base(name: 'coverage-worker', label: 'tests-l', ramDisk: false, bootstrapped: false) { + workers.base(name: 'coverage-worker', size: 'l', ramDisk: false, bootstrapped: false) { kibanaPipeline.downloadCoverageArtifacts() kibanaPipeline.bash( ''' diff --git a/.ci/Jenkinsfile_visual_baseline b/.ci/Jenkinsfile_visual_baseline index 5c13ccccd9c6f..815c1345bbb68 100644 --- a/.ci/Jenkinsfile_visual_baseline +++ b/.ci/Jenkinsfile_visual_baseline @@ -7,12 +7,12 @@ kibanaPipeline(timeoutMinutes: 120) { catchError { parallel([ 'oss-visualRegression': { - workers.ci(name: 'oss-visualRegression', label: 'linux && immutable', ramDisk: false) { + workers.ci(name: 'oss-visualRegression', size: 's', ramDisk: false) { kibanaPipeline.functionalTestProcess('oss-visualRegression', './test/scripts/jenkins_visual_regression.sh')(1) } }, 'xpack-visualRegression': { - workers.ci(name: 'xpack-visualRegression', label: 'linux && immutable', ramDisk: false) { + workers.ci(name: 'xpack-visualRegression', size: 's', ramDisk: false) { kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh')(1) } }, diff --git a/.ci/es-snapshots/Jenkinsfile_build_es b/.ci/es-snapshots/Jenkinsfile_build_es index a00bcb3bbc946..a3470cd750738 100644 --- a/.ci/es-snapshots/Jenkinsfile_build_es +++ b/.ci/es-snapshots/Jenkinsfile_build_es @@ -25,7 +25,7 @@ def PROMOTE_WITHOUT_VERIFY = !!params.PROMOTE_WITHOUT_VERIFICATION timeout(time: 120, unit: 'MINUTES') { timestamps { ansiColor('xterm') { - node('linux && immutable') { + node(workers.label('s')) { catchErrors { def VERSION def SNAPSHOT_ID diff --git a/.ci/es-snapshots/Jenkinsfile_verify_es b/.ci/es-snapshots/Jenkinsfile_verify_es index ce472a404c053..ade79f27e10e9 100644 --- a/.ci/es-snapshots/Jenkinsfile_verify_es +++ b/.ci/es-snapshots/Jenkinsfile_verify_es @@ -61,7 +61,7 @@ kibanaPipeline(timeoutMinutes: 120) { } def promoteSnapshot(snapshotVersion, snapshotId) { - node('linux && immutable') { + node(workers.label('s')) { esSnapshots.promote(snapshotVersion, snapshotId) } } diff --git a/docs/infrastructure/index.asciidoc b/docs/infrastructure/index.asciidoc index 60695c0e3f1cf..416e95a8941ce 100644 --- a/docs/infrastructure/index.asciidoc +++ b/docs/infrastructure/index.asciidoc @@ -21,6 +21,8 @@ You can optionally save these views and add them to {kibana-ref}/dashboard.html[ * Seamlessly switch to view the corresponding logs, application traces or uptime information for a component. +* Create alerts based on metric thresholds for one or more components. + To get started, you need to <>. Then you can <>. [role="screenshot"] diff --git a/docs/infrastructure/metrics-explorer.asciidoc b/docs/infrastructure/metrics-explorer.asciidoc index d47581ffe720a..793f09ea83b4f 100644 --- a/docs/infrastructure/metrics-explorer.asciidoc +++ b/docs/infrastructure/metrics-explorer.asciidoc @@ -20,6 +20,7 @@ By default that is set to `@timestamp`. * The interval for the X Axis is set to `auto`. The bucket size is determined by the time range. * To use *Open in Visualize* you need access to the Visualize app. +* To use *Create alert* you need to {kibana-ref}/alerting-getting-started.html#alerting-setup-prerequisites[set up alerting]. [float] [[metrics-explorer-tutorial]] @@ -67,4 +68,8 @@ Choose a graph, click the *Actions* dropdown and select *Open In Visualize*. This opens the graph in {kibana-ref}/TSVB.html[TSVB]. From here you can save the graph and add it to a dashboard as usual. +9. You can also create an alert based on the metrics in a graph. +Choose a graph, click the *Actions* dropdown and select *Create alert*. +This opens the {kibana-ref}/defining-alerts.html[alert flyout] prefilled with mertrics from the chart. + Who's the Metrics Explorer now? You are! diff --git a/docs/management/managing-indices.asciidoc b/docs/management/managing-indices.asciidoc index 933a2ffbf6ee2..946d9ee1b41c7 100644 --- a/docs/management/managing-indices.asciidoc +++ b/docs/management/managing-indices.asciidoc @@ -126,6 +126,23 @@ under the *Mapped fields* tab as follows: [role="screenshot"] image::images/management-index-templates-mappings.png[Mapped fields page] +Alternatively, you can click the *Load JSON* link and define the mapping as JSON: + +[source,js] +---------------------------------- +{ + "properties": { + "geo": { + "properties": { + "coordinates": { + "type": "geo_point" + } + } + } + } +} +---------------------------------- + You can create additional mapping configurations in the *Dynamic templates* and *Advanced options* tabs. No additional mappings are required for this example. diff --git a/package.json b/package.json index 49b5baecda474..46e0b9adfea25 100644 --- a/package.json +++ b/package.json @@ -238,6 +238,7 @@ "react-monaco-editor": "~0.27.0", "react-redux": "^7.1.3", "react-resize-detector": "^4.2.0", + "react-router": "^5.1.2", "react-router-dom": "^5.1.2", "react-sizeme": "^2.3.6", "react-use": "^13.27.0", diff --git a/packages/kbn-optimizer/src/worker/webpack.config.ts b/packages/kbn-optimizer/src/worker/webpack.config.ts index 9337daf419bfa..a3a11783cd82a 100644 --- a/packages/kbn-optimizer/src/worker/webpack.config.ts +++ b/packages/kbn-optimizer/src/worker/webpack.config.ts @@ -27,7 +27,7 @@ import TerserPlugin from 'terser-webpack-plugin'; import webpackMerge from 'webpack-merge'; // @ts-ignore import { CleanWebpackPlugin } from 'clean-webpack-plugin'; -import * as SharedDeps from '@kbn/ui-shared-deps'; +import * as UiSharedDeps from '@kbn/ui-shared-deps'; import { Bundle, WorkerConfig, parseDirPath, DisallowedSyntaxPlugin } from '../common'; @@ -73,7 +73,7 @@ export function getWebpackConfig(bundle: Bundle, worker: WorkerConfig) { }, externals: { - ...SharedDeps.externals, + ...UiSharedDeps.externals, }, plugins: [new CleanWebpackPlugin(), new DisallowedSyntaxPlugin()], diff --git a/packages/kbn-ui-framework/package.json b/packages/kbn-ui-framework/package.json index bcebdf591d6f0..5ea031595d1d4 100644 --- a/packages/kbn-ui-framework/package.json +++ b/packages/kbn-ui-framework/package.json @@ -38,7 +38,7 @@ "brace": "0.11.1", "chalk": "^2.4.2", "chokidar": "3.2.1", - "core-js": "^3.2.1", + "core-js": "^3.6.4", "css-loader": "^3.4.2", "expose-loader": "^0.7.5", "file-loader": "^4.2.0", diff --git a/packages/kbn-ui-shared-deps/entry.js b/packages/kbn-ui-shared-deps/entry.js index 5028c6efdb40e..f19271de8ad27 100644 --- a/packages/kbn-ui-shared-deps/entry.js +++ b/packages/kbn-ui-shared-deps/entry.js @@ -17,31 +17,40 @@ * under the License. */ -// import global polyfills before everything else require('./polyfills'); // must load before angular export const Jquery = require('jquery'); window.$ = window.jQuery = Jquery; -export const Angular = require('angular'); -export const ElasticCharts = require('@elastic/charts'); -export const ElasticEui = require('@elastic/eui'); -export const ElasticEuiLibServices = require('@elastic/eui/lib/services'); -export const ElasticEuiLightTheme = require('@elastic/eui/dist/eui_theme_light.json'); -export const ElasticEuiDarkTheme = require('@elastic/eui/dist/eui_theme_dark.json'); +// stateful deps export const KbnI18n = require('@kbn/i18n'); export const KbnI18nAngular = require('@kbn/i18n/angular'); export const KbnI18nReact = require('@kbn/i18n/react'); +export const Angular = require('angular'); export const Moment = require('moment'); export const MomentTimezone = require('moment-timezone/moment-timezone'); +export const Monaco = require('./monaco.ts'); +export const MonacoBare = require('monaco-editor/esm/vs/editor/editor.api'); export const React = require('react'); export const ReactDom = require('react-dom'); +export const ReactDomServer = require('react-dom/server'); export const ReactIntl = require('react-intl'); export const ReactRouter = require('react-router'); // eslint-disable-line export const ReactRouterDom = require('react-router-dom'); -export const Monaco = require('./monaco.ts'); -export const MonacoBare = require('monaco-editor/esm/vs/editor/editor.api'); -// load timezone data into moment-timezone Moment.tz.load(require('moment-timezone/data/packed/latest.json')); + +// big deps which are locked to a single version +export const Rxjs = require('rxjs'); +export const RxjsOperators = require('rxjs/operators'); +export const ElasticCharts = require('@elastic/charts'); +export const ElasticEui = require('@elastic/eui'); +export const ElasticEuiLibServices = require('@elastic/eui/lib/services'); +export const ElasticEuiLibServicesFormat = require('@elastic/eui/lib/services/format'); +export const ElasticEuiLightTheme = require('@elastic/eui/dist/eui_theme_light.json'); +export const ElasticEuiDarkTheme = require('@elastic/eui/dist/eui_theme_dark.json'); +export const ElasticEuiChartsTheme = require('@elastic/eui/dist/eui_charts_theme'); + +// massive deps that we should really get rid of or reduce in size substantially +export const ElasticsearchBrowser = require('elasticsearch-browser/elasticsearch.js'); diff --git a/packages/kbn-ui-shared-deps/index.d.ts b/packages/kbn-ui-shared-deps/index.d.ts index 7ee96050a1248..dec519da69641 100644 --- a/packages/kbn-ui-shared-deps/index.d.ts +++ b/packages/kbn-ui-shared-deps/index.d.ts @@ -25,7 +25,12 @@ export const distDir: string; /** * Filename of the main bundle file in the distributable directory */ -export const distFilename: string; +export const jsFilename: string; + +/** + * Filename of files that must be loaded before the jsFilename + */ +export const jsDepFilenames: string[]; /** * Filename of the unthemed css file in the distributable directory diff --git a/packages/kbn-ui-shared-deps/index.js b/packages/kbn-ui-shared-deps/index.js index d1bb93ddecd0a..666ec7a46ff06 100644 --- a/packages/kbn-ui-shared-deps/index.js +++ b/packages/kbn-ui-shared-deps/index.js @@ -20,17 +20,14 @@ const Path = require('path'); exports.distDir = Path.resolve(__dirname, 'target'); -exports.distFilename = 'kbn-ui-shared-deps.js'; +exports.jsDepFilenames = ['kbn-ui-shared-deps.@elastic.js']; +exports.jsFilename = 'kbn-ui-shared-deps.js'; exports.baseCssDistFilename = 'kbn-ui-shared-deps.css'; exports.lightCssDistFilename = 'kbn-ui-shared-deps.light.css'; exports.darkCssDistFilename = 'kbn-ui-shared-deps.dark.css'; exports.externals = { + // stateful deps angular: '__kbnSharedDeps__.Angular', - '@elastic/charts': '__kbnSharedDeps__.ElasticCharts', - '@elastic/eui': '__kbnSharedDeps__.ElasticEui', - '@elastic/eui/lib/services': '__kbnSharedDeps__.ElasticEuiLibServices', - '@elastic/eui/dist/eui_theme_light.json': '__kbnSharedDeps__.ElasticEuiLightTheme', - '@elastic/eui/dist/eui_theme_dark.json': '__kbnSharedDeps__.ElasticEuiDarkTheme', '@kbn/i18n': '__kbnSharedDeps__.KbnI18n', '@kbn/i18n/angular': '__kbnSharedDeps__.KbnI18nAngular', '@kbn/i18n/react': '__kbnSharedDeps__.KbnI18nReact', @@ -39,10 +36,31 @@ exports.externals = { 'moment-timezone': '__kbnSharedDeps__.MomentTimezone', react: '__kbnSharedDeps__.React', 'react-dom': '__kbnSharedDeps__.ReactDom', + 'react-dom/server': '__kbnSharedDeps__.ReactDomServer', 'react-intl': '__kbnSharedDeps__.ReactIntl', 'react-router': '__kbnSharedDeps__.ReactRouter', 'react-router-dom': '__kbnSharedDeps__.ReactRouterDom', '@kbn/ui-shared-deps/monaco': '__kbnSharedDeps__.Monaco', // this is how plugins/consumers from npm load monaco 'monaco-editor/esm/vs/editor/editor.api': '__kbnSharedDeps__.MonacoBare', + + /** + * big deps which are locked to a single version + */ + rxjs: '__kbnSharedDeps__.Rxjs', + 'rxjs/operators': '__kbnSharedDeps__.RxjsOperators', + '@elastic/charts': '__kbnSharedDeps__.ElasticCharts', + '@elastic/eui': '__kbnSharedDeps__.ElasticEui', + '@elastic/eui/lib/services': '__kbnSharedDeps__.ElasticEuiLibServices', + '@elastic/eui/lib/services/format': '__kbnSharedDeps__.ElasticEuiLibServicesFormat', + '@elastic/eui/dist/eui_charts_theme': '__kbnSharedDeps__.ElasticEuiChartsTheme', + '@elastic/eui/dist/eui_theme_light.json': '__kbnSharedDeps__.ElasticEuiLightTheme', + '@elastic/eui/dist/eui_theme_dark.json': '__kbnSharedDeps__.ElasticEuiDarkTheme', + + /** + * massive deps that we should really get rid of or reduce in size substantially + */ + elasticsearch: '__kbnSharedDeps__.ElasticsearchBrowser', + 'elasticsearch-browser': '__kbnSharedDeps__.ElasticsearchBrowser', + 'elasticsearch-browser/elasticsearch': '__kbnSharedDeps__.ElasticsearchBrowser', }; diff --git a/packages/kbn-ui-shared-deps/package.json b/packages/kbn-ui-shared-deps/package.json index c76e909d2adbc..e2823f23d0431 100644 --- a/packages/kbn-ui-shared-deps/package.json +++ b/packages/kbn-ui-shared-deps/package.json @@ -1,37 +1,41 @@ { "name": "@kbn/ui-shared-deps", "version": "1.0.0", - "license": "Apache-2.0", "private": true, + "license": "Apache-2.0", "scripts": { "build": "node scripts/build", "kbn:bootstrap": "node scripts/build --dev", "kbn:watch": "node scripts/build --watch" }, - "devDependencies": { + "dependencies": { "@elastic/charts": "^18.1.1", - "abortcontroller-polyfill": "^1.4.0", "@elastic/eui": "21.0.1", - "@kbn/babel-preset": "1.0.0", - "@kbn/dev-utils": "1.0.0", "@kbn/i18n": "1.0.0", - "@yarnpkg/lockfile": "^1.1.0", + "abortcontroller-polyfill": "^1.4.0", "angular": "^1.7.9", - "core-js": "^3.2.1", - "css-loader": "^3.4.2", + "core-js": "^3.6.4", "custom-event-polyfill": "^0.3.0", - "del": "^5.1.0", + "elasticsearch-browser": "^16.7.0", "jquery": "^3.4.1", - "mini-css-extract-plugin": "0.8.0", "moment": "^2.24.0", "moment-timezone": "^0.5.27", + "monaco-editor": "~0.17.0", "react": "^16.12.0", "react-dom": "^16.12.0", "react-intl": "^2.8.0", - "read-pkg": "^5.2.0", + "react-router": "^5.1.2", + "react-router-dom": "^5.1.2", "regenerator-runtime": "^0.13.3", + "rxjs": "^6.5.3", "symbol-observable": "^1.2.0", - "webpack": "^4.41.5", "whatwg-fetch": "^3.0.0" + }, + "devDependencies": { + "@kbn/babel-preset": "1.0.0", + "@kbn/dev-utils": "1.0.0", + "css-loader": "^3.4.2", + "del": "^5.1.0", + "webpack": "^4.41.5" } } diff --git a/packages/kbn-ui-shared-deps/webpack.config.js b/packages/kbn-ui-shared-deps/webpack.config.js index dc6e7ae33dbec..a875274544905 100644 --- a/packages/kbn-ui-shared-deps/webpack.config.js +++ b/packages/kbn-ui-shared-deps/webpack.config.js @@ -23,19 +23,19 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const { REPO_ROOT } = require('@kbn/dev-utils'); const webpack = require('webpack'); -const SharedDeps = require('./index'); +const UiSharedDeps = require('./index'); const MOMENT_SRC = require.resolve('moment/min/moment-with-locales.js'); exports.getWebpackConfig = ({ dev = false } = {}) => ({ mode: dev ? 'development' : 'production', entry: { - [SharedDeps.distFilename.replace(/\.js$/, '')]: './entry.js', - [SharedDeps.darkCssDistFilename.replace(/\.css$/, '')]: [ + 'kbn-ui-shared-deps': './entry.js', + 'kbn-ui-shared-deps.dark': [ '@elastic/eui/dist/eui_theme_dark.css', '@elastic/charts/dist/theme_only_dark.css', ], - [SharedDeps.lightCssDistFilename.replace(/\.css$/, '')]: [ + 'kbn-ui-shared-deps.light': [ '@elastic/eui/dist/eui_theme_light.css', '@elastic/charts/dist/theme_only_light.css', ], @@ -43,7 +43,7 @@ exports.getWebpackConfig = ({ dev = false } = {}) => ({ context: __dirname, devtool: dev ? '#cheap-source-map' : false, output: { - path: SharedDeps.distDir, + path: UiSharedDeps.distDir, filename: '[name].js', sourceMapFilename: '[file].map', publicPath: '__REPLACE_WITH_PUBLIC_PATH__', @@ -81,6 +81,16 @@ exports.getWebpackConfig = ({ dev = false } = {}) => ({ optimization: { noEmitOnErrors: true, + splitChunks: { + cacheGroups: { + 'kbn-ui-shared-deps.@elastic': { + name: 'kbn-ui-shared-deps.@elastic', + test: m => m.resource && m.resource.includes('@elastic'), + chunks: 'all', + enforce: true, + }, + }, + }, }, performance: { diff --git a/packages/kbn-ui-shared-deps/yarn.lock b/packages/kbn-ui-shared-deps/yarn.lock new file mode 120000 index 0000000000000..3f82ebc9cdbae --- /dev/null +++ b/packages/kbn-ui-shared-deps/yarn.lock @@ -0,0 +1 @@ +../../yarn.lock \ No newline at end of file diff --git a/src/legacy/core_plugins/kibana/index.js b/src/legacy/core_plugins/kibana/index.js index cac9ef30fba4f..1d643418997f5 100644 --- a/src/legacy/core_plugins/kibana/index.js +++ b/src/legacy/core_plugins/kibana/index.js @@ -58,7 +58,6 @@ export default function(kibana) { 'plugins/kibana/discover/legacy', 'plugins/kibana/dev_tools', 'plugins/kibana/visualize/legacy', - 'plugins/kibana/dashboard/legacy', ], app: { id: 'kibana', diff --git a/src/legacy/core_plugins/kibana/public/dashboard/_variables.scss b/src/legacy/core_plugins/kibana/public/dashboard/_variables.scss deleted file mode 100644 index 4a715ab255166..0000000000000 --- a/src/legacy/core_plugins/kibana/public/dashboard/_variables.scss +++ /dev/null @@ -1 +0,0 @@ -$dshEditingModeHoverColor: transparentize($euiColorWarning, lightOrDarkTheme(.9, .7)); diff --git a/src/legacy/core_plugins/kibana/public/dashboard/index.ts b/src/legacy/core_plugins/kibana/public/dashboard/index.ts deleted file mode 100644 index 8900d017ef81a..0000000000000 --- a/src/legacy/core_plugins/kibana/public/dashboard/index.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -import { PluginInitializerContext } from 'kibana/public'; -import { DashboardPlugin } from './plugin'; - -export * from './np_ready/dashboard_constants'; - -// Core will be looking for this when loading our plugin in the new platform -export const plugin = (context: PluginInitializerContext) => { - return new DashboardPlugin(context); -}; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/legacy.ts b/src/legacy/core_plugins/kibana/public/dashboard/legacy.ts deleted file mode 100644 index cedb6fbc9b5ef..0000000000000 --- a/src/legacy/core_plugins/kibana/public/dashboard/legacy.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -import { PluginInitializerContext } from 'kibana/public'; -import { npSetup, npStart } from './legacy_imports'; -import { plugin } from './index'; - -(async () => { - const instance = plugin({ - env: npSetup.plugins.kibanaLegacy.env, - } as PluginInitializerContext); - instance.setup(npSetup.core, npSetup.plugins); - instance.start(npStart.core, npStart.plugins); -})(); diff --git a/src/legacy/core_plugins/kibana/public/dashboard/legacy_imports.ts b/src/legacy/core_plugins/kibana/public/dashboard/legacy_imports.ts deleted file mode 100644 index 86bce5997cdd2..0000000000000 --- a/src/legacy/core_plugins/kibana/public/dashboard/legacy_imports.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -/** - * The imports in this file are static functions and types which still live in legacy folders and are used - * within dashboard. To consolidate them all in one place, they are re-exported from this file. Eventually - * this list should become empty. Imports from the top level of shimmed or moved plugins can be imported - * directly where they are needed. - */ - -export { npSetup, npStart } from 'ui/new_platform'; -export { - configureAppAngularModule, - migrateLegacyQuery, - subscribeWithScope, -} from '../../../../../plugins/kibana_legacy/public'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrate_to_730_panels.test.ts b/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrate_to_730_panels.test.ts index e37c8de08fec4..4dd71fd8ee5f4 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrate_to_730_panels.test.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrate_to_730_panels.test.ts @@ -16,28 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -jest.mock( - 'ui/chrome', - () => ({ - getKibanaVersion: () => '6.3.0', - }), - { virtual: true } -); - -jest.mock( - 'ui/notify', - () => ({ - toastNotifications: { - addDanger: () => {}, - }, - }), - { virtual: true } -); - -jest.mock('ui/new_platform'); - import { migratePanelsTo730 } from './migrate_to_730_panels'; -import { SavedDashboardPanelTo60, SavedDashboardPanel730ToLatest } from '../np_ready/types'; import { RawSavedDashboardPanelTo60, RawSavedDashboardPanel610, @@ -46,6 +25,8 @@ import { RawSavedDashboardPanel640To720, DEFAULT_PANEL_WIDTH, DEFAULT_PANEL_HEIGHT, + SavedDashboardPanelTo60, + SavedDashboardPanel730ToLatest, } from '../../../../../../plugins/dashboard/public'; test('6.0 migrates uiState, sort, scales, and gridData', async () => { diff --git a/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrate_to_730_panels.ts b/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrate_to_730_panels.ts index 047ec15f9a5d6..a19c861f092d5 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrate_to_730_panels.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrate_to_730_panels.ts @@ -27,14 +27,11 @@ import { RawSavedDashboardPanel730ToLatest, RawSavedDashboardPanel610, RawSavedDashboardPanel620, -} from '../../../../../../plugins/dashboard/public'; - -import { SavedDashboardPanelTo60, SavedDashboardPanel620, SavedDashboardPanel630, SavedDashboardPanel610, -} from '../np_ready/types'; +} from '../../../../../../plugins/dashboard/public'; const PANEL_HEIGHT_SCALE_FACTOR = 5; const PANEL_HEIGHT_SCALE_FACTOR_WITH_MARGINS = 4; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrations_730.test.ts b/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrations_730.test.ts index 34bb46ce5d407..5a4970897098d 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrations_730.test.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/migrations/migrations_730.test.ts @@ -17,7 +17,7 @@ * under the License. */ -import { migrations } from '../../../migrations/'; +import { migrations } from '../../../migrations'; import { migrations730 } from './migrations_730'; import { DashboardDoc700To720, diff --git a/src/legacy/core_plugins/kibana/public/dashboard/migrations/move_filters_to_query.ts b/src/legacy/core_plugins/kibana/public/dashboard/migrations/move_filters_to_query.ts index 7207f601a225e..01a66445e4fc2 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/migrations/move_filters_to_query.ts +++ b/src/legacy/core_plugins/kibana/public/dashboard/migrations/move_filters_to_query.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Filter, Query } from '../../../../../../plugins/data/public'; +import { Filter, Query } from 'src/plugins/data/public'; export interface Pre600FilterQuery { // pre 6.0.0 global query:queryString:options were stored per dashboard and would diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_constants.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_constants.ts deleted file mode 100644 index 0820ebd371004..0000000000000 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_constants.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -export const DashboardConstants = { - ADD_VISUALIZATION_TO_DASHBOARD_MODE_PARAM: 'addToDashboard', - LANDING_PAGE_PATH: '/dashboards', - CREATE_NEW_DASHBOARD_URL: '/dashboard', - ADD_EMBEDDABLE_ID: 'addEmbeddableId', - ADD_EMBEDDABLE_TYPE: 'addEmbeddableType', - DASHBOARDS_ID: 'dashboards', - DASHBOARD_ID: 'dashboard', -}; - -export function createDashboardEditUrl(id: string) { - return `/dashboard/${id}`; -} diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/np_core.test.mocks.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/np_core.test.mocks.ts deleted file mode 100644 index e1d9cfac95268..0000000000000 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/np_core.test.mocks.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - -let modalContents: React.Component; - -export const getModalContents = () => modalContents; - -jest.mock('ui/new_platform'); - -jest.doMock('ui/metadata', () => ({ - metadata: { - branch: 'my-metadata-branch', - version: 'my-metadata-version', - }, -})); - -jest.doMock('ui/capabilities', () => ({ - uiCapabilities: { - visualize: { - save: true, - }, - }, -})); - -jest.doMock('ui/chrome', () => ({ getKibanaVersion: () => '6.3.0', setVisible: () => {} })); diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/types.ts b/src/legacy/core_plugins/kibana/public/dashboard/np_ready/types.ts deleted file mode 100644 index 9f8682f13d811..0000000000000 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/types.ts +++ /dev/null @@ -1,131 +0,0 @@ -/* - * 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. - */ - -import { ViewMode } from 'src/plugins/embeddable/public'; -import { - RawSavedDashboardPanelTo60, - RawSavedDashboardPanel610, - RawSavedDashboardPanel620, - RawSavedDashboardPanel630, - RawSavedDashboardPanel640To720, - RawSavedDashboardPanel730ToLatest, -} from '../../../../../../plugins/dashboard/public'; -import { Query, Filter } from '../../../../../../plugins/data/public'; - -export type NavAction = (anchorElement?: any) => void; - -/** - * This should always represent the latest dashboard panel shape, after all possible migrations. - */ -export type SavedDashboardPanel = SavedDashboardPanel730ToLatest; - -// id becomes optional starting in 7.3.0 -export type SavedDashboardPanel730ToLatest = Pick< - RawSavedDashboardPanel730ToLatest, - Exclude -> & { - readonly id?: string; - readonly type: string; -}; - -export type SavedDashboardPanel640To720 = Pick< - RawSavedDashboardPanel640To720, - Exclude -> & { - readonly id: string; - readonly type: string; -}; - -export type SavedDashboardPanel630 = Pick< - RawSavedDashboardPanel630, - Exclude -> & { - readonly id: string; - readonly type: string; -}; - -export type SavedDashboardPanel620 = Pick< - RawSavedDashboardPanel620, - Exclude -> & { - readonly id: string; - readonly type: string; -}; - -export type SavedDashboardPanel610 = Pick< - RawSavedDashboardPanel610, - Exclude -> & { - readonly id: string; - readonly type: string; -}; - -export type SavedDashboardPanelTo60 = Pick< - RawSavedDashboardPanelTo60, - Exclude -> & { - readonly id: string; - readonly type: string; -}; - -export interface DashboardAppState { - panels: SavedDashboardPanel[]; - fullScreenMode: boolean; - title: string; - description: string; - timeRestore: boolean; - options: { - hidePanelTitles: boolean; - useMargins: boolean; - }; - query: Query | string; - filters: Filter[]; - viewMode: ViewMode; - savedQuery?: string; -} - -export type DashboardAppStateDefaults = DashboardAppState & { - description?: string; -}; - -export interface DashboardAppStateTransitions { - set: ( - state: DashboardAppState - ) => ( - prop: T, - value: DashboardAppState[T] - ) => DashboardAppState; - setOption: ( - state: DashboardAppState - ) => ( - prop: T, - value: DashboardAppState['options'][T] - ) => DashboardAppState; -} - -export interface SavedDashboardPanelMap { - [key: string]: SavedDashboardPanel; -} - -export interface StagedFilter { - field: string; - value: string; - operator: string; - index: string; -} diff --git a/src/legacy/core_plugins/kibana/public/dashboard/plugin.ts b/src/legacy/core_plugins/kibana/public/dashboard/plugin.ts deleted file mode 100644 index 7452807454fe7..0000000000000 --- a/src/legacy/core_plugins/kibana/public/dashboard/plugin.ts +++ /dev/null @@ -1,219 +0,0 @@ -/* - * 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. - */ - -import { BehaviorSubject } from 'rxjs'; -import { filter, map } from 'rxjs/operators'; -import { - App, - AppMountParameters, - CoreSetup, - CoreStart, - Plugin, - PluginInitializerContext, - SavedObjectsClientContract, -} from 'kibana/public'; -import { i18n } from '@kbn/i18n'; -import { RenderDeps } from './np_ready/application'; -import { - DataPublicPluginStart, - DataPublicPluginSetup, - esFilters, -} from '../../../../../plugins/data/public'; -import { EmbeddableStart } from '../../../../../plugins/embeddable/public'; -import { Storage } from '../../../../../plugins/kibana_utils/public'; -import { NavigationPublicPluginStart as NavigationStart } from '../../../../../plugins/navigation/public'; -import { DashboardConstants } from './np_ready/dashboard_constants'; -import { - FeatureCatalogueCategory, - HomePublicPluginSetup, -} from '../../../../../plugins/home/public'; -import { SharePluginStart } from '../../../../../plugins/share/public'; -import { - AngularRenderedAppUpdater, - KibanaLegacySetup, - KibanaLegacyStart, -} from '../../../../../plugins/kibana_legacy/public'; -import { createKbnUrlTracker } from '../../../../../plugins/kibana_utils/public'; -import { DashboardStart } from '../../../../../plugins/dashboard/public'; - -export interface DashboardPluginStartDependencies { - data: DataPublicPluginStart; - embeddable: EmbeddableStart; - navigation: NavigationStart; - share: SharePluginStart; - kibanaLegacy: KibanaLegacyStart; - dashboard: DashboardStart; -} - -export interface DashboardPluginSetupDependencies { - home: HomePublicPluginSetup; - kibanaLegacy: KibanaLegacySetup; - data: DataPublicPluginSetup; -} - -export class DashboardPlugin implements Plugin { - private startDependencies: { - data: DataPublicPluginStart; - savedObjectsClient: SavedObjectsClientContract; - embeddable: EmbeddableStart; - navigation: NavigationStart; - share: SharePluginStart; - dashboardConfig: KibanaLegacyStart['dashboardConfig']; - dashboard: DashboardStart; - } | null = null; - - private appStateUpdater = new BehaviorSubject(() => ({})); - private stopUrlTracking: (() => void) | undefined = undefined; - - constructor(private initializerContext: PluginInitializerContext) {} - - public setup(core: CoreSetup, { home, kibanaLegacy, data }: DashboardPluginSetupDependencies) { - const { appMounted, appUnMounted, stop: stopUrlTracker } = createKbnUrlTracker({ - baseUrl: core.http.basePath.prepend('/app/kibana'), - defaultSubUrl: `#${DashboardConstants.LANDING_PAGE_PATH}`, - shouldTrackUrlUpdate: pathname => { - const targetAppName = pathname.split('/')[1]; - return ( - targetAppName === DashboardConstants.DASHBOARDS_ID || - targetAppName === DashboardConstants.DASHBOARD_ID - ); - }, - storageKey: 'lastUrl:dashboard', - navLinkUpdater$: this.appStateUpdater, - toastNotifications: core.notifications.toasts, - stateParams: [ - { - kbnUrlKey: '_g', - stateUpdate$: data.query.state$.pipe( - filter( - ({ changes }) => !!(changes.globalFilters || changes.time || changes.refreshInterval) - ), - map(({ state }) => ({ - ...state, - filters: state.filters?.filter(esFilters.isFilterPinned), - })) - ), - }, - ], - }); - this.stopUrlTracking = () => { - stopUrlTracker(); - }; - const app: App = { - id: '', - title: 'Dashboards', - mount: async (params: AppMountParameters) => { - const [coreStart] = await core.getStartServices(); - if (this.startDependencies === null) { - throw new Error('not started yet'); - } - appMounted(); - const { - savedObjectsClient, - embeddable, - navigation, - share, - data: dataStart, - dashboardConfig, - dashboard: { getSavedDashboardLoader }, - } = this.startDependencies; - const savedDashboards = getSavedDashboardLoader(); - - const deps: RenderDeps = { - pluginInitializerContext: this.initializerContext, - core: coreStart, - dashboardConfig, - navigation, - share, - data: dataStart, - savedObjectsClient, - savedDashboards, - chrome: coreStart.chrome, - addBasePath: coreStart.http.basePath.prepend, - uiSettings: coreStart.uiSettings, - config: kibanaLegacy.config, - savedQueryService: dataStart.query.savedQueries, - embeddable, - dashboardCapabilities: coreStart.application.capabilities.dashboard, - embeddableCapabilities: { - visualizeCapabilities: coreStart.application.capabilities.visualize, - mapsCapabilities: coreStart.application.capabilities.maps, - }, - localStorage: new Storage(localStorage), - }; - const { renderApp } = await import('./np_ready/application'); - const unmount = renderApp(params.element, params.appBasePath, deps); - return () => { - unmount(); - appUnMounted(); - }; - }, - }; - kibanaLegacy.registerLegacyApp({ - ...app, - id: DashboardConstants.DASHBOARD_ID, - // only register the updater in once app, otherwise all updates would happen twice - updater$: this.appStateUpdater.asObservable(), - navLinkId: 'kibana:dashboard', - }); - kibanaLegacy.registerLegacyApp({ ...app, id: DashboardConstants.DASHBOARDS_ID }); - - home.featureCatalogue.register({ - id: DashboardConstants.DASHBOARD_ID, - title: i18n.translate('kbn.dashboard.featureCatalogue.dashboardTitle', { - defaultMessage: 'Dashboard', - }), - description: i18n.translate('kbn.dashboard.featureCatalogue.dashboardDescription', { - defaultMessage: 'Display and share a collection of visualizations and saved searches.', - }), - icon: 'dashboardApp', - path: `/app/kibana#${DashboardConstants.LANDING_PAGE_PATH}`, - showOnHomePage: true, - category: FeatureCatalogueCategory.DATA, - }); - } - - start( - { savedObjects: { client: savedObjectsClient } }: CoreStart, - { - embeddable, - navigation, - data, - share, - kibanaLegacy: { dashboardConfig }, - dashboard, - }: DashboardPluginStartDependencies - ) { - this.startDependencies = { - data, - savedObjectsClient, - embeddable, - navigation, - share, - dashboardConfig, - dashboard, - }; - } - - stop() { - if (this.stopUrlTracking) { - this.stopUrlTracking(); - } - } -} diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context.js b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context.js index f8e764cbcbebb..5b03b313e4e3e 100644 --- a/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context.js +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context.js @@ -76,6 +76,7 @@ function ContextAppRouteController($routeParams, $scope, $route) { getFilters, setFilters, setAppState, + flushToUrl, } = getState({ defaultStepSize: getServices().uiSettings.get('context:defaultSize'), timeFieldName: indexPattern.timeFieldName, @@ -99,6 +100,7 @@ function ContextAppRouteController($routeParams, $scope, $route) { const [columns, predecessorCount, successorCount] = newValues; if (Array.isArray(columns) && predecessorCount >= 0 && successorCount >= 0) { setAppState({ columns, predecessorCount, successorCount }); + flushToUrl(true); } } ); diff --git a/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context_state.ts b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context_state.ts index bf185f78941de..ed59143b163f6 100644 --- a/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context_state.ts +++ b/src/legacy/core_plugins/kibana/public/discover/np_ready/angular/context_state.ts @@ -109,7 +109,7 @@ interface GetStateReturn { /** * sync state to URL, used for testing */ - flushToUrl: () => void; + flushToUrl: (replace?: boolean) => void; } const GLOBAL_STATE_URL_KEY = '_g'; const APP_STATE_URL_KEY = '_a'; @@ -205,7 +205,7 @@ export function getState({ } }, // helper function just needed for testing - flushToUrl: () => stateStorage.flush(), + flushToUrl: (replace?: boolean) => stateStorage.flush({ replace }), }; } diff --git a/src/legacy/core_plugins/kibana/public/index.scss b/src/legacy/core_plugins/kibana/public/index.scss index 547f44652cf2b..9b7d0afcd7e39 100644 --- a/src/legacy/core_plugins/kibana/public/index.scss +++ b/src/legacy/core_plugins/kibana/public/index.scss @@ -27,7 +27,3 @@ // Local application mount wrapper styles @import 'local_application_service/index'; - -// Dashboard styles -// MUST STAY AT THE BOTTOM BECAUSE OF DARK THEME IMPORTS -@import './dashboard/index'; diff --git a/src/legacy/core_plugins/kibana/public/kibana.js b/src/legacy/core_plugins/kibana/public/kibana.js index df6b08ef76556..bceb3fa7eef8a 100644 --- a/src/legacy/core_plugins/kibana/public/kibana.js +++ b/src/legacy/core_plugins/kibana/public/kibana.js @@ -44,7 +44,6 @@ import 'uiExports/interpreter'; import 'ui/autoload/all'; import './discover/legacy'; import './visualize/legacy'; -import './dashboard/legacy'; import './management'; import './dev_tools'; import 'ui/agg_response'; diff --git a/src/legacy/core_plugins/kibana/public/visualize/legacy_imports.ts b/src/legacy/core_plugins/kibana/public/visualize/legacy_imports.ts index 6a2034d9a62e4..f6d73b987912d 100644 --- a/src/legacy/core_plugins/kibana/public/visualize/legacy_imports.ts +++ b/src/legacy/core_plugins/kibana/public/visualize/legacy_imports.ts @@ -24,7 +24,7 @@ * directly where they are needed. */ -export { DashboardConstants } from '../dashboard/np_ready/dashboard_constants'; +export { DashboardConstants } from '../../../../../plugins/dashboard/public'; export { VisSavedObject, VISUALIZE_EMBEDDABLE_TYPE, diff --git a/src/legacy/ui/ui_render/bootstrap/template.js.hbs b/src/legacy/ui/ui_render/bootstrap/template.js.hbs index 106dbcd9f8ab2..ad4aa97d8ea7a 100644 --- a/src/legacy/ui/ui_render/bootstrap/template.js.hbs +++ b/src/legacy/ui/ui_render/bootstrap/template.js.hbs @@ -76,24 +76,33 @@ if (window.__kbnStrictCsp__ && window.__kbnCspNotEnforced__) { load({ deps: [ + {{#each sharedJsDepFilenames}} + '{{../regularBundlePath}}/kbn-ui-shared-deps/{{this}}', + {{/each}} + ], + urls: [ { deps: [ - '{{dllBundlePath}}/vendors_runtime.bundle.dll.js' + '{{regularBundlePath}}/kbn-ui-shared-deps/{{sharedJsFilename}}', + { + deps: [ + '{{dllBundlePath}}/vendors_runtime.bundle.dll.js' + ], + urls: [ + {{#each dllJsChunks}} + '{{this}}', + {{/each}} + ] + }, + '{{regularBundlePath}}/commons.bundle.js', ], urls: [ - {{#each dllJsChunks}} + '{{regularBundlePath}}/{{appId}}.bundle.js', + {{#each styleSheetPaths}} '{{this}}', {{/each}} ] - }, - '{{regularBundlePath}}/kbn-ui-shared-deps/{{sharedDepsFilename}}', - '{{regularBundlePath}}/commons.bundle.js', - ], - urls: [ - '{{regularBundlePath}}/{{appId}}.bundle.js', - {{#each styleSheetPaths}} - '{{this}}', - {{/each}}, + } ] }); }; diff --git a/src/legacy/ui/ui_render/ui_render_mixin.js b/src/legacy/ui/ui_render/ui_render_mixin.js index 99560b0bf653f..0912d8683fc48 100644 --- a/src/legacy/ui/ui_render/ui_render_mixin.js +++ b/src/legacy/ui/ui_render/ui_render_mixin.js @@ -135,7 +135,8 @@ export function uiRenderMixin(kbnServer, server, config) { dllBundlePath, dllJsChunks, styleSheetPaths, - sharedDepsFilename: UiSharedDeps.distFilename, + sharedJsFilename: UiSharedDeps.jsFilename, + sharedJsDepFilenames: UiSharedDeps.jsDepFilenames, darkMode, }, }); diff --git a/src/plugins/console/public/application/hooks/use_send_current_request_to_es/use_send_current_request_to_es.ts b/src/plugins/console/public/application/hooks/use_send_current_request_to_es/use_send_current_request_to_es.ts index 548366c63aa05..dde793d9b9691 100644 --- a/src/plugins/console/public/application/hooks/use_send_current_request_to_es/use_send_current_request_to_es.ts +++ b/src/plugins/console/public/application/hooks/use_send_current_request_to_es/use_send_current_request_to_es.ts @@ -39,7 +39,7 @@ export const useSendCurrentRequestToES = () => { const requests = await editor.getRequestsInRange(); if (!requests.length) { notifications.toasts.add( - i18n.translate('console.notification.noReqeustSelectedTitle', { + i18n.translate('console.notification.error.noRequestSelectedTitle', { defaultMessage: 'No request selected. Select a request by placing the cursor inside it.', }) @@ -55,7 +55,16 @@ export const useSendCurrentRequestToES = () => { const results = await sendRequestToES({ requests }); results.forEach(({ request: { path, method, data } }) => { - history.addToHistory(path, method, data); + try { + history.addToHistory(path, method, data); + } catch (e) { + // Best effort, but notify the user. + notifications.toasts.addError(e, { + title: i18n.translate('console.notification.error.couldNotSaveRequestTitle', { + defaultMessage: 'Could not save request to history.', + }), + }); + } }); const { polling } = settings.toJSON(); @@ -85,7 +94,7 @@ export const useSendCurrentRequestToES = () => { payload: undefined, }); notifications.toasts.addError(e, { - title: i18n.translate('console.notification.unknownRequestErrorTitle', { + title: i18n.translate('console.notification.error.unknownErrorTitle', { defaultMessage: 'Unknown Request Error', }), }); diff --git a/src/plugins/dashboard/kibana.json b/src/plugins/dashboard/kibana.json index e35599a5f0b66..9bcd999c2dcc0 100644 --- a/src/plugins/dashboard/kibana.json +++ b/src/plugins/dashboard/kibana.json @@ -5,12 +5,12 @@ "data", "embeddable", "inspector", + "kibanaLegacy", + "navigation", "uiActions", "savedObjects" ], - "optionalPlugins": [ - "share" - ], + "optionalPlugins": ["home", "share", "usageCollection"], "server": false, "ui": true } diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/__snapshots__/dashboard_empty_screen.test.tsx.snap b/src/plugins/dashboard/public/application/__snapshots__/dashboard_empty_screen.test.tsx.snap similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/__snapshots__/dashboard_empty_screen.test.tsx.snap rename to src/plugins/dashboard/public/application/__snapshots__/dashboard_empty_screen.test.tsx.snap diff --git a/src/legacy/core_plugins/kibana/public/dashboard/_dashboard_app.scss b/src/plugins/dashboard/public/application/_dashboard_app.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/_dashboard_app.scss rename to src/plugins/dashboard/public/application/_dashboard_app.scss diff --git a/src/legacy/core_plugins/kibana/public/dashboard/_hacks.scss b/src/plugins/dashboard/public/application/_hacks.scss similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/_hacks.scss rename to src/plugins/dashboard/public/application/_hacks.scss diff --git a/src/plugins/dashboard/public/actions/expand_panel_action.test.tsx b/src/plugins/dashboard/public/application/actions/expand_panel_action.test.tsx similarity index 97% rename from src/plugins/dashboard/public/actions/expand_panel_action.test.tsx rename to src/plugins/dashboard/public/application/actions/expand_panel_action.test.tsx index e9696938b8629..0f4a92a1a7b7d 100644 --- a/src/plugins/dashboard/public/actions/expand_panel_action.test.tsx +++ b/src/plugins/dashboard/public/application/actions/expand_panel_action.test.tsx @@ -17,7 +17,7 @@ * under the License. */ -import { isErrorEmbeddable } from '../embeddable_plugin'; +import { isErrorEmbeddable } from '../../embeddable_plugin'; import { ExpandPanelAction } from './expand_panel_action'; import { DashboardContainer } from '../embeddable'; import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers'; @@ -27,7 +27,7 @@ import { ContactCardEmbeddable, ContactCardEmbeddableInput, ContactCardEmbeddableOutput, -} from '../embeddable_plugin_test_samples'; +} from '../../embeddable_plugin_test_samples'; // eslint-disable-next-line import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks'; diff --git a/src/plugins/dashboard/public/actions/expand_panel_action.tsx b/src/plugins/dashboard/public/application/actions/expand_panel_action.tsx similarity index 95% rename from src/plugins/dashboard/public/actions/expand_panel_action.tsx rename to src/plugins/dashboard/public/application/actions/expand_panel_action.tsx index 27d4078411564..d0442fbc26073 100644 --- a/src/plugins/dashboard/public/actions/expand_panel_action.tsx +++ b/src/plugins/dashboard/public/application/actions/expand_panel_action.tsx @@ -18,8 +18,8 @@ */ import { i18n } from '@kbn/i18n'; -import { IEmbeddable } from '../embeddable_plugin'; -import { ActionByType, IncompatibleActionError } from '../ui_actions_plugin'; +import { IEmbeddable } from '../../embeddable_plugin'; +import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin'; import { DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '../embeddable'; export const ACTION_EXPAND_PANEL = 'togglePanel'; diff --git a/src/plugins/dashboard/public/actions/index.ts b/src/plugins/dashboard/public/application/actions/index.ts similarity index 77% rename from src/plugins/dashboard/public/actions/index.ts rename to src/plugins/dashboard/public/application/actions/index.ts index 304fb98b4f842..23c26dbd280f8 100644 --- a/src/plugins/dashboard/public/actions/index.ts +++ b/src/plugins/dashboard/public/application/actions/index.ts @@ -17,5 +17,13 @@ * under the License. */ -export { ExpandPanelAction, ACTION_EXPAND_PANEL } from './expand_panel_action'; -export { ReplacePanelAction, ACTION_REPLACE_PANEL } from './replace_panel_action'; +export { + ExpandPanelAction, + ExpandPanelActionContext, + ACTION_EXPAND_PANEL, +} from './expand_panel_action'; +export { + ReplacePanelAction, + ReplacePanelActionContext, + ACTION_REPLACE_PANEL, +} from './replace_panel_action'; diff --git a/src/plugins/dashboard/public/actions/open_replace_panel_flyout.tsx b/src/plugins/dashboard/public/application/actions/open_replace_panel_flyout.tsx similarity index 92% rename from src/plugins/dashboard/public/actions/open_replace_panel_flyout.tsx rename to src/plugins/dashboard/public/application/actions/open_replace_panel_flyout.tsx index 3472d208f814c..c676ca052d687 100644 --- a/src/plugins/dashboard/public/actions/open_replace_panel_flyout.tsx +++ b/src/plugins/dashboard/public/application/actions/open_replace_panel_flyout.tsx @@ -17,8 +17,8 @@ * under the License. */ import React from 'react'; -import { CoreStart } from '../../../../core/public'; -import { toMountPoint } from '../../../../plugins/kibana_react/public'; +import { CoreStart } from 'src/core/public'; +import { toMountPoint } from '../../../../../plugins/kibana_react/public'; import { ReplacePanelFlyout } from './replace_panel_flyout'; import { IEmbeddable, @@ -26,7 +26,7 @@ import { EmbeddableOutput, EmbeddableStart, IContainer, -} from '../embeddable_plugin'; +} from '../../embeddable_plugin'; export async function openReplacePanelFlyout(options: { embeddable: IContainer; diff --git a/src/plugins/dashboard/public/actions/replace_panel_action.test.tsx b/src/plugins/dashboard/public/application/actions/replace_panel_action.test.tsx similarity index 96% rename from src/plugins/dashboard/public/actions/replace_panel_action.test.tsx rename to src/plugins/dashboard/public/application/actions/replace_panel_action.test.tsx index 2252928f46f6a..cc06bd41379aa 100644 --- a/src/plugins/dashboard/public/actions/replace_panel_action.test.tsx +++ b/src/plugins/dashboard/public/application/actions/replace_panel_action.test.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { isErrorEmbeddable } from '../embeddable_plugin'; +import { isErrorEmbeddable } from '../../embeddable_plugin'; import { ReplacePanelAction } from './replace_panel_action'; import { DashboardContainer } from '../embeddable'; import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers'; @@ -26,8 +26,8 @@ import { ContactCardEmbeddable, ContactCardEmbeddableInput, ContactCardEmbeddableOutput, -} from '../embeddable_plugin_test_samples'; -import { coreMock } from '../../../../core/public/mocks'; +} from '../../embeddable_plugin_test_samples'; +import { coreMock } from '../../../../../core/public/mocks'; import { CoreStart } from 'kibana/public'; // eslint-disable-next-line diff --git a/src/plugins/dashboard/public/actions/replace_panel_action.tsx b/src/plugins/dashboard/public/application/actions/replace_panel_action.tsx similarity index 93% rename from src/plugins/dashboard/public/actions/replace_panel_action.tsx rename to src/plugins/dashboard/public/application/actions/replace_panel_action.tsx index 21ec961917d17..ddc255295e89b 100644 --- a/src/plugins/dashboard/public/actions/replace_panel_action.tsx +++ b/src/plugins/dashboard/public/application/actions/replace_panel_action.tsx @@ -18,10 +18,10 @@ */ import { i18n } from '@kbn/i18n'; -import { CoreStart } from '../../../../core/public'; -import { IEmbeddable, ViewMode, EmbeddableStart } from '../embeddable_plugin'; +import { CoreStart } from 'src/core/public'; +import { IEmbeddable, ViewMode, EmbeddableStart } from '../../embeddable_plugin'; import { DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '../embeddable'; -import { ActionByType, IncompatibleActionError } from '../ui_actions_plugin'; +import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin'; import { openReplacePanelFlyout } from './open_replace_panel_flyout'; export const ACTION_REPLACE_PANEL = 'replacePanel'; diff --git a/src/plugins/dashboard/public/actions/replace_panel_flyout.tsx b/src/plugins/dashboard/public/application/actions/replace_panel_flyout.tsx similarity index 94% rename from src/plugins/dashboard/public/actions/replace_panel_flyout.tsx rename to src/plugins/dashboard/public/application/actions/replace_panel_flyout.tsx index a1cd865f771d4..d182deb813e11 100644 --- a/src/plugins/dashboard/public/actions/replace_panel_flyout.tsx +++ b/src/plugins/dashboard/public/application/actions/replace_panel_flyout.tsx @@ -20,10 +20,15 @@ import { i18n } from '@kbn/i18n'; import React from 'react'; import { EuiFlyout, EuiFlyoutBody, EuiFlyoutHeader, EuiTitle } from '@elastic/eui'; -import { EmbeddableStart } from '../../../../../src/plugins/embeddable/public'; +import { NotificationsStart, Toast } from 'src/core/public'; import { DashboardPanelState } from '../embeddable'; -import { NotificationsStart, Toast } from '../../../../core/public'; -import { IContainer, IEmbeddable, EmbeddableInput, EmbeddableOutput } from '../embeddable_plugin'; +import { + IContainer, + IEmbeddable, + EmbeddableInput, + EmbeddableOutput, + EmbeddableStart, +} from '../../embeddable_plugin'; interface Props { container: IContainer; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/application.ts b/src/plugins/dashboard/public/application/application.ts similarity index 83% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/application.ts rename to src/plugins/dashboard/public/application/application.ts index 877ccab99171d..3134a5bfe2c67 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/application.ts +++ b/src/plugins/dashboard/public/application/application.ts @@ -17,6 +17,8 @@ * under the License. */ +import './index.scss'; + import { EuiIcon } from '@elastic/eui'; import angular, { IModule } from 'angular'; import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular'; @@ -28,20 +30,21 @@ import { SavedObjectsClientContract, PluginInitializerContext, } from 'kibana/public'; -import { Storage } from '../../../../../../plugins/kibana_utils/public'; -import { configureAppAngularModule } from '../legacy_imports'; +import { UsageCollectionSetup } from 'src/plugins/usage_collection/public'; +import { Storage } from '../../../kibana_utils/public'; // @ts-ignore import { initDashboardApp } from './legacy_app'; -import { EmbeddableStart } from '../../../../../../plugins/embeddable/public'; -import { NavigationPublicPluginStart as NavigationStart } from '../../../../../../plugins/navigation/public'; -import { DataPublicPluginStart } from '../../../../../../plugins/data/public'; -import { SharePluginStart } from '../../../../../../plugins/share/public'; +import { EmbeddableStart } from '../../../embeddable/public'; +import { NavigationPublicPluginStart as NavigationStart } from '../../../navigation/public'; +import { DataPublicPluginStart } from '../../../data/public'; +import { SharePluginStart } from '../../../share/public'; import { KibanaLegacyStart, + configureAppAngularModule, createTopNavDirective, createTopNavHelper, -} from '../../../../../../plugins/kibana_legacy/public'; -import { SavedObjectLoader } from '../../../../../../plugins/saved_objects/public'; +} from '../../../kibana_legacy/public'; +import { SavedObjectLoader } from '../../../saved_objects/public'; export interface RenderDeps { pluginInitializerContext: PluginInitializerContext; @@ -62,8 +65,9 @@ export interface RenderDeps { savedQueryService: DataPublicPluginStart['query']['savedQueries']; embeddable: EmbeddableStart; localStorage: Storage; - share: SharePluginStart; + share?: SharePluginStart; config: KibanaLegacyStart['config']; + usageCollection?: UsageCollectionSetup; } let angularModuleInstance: IModule | null = null; @@ -110,13 +114,11 @@ function mountDashboardApp(appBasePath: string, element: HTMLElement) { function createLocalAngularModule(core: AppMountContext['core'], navigation: NavigationStart) { createLocalI18nModule(); - createLocalConfigModule(core); createLocalTopNavModule(navigation); createLocalIconModule(); const dashboardAngularModule = angular.module(moduleName, [ ...thirdPartyAngularDependencies, - 'app/dashboard/Config', 'app/dashboard/I18n', 'app/dashboard/TopNav', 'app/dashboard/icon', @@ -130,16 +132,6 @@ function createLocalIconModule() { .directive('icon', reactDirective => reactDirective(EuiIcon)); } -function createLocalConfigModule(core: AppMountContext['core']) { - angular.module('app/dashboard/Config', []).provider('config', () => { - return { - $get: () => ({ - get: core.uiSettings.get.bind(core.uiSettings), - }), - }; - }); -} - function createLocalTopNavModule(navigation: NavigationStart) { angular .module('app/dashboard/TopNav', ['react']) diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app.html b/src/plugins/dashboard/public/application/dashboard_app.html similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app.html rename to src/plugins/dashboard/public/application/dashboard_app.html diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app.tsx b/src/plugins/dashboard/public/application/dashboard_app.tsx similarity index 87% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app.tsx rename to src/plugins/dashboard/public/application/dashboard_app.tsx index cc7299b884890..150cd8f8fcbb5 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app.tsx +++ b/src/plugins/dashboard/public/application/dashboard_app.tsx @@ -21,20 +21,14 @@ import moment from 'moment'; import { Subscription } from 'rxjs'; import { History } from 'history'; -import { ViewMode } from '../../../../../../plugins/embeddable/public'; -import { SavedObjectDashboard } from '../../../../../../plugins/dashboard/public'; -import { DashboardAppState, SavedDashboardPanel } from './types'; -import { - IIndexPattern, - TimeRange, - Query, - Filter, - SavedQuery, -} from '../../../../../../plugins/data/public'; +import { ViewMode } from 'src/plugins/embeddable/public'; +import { IIndexPattern, TimeRange, Query, Filter, SavedQuery } from 'src/plugins/data/public'; +import { IKbnUrlStateStorage } from 'src/plugins/kibana_utils/public'; +import { DashboardAppState, SavedDashboardPanel } from '../types'; import { DashboardAppController } from './dashboard_app_controller'; import { RenderDeps } from './application'; -import { IKbnUrlStateStorage } from '../../../../../../plugins/kibana_utils/public/'; +import { SavedObjectDashboard } from '../saved_dashboards'; export interface DashboardAppScope extends ng.IScope { dash: SavedObjectDashboard; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app_controller.tsx b/src/plugins/dashboard/public/application/dashboard_app_controller.tsx similarity index 94% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app_controller.tsx rename to src/plugins/dashboard/public/application/dashboard_app_controller.tsx index e38345989598d..d1c7d2d9eba3e 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app_controller.tsx +++ b/src/plugins/dashboard/public/application/dashboard_app_controller.tsx @@ -29,7 +29,6 @@ import { History } from 'history'; import { SavedObjectSaveOpts } from 'src/plugins/saved_objects/public'; import { DashboardEmptyScreen, DashboardEmptyScreenProps } from './dashboard_empty_screen'; -import { migrateLegacyQuery, subscribeWithScope } from '../legacy_imports'; import { connectToQueryState, esFilters, @@ -39,19 +38,15 @@ import { QueryState, SavedQuery, syncQueryStateWithUrl, -} from '../../../../../../plugins/data/public'; -import { - getSavedObjectFinder, - SaveResult, - showSaveModal, -} from '../../../../../../plugins/saved_objects/public'; +} from '../../../data/public'; +import { getSavedObjectFinder, SaveResult, showSaveModal } from '../../../saved_objects/public'; import { DASHBOARD_CONTAINER_TYPE, DashboardContainer, DashboardContainerInput, DashboardPanelState, -} from '../../../../../../plugins/dashboard/public'; +} from './embeddable'; import { EmbeddableFactoryNotFoundError, ErrorEmbeddable, @@ -59,31 +54,29 @@ import { openAddPanelFlyout, ViewMode, ContainerOutput, -} from '../../../../../../plugins/embeddable/public'; -import { NavAction, SavedDashboardPanel } from './types'; +} from '../../../embeddable/public'; +import { NavAction, SavedDashboardPanel } from '../types'; import { showOptionsPopover } from './top_nav/show_options_popover'; import { DashboardSaveModal } from './top_nav/save_modal'; import { showCloneModal } from './top_nav/show_clone_modal'; import { saveDashboard } from './lib'; import { DashboardStateManager } from './dashboard_state_manager'; -import { createDashboardEditUrl, DashboardConstants } from './dashboard_constants'; +import { createDashboardEditUrl, DashboardConstants } from '../dashboard_constants'; import { getTopNavConfig } from './top_nav/get_top_nav_config'; import { TopNavIds } from './top_nav/top_nav_ids'; import { getDashboardTitle } from './dashboard_strings'; import { DashboardAppScope } from './dashboard_app'; import { convertSavedDashboardPanelToPanelState } from './lib/embeddable_saved_object_converters'; import { RenderDeps } from './application'; -import { - IKbnUrlStateStorage, - removeQueryParam, - unhashUrl, -} from '../../../../../../plugins/kibana_utils/public'; +import { IKbnUrlStateStorage, removeQueryParam, unhashUrl } from '../../../kibana_utils/public'; import { addFatalError, AngularHttpError, KibanaLegacyStart, -} from '../../../../../../plugins/kibana_legacy/public'; + migrateLegacyQuery, + subscribeWithScope, +} from '../../../kibana_legacy/public'; export interface DashboardAppControllerDependencies extends RenderDeps { $scope: DashboardAppScope; @@ -128,6 +121,7 @@ export class DashboardAppController { }, history, kbnUrlStateStorage, + usageCollection, }: DashboardAppControllerDependencies) { const filterManager = queryService.filterManager; const queryFilter = filterManager; @@ -145,6 +139,7 @@ export class DashboardAppController { kibanaVersion: pluginInitializerContext.env.packageInfo.version, kbnUrlStateStorage, history, + usageCollection, }); // sync initial app filters from state to filterManager @@ -439,7 +434,7 @@ export class DashboardAppController { const updateBreadcrumbs = () => { chrome.setBreadcrumbs([ { - text: i18n.translate('kbn.dashboard.dashboardAppBreadcrumbsTitle', { + text: i18n.translate('dashboard.dashboardAppBreadcrumbsTitle', { defaultMessage: 'Dashboard', }), href: landingPageUrl(), @@ -680,20 +675,20 @@ export class DashboardAppController { overlays .openConfirm( - i18n.translate('kbn.dashboard.changeViewModeConfirmModal.discardChangesDescription', { + i18n.translate('dashboard.changeViewModeConfirmModal.discardChangesDescription', { defaultMessage: `Once you discard your changes, there's no getting them back.`, }), { confirmButtonText: i18n.translate( - 'kbn.dashboard.changeViewModeConfirmModal.confirmButtonLabel', + 'dashboard.changeViewModeConfirmModal.confirmButtonLabel', { defaultMessage: 'Discard changes' } ), cancelButtonText: i18n.translate( - 'kbn.dashboard.changeViewModeConfirmModal.cancelButtonLabel', + 'dashboard.changeViewModeConfirmModal.cancelButtonLabel', { defaultMessage: 'Continue editing' } ), defaultFocusedButton: EUI_MODAL_CANCEL_BUTTON, - title: i18n.translate('kbn.dashboard.changeViewModeConfirmModal.discardChangesTitle', { + title: i18n.translate('dashboard.changeViewModeConfirmModal.discardChangesTitle', { defaultMessage: 'Discard changes to dashboard?', }), } @@ -722,7 +717,7 @@ export class DashboardAppController { .then(function(id) { if (id) { notifications.toasts.addSuccess({ - title: i18n.translate('kbn.dashboard.dashboardWasSavedSuccessMessage', { + title: i18n.translate('dashboard.dashboardWasSavedSuccessMessage', { defaultMessage: `Dashboard '{dashTitle}' was saved`, values: { dashTitle: dash.title }, }), @@ -744,7 +739,7 @@ export class DashboardAppController { }) .catch(error => { notifications.toasts.addDanger({ - title: i18n.translate('kbn.dashboard.dashboardWasNotSavedDangerMessage', { + title: i18n.translate('dashboard.dashboardWasNotSavedDangerMessage', { defaultMessage: `Dashboard '{dashTitle}' was not saved. Error: {errorMessage}`, values: { dashTitle: dash.title, @@ -899,21 +894,25 @@ export class DashboardAppController { }, }); }; - navActions[TopNavIds.SHARE] = anchorElement => { - share.toggleShareContextMenu({ - anchorElement, - allowEmbed: true, - allowShortUrl: - !dashboardConfig.getHideWriteControls() || dashboardCapabilities.createShortUrl, - shareableUrl: unhashUrl(window.location.href), - objectId: dash.id, - objectType: 'dashboard', - sharingData: { - title: dash.title, - }, - isDirty: dashboardStateManager.getIsDirty(), - }); - }; + + if (share) { + // the share button is only availabale if "share" plugin contract enabled + navActions[TopNavIds.SHARE] = anchorElement => { + share.toggleShareContextMenu({ + anchorElement, + allowEmbed: true, + allowShortUrl: + !dashboardConfig.getHideWriteControls() || dashboardCapabilities.createShortUrl, + shareableUrl: unhashUrl(window.location.href), + objectId: dash.id, + objectType: 'dashboard', + sharingData: { + title: dash.title, + }, + isDirty: dashboardStateManager.getIsDirty(), + }); + }; + } updateViewMode(dashboardStateManager.getViewMode()); diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_empty_screen.test.tsx b/src/plugins/dashboard/public/application/dashboard_empty_screen.test.tsx similarity index 97% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_empty_screen.test.tsx rename to src/plugins/dashboard/public/application/dashboard_empty_screen.test.tsx index d5e22798b4f24..933475d354cfa 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_empty_screen.test.tsx +++ b/src/plugins/dashboard/public/application/dashboard_empty_screen.test.tsx @@ -21,7 +21,7 @@ import { mountWithIntl } from 'test_utils/enzyme_helpers'; import { DashboardEmptyScreen, DashboardEmptyScreenProps } from './dashboard_empty_screen'; // @ts-ignore import { findTestSubject } from '@elastic/eui/lib/test'; -import { coreMock } from '../../../../../../core/public/mocks'; +import { coreMock } from '../../../../core/public/mocks'; describe('DashboardEmptyScreen', () => { const setupMock = coreMock.createSetup(); diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_empty_screen.tsx b/src/plugins/dashboard/public/application/dashboard_empty_screen.tsx similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_empty_screen.tsx rename to src/plugins/dashboard/public/application/dashboard_empty_screen.tsx diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_empty_screen_constants.tsx b/src/plugins/dashboard/public/application/dashboard_empty_screen_constants.tsx similarity index 76% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_empty_screen_constants.tsx rename to src/plugins/dashboard/public/application/dashboard_empty_screen_constants.tsx index 51fe31913662a..4904d08e958d5 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_empty_screen_constants.tsx +++ b/src/plugins/dashboard/public/application/dashboard_empty_screen_constants.tsx @@ -20,70 +20,70 @@ import { i18n } from '@kbn/i18n'; /** READONLY VIEW CONSTANTS **/ -export const emptyDashboardTitle: string = i18n.translate('kbn.dashboard.emptyDashboardTitle', { +export const emptyDashboardTitle: string = i18n.translate('dashboard.emptyDashboardTitle', { defaultMessage: 'This dashboard is empty.', }); export const emptyDashboardAdditionalPrivilege = i18n.translate( - 'kbn.dashboard.emptyDashboardAdditionalPrivilege', + 'dashboard.emptyDashboardAdditionalPrivilege', { defaultMessage: 'You need additional privileges to edit this dashboard.', } ); /** VIEW MODE CONSTANTS **/ -export const fillDashboardTitle: string = i18n.translate('kbn.dashboard.fillDashboardTitle', { +export const fillDashboardTitle: string = i18n.translate('dashboard.fillDashboardTitle', { defaultMessage: 'This dashboard is empty. Let\u2019s fill it up!', }); export const howToStartWorkingOnNewDashboardDescription1: string = i18n.translate( - 'kbn.dashboard.howToStartWorkingOnNewDashboardDescription1', + 'dashboard.howToStartWorkingOnNewDashboardDescription1', { defaultMessage: 'Click', } ); export const howToStartWorkingOnNewDashboardDescription2: string = i18n.translate( - 'kbn.dashboard.howToStartWorkingOnNewDashboardDescription2', + 'dashboard.howToStartWorkingOnNewDashboardDescription2', { defaultMessage: 'in the menu bar above to start adding panels.', } ); export const howToStartWorkingOnNewDashboardEditLinkText: string = i18n.translate( - 'kbn.dashboard.howToStartWorkingOnNewDashboardEditLinkText', + 'dashboard.howToStartWorkingOnNewDashboardEditLinkText', { defaultMessage: 'Edit', } ); export const howToStartWorkingOnNewDashboardEditLinkAriaLabel: string = i18n.translate( - 'kbn.dashboard.howToStartWorkingOnNewDashboardEditLinkAriaLabel', + 'dashboard.howToStartWorkingOnNewDashboardEditLinkAriaLabel', { defaultMessage: 'Edit dashboard', } ); /** EDIT MODE CONSTANTS **/ export const addExistingVisualizationLinkText: string = i18n.translate( - 'kbn.dashboard.addExistingVisualizationLinkText', + 'dashboard.addExistingVisualizationLinkText', { defaultMessage: 'Add an existing', } ); export const addExistingVisualizationLinkAriaLabel: string = i18n.translate( - 'kbn.dashboard.addVisualizationLinkAriaLabel', + 'dashboard.addVisualizationLinkAriaLabel', { defaultMessage: 'Add an existing visualization', } ); export const addNewVisualizationDescription: string = i18n.translate( - 'kbn.dashboard.addNewVisualizationText', + 'dashboard.addNewVisualizationText', { defaultMessage: 'or new object to this dashboard', } ); export const createNewVisualizationButton: string = i18n.translate( - 'kbn.dashboard.createNewVisualizationButton', + 'dashboard.createNewVisualizationButton', { defaultMessage: 'Create new', } ); export const createNewVisualizationButtonAriaLabel: string = i18n.translate( - 'kbn.dashboard.createNewVisualizationButtonAriaLabel', + 'dashboard.createNewVisualizationButtonAriaLabel', { defaultMessage: 'Create new visualization button', } diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_state.test.ts b/src/plugins/dashboard/public/application/dashboard_state.test.ts similarity index 97% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_state.test.ts rename to src/plugins/dashboard/public/application/dashboard_state.test.ts index 14af89f80f9aa..cfb7fc7e56e42 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_state.test.ts +++ b/src/plugins/dashboard/public/application/dashboard_state.test.ts @@ -17,10 +17,9 @@ * under the License. */ -import './np_core.test.mocks'; import { createBrowserHistory } from 'history'; import { DashboardStateManager } from './dashboard_state_manager'; -import { getSavedDashboardMock } from './test_utils'; +import { getSavedDashboardMock } from './test_helpers'; import { InputTimeRange, TimefilterContract, TimeRange } from 'src/plugins/data/public'; import { ViewMode } from 'src/plugins/embeddable/public'; import { createKbnUrlStateStorage } from 'src/plugins/kibana_utils/public'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_state_manager.ts b/src/plugins/dashboard/public/application/dashboard_state_manager.ts similarity index 95% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_state_manager.ts rename to src/plugins/dashboard/public/application/dashboard_state_manager.ts index 9b8f75bdcf953..6025f535ae761 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_state_manager.ts +++ b/src/plugins/dashboard/public/application/dashboard_state_manager.ts @@ -23,18 +23,11 @@ import { Observable, Subscription } from 'rxjs'; import { Moment } from 'moment'; import { History } from 'history'; -import { - DashboardContainer, - SavedObjectDashboard, -} from '../../../../../../plugins/dashboard/public'; -import { ViewMode } from '../../../../../../plugins/embeddable/public'; -import { migrateLegacyQuery } from '../legacy_imports'; -import { - Filter, - Query, - TimefilterContract as Timefilter, -} from '../../../../../../plugins/data/public'; +import { Filter, Query, TimefilterContract as Timefilter } from 'src/plugins/data/public'; +import { UsageCollectionSetup } from 'src/plugins/usage_collection/public'; +import { migrateLegacyQuery } from '../../../kibana_legacy/public'; +import { ViewMode } from '../embeddable_plugin'; import { getAppStateDefaults, migrateAppState, getDashboardIdFromUrl } from './lib'; import { convertPanelStateToSavedDashboardPanel } from './lib/embeddable_saved_object_converters'; import { FilterUtils } from './lib/filter_utils'; @@ -43,14 +36,16 @@ import { DashboardAppStateDefaults, DashboardAppStateTransitions, SavedDashboardPanel, -} from './types'; +} from '../types'; import { createStateContainer, IKbnUrlStateStorage, ISyncStateRef, ReduxLikeStateContainer, syncState, -} from '../../../../../../plugins/kibana_utils/public'; +} from '../../../kibana_utils/public'; +import { SavedObjectDashboard } from '../saved_dashboards'; +import { DashboardContainer } from './embeddable'; /** * Dashboard state manager handles connecting angular and redux state between the angular and react portions of the @@ -89,6 +84,7 @@ export class DashboardStateManager { private readonly kbnUrlStateStorage: IKbnUrlStateStorage; private readonly stateSyncRef: ISyncStateRef; private readonly history: History; + private readonly usageCollection: UsageCollectionSetup | undefined; /** * @@ -103,22 +99,26 @@ export class DashboardStateManager { kibanaVersion, kbnUrlStateStorage, history, + usageCollection, }: { savedDashboard: SavedObjectDashboard; hideWriteControls: boolean; kibanaVersion: string; kbnUrlStateStorage: IKbnUrlStateStorage; history: History; + usageCollection?: UsageCollectionSetup; }) { this.history = history; this.kibanaVersion = kibanaVersion; this.savedDashboard = savedDashboard; this.hideWriteControls = hideWriteControls; + this.usageCollection = usageCollection; // get state defaults from saved dashboard, make sure it is migrated this.stateDefaults = migrateAppState( getAppStateDefaults(this.savedDashboard, this.hideWriteControls), - kibanaVersion + kibanaVersion, + usageCollection ); this.kbnUrlStateStorage = kbnUrlStateStorage; @@ -130,7 +130,8 @@ export class DashboardStateManager { ...this.stateDefaults, ...this.kbnUrlStateStorage.get(this.STATE_STORAGE_KEY), }, - kibanaVersion + kibanaVersion, + usageCollection ); // setup state container using initial state both from defaults and from url @@ -300,7 +301,8 @@ export class DashboardStateManager { // now. TODO: revisit this! this.stateDefaults = migrateAppState( getAppStateDefaults(this.savedDashboard, this.hideWriteControls), - this.kibanaVersion + this.kibanaVersion, + this.usageCollection ); // The original query won't be restored by the above because the query on this.savedDashboard is applied // in place in order for it to affect the visualizations. @@ -519,7 +521,7 @@ export class DashboardStateManager { public syncTimefilterWithDashboardTime(timeFilter: Timefilter) { if (!this.getIsTimeSavedWithDashboard()) { throw new Error( - i18n.translate('kbn.dashboard.stateManager.timeNotSavedWithDashboardErrorMessage', { + i18n.translate('dashboard.stateManager.timeNotSavedWithDashboardErrorMessage', { defaultMessage: 'The time is not saved with this dashboard so should not be synced.', }) ); @@ -540,7 +542,7 @@ export class DashboardStateManager { public syncTimefilterWithDashboardRefreshInterval(timeFilter: Timefilter) { if (!this.getIsTimeSavedWithDashboard()) { throw new Error( - i18n.translate('kbn.dashboard.stateManager.timeNotSavedWithDashboardErrorMessage', { + i18n.translate('dashboard.stateManager.timeNotSavedWithDashboardErrorMessage', { defaultMessage: 'The time is not saved with this dashboard so should not be synced.', }) ); diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_strings.ts b/src/plugins/dashboard/public/application/dashboard_strings.ts similarity index 84% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_strings.ts rename to src/plugins/dashboard/public/application/dashboard_strings.ts index d9406ccba18ba..9109012adcfa6 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_strings.ts +++ b/src/plugins/dashboard/public/application/dashboard_strings.ts @@ -18,7 +18,7 @@ */ import { i18n } from '@kbn/i18n'; -import { ViewMode } from '../../../../../../plugins/embeddable/public'; +import { ViewMode } from '../embeddable_plugin'; /** * @param title {string} the current title of the dashboard @@ -35,18 +35,18 @@ export function getDashboardTitle( ): string { const isEditMode = viewMode === ViewMode.EDIT; let displayTitle: string; - const newDashboardTitle = i18n.translate('kbn.dashboard.savedDashboard.newDashboardTitle', { + const newDashboardTitle = i18n.translate('dashboard.savedDashboard.newDashboardTitle', { defaultMessage: 'New Dashboard', }); const dashboardTitle = isNew ? newDashboardTitle : title; if (isEditMode && isDirty) { - displayTitle = i18n.translate('kbn.dashboard.strings.dashboardUnsavedEditTitle', { + displayTitle = i18n.translate('dashboard.strings.dashboardUnsavedEditTitle', { defaultMessage: 'Editing {title} (unsaved)', values: { title: dashboardTitle }, }); } else if (isEditMode) { - displayTitle = i18n.translate('kbn.dashboard.strings.dashboardEditTitle', { + displayTitle = i18n.translate('dashboard.strings.dashboardEditTitle', { defaultMessage: 'Editing {title}', values: { title: dashboardTitle }, }); diff --git a/src/plugins/dashboard/public/embeddable/dashboard_constants.ts b/src/plugins/dashboard/public/application/embeddable/dashboard_constants.ts similarity index 100% rename from src/plugins/dashboard/public/embeddable/dashboard_constants.ts rename to src/plugins/dashboard/public/application/embeddable/dashboard_constants.ts diff --git a/src/plugins/dashboard/public/embeddable/dashboard_container.test.tsx b/src/plugins/dashboard/public/application/embeddable/dashboard_container.test.tsx similarity index 97% rename from src/plugins/dashboard/public/embeddable/dashboard_container.test.tsx rename to src/plugins/dashboard/public/application/embeddable/dashboard_container.test.tsx index 6a734cb68fd9c..6785a373c065b 100644 --- a/src/plugins/dashboard/public/embeddable/dashboard_container.test.tsx +++ b/src/plugins/dashboard/public/application/embeddable/dashboard_container.test.tsx @@ -20,7 +20,7 @@ // @ts-ignore import { findTestSubject } from '@elastic/eui/lib/test'; import { nextTick } from 'test_utils/enzyme_helpers'; -import { isErrorEmbeddable, ViewMode } from '../embeddable_plugin'; +import { isErrorEmbeddable, ViewMode } from '../../embeddable_plugin'; import { DashboardContainer, DashboardContainerOptions } from './dashboard_container'; import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers'; import { @@ -29,7 +29,7 @@ import { ContactCardEmbeddableInput, ContactCardEmbeddable, ContactCardEmbeddableOutput, -} from '../embeddable_plugin_test_samples'; +} from '../../embeddable_plugin_test_samples'; // eslint-disable-next-line import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks'; diff --git a/src/plugins/dashboard/public/embeddable/dashboard_container.tsx b/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx similarity index 92% rename from src/plugins/dashboard/public/embeddable/dashboard_container.tsx rename to src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx index d29ce2e4f38f5..7f3a2913daac3 100644 --- a/src/plugins/dashboard/public/embeddable/dashboard_container.tsx +++ b/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx @@ -20,9 +20,10 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { I18nProvider } from '@kbn/i18n/react'; -import { RefreshInterval, TimeRange, Query, Filter } from '../../../data/public'; -import { CoreStart } from '../../../../core/public'; -import { UiActionsStart } from '../ui_actions_plugin'; +import { RefreshInterval, TimeRange, Query, Filter } from 'src/plugins/data/public'; +import { CoreStart } from 'src/core/public'; +import { Start as InspectorStartContract } from 'src/plugins/inspector/public'; +import { UiActionsStart } from '../../ui_actions_plugin'; import { Container, ContainerInput, @@ -31,17 +32,16 @@ import { EmbeddableFactory, IEmbeddable, EmbeddableStart, -} from '../embeddable_plugin'; +} from '../../embeddable_plugin'; import { DASHBOARD_CONTAINER_TYPE } from './dashboard_constants'; import { createPanelState } from './panel'; import { DashboardPanelState } from './types'; import { DashboardViewport } from './viewport/dashboard_viewport'; -import { Start as InspectorStartContract } from '../../../inspector/public'; import { KibanaContextProvider, KibanaReactContext, KibanaReactContextValue, -} from '../../../kibana_react/public'; +} from '../../../../kibana_react/public'; export interface DashboardContainerInput extends ContainerInput { viewMode: ViewMode; diff --git a/src/plugins/dashboard/public/embeddable/dashboard_container_factory.tsx b/src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx similarity index 88% rename from src/plugins/dashboard/public/embeddable/dashboard_container_factory.tsx rename to src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx index 9ff48cb45adfd..a20ba148115a0 100644 --- a/src/plugins/dashboard/public/embeddable/dashboard_container_factory.tsx +++ b/src/plugins/dashboard/public/application/embeddable/dashboard_container_factory.tsx @@ -18,18 +18,18 @@ */ import { i18n } from '@kbn/i18n'; -import { UiActionsStart } from '../../../../../src/plugins/ui_actions/public'; -import { EmbeddableStart } from '../../../../../src/plugins/embeddable/public'; -import { CoreStart } from '../../../../core/public'; +import { UiActionsStart } from 'src/plugins/ui_actions/public'; +import { EmbeddableStart } from 'src/plugins/embeddable/public'; +import { CoreStart } from 'src/core/public'; +import { Start as InspectorStartContract } from 'src/plugins/inspector/public'; import { ContainerOutput, EmbeddableFactoryDefinition, ErrorEmbeddable, Container, -} from '../embeddable_plugin'; +} from '../../embeddable_plugin'; import { DashboardContainer, DashboardContainerInput } from './dashboard_container'; import { DASHBOARD_CONTAINER_TYPE } from './dashboard_constants'; -import { Start as InspectorStartContract } from '../../../inspector/public'; interface StartServices { capabilities: CoreStart['application']['capabilities']; diff --git a/src/plugins/dashboard/public/embeddable/grid/_dashboard_grid.scss b/src/plugins/dashboard/public/application/embeddable/grid/_dashboard_grid.scss similarity index 100% rename from src/plugins/dashboard/public/embeddable/grid/_dashboard_grid.scss rename to src/plugins/dashboard/public/application/embeddable/grid/_dashboard_grid.scss diff --git a/src/plugins/dashboard/public/embeddable/grid/_index.scss b/src/plugins/dashboard/public/application/embeddable/grid/_index.scss similarity index 100% rename from src/plugins/dashboard/public/embeddable/grid/_index.scss rename to src/plugins/dashboard/public/application/embeddable/grid/_index.scss diff --git a/src/plugins/dashboard/public/embeddable/grid/dashboard_grid.test.tsx b/src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.test.tsx similarity index 97% rename from src/plugins/dashboard/public/embeddable/grid/dashboard_grid.test.tsx rename to src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.test.tsx index a946c21765311..948e22e86a302 100644 --- a/src/plugins/dashboard/public/embeddable/grid/dashboard_grid.test.tsx +++ b/src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.test.tsx @@ -29,8 +29,8 @@ import { getSampleDashboardInput } from '../../test_helpers'; import { CONTACT_CARD_EMBEDDABLE, ContactCardEmbeddableFactory, -} from '../../embeddable_plugin_test_samples'; -import { KibanaContextProvider } from '../../../../kibana_react/public'; +} from '../../../embeddable_plugin_test_samples'; +import { KibanaContextProvider } from '../../../../../kibana_react/public'; // eslint-disable-next-line import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks'; diff --git a/src/plugins/dashboard/public/embeddable/grid/dashboard_grid.tsx b/src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.tsx similarity index 98% rename from src/plugins/dashboard/public/embeddable/grid/dashboard_grid.tsx rename to src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.tsx index 3f1f1056cf1b4..b15a813aff903 100644 --- a/src/plugins/dashboard/public/embeddable/grid/dashboard_grid.tsx +++ b/src/plugins/dashboard/public/application/embeddable/grid/dashboard_grid.tsx @@ -29,10 +29,10 @@ import _ from 'lodash'; import React from 'react'; import { Subscription } from 'rxjs'; import ReactGridLayout, { Layout } from 'react-grid-layout'; -import { ViewMode, EmbeddableChildPanel } from '../../embeddable_plugin'; +import { ViewMode, EmbeddableChildPanel } from '../../../embeddable_plugin'; import { DASHBOARD_GRID_COLUMN_COUNT, DASHBOARD_GRID_HEIGHT } from '../dashboard_constants'; import { DashboardPanelState, GridData } from '../types'; -import { withKibana } from '../../../../kibana_react/public'; +import { withKibana } from '../../../../../kibana_react/public'; import { DashboardContainerInput } from '../dashboard_container'; import { DashboardContainer, DashboardReactContextValue } from '../dashboard_container'; diff --git a/src/plugins/dashboard/public/embeddable/grid/index.ts b/src/plugins/dashboard/public/application/embeddable/grid/index.ts similarity index 100% rename from src/plugins/dashboard/public/embeddable/grid/index.ts rename to src/plugins/dashboard/public/application/embeddable/grid/index.ts diff --git a/src/plugins/dashboard/public/embeddable/index.ts b/src/plugins/dashboard/public/application/embeddable/index.ts similarity index 100% rename from src/plugins/dashboard/public/embeddable/index.ts rename to src/plugins/dashboard/public/application/embeddable/index.ts diff --git a/src/plugins/dashboard/public/embeddable/panel/_dashboard_panel.scss b/src/plugins/dashboard/public/application/embeddable/panel/_dashboard_panel.scss similarity index 100% rename from src/plugins/dashboard/public/embeddable/panel/_dashboard_panel.scss rename to src/plugins/dashboard/public/application/embeddable/panel/_dashboard_panel.scss diff --git a/src/plugins/dashboard/public/embeddable/panel/_index.scss b/src/plugins/dashboard/public/application/embeddable/panel/_index.scss similarity index 100% rename from src/plugins/dashboard/public/embeddable/panel/_index.scss rename to src/plugins/dashboard/public/application/embeddable/panel/_index.scss diff --git a/src/plugins/dashboard/public/embeddable/panel/create_panel_state.test.ts b/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.test.ts similarity index 95% rename from src/plugins/dashboard/public/embeddable/panel/create_panel_state.test.ts rename to src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.test.ts index 8889f4dc27544..409cae8b49a53 100644 --- a/src/plugins/dashboard/public/embeddable/panel/create_panel_state.test.ts +++ b/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.test.ts @@ -20,8 +20,8 @@ import { DEFAULT_PANEL_HEIGHT, DEFAULT_PANEL_WIDTH } from '../dashboard_constants'; import { DashboardPanelState } from '../types'; import { createPanelState } from './create_panel_state'; -import { EmbeddableInput } from '../../embeddable_plugin'; -import { CONTACT_CARD_EMBEDDABLE } from '../../embeddable_plugin_test_samples'; +import { EmbeddableInput } from '../../../embeddable_plugin'; +import { CONTACT_CARD_EMBEDDABLE } from '../../../embeddable_plugin_test_samples'; interface TestInput extends EmbeddableInput { test: string; diff --git a/src/plugins/dashboard/public/embeddable/panel/create_panel_state.ts b/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.ts similarity index 97% rename from src/plugins/dashboard/public/embeddable/panel/create_panel_state.ts rename to src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.ts index 7139cddf02b33..f3a48368fe1b3 100644 --- a/src/plugins/dashboard/public/embeddable/panel/create_panel_state.ts +++ b/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.ts @@ -18,7 +18,7 @@ */ import _ from 'lodash'; -import { PanelState, EmbeddableInput } from '../../embeddable_plugin'; +import { PanelState, EmbeddableInput } from '../../../embeddable_plugin'; import { DASHBOARD_GRID_COLUMN_COUNT, DEFAULT_PANEL_HEIGHT, diff --git a/src/plugins/dashboard/public/embeddable/panel/index.ts b/src/plugins/dashboard/public/application/embeddable/panel/index.ts similarity index 100% rename from src/plugins/dashboard/public/embeddable/panel/index.ts rename to src/plugins/dashboard/public/application/embeddable/panel/index.ts diff --git a/src/plugins/dashboard/public/embeddable/types.ts b/src/plugins/dashboard/public/application/embeddable/types.ts similarity index 94% rename from src/plugins/dashboard/public/embeddable/types.ts rename to src/plugins/dashboard/public/application/embeddable/types.ts index 480d03552ca68..3df305b0d7f1b 100644 --- a/src/plugins/dashboard/public/embeddable/types.ts +++ b/src/plugins/dashboard/public/application/embeddable/types.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { PanelState, EmbeddableInput } from '../embeddable_plugin'; +import { PanelState, EmbeddableInput } from '../../embeddable_plugin'; export type PanelId = string; export type SavedObjectId = string; diff --git a/src/plugins/dashboard/public/embeddable/viewport/_dashboard_viewport.scss b/src/plugins/dashboard/public/application/embeddable/viewport/_dashboard_viewport.scss similarity index 100% rename from src/plugins/dashboard/public/embeddable/viewport/_dashboard_viewport.scss rename to src/plugins/dashboard/public/application/embeddable/viewport/_dashboard_viewport.scss diff --git a/src/plugins/dashboard/public/embeddable/viewport/_index.scss b/src/plugins/dashboard/public/application/embeddable/viewport/_index.scss similarity index 100% rename from src/plugins/dashboard/public/embeddable/viewport/_index.scss rename to src/plugins/dashboard/public/application/embeddable/viewport/_index.scss diff --git a/src/plugins/dashboard/public/embeddable/viewport/dashboard_viewport.test.tsx b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx similarity index 98% rename from src/plugins/dashboard/public/embeddable/viewport/dashboard_viewport.test.tsx rename to src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx index be4d2e3851f11..4f9aa75f52105 100644 --- a/src/plugins/dashboard/public/embeddable/viewport/dashboard_viewport.test.tsx +++ b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.test.tsx @@ -30,8 +30,8 @@ import { getSampleDashboardInput } from '../../test_helpers'; import { CONTACT_CARD_EMBEDDABLE, ContactCardEmbeddableFactory, -} from '../../embeddable_plugin_test_samples'; -import { KibanaContextProvider } from '../../../../../plugins/kibana_react/public'; +} from '../../../embeddable_plugin_test_samples'; +import { KibanaContextProvider } from '../../../../../kibana_react/public'; // eslint-disable-next-line import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks'; diff --git a/src/plugins/dashboard/public/embeddable/viewport/dashboard_viewport.tsx b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx similarity index 97% rename from src/plugins/dashboard/public/embeddable/viewport/dashboard_viewport.tsx rename to src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx index e7fd379898dd1..ae239bc27fdba 100644 --- a/src/plugins/dashboard/public/embeddable/viewport/dashboard_viewport.tsx +++ b/src/plugins/dashboard/public/application/embeddable/viewport/dashboard_viewport.tsx @@ -19,10 +19,10 @@ import React from 'react'; import { Subscription } from 'rxjs'; -import { PanelState } from '../../embeddable_plugin'; +import { PanelState } from '../../../embeddable_plugin'; import { DashboardContainer, DashboardReactContextValue } from '../dashboard_container'; import { DashboardGrid } from '../grid'; -import { context } from '../../../../kibana_react/public'; +import { context } from '../../../../../kibana_react/public'; export interface DashboardViewportProps { container: DashboardContainer; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/help_menu/help_menu_util.ts b/src/plugins/dashboard/public/application/help_menu/help_menu_util.ts similarity index 95% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/help_menu/help_menu_util.ts rename to src/plugins/dashboard/public/application/help_menu/help_menu_util.ts index bc281c6eb340f..efdff051a25a0 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/help_menu/help_menu_util.ts +++ b/src/plugins/dashboard/public/application/help_menu/help_menu_util.ts @@ -25,7 +25,7 @@ export function addHelpMenuToAppChrome( docLinks: CoreStart['docLinks'] ) { chrome.setHelpExtension({ - appName: i18n.translate('kbn.dashboard.helpMenu.appName', { + appName: i18n.translate('dashboard.helpMenu.appName', { defaultMessage: 'Dashboards', }), links: [ diff --git a/src/legacy/core_plugins/kibana/public/dashboard/_index.scss b/src/plugins/dashboard/public/application/index.scss similarity index 56% rename from src/legacy/core_plugins/kibana/public/dashboard/_index.scss rename to src/plugins/dashboard/public/application/index.scss index 35d4127365f02..6e158b2ec2e47 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/_index.scss +++ b/src/plugins/dashboard/public/application/index.scss @@ -1,9 +1,8 @@ -// External libraries -// 'react-grid-layout/css/styles.css'; -// 'react-resizable/css/styles.css'; -// ... are being imported via JS in grid/dashboard_grid.js +@import '../../../embeddable/public/variables'; -@import './variables'; +@import './embeddable/grid/index'; +@import './embeddable/panel/index'; +@import './embeddable/viewport/index'; // Temporary hacks @import './hacks'; @@ -16,3 +15,4 @@ // dshChart__legend-isLoading @import './dashboard_app'; + diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/test_utils/index.ts b/src/plugins/dashboard/public/application/index.ts similarity index 88% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/test_utils/index.ts rename to src/plugins/dashboard/public/application/index.ts index a9a306da7f1a2..fcd92da33aa5f 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/test_utils/index.ts +++ b/src/plugins/dashboard/public/application/index.ts @@ -17,4 +17,6 @@ * under the License. */ -export { getSavedDashboardMock } from './get_saved_dashboard_mock'; +export * from './embeddable'; +export * from './actions'; +export { RenderDeps } from './application'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/legacy_app.js b/src/plugins/dashboard/public/application/legacy_app.js similarity index 92% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/legacy_app.js rename to src/plugins/dashboard/public/application/legacy_app.js index dbeaf8a98b461..10243dbf2f979 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/legacy_app.js +++ b/src/plugins/dashboard/public/application/legacy_app.js @@ -25,17 +25,17 @@ import dashboardListingTemplate from './listing/dashboard_listing_ng_wrapper.htm import { createHashHistory } from 'history'; import { initDashboardAppDirective } from './dashboard_app'; -import { createDashboardEditUrl, DashboardConstants } from './dashboard_constants'; +import { createDashboardEditUrl, DashboardConstants } from '../dashboard_constants'; import { createKbnUrlStateStorage, ensureDefaultIndexPattern, redirectWhenMissing, InvalidJSONProperty, SavedObjectNotFound, -} from '../../../../../../plugins/kibana_utils/public'; +} from '../../../kibana_utils/public'; import { DashboardListing, EMPTY_FILTER } from './listing/dashboard_listing'; import { addHelpMenuToAppChrome } from './help_menu/help_menu_util'; -import { syncQueryStateWithUrl } from '../../../../../../plugins/data/public'; +import { syncQueryStateWithUrl } from '../../../data/public'; export function initDashboardApp(app, deps) { initDashboardAppDirective(app, deps); @@ -55,7 +55,7 @@ export function initDashboardApp(app, deps) { }); function createNewDashboardCtrl($scope) { - $scope.visitVisualizeAppLinkText = i18n.translate('kbn.dashboard.visitVisualizeAppLinkText', { + $scope.visitVisualizeAppLinkText = i18n.translate('dashboard.visitVisualizeAppLinkText', { defaultMessage: 'visit the Visualize app', }); addHelpMenuToAppChrome(deps.chrome, deps.core.docLinks); @@ -79,10 +79,10 @@ export function initDashboardApp(app, deps) { } return { - text: i18n.translate('kbn.dashboard.badge.readOnly.text', { + text: i18n.translate('dashboard.badge.readOnly.text', { defaultMessage: 'Read only', }), - tooltip: i18n.translate('kbn.dashboard.badge.readOnly.tooltip', { + tooltip: i18n.translate('dashboard.badge.readOnly.tooltip', { defaultMessage: 'Unable to save dashboards', }), iconType: 'glasses', @@ -94,7 +94,7 @@ export function initDashboardApp(app, deps) { .when(DashboardConstants.LANDING_PAGE_PATH, { ...defaults, template: dashboardListingTemplate, - controller($scope, kbnUrlStateStorage, history) { + controller: function($scope, kbnUrlStateStorage, history) { const service = deps.savedDashboards; const dashboardConfig = deps.dashboardConfig; @@ -124,7 +124,7 @@ export function initDashboardApp(app, deps) { $scope.initialFilter = parse(history.location.search).filter || EMPTY_FILTER; deps.chrome.setBreadcrumbs([ { - text: i18n.translate('kbn.dashboard.dashboardBreadcrumbsTitle', { + text: i18n.translate('dashboard.dashboardBreadcrumbsTitle', { defaultMessage: 'Dashboards', }), }, @@ -222,7 +222,7 @@ export function initDashboardApp(app, deps) { }); deps.core.notifications.toasts.addWarning( - i18n.translate('kbn.dashboard.urlWasRemovedInSixZeroWarningMessage', { + i18n.translate('dashboard.urlWasRemovedInSixZeroWarningMessage', { defaultMessage: 'The url "dashboard/create" was removed in 6.0. Please update your bookmarks.', }) diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/embeddable_saved_object_converters.test.ts b/src/plugins/dashboard/public/application/lib/embeddable_saved_object_converters.test.ts similarity index 95% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/embeddable_saved_object_converters.test.ts rename to src/plugins/dashboard/public/application/lib/embeddable_saved_object_converters.test.ts index d3c3dc46c7057..447563bbfbcfa 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/embeddable_saved_object_converters.test.ts +++ b/src/plugins/dashboard/public/application/lib/embeddable_saved_object_converters.test.ts @@ -16,14 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -import '../np_core.test.mocks'; import { convertSavedDashboardPanelToPanelState, convertPanelStateToSavedDashboardPanel, } from './embeddable_saved_object_converters'; -import { SavedDashboardPanel } from '../types'; -import { DashboardPanelState } from 'src/plugins/dashboard/public'; +import { SavedDashboardPanel } from '../../types'; +import { DashboardPanelState } from '../embeddable'; import { EmbeddableInput } from 'src/plugins/embeddable/public'; interface CustomInput extends EmbeddableInput { diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/embeddable_saved_object_converters.ts b/src/plugins/dashboard/public/application/lib/embeddable_saved_object_converters.ts similarity index 93% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/embeddable_saved_object_converters.ts rename to src/plugins/dashboard/public/application/lib/embeddable_saved_object_converters.ts index 500ee7e28daa6..01cd55df0d8e9 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/embeddable_saved_object_converters.ts +++ b/src/plugins/dashboard/public/application/lib/embeddable_saved_object_converters.ts @@ -17,8 +17,8 @@ * under the License. */ import { omit } from 'lodash'; -import { DashboardPanelState } from '../../../../../../../plugins/dashboard/public'; -import { SavedDashboardPanel } from '../types'; +import { SavedDashboardPanel } from '../../types'; +import { DashboardPanelState } from '../embeddable'; export function convertSavedDashboardPanelToPanelState( savedDashboardPanel: SavedDashboardPanel diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/filter_utils.ts b/src/plugins/dashboard/public/application/lib/filter_utils.ts similarity index 97% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/filter_utils.ts rename to src/plugins/dashboard/public/application/lib/filter_utils.ts index f7b45b0371378..1ec231db0c3d2 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/filter_utils.ts +++ b/src/plugins/dashboard/public/application/lib/filter_utils.ts @@ -19,7 +19,7 @@ import _ from 'lodash'; import moment, { Moment } from 'moment'; -import { Filter } from '../../../../../../../plugins/data/public'; +import { Filter } from 'src/plugins/data/public'; /** * @typedef {Object} QueryFilter diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/get_app_state_defaults.ts b/src/plugins/dashboard/public/application/lib/get_app_state_defaults.ts similarity index 87% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/get_app_state_defaults.ts rename to src/plugins/dashboard/public/application/lib/get_app_state_defaults.ts index b3acefeba0146..f008c787cb95d 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/get_app_state_defaults.ts +++ b/src/plugins/dashboard/public/application/lib/get_app_state_defaults.ts @@ -17,9 +17,9 @@ * under the License. */ -import { ViewMode } from '../../../../../../../plugins/embeddable/public'; -import { SavedObjectDashboard } from '../../../../../../../plugins/dashboard/public'; -import { DashboardAppStateDefaults } from '../types'; +import { ViewMode } from '../../embeddable_plugin'; +import { SavedObjectDashboard } from '../../saved_dashboards'; +import { DashboardAppStateDefaults } from '../../types'; export function getAppStateDefaults( savedDashboard: SavedObjectDashboard, diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/index.ts b/src/plugins/dashboard/public/application/lib/index.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/index.ts rename to src/plugins/dashboard/public/application/lib/index.ts diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/migrate_app_state.test.ts b/src/plugins/dashboard/public/application/lib/migrate_app_state.test.ts similarity index 98% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/migrate_app_state.test.ts rename to src/plugins/dashboard/public/application/lib/migrate_app_state.test.ts index 73336ec951894..d037fb3808406 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/migrate_app_state.test.ts +++ b/src/plugins/dashboard/public/application/lib/migrate_app_state.test.ts @@ -17,9 +17,7 @@ * under the License. */ -import '../np_core.test.mocks'; - -import { SavedDashboardPanel } from '../types'; +import { SavedDashboardPanel } from '../../types'; import { migrateAppState } from './migrate_app_state'; test('migrate app state from 6.0', async () => { diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/migrate_app_state.ts b/src/plugins/dashboard/public/application/lib/migrate_app_state.ts similarity index 77% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/migrate_app_state.ts rename to src/plugins/dashboard/public/application/lib/migrate_app_state.ts index 0cd958ced0eb1..8f8de3663518a 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/migrate_app_state.ts +++ b/src/plugins/dashboard/public/application/lib/migrate_app_state.ts @@ -19,7 +19,9 @@ import semver from 'semver'; import { i18n } from '@kbn/i18n'; -import { createUiStatsReporter, METRIC_TYPE } from '../../../../../ui_metric/public'; +import { METRIC_TYPE } from '@kbn/analytics'; + +import { UsageCollectionSetup } from 'src/plugins/usage_collection/public'; import { DashboardAppState, SavedDashboardPanelTo60, @@ -29,8 +31,9 @@ import { SavedDashboardPanel640To720, SavedDashboardPanel620, SavedDashboardPanel, -} from '../types'; -import { migratePanelsTo730 } from '../../migrations/migrate_to_730_panels'; +} from '../../types'; +// should be moved in src/plugins/dashboard/common right after https://github.com/elastic/kibana/pull/61895 is merged +import { migratePanelsTo730 } from '../../../../../legacy/core_plugins/kibana/public/dashboard/migrations/migrate_to_730_panels'; /** * Attempts to migrate the state stored in the URL into the latest version of it. @@ -39,11 +42,12 @@ import { migratePanelsTo730 } from '../../migrations/migrate_to_730_panels'; */ export function migrateAppState( appState: { [key: string]: unknown } & DashboardAppState, - kibanaVersion: string + kibanaVersion: string, + usageCollection?: UsageCollectionSetup ): DashboardAppState { if (!appState.panels) { throw new Error( - i18n.translate('kbn.dashboard.panel.invalidData', { + i18n.translate('dashboard.panel.invalidData', { defaultMessage: 'Invalid data in url', }) ); @@ -61,8 +65,10 @@ export function migrateAppState( const version = (panel as SavedDashboardPanel730ToLatest).version; - // This will help us figure out when to remove support for older style URLs. - createUiStatsReporter('DashboardPanelVersionInUrl')(METRIC_TYPE.LOADED, `${version}`); + if (usageCollection) { + // This will help us figure out when to remove support for older style URLs. + usageCollection.reportUiStats('DashboardPanelVersionInUrl', METRIC_TYPE.LOADED, `${version}`); + } return semver.satisfies(version, '<7.3'); }); diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/save_dashboard.ts b/src/plugins/dashboard/public/application/lib/save_dashboard.ts similarity index 95% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/save_dashboard.ts rename to src/plugins/dashboard/public/application/lib/save_dashboard.ts index db2b1f15247de..c948c25cb2ab5 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/save_dashboard.ts +++ b/src/plugins/dashboard/public/application/lib/save_dashboard.ts @@ -18,7 +18,7 @@ */ import { TimefilterContract } from 'src/plugins/data/public'; -import { SavedObjectSaveOpts } from '../../../../../../../plugins/saved_objects/public'; +import { SavedObjectSaveOpts } from 'src/plugins/saved_objects/public'; import { updateSavedDashboard } from './update_saved_dashboard'; import { DashboardStateManager } from '../dashboard_state_manager'; diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/update_saved_dashboard.ts b/src/plugins/dashboard/public/application/lib/update_saved_dashboard.ts similarity index 93% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/update_saved_dashboard.ts rename to src/plugins/dashboard/public/application/lib/update_saved_dashboard.ts index dee279550aa6a..53dc7d9b460de 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/update_saved_dashboard.ts +++ b/src/plugins/dashboard/public/application/lib/update_saved_dashboard.ts @@ -20,8 +20,8 @@ import _ from 'lodash'; import { RefreshInterval, TimefilterContract } from 'src/plugins/data/public'; import { FilterUtils } from './filter_utils'; -import { SavedObjectDashboard } from '../../../../../../../plugins/dashboard/public'; -import { DashboardAppState } from '../types'; +import { SavedObjectDashboard } from '../../saved_dashboards'; +import { DashboardAppState } from '../../types'; export function updateSavedDashboard( savedDashboard: SavedObjectDashboard, diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/url.test.ts b/src/plugins/dashboard/public/application/lib/url.test.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/url.test.ts rename to src/plugins/dashboard/public/application/lib/url.test.ts diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/url.ts b/src/plugins/dashboard/public/application/lib/url.ts similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/lib/url.ts rename to src/plugins/dashboard/public/application/lib/url.ts diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/__snapshots__/dashboard_listing.test.js.snap b/src/plugins/dashboard/public/application/listing/__snapshots__/dashboard_listing.test.js.snap similarity index 86% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/__snapshots__/dashboard_listing.test.js.snap rename to src/plugins/dashboard/public/application/listing/__snapshots__/dashboard_listing.test.js.snap index 2a9a793ba43c4..8c91776cabc9c 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/__snapshots__/dashboard_listing.test.js.snap +++ b/src/plugins/dashboard/public/application/listing/__snapshots__/dashboard_listing.test.js.snap @@ -22,7 +22,7 @@ exports[`after fetch hideWriteControls 1`] = ` > @@ -81,7 +81,7 @@ exports[`after fetch initialFilter 1`] = ` > @@ -91,14 +91,14 @@ exports[`after fetch initialFilter 1`] = `

, @@ -123,7 +123,7 @@ exports[`after fetch initialFilter 1`] = ` > @@ -182,7 +182,7 @@ exports[`after fetch renders call to action when no dashboards exist 1`] = ` > @@ -192,14 +192,14 @@ exports[`after fetch renders call to action when no dashboards exist 1`] = `

, @@ -224,7 +224,7 @@ exports[`after fetch renders call to action when no dashboards exist 1`] = ` > @@ -283,7 +283,7 @@ exports[`after fetch renders table rows 1`] = ` > @@ -293,14 +293,14 @@ exports[`after fetch renders table rows 1`] = `

, @@ -325,7 +325,7 @@ exports[`after fetch renders table rows 1`] = ` > @@ -384,7 +384,7 @@ exports[`after fetch renders warning when listingLimit is exceeded 1`] = ` > @@ -394,14 +394,14 @@ exports[`after fetch renders warning when listingLimit is exceeded 1`] = `

, @@ -426,7 +426,7 @@ exports[`after fetch renders warning when listingLimit is exceeded 1`] = ` > @@ -485,7 +485,7 @@ exports[`renders empty page in before initial fetch to avoid flickering 1`] = ` > @@ -495,14 +495,14 @@ exports[`renders empty page in before initial fetch to avoid flickering 1`] = `

, @@ -527,7 +527,7 @@ exports[`renders empty page in before initial fetch to avoid flickering 1`] = ` > diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/dashboard_listing.js b/src/plugins/dashboard/public/application/listing/dashboard_listing.js similarity index 84% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/dashboard_listing.js rename to src/plugins/dashboard/public/application/listing/dashboard_listing.js index 30bf940069fb7..e123a87bf10d5 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/dashboard_listing.js +++ b/src/plugins/dashboard/public/application/listing/dashboard_listing.js @@ -24,7 +24,7 @@ import { FormattedMessage, I18nProvider } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; import { EuiLink, EuiButton, EuiEmptyPrompt } from '@elastic/eui'; -import { TableListView } from '../../../../../../../plugins/kibana_react/public'; +import { TableListView } from '../../../../kibana_react/public'; export const EMPTY_FILTER = ''; @@ -51,13 +51,13 @@ export class DashboardListing extends React.Component { listingLimit={this.props.listingLimit} initialFilter={this.props.initialFilter} noItemsFragment={this.getNoItemsMessage()} - entityName={i18n.translate('kbn.dashboard.listing.table.entityName', { + entityName={i18n.translate('dashboard.listing.table.entityName', { defaultMessage: 'dashboard', })} - entityNamePlural={i18n.translate('kbn.dashboard.listing.table.entityNamePlural', { + entityNamePlural={i18n.translate('dashboard.listing.table.entityNamePlural', { defaultMessage: 'dashboards', })} - tableListTitle={i18n.translate('kbn.dashboard.listing.dashboardsTitle', { + tableListTitle={i18n.translate('dashboard.listing.dashboardsTitle', { defaultMessage: 'Dashboards', })} toastNotifications={this.props.core.notifications.toasts} @@ -76,7 +76,7 @@ export class DashboardListing extends React.Component { title={

@@ -93,7 +93,7 @@ export class DashboardListing extends React.Component { title={

@@ -102,19 +102,19 @@ export class DashboardListing extends React.Component {

@@ -132,7 +132,7 @@ export class DashboardListing extends React.Component { data-test-subj="createDashboardPromptButton" > @@ -146,7 +146,7 @@ export class DashboardListing extends React.Component { const tableColumns = [ { field: 'title', - name: i18n.translate('kbn.dashboard.listing.table.titleColumnName', { + name: i18n.translate('dashboard.listing.table.titleColumnName', { defaultMessage: 'Title', }), sortable: true, @@ -161,7 +161,7 @@ export class DashboardListing extends React.Component { }, { field: 'description', - name: i18n.translate('kbn.dashboard.listing.table.descriptionColumnName', { + name: i18n.translate('dashboard.listing.table.descriptionColumnName', { defaultMessage: 'Description', }), dataType: 'string', diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/dashboard_listing.test.js b/src/plugins/dashboard/public/application/listing/dashboard_listing.test.js similarity index 97% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/dashboard_listing.test.js rename to src/plugins/dashboard/public/application/listing/dashboard_listing.test.js index c47a54ad60460..0cdefff6a738e 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/dashboard_listing.test.js +++ b/src/plugins/dashboard/public/application/listing/dashboard_listing.test.js @@ -17,16 +17,6 @@ * under the License. */ -jest.mock( - 'ui/notify', - () => ({ - toastNotifications: { - addWarning: () => {}, - }, - }), - { virtual: true } -); - jest.mock( 'lodash', () => ({ diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/dashboard_listing_ng_wrapper.html b/src/plugins/dashboard/public/application/listing/dashboard_listing_ng_wrapper.html similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/listing/dashboard_listing_ng_wrapper.html rename to src/plugins/dashboard/public/application/listing/dashboard_listing_ng_wrapper.html diff --git a/src/plugins/dashboard/public/test_helpers/get_sample_dashboard_input.ts b/src/plugins/dashboard/public/application/test_helpers/get_sample_dashboard_input.ts similarity index 96% rename from src/plugins/dashboard/public/test_helpers/get_sample_dashboard_input.ts rename to src/plugins/dashboard/public/application/test_helpers/get_sample_dashboard_input.ts index 09478d8e8af35..4ceac90672cb3 100644 --- a/src/plugins/dashboard/public/test_helpers/get_sample_dashboard_input.ts +++ b/src/plugins/dashboard/public/application/test_helpers/get_sample_dashboard_input.ts @@ -17,7 +17,7 @@ * under the License. */ -import { ViewMode, EmbeddableInput } from '../embeddable_plugin'; +import { ViewMode, EmbeddableInput } from '../../embeddable_plugin'; import { DashboardContainerInput, DashboardPanelState } from '../embeddable'; export function getSampleDashboardInput( diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/test_utils/get_saved_dashboard_mock.ts b/src/plugins/dashboard/public/application/test_helpers/get_saved_dashboard_mock.ts similarity index 88% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/test_utils/get_saved_dashboard_mock.ts rename to src/plugins/dashboard/public/application/test_helpers/get_saved_dashboard_mock.ts index 53618f1cfe5fa..57c147ffe3588 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/test_utils/get_saved_dashboard_mock.ts +++ b/src/plugins/dashboard/public/application/test_helpers/get_saved_dashboard_mock.ts @@ -17,8 +17,8 @@ * under the License. */ -import { searchSourceMock } from '../../../../../../../plugins/data/public/mocks'; -import { SavedObjectDashboard } from '../../../../../../../plugins/dashboard/public/'; +import { searchSourceMock } from '../../../../data/public/mocks'; +import { SavedObjectDashboard } from '../../saved_dashboards'; export function getSavedDashboardMock( config?: Partial diff --git a/src/plugins/dashboard/public/test_helpers/index.ts b/src/plugins/dashboard/public/application/test_helpers/index.ts similarity index 92% rename from src/plugins/dashboard/public/test_helpers/index.ts rename to src/plugins/dashboard/public/application/test_helpers/index.ts index 88909826971fc..c22c614e9ffcf 100644 --- a/src/plugins/dashboard/public/test_helpers/index.ts +++ b/src/plugins/dashboard/public/application/test_helpers/index.ts @@ -18,3 +18,4 @@ */ export { getSampleDashboardInput, getSampleDashboardPanel } from './get_sample_dashboard_input'; +export { getSavedDashboardMock } from './get_saved_dashboard_mock'; diff --git a/src/plugins/dashboard/public/tests/dashboard_container.test.tsx b/src/plugins/dashboard/public/application/tests/dashboard_container.test.tsx similarity index 90% rename from src/plugins/dashboard/public/tests/dashboard_container.test.tsx rename to src/plugins/dashboard/public/application/tests/dashboard_container.test.tsx index 1c72ad34e5446..836cea298f035 100644 --- a/src/plugins/dashboard/public/tests/dashboard_container.test.tsx +++ b/src/plugins/dashboard/public/application/tests/dashboard_container.test.tsx @@ -23,7 +23,7 @@ import React from 'react'; import { mount } from 'enzyme'; import { nextTick } from 'test_utils/enzyme_helpers'; import { I18nProvider } from '@kbn/i18n/react'; -import { ViewMode, CONTEXT_MENU_TRIGGER, EmbeddablePanel } from '../embeddable_plugin'; +import { ViewMode, CONTEXT_MENU_TRIGGER, EmbeddablePanel } from '../../embeddable_plugin'; import { DashboardContainer, DashboardContainerOptions } from '../embeddable/dashboard_container'; import { getSampleDashboardInput } from '../test_helpers'; import { @@ -33,14 +33,11 @@ import { ContactCardEmbeddable, ContactCardEmbeddableOutput, createEditModeAction, -} from '../embeddable_plugin_test_samples'; -// eslint-disable-next-line -import { embeddablePluginMock } from '../../../embeddable/public/mocks'; -// eslint-disable-next-line -import { inspectorPluginMock } from '../../../inspector/public/mocks'; -import { KibanaContextProvider } from '../../../kibana_react/public'; -// eslint-disable-next-line -import { uiActionsPluginMock } from '../../../ui_actions/public/mocks'; +} from '../../embeddable_plugin_test_samples'; +import { embeddablePluginMock } from '../../../../embeddable/public/mocks'; +import { inspectorPluginMock } from '../../../../inspector/public/mocks'; +import { KibanaContextProvider } from '../../../../kibana_react/public'; +import { uiActionsPluginMock } from '../../../../ui_actions/public/mocks'; test('DashboardContainer in edit mode shows edit mode actions', async () => { const inspector = inspectorPluginMock.createStartContract(); diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/__snapshots__/clone_modal.test.js.snap b/src/plugins/dashboard/public/application/top_nav/__snapshots__/clone_modal.test.js.snap similarity index 83% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/__snapshots__/clone_modal.test.js.snap rename to src/plugins/dashboard/public/application/top_nav/__snapshots__/clone_modal.test.js.snap index 771d53b73d960..d289d267a2fd6 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/__snapshots__/clone_modal.test.js.snap +++ b/src/plugins/dashboard/public/application/top_nav/__snapshots__/clone_modal.test.js.snap @@ -11,7 +11,7 @@ exports[`renders DashboardCloneModal 1`] = ` @@ -21,7 +21,7 @@ exports[`renders DashboardCloneModal 1`] = `

@@ -43,7 +43,7 @@ exports[`renders DashboardCloneModal 1`] = ` > @@ -55,7 +55,7 @@ exports[`renders DashboardCloneModal 1`] = ` > diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/__snapshots__/save_modal.test.js.snap b/src/plugins/dashboard/public/application/top_nav/__snapshots__/save_modal.test.js.snap similarity index 86% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/__snapshots__/save_modal.test.js.snap rename to src/plugins/dashboard/public/application/top_nav/__snapshots__/save_modal.test.js.snap index 7ac2e2d9dd317..bc4ed477d9eea 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/__snapshots__/save_modal.test.js.snap +++ b/src/plugins/dashboard/public/application/top_nav/__snapshots__/save_modal.test.js.snap @@ -16,7 +16,7 @@ exports[`renders DashboardSaveModal 1`] = ` label={ } @@ -37,7 +37,7 @@ exports[`renders DashboardSaveModal 1`] = ` helpText={ } @@ -49,7 +49,7 @@ exports[`renders DashboardSaveModal 1`] = ` label={ } diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/clone_modal.test.js b/src/plugins/dashboard/public/application/top_nav/clone_modal.test.js similarity index 100% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/clone_modal.test.js rename to src/plugins/dashboard/public/application/top_nav/clone_modal.test.js diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/clone_modal.tsx b/src/plugins/dashboard/public/application/top_nav/clone_modal.tsx similarity index 88% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/clone_modal.tsx rename to src/plugins/dashboard/public/application/top_nav/clone_modal.tsx index 08e2b98d1c73d..16cfced6573ca 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/clone_modal.tsx +++ b/src/plugins/dashboard/public/application/top_nav/clone_modal.tsx @@ -117,7 +117,7 @@ export class DashboardCloneModal extends React.Component { { >

@@ -158,7 +158,7 @@ export class DashboardCloneModal extends React.Component { @@ -168,7 +168,7 @@ export class DashboardCloneModal extends React.Component {

@@ -178,7 +178,7 @@ export class DashboardCloneModal extends React.Component { { @@ -205,7 +205,7 @@ export class DashboardCloneModal extends React.Component { isLoading={this.state.isLoading} > diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/get_top_nav_config.ts b/src/plugins/dashboard/public/application/top_nav/get_top_nav_config.ts similarity index 76% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/get_top_nav_config.ts rename to src/plugins/dashboard/public/application/top_nav/get_top_nav_config.ts index 7a3cb4b7dad56..dbdadeb4e4e7c 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/get_top_nav_config.ts +++ b/src/plugins/dashboard/public/application/top_nav/get_top_nav_config.ts @@ -18,9 +18,9 @@ */ import { i18n } from '@kbn/i18n'; -import { ViewMode } from '../../../../../../../plugins/embeddable/public'; +import { ViewMode } from '../../embeddable_plugin'; import { TopNavIds } from './top_nav_ids'; -import { NavAction } from '../types'; +import { NavAction } from '../../types'; /** * @param actions - A mapping of TopNavIds to an action function that should run when the @@ -63,10 +63,10 @@ export function getTopNavConfig( function getFullScreenConfig(action: NavAction) { return { id: 'full-screen', - label: i18n.translate('kbn.dashboard.topNave.fullScreenButtonAriaLabel', { + label: i18n.translate('dashboard.topNave.fullScreenButtonAriaLabel', { defaultMessage: 'full screen', }), - description: i18n.translate('kbn.dashboard.topNave.fullScreenConfigDescription', { + description: i18n.translate('dashboard.topNave.fullScreenConfigDescription', { defaultMessage: 'Full Screen Mode', }), testId: 'dashboardFullScreenMode', @@ -80,10 +80,10 @@ function getFullScreenConfig(action: NavAction) { function getEditConfig(action: NavAction) { return { id: 'edit', - label: i18n.translate('kbn.dashboard.topNave.editButtonAriaLabel', { + label: i18n.translate('dashboard.topNave.editButtonAriaLabel', { defaultMessage: 'edit', }), - description: i18n.translate('kbn.dashboard.topNave.editConfigDescription', { + description: i18n.translate('dashboard.topNave.editConfigDescription', { defaultMessage: 'Switch to edit mode', }), testId: 'dashboardEditMode', @@ -100,10 +100,10 @@ function getEditConfig(action: NavAction) { function getSaveConfig(action: NavAction) { return { id: 'save', - label: i18n.translate('kbn.dashboard.topNave.saveButtonAriaLabel', { + label: i18n.translate('dashboard.topNave.saveButtonAriaLabel', { defaultMessage: 'save', }), - description: i18n.translate('kbn.dashboard.topNave.saveConfigDescription', { + description: i18n.translate('dashboard.topNave.saveConfigDescription', { defaultMessage: 'Save your dashboard', }), testId: 'dashboardSaveMenuItem', @@ -117,10 +117,10 @@ function getSaveConfig(action: NavAction) { function getViewConfig(action: NavAction) { return { id: 'cancel', - label: i18n.translate('kbn.dashboard.topNave.cancelButtonAriaLabel', { + label: i18n.translate('dashboard.topNave.cancelButtonAriaLabel', { defaultMessage: 'cancel', }), - description: i18n.translate('kbn.dashboard.topNave.viewConfigDescription', { + description: i18n.translate('dashboard.topNave.viewConfigDescription', { defaultMessage: 'Cancel editing and switch to view-only mode', }), testId: 'dashboardViewOnlyMode', @@ -134,10 +134,10 @@ function getViewConfig(action: NavAction) { function getCloneConfig(action: NavAction) { return { id: 'clone', - label: i18n.translate('kbn.dashboard.topNave.cloneButtonAriaLabel', { + label: i18n.translate('dashboard.topNave.cloneButtonAriaLabel', { defaultMessage: 'clone', }), - description: i18n.translate('kbn.dashboard.topNave.cloneConfigDescription', { + description: i18n.translate('dashboard.topNave.cloneConfigDescription', { defaultMessage: 'Create a copy of your dashboard', }), testId: 'dashboardClone', @@ -151,10 +151,10 @@ function getCloneConfig(action: NavAction) { function getAddConfig(action: NavAction) { return { id: 'add', - label: i18n.translate('kbn.dashboard.topNave.addButtonAriaLabel', { + label: i18n.translate('dashboard.topNave.addButtonAriaLabel', { defaultMessage: 'add', }), - description: i18n.translate('kbn.dashboard.topNave.addConfigDescription', { + description: i18n.translate('dashboard.topNave.addConfigDescription', { defaultMessage: 'Add a panel to the dashboard', }), testId: 'dashboardAddPanelButton', @@ -170,10 +170,10 @@ function getCreateNewConfig(action: NavAction) { emphasize: true, iconType: 'plusInCircle', id: 'addNew', - label: i18n.translate('kbn.dashboard.topNave.addNewButtonAriaLabel', { + label: i18n.translate('dashboard.topNave.addNewButtonAriaLabel', { defaultMessage: 'Create new', }), - description: i18n.translate('kbn.dashboard.topNave.addNewConfigDescription', { + description: i18n.translate('dashboard.topNave.addNewConfigDescription', { defaultMessage: 'Create a new panel on this dashboard', }), testId: 'dashboardAddNewPanelButton', @@ -184,17 +184,19 @@ function getCreateNewConfig(action: NavAction) { /** * @returns {kbnTopNavConfig} */ -function getShareConfig(action: NavAction) { +function getShareConfig(action: NavAction | undefined) { return { id: 'share', - label: i18n.translate('kbn.dashboard.topNave.shareButtonAriaLabel', { + label: i18n.translate('dashboard.topNave.shareButtonAriaLabel', { defaultMessage: 'share', }), - description: i18n.translate('kbn.dashboard.topNave.shareConfigDescription', { + description: i18n.translate('dashboard.topNave.shareConfigDescription', { defaultMessage: 'Share Dashboard', }), testId: 'shareTopNavButton', run: action, + // disable the Share button if no action specified + disableButton: !action, }; } @@ -204,10 +206,10 @@ function getShareConfig(action: NavAction) { function getOptionsConfig(action: NavAction) { return { id: 'options', - label: i18n.translate('kbn.dashboard.topNave.optionsButtonAriaLabel', { + label: i18n.translate('dashboard.topNave.optionsButtonAriaLabel', { defaultMessage: 'options', }), - description: i18n.translate('kbn.dashboard.topNave.optionsConfigDescription', { + description: i18n.translate('dashboard.topNave.optionsConfigDescription', { defaultMessage: 'Options', }), testId: 'dashboardOptionsButton', diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/options.tsx b/src/plugins/dashboard/public/application/top_nav/options.tsx similarity index 88% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/options.tsx rename to src/plugins/dashboard/public/application/top_nav/options.tsx index af284e6f557cb..3398696ff40db 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/options.tsx +++ b/src/plugins/dashboard/public/application/top_nav/options.tsx @@ -61,12 +61,9 @@ export class OptionsMenu extends Component { { ({ +jest.mock('../../../../saved_objects/public', () => ({ SavedObjectSaveModal: () => null, })); -jest.mock('ui/new_platform'); - import { DashboardSaveModal } from './save_modal'; test('renders DashboardSaveModal', () => { diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/save_modal.tsx b/src/plugins/dashboard/public/application/top_nav/save_modal.tsx similarity index 91% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/save_modal.tsx rename to src/plugins/dashboard/public/application/top_nav/save_modal.tsx index 4a4fcb7e1adc8..609ed23472924 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/save_modal.tsx +++ b/src/plugins/dashboard/public/application/top_nav/save_modal.tsx @@ -21,7 +21,7 @@ import React, { Fragment } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiFormRow, EuiTextArea, EuiSwitch } from '@elastic/eui'; -import { SavedObjectSaveModal } from '../../../../../../../plugins/saved_objects/public'; +import { SavedObjectSaveModal } from '../../../../saved_objects/public'; interface SaveOptions { newTitle: string; @@ -102,7 +102,7 @@ export class DashboardSaveModal extends React.Component { } @@ -117,7 +117,7 @@ export class DashboardSaveModal extends React.Component { } @@ -128,7 +128,7 @@ export class DashboardSaveModal extends React.Component { onChange={this.onTimeRestoreChange} label={ } diff --git a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/show_clone_modal.tsx b/src/plugins/dashboard/public/application/top_nav/show_clone_modal.tsx similarity index 96% rename from src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/show_clone_modal.tsx rename to src/plugins/dashboard/public/application/top_nav/show_clone_modal.tsx index af1020e01e0c5..ee356b81802ee 100644 --- a/src/legacy/core_plugins/kibana/public/dashboard/np_ready/top_nav/show_clone_modal.tsx +++ b/src/plugins/dashboard/public/application/top_nav/show_clone_modal.tsx @@ -58,7 +58,7 @@ export function showCloneModal( { - constructor(initializerContext: PluginInitializerContext) {} + constructor(private initializerContext: PluginInitializerContext) {} + + private appStateUpdater = new BehaviorSubject(() => ({})); + private stopUrlTracking: (() => void) | undefined = undefined; public setup( - core: CoreSetup, - { share, uiActions, embeddable }: SetupDependencies + core: CoreSetup, + { share, uiActions, embeddable, home, kibanaLegacy, data, usageCollection }: SetupDependencies ): Setup { const expandPanelAction = new ExpandPanelAction(); uiActions.registerAction(expandPanelAction); @@ -128,6 +172,112 @@ export class DashboardEmbeddableContainerPublicPlugin const factory = new DashboardContainerFactory(getStartServices); embeddable.registerEmbeddableFactory(factory.type, factory); + + const { appMounted, appUnMounted, stop: stopUrlTracker } = createKbnUrlTracker({ + baseUrl: core.http.basePath.prepend('/app/kibana'), + defaultSubUrl: `#${DashboardConstants.LANDING_PAGE_PATH}`, + shouldTrackUrlUpdate: pathname => { + const targetAppName = pathname.split('/')[1]; + return ( + targetAppName === DashboardConstants.DASHBOARDS_ID || + targetAppName === DashboardConstants.DASHBOARD_ID + ); + }, + storageKey: 'lastUrl:dashboard', + navLinkUpdater$: this.appStateUpdater, + toastNotifications: core.notifications.toasts, + stateParams: [ + { + kbnUrlKey: '_g', + stateUpdate$: data.query.state$.pipe( + filter( + ({ changes }) => !!(changes.globalFilters || changes.time || changes.refreshInterval) + ), + map(({ state }) => ({ + ...state, + filters: state.filters?.filter(esFilters.isFilterPinned), + })) + ), + }, + ], + }); + + this.stopUrlTracking = () => { + stopUrlTracker(); + }; + + const app: App = { + id: '', + title: 'Dashboards', + mount: async (params: AppMountParameters) => { + const [coreStart, pluginsStart, dashboardStart] = await core.getStartServices(); + appMounted(); + const { + embeddable: embeddableStart, + navigation, + share: shareStart, + data: dataStart, + kibanaLegacy: { dashboardConfig }, + } = pluginsStart; + + const deps: RenderDeps = { + pluginInitializerContext: this.initializerContext, + core: coreStart, + dashboardConfig, + navigation, + share: shareStart, + data: dataStart, + savedObjectsClient: coreStart.savedObjects.client, + savedDashboards: dashboardStart.getSavedDashboardLoader(), + chrome: coreStart.chrome, + addBasePath: coreStart.http.basePath.prepend, + uiSettings: coreStart.uiSettings, + config: kibanaLegacy.config, + savedQueryService: dataStart.query.savedQueries, + embeddable: embeddableStart, + dashboardCapabilities: coreStart.application.capabilities.dashboard, + embeddableCapabilities: { + visualizeCapabilities: coreStart.application.capabilities.visualize, + mapsCapabilities: coreStart.application.capabilities.maps, + }, + localStorage: new Storage(localStorage), + usageCollection, + }; + const { renderApp } = await import('./application/application'); + const unmount = renderApp(params.element, params.appBasePath, deps); + return () => { + unmount(); + appUnMounted(); + }; + }, + }; + + initAngularBootstrap(); + + kibanaLegacy.registerLegacyApp({ + ...app, + id: DashboardConstants.DASHBOARD_ID, + // only register the updater in once app, otherwise all updates would happen twice + updater$: this.appStateUpdater.asObservable(), + navLinkId: 'kibana:dashboard', + }); + kibanaLegacy.registerLegacyApp({ ...app, id: DashboardConstants.DASHBOARDS_ID }); + + if (home) { + home.featureCatalogue.register({ + id: DashboardConstants.DASHBOARD_ID, + title: i18n.translate('dashboard.featureCatalogue.dashboardTitle', { + defaultMessage: 'Dashboard', + }), + description: i18n.translate('dashboard.featureCatalogue.dashboardDescription', { + defaultMessage: 'Display and share a collection of visualizations and saved searches.', + }), + icon: 'dashboardApp', + path: `/app/kibana#${DashboardConstants.LANDING_PAGE_PATH}`, + showOnHomePage: true, + category: FeatureCatalogueCategory.DATA, + }); + } } public start(core: CoreStart, plugins: StartDependencies): DashboardStart { @@ -158,5 +308,9 @@ export class DashboardEmbeddableContainerPublicPlugin }; } - public stop() {} + public stop() { + if (this.stopUrlTracking) { + this.stopUrlTracking(); + } + } } diff --git a/src/plugins/dashboard/public/types.ts b/src/plugins/dashboard/public/types.ts index f58be10e11ba6..7bccd3de6eca8 100644 --- a/src/plugins/dashboard/public/types.ts +++ b/src/plugins/dashboard/public/types.ts @@ -17,7 +17,17 @@ * under the License. */ -import { SavedObject as SavedObjectType, SavedObjectAttributes } from '../../../core/public'; +import { Query, Filter } from 'src/plugins/data/public'; +import { SavedObject as SavedObjectType, SavedObjectAttributes } from 'src/core/public'; +import { + RawSavedDashboardPanelTo60, + RawSavedDashboardPanel610, + RawSavedDashboardPanel620, + RawSavedDashboardPanel630, + RawSavedDashboardPanel640To720, + RawSavedDashboardPanel730ToLatest, +} from './bwc'; +import { ViewMode } from './embeddable_plugin'; export interface DashboardCapabilities { showWriteControls: boolean; @@ -65,3 +75,105 @@ export interface Field { searchable: boolean; subType?: FieldSubType; } + +export type NavAction = (anchorElement?: any) => void; + +/** + * This should always represent the latest dashboard panel shape, after all possible migrations. + */ +export type SavedDashboardPanel = SavedDashboardPanel730ToLatest; + +// id becomes optional starting in 7.3.0 +export type SavedDashboardPanel730ToLatest = Pick< + RawSavedDashboardPanel730ToLatest, + Exclude +> & { + readonly id?: string; + readonly type: string; +}; + +export type SavedDashboardPanel640To720 = Pick< + RawSavedDashboardPanel640To720, + Exclude +> & { + readonly id: string; + readonly type: string; +}; + +export type SavedDashboardPanel630 = Pick< + RawSavedDashboardPanel630, + Exclude +> & { + readonly id: string; + readonly type: string; +}; + +export type SavedDashboardPanel620 = Pick< + RawSavedDashboardPanel620, + Exclude +> & { + readonly id: string; + readonly type: string; +}; + +export type SavedDashboardPanel610 = Pick< + RawSavedDashboardPanel610, + Exclude +> & { + readonly id: string; + readonly type: string; +}; + +export type SavedDashboardPanelTo60 = Pick< + RawSavedDashboardPanelTo60, + Exclude +> & { + readonly id: string; + readonly type: string; +}; + +export interface DashboardAppState { + panels: SavedDashboardPanel[]; + fullScreenMode: boolean; + title: string; + description: string; + timeRestore: boolean; + options: { + hidePanelTitles: boolean; + useMargins: boolean; + }; + query: Query | string; + filters: Filter[]; + viewMode: ViewMode; + savedQuery?: string; +} + +export type DashboardAppStateDefaults = DashboardAppState & { + description?: string; +}; + +export interface DashboardAppStateTransitions { + set: ( + state: DashboardAppState + ) => ( + prop: T, + value: DashboardAppState[T] + ) => DashboardAppState; + setOption: ( + state: DashboardAppState + ) => ( + prop: T, + value: DashboardAppState['options'][T] + ) => DashboardAppState; +} + +export interface SavedDashboardPanelMap { + [key: string]: SavedDashboardPanel; +} + +export interface StagedFilter { + field: string; + value: string; + operator: string; + index: string; +} diff --git a/src/plugins/embeddable/public/lib/embeddables/error_embeddable.test.tsx b/src/plugins/embeddable/public/lib/embeddables/error_embeddable.test.tsx new file mode 100644 index 0000000000000..816001ba42ff1 --- /dev/null +++ b/src/plugins/embeddable/public/lib/embeddables/error_embeddable.test.tsx @@ -0,0 +1,61 @@ +/* + * 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. + */ +import React from 'react'; +import { ErrorEmbeddable } from './error_embeddable'; +import { EmbeddableRoot } from './embeddable_root'; +import { mount } from 'enzyme'; +// @ts-ignore +import { findTestSubject } from '@elastic/eui/lib/test'; + +test('ErrorEmbeddable renders an embeddable', async () => { + const embeddable = new ErrorEmbeddable('some error occurred', { id: '123', title: 'Error' }); + const component = mount(); + expect( + component.getDOMNode().querySelectorAll('[data-test-subj="embeddableStackError"]').length + ).toBe(1); + expect( + component.getDOMNode().querySelectorAll('[data-test-subj="errorMessageMarkdown"]').length + ).toBe(1); + expect( + component + .getDOMNode() + .querySelectorAll('[data-test-subj="errorMessageMarkdown"]')[0] + .innerHTML.includes('some error occurred') + ).toBe(true); +}); + +test('ErrorEmbeddable renders an embeddable with markdown message', async () => { + const error = '[some link](http://localhost:5601/takeMeThere)'; + const embeddable = new ErrorEmbeddable(error, { id: '123', title: 'Error' }); + const component = mount(); + expect( + component.getDOMNode().querySelectorAll('[data-test-subj="embeddableStackError"]').length + ).toBe(1); + expect( + component.getDOMNode().querySelectorAll('[data-test-subj="errorMessageMarkdown"]').length + ).toBe(1); + expect( + component + .getDOMNode() + .querySelectorAll('[data-test-subj="errorMessageMarkdown"]')[0] + .innerHTML.includes( + 'some link' + ) + ).toBe(true); +}); diff --git a/src/plugins/embeddable/public/lib/embeddables/error_embeddable.tsx b/src/plugins/embeddable/public/lib/embeddables/error_embeddable.tsx index 2c2c47775369d..cdbe7af98a4f4 100644 --- a/src/plugins/embeddable/public/lib/embeddables/error_embeddable.tsx +++ b/src/plugins/embeddable/public/lib/embeddables/error_embeddable.tsx @@ -20,6 +20,7 @@ import { EuiText, EuiIcon, EuiSpacer } from '@elastic/eui'; import React from 'react'; import ReactDOM from 'react-dom'; +import { Markdown } from '../../../../kibana_react/public'; import { Embeddable } from './embeddable'; import { EmbeddableInput, EmbeddableOutput, IEmbeddable } from './i_embeddable'; import { IContainer } from '../containers'; @@ -53,7 +54,11 @@ export class ErrorEmbeddable extends Embeddable - {title} + , dom diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx index 06c47bd1bcad8..50d8bcef8506c 100644 --- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/add_panel/add_panel_flyout.tsx @@ -29,7 +29,7 @@ import { EuiTitle, } from '@elastic/eui'; -import { EmbeddableStart } from 'src/plugins/embeddable/public/plugin'; +import { EmbeddableStart } from 'src/plugins/embeddable/public'; import { IContainer } from '../../../../containers'; import { EmbeddableFactoryNotFoundError } from '../../../../errors'; import { SavedObjectFinderCreateNew } from './saved_object_finder_create_new'; diff --git a/src/plugins/kibana_utils/public/state_management/url/kbn_url_tracker.ts b/src/plugins/kibana_utils/public/state_management/url/kbn_url_tracker.ts index b778535a2d428..af8811b1969e6 100644 --- a/src/plugins/kibana_utils/public/state_management/url/kbn_url_tracker.ts +++ b/src/plugins/kibana_utils/public/state_management/url/kbn_url_tracker.ts @@ -115,7 +115,6 @@ export function createKbnUrlTracker({ */ shouldTrackUrlUpdate?: (pathname: string) => boolean; }): KbnUrlTracker { - const historyInstance = history || createHashHistory(); const storageInstance = storage || sessionStorage; // local state storing current listeners and active url @@ -159,6 +158,7 @@ export function createKbnUrlTracker({ function onMountApp() { unsubscribe(); + const historyInstance = history || createHashHistory(); // track current hash when within app unsubscribeURLHistory = historyInstance.listen(location => { if (shouldTrackUrlUpdate(location.pathname)) { diff --git a/src/plugins/share/public/services/short_url_redirect_app.ts b/src/plugins/share/public/services/short_url_redirect_app.ts index 6f72b711f6602..5326aa3a21dc5 100644 --- a/src/plugins/share/public/services/short_url_redirect_app.ts +++ b/src/plugins/share/public/services/short_url_redirect_app.ts @@ -19,7 +19,6 @@ import { CoreSetup } from 'kibana/public'; import { getUrlIdFromGotoRoute, getUrlPath, GOTO_PREFIX } from '../../common/short_url_routes'; -import { hashUrl } from '../../../kibana_utils/public'; export const createShortUrlRedirectApp = (core: CoreSetup, location: Location) => ({ id: 'short_url_redirect', @@ -35,6 +34,7 @@ export const createShortUrlRedirectApp = (core: CoreSetup, location: Location) = const response = await core.http.get<{ url: string }>(getUrlPath(urlId)); const redirectUrl = response.url; + const { hashUrl } = await import('../../../kibana_utils/public'); const hashedUrl = hashUrl(redirectUrl); const url = core.http.basePath.prepend(hashedUrl); diff --git a/tasks/config/karma.js b/tasks/config/karma.js index 24e97aa081e51..4e106ef3e039a 100644 --- a/tasks/config/karma.js +++ b/tasks/config/karma.js @@ -54,7 +54,11 @@ module.exports = function(grunt) { return [ 'http://localhost:5610/test_bundle/built_css.css', - `http://localhost:5610/bundles/kbn-ui-shared-deps/${UiSharedDeps.distFilename}`, + ...UiSharedDeps.jsDepFilenames.map( + chunkFilename => `http://localhost:5610/bundles/kbn-ui-shared-deps/${chunkFilename}` + ), + `http://localhost:5610/bundles/kbn-ui-shared-deps/${UiSharedDeps.jsFilename}`, + 'http://localhost:5610/built_assets/dlls/vendors_runtime.bundle.dll.js', ...DllCompiler.getRawDllConfig().chunks.map( chunk => `http://localhost:5610/built_assets/dlls/vendors${chunk}.bundle.dll.js` diff --git a/test/accessibility/apps/management.ts b/test/accessibility/apps/management.ts index ac2921ed063f5..9e75250403d6b 100644 --- a/test/accessibility/apps/management.ts +++ b/test/accessibility/apps/management.ts @@ -35,7 +35,8 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { // await PageObjects.common.navigateToApp('settings'); // }); - describe('Management', () => { + // FLAKY: https://github.com/elastic/kibana/issues/60470 + describe.skip('Management', () => { before(async () => { await esArchiver.load('discover'); await esArchiver.loadIfNeeded('logstash_functional'); diff --git a/test/functional/apps/context/_context_navigation.js b/test/functional/apps/context/_context_navigation.js new file mode 100644 index 0000000000000..e4066d4159b9e --- /dev/null +++ b/test/functional/apps/context/_context_navigation.js @@ -0,0 +1,61 @@ +/* + * 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. + */ + +import expect from '@kbn/expect'; + +const TEST_COLUMN_NAMES = ['@message']; +const TEST_FILTER_COLUMN_NAMES = [ + ['extension', 'jpg'], + ['geo.src', 'IN'], +]; + +export default function({ getService, getPageObjects }) { + const browser = getService('browser'); + const docTable = getService('docTable'); + const PageObjects = getPageObjects(['common', 'context', 'discover', 'timePicker']); + + describe('context link in discover', function contextSize() { + before(async function() { + await PageObjects.common.navigateToApp('discover'); + await PageObjects.timePicker.setDefaultAbsoluteRange(); + await Promise.all( + TEST_COLUMN_NAMES.map(columnName => PageObjects.discover.clickFieldListItemAdd(columnName)) + ); + for (const [columnName, value] of TEST_FILTER_COLUMN_NAMES) { + await PageObjects.discover.clickFieldListItem(columnName); + await PageObjects.discover.clickFieldListPlusFilter(columnName, value); + } + }); + + it('should go back after loading', async function() { + // navigate to the context view + await docTable.clickRowToggle({ rowIndex: 0 }); + await (await docTable.getRowActions({ rowIndex: 0 }))[0].click(); + await PageObjects.context.waitUntilContextLoadingHasFinished(); + await PageObjects.context.clickSuccessorLoadMoreButton(); + await PageObjects.context.clickSuccessorLoadMoreButton(); + await PageObjects.context.clickSuccessorLoadMoreButton(); + await PageObjects.context.waitUntilContextLoadingHasFinished(); + await browser.goBack(); + await PageObjects.discover.waitForDocTableLoadingComplete(); + const hitCount = await PageObjects.discover.getHitCount(); + expect(hitCount).to.be('1,556'); + }); + }); +} diff --git a/test/functional/apps/context/index.js b/test/functional/apps/context/index.js index c3c938c623731..ffd7daf42c642 100644 --- a/test/functional/apps/context/index.js +++ b/test/functional/apps/context/index.js @@ -38,6 +38,7 @@ export default function({ getService, getPageObjects, loadTestFile }) { return esArchiver.unload('logstash_functional'); }); + loadTestFile(require.resolve('./_context_navigation')); loadTestFile(require.resolve('./_discover_navigation')); loadTestFile(require.resolve('./_filters')); loadTestFile(require.resolve('./_size')); diff --git a/test/functional/apps/dashboard/dashboard_state.js b/test/functional/apps/dashboard/dashboard_state.js index a643a9ee40aa2..024ca0d6dc9e7 100644 --- a/test/functional/apps/dashboard/dashboard_state.js +++ b/test/functional/apps/dashboard/dashboard_state.js @@ -21,10 +21,7 @@ import expect from '@kbn/expect'; import { PIE_CHART_VIS_NAME, AREA_CHART_VIS_NAME } from '../../page_objects/dashboard_page'; -// eslint-disable-next-line -import { - DEFAULT_PANEL_WIDTH -} from '../../../../src/plugins/dashboard/public/embeddable/dashboard_constants'; +import { DEFAULT_PANEL_WIDTH } from '../../../../src/plugins/dashboard/public/application/embeddable/dashboard_constants'; export default function({ getService, getPageObjects }) { const PageObjects = getPageObjects([ diff --git a/test/functional/apps/discover/_doc_navigation.js b/test/functional/apps/discover/_doc_navigation.js index f0a7844b29987..08e0cb0b8d23a 100644 --- a/test/functional/apps/discover/_doc_navigation.js +++ b/test/functional/apps/discover/_doc_navigation.js @@ -31,7 +31,8 @@ export default function({ getService, getPageObjects }) { const PageObjects = getPageObjects(['common', 'discover', 'timePicker']); const esArchiver = getService('esArchiver'); - describe('doc link in discover', function contextSize() { + // FLAKY: https://github.com/elastic/kibana/issues/62281 + describe.skip('doc link in discover', function contextSize() { this.tags('smoke'); before(async function() { await esArchiver.loadIfNeeded('logstash_functional'); diff --git a/test/functional/apps/discover/_field_visualize.ts b/test/functional/apps/discover/_field_visualize.ts index 24f4ba592324c..f8f290b259b7e 100644 --- a/test/functional/apps/discover/_field_visualize.ts +++ b/test/functional/apps/discover/_field_visualize.ts @@ -32,8 +32,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { defaultIndex: 'logstash-*', }; - // FLAKY: https://github.com/elastic/kibana/issues/61714 - describe.skip('discover field visualize button', () => { + describe('discover field visualize button', () => { before(async function() { log.debug('load kibana index with default index pattern'); await esArchiver.load('discover'); @@ -50,7 +49,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { }); it('should visualize a field in area chart', async () => { - await PageObjects.discover.clickFieldListItem('phpmemory'); + await PageObjects.discover.findFieldByName('phpmemory'); log.debug('visualize a phpmemory field'); await PageObjects.discover.clickFieldListItemVisualize('phpmemory'); await PageObjects.header.waitUntilLoadingHasFinished(); @@ -83,7 +82,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { it('should preserve app filters in visualize', async () => { await filterBar.addFilter('bytes', 'is between', '3500', '4000'); - await PageObjects.discover.clickFieldListItem('geo.src'); + await PageObjects.discover.findFieldByName('geo.src'); log.debug('visualize a geo.src field with filter applied'); await PageObjects.discover.clickFieldListItemVisualize('geo.src'); await PageObjects.header.waitUntilLoadingHasFinished(); @@ -119,7 +118,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { it('should preserve query in visualize', async () => { await queryBar.setQuery('machine.os : ios'); await queryBar.submitQuery(); - await PageObjects.discover.clickFieldListItem('geo.dest'); + await PageObjects.discover.findFieldByName('geo.dest'); log.debug('visualize a geo.dest field with query applied'); await PageObjects.discover.clickFieldListItemVisualize('geo.dest'); await PageObjects.header.waitUntilLoadingHasFinished(); diff --git a/test/functional/page_objects/dashboard_page.ts b/test/functional/page_objects/dashboard_page.ts index 0f01097cf50dc..a20d7ae9a5372 100644 --- a/test/functional/page_objects/dashboard_page.ts +++ b/test/functional/page_objects/dashboard_page.ts @@ -17,7 +17,7 @@ * under the License. */ -import { DashboardConstants } from '../../../src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_constants'; +import { DashboardConstants } from '../../../src/plugins/dashboard/public/dashboard_constants'; export const PIE_CHART_VIS_NAME = 'Visualization PieChart'; export const AREA_CHART_VIS_NAME = 'Visualization漢字 AreaChart'; diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts index 10652ce3ec4b2..2377c32a80b5b 100644 --- a/test/functional/page_objects/discover_page.ts +++ b/test/functional/page_objects/discover_page.ts @@ -40,6 +40,11 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider return await el.getVisibleText(); } + public async findFieldByName(name: string) { + const fieldSearch = await testSubjects.find('fieldFilterSearchInput'); + await fieldSearch.type(name); + } + public async saveSearch(searchName: string) { log.debug('saveSearch'); await this.clickSaveSearchButton(); @@ -239,10 +244,16 @@ export function DiscoverPageProvider({ getService, getPageObjects }: FtrProvider await testSubjects.click(`fieldToggle-${field}`); } - public async clickFieldListItemVisualize(field: string) { - return await retry.try(async () => { - await testSubjects.click(`fieldVisualize-${field}`); - }); + public async clickFieldListItemVisualize(fieldName: string) { + const field = await testSubjects.find(`field-${fieldName}-showDetails`); + const isActive = await field.elementHasClass('dscSidebarItem--active'); + + if (!isActive) { + // expand the field to show the "Visualize" button + await field.click(); + } + + await testSubjects.click(`fieldVisualize-${fieldName}`); } public async expectFieldListItemVisualize(field: string) { diff --git a/vars/workers.groovy b/vars/workers.groovy index c5638f2624fe5..1c55c676d9425 100644 --- a/vars/workers.groovy +++ b/vars/workers.groovy @@ -1,23 +1,38 @@ // "Workers" in this file will spin up an instance, do some setup etc depending on the configuration, and then execute some work that you define // e.g. workers.base(name: 'my-worker') { sh "echo 'ready to execute some kibana scripts'" } +def label(size) { + switch(size) { + case 's': + return 'linux && immutable' + case 'l': + return 'tests-l' + case 'xl': + return 'tests-xl' + case 'xxl': + return 'tests-xxl' + } + + error "unknown size '${size}'" +} + /* The base worker that all of the others use. Will clone the scm (assumed to be kibana), and run kibana bootstrap processes by default. Parameters: - label - gobld/agent label to use, e.g. 'linux && immutable' + size - size of worker label to use, e.g. 's' or 'xl' ramDisk - Should the workspace be mounted in memory? Default: true bootstrapped - If true, download kibana dependencies, run kbn bootstrap, etc. Default: true name - Name of the worker for display purposes, filenames, etc. scm - Jenkins scm configuration for checking out code. Use `null` to disable checkout. Default: inherited from job */ def base(Map params, Closure closure) { - def config = [label: '', ramDisk: true, bootstrapped: true, name: 'unnamed-worker', scm: scm] + params - if (!config.label) { - error "You must specify an agent label, such as 'tests-xl' or 'linux && immutable', when using workers.base()" + def config = [size: '', ramDisk: true, bootstrapped: true, name: 'unnamed-worker', scm: scm] + params + if (!config.size) { + error "You must specify an agent size, such as 'xl' or 's', when using workers.base()" } - node(config.label) { + node(label(config.size)) { agentInfo.print() if (config.ramDisk) { @@ -88,7 +103,7 @@ def ci(Map params, Closure closure) { // Worker for running the current intake jobs. Just runs a single script after bootstrap. def intake(jobName, String script) { return { - ci(name: jobName, label: 'linux && immutable', ramDisk: false) { + ci(name: jobName, size: 's', ramDisk: false) { withEnv(["JOB=${jobName}"]) { runbld(script, "Execute ${jobName}") } @@ -99,7 +114,7 @@ def intake(jobName, String script) { // Worker for running functional tests. Runs a setup process (e.g. the kibana build) then executes a map of closures in parallel (e.g. one for each ciGroup) def functional(name, Closure setup, Map processes) { return { - parallelProcesses(name: name, setup: setup, processes: processes, delayBetweenProcesses: 20, label: 'tests-xl') + parallelProcesses(name: name, setup: setup, processes: processes, delayBetweenProcesses: 20, size: 'xl') } } @@ -111,12 +126,12 @@ def functional(name, Closure setup, Map processes) { setup: Closure to execute after the agent is bootstrapped, before starting the parallel work processes: Map of closures that will execute in parallel after setup. Each closure is passed a unique number. delayBetweenProcesses: Number of seconds to wait between starting the parallel processes. Useful to spread the load of heavy init processes, e.g. Elasticsearch starting up. Default: 0 - label: gobld/agent label to use, e.g. 'linux && immutable'. Default: 'tests-xl', a 32 CPU machine used for running many functional test suites in parallel + size: size of worker label to use, e.g. 's' or 'xl' */ def parallelProcesses(Map params) { - def config = [name: 'parallel-worker', setup: {}, processes: [:], delayBetweenProcesses: 0, label: 'tests-xl'] + params + def config = [name: 'parallel-worker', setup: {}, processes: [:], delayBetweenProcesses: 0, size: 'xl'] + params - ci(label: config.label, name: config.name) { + ci(size: config.size, name: config.name) { config.setup() def nextProcessNumber = 1 diff --git a/webpackShims/elasticsearch-browser.js b/webpackShims/elasticsearch-browser.js deleted file mode 100644 index a4373dcdfe1d1..0000000000000 --- a/webpackShims/elasticsearch-browser.js +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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. - */ - -require('angular'); -module.exports = require('elasticsearch-browser/elasticsearch.angular.js'); diff --git a/x-pack/legacy/plugins/apm/public/components/shared/ErrorRateAlertTrigger/index.tsx b/x-pack/legacy/plugins/apm/public/components/shared/ErrorRateAlertTrigger/index.tsx index 6d0a2b96092a1..9bfc5936a555e 100644 --- a/x-pack/legacy/plugins/apm/public/components/shared/ErrorRateAlertTrigger/index.tsx +++ b/x-pack/legacy/plugins/apm/public/components/shared/ErrorRateAlertTrigger/index.tsx @@ -58,7 +58,7 @@ export function ErrorRateAlertTrigger(props: Props) { , - setAlertParams('windowSize', windowSize) + setAlertParams('windowSize', windowSize || '') } onChangeWindowUnit={windowUnit => setAlertParams('windowUnit', windowUnit) diff --git a/x-pack/legacy/plugins/apm/public/components/shared/TransactionDurationAlertTrigger/index.tsx b/x-pack/legacy/plugins/apm/public/components/shared/TransactionDurationAlertTrigger/index.tsx index cdc7c30089b4f..077e6535a8b21 100644 --- a/x-pack/legacy/plugins/apm/public/components/shared/TransactionDurationAlertTrigger/index.tsx +++ b/x-pack/legacy/plugins/apm/public/components/shared/TransactionDurationAlertTrigger/index.tsx @@ -123,7 +123,7 @@ export function TransactionDurationAlertTrigger(props: Props) { , - setAlertParams('windowSize', timeWindowSize) + setAlertParams('windowSize', timeWindowSize || '') } onChangeWindowUnit={timeWindowUnit => setAlertParams('windowUnit', timeWindowUnit) diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/workpad_export/index.ts b/x-pack/legacy/plugins/canvas/public/components/workpad_header/workpad_export/index.ts index 949264fcc9fdb..b0083eb4f87e2 100644 --- a/x-pack/legacy/plugins/canvas/public/components/workpad_header/workpad_export/index.ts +++ b/x-pack/legacy/plugins/canvas/public/components/workpad_header/workpad_export/index.ts @@ -57,7 +57,7 @@ export const WorkpadExport = compose( ({ workpad, pageCount, kibana }: Props & WithKibanaProps): ComponentProps => ({ getExportUrl: type => { if (type === 'pdf') { - const pdfUrl = getPdfUrl(workpad, { pageCount }, kibana.services.http.basePath.prepend); + const pdfUrl = getPdfUrl(workpad, { pageCount }, kibana.services.http.basePath); return getAbsoluteUrl(pdfUrl); } @@ -78,7 +78,7 @@ export const WorkpadExport = compose( onExport: type => { switch (type) { case 'pdf': - return createPdf(workpad, { pageCount }, kibana.services.http.basePath.prepend) + return createPdf(workpad, { pageCount }, kibana.services.http.basePath) .then(({ data }: { data: { job: { id: string } } }) => { notify.info(strings.getExportPDFMessage(), { title: strings.getExportPDFTitle(workpad.name), diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/workpad_export/utils.test.ts b/x-pack/legacy/plugins/canvas/public/components/workpad_header/workpad_export/utils.test.ts index ceaf82c1c07d6..6c7d7ddd0a793 100644 --- a/x-pack/legacy/plugins/canvas/public/components/workpad_header/workpad_export/utils.test.ts +++ b/x-pack/legacy/plugins/canvas/public/components/workpad_header/workpad_export/utils.test.ts @@ -9,29 +9,34 @@ jest.mock('../../../../common/lib/fetch'); import { getPdfUrl, createPdf } from './utils'; import { workpads } from '../../../../__tests__/fixtures/workpads'; import { fetch } from '../../../../common/lib/fetch'; +import { IBasePath } from 'kibana/public'; -const addBasePath = jest.fn().mockImplementation(s => `basepath/${s}`); +const basePath = ({ + prepend: jest.fn().mockImplementation(s => `basepath/s/spacey/${s}`), + get: () => 'basepath/s/spacey', + serverBasePath: `basepath`, +} as unknown) as IBasePath; const workpad = workpads[0]; test('getPdfUrl returns the correct url', () => { - const url = getPdfUrl(workpad, { pageCount: 2 }, addBasePath); + const url = getPdfUrl(workpad, { pageCount: 2 }, basePath); expect(url).toMatchInlineSnapshot( - `"basepath//api/reporting/generate/printablePdf?jobParams=(browserTimezone:America%2FPhoenix,layout:(dimensions:(height:0,width:0),id:preserve_layout),objectType:'canvas%20workpad',relativeUrls:!(%2Fapp%2Fcanvas%23%2Fexport%2Fworkpad%2Fpdf%2Fbase-workpad%2Fpage%2F1,%2Fapp%2Fcanvas%23%2Fexport%2Fworkpad%2Fpdf%2Fbase-workpad%2Fpage%2F2),title:'base%20workpad')"` + `"basepath/s/spacey//api/reporting/generate/printablePdf?jobParams=(browserTimezone:America%2FPhoenix,layout:(dimensions:(height:0,width:0),id:preserve_layout),objectType:'canvas%20workpad',relativeUrls:!(%2Fs%2Fspacey%2Fapp%2Fcanvas%23%2Fexport%2Fworkpad%2Fpdf%2Fbase-workpad%2Fpage%2F1,%2Fs%2Fspacey%2Fapp%2Fcanvas%23%2Fexport%2Fworkpad%2Fpdf%2Fbase-workpad%2Fpage%2F2),title:'base%20workpad')"` ); }); test('createPdf posts to create the pdf', () => { - createPdf(workpad, { pageCount: 2 }, addBasePath); + createPdf(workpad, { pageCount: 2 }, basePath); expect(fetch.post).toBeCalled(); const args = (fetch.post as jest.MockedFunction).mock.calls[0]; - expect(args[0]).toMatchInlineSnapshot(`"basepath//api/reporting/generate/printablePdf"`); + expect(args[0]).toMatchInlineSnapshot(`"basepath/s/spacey//api/reporting/generate/printablePdf"`); expect(args[1]).toMatchInlineSnapshot(` Object { - "jobParams": "(browserTimezone:America/Phoenix,layout:(dimensions:(height:0,width:0),id:preserve_layout),objectType:'canvas workpad',relativeUrls:!(/app/canvas#/export/workpad/pdf/base-workpad/page/1,/app/canvas#/export/workpad/pdf/base-workpad/page/2),title:'base workpad')", + "jobParams": "(browserTimezone:America/Phoenix,layout:(dimensions:(height:0,width:0),id:preserve_layout),objectType:'canvas workpad',relativeUrls:!(/s/spacey/app/canvas#/export/workpad/pdf/base-workpad/page/1,/s/spacey/app/canvas#/export/workpad/pdf/base-workpad/page/2),title:'base workpad')", } `); }); diff --git a/x-pack/legacy/plugins/canvas/public/components/workpad_header/workpad_export/utils.ts b/x-pack/legacy/plugins/canvas/public/components/workpad_header/workpad_export/utils.ts index 5adbf4ce66c13..dc99c0687f388 100644 --- a/x-pack/legacy/plugins/canvas/public/components/workpad_header/workpad_export/utils.ts +++ b/x-pack/legacy/plugins/canvas/public/components/workpad_header/workpad_export/utils.ts @@ -6,6 +6,7 @@ import rison from 'rison-node'; // @ts-ignore Untyped local. +import { IBasePath } from 'kibana/public'; import { fetch } from '../../../../common/lib/fetch'; import { CanvasWorkpad } from '../../../../types'; import { url } from '../../../../../../../../src/plugins/kibana_utils/public'; @@ -17,9 +18,7 @@ interface PageCount { pageCount: number; } -type AddBasePath = (url: string) => string; - -type Arguments = [CanvasWorkpad, PageCount, AddBasePath]; +type Arguments = [CanvasWorkpad, PageCount, IBasePath]; interface PdfUrlData { createPdfUri: string; @@ -29,10 +28,11 @@ interface PdfUrlData { function getPdfUrlParts( { id, name: title, width, height }: CanvasWorkpad, { pageCount }: PageCount, - addBasePath: (path: string) => string + basePath: IBasePath ): PdfUrlData { - const reportingEntry = addBasePath('/api/reporting/generate'); - const canvasEntry = '/app/canvas#'; + const reportingEntry = basePath.prepend('/api/reporting/generate'); + const urlPrefix = basePath.get().replace(basePath.serverBasePath, ''); // for Spaces prefix, which is included in basePath.get() + const canvasEntry = `${urlPrefix}/app/canvas#`; // The viewport in Reporting by specifying the dimensions. In order for things to work, // we need a viewport that will include all of the pages in the workpad. The viewport diff --git a/x-pack/legacy/plugins/dashboard_mode/public/dashboard_viewer.js b/x-pack/legacy/plugins/dashboard_mode/public/dashboard_viewer.js index a51972852c6ca..905c88a6d18a0 100644 --- a/x-pack/legacy/plugins/dashboard_mode/public/dashboard_viewer.js +++ b/x-pack/legacy/plugins/dashboard_mode/public/dashboard_viewer.js @@ -29,12 +29,14 @@ import _ from 'lodash'; import 'ui/autoload/all'; import 'ui/agg_response'; import 'leaflet'; -import 'plugins/kibana/dashboard/legacy'; import { npStart } from 'ui/new_platform'; import { localApplicationService } from 'plugins/kibana/local_application_service'; import { showAppRedirectNotification } from '../../../../../src/plugins/kibana_legacy/public'; -import { DashboardConstants, createDashboardEditUrl } from 'plugins/kibana/dashboard'; +import { + DashboardConstants, + createDashboardEditUrl, +} from '../../../../../src/plugins/dashboard/public'; npStart.plugins.kibanaLegacy.dashboardConfig.turnHideWriteControlsOn(); diff --git a/x-pack/legacy/plugins/lens/public/legacy_imports.ts b/x-pack/legacy/plugins/lens/public/legacy_imports.ts index 857443ae0fa1c..0f37e460e2957 100644 --- a/x-pack/legacy/plugins/lens/public/legacy_imports.ts +++ b/x-pack/legacy/plugins/lens/public/legacy_imports.ts @@ -7,4 +7,4 @@ import { npSetup } from 'ui/new_platform'; export const { visualizations } = npSetup.plugins; export { VisualizationsSetup } from '../../../../../src/plugins/visualizations/public'; -export { DashboardConstants } from '../../../../../src/legacy/core_plugins/kibana/public/dashboard'; +export { DashboardConstants } from '../../../../../src/plugins/dashboard/public'; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_map_select.js b/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_map_select.js index bf57306df5697..eadaf42ca694d 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_map_select.js +++ b/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_map_select.js @@ -99,6 +99,7 @@ export class ColorMapSelect extends Component { ); } else @@ -108,6 +109,7 @@ export class ColorMapSelect extends Component { field={this.props.styleProperty.getField()} getValueSuggestions={this.props.styleProperty.getValueSuggestions} onChange={this._onCustomColorMapChange} + swatches={this.props.swatches} /> ); diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops.js b/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops.js index 059543d705fc7..20fd97a229352 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops.js +++ b/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops.js @@ -8,61 +8,8 @@ import _ from 'lodash'; import React from 'react'; import { removeRow, isColorInvalid } from './color_stops_utils'; import { i18n } from '@kbn/i18n'; -import { EuiButtonIcon, EuiColorPicker, EuiFlexGroup, EuiFlexItem, EuiFormRow } from '@elastic/eui'; - -function getColorStopRow({ index, errors, stopInput, onColorChange, color, deleteButton, onAdd }) { - const colorPickerButtons = ( -
- {deleteButton} - -
- ); - return ( - - - - {stopInput} - - - - - - - ); -} - -export function getDeleteButton(onRemove) { - return ( - - ); -} +import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem, EuiFormRow } from '@elastic/eui'; +import { MbValidatedColorPicker } from './mb_validated_color_picker'; export const ColorStops = ({ onChange, @@ -72,6 +19,7 @@ export const ColorStops = ({ renderStopInput, addNewRow, canDeleteStop, + swatches, }) => { function getStopInput(stop, index) { const onStopChange = newStopValue => { @@ -134,10 +82,56 @@ export const ColorStops = ({ isInvalid: isStopsInvalid(newColorStops), }); }; - deleteButton = getDeleteButton(onRemove); + deleteButton = ( + + ); } - return getColorStopRow({ index, errors, stopInput, onColorChange, color, deleteButton, onAdd }); + const colorPickerButtons = ( +
+ {deleteButton} + +
+ ); + return ( + + + + {stopInput} + + + + + + + ); }); return
{rows}
; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops_categorical.js b/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops_categorical.js index edf230b0a945c..0656173e5c411 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops_categorical.js +++ b/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops_categorical.js @@ -27,6 +27,7 @@ export const ColorStopsCategorical = ({ field, onChange, getValueSuggestions, + swatches, }) => { const getStopError = (stop, index) => { let count = 0; @@ -81,6 +82,7 @@ export const ColorStopsCategorical = ({ renderStopInput={renderStopInput} canDeleteStop={canDeleteStop} addNewRow={addCategoricalRow} + swatches={swatches} /> ); }; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops_ordinal.js b/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops_ordinal.js index 0f6a0583d3dbc..4e2d07b9dfea0 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops_ordinal.js +++ b/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_stops_ordinal.js @@ -20,6 +20,7 @@ import { i18n } from '@kbn/i18n'; export const ColorStopsOrdinal = ({ colorStops = [{ stop: 0, color: DEFAULT_CUSTOM_COLOR }], onChange, + swatches, }) => { const getStopError = (stop, index) => { let error; @@ -69,6 +70,7 @@ export const ColorStopsOrdinal = ({ renderStopInput={renderStopInput} canDeleteStop={canDeleteStop} addNewRow={addOrdinalRow} + swatches={swatches} /> ); }; diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/dynamic_color_form.js b/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/dynamic_color_form.js index 5e8f720fcc5e3..460e7379920c4 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/dynamic_color_form.js +++ b/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/dynamic_color_form.js @@ -18,6 +18,7 @@ export function DynamicColorForm({ onDynamicStyleChange, staticDynamicSelect, styleProperty, + swatches, }) { const styleOptions = styleProperty.getOptions(); @@ -101,6 +102,7 @@ export function DynamicColorForm({ useCustomColorMap={_.get(styleOptions, 'useCustomColorRamp', false)} styleProperty={styleProperty} showColorMapTypeToggle={showColorMapTypeToggle} + swatches={swatches} /> ); } else if (styleProperty.isCategorical()) { @@ -118,6 +120,7 @@ export function DynamicColorForm({ useCustomColorMap={_.get(styleOptions, 'useCustomColorPalette', false)} styleProperty={styleProperty} showColorMapTypeToggle={showColorMapTypeToggle} + swatches={swatches} /> ); } diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/mb_validated_color_picker.tsx b/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/mb_validated_color_picker.tsx new file mode 100644 index 0000000000000..b4fad6690b9ac --- /dev/null +++ b/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/mb_validated_color_picker.tsx @@ -0,0 +1,51 @@ +/* + * 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 React, { Component } from 'react'; +import { isValidHex, EuiColorPicker, EuiFormControlLayoutProps } from '@elastic/eui'; + +export const RGBA_0000 = 'rgba(0,0,0,0)'; + +interface Props { + onChange: (color: string) => void; + color: string; + swatches?: string[]; + append?: EuiFormControlLayoutProps['append']; +} + +interface State { + colorInputValue: string; +} + +// EuiColorPicker treats '' or invalid colors as transparent. +// Mapbox logs errors for '' or invalid colors. +// MbValidatedColorPicker is a wrapper around EuiColorPicker that reconciles the behavior difference +// between the two by returning a Mapbox safe RGBA_0000 for '' or invalid colors +// while keeping invalid state local so EuiColorPicker's input properly handles text input. +export class MbValidatedColorPicker extends Component { + state = { + colorInputValue: this.props.color === RGBA_0000 ? '' : this.props.color, + }; + + _onColorChange = (color: string) => { + // reflect all user input, whether valid or not + this.setState({ colorInputValue: color }); + // Only surface mapbox valid input to caller + this.props.onChange(isValidHex(color) ? color : RGBA_0000); + }; + + render() { + return ( + + ); + } +} diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/static_color_form.js b/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/static_color_form.js index ab1634a53a966..a295556ee3126 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/static_color_form.js +++ b/x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/static_color_form.js @@ -5,7 +5,8 @@ */ import React from 'react'; -import { EuiColorPicker, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { MbValidatedColorPicker } from './mb_validated_color_picker'; export function StaticColorForm({ onStaticStyleChange, @@ -23,11 +24,10 @@ export function StaticColorForm({ {staticDynamicSelect} - diff --git a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.js b/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.js index 146bc40aa8531..e671f00b78381 100644 --- a/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.js +++ b/x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.js @@ -18,11 +18,10 @@ import { EuiTextColor, } from '@elastic/eui'; import { Category } from '../components/legend/category'; -import { COLOR_MAP_TYPE } from '../../../../../common/constants'; +import { COLOR_MAP_TYPE, RGBA_0000 } from '../../../../../common/constants'; import { isCategoricalStopsInvalid } from '../components/color/color_stops_utils'; const EMPTY_STOPS = { stops: [], defaultColor: null }; -const RGBA_0000 = 'rgba(0,0,0,0)'; export class DynamicColorProperty extends DynamicStyleProperty { syncCircleColorWithMb(mbLayerId, mbMap, alpha) { diff --git a/x-pack/legacy/plugins/maps/server/plugin.js b/x-pack/legacy/plugins/maps/server/plugin.js index 5b52a3eba2f23..25c552433e9f8 100644 --- a/x-pack/legacy/plugins/maps/server/plugin.js +++ b/x-pack/legacy/plugins/maps/server/plugin.js @@ -9,7 +9,6 @@ import { getEcommerceSavedObjects } from './sample_data/ecommerce_saved_objects' import { getFlightsSavedObjects } from './sample_data/flights_saved_objects.js'; import { getWebLogsSavedObjects } from './sample_data/web_logs_saved_objects.js'; import { registerMapsUsageCollector } from './maps_telemetry/collectors/register'; -import { LICENSE_CHECK_STATE } from '../../../../plugins/licensing/server'; import { initRoutes } from './routes'; import { emsBoundariesSpecProvider } from './tutorials/ems'; @@ -52,7 +51,7 @@ export class MapPlugin { licensing.license$.subscribe(license => { const { state } = license.check('maps', 'basic'); - if (state === LICENSE_CHECK_STATE.Valid && !routesInitialized) { + if (state === 'valid' && !routesInitialized) { routesInitialized = true; initRoutes(__LEGACY, license.uid); } diff --git a/x-pack/legacy/plugins/reporting/common/constants.ts b/x-pack/legacy/plugins/reporting/common/constants.ts index 1746345879192..8f7a06ba9f8e9 100644 --- a/x-pack/legacy/plugins/reporting/common/constants.ts +++ b/x-pack/legacy/plugins/reporting/common/constants.ts @@ -27,6 +27,9 @@ export const WHITELISTED_JOB_CONTENT_TYPES = [ 'image/png', ]; +// See: +// https://github.com/chromium/chromium/blob/3611052c055897e5ebbc5b73ea295092e0c20141/services/network/public/cpp/header_util_unittest.cc#L50 +// For a list of headers that chromium doesn't like export const KBN_SCREENSHOT_HEADER_BLACKLIST = [ 'accept-encoding', 'connection', @@ -38,8 +41,14 @@ export const KBN_SCREENSHOT_HEADER_BLACKLIST = [ // only for a single transport-level connection, and shouldn't // be stored by caches or forwarded by proxies. 'transfer-encoding', + 'trailer', + 'te', + 'upgrade', + 'keep-alive', ]; +export const KBN_SCREENSHOT_HEADER_BLACKLIST_STARTS_WITH_PATTERN = ['proxy-']; + export const UI_SETTINGS_CUSTOM_PDF_LOGO = 'xpackReporting:customPdfLogo'; /** diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/decrypt_job_headers.test.ts b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/decrypt_job_headers.test.ts index 468caf93ec5dd..9085fb3cbc876 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/decrypt_job_headers.test.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/decrypt_job_headers.test.ts @@ -5,33 +5,27 @@ */ import { cryptoFactory } from '../../../server/lib/crypto'; -import { createMockServer } from '../../../test_helpers'; import { Logger } from '../../../types'; import { decryptJobHeaders } from './decrypt_job_headers'; -let mockServer: any; -beforeEach(() => { - mockServer = createMockServer(''); -}); - -const encryptHeaders = async (headers: Record) => { - const crypto = cryptoFactory(mockServer); +const encryptHeaders = async (encryptionKey: string, headers: Record) => { + const crypto = cryptoFactory(encryptionKey); return await crypto.encrypt(headers); }; describe('headers', () => { test(`fails if it can't decrypt headers`, async () => { - await expect( + const getDecryptedHeaders = () => decryptJobHeaders({ + encryptionKey: 'abcsecretsauce', job: { headers: 'Q53+9A+zf+Xe+ceR/uB/aR/Sw/8e+M+qR+WiG+8z+EY+mo+HiU/zQL+Xn', }, logger: ({ error: jest.fn(), } as unknown) as Logger, - server: mockServer, - }) - ).rejects.toMatchInlineSnapshot( + }); + await expect(getDecryptedHeaders()).rejects.toMatchInlineSnapshot( `[Error: Failed to decrypt report job data. Please ensure that xpack.reporting.encryptionKey is set and re-generate this report. Error: Invalid IV length]` ); }); @@ -42,15 +36,15 @@ describe('headers', () => { baz: 'quix', }; - const encryptedHeaders = await encryptHeaders(headers); + const encryptedHeaders = await encryptHeaders('abcsecretsauce', headers); const decryptedHeaders = await decryptJobHeaders({ + encryptionKey: 'abcsecretsauce', job: { title: 'cool-job-bro', type: 'csv', headers: encryptedHeaders, }, logger: {} as Logger, - server: mockServer, }); expect(decryptedHeaders).toEqual(headers); }); diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/decrypt_job_headers.ts b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/decrypt_job_headers.ts index 436b2c2dab1ad..6f415d7ee5ea9 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/decrypt_job_headers.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/decrypt_job_headers.ts @@ -6,7 +6,7 @@ import { i18n } from '@kbn/i18n'; import { cryptoFactory } from '../../../server/lib/crypto'; -import { CryptoFactory, ServerFacade, Logger } from '../../../types'; +import { CryptoFactory, Logger } from '../../../types'; interface HasEncryptedHeaders { headers?: string; @@ -17,15 +17,15 @@ export const decryptJobHeaders = async < JobParamsType, JobDocPayloadType extends HasEncryptedHeaders >({ - server, + encryptionKey, job, logger, }: { - server: ServerFacade; + encryptionKey?: string; job: JobDocPayloadType; logger: Logger; }): Promise> => { - const crypto: CryptoFactory = cryptoFactory(server); + const crypto: CryptoFactory = cryptoFactory(encryptionKey); try { const decryptedHeaders: Record = await crypto.decrypt(job.headers); return decryptedHeaders; diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_conditional_headers.test.ts b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_conditional_headers.test.ts index eedb742ad7597..5f5fc94eee830 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_conditional_headers.test.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_conditional_headers.test.ts @@ -4,27 +4,32 @@ * you may not use this file except in compliance with the Elastic License. */ -import { createMockReportingCore, createMockServer } from '../../../test_helpers'; -import { ReportingCore } from '../../../server'; +import sinon from 'sinon'; +import { createMockReportingCore } from '../../../test_helpers'; +import { ReportingConfig, ReportingCore } from '../../../server/types'; import { JobDocPayload } from '../../../types'; import { JobDocPayloadPDF } from '../../printable_pdf/types'; import { getConditionalHeaders, getCustomLogo } from './index'; +let mockConfig: ReportingConfig; let mockReportingPlugin: ReportingCore; -let mockServer: any; + +const getMockConfig = (mockConfigGet: sinon.SinonStub) => ({ + get: mockConfigGet, + kbnConfig: { get: mockConfigGet }, +}); + beforeEach(async () => { - mockReportingPlugin = await createMockReportingCore(); - mockServer = createMockServer(''); + const mockConfigGet = sinon + .stub() + .withArgs('kibanaServer', 'hostname') + .returns('custom-hostname'); + mockConfig = getMockConfig(mockConfigGet); + mockReportingPlugin = await createMockReportingCore(mockConfig); }); describe('conditions', () => { test(`uses hostname from reporting config if set`, async () => { - const settings: any = { - 'xpack.reporting.kibanaServer.hostname': 'custom-hostname', - }; - - mockServer = createMockServer({ settings }); - const permittedHeaders = { foo: 'bar', baz: 'quix', @@ -33,121 +38,20 @@ describe('conditions', () => { const conditionalHeaders = await getConditionalHeaders({ job: {} as JobDocPayload, filteredHeaders: permittedHeaders, - server: mockServer, + config: mockConfig, }); expect(conditionalHeaders.conditions.hostname).toEqual( - mockServer.config().get('xpack.reporting.kibanaServer.hostname') + mockConfig.get('kibanaServer', 'hostname') ); - }); - - test(`uses hostname from server.config if reporting config not set`, async () => { - const permittedHeaders = { - foo: 'bar', - baz: 'quix', - }; - - const conditionalHeaders = await getConditionalHeaders({ - job: {} as JobDocPayload, - filteredHeaders: permittedHeaders, - server: mockServer, - }); - - expect(conditionalHeaders.conditions.hostname).toEqual(mockServer.config().get('server.host')); - }); - - test(`uses port from reporting config if set`, async () => { - const settings = { - 'xpack.reporting.kibanaServer.port': 443, - }; - - mockServer = createMockServer({ settings }); - - const permittedHeaders = { - foo: 'bar', - baz: 'quix', - }; - - const conditionalHeaders = await getConditionalHeaders({ - job: {} as JobDocPayload, - filteredHeaders: permittedHeaders, - server: mockServer, - }); - - expect(conditionalHeaders.conditions.port).toEqual( - mockServer.config().get('xpack.reporting.kibanaServer.port') + expect(conditionalHeaders.conditions.port).toEqual(mockConfig.get('kibanaServer', 'port')); + expect(conditionalHeaders.conditions.protocol).toEqual( + mockConfig.get('kibanaServer', 'protocol') ); - }); - - test(`uses port from server if reporting config not set`, async () => { - const permittedHeaders = { - foo: 'bar', - baz: 'quix', - }; - - const conditionalHeaders = await getConditionalHeaders({ - job: {} as JobDocPayload, - filteredHeaders: permittedHeaders, - server: mockServer, - }); - - expect(conditionalHeaders.conditions.port).toEqual(mockServer.config().get('server.port')); - }); - - test(`uses basePath from server config`, async () => { - const permittedHeaders = { - foo: 'bar', - baz: 'quix', - }; - - const conditionalHeaders = await getConditionalHeaders({ - job: {} as JobDocPayload, - filteredHeaders: permittedHeaders, - server: mockServer, - }); - expect(conditionalHeaders.conditions.basePath).toEqual( - mockServer.config().get('server.basePath') + mockConfig.kbnConfig.get('server', 'basePath') ); }); - - test(`uses protocol from reporting config if set`, async () => { - const settings = { - 'xpack.reporting.kibanaServer.protocol': 'https', - }; - - mockServer = createMockServer({ settings }); - - const permittedHeaders = { - foo: 'bar', - baz: 'quix', - }; - - const conditionalHeaders = await getConditionalHeaders({ - job: {} as JobDocPayload, - filteredHeaders: permittedHeaders, - server: mockServer, - }); - - expect(conditionalHeaders.conditions.protocol).toEqual( - mockServer.config().get('xpack.reporting.kibanaServer.protocol') - ); - }); - - test(`uses protocol from server.info`, async () => { - const permittedHeaders = { - foo: 'bar', - baz: 'quix', - }; - - const conditionalHeaders = await getConditionalHeaders({ - job: {} as JobDocPayload, - filteredHeaders: permittedHeaders, - server: mockServer, - }); - - expect(conditionalHeaders.conditions.protocol).toEqual(mockServer.info.protocol); - }); }); test('uses basePath from job when creating saved object service', async () => { @@ -161,14 +65,14 @@ test('uses basePath from job when creating saved object service', async () => { const conditionalHeaders = await getConditionalHeaders({ job: {} as JobDocPayload, filteredHeaders: permittedHeaders, - server: mockServer, + config: mockConfig, }); const jobBasePath = '/sbp/s/marketing'; await getCustomLogo({ reporting: mockReportingPlugin, job: { basePath: jobBasePath } as JobDocPayloadPDF, conditionalHeaders, - server: mockServer, + config: mockConfig, }); const getBasePath = mockGetSavedObjectsClient.mock.calls[0][0].getBasePath; @@ -179,6 +83,11 @@ test(`uses basePath from server if job doesn't have a basePath when creating sav const mockGetSavedObjectsClient = jest.fn(); mockReportingPlugin.getSavedObjectsClient = mockGetSavedObjectsClient; + const mockConfigGet = sinon.stub(); + mockConfigGet.withArgs('kibanaServer', 'hostname').returns('localhost'); + mockConfigGet.withArgs('server', 'basePath').returns('/sbp'); + mockConfig = getMockConfig(mockConfigGet); + const permittedHeaders = { foo: 'bar', baz: 'quix', @@ -186,14 +95,14 @@ test(`uses basePath from server if job doesn't have a basePath when creating sav const conditionalHeaders = await getConditionalHeaders({ job: {} as JobDocPayload, filteredHeaders: permittedHeaders, - server: mockServer, + config: mockConfig, }); await getCustomLogo({ reporting: mockReportingPlugin, job: {} as JobDocPayloadPDF, conditionalHeaders, - server: mockServer, + config: mockConfig, }); const getBasePath = mockGetSavedObjectsClient.mock.calls[0][0].getBasePath; @@ -225,19 +134,26 @@ test(`uses basePath from server if job doesn't have a basePath when creating sav describe('config formatting', () => { test(`lowercases server.host`, async () => { - mockServer = createMockServer({ settings: { 'server.host': 'COOL-HOSTNAME' } }); + const mockConfigGet = sinon + .stub() + .withArgs('server', 'host') + .returns('COOL-HOSTNAME'); + mockConfig = getMockConfig(mockConfigGet); + const conditionalHeaders = await getConditionalHeaders({ job: {} as JobDocPayload, filteredHeaders: {}, - server: mockServer, + config: mockConfig, }); expect(conditionalHeaders.conditions.hostname).toEqual('cool-hostname'); }); - test(`lowercases xpack.reporting.kibanaServer.hostname`, async () => { - mockServer = createMockServer({ - settings: { 'xpack.reporting.kibanaServer.hostname': 'GREAT-HOSTNAME' }, - }); + test(`lowercases kibanaServer.hostname`, async () => { + const mockConfigGet = sinon + .stub() + .withArgs('kibanaServer', 'hostname') + .returns('GREAT-HOSTNAME'); + mockConfig = getMockConfig(mockConfigGet); const conditionalHeaders = await getConditionalHeaders({ job: { title: 'cool-job-bro', @@ -249,7 +165,7 @@ describe('config formatting', () => { }, }, filteredHeaders: {}, - server: mockServer, + config: mockConfig, }); expect(conditionalHeaders.conditions.hostname).toEqual('great-hostname'); }); diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_conditional_headers.ts b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_conditional_headers.ts index 975060a8052f0..bd7999d697ca9 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_conditional_headers.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_conditional_headers.ts @@ -3,29 +3,31 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { ConditionalHeaders, ServerFacade } from '../../../types'; + +import { ReportingConfig } from '../../../server/types'; +import { ConditionalHeaders } from '../../../types'; export const getConditionalHeaders = ({ - server, + config, job, filteredHeaders, }: { - server: ServerFacade; + config: ReportingConfig; job: JobDocPayloadType; filteredHeaders: Record; }) => { - const config = server.config(); + const { kbnConfig } = config; const [hostname, port, basePath, protocol] = [ - config.get('xpack.reporting.kibanaServer.hostname') || config.get('server.host'), - config.get('xpack.reporting.kibanaServer.port') || config.get('server.port'), - config.get('server.basePath'), - config.get('xpack.reporting.kibanaServer.protocol') || server.info.protocol, + config.get('kibanaServer', 'hostname'), + config.get('kibanaServer', 'port'), + kbnConfig.get('server', 'basePath'), + config.get('kibanaServer', 'protocol'), ] as [string, number, string, string]; const conditionalHeaders: ConditionalHeaders = { headers: filteredHeaders, conditions: { - hostname: hostname.toLowerCase(), + hostname: hostname ? hostname.toLowerCase() : hostname, port, basePath, protocol, diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_custom_logo.test.ts b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_custom_logo.test.ts index fa53f474dfba7..2cbde69c81316 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_custom_logo.test.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_custom_logo.test.ts @@ -5,16 +5,18 @@ */ import { ReportingCore } from '../../../server'; -import { createMockReportingCore, createMockServer } from '../../../test_helpers'; -import { ServerFacade } from '../../../types'; +import { createMockReportingCore } from '../../../test_helpers'; import { JobDocPayloadPDF } from '../../printable_pdf/types'; import { getConditionalHeaders, getCustomLogo } from './index'; +const mockConfigGet = jest.fn().mockImplementation((key: string) => { + return 'localhost'; +}); +const mockConfig = { get: mockConfigGet, kbnConfig: { get: mockConfigGet } }; + let mockReportingPlugin: ReportingCore; -let mockServer: ServerFacade; beforeEach(async () => { - mockReportingPlugin = await createMockReportingCore(); - mockServer = createMockServer(''); + mockReportingPlugin = await createMockReportingCore(mockConfig); }); test(`gets logo from uiSettings`, async () => { @@ -37,14 +39,14 @@ test(`gets logo from uiSettings`, async () => { const conditionalHeaders = await getConditionalHeaders({ job: {} as JobDocPayloadPDF, filteredHeaders: permittedHeaders, - server: mockServer, + config: mockConfig, }); const { logo } = await getCustomLogo({ reporting: mockReportingPlugin, + config: mockConfig, job: {} as JobDocPayloadPDF, conditionalHeaders, - server: mockServer, }); expect(mockGet).toBeCalledWith('xpackReporting:customPdfLogo'); diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_custom_logo.ts b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_custom_logo.ts index 7af5edab41ab7..a13f992e7867c 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_custom_logo.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_custom_logo.ts @@ -5,23 +5,22 @@ */ import { UI_SETTINGS_CUSTOM_PDF_LOGO } from '../../../common/constants'; -import { ReportingCore } from '../../../server'; -import { ConditionalHeaders, ServerFacade } from '../../../types'; +import { ReportingConfig, ReportingCore } from '../../../server/types'; +import { ConditionalHeaders } from '../../../types'; import { JobDocPayloadPDF } from '../../printable_pdf/types'; // Logo is PDF only export const getCustomLogo = async ({ reporting, - server, + config, job, conditionalHeaders, }: { reporting: ReportingCore; - server: ServerFacade; + config: ReportingConfig; job: JobDocPayloadPDF; conditionalHeaders: ConditionalHeaders; }) => { - const serverBasePath: string = server.config().get('server.basePath'); - + const serverBasePath: string = config.kbnConfig.get('server', 'basePath'); const fakeRequest: any = { headers: conditionalHeaders.headers, // This is used by the spaces SavedObjectClientWrapper to determine the existing space. diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_full_urls.test.ts b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_full_urls.test.ts index 27e772195f726..5f55617724ff6 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_full_urls.test.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_full_urls.test.ts @@ -4,29 +4,41 @@ * you may not use this file except in compliance with the Elastic License. */ -import { createMockServer } from '../../../test_helpers'; -import { ServerFacade } from '../../../types'; +import { ReportingConfig } from '../../../server'; import { JobDocPayloadPNG } from '../../png/types'; import { JobDocPayloadPDF } from '../../printable_pdf/types'; import { getFullUrls } from './get_full_urls'; interface FullUrlsOpts { job: JobDocPayloadPNG & JobDocPayloadPDF; - server: ServerFacade; - conditionalHeaders: any; + config: ReportingConfig; } -let mockServer: any; +let mockConfig: ReportingConfig; +const getMockConfig = (mockConfigGet: jest.Mock) => { + return { + get: mockConfigGet, + kbnConfig: { get: mockConfigGet }, + }; +}; + beforeEach(() => { - mockServer = createMockServer(''); + const reportingConfig: Record = { + 'kibanaServer.hostname': 'localhost', + 'kibanaServer.port': 5601, + 'kibanaServer.protocol': 'http', + 'server.basePath': '/sbp', + }; + const mockConfigGet = jest.fn().mockImplementation((...keys: string[]) => { + return reportingConfig[keys.join('.') as string]; + }); + mockConfig = getMockConfig(mockConfigGet); }); +const getMockJob = (base: object) => base as JobDocPayloadPNG & JobDocPayloadPDF; + test(`fails if no URL is passed`, async () => { - const fn = () => - getFullUrls({ - job: {}, - server: mockServer, - } as FullUrlsOpts); + const fn = () => getFullUrls({ job: getMockJob({}), config: mockConfig } as FullUrlsOpts); expect(fn).toThrowErrorMatchingInlineSnapshot( `"No valid URL fields found in Job Params! Expected \`job.relativeUrl: string\` or \`job.relativeUrls: string[]\`"` ); @@ -37,8 +49,8 @@ test(`fails if URLs are file-protocols for PNGs`, async () => { const relativeUrl = 'file://etc/passwd/#/something'; const fn = () => getFullUrls({ - job: { relativeUrl, forceNow }, - server: mockServer, + job: getMockJob({ relativeUrl, forceNow }), + config: mockConfig, } as FullUrlsOpts); expect(fn).toThrowErrorMatchingInlineSnapshot( `"Found invalid URL(s), all URLs must be relative: file://etc/passwd/#/something"` @@ -51,8 +63,8 @@ test(`fails if URLs are absolute for PNGs`, async () => { 'http://169.254.169.254/latest/meta-data/iam/security-credentials/profileName/#/something'; const fn = () => getFullUrls({ - job: { relativeUrl, forceNow }, - server: mockServer, + job: getMockJob({ relativeUrl, forceNow }), + config: mockConfig, } as FullUrlsOpts); expect(fn).toThrowErrorMatchingInlineSnapshot( `"Found invalid URL(s), all URLs must be relative: http://169.254.169.254/latest/meta-data/iam/security-credentials/profileName/#/something"` @@ -64,11 +76,11 @@ test(`fails if URLs are file-protocols for PDF`, async () => { const relativeUrl = 'file://etc/passwd/#/something'; const fn = () => getFullUrls({ - job: { + job: getMockJob({ relativeUrls: [relativeUrl], forceNow, - }, - server: mockServer, + }), + config: mockConfig, } as FullUrlsOpts); expect(fn).toThrowErrorMatchingInlineSnapshot( `"Found invalid URL(s), all URLs must be relative: file://etc/passwd/#/something"` @@ -81,11 +93,11 @@ test(`fails if URLs are absolute for PDF`, async () => { 'http://169.254.169.254/latest/meta-data/iam/security-credentials/profileName/#/something'; const fn = () => getFullUrls({ - job: { + job: getMockJob({ relativeUrls: [relativeUrl], forceNow, - }, - server: mockServer, + }), + config: mockConfig, } as FullUrlsOpts); expect(fn).toThrowErrorMatchingInlineSnapshot( `"Found invalid URL(s), all URLs must be relative: http://169.254.169.254/latest/meta-data/iam/security-credentials/profileName/#/something"` @@ -102,8 +114,8 @@ test(`fails if any URLs are absolute or file's for PDF`, async () => { const fn = () => getFullUrls({ - job: { relativeUrls, forceNow }, - server: mockServer, + job: getMockJob({ relativeUrls, forceNow }), + config: mockConfig, } as FullUrlsOpts); expect(fn).toThrowErrorMatchingInlineSnapshot( `"Found invalid URL(s), all URLs must be relative: http://169.254.169.254/latest/meta-data/iam/security-credentials/profileName/#/something file://etc/passwd/#/something"` @@ -113,8 +125,8 @@ test(`fails if any URLs are absolute or file's for PDF`, async () => { test(`fails if URL does not route to a visualization`, async () => { const fn = () => getFullUrls({ - job: { relativeUrl: '/app/phoney' }, - server: mockServer, + job: getMockJob({ relativeUrl: '/app/phoney' }), + config: mockConfig, } as FullUrlsOpts); expect(fn).toThrowErrorMatchingInlineSnapshot( `"No valid hash in the URL! A hash is expected for the application to route to the intended visualization."` @@ -124,8 +136,8 @@ test(`fails if URL does not route to a visualization`, async () => { test(`adds forceNow to hash's query, if it exists`, async () => { const forceNow = '2000-01-01T00:00:00.000Z'; const urls = await getFullUrls({ - job: { relativeUrl: '/app/kibana#/something', forceNow }, - server: mockServer, + job: getMockJob({ relativeUrl: '/app/kibana#/something', forceNow }), + config: mockConfig, } as FullUrlsOpts); expect(urls[0]).toEqual( @@ -137,8 +149,8 @@ test(`appends forceNow to hash's query, if it exists`, async () => { const forceNow = '2000-01-01T00:00:00.000Z'; const urls = await getFullUrls({ - job: { relativeUrl: '/app/kibana#/something?_g=something', forceNow }, - server: mockServer, + job: getMockJob({ relativeUrl: '/app/kibana#/something?_g=something', forceNow }), + config: mockConfig, } as FullUrlsOpts); expect(urls[0]).toEqual( @@ -148,8 +160,8 @@ test(`appends forceNow to hash's query, if it exists`, async () => { test(`doesn't append forceNow query to url, if it doesn't exists`, async () => { const urls = await getFullUrls({ - job: { relativeUrl: '/app/kibana#/something' }, - server: mockServer, + job: getMockJob({ relativeUrl: '/app/kibana#/something' }), + config: mockConfig, } as FullUrlsOpts); expect(urls[0]).toEqual('http://localhost:5601/sbp/app/kibana#/something'); @@ -158,7 +170,7 @@ test(`doesn't append forceNow query to url, if it doesn't exists`, async () => { test(`adds forceNow to each of multiple urls`, async () => { const forceNow = '2000-01-01T00:00:00.000Z'; const urls = await getFullUrls({ - job: { + job: getMockJob({ relativeUrls: [ '/app/kibana#/something_aaa', '/app/kibana#/something_bbb', @@ -166,8 +178,8 @@ test(`adds forceNow to each of multiple urls`, async () => { '/app/kibana#/something_ddd', ], forceNow, - }, - server: mockServer, + }), + config: mockConfig, } as FullUrlsOpts); expect(urls).toEqual([ diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_full_urls.ts b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_full_urls.ts index ca64d8632dbfe..c4b6f31019fdf 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_full_urls.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/get_full_urls.ts @@ -12,7 +12,7 @@ import { } from 'url'; import { getAbsoluteUrlFactory } from '../../../common/get_absolute_url'; import { validateUrls } from '../../../common/validate_urls'; -import { ServerFacade } from '../../../types'; +import { ReportingConfig } from '../../../server/types'; import { JobDocPayloadPNG } from '../../png/types'; import { JobDocPayloadPDF } from '../../printable_pdf/types'; @@ -24,19 +24,23 @@ function isPdfJob(job: JobDocPayloadPNG | JobDocPayloadPDF): job is JobDocPayloa } export function getFullUrls({ - server, + config, job, }: { - server: ServerFacade; + config: ReportingConfig; job: JobDocPayloadPDF | JobDocPayloadPNG; }) { - const config = server.config(); - + const [basePath, protocol, hostname, port] = [ + config.kbnConfig.get('server', 'basePath'), + config.get('kibanaServer', 'protocol'), + config.get('kibanaServer', 'hostname'), + config.get('kibanaServer', 'port'), + ] as string[]; const getAbsoluteUrl = getAbsoluteUrlFactory({ - defaultBasePath: config.get('server.basePath'), - protocol: config.get('xpack.reporting.kibanaServer.protocol') || server.info.protocol, - hostname: config.get('xpack.reporting.kibanaServer.hostname') || config.get('server.host'), - port: config.get('xpack.reporting.kibanaServer.port') || config.get('server.port'), + defaultBasePath: basePath, + protocol, + hostname, + port, }); // PDF and PNG job params put in the url differently diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/omit_blacklisted_headers.test.ts b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/omit_blacklisted_headers.test.ts index f446369fec78c..abf5784dacff9 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/omit_blacklisted_headers.test.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/omit_blacklisted_headers.test.ts @@ -19,6 +19,9 @@ test(`omits blacklisted headers`, async () => { 'content-type': '', host: '', 'transfer-encoding': '', + 'proxy-connection': 'bananas', + 'proxy-authorization': 'some-base64-encoded-thing', + trailer: 's are for trucks', }; const filteredHeaders = await omitBlacklistedHeaders({ diff --git a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/omit_blacklisted_headers.ts b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/omit_blacklisted_headers.ts index cbebd6bc21b0e..2fbfd868674f6 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/execute_job/omit_blacklisted_headers.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/execute_job/omit_blacklisted_headers.ts @@ -4,7 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ import { omit } from 'lodash'; -import { KBN_SCREENSHOT_HEADER_BLACKLIST } from '../../../common/constants'; +import { + KBN_SCREENSHOT_HEADER_BLACKLIST, + KBN_SCREENSHOT_HEADER_BLACKLIST_STARTS_WITH_PATTERN, +} from '../../../common/constants'; export const omitBlacklistedHeaders = ({ job, @@ -15,7 +18,12 @@ export const omitBlacklistedHeaders = ({ }) => { const filteredHeaders: Record = omit( decryptedHeaders, - KBN_SCREENSHOT_HEADER_BLACKLIST + (_value, header: string) => + header && + (KBN_SCREENSHOT_HEADER_BLACKLIST.includes(header) || + KBN_SCREENSHOT_HEADER_BLACKLIST_STARTS_WITH_PATTERN.some(pattern => + header?.startsWith(pattern) + )) ); return filteredHeaders; }; diff --git a/x-pack/legacy/plugins/reporting/export_types/common/layouts/create_layout.ts b/x-pack/legacy/plugins/reporting/export_types/common/layouts/create_layout.ts index 0cb83352d4606..07fceb603e451 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/layouts/create_layout.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/layouts/create_layout.ts @@ -3,17 +3,18 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { ServerFacade } from '../../../types'; + +import { CaptureConfig } from '../../../server/types'; import { LayoutTypes } from '../constants'; import { Layout, LayoutParams } from './layout'; import { PreserveLayout } from './preserve_layout'; import { PrintLayout } from './print_layout'; -export function createLayout(server: ServerFacade, layoutParams?: LayoutParams): Layout { +export function createLayout(captureConfig: CaptureConfig, layoutParams?: LayoutParams): Layout { if (layoutParams && layoutParams.id === LayoutTypes.PRESERVE_LAYOUT) { return new PreserveLayout(layoutParams.dimensions); } // this is the default because some jobs won't have anything specified - return new PrintLayout(server); + return new PrintLayout(captureConfig); } diff --git a/x-pack/legacy/plugins/reporting/export_types/common/layouts/print_layout.ts b/x-pack/legacy/plugins/reporting/export_types/common/layouts/print_layout.ts index 6007c2960057a..f6974379253fb 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/layouts/print_layout.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/layouts/print_layout.ts @@ -3,14 +3,14 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ + import path from 'path'; import { EvaluateFn, SerializableOrJSHandle } from 'puppeteer'; -import { LevelLogger } from '../../../server/lib'; import { HeadlessChromiumDriver } from '../../../server/browsers'; -import { ServerFacade } from '../../../types'; +import { LevelLogger } from '../../../server/lib'; +import { CaptureConfig } from '../../../server/types'; import { LayoutTypes } from '../constants'; import { getDefaultLayoutSelectors, Layout, LayoutSelectorDictionary, Size } from './layout'; -import { CaptureConfig } from './types'; export class PrintLayout extends Layout { public readonly selectors: LayoutSelectorDictionary = { @@ -20,9 +20,9 @@ export class PrintLayout extends Layout { public readonly groupCount = 2; private captureConfig: CaptureConfig; - constructor(server: ServerFacade) { + constructor(captureConfig: CaptureConfig) { super(LayoutTypes.PRINT); - this.captureConfig = server.config().get('xpack.reporting.capture'); + this.captureConfig = captureConfig; } public getCssOverridesPath() { diff --git a/x-pack/legacy/plugins/reporting/export_types/common/layouts/types.d.ts b/x-pack/legacy/plugins/reporting/export_types/common/layouts/types.d.ts deleted file mode 100644 index ccfa82ca0ae53..0000000000000 --- a/x-pack/legacy/plugins/reporting/export_types/common/layouts/types.d.ts +++ /dev/null @@ -1,12 +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 { Size } from './layout'; - -export interface CaptureConfig { - zoom: number; - viewport: Size; -} diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_number_of_items.ts b/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_number_of_items.ts index 16eb433e8a75e..57d025890d3e2 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_number_of_items.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/get_number_of_items.ts @@ -7,17 +7,16 @@ import { i18n } from '@kbn/i18n'; import { HeadlessChromiumDriver as HeadlessBrowser } from '../../../../server/browsers'; import { LevelLogger } from '../../../../server/lib'; -import { ServerFacade } from '../../../../types'; +import { CaptureConfig } from '../../../../server/types'; import { LayoutInstance } from '../../layouts/layout'; import { CONTEXT_GETNUMBEROFITEMS, CONTEXT_READMETADATA } from './constants'; export const getNumberOfItems = async ( - server: ServerFacade, + captureConfig: CaptureConfig, browser: HeadlessBrowser, layout: LayoutInstance, logger: LevelLogger ): Promise => { - const config = server.config(); const { renderComplete: renderCompleteSelector, itemsCountAttribute } = layout.selectors; let itemsCount: number; @@ -33,7 +32,7 @@ export const getNumberOfItems = async ( // we have to use this hint to wait for all of them await browser.waitForSelector( `${renderCompleteSelector},[${itemsCountAttribute}]`, - { timeout: config.get('xpack.reporting.capture.timeouts.waitForElements') }, + { timeout: captureConfig.timeouts.waitForElements }, { context: CONTEXT_READMETADATA }, logger ); diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/observable.test.ts b/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/observable.test.ts index 13d07bcdd6baf..75ac3dca4ffa0 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/observable.test.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/observable.test.ts @@ -19,12 +19,9 @@ import * as Rx from 'rxjs'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { loggingServiceMock } from '../../../../../../../../src/core/server/mocks'; import { LevelLogger } from '../../../../server/lib'; -import { - createMockBrowserDriverFactory, - createMockLayoutInstance, - createMockServer, -} from '../../../../test_helpers'; +import { createMockBrowserDriverFactory, createMockLayoutInstance } from '../../../../test_helpers'; import { ConditionalHeaders, HeadlessChromiumDriver } from '../../../../types'; +import { CaptureConfig } from '../../../../server/types'; import { screenshotsObservableFactory } from './observable'; import { ElementsPositionAndAttribute } from './types'; @@ -34,8 +31,8 @@ import { ElementsPositionAndAttribute } from './types'; const mockLogger = jest.fn(loggingServiceMock.create); const logger = new LevelLogger(mockLogger()); -const __LEGACY = createMockServer({ settings: { 'xpack.reporting.capture': { loadDelay: 13 } } }); -const mockLayout = createMockLayoutInstance(__LEGACY); +const mockConfig = { timeouts: { openUrl: 13 } } as CaptureConfig; +const mockLayout = createMockLayoutInstance(mockConfig); /* * Tests @@ -48,7 +45,7 @@ describe('Screenshot Observable Pipeline', () => { }); it('pipelines a single url into screenshot and timeRange', async () => { - const getScreenshots$ = screenshotsObservableFactory(__LEGACY, mockBrowserDriverFactory); + const getScreenshots$ = screenshotsObservableFactory(mockConfig, mockBrowserDriverFactory); const result = await getScreenshots$({ logger, urls: ['/welcome/home/start/index.htm'], @@ -86,7 +83,7 @@ describe('Screenshot Observable Pipeline', () => { }); // test - const getScreenshots$ = screenshotsObservableFactory(__LEGACY, mockBrowserDriverFactory); + const getScreenshots$ = screenshotsObservableFactory(mockConfig, mockBrowserDriverFactory); const result = await getScreenshots$({ logger, urls: ['/welcome/home/start/index2.htm', '/welcome/home/start/index.php3?page=./home.php'], @@ -136,7 +133,7 @@ describe('Screenshot Observable Pipeline', () => { }); // test - const getScreenshots$ = screenshotsObservableFactory(__LEGACY, mockBrowserDriverFactory); + const getScreenshots$ = screenshotsObservableFactory(mockConfig, mockBrowserDriverFactory); const getScreenshot = async () => { return await getScreenshots$({ logger, @@ -197,7 +194,7 @@ describe('Screenshot Observable Pipeline', () => { }); // test - const getScreenshots$ = screenshotsObservableFactory(__LEGACY, mockBrowserDriverFactory); + const getScreenshots$ = screenshotsObservableFactory(mockConfig, mockBrowserDriverFactory); const getScreenshot = async () => { return await getScreenshots$({ logger, diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/observable.ts b/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/observable.ts index 44c04c763f840..53a11c18abd79 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/observable.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/observable.ts @@ -6,24 +6,22 @@ import * as Rx from 'rxjs'; import { catchError, concatMap, first, mergeMap, take, takeUntil, toArray } from 'rxjs/operators'; -import { CaptureConfig, HeadlessChromiumDriverFactory, ServerFacade } from '../../../../types'; +import { CaptureConfig } from '../../../../server/types'; +import { HeadlessChromiumDriverFactory } from '../../../../types'; import { getElementPositionAndAttributes } from './get_element_position_data'; import { getNumberOfItems } from './get_number_of_items'; import { getScreenshots } from './get_screenshots'; import { getTimeRange } from './get_time_range'; +import { injectCustomCss } from './inject_css'; import { openUrl } from './open_url'; import { ScreenSetupData, ScreenshotObservableOpts, ScreenshotResults } from './types'; import { waitForRenderComplete } from './wait_for_render'; import { waitForVisualizations } from './wait_for_visualizations'; -import { injectCustomCss } from './inject_css'; export function screenshotsObservableFactory( - server: ServerFacade, + captureConfig: CaptureConfig, browserDriverFactory: HeadlessChromiumDriverFactory ) { - const config = server.config(); - const captureConfig: CaptureConfig = config.get('xpack.reporting.capture'); - return function screenshotsObservable({ logger, urls, @@ -41,13 +39,13 @@ export function screenshotsObservableFactory( mergeMap(({ driver, exit$ }) => { const setup$: Rx.Observable = Rx.of(1).pipe( takeUntil(exit$), - mergeMap(() => openUrl(server, driver, url, conditionalHeaders, logger)), - mergeMap(() => getNumberOfItems(server, driver, layout, logger)), + mergeMap(() => openUrl(captureConfig, driver, url, conditionalHeaders, logger)), + mergeMap(() => getNumberOfItems(captureConfig, driver, layout, logger)), mergeMap(async itemsCount => { const viewport = layout.getViewport(itemsCount); await Promise.all([ driver.setViewport(viewport, logger), - waitForVisualizations(server, driver, itemsCount, layout, logger), + waitForVisualizations(captureConfig, driver, itemsCount, layout, logger), ]); }), mergeMap(async () => { @@ -60,7 +58,7 @@ export function screenshotsObservableFactory( await layout.positionElements(driver, logger); } - await waitForRenderComplete(driver, layout, captureConfig, logger); + await waitForRenderComplete(captureConfig, driver, layout, logger); }), mergeMap(async () => { return await Promise.all([ diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/open_url.ts b/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/open_url.ts index fbae1f91a7a6a..a484dfb243563 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/open_url.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/open_url.ts @@ -5,27 +5,26 @@ */ import { i18n } from '@kbn/i18n'; -import { ConditionalHeaders, ServerFacade } from '../../../../types'; -import { LevelLogger } from '../../../../server/lib'; import { HeadlessChromiumDriver as HeadlessBrowser } from '../../../../server/browsers'; +import { LevelLogger } from '../../../../server/lib'; +import { CaptureConfig } from '../../../../server/types'; +import { ConditionalHeaders } from '../../../../types'; import { PAGELOAD_SELECTOR } from '../../constants'; export const openUrl = async ( - server: ServerFacade, + captureConfig: CaptureConfig, browser: HeadlessBrowser, url: string, conditionalHeaders: ConditionalHeaders, logger: LevelLogger ): Promise => { - const config = server.config(); - try { await browser.open( url, { conditionalHeaders, waitForSelector: PAGELOAD_SELECTOR, - timeout: config.get('xpack.reporting.capture.timeouts.openUrl'), + timeout: captureConfig.timeouts.openUrl, }, logger ); diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/types.ts b/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/types.ts index ab81a952f345c..76613c2d631d6 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/types.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/types.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ElementPosition, ConditionalHeaders } from '../../../../types'; import { LevelLogger } from '../../../../server/lib'; +import { ConditionalHeaders, ElementPosition } from '../../../../types'; import { LayoutInstance } from '../../layouts/layout'; export interface ScreenshotObservableOpts { diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/wait_for_render.ts b/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/wait_for_render.ts index 2f6dc2829dfd8..069896c8d9e90 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/wait_for_render.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/wait_for_render.ts @@ -5,16 +5,16 @@ */ import { i18n } from '@kbn/i18n'; -import { CaptureConfig } from '../../../../types'; import { HeadlessChromiumDriver as HeadlessBrowser } from '../../../../server/browsers'; import { LevelLogger } from '../../../../server/lib'; +import { CaptureConfig } from '../../../../server/types'; import { LayoutInstance } from '../../layouts/layout'; import { CONTEXT_WAITFORRENDER } from './constants'; export const waitForRenderComplete = async ( + captureConfig: CaptureConfig, browser: HeadlessBrowser, layout: LayoutInstance, - captureConfig: CaptureConfig, logger: LevelLogger ) => { logger.debug( diff --git a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/wait_for_visualizations.ts b/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/wait_for_visualizations.ts index 93ad40026dff8..7960e1552e559 100644 --- a/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/wait_for_visualizations.ts +++ b/x-pack/legacy/plugins/reporting/export_types/common/lib/screenshots/wait_for_visualizations.ts @@ -5,9 +5,9 @@ */ import { i18n } from '@kbn/i18n'; -import { ServerFacade } from '../../../../types'; import { HeadlessChromiumDriver as HeadlessBrowser } from '../../../../server/browsers'; import { LevelLogger } from '../../../../server/lib'; +import { CaptureConfig } from '../../../../server/types'; import { LayoutInstance } from '../../layouts/layout'; import { CONTEXT_WAITFORELEMENTSTOBEINDOM } from './constants'; @@ -23,13 +23,12 @@ const getCompletedItemsCount = ({ renderCompleteSelector }: SelectorArgs) => { * 3. Wait for the render complete event to be fired once for each item */ export const waitForVisualizations = async ( - server: ServerFacade, + captureConfig: CaptureConfig, browser: HeadlessBrowser, itemsCount: number, layout: LayoutInstance, logger: LevelLogger ): Promise => { - const config = server.config(); const { renderComplete: renderCompleteSelector } = layout.selectors; logger.debug( @@ -45,7 +44,7 @@ export const waitForVisualizations = async ( fn: getCompletedItemsCount, args: [{ renderCompleteSelector }], toEqual: itemsCount, - timeout: config.get('xpack.reporting.capture.timeouts.renderComplete'), + timeout: captureConfig.timeouts.renderComplete, }, { context: CONTEXT_WAITFORELEMENTSTOBEINDOM }, logger diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/create_job.ts b/x-pack/legacy/plugins/reporting/export_types/csv/server/create_job.ts index 7ea67277015ab..0e704a041452a 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv/server/create_job.ts +++ b/x-pack/legacy/plugins/reporting/export_types/csv/server/create_job.ts @@ -11,14 +11,14 @@ import { CreateJobFactory, ESQueueCreateJobFn, RequestFacade, - ServerFacade, } from '../../../types'; import { JobParamsDiscoverCsv } from '../types'; export const createJobFactory: CreateJobFactory> = function createJobFactoryFn(reporting: ReportingCore, server: ServerFacade) { - const crypto = cryptoFactory(server); +>> = function createJobFactoryFn(reporting: ReportingCore) { + const config = reporting.getConfig(); + const crypto = cryptoFactory(config.get('encryptionKey')); return async function createJob( jobParams: JobParamsDiscoverCsv, diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/execute_job.test.js b/x-pack/legacy/plugins/reporting/export_types/csv/server/execute_job.test.js index f12916b734dbf..93dbe598b367c 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv/server/execute_job.test.js +++ b/x-pack/legacy/plugins/reporting/export_types/csv/server/execute_job.test.js @@ -11,8 +11,8 @@ import { CancellationToken } from '../../../common/cancellation_token'; import { fieldFormats } from '../../../../../../../src/plugins/data/server'; import { createMockReportingCore } from '../../../test_helpers'; import { LevelLogger } from '../../../server/lib/level_logger'; -import { executeJobFactory } from './execute_job'; import { setFieldFormats } from '../../../server/services'; +import { executeJobFactory } from './execute_job'; const delay = ms => new Promise(resolve => setTimeout(() => resolve(), ms)); @@ -36,11 +36,12 @@ describe('CSV Execute Job', function() { let defaultElasticsearchResponse; let encryptedHeaders; - let cancellationToken; - let mockReportingPlugin; - let mockServer; let clusterStub; + let configGetStub; + let mockReportingConfig; + let mockReportingPlugin; let callAsCurrentUserStub; + let cancellationToken; const mockElasticsearch = { dataClient: { @@ -57,8 +58,16 @@ describe('CSV Execute Job', function() { }); beforeEach(async function() { - mockReportingPlugin = await createMockReportingCore(); - mockReportingPlugin.getUiSettingsServiceFactory = () => mockUiSettingsClient; + configGetStub = sinon.stub(); + configGetStub.withArgs('encryptionKey').returns(encryptionKey); + configGetStub.withArgs('csv', 'maxSizeBytes').returns(1024 * 1000); // 1mB + configGetStub.withArgs('csv', 'scroll').returns({}); + mockReportingConfig = { get: configGetStub, kbnConfig: { get: configGetStub } }; + + mockReportingPlugin = await createMockReportingCore(mockReportingConfig); + mockReportingPlugin.getUiSettingsServiceFactory = () => Promise.resolve(mockUiSettingsClient); + mockReportingPlugin.getElasticsearchService = () => Promise.resolve(mockElasticsearch); + cancellationToken = new CancellationToken(); defaultElasticsearchResponse = { @@ -75,7 +84,6 @@ describe('CSV Execute Job', function() { .stub(clusterStub, 'callAsCurrentUser') .resolves(defaultElasticsearchResponse); - const configGetStub = sinon.stub(); mockUiSettingsClient.get.withArgs('csv:separator').returns(','); mockUiSettingsClient.get.withArgs('csv:quoteValues').returns(true); @@ -93,36 +101,11 @@ describe('CSV Execute Job', function() { return fieldFormatsRegistry; }, }); - - mockServer = { - config: function() { - return { - get: configGetStub, - }; - }, - }; - mockServer - .config() - .get.withArgs('xpack.reporting.encryptionKey') - .returns(encryptionKey); - mockServer - .config() - .get.withArgs('xpack.reporting.csv.maxSizeBytes') - .returns(1024 * 1000); // 1mB - mockServer - .config() - .get.withArgs('xpack.reporting.csv.scroll') - .returns({}); }); describe('basic Elasticsearch call behavior', function() { it('should decrypt encrypted headers and pass to callAsCurrentUser', async function() { - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); await executeJob( 'job456', { headers: encryptedHeaders, fields: [], searchRequest: { index: null, body: null } }, @@ -138,12 +121,7 @@ describe('CSV Execute Job', function() { testBody: true, }; - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const job = { headers: encryptedHeaders, fields: [], @@ -170,12 +148,7 @@ describe('CSV Execute Job', function() { _scroll_id: scrollId, }); callAsCurrentUserStub.onSecondCall().resolves(defaultElasticsearchResponse); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); await executeJob( 'job456', { headers: encryptedHeaders, fields: [], searchRequest: { index: null, body: null } }, @@ -189,12 +162,7 @@ describe('CSV Execute Job', function() { }); it('should not execute scroll if there are no hits from the search', async function() { - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); await executeJob( 'job456', { headers: encryptedHeaders, fields: [], searchRequest: { index: null, body: null } }, @@ -224,12 +192,7 @@ describe('CSV Execute Job', function() { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); await executeJob( 'job456', { headers: encryptedHeaders, fields: [], searchRequest: { index: null, body: null } }, @@ -264,12 +227,7 @@ describe('CSV Execute Job', function() { _scroll_id: lastScrollId, }); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); await executeJob( 'job456', { headers: encryptedHeaders, fields: [], searchRequest: { index: null, body: null } }, @@ -297,12 +255,7 @@ describe('CSV Execute Job', function() { _scroll_id: lastScrollId, }); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: ['one', 'two'], @@ -321,10 +274,7 @@ describe('CSV Execute Job', function() { describe('Cells with formula values', () => { it('returns `csv_contains_formulas` when cells contain formulas', async function() { - mockServer - .config() - .get.withArgs('xpack.reporting.csv.checkForFormulas') - .returns(true); + configGetStub.withArgs('csv', 'checkForFormulas').returns(true); callAsCurrentUserStub.onFirstCall().returns({ hits: { hits: [{ _source: { one: '=SUM(A1:A2)', two: 'bar' } }], @@ -332,12 +282,7 @@ describe('CSV Execute Job', function() { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: ['one', 'two'], @@ -354,10 +299,7 @@ describe('CSV Execute Job', function() { }); it('returns warnings when headings contain formulas', async function() { - mockServer - .config() - .get.withArgs('xpack.reporting.csv.checkForFormulas') - .returns(true); + configGetStub.withArgs('csv', 'checkForFormulas').returns(true); callAsCurrentUserStub.onFirstCall().returns({ hits: { hits: [{ _source: { '=SUM(A1:A2)': 'foo', two: 'bar' } }], @@ -365,12 +307,7 @@ describe('CSV Execute Job', function() { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: ['=SUM(A1:A2)', 'two'], @@ -387,10 +324,7 @@ describe('CSV Execute Job', function() { }); it('returns no warnings when cells have no formulas', async function() { - mockServer - .config() - .get.withArgs('xpack.reporting.csv.checkForFormulas') - .returns(true); + configGetStub.withArgs('csv', 'checkForFormulas').returns(true); callAsCurrentUserStub.onFirstCall().returns({ hits: { hits: [{ _source: { one: 'foo', two: 'bar' } }], @@ -398,12 +332,7 @@ describe('CSV Execute Job', function() { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: ['one', 'two'], @@ -420,10 +349,7 @@ describe('CSV Execute Job', function() { }); it('returns no warnings when configured not to', async () => { - mockServer - .config() - .get.withArgs('xpack.reporting.csv.checkForFormulas') - .returns(false); + configGetStub.withArgs('csv', 'checkForFormulas').returns(false); callAsCurrentUserStub.onFirstCall().returns({ hits: { hits: [{ _source: { one: '=SUM(A1:A2)', two: 'bar' } }], @@ -431,12 +357,7 @@ describe('CSV Execute Job', function() { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: ['one', 'two'], @@ -456,12 +377,7 @@ describe('CSV Execute Job', function() { describe('Elasticsearch call errors', function() { it('should reject Promise if search call errors out', async function() { callAsCurrentUserStub.rejects(new Error()); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: [], @@ -480,12 +396,7 @@ describe('CSV Execute Job', function() { _scroll_id: 'scrollId', }); callAsCurrentUserStub.onSecondCall().rejects(new Error()); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: [], @@ -506,12 +417,7 @@ describe('CSV Execute Job', function() { _scroll_id: undefined, }); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: [], @@ -532,12 +438,7 @@ describe('CSV Execute Job', function() { _scroll_id: undefined, }); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: [], @@ -565,12 +466,7 @@ describe('CSV Execute Job', function() { _scroll_id: undefined, }); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: [], @@ -598,12 +494,7 @@ describe('CSV Execute Job', function() { _scroll_id: undefined, }); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: [], @@ -639,12 +530,7 @@ describe('CSV Execute Job', function() { }); it('should stop calling Elasticsearch when cancellationToken.cancel is called', async function() { - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); executeJob( 'job345', { headers: encryptedHeaders, fields: [], searchRequest: { index: null, body: null } }, @@ -659,12 +545,7 @@ describe('CSV Execute Job', function() { }); it(`shouldn't call clearScroll if it never got a scrollId`, async function() { - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); executeJob( 'job345', { headers: encryptedHeaders, fields: [], searchRequest: { index: null, body: null } }, @@ -678,12 +559,7 @@ describe('CSV Execute Job', function() { }); it('should call clearScroll if it got a scrollId', async function() { - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); executeJob( 'job345', { headers: encryptedHeaders, fields: [], searchRequest: { index: null, body: null } }, @@ -701,12 +577,7 @@ describe('CSV Execute Job', function() { describe('csv content', function() { it('should write column headers to output, even if there are no results', async function() { - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: ['one', 'two'], @@ -718,12 +589,7 @@ describe('CSV Execute Job', function() { it('should use custom uiSettings csv:separator for header', async function() { mockUiSettingsClient.get.withArgs('csv:separator').returns(';'); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: ['one', 'two'], @@ -735,12 +601,7 @@ describe('CSV Execute Job', function() { it('should escape column headers if uiSettings csv:quoteValues is true', async function() { mockUiSettingsClient.get.withArgs('csv:quoteValues').returns(true); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: ['one and a half', 'two', 'three-and-four', 'five & six'], @@ -752,12 +613,7 @@ describe('CSV Execute Job', function() { it(`shouldn't escape column headers if uiSettings csv:quoteValues is false`, async function() { mockUiSettingsClient.get.withArgs('csv:quoteValues').returns(false); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: ['one and a half', 'two', 'three-and-four', 'five & six'], @@ -768,12 +624,7 @@ describe('CSV Execute Job', function() { }); it('should write column headers to output, when there are results', async function() { - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); callAsCurrentUserStub.onFirstCall().resolves({ hits: { hits: [{ one: '1', two: '2' }], @@ -793,12 +644,7 @@ describe('CSV Execute Job', function() { }); it('should use comma separated values of non-nested fields from _source', async function() { - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); callAsCurrentUserStub.onFirstCall().resolves({ hits: { hits: [{ _source: { one: 'foo', two: 'bar' } }], @@ -819,12 +665,7 @@ describe('CSV Execute Job', function() { }); it('should concatenate the hits from multiple responses', async function() { - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); callAsCurrentUserStub.onFirstCall().resolves({ hits: { hits: [{ _source: { one: 'foo', two: 'bar' } }], @@ -852,12 +693,7 @@ describe('CSV Execute Job', function() { }); it('should use field formatters to format fields', async function() { - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); callAsCurrentUserStub.onFirstCall().resolves({ hits: { hits: [{ _source: { one: 'foo', two: 'bar' } }], @@ -897,17 +733,9 @@ describe('CSV Execute Job', function() { let maxSizeReached; beforeEach(async function() { - mockServer - .config() - .get.withArgs('xpack.reporting.csv.maxSizeBytes') - .returns(1); - - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + configGetStub.withArgs('csv', 'maxSizeBytes').returns(1); + + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: ['one', 'two'], @@ -935,17 +763,9 @@ describe('CSV Execute Job', function() { let maxSizeReached; beforeEach(async function() { - mockServer - .config() - .get.withArgs('xpack.reporting.csv.maxSizeBytes') - .returns(9); - - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + configGetStub.withArgs('csv', 'maxSizeBytes').returns(9); + + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: ['one', 'two'], @@ -973,10 +793,7 @@ describe('CSV Execute Job', function() { let maxSizeReached; beforeEach(async function() { - mockServer - .config() - .get.withArgs('xpack.reporting.csv.maxSizeBytes') - .returns(9); + configGetStub.withArgs('csv', 'maxSizeBytes').returns(9); callAsCurrentUserStub.onFirstCall().returns({ hits: { @@ -985,12 +802,7 @@ describe('CSV Execute Job', function() { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: ['one', 'two'], @@ -1020,10 +832,7 @@ describe('CSV Execute Job', function() { beforeEach(async function() { mockReportingPlugin.getUiSettingsServiceFactory = () => mockUiSettingsClient; - mockServer - .config() - .get.withArgs('xpack.reporting.csv.maxSizeBytes') - .returns(18); + configGetStub.withArgs('csv', 'maxSizeBytes').returns(18); callAsCurrentUserStub.onFirstCall().returns({ hits: { @@ -1032,12 +841,7 @@ describe('CSV Execute Job', function() { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: ['one', 'two'], @@ -1065,10 +869,7 @@ describe('CSV Execute Job', function() { describe('scroll settings', function() { it('passes scroll duration to initial search call', async function() { const scrollDuration = 'test'; - mockServer - .config() - .get.withArgs('xpack.reporting.csv.scroll') - .returns({ duration: scrollDuration }); + configGetStub.withArgs('csv', 'scroll').returns({ duration: scrollDuration }); callAsCurrentUserStub.onFirstCall().returns({ hits: { @@ -1077,12 +878,7 @@ describe('CSV Execute Job', function() { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: ['one', 'two'], @@ -1099,10 +895,7 @@ describe('CSV Execute Job', function() { it('passes scroll size to initial search call', async function() { const scrollSize = 100; - mockServer - .config() - .get.withArgs('xpack.reporting.csv.scroll') - .returns({ size: scrollSize }); + configGetStub.withArgs('csv', 'scroll').returns({ size: scrollSize }); callAsCurrentUserStub.onFirstCall().resolves({ hits: { @@ -1111,12 +904,7 @@ describe('CSV Execute Job', function() { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: ['one', 'two'], @@ -1133,10 +921,7 @@ describe('CSV Execute Job', function() { it('passes scroll duration to subsequent scroll call', async function() { const scrollDuration = 'test'; - mockServer - .config() - .get.withArgs('xpack.reporting.csv.scroll') - .returns({ duration: scrollDuration }); + configGetStub.withArgs('csv', 'scroll').returns({ duration: scrollDuration }); callAsCurrentUserStub.onFirstCall().resolves({ hits: { @@ -1145,12 +930,7 @@ describe('CSV Execute Job', function() { _scroll_id: 'scrollId', }); - const executeJob = await executeJobFactory( - mockReportingPlugin, - mockServer, - mockElasticsearch, - mockLogger - ); + const executeJob = await executeJobFactory(mockReportingPlugin, mockLogger); const jobParams = { headers: encryptedHeaders, fields: ['one', 'two'], diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/server/execute_job.ts b/x-pack/legacy/plugins/reporting/export_types/csv/server/execute_job.ts index 1579985891053..d78d8a8a8010d 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv/server/execute_job.ts +++ b/x-pack/legacy/plugins/reporting/export_types/csv/server/execute_job.ts @@ -6,38 +6,30 @@ import { i18n } from '@kbn/i18n'; import Hapi from 'hapi'; -import { - ElasticsearchServiceSetup, - IUiSettingsClient, - KibanaRequest, -} from '../../../../../../../src/core/server'; +import { IUiSettingsClient, KibanaRequest } from '../../../../../../../src/core/server'; import { CSV_JOB_TYPE } from '../../../common/constants'; -import { ReportingCore } from '../../../server'; +import { ReportingCore } from '../../../server/core'; import { cryptoFactory } from '../../../server/lib'; import { getFieldFormats } from '../../../server/services'; -import { ESQueueWorkerExecuteFn, ExecuteJobFactory, Logger, ServerFacade } from '../../../types'; +import { ESQueueWorkerExecuteFn, ExecuteJobFactory, Logger } from '../../../types'; import { JobDocPayloadDiscoverCsv } from '../types'; import { fieldFormatMapFactory } from './lib/field_format_map'; import { createGenerateCsv } from './lib/generate_csv'; export const executeJobFactory: ExecuteJobFactory> = async function executeJobFactoryFn( - reporting: ReportingCore, - server: ServerFacade, - elasticsearch: ElasticsearchServiceSetup, - parentLogger: Logger -) { - const crypto = cryptoFactory(server); - const config = server.config(); +>> = async function executeJobFactoryFn(reporting: ReportingCore, parentLogger: Logger) { + const config = reporting.getConfig(); + const crypto = cryptoFactory(config.get('encryptionKey')); const logger = parentLogger.clone([CSV_JOB_TYPE, 'execute-job']); - const serverBasePath = config.get('server.basePath'); + const serverBasePath = config.kbnConfig.get('server', 'basePath'); return async function executeJob( jobId: string, job: JobDocPayloadDiscoverCsv, cancellationToken: any ) { + const elasticsearch = await reporting.getElasticsearchService(); const jobLogger = logger.clone([jobId]); const { @@ -131,9 +123,9 @@ export const executeJobFactory: ExecuteJobFactory) { const response = await request; diff --git a/x-pack/legacy/plugins/reporting/export_types/csv/types.d.ts b/x-pack/legacy/plugins/reporting/export_types/csv/types.d.ts index 842330fa7c93f..529c195486bc6 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv/types.d.ts +++ b/x-pack/legacy/plugins/reporting/export_types/csv/types.d.ts @@ -5,7 +5,8 @@ */ import { CancellationToken } from '../../common/cancellation_token'; -import { JobDocPayload, JobParamPostPayload, ConditionalHeaders, RequestFacade } from '../../types'; +import { ScrollConfig } from '../../server/types'; +import { JobDocPayload, JobParamPostPayload } from '../../types'; interface DocValueField { field: string; @@ -106,7 +107,7 @@ export interface GenerateCsvParams { quoteValues: boolean; timezone: string | null; maxSizeBytes: number; - scroll: { duration: string; size: number }; + scroll: ScrollConfig; checkForFormulas?: boolean; }; } diff --git a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/create_job/create_job.ts b/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/create_job/create_job.ts index 17072d311b35f..8e0376a190267 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/create_job/create_job.ts +++ b/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/create_job/create_job.ts @@ -5,18 +5,11 @@ */ import { notFound, notImplemented } from 'boom'; -import { ElasticsearchServiceSetup } from 'kibana/server'; import { get } from 'lodash'; import { CSV_FROM_SAVEDOBJECT_JOB_TYPE } from '../../../../common/constants'; import { ReportingCore } from '../../../../server'; import { cryptoFactory } from '../../../../server/lib'; -import { - CreateJobFactory, - ImmediateCreateJobFn, - Logger, - RequestFacade, - ServerFacade, -} from '../../../../types'; +import { CreateJobFactory, ImmediateCreateJobFn, Logger, RequestFacade } from '../../../../types'; import { JobDocPayloadPanelCsv, JobParamsPanelCsv, @@ -37,13 +30,9 @@ interface VisData { export const createJobFactory: CreateJobFactory> = function createJobFactoryFn( - reporting: ReportingCore, - server: ServerFacade, - elasticsearch: ElasticsearchServiceSetup, - parentLogger: Logger -) { - const crypto = cryptoFactory(server); +>> = function createJobFactoryFn(reporting: ReportingCore, parentLogger: Logger) { + const config = reporting.getConfig(); + const crypto = cryptoFactory(config.get('encryptionKey')); const logger = parentLogger.clone([CSV_FROM_SAVEDOBJECT_JOB_TYPE, 'create-job']); return async function createJob( diff --git a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/execute_job.ts b/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/execute_job.ts index 6bb3e73fcfe84..afa917f17651c 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/execute_job.ts +++ b/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/execute_job.ts @@ -5,7 +5,6 @@ */ import { i18n } from '@kbn/i18n'; -import { ElasticsearchServiceSetup } from 'kibana/server'; import { CONTENT_TYPE_CSV, CSV_FROM_SAVEDOBJECT_JOB_TYPE } from '../../../common/constants'; import { ReportingCore } from '../../../server'; import { cryptoFactory } from '../../../server/lib'; @@ -15,7 +14,6 @@ import { JobDocOutput, Logger, RequestFacade, - ServerFacade, } from '../../../types'; import { CsvResultFromSearch } from '../../csv/types'; import { FakeRequest, JobDocPayloadPanelCsv, JobParamsPanelCsv, SearchPanel } from '../types'; @@ -23,15 +21,11 @@ import { createGenerateCsv } from './lib'; export const executeJobFactory: ExecuteJobFactory> = async function executeJobFactoryFn( - reporting: ReportingCore, - server: ServerFacade, - elasticsearch: ElasticsearchServiceSetup, - parentLogger: Logger -) { - const crypto = cryptoFactory(server); +>> = async function executeJobFactoryFn(reporting: ReportingCore, parentLogger: Logger) { + const config = reporting.getConfig(); + const crypto = cryptoFactory(config.get('encryptionKey')); const logger = parentLogger.clone([CSV_FROM_SAVEDOBJECT_JOB_TYPE, 'execute-job']); - const generateCsv = createGenerateCsv(reporting, server, elasticsearch, parentLogger); + const generateCsv = createGenerateCsv(reporting, parentLogger); return async function executeJob( jobId: string | null, @@ -57,11 +51,11 @@ export const executeJobFactory: ExecuteJobFactory; const serializedEncryptedHeaders = job.headers; try { decryptedHeaders = await crypto.decrypt(serializedEncryptedHeaders); @@ -79,10 +73,7 @@ export const executeJobFactory: ExecuteJobFactory { export async function generateCsvSearch( req: RequestFacade, reporting: ReportingCore, - server: ServerFacade, - elasticsearch: ElasticsearchServiceSetup, logger: Logger, searchPanel: SearchPanel, jobParams: JobParamsDiscoverCsv @@ -159,11 +153,12 @@ export async function generateCsvSearch( }, }; + const config = reporting.getConfig(); + const elasticsearch = await reporting.getElasticsearchService(); const { callAsCurrentUser } = elasticsearch.dataClient.asScoped( KibanaRequest.from(req.getRawRequest()) ); const callCluster = (...params: [string, object]) => callAsCurrentUser(...params); - const config = server.config(); const uiSettings = await getUiSettings(uiConfig); const generateCsvParams: GenerateCsvParams = { @@ -176,8 +171,8 @@ export async function generateCsvSearch( cancellationToken: new CancellationToken(), settings: { ...uiSettings, - maxSizeBytes: config.get('xpack.reporting.csv.maxSizeBytes'), - scroll: config.get('xpack.reporting.csv.scroll'), + maxSizeBytes: config.get('csv', 'maxSizeBytes'), + scroll: config.get('csv', 'scroll'), timezone, }, }; diff --git a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/types.d.ts b/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/types.d.ts index 6a7d5f336e238..ab14d2dd8a660 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/types.d.ts +++ b/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/types.d.ts @@ -4,11 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { JobParamPostPayload, JobDocPayload, ServerFacade } from '../../types'; +import { JobDocPayload, JobParamPostPayload } from '../../types'; export interface FakeRequest { - headers: any; - server: ServerFacade; + headers: Record; } export interface JobParamsPostPayloadPanelCsv extends JobParamPostPayload { diff --git a/x-pack/legacy/plugins/reporting/export_types/png/server/create_job/index.ts b/x-pack/legacy/plugins/reporting/export_types/png/server/create_job/index.ts index a6911e1f14704..1f834bde88a2d 100644 --- a/x-pack/legacy/plugins/reporting/export_types/png/server/create_job/index.ts +++ b/x-pack/legacy/plugins/reporting/export_types/png/server/create_job/index.ts @@ -12,14 +12,14 @@ import { CreateJobFactory, ESQueueCreateJobFn, RequestFacade, - ServerFacade, } from '../../../../types'; import { JobParamsPNG } from '../../types'; export const createJobFactory: CreateJobFactory> = function createJobFactoryFn(reporting: ReportingCore, server: ServerFacade) { - const crypto = cryptoFactory(server); +>> = function createJobFactoryFn(reporting: ReportingCore) { + const config = reporting.getConfig(); + const crypto = cryptoFactory(config.get('encryptionKey')); return async function createJob( { objectType, title, relativeUrl, browserTimezone, layout }: JobParamsPNG, diff --git a/x-pack/legacy/plugins/reporting/export_types/png/server/execute_job/index.test.js b/x-pack/legacy/plugins/reporting/export_types/png/server/execute_job/index.test.js index e2e6ba1b89096..cb63e7dad2fdf 100644 --- a/x-pack/legacy/plugins/reporting/export_types/png/server/execute_job/index.test.js +++ b/x-pack/legacy/plugins/reporting/export_types/png/server/execute_job/index.test.js @@ -5,7 +5,6 @@ */ import * as Rx from 'rxjs'; -import { memoize } from 'lodash'; import { createMockReportingCore } from '../../../../test_helpers'; import { cryptoFactory } from '../../../../server/lib/crypto'; import { executeJobFactory } from './index'; @@ -14,63 +13,65 @@ import { LevelLogger } from '../../../../server/lib'; jest.mock('../lib/generate_png', () => ({ generatePngObservableFactory: jest.fn() })); +let mockReporting; + const cancellationToken = { on: jest.fn(), }; -let config; -let mockServer; -let mockReporting; +const mockLoggerFactory = { + get: jest.fn().mockImplementation(() => ({ + error: jest.fn(), + debug: jest.fn(), + warn: jest.fn(), + })), +}; +const getMockLogger = () => new LevelLogger(mockLoggerFactory); -beforeEach(async () => { - mockReporting = await createMockReportingCore(); +const mockEncryptionKey = 'abcabcsecuresecret'; +const encryptHeaders = async headers => { + const crypto = cryptoFactory(mockEncryptionKey); + return await crypto.encrypt(headers); +}; - config = { - 'xpack.reporting.encryptionKey': 'testencryptionkey', +beforeEach(async () => { + const kbnConfig = { 'server.basePath': '/sbp', - 'server.host': 'localhost', - 'server.port': 5601, }; - mockServer = { - config: memoize(() => ({ get: jest.fn() })), - info: { - protocol: 'http', + const reportingConfig = { + encryptionKey: mockEncryptionKey, + 'kibanaServer.hostname': 'localhost', + 'kibanaServer.port': 5601, + 'kibanaServer.protocol': 'http', + }; + const mockReportingConfig = { + get: (...keys) => reportingConfig[keys.join('.')], + kbnConfig: { get: (...keys) => kbnConfig[keys.join('.')] }, + }; + + mockReporting = await createMockReportingCore(mockReportingConfig); + + const mockElasticsearch = { + dataClient: { + asScoped: () => ({ callAsCurrentUser: jest.fn() }), }, }; - mockServer.config().get.mockImplementation(key => { - return config[key]; - }); + const mockGetElasticsearch = jest.fn(); + mockGetElasticsearch.mockImplementation(() => Promise.resolve(mockElasticsearch)); + mockReporting.getElasticsearchService = mockGetElasticsearch; generatePngObservableFactory.mockReturnValue(jest.fn()); }); afterEach(() => generatePngObservableFactory.mockReset()); -const mockElasticsearch = { - dataClient: { - asScoped: () => ({ callAsCurrentUser: jest.fn() }), - }, -}; - -const getMockLogger = () => new LevelLogger(); - -const encryptHeaders = async headers => { - const crypto = cryptoFactory(mockServer); - return await crypto.encrypt(headers); -}; - test(`passes browserTimezone to generatePng`, async () => { const encryptedHeaders = await encryptHeaders({}); const generatePngObservable = generatePngObservableFactory(); generatePngObservable.mockReturnValue(Rx.of(Buffer.from(''))); - const executeJob = await executeJobFactory( - mockReporting, - mockServer, - mockElasticsearch, - getMockLogger() - ); + const executeJob = await executeJobFactory(mockReporting, getMockLogger()); const browserTimezone = 'UTC'; await executeJob( 'pngJobId', @@ -88,15 +89,7 @@ test(`passes browserTimezone to generatePng`, async () => { }); test(`returns content_type of application/png`, async () => { - const executeJob = await executeJobFactory( - mockReporting, - mockServer, - mockElasticsearch, - getMockLogger(), - { - browserDriverFactory: {}, - } - ); + const executeJob = await executeJobFactory(mockReporting, getMockLogger()); const encryptedHeaders = await encryptHeaders({}); const generatePngObservable = generatePngObservableFactory(); @@ -116,15 +109,7 @@ test(`returns content of generatePng getBuffer base64 encoded`, async () => { const generatePngObservable = generatePngObservableFactory(); generatePngObservable.mockReturnValue(Rx.of({ buffer: Buffer.from(testContent) })); - const executeJob = await executeJobFactory( - mockReporting, - mockServer, - mockElasticsearch, - getMockLogger(), - { - browserDriverFactory: {}, - } - ); + const executeJob = await executeJobFactory(mockReporting, getMockLogger()); const encryptedHeaders = await encryptHeaders({}); const { content } = await executeJob( 'pngJobId', diff --git a/x-pack/legacy/plugins/reporting/export_types/png/server/execute_job/index.ts b/x-pack/legacy/plugins/reporting/export_types/png/server/execute_job/index.ts index 8670f0027af89..113da92d1862f 100644 --- a/x-pack/legacy/plugins/reporting/export_types/png/server/execute_job/index.ts +++ b/x-pack/legacy/plugins/reporting/export_types/png/server/execute_job/index.ts @@ -4,18 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ElasticsearchServiceSetup } from 'kibana/server'; import * as Rx from 'rxjs'; import { catchError, map, mergeMap, takeUntil } from 'rxjs/operators'; import { PNG_JOB_TYPE } from '../../../../common/constants'; import { ReportingCore } from '../../../../server'; -import { - ESQueueWorkerExecuteFn, - ExecuteJobFactory, - JobDocOutput, - Logger, - ServerFacade, -} from '../../../../types'; +import { ESQueueWorkerExecuteFn, ExecuteJobFactory, JobDocOutput, Logger } from '../../../../types'; import { decryptJobHeaders, getConditionalHeaders, @@ -29,22 +22,23 @@ type QueuedPngExecutorFactory = ExecuteJobFactory = Rx.of(1).pipe( - mergeMap(() => decryptJobHeaders({ server, job, logger })), + mergeMap(() => decryptJobHeaders({ encryptionKey, job, logger })), map(decryptedHeaders => omitBlacklistedHeaders({ job, decryptedHeaders })), - map(filteredHeaders => getConditionalHeaders({ server, job, filteredHeaders })), + map(filteredHeaders => getConditionalHeaders({ config, job, filteredHeaders })), mergeMap(conditionalHeaders => { - const urls = getFullUrls({ server, job }); + const urls = getFullUrls({ config, job }); const hashUrl = urls[0]; return generatePngObservable( jobLogger, diff --git a/x-pack/legacy/plugins/reporting/export_types/png/server/lib/generate_png.ts b/x-pack/legacy/plugins/reporting/export_types/png/server/lib/generate_png.ts index 88e91982adc63..a15541d99f6fb 100644 --- a/x-pack/legacy/plugins/reporting/export_types/png/server/lib/generate_png.ts +++ b/x-pack/legacy/plugins/reporting/export_types/png/server/lib/generate_png.ts @@ -7,17 +7,18 @@ import * as Rx from 'rxjs'; import { map } from 'rxjs/operators'; import { LevelLogger } from '../../../../server/lib'; -import { ConditionalHeaders, HeadlessChromiumDriverFactory, ServerFacade } from '../../../../types'; +import { CaptureConfig } from '../../../../server/types'; +import { ConditionalHeaders, HeadlessChromiumDriverFactory } from '../../../../types'; import { LayoutParams } from '../../../common/layouts/layout'; import { PreserveLayout } from '../../../common/layouts/preserve_layout'; import { screenshotsObservableFactory } from '../../../common/lib/screenshots'; import { ScreenshotResults } from '../../../common/lib/screenshots/types'; export function generatePngObservableFactory( - server: ServerFacade, + captureConfig: CaptureConfig, browserDriverFactory: HeadlessChromiumDriverFactory ) { - const screenshotsObservable = screenshotsObservableFactory(server, browserDriverFactory); + const screenshotsObservable = screenshotsObservableFactory(captureConfig, browserDriverFactory); return function generatePngObservable( logger: LevelLogger, diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/create_job/index.ts b/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/create_job/index.ts index 656c99991e1f6..25d2d64b1029d 100644 --- a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/create_job/index.ts +++ b/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/create_job/index.ts @@ -12,14 +12,14 @@ import { CreateJobFactory, ESQueueCreateJobFn, RequestFacade, - ServerFacade, } from '../../../../types'; import { JobParamsPDF } from '../../types'; export const createJobFactory: CreateJobFactory> = function createJobFactoryFn(reporting: ReportingCore, server: ServerFacade) { - const crypto = cryptoFactory(server); +>> = function createJobFactoryFn(reporting: ReportingCore) { + const config = reporting.getConfig(); + const crypto = cryptoFactory(config.get('encryptionKey')); return async function createJobFn( { title, relativeUrls, browserTimezone, layout, objectType }: JobParamsPDF, diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/execute_job/index.test.js b/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/execute_job/index.test.js index 484842ba18f2a..c6f07f8ad2d34 100644 --- a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/execute_job/index.test.js +++ b/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/execute_job/index.test.js @@ -5,7 +5,6 @@ */ import * as Rx from 'rxjs'; -import { memoize } from 'lodash'; import { createMockReportingCore } from '../../../../test_helpers'; import { cryptoFactory } from '../../../../server/lib/crypto'; import { executeJobFactory } from './index'; @@ -14,57 +13,60 @@ import { LevelLogger } from '../../../../server/lib'; jest.mock('../lib/generate_pdf', () => ({ generatePdfObservableFactory: jest.fn() })); +let mockReporting; + const cancellationToken = { on: jest.fn(), }; -let config; -let mockServer; -let mockReporting; +const mockLoggerFactory = { + get: jest.fn().mockImplementation(() => ({ + error: jest.fn(), + debug: jest.fn(), + warn: jest.fn(), + })), +}; +const getMockLogger = () => new LevelLogger(mockLoggerFactory); -beforeEach(async () => { - mockReporting = await createMockReportingCore(); +const mockEncryptionKey = 'testencryptionkey'; +const encryptHeaders = async headers => { + const crypto = cryptoFactory(mockEncryptionKey); + return await crypto.encrypt(headers); +}; - config = { - 'xpack.reporting.encryptionKey': 'testencryptionkey', +beforeEach(async () => { + const kbnConfig = { 'server.basePath': '/sbp', - 'server.host': 'localhost', - 'server.port': 5601, }; - mockServer = { - config: memoize(() => ({ get: jest.fn() })), - info: { - protocol: 'http', + const reportingConfig = { + encryptionKey: mockEncryptionKey, + 'kibanaServer.hostname': 'localhost', + 'kibanaServer.port': 5601, + 'kibanaServer.protocol': 'http', + }; + const mockReportingConfig = { + get: (...keys) => reportingConfig[keys.join('.')], + kbnConfig: { get: (...keys) => kbnConfig[keys.join('.')] }, + }; + + mockReporting = await createMockReportingCore(mockReportingConfig); + + const mockElasticsearch = { + dataClient: { + asScoped: () => ({ callAsCurrentUser: jest.fn() }), }, }; - mockServer.config().get.mockImplementation(key => { - return config[key]; - }); + const mockGetElasticsearch = jest.fn(); + mockGetElasticsearch.mockImplementation(() => Promise.resolve(mockElasticsearch)); + mockReporting.getElasticsearchService = mockGetElasticsearch; generatePdfObservableFactory.mockReturnValue(jest.fn()); }); afterEach(() => generatePdfObservableFactory.mockReset()); -const getMockLogger = () => new LevelLogger(); -const mockElasticsearch = { - dataClient: { - asScoped: () => ({ callAsCurrentUser: jest.fn() }), - }, -}; - -const encryptHeaders = async headers => { - const crypto = cryptoFactory(mockServer); - return await crypto.encrypt(headers); -}; - test(`returns content_type of application/pdf`, async () => { - const executeJob = await executeJobFactory( - mockReporting, - mockServer, - mockElasticsearch, - getMockLogger() - ); + const executeJob = await executeJobFactory(mockReporting, getMockLogger()); const encryptedHeaders = await encryptHeaders({}); const generatePdfObservable = generatePdfObservableFactory(); @@ -84,12 +86,7 @@ test(`returns content of generatePdf getBuffer base64 encoded`, async () => { const generatePdfObservable = generatePdfObservableFactory(); generatePdfObservable.mockReturnValue(Rx.of({ buffer: Buffer.from(testContent) })); - const executeJob = await executeJobFactory( - mockReporting, - mockServer, - mockElasticsearch, - getMockLogger() - ); + const executeJob = await executeJobFactory(mockReporting, getMockLogger()); const encryptedHeaders = await encryptHeaders({}); const { content } = await executeJob( 'pdfJobId', diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/execute_job/index.ts b/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/execute_job/index.ts index 535c2dcd439a7..dbdccb6160a6e 100644 --- a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/execute_job/index.ts +++ b/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/execute_job/index.ts @@ -4,18 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ElasticsearchServiceSetup } from 'kibana/server'; import * as Rx from 'rxjs'; import { catchError, map, mergeMap, takeUntil } from 'rxjs/operators'; import { PDF_JOB_TYPE } from '../../../../common/constants'; import { ReportingCore } from '../../../../server'; -import { - ESQueueWorkerExecuteFn, - ExecuteJobFactory, - JobDocOutput, - Logger, - ServerFacade, -} from '../../../../types'; +import { ESQueueWorkerExecuteFn, ExecuteJobFactory, JobDocOutput, Logger } from '../../../../types'; import { decryptJobHeaders, getConditionalHeaders, @@ -30,23 +23,26 @@ type QueuedPdfExecutorFactory = ExecuteJobFactory = Rx.of(1).pipe( - mergeMap(() => decryptJobHeaders({ server, job, logger })), + mergeMap(() => decryptJobHeaders({ encryptionKey, job, logger })), map(decryptedHeaders => omitBlacklistedHeaders({ job, decryptedHeaders })), - map(filteredHeaders => getConditionalHeaders({ server, job, filteredHeaders })), - mergeMap(conditionalHeaders => getCustomLogo({ reporting, server, job, conditionalHeaders })), + map(filteredHeaders => getConditionalHeaders({ config, job, filteredHeaders })), + mergeMap(conditionalHeaders => getCustomLogo({ reporting, config, job, conditionalHeaders })), mergeMap(({ logo, conditionalHeaders }) => { - const urls = getFullUrls({ server, job }); + const urls = getFullUrls({ config, job }); const { browserTimezone, layout, title } = job; return generatePdfObservable( diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/generate_pdf.ts b/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/generate_pdf.ts index d78effaa1fc2f..a62b7ec7013a5 100644 --- a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/generate_pdf.ts +++ b/x-pack/legacy/plugins/reporting/export_types/printable_pdf/server/lib/generate_pdf.ts @@ -8,7 +8,8 @@ import { groupBy } from 'lodash'; import * as Rx from 'rxjs'; import { mergeMap } from 'rxjs/operators'; import { LevelLogger } from '../../../../server/lib'; -import { ConditionalHeaders, HeadlessChromiumDriverFactory, ServerFacade } from '../../../../types'; +import { CaptureConfig } from '../../../../server/types'; +import { ConditionalHeaders, HeadlessChromiumDriverFactory } from '../../../../types'; import { createLayout } from '../../../common/layouts'; import { LayoutInstance, LayoutParams } from '../../../common/layouts/layout'; import { screenshotsObservableFactory } from '../../../common/lib/screenshots'; @@ -27,10 +28,10 @@ const getTimeRange = (urlScreenshots: ScreenshotResults[]) => { }; export function generatePdfObservableFactory( - server: ServerFacade, + captureConfig: CaptureConfig, browserDriverFactory: HeadlessChromiumDriverFactory ) { - const screenshotsObservable = screenshotsObservableFactory(server, browserDriverFactory); + const screenshotsObservable = screenshotsObservableFactory(captureConfig, browserDriverFactory); return function generatePdfObservable( logger: LevelLogger, @@ -41,7 +42,7 @@ export function generatePdfObservableFactory( layoutParams: LayoutParams, logo?: string ): Rx.Observable<{ buffer: Buffer; warnings: string[] }> { - const layout = createLayout(server, layoutParams) as LayoutInstance; + const layout = createLayout(captureConfig, layoutParams) as LayoutInstance; const screenshots$ = screenshotsObservable({ logger, urls, diff --git a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/types.d.ts b/x-pack/legacy/plugins/reporting/export_types/printable_pdf/types.d.ts index 0a9dcfe986ca6..e8dd3c5207d92 100644 --- a/x-pack/legacy/plugins/reporting/export_types/printable_pdf/types.d.ts +++ b/x-pack/legacy/plugins/reporting/export_types/printable_pdf/types.d.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +import { JobDocPayload } from '../../types'; import { LayoutInstance, LayoutParams } from '../common/layouts/layout'; -import { JobDocPayload, ServerFacade, RequestFacade } from '../../types'; // Job params: structure of incoming user request data, after being parsed from RISON export interface JobParamsPDF { diff --git a/x-pack/legacy/plugins/reporting/index.ts b/x-pack/legacy/plugins/reporting/index.ts index 89e98302cddc9..a5d27d0545da1 100644 --- a/x-pack/legacy/plugins/reporting/index.ts +++ b/x-pack/legacy/plugins/reporting/index.ts @@ -12,9 +12,7 @@ import { config as reportingConfig } from './config'; import { legacyInit } from './server/legacy'; import { ReportingPluginSpecOptions } from './types'; -const kbToBase64Length = (kb: number) => { - return Math.floor((kb * 1024 * 8) / 6); -}; +const kbToBase64Length = (kb: number) => Math.floor((kb * 1024 * 8) / 6); export const reporting = (kibana: any) => { return new kibana.Plugin({ diff --git a/x-pack/legacy/plugins/reporting/log_configuration.ts b/x-pack/legacy/plugins/reporting/log_configuration.ts index b07475df6304f..7aaed2038bd52 100644 --- a/x-pack/legacy/plugins/reporting/log_configuration.ts +++ b/x-pack/legacy/plugins/reporting/log_configuration.ts @@ -6,22 +6,23 @@ import getosSync, { LinuxOs } from 'getos'; import { promisify } from 'util'; -import { ServerFacade, Logger } from './types'; +import { BROWSER_TYPE } from './common/constants'; +import { CaptureConfig } from './server/types'; +import { Logger } from './types'; const getos = promisify(getosSync); -export async function logConfiguration(server: ServerFacade, logger: Logger) { - const config = server.config(); +export async function logConfiguration(captureConfig: CaptureConfig, logger: Logger) { + const { + browser: { + type: browserType, + chromium: { disableSandbox }, + }, + } = captureConfig; - const browserType = config.get('xpack.reporting.capture.browser.type'); logger.debug(`Browser type: ${browserType}`); - - if (browserType === 'chromium') { - logger.debug( - `Chromium sandbox disabled: ${config.get( - 'xpack.reporting.capture.browser.chromium.disableSandbox' - )}` - ); + if (browserType === BROWSER_TYPE) { + logger.debug(`Chromium sandbox disabled: ${disableSandbox}`); } const os = await getos(); diff --git a/x-pack/legacy/plugins/reporting/server/browsers/chromium/driver_factory/args.ts b/x-pack/legacy/plugins/reporting/server/browsers/chromium/driver_factory/args.ts index dc79a6b9db2c1..a2f7a1f3ad0da 100644 --- a/x-pack/legacy/plugins/reporting/server/browsers/chromium/driver_factory/args.ts +++ b/x-pack/legacy/plugins/reporting/server/browsers/chromium/driver_factory/args.ts @@ -4,11 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ -import { BrowserConfig } from '../../../../types'; +import { CaptureConfig } from '../../../../server/types'; + +type ViewportConfig = CaptureConfig['viewport']; +type BrowserConfig = CaptureConfig['browser']['chromium']; interface LaunchArgs { userDataDir: BrowserConfig['userDataDir']; - viewport: BrowserConfig['viewport']; + viewport: ViewportConfig; disableSandbox: BrowserConfig['disableSandbox']; proxy: BrowserConfig['proxy']; } diff --git a/x-pack/legacy/plugins/reporting/server/browsers/chromium/driver_factory/index.ts b/x-pack/legacy/plugins/reporting/server/browsers/chromium/driver_factory/index.ts index f90f2c7aee395..cb228150efbcd 100644 --- a/x-pack/legacy/plugins/reporting/server/browsers/chromium/driver_factory/index.ts +++ b/x-pack/legacy/plugins/reporting/server/browsers/chromium/driver_factory/index.ts @@ -19,7 +19,8 @@ import { import * as Rx from 'rxjs'; import { InnerSubscriber } from 'rxjs/internal/InnerSubscriber'; import { ignoreElements, map, mergeMap, tap } from 'rxjs/operators'; -import { BrowserConfig, CaptureConfig } from '../../../../types'; +import { BROWSER_TYPE } from '../../../../common/constants'; +import { CaptureConfig } from '../../../../server/types'; import { LevelLogger as Logger } from '../../../lib/level_logger'; import { safeChildProcess } from '../../safe_child_process'; import { HeadlessChromiumDriver } from '../driver'; @@ -28,7 +29,8 @@ import { puppeteerLaunch } from '../puppeteer'; import { args } from './args'; type binaryPath = string; -type ViewportConfig = BrowserConfig['viewport']; +type BrowserConfig = CaptureConfig['browser']['chromium']; +type ViewportConfig = CaptureConfig['viewport']; export class HeadlessChromiumDriverFactory { private binaryPath: binaryPath; @@ -37,15 +39,10 @@ export class HeadlessChromiumDriverFactory { private userDataDir: string; private getChromiumArgs: (viewport: ViewportConfig) => string[]; - constructor( - binaryPath: binaryPath, - logger: Logger, - browserConfig: BrowserConfig, - captureConfig: CaptureConfig - ) { + constructor(binaryPath: binaryPath, logger: Logger, captureConfig: CaptureConfig) { this.binaryPath = binaryPath; - this.browserConfig = browserConfig; this.captureConfig = captureConfig; + this.browserConfig = captureConfig.browser.chromium; this.userDataDir = fs.mkdtempSync(path.join(os.tmpdir(), 'chromium-')); this.getChromiumArgs = (viewport: ViewportConfig) => @@ -57,7 +54,7 @@ export class HeadlessChromiumDriverFactory { }); } - type = 'chromium'; + type = BROWSER_TYPE; test(logger: Logger) { const chromiumArgs = args({ @@ -153,7 +150,7 @@ export class HeadlessChromiumDriverFactory { // HeadlessChromiumDriver: object to "drive" a browser page const driver = new HeadlessChromiumDriver(page, { - inspect: this.browserConfig.inspect, + inspect: !!this.browserConfig.inspect, networkPolicy: this.captureConfig.networkPolicy, }); diff --git a/x-pack/legacy/plugins/reporting/server/browsers/chromium/index.ts b/x-pack/legacy/plugins/reporting/server/browsers/chromium/index.ts index d32338ae3e311..5f89662c94da2 100644 --- a/x-pack/legacy/plugins/reporting/server/browsers/chromium/index.ts +++ b/x-pack/legacy/plugins/reporting/server/browsers/chromium/index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { BrowserConfig, CaptureConfig } from '../../../types'; +import { CaptureConfig } from '../../../server/types'; import { LevelLogger } from '../../lib'; import { HeadlessChromiumDriverFactory } from './driver_factory'; @@ -13,8 +13,7 @@ export { paths } from './paths'; export async function createDriverFactory( binaryPath: string, logger: LevelLogger, - browserConfig: BrowserConfig, captureConfig: CaptureConfig ): Promise { - return new HeadlessChromiumDriverFactory(binaryPath, logger, browserConfig, captureConfig); + return new HeadlessChromiumDriverFactory(binaryPath, logger, captureConfig); } diff --git a/x-pack/legacy/plugins/reporting/server/browsers/create_browser_driver_factory.ts b/x-pack/legacy/plugins/reporting/server/browsers/create_browser_driver_factory.ts index 49c6222c9f276..af3b86919dc50 100644 --- a/x-pack/legacy/plugins/reporting/server/browsers/create_browser_driver_factory.ts +++ b/x-pack/legacy/plugins/reporting/server/browsers/create_browser_driver_factory.ts @@ -4,24 +4,22 @@ * you may not use this file except in compliance with the Elastic License. */ +import { Logger } from '../../types'; +import { ReportingConfig } from '../types'; +import { HeadlessChromiumDriverFactory } from './chromium/driver_factory'; import { ensureBrowserDownloaded } from './download'; -import { installBrowser } from './install'; -import { ServerFacade, CaptureConfig, Logger } from '../../types'; -import { BROWSER_TYPE } from '../../common/constants'; import { chromium } from './index'; -import { HeadlessChromiumDriverFactory } from './chromium/driver_factory'; +import { installBrowser } from './install'; export async function createBrowserDriverFactory( - server: ServerFacade, + config: ReportingConfig, logger: Logger ): Promise { - const config = server.config(); - - const dataDir: string = config.get('path.data'); - const captureConfig: CaptureConfig = config.get('xpack.reporting.capture'); - const browserType = captureConfig.browser.type; + const captureConfig = config.get('capture'); + const browserConfig = captureConfig.browser.chromium; const browserAutoDownload = captureConfig.browser.autoDownload; - const browserConfig = captureConfig.browser[BROWSER_TYPE]; + const browserType = captureConfig.browser.type; + const dataDir = config.kbnConfig.get('path', 'data'); if (browserConfig.disableSandbox) { logger.warning(`Enabling the Chromium sandbox provides an additional layer of protection.`); @@ -32,7 +30,7 @@ export async function createBrowserDriverFactory( try { const { binaryPath } = await installBrowser(logger, chromium, dataDir); - return chromium.createDriverFactory(binaryPath, logger, browserConfig, captureConfig); + return chromium.createDriverFactory(binaryPath, logger, captureConfig); } catch (error) { if (error.cause && ['EACCES', 'EEXIST'].includes(error.cause.code)) { logger.error( diff --git a/x-pack/legacy/plugins/reporting/server/browsers/download/ensure_downloaded.ts b/x-pack/legacy/plugins/reporting/server/browsers/download/ensure_downloaded.ts index 73186966e3d2f..3697c4b86ce3c 100644 --- a/x-pack/legacy/plugins/reporting/server/browsers/download/ensure_downloaded.ts +++ b/x-pack/legacy/plugins/reporting/server/browsers/download/ensure_downloaded.ts @@ -4,16 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ -import { resolve as resolvePath } from 'path'; import { existsSync } from 'fs'; - +import { resolve as resolvePath } from 'path'; +import { BROWSER_TYPE } from '../../../common/constants'; import { chromium } from '../index'; -import { BrowserDownload, BrowserType } from '../types'; - +import { BrowserDownload } from '../types'; import { md5 } from './checksum'; -import { asyncMap } from './util'; -import { download } from './download'; import { clean } from './clean'; +import { download } from './download'; +import { asyncMap } from './util'; /** * Check for the downloaded archive of each requested browser type and @@ -21,7 +20,7 @@ import { clean } from './clean'; * @param {String} browserType * @return {Promise} */ -export async function ensureBrowserDownloaded(browserType: BrowserType) { +export async function ensureBrowserDownloaded(browserType = BROWSER_TYPE) { await ensureDownloaded([chromium]); } diff --git a/x-pack/legacy/plugins/reporting/server/browsers/network_policy.ts b/x-pack/legacy/plugins/reporting/server/browsers/network_policy.ts index b36345c08bfee..9714c5965a5db 100644 --- a/x-pack/legacy/plugins/reporting/server/browsers/network_policy.ts +++ b/x-pack/legacy/plugins/reporting/server/browsers/network_policy.ts @@ -6,12 +6,7 @@ import * as _ from 'lodash'; import { parse } from 'url'; - -interface FirewallRule { - allow: boolean; - host?: string; - protocol?: string; -} +import { NetworkPolicyRule } from '../../types'; const isHostMatch = (actualHost: string, ruleHost: string) => { const hostParts = actualHost.split('.').reverse(); @@ -20,7 +15,7 @@ const isHostMatch = (actualHost: string, ruleHost: string) => { return _.every(ruleParts, (part, idx) => part === hostParts[idx]); }; -export const allowRequest = (url: string, rules: FirewallRule[]) => { +export const allowRequest = (url: string, rules: NetworkPolicyRule[]) => { const parsed = parse(url); if (!rules.length) { diff --git a/x-pack/legacy/plugins/reporting/server/browsers/types.d.ts b/x-pack/legacy/plugins/reporting/server/browsers/types.d.ts index 0c480fc82752b..f096073ec2f5f 100644 --- a/x-pack/legacy/plugins/reporting/server/browsers/types.d.ts +++ b/x-pack/legacy/plugins/reporting/server/browsers/types.d.ts @@ -4,8 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -export type BrowserType = 'chromium'; - export interface BrowserDownload { paths: { archivesPath: string; diff --git a/x-pack/legacy/plugins/reporting/server/config/index.ts b/x-pack/legacy/plugins/reporting/server/config/index.ts new file mode 100644 index 0000000000000..623d3c2015f3b --- /dev/null +++ b/x-pack/legacy/plugins/reporting/server/config/index.ts @@ -0,0 +1,214 @@ +/* + * 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 { Legacy } from 'kibana'; +import { CoreSetup } from 'src/core/server'; +import { i18n } from '@kbn/i18n'; +import crypto from 'crypto'; +import { get } from 'lodash'; +import { NetworkPolicy } from '../../types'; + +// make config.get() aware of the value type it returns +interface Config { + get(key1: Key1): BaseType[Key1]; + get( + key1: Key1, + key2: Key2 + ): BaseType[Key1][Key2]; + get< + Key1 extends keyof BaseType, + Key2 extends keyof BaseType[Key1], + Key3 extends keyof BaseType[Key1][Key2] + >( + key1: Key1, + key2: Key2, + key3: Key3 + ): BaseType[Key1][Key2][Key3]; + get< + Key1 extends keyof BaseType, + Key2 extends keyof BaseType[Key1], + Key3 extends keyof BaseType[Key1][Key2], + Key4 extends keyof BaseType[Key1][Key2][Key3] + >( + key1: Key1, + key2: Key2, + key3: Key3, + key4: Key4 + ): BaseType[Key1][Key2][Key3][Key4]; +} + +interface KbnServerConfigType { + path: { data: string }; + server: { + basePath: string; + host: string; + name: string; + port: number; + protocol: string; + uuid: string; + }; +} + +export interface ReportingConfig extends Config { + kbnConfig: Config; +} + +type BrowserType = 'chromium'; + +interface BrowserConfig { + inspect: boolean; + userDataDir: string; + viewport: { width: number; height: number }; + disableSandbox: boolean; + proxy: { + enabled: boolean; + server?: string; + bypass?: string[]; + }; +} + +interface CaptureConfig { + browser: { + type: BrowserType; + autoDownload: boolean; + chromium: BrowserConfig; + }; + maxAttempts: number; + networkPolicy: NetworkPolicy; + loadDelay: number; + timeouts: { + openUrl: number; + waitForElements: number; + renderComplete: number; + }; + viewport: any; + zoom: any; +} + +interface QueueConfig { + indexInterval: string; + pollEnabled: boolean; + pollInterval: number; + pollIntervalErrorMultiplier: number; + timeout: number; +} + +interface ScrollConfig { + duration: string; + size: number; +} + +export interface ReportingConfigType { + capture: CaptureConfig; + csv: { + scroll: ScrollConfig; + enablePanelActionDownload: boolean; + checkForFormulas: boolean; + maxSizeBytes: number; + }; + encryptionKey: string; + kibanaServer: any; + index: string; + queue: QueueConfig; + roles: any; +} + +const addConfigDefaults = ( + server: Legacy.Server, + core: CoreSetup, + baseConfig: ReportingConfigType +) => { + // encryption key + let encryptionKey = baseConfig.encryptionKey; + if (encryptionKey === undefined) { + server.log( + ['reporting', 'config', 'warning'], + i18n.translate('xpack.reporting.selfCheckEncryptionKey.warning', { + defaultMessage: + `Generating a random key for {setting}. To prevent pending reports ` + + `from failing on restart, please set {setting} in kibana.yml`, + values: { + setting: 'xpack.reporting.encryptionKey', + }, + }) + ); + encryptionKey = crypto.randomBytes(16).toString('hex'); + } + + const { kibanaServer: reportingServer } = baseConfig; + const serverInfo = core.http.getServerInfo(); + + // kibanaServer.hostname, default to server.host, don't allow "0" + let kibanaServerHostname = reportingServer.hostname ? reportingServer.hostname : serverInfo.host; + if (kibanaServerHostname === '0') { + server.log( + ['reporting', 'config', 'warning'], + i18n.translate('xpack.reporting.selfCheckHostname.warning', { + defaultMessage: + `Found 'server.host: "0"' in settings. This is incompatible with Reporting. ` + + `To enable Reporting to work, '{setting}: 0.0.0.0' is being automatically to the configuration. ` + + `You can change to 'server.host: 0.0.0.0' or add '{setting}: 0.0.0.0' in kibana.yml to prevent this message.`, + values: { + setting: 'xpack.reporting.kibanaServer.hostname', + }, + }) + ); + kibanaServerHostname = '0.0.0.0'; + } + + // kibanaServer.port, default to server.port + const kibanaServerPort = reportingServer.port + ? reportingServer.port + : serverInfo.port; // prettier-ignore + + // kibanaServer.protocol, default to server.protocol + const kibanaServerProtocol = reportingServer.protocol + ? reportingServer.protocol + : serverInfo.protocol; + + return { + ...baseConfig, + encryptionKey, + kibanaServer: { + hostname: kibanaServerHostname, + port: kibanaServerPort, + protocol: kibanaServerProtocol, + }, + }; +}; + +export const buildConfig = ( + core: CoreSetup, + server: Legacy.Server, + reportingConfig: ReportingConfigType +): ReportingConfig => { + const config = server.config(); + const { http } = core; + const serverInfo = http.getServerInfo(); + + const kbnConfig = { + path: { + data: config.get('path.data'), + }, + server: { + basePath: core.http.basePath.serverBasePath, + host: serverInfo.host, + name: serverInfo.name, + port: serverInfo.port, + uuid: core.uuid.getInstanceUuid(), + protocol: serverInfo.protocol, + }, + }; + + // spreading arguments as an array allows the return type to be known by the compiler + reportingConfig = addConfigDefaults(server, core, reportingConfig); + return { + get: (...keys: string[]) => get(reportingConfig, keys.join('.'), null), + kbnConfig: { + get: (...keys: string[]) => get(kbnConfig, keys.join('.'), null), + }, + }; +}; diff --git a/x-pack/legacy/plugins/reporting/server/core.ts b/x-pack/legacy/plugins/reporting/server/core.ts index 4506d41e4f5c3..9be61d091b00e 100644 --- a/x-pack/legacy/plugins/reporting/server/core.ts +++ b/x-pack/legacy/plugins/reporting/server/core.ts @@ -7,6 +7,7 @@ import * as Rx from 'rxjs'; import { first, mapTo } from 'rxjs/operators'; import { + ElasticsearchServiceSetup, IUiSettingsClient, KibanaRequest, SavedObjectsClient, @@ -19,20 +20,24 @@ import { XPackMainPlugin } from '../../xpack_main/server/xpack_main'; import { PLUGIN_ID } from '../common/constants'; import { EnqueueJobFn, ESQueueInstance, ReportingPluginSpecOptions, ServerFacade } from '../types'; import { HeadlessChromiumDriverFactory } from './browsers/chromium/driver_factory'; +import { ReportingConfig, ReportingConfigType } from './config'; import { checkLicenseFactory, getExportTypesRegistry, LevelLogger } from './lib'; import { registerRoutes } from './routes'; import { ReportingSetupDeps } from './types'; interface ReportingInternalSetup { browserDriverFactory: HeadlessChromiumDriverFactory; + elasticsearch: ElasticsearchServiceSetup; } interface ReportingInternalStart { + enqueueJob: EnqueueJobFn; + esqueue: ESQueueInstance; savedObjects: SavedObjectsServiceStart; uiSettings: UiSettingsServiceStart; - esqueue: ESQueueInstance; - enqueueJob: EnqueueJobFn; } +export { ReportingConfig, ReportingConfigType }; + export class ReportingCore { private pluginSetupDeps?: ReportingInternalSetup; private pluginStartDeps?: ReportingInternalStart; @@ -40,7 +45,7 @@ export class ReportingCore { private readonly pluginStart$ = new Rx.ReplaySubject(); private exportTypesRegistry = getExportTypesRegistry(); - constructor(private logger: LevelLogger) {} + constructor(private logger: LevelLogger, private config: ReportingConfig) {} legacySetup( xpackMainPlugin: XPackMainPlugin, @@ -48,14 +53,18 @@ export class ReportingCore { __LEGACY: ServerFacade, plugins: ReportingSetupDeps ) { + // legacy plugin status mirrorPluginStatus(xpackMainPlugin, reporting); + + // legacy license check const checkLicense = checkLicenseFactory(this.exportTypesRegistry); (xpackMainPlugin as any).status.once('green', () => { // Register a function that is called whenever the xpack info changes, // to re-compute the license check results for this plugin xpackMainPlugin.info.feature(PLUGIN_ID).registerLicenseCheckResultsGenerator(checkLicense); }); - // Reporting routes + + // legacy routes registerRoutes(this, __LEGACY, plugins, this.logger); } @@ -90,23 +99,31 @@ export class ReportingCore { return (await this.getPluginSetupDeps()).browserDriverFactory; } + public getConfig(): ReportingConfig { + return this.config; + } + /* - * Kibana core module dependencies + * Outside dependencies */ - private async getPluginSetupDeps() { + private async getPluginSetupDeps(): Promise { if (this.pluginSetupDeps) { return this.pluginSetupDeps; } return await this.pluginSetup$.pipe(first()).toPromise(); } - private async getPluginStartDeps() { + private async getPluginStartDeps(): Promise { if (this.pluginStartDeps) { return this.pluginStartDeps; } return await this.pluginStart$.pipe(first()).toPromise(); } + public async getElasticsearchService(): Promise { + return (await this.getPluginSetupDeps()).elasticsearch; + } + public async getSavedObjectsClient(fakeRequest: KibanaRequest): Promise { const { savedObjects } = await this.getPluginStartDeps(); return savedObjects.getScopedClient(fakeRequest) as SavedObjectsClient; diff --git a/x-pack/legacy/plugins/reporting/server/index.ts b/x-pack/legacy/plugins/reporting/server/index.ts index 24e2a954415d9..c564963e363cc 100644 --- a/x-pack/legacy/plugins/reporting/server/index.ts +++ b/x-pack/legacy/plugins/reporting/server/index.ts @@ -6,10 +6,11 @@ import { PluginInitializerContext } from 'src/core/server'; import { ReportingPlugin as Plugin } from './plugin'; +import { ReportingConfig, ReportingCore } from './core'; -export const plugin = (context: PluginInitializerContext) => { - return new Plugin(context); +export const plugin = (context: PluginInitializerContext, config: ReportingConfig) => { + return new Plugin(context, config); }; -export { ReportingCore } from './core'; export { ReportingPlugin } from './plugin'; +export { ReportingConfig, ReportingCore }; diff --git a/x-pack/legacy/plugins/reporting/server/legacy.ts b/x-pack/legacy/plugins/reporting/server/legacy.ts index 336ff5f4d2ee7..679b42aca6de5 100644 --- a/x-pack/legacy/plugins/reporting/server/legacy.ts +++ b/x-pack/legacy/plugins/reporting/server/legacy.ts @@ -3,10 +3,12 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ + import { Legacy } from 'kibana'; import { PluginInitializerContext } from 'src/core/server'; import { SecurityPluginSetup } from '../../../../plugins/security/server'; import { ReportingPluginSpecOptions } from '../types'; +import { buildConfig } from './config'; import { plugin } from './index'; import { LegacySetup, ReportingStartDeps } from './types'; @@ -14,24 +16,31 @@ const buildLegacyDependencies = ( server: Legacy.Server, reportingPlugin: ReportingPluginSpecOptions ): LegacySetup => ({ - config: server.config, - info: server.info, route: server.route.bind(server), + config: server.config, plugins: { - elasticsearch: server.plugins.elasticsearch, xpack_main: server.plugins.xpack_main, reporting: reportingPlugin, }, }); +/* + * Starts the New Platform instance of Reporting using legacy dependencies + */ export const legacyInit = async ( server: Legacy.Server, - reportingPlugin: ReportingPluginSpecOptions + reportingLegacyPlugin: ReportingPluginSpecOptions ) => { - const coreSetup = server.newPlatform.setup.core; - const pluginInstance = plugin(server.newPlatform.coreContext as PluginInitializerContext); + const { core: coreSetup } = server.newPlatform.setup; + const legacyConfig = server.config(); + const reportingConfig = buildConfig(coreSetup, server, legacyConfig.get('xpack.reporting')); - const __LEGACY = buildLegacyDependencies(server, reportingPlugin); + const __LEGACY = buildLegacyDependencies(server, reportingLegacyPlugin); + + const pluginInstance = plugin( + server.newPlatform.coreContext as PluginInitializerContext, + reportingConfig + ); await pluginInstance.setup(coreSetup, { elasticsearch: coreSetup.elasticsearch, security: server.newPlatform.setup.plugins.security as SecurityPluginSetup, @@ -42,7 +51,6 @@ export const legacyInit = async ( // Schedule to call the "start" hook only after start dependencies are ready coreSetup.getStartServices().then(([core, plugins]) => pluginInstance.start(core, { - elasticsearch: coreSetup.elasticsearch, data: (plugins as ReportingStartDeps).data, __LEGACY, }) diff --git a/x-pack/legacy/plugins/reporting/server/lib/create_queue.ts b/x-pack/legacy/plugins/reporting/server/lib/create_queue.ts index d593e4625cdf4..8230ee889ae05 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/create_queue.ts +++ b/x-pack/legacy/plugins/reporting/server/lib/create_queue.ts @@ -4,22 +4,21 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ElasticsearchServiceSetup } from 'kibana/server'; -import { ESQueueInstance, ServerFacade, QueueConfig, Logger } from '../../types'; +import { ESQueueInstance, Logger } from '../../types'; import { ReportingCore } from '../core'; +import { createTaggedLogger } from './create_tagged_logger'; // TODO remove createTaggedLogger once esqueue is removed +import { createWorkerFactory } from './create_worker'; // @ts-ignore import { Esqueue } from './esqueue'; -import { createWorkerFactory } from './create_worker'; -import { createTaggedLogger } from './create_tagged_logger'; // TODO remove createTaggedLogger once esqueue is removed export async function createQueueFactory( reporting: ReportingCore, - server: ServerFacade, - elasticsearch: ElasticsearchServiceSetup, logger: Logger ): Promise { - const queueConfig: QueueConfig = server.config().get('xpack.reporting.queue'); - const index = server.config().get('xpack.reporting.index'); + const config = reporting.getConfig(); + const queueConfig = config.get('queue'); + const index = config.get('index'); + const elasticsearch = await reporting.getElasticsearchService(); const queueOptions = { interval: queueConfig.indexInterval, @@ -33,7 +32,7 @@ export async function createQueueFactory( if (queueConfig.pollEnabled) { // create workers to poll the index for idle jobs waiting to be claimed and executed - const createWorker = createWorkerFactory(reporting, server, elasticsearch, logger); + const createWorker = createWorkerFactory(reporting, logger); await createWorker(queue); } else { logger.info( diff --git a/x-pack/legacy/plugins/reporting/server/lib/create_worker.test.ts b/x-pack/legacy/plugins/reporting/server/lib/create_worker.test.ts index d4d913243e18d..ad8db3201844e 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/create_worker.test.ts +++ b/x-pack/legacy/plugins/reporting/server/lib/create_worker.test.ts @@ -4,11 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ElasticsearchServiceSetup } from 'kibana/server'; import * as sinon from 'sinon'; -import { ReportingCore } from '../../server'; +import { ReportingConfig, ReportingCore } from '../../server/types'; import { createMockReportingCore } from '../../test_helpers'; -import { ServerFacade } from '../../types'; import { createWorkerFactory } from './create_worker'; // @ts-ignore import { Esqueue } from './esqueue'; @@ -17,21 +15,15 @@ import { ClientMock } from './esqueue/__tests__/fixtures/legacy_elasticsearch'; import { ExportTypesRegistry } from './export_types_registry'; const configGetStub = sinon.stub(); -configGetStub.withArgs('xpack.reporting.queue').returns({ +configGetStub.withArgs('queue').returns({ pollInterval: 3300, pollIntervalErrorMultiplier: 10, }); -configGetStub.withArgs('server.name').returns('test-server-123'); -configGetStub.withArgs('server.uuid').returns('g9ymiujthvy6v8yrh7567g6fwzgzftzfr'); +configGetStub.withArgs('server', 'name').returns('test-server-123'); +configGetStub.withArgs('server', 'uuid').returns('g9ymiujthvy6v8yrh7567g6fwzgzftzfr'); const executeJobFactoryStub = sinon.stub(); - -const getMockServer = (): ServerFacade => { - return ({ - config: () => ({ get: configGetStub }), - } as unknown) as ServerFacade; -}; -const getMockLogger = jest.fn(); +const getMockLogger = sinon.stub(); const getMockExportTypesRegistry = ( exportTypes: any[] = [{ executeJobFactory: executeJobFactoryStub }] @@ -41,25 +33,22 @@ const getMockExportTypesRegistry = ( } as ExportTypesRegistry); describe('Create Worker', () => { + let mockReporting: ReportingCore; + let mockConfig: ReportingConfig; let queue: Esqueue; let client: ClientMock; - let mockReporting: ReportingCore; beforeEach(async () => { - mockReporting = await createMockReportingCore(); + mockConfig = { get: configGetStub, kbnConfig: { get: configGetStub } }; + mockReporting = await createMockReportingCore(mockConfig); + mockReporting.getExportTypesRegistry = () => getMockExportTypesRegistry(); client = new ClientMock(); queue = new Esqueue('reporting-queue', { client }); executeJobFactoryStub.reset(); }); test('Creates a single Esqueue worker for Reporting', async () => { - mockReporting.getExportTypesRegistry = () => getMockExportTypesRegistry(); - const createWorker = createWorkerFactory( - mockReporting, - getMockServer(), - {} as ElasticsearchServiceSetup, - getMockLogger() - ); + const createWorker = createWorkerFactory(mockReporting, getMockLogger()); const registerWorkerSpy = sinon.spy(queue, 'registerWorker'); await createWorker(queue); @@ -91,12 +80,7 @@ Object { { executeJobFactory: executeJobFactoryStub }, ]); mockReporting.getExportTypesRegistry = () => exportTypesRegistry; - const createWorker = createWorkerFactory( - mockReporting, - getMockServer(), - {} as ElasticsearchServiceSetup, - getMockLogger() - ); + const createWorker = createWorkerFactory(mockReporting, getMockLogger()); const registerWorkerSpy = sinon.spy(queue, 'registerWorker'); await createWorker(queue); diff --git a/x-pack/legacy/plugins/reporting/server/lib/create_worker.ts b/x-pack/legacy/plugins/reporting/server/lib/create_worker.ts index 3567712367608..16b8fbdb30fdd 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/create_worker.ts +++ b/x-pack/legacy/plugins/reporting/server/lib/create_worker.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ElasticsearchServiceSetup } from 'kibana/server'; import { CancellationToken } from '../../common/cancellation_token'; import { PLUGIN_ID } from '../../common/constants'; +import { ReportingCore } from '../../server/types'; import { ESQueueInstance, ESQueueWorkerExecuteFn, @@ -15,25 +15,18 @@ import { JobDocPayload, JobSource, Logger, - QueueConfig, RequestFacade, - ServerFacade, } from '../../types'; -import { ReportingCore } from '../core'; // @ts-ignore untyped dependency import { events as esqueueEvents } from './esqueue'; -export function createWorkerFactory( - reporting: ReportingCore, - server: ServerFacade, - elasticsearch: ElasticsearchServiceSetup, - logger: Logger -) { +export function createWorkerFactory(reporting: ReportingCore, logger: Logger) { type JobDocPayloadType = JobDocPayload; - const config = server.config(); - const queueConfig: QueueConfig = config.get('xpack.reporting.queue'); - const kibanaName: string = config.get('server.name'); - const kibanaId: string = config.get('server.uuid'); + + const config = reporting.getConfig(); + const queueConfig = config.get('queue'); + const kibanaName = config.kbnConfig.get('server', 'name'); + const kibanaId = config.kbnConfig.get('server', 'uuid'); // Once more document types are added, this will need to be passed in return async function createWorker(queue: ESQueueInstance) { @@ -44,15 +37,14 @@ export function createWorkerFactory( > = new Map(); for (const exportType of reporting.getExportTypesRegistry().getAll() as Array< - ExportTypeDefinition + ExportTypeDefinition< + JobParamsType, + unknown, + unknown, + ImmediateExecuteFn | ESQueueWorkerExecuteFn + > >) { - // TODO: the executeJobFn should be unwrapped in the register method of the export types registry - const jobExecutor = await exportType.executeJobFactory( - reporting, - server, - elasticsearch, - logger - ); + const jobExecutor = await exportType.executeJobFactory(reporting, logger); // FIXME: does not "need" to be async jobExecutors.set(exportType.jobType, jobExecutor); } diff --git a/x-pack/legacy/plugins/reporting/server/lib/crypto.ts b/x-pack/legacy/plugins/reporting/server/lib/crypto.ts index dbc01fc947f8b..97876529ecfa7 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/crypto.ts +++ b/x-pack/legacy/plugins/reporting/server/lib/crypto.ts @@ -5,12 +5,7 @@ */ import nodeCrypto from '@elastic/node-crypto'; -import { oncePerServer } from './once_per_server'; -import { ServerFacade } from '../../types'; -function cryptoFn(server: ServerFacade) { - const encryptionKey = server.config().get('xpack.reporting.encryptionKey'); +export function cryptoFactory(encryptionKey: string | undefined) { return nodeCrypto({ encryptionKey }); } - -export const cryptoFactory = oncePerServer(cryptoFn); diff --git a/x-pack/legacy/plugins/reporting/server/lib/enqueue_job.ts b/x-pack/legacy/plugins/reporting/server/lib/enqueue_job.ts index c215bdc398904..5a062a693b468 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/enqueue_job.ts +++ b/x-pack/legacy/plugins/reporting/server/lib/enqueue_job.ts @@ -5,22 +5,18 @@ */ import { get } from 'lodash'; -import { ElasticsearchServiceSetup } from 'kibana/server'; -// @ts-ignore -import { events as esqueueEvents } from './esqueue'; import { + ConditionalHeaders, EnqueueJobFn, ESQueueCreateJobFn, ImmediateCreateJobFn, Job, - ServerFacade, - RequestFacade, Logger, - CaptureConfig, - QueueConfig, - ConditionalHeaders, + RequestFacade, } from '../../types'; import { ReportingCore } from '../core'; +// @ts-ignore +import { events as esqueueEvents } from './esqueue'; interface ConfirmedJob { id: string; @@ -29,18 +25,13 @@ interface ConfirmedJob { _primary_term: number; } -export function enqueueJobFactory( - reporting: ReportingCore, - server: ServerFacade, - elasticsearch: ElasticsearchServiceSetup, - parentLogger: Logger -): EnqueueJobFn { +export function enqueueJobFactory(reporting: ReportingCore, parentLogger: Logger): EnqueueJobFn { const logger = parentLogger.clone(['queue-job']); - const config = server.config(); - const captureConfig: CaptureConfig = config.get('xpack.reporting.capture'); + const config = reporting.getConfig(); + const captureConfig = config.get('capture'); + const queueConfig = config.get('queue'); const browserType = captureConfig.browser.type; const maxAttempts = captureConfig.maxAttempts; - const queueConfig: QueueConfig = config.get('xpack.reporting.queue'); return async function enqueueJob( exportTypeId: string, @@ -58,13 +49,7 @@ export function enqueueJobFactory( throw new Error(`Export type ${exportTypeId} does not exist in the registry!`); } - // TODO: the createJobFn should be unwrapped in the register method of the export types registry - const createJob = exportType.createJobFactory( - reporting, - server, - elasticsearch, - logger - ) as CreateJobFn; + const createJob = exportType.createJobFactory(reporting, logger) as CreateJobFn; const payload = await createJob(jobParams, headers, request); const options = { diff --git a/x-pack/legacy/plugins/reporting/server/lib/get_user.ts b/x-pack/legacy/plugins/reporting/server/lib/get_user.ts index 49d5c568c3981..5e73fe77ecb79 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/get_user.ts +++ b/x-pack/legacy/plugins/reporting/server/lib/get_user.ts @@ -6,10 +6,10 @@ import { Legacy } from 'kibana'; import { KibanaRequest } from '../../../../../../src/core/server'; -import { ServerFacade } from '../../types'; +import { Logger } from '../../types'; import { ReportingSetupDeps } from '../types'; -export function getUserFactory(server: ServerFacade, security: ReportingSetupDeps['security']) { +export function getUserFactory(security: ReportingSetupDeps['security'], logger: Logger) { /* * Legacy.Request because this is called from routing middleware */ diff --git a/x-pack/legacy/plugins/reporting/server/lib/index.ts b/x-pack/legacy/plugins/reporting/server/lib/index.ts index 0a2db749cb954..f5ccbe493a91f 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/index.ts +++ b/x-pack/legacy/plugins/reporting/server/lib/index.ts @@ -4,11 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -export { getExportTypesRegistry } from './export_types_registry'; export { checkLicenseFactory } from './check_license'; -export { LevelLogger } from './level_logger'; -export { cryptoFactory } from './crypto'; -export { oncePerServer } from './once_per_server'; -export { runValidations } from './validate'; export { createQueueFactory } from './create_queue'; +export { cryptoFactory } from './crypto'; export { enqueueJobFactory } from './enqueue_job'; +export { getExportTypesRegistry } from './export_types_registry'; +export { LevelLogger } from './level_logger'; +export { runValidations } from './validate'; diff --git a/x-pack/legacy/plugins/reporting/server/lib/jobs_query.ts b/x-pack/legacy/plugins/reporting/server/lib/jobs_query.ts index c01e6377b039e..0affc111c1368 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/jobs_query.ts +++ b/x-pack/legacy/plugins/reporting/server/lib/jobs_query.ts @@ -9,7 +9,8 @@ import Boom from 'boom'; import { errors as elasticsearchErrors } from 'elasticsearch'; import { ElasticsearchServiceSetup } from 'kibana/server'; import { get } from 'lodash'; -import { JobSource, ServerFacade } from '../../types'; +import { JobSource } from '../../types'; +import { ReportingConfig } from '../types'; const esErrors = elasticsearchErrors as Record; const defaultSize = 10; @@ -39,8 +40,11 @@ interface CountAggResult { count: number; } -export function jobsQueryFactory(server: ServerFacade, elasticsearch: ElasticsearchServiceSetup) { - const index = server.config().get('xpack.reporting.index'); +export function jobsQueryFactory( + config: ReportingConfig, + elasticsearch: ElasticsearchServiceSetup +) { + const index = config.get('index'); const { callAsInternalUser } = elasticsearch.adminClient; function getUsername(user: any) { diff --git a/x-pack/legacy/plugins/reporting/server/lib/validate/__tests__/validate_encryption_key.js b/x-pack/legacy/plugins/reporting/server/lib/validate/__tests__/validate_encryption_key.js deleted file mode 100644 index 10980f702d849..0000000000000 --- a/x-pack/legacy/plugins/reporting/server/lib/validate/__tests__/validate_encryption_key.js +++ /dev/null @@ -1,34 +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 expect from '@kbn/expect'; -import sinon from 'sinon'; -import { validateEncryptionKey } from '../validate_encryption_key'; - -describe('Reporting: Validate config', () => { - const logger = { - warning: sinon.spy(), - }; - - beforeEach(() => { - logger.warning.resetHistory(); - }); - - [undefined, null].forEach(value => { - it(`should log a warning and set xpack.reporting.encryptionKey if encryptionKey is ${value}`, () => { - const config = { - get: sinon.stub().returns(value), - set: sinon.stub(), - }; - - expect(() => validateEncryptionKey({ config: () => config }, logger)).not.to.throwError(); - - sinon.assert.calledWith(config.set, 'xpack.reporting.encryptionKey'); - sinon.assert.calledWithMatch(logger.warning, /Generating a random key/); - sinon.assert.calledWithMatch(logger.warning, /please set xpack.reporting.encryptionKey/); - }); - }); -}); diff --git a/x-pack/legacy/plugins/reporting/server/lib/validate/__tests__/validate_server_host.ts b/x-pack/legacy/plugins/reporting/server/lib/validate/__tests__/validate_server_host.ts deleted file mode 100644 index 04f998fd3e5a5..0000000000000 --- a/x-pack/legacy/plugins/reporting/server/lib/validate/__tests__/validate_server_host.ts +++ /dev/null @@ -1,30 +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 expect from '@kbn/expect'; -import sinon from 'sinon'; -import { ServerFacade } from '../../../../types'; -import { validateServerHost } from '../validate_server_host'; - -const configKey = 'xpack.reporting.kibanaServer.hostname'; - -describe('Reporting: Validate server host setting', () => { - it(`should log a warning and set ${configKey} if server.host is "0"`, () => { - const getStub = sinon.stub(); - getStub.withArgs('server.host').returns('0'); - getStub.withArgs(configKey).returns(undefined); - const config = { - get: getStub, - set: sinon.stub(), - }; - - expect(() => - validateServerHost(({ config: () => config } as unknown) as ServerFacade) - ).to.throwError(); - - sinon.assert.calledWith(config.set, configKey); - }); -}); diff --git a/x-pack/legacy/plugins/reporting/server/lib/validate/index.ts b/x-pack/legacy/plugins/reporting/server/lib/validate/index.ts index 0fdbd858b8e3c..85d9f727d7fa7 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/validate/index.ts +++ b/x-pack/legacy/plugins/reporting/server/lib/validate/index.ts @@ -6,25 +6,22 @@ import { i18n } from '@kbn/i18n'; import { ElasticsearchServiceSetup } from 'kibana/server'; -import { Logger, ServerFacade } from '../../../types'; +import { Logger } from '../../../types'; import { HeadlessChromiumDriverFactory } from '../../browsers/chromium/driver_factory'; +import { ReportingConfig } from '../../types'; import { validateBrowser } from './validate_browser'; -import { validateEncryptionKey } from './validate_encryption_key'; import { validateMaxContentLength } from './validate_max_content_length'; -import { validateServerHost } from './validate_server_host'; export async function runValidations( - server: ServerFacade, + config: ReportingConfig, elasticsearch: ElasticsearchServiceSetup, browserFactory: HeadlessChromiumDriverFactory, logger: Logger ) { try { await Promise.all([ - validateBrowser(server, browserFactory, logger), - validateEncryptionKey(server, logger), - validateMaxContentLength(server, elasticsearch, logger), - validateServerHost(server), + validateBrowser(browserFactory, logger), + validateMaxContentLength(config, elasticsearch, logger), ]); logger.debug( i18n.translate('xpack.reporting.selfCheck.ok', { diff --git a/x-pack/legacy/plugins/reporting/server/lib/validate/validate_browser.ts b/x-pack/legacy/plugins/reporting/server/lib/validate/validate_browser.ts index 89c49123e85bf..d6512d5eb718b 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/validate/validate_browser.ts +++ b/x-pack/legacy/plugins/reporting/server/lib/validate/validate_browser.ts @@ -3,9 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ + import { Browser } from 'puppeteer'; import { BROWSER_TYPE } from '../../../common/constants'; -import { ServerFacade, Logger } from '../../../types'; +import { Logger } from '../../../types'; import { HeadlessChromiumDriverFactory } from '../../browsers/chromium/driver_factory'; /* @@ -13,7 +14,6 @@ import { HeadlessChromiumDriverFactory } from '../../browsers/chromium/driver_fa * to the locally running Kibana instance. */ export const validateBrowser = async ( - server: ServerFacade, browserFactory: HeadlessChromiumDriverFactory, logger: Logger ) => { diff --git a/x-pack/legacy/plugins/reporting/server/lib/validate/validate_encryption_key.ts b/x-pack/legacy/plugins/reporting/server/lib/validate/validate_encryption_key.ts deleted file mode 100644 index e0af94cbdc29c..0000000000000 --- a/x-pack/legacy/plugins/reporting/server/lib/validate/validate_encryption_key.ts +++ /dev/null @@ -1,31 +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 { i18n } from '@kbn/i18n'; -import crypto from 'crypto'; -import { ServerFacade, Logger } from '../../../types'; - -export function validateEncryptionKey(serverFacade: ServerFacade, logger: Logger) { - const config = serverFacade.config(); - - const encryptionKey = config.get('xpack.reporting.encryptionKey'); - if (encryptionKey == null) { - // TODO this should simply throw an error and let the handler conver it to a warning mesasge. See validateServerHost. - logger.warning( - i18n.translate('xpack.reporting.selfCheckEncryptionKey.warning', { - defaultMessage: - `Generating a random key for {setting}. To prevent pending reports ` + - `from failing on restart, please set {setting} in kibana.yml`, - values: { - setting: 'xpack.reporting.encryptionKey', - }, - }) - ); - - // @ts-ignore: No set() method on KibanaConfig, just get() and has() - config.set('xpack.reporting.encryptionKey', crypto.randomBytes(16).toString('hex')); // update config in memory to contain a usable encryption key - } -} diff --git a/x-pack/legacy/plugins/reporting/server/lib/validate/validate_max_content_length.test.js b/x-pack/legacy/plugins/reporting/server/lib/validate/validate_max_content_length.test.js index 942dcaf842696..2551fd48b91f3 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/validate/validate_max_content_length.test.js +++ b/x-pack/legacy/plugins/reporting/server/lib/validate/validate_max_content_length.test.js @@ -32,11 +32,7 @@ describe('Reporting: Validate Max Content Length', () => { }); it('should log warning messages when reporting has a higher max-size than elasticsearch', async () => { - const server = { - config: () => ({ - get: sinon.stub().returns(FIVE_HUNDRED_MEGABYTES), - }), - }; + const config = { get: sinon.stub().returns(FIVE_HUNDRED_MEGABYTES) }; const elasticsearch = { dataClient: { callAsInternalUser: () => ({ @@ -49,7 +45,7 @@ describe('Reporting: Validate Max Content Length', () => { }, }; - await validateMaxContentLength(server, elasticsearch, logger); + await validateMaxContentLength(config, elasticsearch, logger); sinon.assert.calledWithMatch( logger.warning, @@ -70,14 +66,10 @@ describe('Reporting: Validate Max Content Length', () => { }); it('should do nothing when reporting has the same max-size as elasticsearch', async () => { - const server = { - config: () => ({ - get: sinon.stub().returns(ONE_HUNDRED_MEGABYTES), - }), - }; + const config = { get: sinon.stub().returns(ONE_HUNDRED_MEGABYTES) }; expect( - async () => await validateMaxContentLength(server, elasticsearch, logger.warning) + async () => await validateMaxContentLength(config, elasticsearch, logger.warning) ).not.toThrow(); sinon.assert.notCalled(logger.warning); }); diff --git a/x-pack/legacy/plugins/reporting/server/lib/validate/validate_max_content_length.ts b/x-pack/legacy/plugins/reporting/server/lib/validate/validate_max_content_length.ts index ce4a5b93e7431..a20905ba093d4 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/validate/validate_max_content_length.ts +++ b/x-pack/legacy/plugins/reporting/server/lib/validate/validate_max_content_length.ts @@ -7,17 +7,17 @@ import numeral from '@elastic/numeral'; import { ElasticsearchServiceSetup } from 'kibana/server'; import { defaults, get } from 'lodash'; -import { Logger, ServerFacade } from '../../../types'; +import { Logger } from '../../../types'; +import { ReportingConfig } from '../../types'; -const KIBANA_MAX_SIZE_BYTES_PATH = 'xpack.reporting.csv.maxSizeBytes'; +const KIBANA_MAX_SIZE_BYTES_PATH = 'csv.maxSizeBytes'; const ES_MAX_SIZE_BYTES_PATH = 'http.max_content_length'; export async function validateMaxContentLength( - server: ServerFacade, + config: ReportingConfig, elasticsearch: ElasticsearchServiceSetup, logger: Logger ) { - const config = server.config(); const { callAsInternalUser } = elasticsearch.dataClient; const elasticClusterSettingsResponse = await callAsInternalUser('cluster.getSettings', { @@ -28,13 +28,13 @@ export async function validateMaxContentLength( const elasticSearchMaxContent = get(elasticClusterSettings, 'http.max_content_length', '100mb'); const elasticSearchMaxContentBytes = numeral().unformat(elasticSearchMaxContent.toUpperCase()); - const kibanaMaxContentBytes: number = config.get(KIBANA_MAX_SIZE_BYTES_PATH); + const kibanaMaxContentBytes = config.get('csv', 'maxSizeBytes'); if (kibanaMaxContentBytes > elasticSearchMaxContentBytes) { // TODO this should simply throw an error and let the handler conver it to a warning mesasge. See validateServerHost. logger.warning( - `${KIBANA_MAX_SIZE_BYTES_PATH} (${kibanaMaxContentBytes}) is higher than ElasticSearch's ${ES_MAX_SIZE_BYTES_PATH} (${elasticSearchMaxContentBytes}). ` + - `Please set ${ES_MAX_SIZE_BYTES_PATH} in ElasticSearch to match, or lower your ${KIBANA_MAX_SIZE_BYTES_PATH} in Kibana to avoid this warning.` + `xpack.reporting.${KIBANA_MAX_SIZE_BYTES_PATH} (${kibanaMaxContentBytes}) is higher than ElasticSearch's ${ES_MAX_SIZE_BYTES_PATH} (${elasticSearchMaxContentBytes}). ` + + `Please set ${ES_MAX_SIZE_BYTES_PATH} in ElasticSearch to match, or lower your xpack.reporting.${KIBANA_MAX_SIZE_BYTES_PATH} in Kibana to avoid this warning.` ); } } diff --git a/x-pack/legacy/plugins/reporting/server/lib/validate/validate_server_host.ts b/x-pack/legacy/plugins/reporting/server/lib/validate/validate_server_host.ts deleted file mode 100644 index f4f4d61246b6a..0000000000000 --- a/x-pack/legacy/plugins/reporting/server/lib/validate/validate_server_host.ts +++ /dev/null @@ -1,27 +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 { ServerFacade } from '../../../types'; - -const configKey = 'xpack.reporting.kibanaServer.hostname'; - -export function validateServerHost(serverFacade: ServerFacade) { - const config = serverFacade.config(); - - const serverHost = config.get('server.host'); - const reportingKibanaHostName = config.get(configKey); - - if (!reportingKibanaHostName && serverHost === '0') { - // @ts-ignore: No set() method on KibanaConfig, just get() and has() - config.set(configKey, '0.0.0.0'); // update config in memory to allow Reporting to work - - throw new Error( - `Found 'server.host: "0"' in settings. This is incompatible with Reporting. ` + - `To enable Reporting to work, '${configKey}: 0.0.0.0' is being automatically to the configuration. ` + - `You can change to 'server.host: 0.0.0.0' or add '${configKey}: 0.0.0.0' in kibana.yml to prevent this message.` - ); - } -} diff --git a/x-pack/legacy/plugins/reporting/server/plugin.ts b/x-pack/legacy/plugins/reporting/server/plugin.ts index 4f24cc16b2277..c9ed2e81c6792 100644 --- a/x-pack/legacy/plugins/reporting/server/plugin.ts +++ b/x-pack/legacy/plugins/reporting/server/plugin.ts @@ -7,7 +7,7 @@ import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from 'src/core/server'; import { logConfiguration } from '../log_configuration'; import { createBrowserDriverFactory } from './browsers'; -import { ReportingCore } from './core'; +import { ReportingCore, ReportingConfig } from './core'; import { createQueueFactory, enqueueJobFactory, LevelLogger, runValidations } from './lib'; import { setFieldFormats } from './services'; import { ReportingSetup, ReportingSetupDeps, ReportingStart, ReportingStartDeps } from './types'; @@ -17,38 +17,40 @@ import { mirrorPluginStatus } from '../../../server/lib/mirror_plugin_status'; export class ReportingPlugin implements Plugin { + private config: ReportingConfig; private logger: LevelLogger; private reportingCore: ReportingCore; - constructor(context: PluginInitializerContext) { + constructor(context: PluginInitializerContext, config: ReportingConfig) { + this.config = config; this.logger = new LevelLogger(context.logger.get('reporting')); - this.reportingCore = new ReportingCore(this.logger); + this.reportingCore = new ReportingCore(this.logger, this.config); } public async setup(core: CoreSetup, plugins: ReportingSetupDeps) { - const { elasticsearch, usageCollection, __LEGACY } = plugins; + const { config } = this; + const { elasticsearch, __LEGACY } = plugins; - const browserDriverFactory = await createBrowserDriverFactory(__LEGACY, this.logger); // required for validations :( - runValidations(__LEGACY, elasticsearch, browserDriverFactory, this.logger); // this must run early, as it sets up config defaults + const browserDriverFactory = await createBrowserDriverFactory(config, this.logger); // required for validations :( + runValidations(config, elasticsearch, browserDriverFactory, this.logger); const { xpack_main: xpackMainLegacy, reporting: reportingLegacy } = __LEGACY.plugins; this.reportingCore.legacySetup(xpackMainLegacy, reportingLegacy, __LEGACY, plugins); // Register a function with server to manage the collection of usage stats - registerReportingUsageCollector(this.reportingCore, __LEGACY, usageCollection); + registerReportingUsageCollector(this.reportingCore, plugins); // regsister setup internals - this.reportingCore.pluginSetup({ browserDriverFactory }); + this.reportingCore.pluginSetup({ browserDriverFactory, elasticsearch }); return {}; } public async start(core: CoreStart, plugins: ReportingStartDeps) { const { reportingCore, logger } = this; - const { elasticsearch, __LEGACY } = plugins; - const esqueue = await createQueueFactory(reportingCore, __LEGACY, elasticsearch, logger); - const enqueueJob = enqueueJobFactory(reportingCore, __LEGACY, elasticsearch, logger); + const esqueue = await createQueueFactory(reportingCore, logger); + const enqueueJob = enqueueJobFactory(reportingCore, logger); this.reportingCore.pluginStart({ savedObjects: core.savedObjects, @@ -58,7 +60,8 @@ export class ReportingPlugin }); setFieldFormats(plugins.data.fieldFormats); - logConfiguration(__LEGACY, this.logger); + + logConfiguration(this.config.get('capture'), this.logger); return {}; } diff --git a/x-pack/legacy/plugins/reporting/server/routes/generate_from_jobparams.ts b/x-pack/legacy/plugins/reporting/server/routes/generate_from_jobparams.ts index 56622617586f7..6b4f5dbd9203a 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/generate_from_jobparams.ts +++ b/x-pack/legacy/plugins/reporting/server/routes/generate_from_jobparams.ts @@ -10,7 +10,7 @@ import { Legacy } from 'kibana'; import rison from 'rison-node'; import { API_BASE_URL } from '../../common/constants'; import { Logger, ReportingResponseToolkit, ServerFacade } from '../../types'; -import { ReportingSetupDeps } from '../types'; +import { ReportingCore, ReportingSetupDeps } from '../types'; import { makeRequestFacade } from './lib/make_request_facade'; import { GetRouteConfigFactoryFn, @@ -22,15 +22,17 @@ import { HandlerErrorFunction, HandlerFunction } from './types'; const BASE_GENERATE = `${API_BASE_URL}/generate`; export function registerGenerateFromJobParams( + reporting: ReportingCore, server: ServerFacade, plugins: ReportingSetupDeps, handler: HandlerFunction, handleError: HandlerErrorFunction, logger: Logger ) { + const config = reporting.getConfig(); const getRouteConfig = () => { const getOriginalRouteConfig: GetRouteConfigFactoryFn = getRouteConfigFactoryReportingPre( - server, + config, plugins, logger ); diff --git a/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject.ts b/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject.ts index 415b6b7d64366..830953d532243 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject.ts +++ b/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject.ts @@ -9,7 +9,7 @@ import { get } from 'lodash'; import { API_BASE_GENERATE_V1, CSV_FROM_SAVEDOBJECT_JOB_TYPE } from '../../common/constants'; import { getJobParamsFromRequest } from '../../export_types/csv_from_savedobject/server/lib/get_job_params_from_request'; import { Logger, ReportingResponseToolkit, ServerFacade } from '../../types'; -import { ReportingSetupDeps } from '../types'; +import { ReportingCore, ReportingSetupDeps } from '../types'; import { makeRequestFacade } from './lib/make_request_facade'; import { getRouteOptionsCsv } from './lib/route_config_factories'; import { HandlerErrorFunction, HandlerFunction, QueuedJobPayload } from './types'; @@ -24,13 +24,15 @@ import { HandlerErrorFunction, HandlerFunction, QueuedJobPayload } from './types * - local (transient) changes the user made to the saved object */ export function registerGenerateCsvFromSavedObject( + reporting: ReportingCore, server: ServerFacade, plugins: ReportingSetupDeps, handleRoute: HandlerFunction, handleRouteError: HandlerErrorFunction, logger: Logger ) { - const routeOptions = getRouteOptionsCsv(server, plugins, logger); + const config = reporting.getConfig(); + const routeOptions = getRouteOptionsCsv(config, plugins, logger); server.route({ path: `${API_BASE_GENERATE_V1}/csv/saved-object/{savedObjectType}:{savedObjectId}`, diff --git a/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject_immediate.ts b/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject_immediate.ts index 5d17fa2e82b8c..519e49f56c377 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject_immediate.ts +++ b/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject_immediate.ts @@ -16,7 +16,7 @@ import { ResponseFacade, ServerFacade, } from '../../types'; -import { ReportingSetupDeps, ReportingCore } from '../types'; +import { ReportingCore, ReportingSetupDeps } from '../types'; import { makeRequestFacade } from './lib/make_request_facade'; import { getRouteOptionsCsv } from './lib/route_config_factories'; @@ -35,8 +35,8 @@ export function registerGenerateCsvFromSavedObjectImmediate( plugins: ReportingSetupDeps, parentLogger: Logger ) { - const routeOptions = getRouteOptionsCsv(server, plugins, parentLogger); - const { elasticsearch } = plugins; + const config = reporting.getConfig(); + const routeOptions = getRouteOptionsCsv(config, plugins, parentLogger); /* * CSV export with the `immediate` option does not queue a job with Reporting's ESQueue to run the job async. Instead, this does: @@ -51,15 +51,8 @@ export function registerGenerateCsvFromSavedObjectImmediate( const request = makeRequestFacade(legacyRequest); const logger = parentLogger.clone(['savedobject-csv']); const jobParams = getJobParamsFromRequest(request, { isImmediate: true }); - - /* TODO these functions should be made available in the export types registry: - * - * const { createJobFn, executeJobFn } = exportTypesRegistry.getById(CSV_FROM_SAVEDOBJECT_JOB_TYPE) - * - * Calling an execute job factory requires passing a browserDriverFactory option, so we should not call the factory from here - */ - const createJobFn = createJobFactory(reporting, server, elasticsearch, logger); - const executeJobFn = await executeJobFactory(reporting, server, elasticsearch, logger); + const createJobFn = createJobFactory(reporting, logger); + const executeJobFn = await executeJobFactory(reporting, logger); // FIXME: does not "need" to be async const jobDocPayload: JobDocPayloadPanelCsv = await createJobFn( jobParams, request.headers, diff --git a/x-pack/legacy/plugins/reporting/server/routes/generation.test.ts b/x-pack/legacy/plugins/reporting/server/routes/generation.test.ts index 54d9671692c5d..8e54feac3c8a6 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/generation.test.ts +++ b/x-pack/legacy/plugins/reporting/server/routes/generation.test.ts @@ -7,7 +7,7 @@ import Hapi from 'hapi'; import { createMockReportingCore } from '../../test_helpers'; import { Logger, ServerFacade } from '../../types'; -import { ReportingCore, ReportingSetupDeps } from '../../server/types'; +import { ReportingConfig, ReportingCore, ReportingSetupDeps } from '../types'; jest.mock('./lib/authorized_user_pre_routing', () => ({ authorizedUserPreRoutingFactory: () => () => ({}), @@ -22,6 +22,8 @@ import { registerJobGenerationRoutes } from './generation'; let mockServer: Hapi.Server; let mockReportingPlugin: ReportingCore; +let mockReportingConfig: ReportingConfig; + const mockLogger = ({ error: jest.fn(), debug: jest.fn(), @@ -33,8 +35,9 @@ beforeEach(async () => { port: 8080, routes: { log: { collect: true } }, }); - mockServer.config = () => ({ get: jest.fn(), has: jest.fn() }); - mockReportingPlugin = await createMockReportingCore(); + + mockReportingConfig = { get: jest.fn(), kbnConfig: { get: jest.fn() } }; + mockReportingPlugin = await createMockReportingCore(mockReportingConfig); mockReportingPlugin.getEnqueueJob = async () => jest.fn().mockImplementation(() => ({ toJSON: () => '{ "job": "data" }' })); }); diff --git a/x-pack/legacy/plugins/reporting/server/routes/generation.ts b/x-pack/legacy/plugins/reporting/server/routes/generation.ts index 096ba84b63d1a..1c6129313db4b 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/generation.ts +++ b/x-pack/legacy/plugins/reporting/server/routes/generation.ts @@ -9,7 +9,7 @@ import { errors as elasticsearchErrors } from 'elasticsearch'; import { Legacy } from 'kibana'; import { API_BASE_URL } from '../../common/constants'; import { Logger, ReportingResponseToolkit, ServerFacade } from '../../types'; -import { ReportingSetupDeps, ReportingCore } from '../types'; +import { ReportingCore, ReportingSetupDeps } from '../types'; import { registerGenerateFromJobParams } from './generate_from_jobparams'; import { registerGenerateCsvFromSavedObject } from './generate_from_savedobject'; import { registerGenerateCsvFromSavedObjectImmediate } from './generate_from_savedobject_immediate'; @@ -23,8 +23,9 @@ export function registerJobGenerationRoutes( plugins: ReportingSetupDeps, logger: Logger ) { - const config = server.config(); - const DOWNLOAD_BASE_URL = config.get('server.basePath') + `${API_BASE_URL}/jobs/download`; + const config = reporting.getConfig(); + const downloadBaseUrl = + config.kbnConfig.get('server', 'basePath') + `${API_BASE_URL}/jobs/download`; /* * Generates enqueued job details to use in responses @@ -47,7 +48,7 @@ export function registerJobGenerationRoutes( return h .response({ - path: `${DOWNLOAD_BASE_URL}/${jobJson.id}`, + path: `${downloadBaseUrl}/${jobJson.id}`, job: jobJson, }) .type('application/json'); @@ -66,11 +67,11 @@ export function registerJobGenerationRoutes( return err; } - registerGenerateFromJobParams(server, plugins, handler, handleError, logger); + registerGenerateFromJobParams(reporting, server, plugins, handler, handleError, logger); // Register beta panel-action download-related API's - if (config.get('xpack.reporting.csv.enablePanelActionDownload')) { - registerGenerateCsvFromSavedObject(server, plugins, handler, handleError, logger); + if (config.get('csv', 'enablePanelActionDownload')) { + registerGenerateCsvFromSavedObject(reporting, server, plugins, handler, handleError, logger); registerGenerateCsvFromSavedObjectImmediate(reporting, server, plugins, logger); } } diff --git a/x-pack/legacy/plugins/reporting/server/routes/jobs.test.js b/x-pack/legacy/plugins/reporting/server/routes/jobs.test.js index 071b401d2321b..9f0de844df369 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/jobs.test.js +++ b/x-pack/legacy/plugins/reporting/server/routes/jobs.test.js @@ -5,7 +5,6 @@ */ import Hapi from 'hapi'; -import { memoize } from 'lodash'; import { createMockReportingCore } from '../../test_helpers'; import { ExportTypesRegistry } from '../lib/export_types_registry'; @@ -23,6 +22,7 @@ import { registerJobInfoRoutes } from './jobs'; let mockServer; let exportTypesRegistry; let mockReportingPlugin; +let mockReportingConfig; const mockLogger = { error: jest.fn(), debug: jest.fn(), @@ -30,7 +30,6 @@ const mockLogger = { beforeEach(async () => { mockServer = new Hapi.Server({ debug: false, port: 8080, routes: { log: { collect: true } } }); - mockServer.config = memoize(() => ({ get: jest.fn() })); exportTypesRegistry = new ExportTypesRegistry(); exportTypesRegistry.register({ id: 'unencoded', @@ -43,7 +42,9 @@ beforeEach(async () => { jobContentEncoding: 'base64', jobContentExtension: 'pdf', }); - mockReportingPlugin = await createMockReportingCore(); + + mockReportingConfig = { get: jest.fn(), kbnConfig: { get: jest.fn() } }; + mockReportingPlugin = await createMockReportingCore(mockReportingConfig); mockReportingPlugin.getExportTypesRegistry = () => exportTypesRegistry; }); diff --git a/x-pack/legacy/plugins/reporting/server/routes/jobs.ts b/x-pack/legacy/plugins/reporting/server/routes/jobs.ts index b9aa75e0ddd00..f6f98b2377db6 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/jobs.ts +++ b/x-pack/legacy/plugins/reporting/server/routes/jobs.ts @@ -17,7 +17,7 @@ import { ServerFacade, } from '../../types'; import { jobsQueryFactory } from '../lib/jobs_query'; -import { ReportingSetupDeps, ReportingCore } from '../types'; +import { ReportingCore, ReportingSetupDeps } from '../types'; import { deleteJobResponseHandlerFactory, downloadJobResponseHandlerFactory, @@ -41,9 +41,10 @@ export function registerJobInfoRoutes( plugins: ReportingSetupDeps, logger: Logger ) { + const config = reporting.getConfig(); const { elasticsearch } = plugins; - const jobsQuery = jobsQueryFactory(server, elasticsearch); - const getRouteConfig = getRouteConfigFactoryManagementPre(server, plugins, logger); + const jobsQuery = jobsQueryFactory(config, elasticsearch); + const getRouteConfig = getRouteConfigFactoryManagementPre(config, plugins, logger); // list jobs in the queue, paginated server.route({ @@ -141,8 +142,8 @@ export function registerJobInfoRoutes( // trigger a download of the output from a job const exportTypesRegistry = reporting.getExportTypesRegistry(); - const getRouteConfigDownload = getRouteConfigFactoryDownloadPre(server, plugins, logger); - const downloadResponseHandler = downloadJobResponseHandlerFactory(server, elasticsearch, exportTypesRegistry); // prettier-ignore + const getRouteConfigDownload = getRouteConfigFactoryDownloadPre(config, plugins, logger); + const downloadResponseHandler = downloadJobResponseHandlerFactory(config, elasticsearch, exportTypesRegistry); // prettier-ignore server.route({ path: `${MAIN_ENTRY}/download/{docId}`, method: 'GET', @@ -181,8 +182,8 @@ export function registerJobInfoRoutes( }); // allow a report to be deleted - const getRouteConfigDelete = getRouteConfigFactoryDeletePre(server, plugins, logger); - const deleteResponseHandler = deleteJobResponseHandlerFactory(server, elasticsearch); + const getRouteConfigDelete = getRouteConfigFactoryDeletePre(config, plugins, logger); + const deleteResponseHandler = deleteJobResponseHandlerFactory(config, elasticsearch); server.route({ path: `${MAIN_ENTRY}/delete/{docId}`, method: 'DELETE', diff --git a/x-pack/legacy/plugins/reporting/server/routes/lib/authorized_user_pre_routing.test.js b/x-pack/legacy/plugins/reporting/server/routes/lib/authorized_user_pre_routing.test.js index 3460d22592e3d..b5d6ae59ce5dd 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/lib/authorized_user_pre_routing.test.js +++ b/x-pack/legacy/plugins/reporting/server/routes/lib/authorized_user_pre_routing.test.js @@ -7,56 +7,48 @@ import { authorizedUserPreRoutingFactory } from './authorized_user_pre_routing'; describe('authorized_user_pre_routing', function() { - // the getClientShield is using `once` which forces us to use a constant mock - // which makes testing anything that is dependent on `oncePerServer` confusing. - // so createMockServer reuses the same 'instance' of the server and overwrites - // the properties to contain different values - const createMockServer = (function() { - const getUserStub = jest.fn(); - let mockConfig; - - const mockServer = { - expose() {}, - config() { - return { - get(key) { - return mockConfig[key]; - }, - }; - }, - log: function() {}, - plugins: { - xpack_main: {}, - security: { getUser: getUserStub }, - }, + const createMockConfig = (mockConfig = {}) => { + return { + get: (...keys) => mockConfig[keys.join('.')], + kbnConfig: { get: (...keys) => mockConfig[keys.join('.')] }, }; + }; + const createMockPlugins = (function() { + const getUserStub = jest.fn(); return function({ securityEnabled = true, xpackInfoUndefined = false, xpackInfoAvailable = true, + getCurrentUser = undefined, user = undefined, - config = {}, }) { - mockConfig = config; - - mockServer.plugins.xpack_main = { - info: !xpackInfoUndefined && { - isAvailable: () => xpackInfoAvailable, - feature(featureName) { - if (featureName === 'security') { - return { - isEnabled: () => securityEnabled, - isAvailable: () => xpackInfoAvailable, - }; + getUserStub.mockReset(); + getUserStub.mockResolvedValue(user); + return { + security: securityEnabled + ? { + authc: { getCurrentUser }, } + : null, + __LEGACY: { + plugins: { + xpack_main: { + info: !xpackInfoUndefined && { + isAvailable: () => xpackInfoAvailable, + feature(featureName) { + if (featureName === 'security') { + return { + isEnabled: () => securityEnabled, + isAvailable: () => xpackInfoAvailable, + }; + } + }, + }, + }, }, }, }; - - getUserStub.mockReset(); - getUserStub.mockResolvedValue(user); - return mockServer; }; })(); @@ -75,10 +67,6 @@ describe('authorized_user_pre_routing', function() { raw: { req: mockRequestRaw }, }); - const getMockPlugins = pluginSet => { - return pluginSet || { security: null }; - }; - const getMockLogger = () => ({ warn: jest.fn(), error: msg => { @@ -87,11 +75,9 @@ describe('authorized_user_pre_routing', function() { }); it('should return with boom notFound when xpackInfo is undefined', async function() { - const mockServer = createMockServer({ xpackInfoUndefined: true }); - const authorizedUserPreRouting = authorizedUserPreRoutingFactory( - mockServer, - getMockPlugins(), + createMockConfig(), + createMockPlugins({ xpackInfoUndefined: true }), getMockLogger() ); const response = await authorizedUserPreRouting(getMockRequest()); @@ -100,11 +86,9 @@ describe('authorized_user_pre_routing', function() { }); it(`should return with boom notFound when xpackInfo isn't available`, async function() { - const mockServer = createMockServer({ xpackInfoAvailable: false }); - const authorizedUserPreRouting = authorizedUserPreRoutingFactory( - mockServer, - getMockPlugins(), + createMockConfig(), + createMockPlugins({ xpackInfoAvailable: false }), getMockLogger() ); const response = await authorizedUserPreRouting(getMockRequest()); @@ -113,11 +97,9 @@ describe('authorized_user_pre_routing', function() { }); it('should return with null user when security is disabled in Elasticsearch', async function() { - const mockServer = createMockServer({ securityEnabled: false }); - const authorizedUserPreRouting = authorizedUserPreRoutingFactory( - mockServer, - getMockPlugins(), + createMockConfig(), + createMockPlugins({ securityEnabled: false }), getMockLogger() ); const response = await authorizedUserPreRouting(getMockRequest()); @@ -125,16 +107,14 @@ describe('authorized_user_pre_routing', function() { }); it('should return with boom unauthenticated when security is enabled but no authenticated user', async function() { - const mockServer = createMockServer({ + const mockPlugins = createMockPlugins({ user: null, config: { 'xpack.reporting.roles.allow': ['.reporting_user'] }, }); - const mockPlugins = getMockPlugins({ - security: { authc: { getCurrentUser: () => null } }, - }); + mockPlugins.security = { authc: { getCurrentUser: () => null } }; const authorizedUserPreRouting = authorizedUserPreRoutingFactory( - mockServer, + createMockConfig(), mockPlugins, getMockLogger() ); @@ -144,16 +124,14 @@ describe('authorized_user_pre_routing', function() { }); it(`should return with boom forbidden when security is enabled but user doesn't have allowed role`, async function() { - const mockServer = createMockServer({ + const mockConfig = createMockConfig({ 'roles.allow': ['.reporting_user'] }); + const mockPlugins = createMockPlugins({ user: { roles: [] }, - config: { 'xpack.reporting.roles.allow': ['.reporting_user'] }, - }); - const mockPlugins = getMockPlugins({ - security: { authc: { getCurrentUser: () => ({ roles: ['something_else'] }) } }, + getCurrentUser: () => ({ roles: ['something_else'] }), }); const authorizedUserPreRouting = authorizedUserPreRoutingFactory( - mockServer, + mockConfig, mockPlugins, getMockLogger() ); @@ -164,18 +142,14 @@ describe('authorized_user_pre_routing', function() { it('should return with user when security is enabled and user has explicitly allowed role', async function() { const user = { roles: ['.reporting_user', 'something_else'] }; - const mockServer = createMockServer({ + const mockConfig = createMockConfig({ 'roles.allow': ['.reporting_user'] }); + const mockPlugins = createMockPlugins({ user, - config: { 'xpack.reporting.roles.allow': ['.reporting_user'] }, - }); - const mockPlugins = getMockPlugins({ - security: { - authc: { getCurrentUser: () => ({ roles: ['.reporting_user', 'something_else'] }) }, - }, + getCurrentUser: () => ({ roles: ['.reporting_user', 'something_else'] }), }); const authorizedUserPreRouting = authorizedUserPreRoutingFactory( - mockServer, + mockConfig, mockPlugins, getMockLogger() ); @@ -185,16 +159,13 @@ describe('authorized_user_pre_routing', function() { it('should return with user when security is enabled and user has superuser role', async function() { const user = { roles: ['superuser', 'something_else'] }; - const mockServer = createMockServer({ - user, - config: { 'xpack.reporting.roles.allow': [] }, - }); - const mockPlugins = getMockPlugins({ - security: { authc: { getCurrentUser: () => ({ roles: ['superuser', 'something_else'] }) } }, + const mockConfig = createMockConfig({ 'roles.allow': [] }); + const mockPlugins = createMockPlugins({ + getCurrentUser: () => ({ roles: ['superuser', 'something_else'] }), }); const authorizedUserPreRouting = authorizedUserPreRoutingFactory( - mockServer, + mockConfig, mockPlugins, getMockLogger() ); diff --git a/x-pack/legacy/plugins/reporting/server/routes/lib/authorized_user_pre_routing.ts b/x-pack/legacy/plugins/reporting/server/routes/lib/authorized_user_pre_routing.ts index c5f8c78016f61..1ca28ca62a7f2 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/lib/authorized_user_pre_routing.ts +++ b/x-pack/legacy/plugins/reporting/server/routes/lib/authorized_user_pre_routing.ts @@ -7,7 +7,8 @@ import Boom from 'boom'; import { Legacy } from 'kibana'; import { AuthenticatedUser } from '../../../../../../plugins/security/server'; -import { Logger, ServerFacade } from '../../../types'; +import { ReportingConfig } from '../../../server'; +import { Logger } from '../../../types'; import { getUserFactory } from '../../lib/get_user'; import { ReportingSetupDeps } from '../../types'; @@ -18,16 +19,14 @@ export type PreRoutingFunction = ( ) => Promise | AuthenticatedUser | null>; export const authorizedUserPreRoutingFactory = function authorizedUserPreRoutingFn( - server: ServerFacade, + config: ReportingConfig, plugins: ReportingSetupDeps, logger: Logger ) { - const getUser = getUserFactory(server, plugins.security); - const config = server.config(); + const getUser = getUserFactory(plugins.security, logger); + const { info: xpackInfo } = plugins.__LEGACY.plugins.xpack_main; return async function authorizedUserPreRouting(request: Legacy.Request) { - const xpackInfo = server.plugins.xpack_main.info; - if (!xpackInfo || !xpackInfo.isAvailable()) { logger.warn('Unable to authorize user before xpack info is available.', [ 'authorizedUserPreRouting', @@ -46,10 +45,7 @@ export const authorizedUserPreRoutingFactory = function authorizedUserPreRouting return Boom.unauthorized(`Sorry, you aren't authenticated`); } - const authorizedRoles = [ - superuserRole, - ...(config.get('xpack.reporting.roles.allow') as string[]), - ]; + const authorizedRoles = [superuserRole, ...(config.get('roles', 'allow') as string[])]; if (!user.roles.find(role => authorizedRoles.includes(role))) { return Boom.forbidden(`Sorry, you don't have access to Reporting`); } diff --git a/x-pack/legacy/plugins/reporting/server/routes/lib/get_document_payload.ts b/x-pack/legacy/plugins/reporting/server/routes/lib/get_document_payload.ts index fb3944ea33552..aef37754681ec 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/lib/get_document_payload.ts +++ b/x-pack/legacy/plugins/reporting/server/routes/lib/get_document_payload.ts @@ -8,13 +8,7 @@ import contentDisposition from 'content-disposition'; import * as _ from 'lodash'; import { CSV_JOB_TYPE } from '../../../common/constants'; -import { - ExportTypeDefinition, - ExportTypesRegistry, - JobDocOutput, - JobSource, - ServerFacade, -} from '../../../types'; +import { ExportTypeDefinition, ExportTypesRegistry, JobDocOutput, JobSource } from '../../../types'; interface ICustomHeaders { [x: string]: any; @@ -22,9 +16,15 @@ interface ICustomHeaders { type ExportTypeType = ExportTypeDefinition; +interface ErrorFromPayload { + message: string; + reason: string | null; +} + +// A camelCase version of JobDocOutput interface Payload { statusCode: number; - content: any; + content: string | Buffer | ErrorFromPayload; contentType: string; headers: Record; } @@ -48,20 +48,17 @@ const getReportingHeaders = (output: JobDocOutput, exportType: ExportTypeType) = return metaDataHeaders; }; -export function getDocumentPayloadFactory( - server: ServerFacade, - exportTypesRegistry: ExportTypesRegistry -) { - function encodeContent(content: string | null, exportType: ExportTypeType) { +export function getDocumentPayloadFactory(exportTypesRegistry: ExportTypesRegistry) { + function encodeContent(content: string | null, exportType: ExportTypeType): Buffer | string { switch (exportType.jobContentEncoding) { case 'base64': - return content ? Buffer.from(content, 'base64') : content; // Buffer.from rejects null + return content ? Buffer.from(content, 'base64') : ''; // convert null to empty string default: - return content; + return content ? content : ''; // convert null to empty string } } - function getCompleted(output: JobDocOutput, jobType: string, title: string) { + function getCompleted(output: JobDocOutput, jobType: string, title: string): Payload { const exportType = exportTypesRegistry.get((item: ExportTypeType) => item.jobType === jobType); const filename = getTitle(exportType, title); const headers = getReportingHeaders(output, exportType); @@ -77,7 +74,7 @@ export function getDocumentPayloadFactory( }; } - function getFailure(output: JobDocOutput) { + function getFailure(output: JobDocOutput): Payload { return { statusCode: 500, content: { diff --git a/x-pack/legacy/plugins/reporting/server/routes/lib/job_response_handler.ts b/x-pack/legacy/plugins/reporting/server/routes/lib/job_response_handler.ts index 30627d5b23230..e7e7c866db96a 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/lib/job_response_handler.ts +++ b/x-pack/legacy/plugins/reporting/server/routes/lib/job_response_handler.ts @@ -5,11 +5,12 @@ */ import Boom from 'boom'; -import { ElasticsearchServiceSetup } from 'kibana/server'; import { ResponseToolkit } from 'hapi'; +import { ElasticsearchServiceSetup } from 'kibana/server'; import { WHITELISTED_JOB_CONTENT_TYPES } from '../../../common/constants'; -import { ExportTypesRegistry, ServerFacade } from '../../../types'; +import { ExportTypesRegistry } from '../../../types'; import { jobsQueryFactory } from '../../lib/jobs_query'; +import { ReportingConfig } from '../../types'; import { getDocumentPayloadFactory } from './get_document_payload'; interface JobResponseHandlerParams { @@ -21,12 +22,12 @@ interface JobResponseHandlerOpts { } export function downloadJobResponseHandlerFactory( - server: ServerFacade, + config: ReportingConfig, elasticsearch: ElasticsearchServiceSetup, exportTypesRegistry: ExportTypesRegistry ) { - const jobsQuery = jobsQueryFactory(server, elasticsearch); - const getDocumentPayload = getDocumentPayloadFactory(server, exportTypesRegistry); + const jobsQuery = jobsQueryFactory(config, elasticsearch); + const getDocumentPayload = getDocumentPayloadFactory(exportTypesRegistry); return function jobResponseHandler( validJobTypes: string[], @@ -70,10 +71,10 @@ export function downloadJobResponseHandlerFactory( } export function deleteJobResponseHandlerFactory( - server: ServerFacade, + config: ReportingConfig, elasticsearch: ElasticsearchServiceSetup ) { - const jobsQuery = jobsQueryFactory(server, elasticsearch); + const jobsQuery = jobsQueryFactory(config, elasticsearch); return async function deleteJobResponseHander( validJobTypes: string[], diff --git a/x-pack/legacy/plugins/reporting/server/routes/lib/reporting_feature_pre_routing.ts b/x-pack/legacy/plugins/reporting/server/routes/lib/reporting_feature_pre_routing.ts index 9e618ff1fe40a..8a79566aafae2 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/lib/reporting_feature_pre_routing.ts +++ b/x-pack/legacy/plugins/reporting/server/routes/lib/reporting_feature_pre_routing.ts @@ -6,17 +6,17 @@ import Boom from 'boom'; import { Legacy } from 'kibana'; -import { Logger, ServerFacade } from '../../../types'; -import { ReportingSetupDeps } from '../../types'; +import { Logger } from '../../../types'; +import { ReportingConfig, ReportingSetupDeps } from '../../types'; export type GetReportingFeatureIdFn = (request: Legacy.Request) => string; export const reportingFeaturePreRoutingFactory = function reportingFeaturePreRoutingFn( - server: ServerFacade, + config: ReportingConfig, plugins: ReportingSetupDeps, logger: Logger ) { - const xpackMainPlugin = server.plugins.xpack_main; + const xpackMainPlugin = plugins.__LEGACY.plugins.xpack_main; const pluginId = 'reporting'; // License checking and enable/disable logic diff --git a/x-pack/legacy/plugins/reporting/server/routes/lib/route_config_factories.ts b/x-pack/legacy/plugins/reporting/server/routes/lib/route_config_factories.ts index 3d275d34e2f7d..06f7efaa9dcbb 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/lib/route_config_factories.ts +++ b/x-pack/legacy/plugins/reporting/server/routes/lib/route_config_factories.ts @@ -6,8 +6,8 @@ import Joi from 'joi'; import { CSV_FROM_SAVEDOBJECT_JOB_TYPE } from '../../../common/constants'; -import { Logger, ServerFacade } from '../../../types'; -import { ReportingSetupDeps } from '../../types'; +import { Logger } from '../../../types'; +import { ReportingConfig, ReportingSetupDeps } from '../../types'; import { authorizedUserPreRoutingFactory } from './authorized_user_pre_routing'; import { GetReportingFeatureIdFn, @@ -29,12 +29,12 @@ export type GetRouteConfigFactoryFn = ( ) => RouteConfigFactory; export function getRouteConfigFactoryReportingPre( - server: ServerFacade, + config: ReportingConfig, plugins: ReportingSetupDeps, logger: Logger ): GetRouteConfigFactoryFn { - const authorizedUserPreRouting = authorizedUserPreRoutingFactory(server, plugins, logger); - const reportingFeaturePreRouting = reportingFeaturePreRoutingFactory(server, plugins, logger); + const authorizedUserPreRouting = authorizedUserPreRoutingFactory(config, plugins, logger); + const reportingFeaturePreRouting = reportingFeaturePreRoutingFactory(config, plugins, logger); return (getFeatureId?: GetReportingFeatureIdFn): RouteConfigFactory => { const preRouting: any[] = [{ method: authorizedUserPreRouting, assign: 'user' }]; @@ -50,11 +50,11 @@ export function getRouteConfigFactoryReportingPre( } export function getRouteOptionsCsv( - server: ServerFacade, + config: ReportingConfig, plugins: ReportingSetupDeps, logger: Logger ) { - const getRouteConfig = getRouteConfigFactoryReportingPre(server, plugins, logger); + const getRouteConfig = getRouteConfigFactoryReportingPre(config, plugins, logger); return { ...getRouteConfig(() => CSV_FROM_SAVEDOBJECT_JOB_TYPE), validate: { @@ -75,12 +75,12 @@ export function getRouteOptionsCsv( } export function getRouteConfigFactoryManagementPre( - server: ServerFacade, + config: ReportingConfig, plugins: ReportingSetupDeps, logger: Logger ): GetRouteConfigFactoryFn { - const authorizedUserPreRouting = authorizedUserPreRoutingFactory(server, plugins, logger); - const reportingFeaturePreRouting = reportingFeaturePreRoutingFactory(server, plugins, logger); + const authorizedUserPreRouting = authorizedUserPreRoutingFactory(config, plugins, logger); + const reportingFeaturePreRouting = reportingFeaturePreRoutingFactory(config, plugins, logger); const managementPreRouting = reportingFeaturePreRouting(() => 'management'); return (): RouteConfigFactory => { @@ -99,11 +99,11 @@ export function getRouteConfigFactoryManagementPre( // Additionally, the range-request doesn't alleviate any performance issues on the server as the entire // download is loaded into memory. export function getRouteConfigFactoryDownloadPre( - server: ServerFacade, + config: ReportingConfig, plugins: ReportingSetupDeps, logger: Logger ): GetRouteConfigFactoryFn { - const getManagementRouteConfig = getRouteConfigFactoryManagementPre(server, plugins, logger); + const getManagementRouteConfig = getRouteConfigFactoryManagementPre(config, plugins, logger); return (): RouteConfigFactory => ({ ...getManagementRouteConfig(), tags: [API_TAG, 'download'], @@ -114,11 +114,11 @@ export function getRouteConfigFactoryDownloadPre( } export function getRouteConfigFactoryDeletePre( - server: ServerFacade, + config: ReportingConfig, plugins: ReportingSetupDeps, logger: Logger ): GetRouteConfigFactoryFn { - const getManagementRouteConfig = getRouteConfigFactoryManagementPre(server, plugins, logger); + const getManagementRouteConfig = getRouteConfigFactoryManagementPre(config, plugins, logger); return (): RouteConfigFactory => ({ ...getManagementRouteConfig(), tags: [API_TAG, 'delete'], diff --git a/x-pack/legacy/plugins/reporting/server/types.d.ts b/x-pack/legacy/plugins/reporting/server/types.d.ts index 59b7bc2020ad9..bec00688432cc 100644 --- a/x-pack/legacy/plugins/reporting/server/types.d.ts +++ b/x-pack/legacy/plugins/reporting/server/types.d.ts @@ -11,16 +11,16 @@ import { PluginStart as DataPluginStart } from '../../../../../src/plugins/data/ import { SecurityPluginSetup } from '../../../../plugins/security/server'; import { XPackMainPlugin } from '../../xpack_main/server/xpack_main'; import { ReportingPluginSpecOptions } from '../types'; +import { ReportingConfig, ReportingConfigType } from './core'; export interface ReportingSetupDeps { elasticsearch: ElasticsearchServiceSetup; security: SecurityPluginSetup; - usageCollection: UsageCollectionSetup; + usageCollection?: UsageCollectionSetup; __LEGACY: LegacySetup; } export interface ReportingStartDeps { - elasticsearch: ElasticsearchServiceSetup; data: DataPluginStart; __LEGACY: LegacySetup; } @@ -31,9 +31,7 @@ export type ReportingStart = object; export interface LegacySetup { config: Legacy.Server['config']; - info: Legacy.Server['info']; plugins: { - elasticsearch: Legacy.Server['plugins']['elasticsearch']; xpack_main: XPackMainPlugin & { status?: any; }; @@ -42,4 +40,7 @@ export interface LegacySetup { route: Legacy.Server['route']; } -export { ReportingCore } from './core'; +export { ReportingConfig, ReportingConfigType, ReportingCore } from './core'; + +export type CaptureConfig = ReportingConfigType['capture']; +export type ScrollConfig = ReportingConfigType['csv']['scroll']; diff --git a/x-pack/legacy/plugins/reporting/server/usage/get_reporting_usage.ts b/x-pack/legacy/plugins/reporting/server/usage/get_reporting_usage.ts index bd2d0cb835a79..e9523d9e70202 100644 --- a/x-pack/legacy/plugins/reporting/server/usage/get_reporting_usage.ts +++ b/x-pack/legacy/plugins/reporting/server/usage/get_reporting_usage.ts @@ -5,7 +5,11 @@ */ import { get } from 'lodash'; -import { ServerFacade, ExportTypesRegistry, ESCallCluster } from '../../types'; +import { XPackMainPlugin } from '../../../xpack_main/server/xpack_main'; +import { ESCallCluster, ExportTypesRegistry } from '../../types'; +import { ReportingConfig } from '../types'; +import { decorateRangeStats } from './decorate_range_stats'; +import { getExportTypesHandler } from './get_export_type_handler'; import { AggregationBuckets, AggregationResults, @@ -15,8 +19,8 @@ import { RangeAggregationResults, RangeStats, } from './types'; -import { decorateRangeStats } from './decorate_range_stats'; -import { getExportTypesHandler } from './get_export_type_handler'; + +type XPackInfo = XPackMainPlugin['info']; const JOB_TYPES_KEY = 'jobTypes'; const JOB_TYPES_FIELD = 'jobtype'; @@ -79,10 +83,7 @@ type RangeStatSets = Partial< last7Days: RangeStats; } >; -async function handleResponse( - server: ServerFacade, - response: AggregationResults -): Promise { +async function handleResponse(response: AggregationResults): Promise { const buckets = get(response, 'aggregations.ranges.buckets'); if (!buckets) { return {}; @@ -101,12 +102,12 @@ async function handleResponse( } export async function getReportingUsage( - server: ServerFacade, + config: ReportingConfig, + xpackMainInfo: XPackInfo, callCluster: ESCallCluster, exportTypesRegistry: ExportTypesRegistry ) { - const config = server.config(); - const reportingIndex = config.get('xpack.reporting.index'); + const reportingIndex = config.get('index'); const params = { index: `${reportingIndex}-*`, @@ -140,15 +141,16 @@ export async function getReportingUsage( }; return callCluster('search', params) - .then((response: AggregationResults) => handleResponse(server, response)) + .then((response: AggregationResults) => handleResponse(response)) .then((usage: RangeStatSets) => { // Allow this to explicitly throw an exception if/when this config is deprecated, // because we shouldn't collect browserType in that case! - const browserType = config.get('xpack.reporting.capture.browser.type'); + const browserType = config.get('capture', 'browser', 'type'); - const xpackInfo = server.plugins.xpack_main.info; const exportTypesHandler = getExportTypesHandler(exportTypesRegistry); - const availability = exportTypesHandler.getAvailability(xpackInfo) as FeatureAvailabilityMap; + const availability = exportTypesHandler.getAvailability( + xpackMainInfo + ) as FeatureAvailabilityMap; const { lastDay, last7Days, ...all } = usage; diff --git a/x-pack/legacy/plugins/reporting/server/usage/reporting_usage_collector.test.js b/x-pack/legacy/plugins/reporting/server/usage/reporting_usage_collector.test.js index a6d753f9b107a..929109e66914d 100644 --- a/x-pack/legacy/plugins/reporting/server/usage/reporting_usage_collector.test.js +++ b/x-pack/legacy/plugins/reporting/server/usage/reporting_usage_collector.test.js @@ -24,62 +24,60 @@ function getMockUsageCollection() { makeUsageCollector: options => { return new MockUsageCollector(this, options); }, + registerCollector: sinon.stub(), }; } -function getServerMock(customization) { - const getLicenseCheckResults = sinon.stub().returns({}); - const defaultServerMock = { - plugins: { - security: { - isAuthenticated: sinon.stub().returns(true), - }, - xpack_main: { - info: { - isAvailable: sinon.stub().returns(true), - feature: () => ({ - getLicenseCheckResults, - }), - license: { - isOneOf: sinon.stub().returns(false), - getType: sinon.stub().returns('platinum'), - }, - toJSON: () => ({ b: 1 }), - }, +function getPluginsMock( + { license, usageCollection = getMockUsageCollection() } = { license: 'platinum' } +) { + const mockXpackMain = { + info: { + isAvailable: sinon.stub().returns(true), + feature: () => ({ + getLicenseCheckResults: sinon.stub(), + }), + license: { + isOneOf: sinon.stub().returns(false), + getType: sinon.stub().returns(license), }, + toJSON: () => ({ b: 1 }), }, - log: () => {}, - config: () => ({ - get: key => { - if (key === 'xpack.reporting.enabled') { - return true; - } else if (key === 'xpack.reporting.index') { - return '.reporting-index'; - } + }; + return { + usageCollection, + __LEGACY: { + plugins: { + xpack_main: mockXpackMain, }, - }), + }, }; - return Object.assign(defaultServerMock, customization); } +const getMockReportingConfig = () => ({ + get: () => {}, + kbnConfig: { get: () => '' }, +}); const getResponseMock = (customization = {}) => customization; describe('license checks', () => { + let mockConfig; + beforeAll(async () => { + mockConfig = getMockReportingConfig(); + }); + describe('with a basic license', () => { let usageStats; beforeAll(async () => { - const serverWithBasicLicenseMock = getServerMock(); - serverWithBasicLicenseMock.plugins.xpack_main.info.license.getType = sinon - .stub() - .returns('basic'); + const plugins = getPluginsMock({ license: 'basic' }); const callClusterMock = jest.fn(() => Promise.resolve(getResponseMock())); - const usageCollection = getMockUsageCollection(); - const { fetch: getReportingUsage } = getReportingUsageCollector( - serverWithBasicLicenseMock, - usageCollection, + const { fetch } = getReportingUsageCollector( + mockConfig, + plugins.usageCollection, + plugins.__LEGACY.plugins.xpack_main.info, exportTypesRegistry ); - usageStats = await getReportingUsage(callClusterMock, exportTypesRegistry); + usageStats = await fetch(callClusterMock, exportTypesRegistry); }); test('sets enables to true', async () => { @@ -98,18 +96,15 @@ describe('license checks', () => { describe('with no license', () => { let usageStats; beforeAll(async () => { - const serverWithNoLicenseMock = getServerMock(); - serverWithNoLicenseMock.plugins.xpack_main.info.license.getType = sinon - .stub() - .returns('none'); + const plugins = getPluginsMock({ license: 'none' }); const callClusterMock = jest.fn(() => Promise.resolve(getResponseMock())); - const usageCollection = getMockUsageCollection(); - const { fetch: getReportingUsage } = getReportingUsageCollector( - serverWithNoLicenseMock, - usageCollection, + const { fetch } = getReportingUsageCollector( + mockConfig, + plugins.usageCollection, + plugins.__LEGACY.plugins.xpack_main.info, exportTypesRegistry ); - usageStats = await getReportingUsage(callClusterMock, exportTypesRegistry); + usageStats = await fetch(callClusterMock, exportTypesRegistry); }); test('sets enables to true', async () => { @@ -128,18 +123,15 @@ describe('license checks', () => { describe('with platinum license', () => { let usageStats; beforeAll(async () => { - const serverWithPlatinumLicenseMock = getServerMock(); - serverWithPlatinumLicenseMock.plugins.xpack_main.info.license.getType = sinon - .stub() - .returns('platinum'); + const plugins = getPluginsMock({ license: 'platinum' }); const callClusterMock = jest.fn(() => Promise.resolve(getResponseMock())); - const usageCollection = getMockUsageCollection(); - const { fetch: getReportingUsage } = getReportingUsageCollector( - serverWithPlatinumLicenseMock, - usageCollection, + const { fetch } = getReportingUsageCollector( + mockConfig, + plugins.usageCollection, + plugins.__LEGACY.plugins.xpack_main.info, exportTypesRegistry ); - usageStats = await getReportingUsage(callClusterMock, exportTypesRegistry); + usageStats = await fetch(callClusterMock, exportTypesRegistry); }); test('sets enables to true', async () => { @@ -158,18 +150,15 @@ describe('license checks', () => { describe('with no usage data', () => { let usageStats; beforeAll(async () => { - const serverWithBasicLicenseMock = getServerMock(); - serverWithBasicLicenseMock.plugins.xpack_main.info.license.getType = sinon - .stub() - .returns('basic'); + const plugins = getPluginsMock({ license: 'basic' }); const callClusterMock = jest.fn(() => Promise.resolve({})); - const usageCollection = getMockUsageCollection(); - const { fetch: getReportingUsage } = getReportingUsageCollector( - serverWithBasicLicenseMock, - usageCollection, + const { fetch } = getReportingUsageCollector( + mockConfig, + plugins.usageCollection, + plugins.__LEGACY.plugins.xpack_main.info, exportTypesRegistry ); - usageStats = await getReportingUsage(callClusterMock, exportTypesRegistry); + usageStats = await fetch(callClusterMock, exportTypesRegistry); }); test('sets enables to true', async () => { @@ -183,21 +172,15 @@ describe('license checks', () => { }); describe('data modeling', () => { - let getReportingUsage; - beforeAll(async () => { - const usageCollection = getMockUsageCollection(); - const serverWithPlatinumLicenseMock = getServerMock(); - serverWithPlatinumLicenseMock.plugins.xpack_main.info.license.getType = sinon - .stub() - .returns('platinum'); - ({ fetch: getReportingUsage } = getReportingUsageCollector( - serverWithPlatinumLicenseMock, - usageCollection, - exportTypesRegistry - )); - }); - test('with normal looking usage data', async () => { + const mockConfig = getMockReportingConfig(); + const plugins = getPluginsMock(); + const { fetch } = getReportingUsageCollector( + mockConfig, + plugins.usageCollection, + plugins.__LEGACY.plugins.xpack_main.info, + exportTypesRegistry + ); const callClusterMock = jest.fn(() => Promise.resolve( getResponseMock({ @@ -320,7 +303,7 @@ describe('data modeling', () => { ) ); - const usageStats = await getReportingUsage(callClusterMock); + const usageStats = await fetch(callClusterMock); expect(usageStats).toMatchInlineSnapshot(` Object { "PNG": Object { @@ -415,20 +398,16 @@ describe('data modeling', () => { }); describe('Ready for collection observable', () => { - let mockReporting; - - beforeEach(async () => { - mockReporting = await createMockReportingCore(); - }); - test('converts observable to promise', async () => { - const serverWithBasicLicenseMock = getServerMock(); + const mockConfig = getMockReportingConfig(); + const mockReporting = await createMockReportingCore(mockConfig); + + const usageCollection = getMockUsageCollection(); const makeCollectorSpy = sinon.spy(); - const usageCollection = { - makeUsageCollector: makeCollectorSpy, - registerCollector: sinon.stub(), - }; - registerReportingUsageCollector(mockReporting, serverWithBasicLicenseMock, usageCollection); + usageCollection.makeUsageCollector = makeCollectorSpy; + + const plugins = getPluginsMock({ usageCollection }); + registerReportingUsageCollector(mockReporting, plugins); const [args] = makeCollectorSpy.firstCall.args; expect(args).toMatchInlineSnapshot(` diff --git a/x-pack/legacy/plugins/reporting/server/usage/reporting_usage_collector.ts b/x-pack/legacy/plugins/reporting/server/usage/reporting_usage_collector.ts index 14202530fb6c7..8f9d65c200dad 100644 --- a/x-pack/legacy/plugins/reporting/server/usage/reporting_usage_collector.ts +++ b/x-pack/legacy/plugins/reporting/server/usage/reporting_usage_collector.ts @@ -5,29 +5,32 @@ */ import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; +import { XPackMainPlugin } from '../../../xpack_main/server/xpack_main'; import { KIBANA_REPORTING_TYPE } from '../../common/constants'; -import { ReportingCore } from '../../server'; -import { ESCallCluster, ExportTypesRegistry, ServerFacade } from '../../types'; +import { ReportingConfig, ReportingCore, ReportingSetupDeps } from '../../server/types'; +import { ESCallCluster, ExportTypesRegistry } from '../../types'; import { getReportingUsage } from './get_reporting_usage'; import { RangeStats } from './types'; +type XPackInfo = XPackMainPlugin['info']; + // places the reporting data as kibana stats const METATYPE = 'kibana_stats'; /* - * @param {Object} server * @return {Object} kibana usage stats type collection object */ export function getReportingUsageCollector( - server: ServerFacade, + config: ReportingConfig, usageCollection: UsageCollectionSetup, + xpackMainInfo: XPackInfo, exportTypesRegistry: ExportTypesRegistry, isReady: () => Promise ) { return usageCollection.makeUsageCollector({ type: KIBANA_REPORTING_TYPE, fetch: (callCluster: ESCallCluster) => - getReportingUsage(server, callCluster, exportTypesRegistry), + getReportingUsage(config, xpackMainInfo, callCluster, exportTypesRegistry), isReady, /* @@ -52,17 +55,23 @@ export function getReportingUsageCollector( export function registerReportingUsageCollector( reporting: ReportingCore, - server: ServerFacade, - usageCollection: UsageCollectionSetup + plugins: ReportingSetupDeps ) { + if (!plugins.usageCollection) { + return; + } + const xpackMainInfo = plugins.__LEGACY.plugins.xpack_main.info; + const exportTypesRegistry = reporting.getExportTypesRegistry(); const collectionIsReady = reporting.pluginHasStarted.bind(reporting); + const config = reporting.getConfig(); const collector = getReportingUsageCollector( - server, - usageCollection, + config, + plugins.usageCollection, + xpackMainInfo, exportTypesRegistry, collectionIsReady ); - usageCollection.registerCollector(collector); + plugins.usageCollection.registerCollector(collector); } diff --git a/x-pack/legacy/plugins/reporting/test_helpers/create_mock_browserdriverfactory.ts b/x-pack/legacy/plugins/reporting/test_helpers/create_mock_browserdriverfactory.ts index 883276d43e27e..930aa7601b8cb 100644 --- a/x-pack/legacy/plugins/reporting/test_helpers/create_mock_browserdriverfactory.ts +++ b/x-pack/legacy/plugins/reporting/test_helpers/create_mock_browserdriverfactory.ts @@ -10,7 +10,8 @@ import * as contexts from '../export_types/common/lib/screenshots/constants'; import { ElementsPositionAndAttribute } from '../export_types/common/lib/screenshots/types'; import { HeadlessChromiumDriver, HeadlessChromiumDriverFactory } from '../server/browsers'; import { createDriverFactory } from '../server/browsers/chromium'; -import { BrowserConfig, CaptureConfig, Logger } from '../types'; +import { CaptureConfig } from '../server/types'; +import { Logger } from '../types'; interface CreateMockBrowserDriverFactoryOpts { evaluate: jest.Mock, any[]>; @@ -93,24 +94,34 @@ export const createMockBrowserDriverFactory = async ( logger: Logger, opts: Partial ): Promise => { - const browserConfig = { - inspect: true, - userDataDir: '/usr/data/dir', - viewport: { width: 12, height: 12 }, - disableSandbox: false, - proxy: { enabled: false }, - } as BrowserConfig; + const captureConfig = { + timeouts: { openUrl: 30000, waitForElements: 30000, renderComplete: 30000 }, + browser: { + type: 'chromium', + chromium: { + inspect: false, + disableSandbox: false, + userDataDir: '/usr/data/dir', + viewport: { width: 12, height: 12 }, + proxy: { enabled: false, server: undefined, bypass: undefined }, + }, + autoDownload: false, + inspect: true, + userDataDir: '/usr/data/dir', + viewport: { width: 12, height: 12 }, + disableSandbox: false, + proxy: { enabled: false, server: undefined, bypass: undefined }, + maxScreenshotDimension: undefined, + }, + networkPolicy: { enabled: true, rules: [] }, + viewport: { width: 800, height: 600 }, + loadDelay: 2000, + zoom: 1, + maxAttempts: 1, + } as CaptureConfig; const binaryPath = '/usr/local/share/common/secure/'; - const captureConfig = { networkPolicy: {}, timeouts: {} } as CaptureConfig; - - const mockBrowserDriverFactory = await createDriverFactory( - binaryPath, - logger, - browserConfig, - captureConfig - ); - + const mockBrowserDriverFactory = await createDriverFactory(binaryPath, logger, captureConfig); const mockPage = {} as Page; const mockBrowserDriver = new HeadlessChromiumDriver(mockPage, { inspect: true, diff --git a/x-pack/legacy/plugins/reporting/test_helpers/create_mock_layoutinstance.ts b/x-pack/legacy/plugins/reporting/test_helpers/create_mock_layoutinstance.ts index 0250e6c0a9afd..be60b56dcc0c1 100644 --- a/x-pack/legacy/plugins/reporting/test_helpers/create_mock_layoutinstance.ts +++ b/x-pack/legacy/plugins/reporting/test_helpers/create_mock_layoutinstance.ts @@ -4,13 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import { createLayout } from '../export_types/common/layouts'; import { LayoutTypes } from '../export_types/common/constants'; +import { createLayout } from '../export_types/common/layouts'; import { LayoutInstance } from '../export_types/common/layouts/layout'; -import { ServerFacade } from '../types'; +import { CaptureConfig } from '../server/types'; -export const createMockLayoutInstance = (__LEGACY: ServerFacade) => { - const mockLayout = createLayout(__LEGACY, { +export const createMockLayoutInstance = (captureConfig: CaptureConfig) => { + const mockLayout = createLayout(captureConfig, { id: LayoutTypes.PRESERVE_LAYOUT, dimensions: { height: 12, width: 12 }, }) as LayoutInstance; diff --git a/x-pack/legacy/plugins/reporting/test_helpers/create_mock_reportingplugin.ts b/x-pack/legacy/plugins/reporting/test_helpers/create_mock_reportingplugin.ts index 2cd129d47b3f9..34ff91d1972a0 100644 --- a/x-pack/legacy/plugins/reporting/test_helpers/create_mock_reportingplugin.ts +++ b/x-pack/legacy/plugins/reporting/test_helpers/create_mock_reportingplugin.ts @@ -16,24 +16,26 @@ jest.mock('../log_configuration'); import { EventEmitter } from 'events'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { coreMock } from 'src/core/server/mocks'; -import { ReportingPlugin, ReportingCore } from '../server'; +import { ReportingPlugin, ReportingCore, ReportingConfig } from '../server'; import { ReportingSetupDeps, ReportingStartDeps } from '../server/types'; -export const createMockSetupDeps = (setupMock?: any): ReportingSetupDeps => ({ - elasticsearch: setupMock.elasticsearch, - security: setupMock.security, - usageCollection: {} as any, - __LEGACY: { plugins: { xpack_main: { status: new EventEmitter() } } } as any, -}); +const createMockSetupDeps = (setupMock?: any): ReportingSetupDeps => { + return { + elasticsearch: setupMock.elasticsearch, + security: setupMock.security, + usageCollection: {} as any, + __LEGACY: { plugins: { xpack_main: { status: new EventEmitter() } } } as any, + }; +}; export const createMockStartDeps = (startMock?: any): ReportingStartDeps => ({ data: startMock.data, - elasticsearch: startMock.elasticsearch, __LEGACY: {} as any, }); -const createMockReportingPlugin = async (config = {}): Promise => { - const plugin = new ReportingPlugin(coreMock.createPluginInitializerContext(config)); +const createMockReportingPlugin = async (config: ReportingConfig): Promise => { + config = config || {}; + const plugin = new ReportingPlugin(coreMock.createPluginInitializerContext(config), config); const setupMock = coreMock.createSetup(); const coreStartMock = coreMock.createStart(); const startMock = { @@ -47,7 +49,8 @@ const createMockReportingPlugin = async (config = {}): Promise return plugin; }; -export const createMockReportingCore = async (config = {}): Promise => { +export const createMockReportingCore = async (config: ReportingConfig): Promise => { + config = config || {}; const plugin = await createMockReportingPlugin(config); return plugin.getReportingCore(); }; diff --git a/x-pack/legacy/plugins/reporting/test_helpers/create_mock_server.ts b/x-pack/legacy/plugins/reporting/test_helpers/create_mock_server.ts index bb7851ba036a9..531e1dcaf84e0 100644 --- a/x-pack/legacy/plugins/reporting/test_helpers/create_mock_server.ts +++ b/x-pack/legacy/plugins/reporting/test_helpers/create_mock_server.ts @@ -3,36 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { memoize } from 'lodash'; -import { ServerFacade } from '../types'; - -export const createMockServer = ({ settings = {} }: any): ServerFacade => { - const mockServer = { - config: memoize(() => ({ get: jest.fn() })), - info: { - protocol: 'http', - }, - plugins: { - elasticsearch: { - getCluster: memoize(() => { - return { - callWithRequest: jest.fn(), - }; - }), - }, - }, - }; - const defaultSettings: any = { - 'xpack.reporting.encryptionKey': 'testencryptionkey', - 'server.basePath': '/sbp', - 'server.host': 'localhost', - 'server.port': 5601, - 'xpack.reporting.kibanaServer': {}, - }; - mockServer.config().get.mockImplementation((key: any) => { - return key in settings ? settings[key] : defaultSettings[key]; - }); +import { ServerFacade } from '../types'; - return (mockServer as unknown) as ServerFacade; +export const createMockServer = (): ServerFacade => { + const mockServer = {}; + return mockServer as any; }; diff --git a/x-pack/legacy/plugins/reporting/types.d.ts b/x-pack/legacy/plugins/reporting/types.d.ts index 238079ba92a29..09d53278941c9 100644 --- a/x-pack/legacy/plugins/reporting/types.d.ts +++ b/x-pack/legacy/plugins/reporting/types.d.ts @@ -7,14 +7,11 @@ import { EventEmitter } from 'events'; import { ResponseObject } from 'hapi'; import { Legacy } from 'kibana'; -import { ElasticsearchServiceSetup } from 'kibana/server'; import { CallCluster } from '../../../../src/legacy/core_plugins/elasticsearch'; import { CancellationToken } from './common/cancellation_token'; -import { HeadlessChromiumDriverFactory } from './server/browsers/chromium/driver_factory'; -import { BrowserType } from './server/browsers/types'; -import { LevelLogger } from './server/lib/level_logger'; import { ReportingCore } from './server/core'; -import { LegacySetup, ReportingStartDeps, ReportingSetup, ReportingStart } from './server/types'; +import { LevelLogger } from './server/lib/level_logger'; +import { LegacySetup } from './server/types'; export type Job = EventEmitter & { id: string; @@ -25,8 +22,8 @@ export type Job = EventEmitter & { export interface NetworkPolicyRule { allow: boolean; - protocol: string; - host: string; + protocol?: string; + host?: string; } export interface NetworkPolicy { @@ -93,51 +90,6 @@ export type ReportingResponseToolkit = Legacy.ResponseToolkit; export type ESCallCluster = CallCluster; -/* - * Reporting Config - */ - -export interface CaptureConfig { - browser: { - type: BrowserType; - autoDownload: boolean; - chromium: BrowserConfig; - }; - maxAttempts: number; - networkPolicy: NetworkPolicy; - loadDelay: number; - timeouts: { - openUrl: number; - waitForElements: number; - renderComplet: number; - }; -} - -export interface BrowserConfig { - inspect: boolean; - userDataDir: string; - viewport: { width: number; height: number }; - disableSandbox: boolean; - proxy: { - enabled: boolean; - server: string; - bypass?: string[]; - }; -} - -export interface QueueConfig { - indexInterval: string; - pollEnabled: boolean; - pollInterval: number; - pollIntervalErrorMultiplier: number; - timeout: number; -} - -export interface ScrollConfig { - duration: string; - size: number; -} - export interface ElementPosition { boundingClientRect: { // modern browsers support x/y, but older ones don't @@ -274,16 +226,12 @@ export interface ESQueueInstance { export type CreateJobFactory = ( reporting: ReportingCore, - server: ServerFacade, - elasticsearch: ElasticsearchServiceSetup, logger: LevelLogger ) => CreateJobFnType; export type ExecuteJobFactory = ( reporting: ReportingCore, - server: ServerFacade, - elasticsearch: ElasticsearchServiceSetup, logger: LevelLogger -) => Promise; +) => Promise; // FIXME: does not "need" to be async export interface ExportTypeDefinition< JobParamsType, diff --git a/x-pack/legacy/plugins/siem/cypress/integration/detections.spec.ts b/x-pack/legacy/plugins/siem/cypress/integration/detections.spec.ts index 646132c3f88eb..f38cb2285b480 100644 --- a/x-pack/legacy/plugins/siem/cypress/integration/detections.spec.ts +++ b/x-pack/legacy/plugins/siem/cypress/integration/detections.spec.ts @@ -42,16 +42,15 @@ describe('Detections', () => { cy.get(NUMBER_OF_SIGNALS) .invoke('text') .then(numberOfSignals => { - cy.get(SHOWING_SIGNALS) - .invoke('text') - .should('eql', `Showing ${numberOfSignals} signals`); + cy.get(SHOWING_SIGNALS).should('have.text', `Showing ${numberOfSignals} signals`); const numberOfSignalsToBeClosed = 3; selectNumberOfSignals(numberOfSignalsToBeClosed); - cy.get(SELECTED_SIGNALS) - .invoke('text') - .should('eql', `Selected ${numberOfSignalsToBeClosed} signals`); + cy.get(SELECTED_SIGNALS).should( + 'have.text', + `Selected ${numberOfSignalsToBeClosed} signals` + ); closeSignals(); waitForSignals(); @@ -59,30 +58,33 @@ describe('Detections', () => { waitForSignals(); const expectedNumberOfSignalsAfterClosing = +numberOfSignals - numberOfSignalsToBeClosed; - cy.get(NUMBER_OF_SIGNALS) - .invoke('text') - .should('eq', expectedNumberOfSignalsAfterClosing.toString()); - cy.get(SHOWING_SIGNALS) - .invoke('text') - .should('eql', `Showing ${expectedNumberOfSignalsAfterClosing.toString()} signals`); + cy.get(NUMBER_OF_SIGNALS).should( + 'have.text', + expectedNumberOfSignalsAfterClosing.toString() + ); + + cy.get(SHOWING_SIGNALS).should( + 'have.text', + `Showing ${expectedNumberOfSignalsAfterClosing.toString()} signals` + ); goToClosedSignals(); waitForSignals(); - cy.get(NUMBER_OF_SIGNALS) - .invoke('text') - .should('eql', numberOfSignalsToBeClosed.toString()); - cy.get(SHOWING_SIGNALS) - .invoke('text') - .should('eql', `Showing ${numberOfSignalsToBeClosed.toString()} signals`); + cy.get(NUMBER_OF_SIGNALS).should('have.text', numberOfSignalsToBeClosed.toString()); + cy.get(SHOWING_SIGNALS).should( + 'have.text', + `Showing ${numberOfSignalsToBeClosed.toString()} signals` + ); cy.get(SIGNALS).should('have.length', numberOfSignalsToBeClosed); const numberOfSignalsToBeOpened = 1; selectNumberOfSignals(numberOfSignalsToBeOpened); - cy.get(SELECTED_SIGNALS) - .invoke('text') - .should('eql', `Selected ${numberOfSignalsToBeOpened} signal`); + cy.get(SELECTED_SIGNALS).should( + 'have.text', + `Selected ${numberOfSignalsToBeOpened} signal` + ); openSignals(); waitForSignals(); @@ -93,15 +95,14 @@ describe('Detections', () => { waitForSignals(); const expectedNumberOfClosedSignalsAfterOpened = 2; - cy.get(NUMBER_OF_SIGNALS) - .invoke('text') - .should('eql', expectedNumberOfClosedSignalsAfterOpened.toString()); - cy.get(SHOWING_SIGNALS) - .invoke('text') - .should( - 'eql', - `Showing ${expectedNumberOfClosedSignalsAfterOpened.toString()} signals` - ); + cy.get(NUMBER_OF_SIGNALS).should( + 'have.text', + expectedNumberOfClosedSignalsAfterOpened.toString() + ); + cy.get(SHOWING_SIGNALS).should( + 'have.text', + `Showing ${expectedNumberOfClosedSignalsAfterOpened.toString()} signals` + ); cy.get(SIGNALS).should('have.length', expectedNumberOfClosedSignalsAfterOpened); goToOpenedSignals(); @@ -109,13 +110,15 @@ describe('Detections', () => { const expectedNumberOfOpenedSignals = +numberOfSignals - expectedNumberOfClosedSignalsAfterOpened; - cy.get(SHOWING_SIGNALS) - .invoke('text') - .should('eql', `Showing ${expectedNumberOfOpenedSignals.toString()} signals`); - - cy.get('[data-test-subj="server-side-event-count"]') - .invoke('text') - .should('eql', expectedNumberOfOpenedSignals.toString()); + cy.get(SHOWING_SIGNALS).should( + 'have.text', + `Showing ${expectedNumberOfOpenedSignals.toString()} signals` + ); + + cy.get('[data-test-subj="server-side-event-count"]').should( + 'have.text', + expectedNumberOfOpenedSignals.toString() + ); }); }); diff --git a/x-pack/legacy/plugins/siem/cypress/screens/detections.ts b/x-pack/legacy/plugins/siem/cypress/screens/detections.ts index f388ac1215d01..cb776be8d7b6b 100644 --- a/x-pack/legacy/plugins/siem/cypress/screens/detections.ts +++ b/x-pack/legacy/plugins/siem/cypress/screens/detections.ts @@ -10,7 +10,7 @@ export const LOADING_SIGNALS_PANEL = '[data-test-subj="loading-signals-panel"]'; export const MANAGE_SIGNAL_DETECTION_RULES_BTN = '[data-test-subj="manage-signal-detection-rules"]'; -export const NUMBER_OF_SIGNALS = '[data-test-subj="server-side-event-count"]'; +export const NUMBER_OF_SIGNALS = '[data-test-subj="server-side-event-count"] .euiBadge__text'; export const OPEN_CLOSE_SIGNAL_BTN = '[data-test-subj="update-signal-status-button"]'; diff --git a/x-pack/legacy/plugins/siem/public/components/ml_popover/ml_popover.tsx b/x-pack/legacy/plugins/siem/public/components/ml_popover/ml_popover.tsx index 05dfd561b1f5e..b00eef79ee480 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml_popover/ml_popover.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml_popover/ml_popover.tsx @@ -7,13 +7,13 @@ import { EuiButtonEmpty, EuiCallOut, EuiPopover, EuiPopoverTitle, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import moment from 'moment'; -import React, { useReducer, useState } from 'react'; +import React, { Dispatch, useCallback, useReducer, useState } from 'react'; import styled from 'styled-components'; import { useKibana } from '../../lib/kibana'; import { METRIC_TYPE, TELEMETRY_EVENT, track } from '../../lib/telemetry'; import { hasMlAdminPermissions } from '../ml/permissions/has_ml_admin_permissions'; -import { errorToToaster, useStateToaster } from '../toasters'; +import { errorToToaster, useStateToaster, ActionToaster } from '../toasters'; import { setupMlJob, startDatafeeds, stopDatafeeds } from './api'; import { filterJobs } from './helpers'; import { useSiemJobs } from './hooks/use_siem_jobs'; @@ -22,7 +22,7 @@ import { JobsTable } from './jobs_table/jobs_table'; import { ShowingCount } from './jobs_table/showing_count'; import { PopoverDescription } from './popover_description'; import * as i18n from './translations'; -import { JobsFilters, JobSummary, SiemJob } from './types'; +import { JobsFilters, SiemJob } from './types'; import { UpgradeContents } from './upgrade_contents'; import { useMlCapabilities } from './hooks/use_ml_capabilities'; @@ -34,15 +34,10 @@ PopoverContentsDiv.displayName = 'PopoverContentsDiv'; interface State { isLoading: boolean; - jobs: JobSummary[]; refreshToggle: boolean; } -type Action = - | { type: 'refresh' } - | { type: 'loading' } - | { type: 'success'; results: JobSummary[] } - | { type: 'failure' }; +type Action = { type: 'refresh' } | { type: 'loading' } | { type: 'success' } | { type: 'failure' }; function mlPopoverReducer(state: State, action: Action): State { switch (action.type) { @@ -62,14 +57,12 @@ function mlPopoverReducer(state: State, action: Action): State { return { ...state, isLoading: false, - jobs: action.results, }; } case 'failure': { return { ...state, isLoading: false, - jobs: [], }; } default: @@ -79,7 +72,6 @@ function mlPopoverReducer(state: State, action: Action): State { const initialState: State = { isLoading: false, - jobs: [], refreshToggle: true, }; @@ -91,7 +83,7 @@ const defaultFilterProps: JobsFilters = { }; export const MlPopover = React.memo(() => { - const [{ refreshToggle }, dispatch] = useReducer(mlPopoverReducer, initialState); + const [{ isLoading, refreshToggle }, dispatch] = useReducer(mlPopoverReducer, initialState); const [isPopoverOpen, setIsPopoverOpen] = useState(false); const [filterProperties, setFilterProperties] = useState(defaultFilterProps); @@ -99,50 +91,11 @@ export const MlPopover = React.memo(() => { const [, dispatchToaster] = useStateToaster(); const capabilities = useMlCapabilities(); const docLinks = useKibana().services.docLinks; - - // Enable/Disable Job & Datafeed -- passed to JobsTable for use as callback on JobSwitch - const enableDatafeed = async (job: SiemJob, latestTimestampMs: number, enable: boolean) => { - submitTelemetry(job, enable); - - if (!job.isInstalled) { - try { - await setupMlJob({ - configTemplate: job.moduleId, - indexPatternName: job.defaultIndexPattern, - jobIdErrorFilter: [job.id], - groups: job.groups, - }); - } catch (error) { - errorToToaster({ title: i18n.CREATE_JOB_FAILURE, error, dispatchToaster }); - dispatch({ type: 'refresh' }); - return; - } - } - - // Max start time for job is no more than two weeks ago to ensure job performance - const maxStartTime = moment - .utc() - .subtract(14, 'days') - .valueOf(); - - if (enable) { - const startTime = Math.max(latestTimestampMs, maxStartTime); - try { - await startDatafeeds({ datafeedIds: [`datafeed-${job.id}`], start: startTime }); - } catch (error) { - track(METRIC_TYPE.COUNT, TELEMETRY_EVENT.JOB_ENABLE_FAILURE); - errorToToaster({ title: i18n.START_JOB_FAILURE, error, dispatchToaster }); - } - } else { - try { - await stopDatafeeds({ datafeedIds: [`datafeed-${job.id}`] }); - } catch (error) { - track(METRIC_TYPE.COUNT, TELEMETRY_EVENT.JOB_DISABLE_FAILURE); - errorToToaster({ title: i18n.STOP_JOB_FAILURE, error, dispatchToaster }); - } - } - dispatch({ type: 'refresh' }); - }; + const handleJobStateChange = useCallback( + (job: SiemJob, latestTimestampMs: number, enable: boolean) => + enableDatafeed(job, latestTimestampMs, enable, dispatch, dispatchToaster), + [dispatch, dispatchToaster] + ); const filteredJobs = filterJobs({ jobs: siemJobs, @@ -239,9 +192,9 @@ export const MlPopover = React.memo(() => { )} @@ -252,6 +205,59 @@ export const MlPopover = React.memo(() => { } }); +// Enable/Disable Job & Datafeed -- passed to JobsTable for use as callback on JobSwitch +const enableDatafeed = async ( + job: SiemJob, + latestTimestampMs: number, + enable: boolean, + dispatch: Dispatch, + dispatchToaster: Dispatch +) => { + submitTelemetry(job, enable); + + if (!job.isInstalled) { + dispatch({ type: 'loading' }); + try { + await setupMlJob({ + configTemplate: job.moduleId, + indexPatternName: job.defaultIndexPattern, + jobIdErrorFilter: [job.id], + groups: job.groups, + }); + dispatch({ type: 'success' }); + } catch (error) { + errorToToaster({ title: i18n.CREATE_JOB_FAILURE, error, dispatchToaster }); + dispatch({ type: 'failure' }); + dispatch({ type: 'refresh' }); + return; + } + } + + // Max start time for job is no more than two weeks ago to ensure job performance + const maxStartTime = moment + .utc() + .subtract(14, 'days') + .valueOf(); + + if (enable) { + const startTime = Math.max(latestTimestampMs, maxStartTime); + try { + await startDatafeeds({ datafeedIds: [`datafeed-${job.id}`], start: startTime }); + } catch (error) { + track(METRIC_TYPE.COUNT, TELEMETRY_EVENT.JOB_ENABLE_FAILURE); + errorToToaster({ title: i18n.START_JOB_FAILURE, error, dispatchToaster }); + } + } else { + try { + await stopDatafeeds({ datafeedIds: [`datafeed-${job.id}`] }); + } catch (error) { + track(METRIC_TYPE.COUNT, TELEMETRY_EVENT.JOB_DISABLE_FAILURE); + errorToToaster({ title: i18n.STOP_JOB_FAILURE, error, dispatchToaster }); + } + } + dispatch({ type: 'refresh' }); +}; + const submitTelemetry = (job: SiemJob, enabled: boolean) => { // Report type of job enabled/disabled track( diff --git a/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/use_pre_packaged_rules.test.tsx b/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/use_pre_packaged_rules.test.tsx index 426a1ab9238dc..4d9e283bfb9cc 100644 --- a/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/use_pre_packaged_rules.test.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/use_pre_packaged_rules.test.tsx @@ -22,7 +22,6 @@ describe('usePersistRule', () => { usePrePackagedRules({ canUserCRUD: null, hasIndexWrite: null, - hasManageApiKey: null, isAuthenticated: null, hasEncryptionKey: null, isSignalIndexExists: null, @@ -50,7 +49,6 @@ describe('usePersistRule', () => { usePrePackagedRules({ canUserCRUD: null, hasIndexWrite: null, - hasManageApiKey: null, isAuthenticated: null, hasEncryptionKey: null, isSignalIndexExists: null, @@ -79,7 +77,6 @@ describe('usePersistRule', () => { usePrePackagedRules({ canUserCRUD: true, hasIndexWrite: true, - hasManageApiKey: true, isAuthenticated: true, hasEncryptionKey: true, isSignalIndexExists: true, @@ -116,7 +113,6 @@ describe('usePersistRule', () => { usePrePackagedRules({ canUserCRUD: true, hasIndexWrite: true, - hasManageApiKey: true, isAuthenticated: true, hasEncryptionKey: true, isSignalIndexExists: true, @@ -139,7 +135,6 @@ describe('usePersistRule', () => { usePrePackagedRules({ canUserCRUD: false, hasIndexWrite: true, - hasManageApiKey: true, isAuthenticated: true, hasEncryptionKey: true, isSignalIndexExists: true, @@ -161,29 +156,6 @@ describe('usePersistRule', () => { usePrePackagedRules({ canUserCRUD: true, hasIndexWrite: false, - hasManageApiKey: true, - isAuthenticated: true, - hasEncryptionKey: true, - isSignalIndexExists: true, - }) - ); - await waitForNextUpdate(); - await waitForNextUpdate(); - let resp = null; - if (result.current.createPrePackagedRules) { - resp = await result.current.createPrePackagedRules(); - } - expect(resp).toEqual(false); - }); - }); - - test('can NOT createPrePackagedRules because hasManageApiKey === false', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => - usePrePackagedRules({ - canUserCRUD: true, - hasIndexWrite: true, - hasManageApiKey: false, isAuthenticated: true, hasEncryptionKey: true, isSignalIndexExists: true, @@ -205,7 +177,6 @@ describe('usePersistRule', () => { usePrePackagedRules({ canUserCRUD: true, hasIndexWrite: true, - hasManageApiKey: true, isAuthenticated: false, hasEncryptionKey: true, isSignalIndexExists: true, @@ -227,7 +198,6 @@ describe('usePersistRule', () => { usePrePackagedRules({ canUserCRUD: true, hasIndexWrite: true, - hasManageApiKey: true, isAuthenticated: true, hasEncryptionKey: false, isSignalIndexExists: true, @@ -249,7 +219,6 @@ describe('usePersistRule', () => { usePrePackagedRules({ canUserCRUD: true, hasIndexWrite: true, - hasManageApiKey: true, isAuthenticated: true, hasEncryptionKey: true, isSignalIndexExists: false, diff --git a/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/use_pre_packaged_rules.tsx b/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/use_pre_packaged_rules.tsx index 0dd95bea8a0b2..44d5de10e361a 100644 --- a/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/use_pre_packaged_rules.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/use_pre_packaged_rules.tsx @@ -26,7 +26,6 @@ export interface ReturnPrePackagedRules { interface UsePrePackagedRuleProps { canUserCRUD: boolean | null; hasIndexWrite: boolean | null; - hasManageApiKey: boolean | null; isAuthenticated: boolean | null; hasEncryptionKey: boolean | null; isSignalIndexExists: boolean | null; @@ -36,7 +35,6 @@ interface UsePrePackagedRuleProps { * Hook for using to get status about pre-packaged Rules from the Detection Engine API * * @param hasIndexWrite boolean - * @param hasManageApiKey boolean * @param isAuthenticated boolean * @param hasEncryptionKey boolean * @param isSignalIndexExists boolean @@ -45,7 +43,6 @@ interface UsePrePackagedRuleProps { export const usePrePackagedRules = ({ canUserCRUD, hasIndexWrite, - hasManageApiKey, isAuthenticated, hasEncryptionKey, isSignalIndexExists, @@ -117,7 +114,6 @@ export const usePrePackagedRules = ({ if ( canUserCRUD && hasIndexWrite && - hasManageApiKey && isAuthenticated && hasEncryptionKey && isSignalIndexExists @@ -185,14 +181,7 @@ export const usePrePackagedRules = ({ isSubscribed = false; abortCtrl.abort(); }; - }, [ - canUserCRUD, - hasIndexWrite, - hasManageApiKey, - isAuthenticated, - hasEncryptionKey, - isSignalIndexExists, - ]); + }, [canUserCRUD, hasIndexWrite, isAuthenticated, hasEncryptionKey, isSignalIndexExists]); return { loading, diff --git a/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/use_rule_status.tsx b/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/use_rule_status.tsx index 0d37cce1fd85c..412fc0706b151 100644 --- a/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/use_rule_status.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/use_rule_status.tsx @@ -16,7 +16,7 @@ type Func = (ruleId: string) => void; export type ReturnRuleStatus = [boolean, RuleStatus | null, Func | null]; export interface ReturnRulesStatuses { loading: boolean; - rulesStatuses: RuleStatusRowItemType[] | null; + rulesStatuses: RuleStatusRowItemType[]; } /** diff --git a/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/mock.ts b/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/mock.ts index 37e93b1481e15..6b0c7e0078268 100644 --- a/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/mock.ts +++ b/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/mock.ts @@ -992,7 +992,6 @@ export const mockUserPrivilege: Privilege = { monitor_watcher: true, monitor_transform: true, read_ilm: true, - manage_api_key: true, manage_security: true, manage_own_api_key: false, manage_saml: true, diff --git a/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/types.ts b/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/types.ts index d90f94d32001d..4e97c597546a7 100644 --- a/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/types.ts +++ b/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/types.ts @@ -54,7 +54,6 @@ export interface Privilege { monitor_watcher: boolean; monitor_transform: boolean; read_ilm: boolean; - manage_api_key: boolean; manage_security: boolean; manage_own_api_key: boolean; manage_saml: boolean; diff --git a/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/use_privilege_user.test.tsx b/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/use_privilege_user.test.tsx index 2682742960442..c248223c6b81b 100644 --- a/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/use_privilege_user.test.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/use_privilege_user.test.tsx @@ -21,7 +21,6 @@ describe('usePrivilegeUser', () => { hasEncryptionKey: null, hasIndexManage: null, hasIndexWrite: null, - hasManageApiKey: null, isAuthenticated: null, loading: true, }); @@ -39,7 +38,6 @@ describe('usePrivilegeUser', () => { hasEncryptionKey: true, hasIndexManage: true, hasIndexWrite: true, - hasManageApiKey: true, isAuthenticated: true, loading: false, }); @@ -61,7 +59,6 @@ describe('usePrivilegeUser', () => { hasEncryptionKey: false, hasIndexManage: false, hasIndexWrite: false, - hasManageApiKey: false, isAuthenticated: false, loading: false, }); diff --git a/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/use_privilege_user.tsx b/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/use_privilege_user.tsx index c58e62c062fae..140dd1544b12b 100644 --- a/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/use_privilege_user.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/use_privilege_user.tsx @@ -15,7 +15,6 @@ export interface ReturnPrivilegeUser { isAuthenticated: boolean | null; hasEncryptionKey: boolean | null; hasIndexManage: boolean | null; - hasManageApiKey: boolean | null; hasIndexWrite: boolean | null; } /** @@ -27,17 +26,12 @@ export const usePrivilegeUser = (): ReturnPrivilegeUser => { const [privilegeUser, setPrivilegeUser] = useState< Pick< ReturnPrivilegeUser, - | 'isAuthenticated' - | 'hasEncryptionKey' - | 'hasIndexManage' - | 'hasManageApiKey' - | 'hasIndexWrite' + 'isAuthenticated' | 'hasEncryptionKey' | 'hasIndexManage' | 'hasIndexWrite' > >({ isAuthenticated: null, hasEncryptionKey: null, hasIndexManage: null, - hasManageApiKey: null, hasIndexWrite: null, }); const [, dispatchToaster] = useStateToaster(); @@ -65,10 +59,6 @@ export const usePrivilegeUser = (): ReturnPrivilegeUser => { privilege.index[indexName].create_doc || privilege.index[indexName].index || privilege.index[indexName].write, - hasManageApiKey: - privilege.cluster.manage_security || - privilege.cluster.manage_api_key || - privilege.cluster.manage_own_api_key, }); } } @@ -78,7 +68,6 @@ export const usePrivilegeUser = (): ReturnPrivilegeUser => { isAuthenticated: false, hasEncryptionKey: false, hasIndexManage: false, - hasManageApiKey: false, hasIndexWrite: false, }); errorToToaster({ title: i18n.PRIVILEGE_FETCH_FAILURE, error, dispatchToaster }); diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/components/user_info/index.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/components/user_info/index.tsx index a96913f2ad541..9e45371fb6058 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/components/user_info/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/components/user_info/index.tsx @@ -15,7 +15,6 @@ export interface State { canUserCRUD: boolean | null; hasIndexManage: boolean | null; hasIndexWrite: boolean | null; - hasManageApiKey: boolean | null; isSignalIndexExists: boolean | null; isAuthenticated: boolean | null; hasEncryptionKey: boolean | null; @@ -27,7 +26,6 @@ const initialState: State = { canUserCRUD: null, hasIndexManage: null, hasIndexWrite: null, - hasManageApiKey: null, isSignalIndexExists: null, isAuthenticated: null, hasEncryptionKey: null, @@ -37,10 +35,6 @@ const initialState: State = { export type Action = | { type: 'updateLoading'; loading: boolean } - | { - type: 'updateHasManageApiKey'; - hasManageApiKey: boolean | null; - } | { type: 'updateHasIndexManage'; hasIndexManage: boolean | null; @@ -90,12 +84,6 @@ export const userInfoReducer = (state: State, action: Action): State => { hasIndexWrite: action.hasIndexWrite, }; } - case 'updateHasManageApiKey': { - return { - ...state, - hasManageApiKey: action.hasManageApiKey, - }; - } case 'updateIsSignalIndexExists': { return { ...state, @@ -151,7 +139,6 @@ export const useUserInfo = (): State => { canUserCRUD, hasIndexManage, hasIndexWrite, - hasManageApiKey, isSignalIndexExists, isAuthenticated, hasEncryptionKey, @@ -166,7 +153,6 @@ export const useUserInfo = (): State => { hasEncryptionKey: isApiEncryptionKey, hasIndexManage: hasApiIndexManage, hasIndexWrite: hasApiIndexWrite, - hasManageApiKey: hasApiManageApiKey, } = usePrivilegeUser(); const { loading: indexNameLoading, @@ -197,12 +183,6 @@ export const useUserInfo = (): State => { } }, [loading, hasIndexWrite, hasApiIndexWrite]); - useEffect(() => { - if (!loading && hasManageApiKey !== hasApiManageApiKey && hasApiManageApiKey != null) { - dispatch({ type: 'updateHasManageApiKey', hasManageApiKey: hasApiManageApiKey }); - } - }, [loading, hasManageApiKey, hasApiManageApiKey]); - useEffect(() => { if ( !loading && @@ -258,7 +238,6 @@ export const useUserInfo = (): State => { canUserCRUD, hasIndexManage, hasIndexWrite, - hasManageApiKey, signalIndexName, }; }; diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/all/columns.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/all/columns.tsx index 5157bd81403e2..9a84d33ab5fdf 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/all/columns.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/all/columns.tsx @@ -81,8 +81,8 @@ export type RuleStatusRowItemType = RuleStatus & { name: string; id: string; }; -type RulesColumns = EuiBasicTableColumn | EuiTableActionsColumnType; -type RulesStatusesColumns = EuiBasicTableColumn; +export type RulesColumns = EuiBasicTableColumn | EuiTableActionsColumnType; +export type RulesStatusesColumns = EuiBasicTableColumn; interface GetColumns { dispatch: React.Dispatch; diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/all/index.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/all/index.tsx index 1a98272546440..ccdfd1ed1be38 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/all/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/all/index.tsx @@ -31,7 +31,7 @@ import { Loader } from '../../../../components/loader'; import { Panel } from '../../../../components/panel'; import { PrePackagedRulesPrompt } from '../components/pre_packaged_rules/load_empty_prompt'; import { GenericDownloader } from '../../../../components/generic_downloader'; -import { AllRulesTables } from '../components/all_rules_tables'; +import { AllRulesTables, SortingType } from '../components/all_rules_tables'; import { getPrePackagedRuleStatus } from '../helpers'; import * as i18n from '../translations'; import { EuiBasicTableOnChange } from '../types'; @@ -128,7 +128,7 @@ export const AllRules = React.memo( }); const sorting = useMemo( - () => ({ sort: { field: 'enabled', direction: filterOptions.sortOrder } }), + (): SortingType => ({ sort: { field: 'enabled', direction: filterOptions.sortOrder } }), [filterOptions.sortOrder] ); @@ -330,7 +330,7 @@ export const AllRules = React.memo( euiBasicTableSelectionProps={euiBasicTableSelectionProps} hasNoPermissions={hasNoPermissions} monitoringColumns={monitoringColumns} - paginationMemo={paginationMemo} + pagination={paginationMemo} rules={rules} rulesColumns={rulesColumns} rulesStatuses={rulesStatuses} diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/all_rules_tables/index.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/all_rules_tables/index.tsx index 0fd07f30a00b6..31aaa426e4f3b 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/all_rules_tables/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/all_rules_tables/index.tsx @@ -4,30 +4,59 @@ * you may not use this file except in compliance with the Elastic License. */ -import { EuiBasicTable, EuiTab, EuiTabs, EuiEmptyPrompt } from '@elastic/eui'; +import { + EuiBasicTable, + EuiBasicTableColumn, + EuiTab, + EuiTabs, + EuiEmptyPrompt, + Direction, + EuiTableSelectionType, +} from '@elastic/eui'; import React, { useMemo, memo, useState } from 'react'; import styled from 'styled-components'; +import { EuiBasicTableOnChange } from '../../types'; import * as i18n from '../../translations'; -import { RuleStatusRowItemType } from '../../../../../pages/detection_engine/rules/all/columns'; -import { Rules } from '../../../../../containers/detection_engine/rules'; +import { + RulesColumns, + RuleStatusRowItemType, +} from '../../../../../pages/detection_engine/rules/all/columns'; +import { Rule, Rules } from '../../../../../containers/detection_engine/rules'; // EuiBasicTable give me a hardtime with adding the ref attributes so I went the easy way // after few hours of fight with typescript !!!! I lost :( // eslint-disable-next-line @typescript-eslint/no-explicit-any const MyEuiBasicTable = styled(EuiBasicTable as any)`` as any; +export interface SortingType { + sort: { + field: 'enabled'; + direction: Direction; + }; +} + interface AllRulesTablesProps { - euiBasicTableSelectionProps: unknown; + euiBasicTableSelectionProps: EuiTableSelectionType; hasNoPermissions: boolean; - monitoringColumns: unknown; - paginationMemo: unknown; + monitoringColumns: Array>; + pagination: { + pageIndex: number; + pageSize: number; + totalItemCount: number; + pageSizeOptions: number[]; + }; rules: Rules; - rulesColumns: unknown; - rulesStatuses: RuleStatusRowItemType[] | null; - sorting: unknown; - tableOnChangeCallback: unknown; - tableRef?: unknown; + rulesColumns: RulesColumns[]; + rulesStatuses: RuleStatusRowItemType[]; + sorting: { + sort: { + field: 'enabled'; + direction: Direction; + }; + }; + tableOnChangeCallback: ({ page, sort }: EuiBasicTableOnChange) => void; + tableRef?: React.MutableRefObject; } enum AllRulesTabs { @@ -52,7 +81,7 @@ const AllRulesTablesComponent: React.FC = ({ euiBasicTableSelectionProps, hasNoPermissions, monitoringColumns, - paginationMemo, + pagination, rules, rulesColumns, rulesStatuses, @@ -95,7 +124,7 @@ const AllRulesTablesComponent: React.FC = ({ items={rules ?? []} noItemsMessage={emptyPrompt} onChange={tableOnChangeCallback} - pagination={paginationMemo} + pagination={pagination} ref={tableRef} sorting={sorting} selection={hasNoPermissions ? undefined : euiBasicTableSelectionProps} @@ -110,7 +139,7 @@ const AllRulesTablesComponent: React.FC = ({ items={rulesStatuses} noItemsMessage={emptyPrompt} onChange={tableOnChangeCallback} - pagination={paginationMemo} + pagination={pagination} sorting={sorting} /> )} diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/rule_actions_overflow/__snapshots__/index.test.tsx.snap b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/rule_actions_overflow/__snapshots__/index.test.tsx.snap index 65a606604d4a7..1bee36ed9e185 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/rule_actions_overflow/__snapshots__/index.test.tsx.snap +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/rule_actions_overflow/__snapshots__/index.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`RuleActionsOverflow renders correctly against snapshot 1`] = ` +exports[`RuleActionsOverflow snapshots renders correctly against snapshot 1`] = ` } closePopover={[Function]} + data-test-subj="rules-details-popover" display="inlineBlock" hasArrow={true} id="ruleActionsOverflow" @@ -27,24 +29,28 @@ exports[`RuleActionsOverflow renders correctly against snapshot 1`] = ` panelPaddingSize="none" > Duplicate rule… , Export rule , ({ }), })); +jest.mock('../../all/actions', () => ({ + deleteRulesAction: jest.fn(), + duplicateRulesAction: jest.fn(), +})); + describe('RuleActionsOverflow', () => { - test('renders correctly against snapshot', () => { - const wrapper = shallow( - - ); - expect(wrapper).toMatchSnapshot(); + describe('snapshots', () => { + test('renders correctly against snapshot', () => { + const wrapper = shallow( + + ); + expect(wrapper).toMatchSnapshot(); + }); + }); + + describe('rules details menu panel', () => { + test('there is at least one item when there is a rule within the rules-details-menu-panel', () => { + const wrapper = mount( + + ); + wrapper.find('[data-test-subj="rules-details-popover-button-icon"] button').simulate('click'); + wrapper.update(); + const items: unknown[] = wrapper + .find('[data-test-subj="rules-details-menu-panel"]') + .first() + .prop('items'); + + expect(items.length).toBeGreaterThan(0); + }); + + test('items are empty when there is a null rule within the rules-details-menu-panel', () => { + const wrapper = mount(); + wrapper.find('[data-test-subj="rules-details-popover-button-icon"] button').simulate('click'); + wrapper.update(); + expect( + wrapper + .find('[data-test-subj="rules-details-menu-panel"]') + .first() + .prop('items') + ).toEqual([]); + }); + + test('items are empty when there is an undefined rule within the rules-details-menu-panel', () => { + const wrapper = mount(); + wrapper.find('[data-test-subj="rules-details-popover-button-icon"] button').simulate('click'); + wrapper.update(); + expect( + wrapper + .find('[data-test-subj="rules-details-menu-panel"]') + .first() + .prop('items') + ).toEqual([]); + }); + + test('it opens the popover when rules-details-popover-button-icon is clicked', () => { + const wrapper = mount( + + ); + wrapper.find('[data-test-subj="rules-details-popover-button-icon"] button').simulate('click'); + wrapper.update(); + expect( + wrapper + .find('[data-test-subj="rules-details-popover"]') + .first() + .prop('isOpen') + ).toEqual(true); + }); + }); + + describe('rules details pop over button icon', () => { + test('it does not open the popover when rules-details-popover-button-icon is clicked when the user does not have permission', () => { + const wrapper = mount( + + ); + wrapper.find('[data-test-subj="rules-details-popover-button-icon"] button').simulate('click'); + wrapper.update(); + expect( + wrapper + .find('[data-test-subj="rules-details-popover"]') + .first() + .prop('isOpen') + ).toEqual(false); + }); + }); + + describe('rules details duplicate rule', () => { + test('it does not open the popover when rules-details-popover-button-icon is clicked and the user does not have permission', () => { + const rule = mockRule('id'); + const wrapper = mount(); + wrapper.find('[data-test-subj="rules-details-popover-button-icon"] button').simulate('click'); + wrapper.update(); + expect(wrapper.find('[data-test-subj="rules-details-delete-rule"] button').exists()).toEqual( + false + ); + }); + + test('it opens the popover when rules-details-popover-button-icon is clicked', () => { + const wrapper = mount( + + ); + wrapper.find('[data-test-subj="rules-details-popover-button-icon"] button').simulate('click'); + wrapper.update(); + expect( + wrapper + .find('[data-test-subj="rules-details-popover"]') + .first() + .prop('isOpen') + ).toEqual(true); + }); + + test('it closes the popover when rules-details-duplicate-rule is clicked', () => { + const wrapper = mount( + + ); + wrapper.find('[data-test-subj="rules-details-popover-button-icon"] button').simulate('click'); + wrapper.update(); + wrapper.find('[data-test-subj="rules-details-duplicate-rule"] button').simulate('click'); + wrapper.update(); + expect( + wrapper + .find('[data-test-subj="rules-details-popover"]') + .first() + .prop('isOpen') + ).toEqual(false); + }); + + test('it calls duplicateRulesAction when rules-details-duplicate-rule is clicked', () => { + const wrapper = mount( + + ); + wrapper.find('[data-test-subj="rules-details-popover-button-icon"] button').simulate('click'); + wrapper.update(); + wrapper.find('[data-test-subj="rules-details-duplicate-rule"] button').simulate('click'); + wrapper.update(); + expect(duplicateRulesAction).toHaveBeenCalled(); + }); + + test('it calls duplicateRulesAction with the rule and rule.id when rules-details-duplicate-rule is clicked', () => { + const rule = mockRule('id'); + const wrapper = mount(); + wrapper.find('[data-test-subj="rules-details-popover-button-icon"] button').simulate('click'); + wrapper.update(); + wrapper.find('[data-test-subj="rules-details-duplicate-rule"] button').simulate('click'); + wrapper.update(); + expect(duplicateRulesAction).toHaveBeenCalledWith( + [rule], + [rule.id], + expect.anything(), + expect.anything() + ); + }); + }); + + describe('rules details export rule', () => { + test('it does not open the popover when rules-details-popover-button-icon is clicked and the user does not have permission', () => { + const rule = mockRule('id'); + const wrapper = mount(); + wrapper.find('[data-test-subj="rules-details-popover-button-icon"] button').simulate('click'); + wrapper.update(); + expect(wrapper.find('[data-test-subj="rules-details-export-rule"] button').exists()).toEqual( + false + ); + }); + + test('it closes the popover when rules-details-export-rule is clicked', () => { + const wrapper = mount( + + ); + wrapper.find('[data-test-subj="rules-details-popover-button-icon"] button').simulate('click'); + wrapper.update(); + wrapper.find('[data-test-subj="rules-details-export-rule"] button').simulate('click'); + wrapper.update(); + expect( + wrapper + .find('[data-test-subj="rules-details-popover"]') + .first() + .prop('isOpen') + ).toEqual(false); + }); + + test('it sets the rule.rule_id on the generic downloader when rules-details-export-rule is clicked', () => { + const rule = mockRule('id'); + const wrapper = mount(); + wrapper.find('[data-test-subj="rules-details-popover-button-icon"] button').simulate('click'); + wrapper.update(); + wrapper.find('[data-test-subj="rules-details-export-rule"] button').simulate('click'); + wrapper.update(); + expect( + wrapper.find('[data-test-subj="rules-details-generic-downloader"]').prop('ids') + ).toEqual([rule.rule_id]); + }); + + test('it does not close the pop over on rules-details-export-rule when the rule is an immutable rule and the user does a click', () => { + const rule = mockRule('id'); + rule.immutable = true; + const wrapper = mount(); + wrapper.find('[data-test-subj="rules-details-popover-button-icon"] button').simulate('click'); + wrapper.update(); + wrapper.find('[data-test-subj="rules-details-export-rule"] button').simulate('click'); + wrapper.update(); + expect( + wrapper + .find('[data-test-subj="rules-details-popover"]') + .first() + .prop('isOpen') + ).toEqual(true); + }); + + test('it does not set the rule.rule_id on rules-details-export-rule when the rule is an immutable rule', () => { + const rule = mockRule('id'); + rule.immutable = true; + const wrapper = mount(); + wrapper.find('[data-test-subj="rules-details-popover-button-icon"] button').simulate('click'); + wrapper.update(); + wrapper.find('[data-test-subj="rules-details-export-rule"] button').simulate('click'); + wrapper.update(); + expect( + wrapper.find('[data-test-subj="rules-details-generic-downloader"]').prop('ids') + ).toEqual([]); + }); + }); + + describe('rules details delete rule', () => { + test('it does not open the popover when rules-details-popover-button-icon is clicked and the user does not have permission', () => { + const rule = mockRule('id'); + const wrapper = mount(); + wrapper.find('[data-test-subj="rules-details-popover-button-icon"] button').simulate('click'); + wrapper.update(); + expect(wrapper.find('[data-test-subj="rules-details-delete-rule"] button').exists()).toEqual( + false + ); + }); + + test('it closes the popover when rules-details-delete-rule is clicked', () => { + const wrapper = mount( + + ); + wrapper.find('[data-test-subj="rules-details-popover-button-icon"] button').simulate('click'); + wrapper.update(); + wrapper.find('[data-test-subj="rules-details-delete-rule"] button').simulate('click'); + wrapper.update(); + expect( + wrapper + .find('[data-test-subj="rules-details-popover"]') + .first() + .prop('isOpen') + ).toEqual(false); + }); + + test('it calls deleteRulesAction when rules-details-delete-rule is clicked', () => { + const wrapper = mount( + + ); + wrapper.find('[data-test-subj="rules-details-popover-button-icon"] button').simulate('click'); + wrapper.update(); + wrapper.find('[data-test-subj="rules-details-delete-rule"] button').simulate('click'); + wrapper.update(); + expect(deleteRulesAction).toHaveBeenCalled(); + }); + + test('it calls deleteRulesAction with the rule.id when rules-details-delete-rule is clicked', () => { + const rule = mockRule('id'); + const wrapper = mount(); + wrapper.find('[data-test-subj="rules-details-popover-button-icon"] button').simulate('click'); + wrapper.update(); + wrapper.find('[data-test-subj="rules-details-delete-rule"] button').simulate('click'); + wrapper.update(); + expect(deleteRulesAction).toHaveBeenCalledWith( + [rule.id], + expect.anything(), + expect.anything(), + expect.anything() + ); + }); }); }); diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/rule_actions_overflow/index.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/rule_actions_overflow/index.tsx index e1ca84ed8cc64..a7ce0c85ffdcf 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/rule_actions_overflow/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/rule_actions_overflow/index.tsx @@ -62,8 +62,9 @@ const RuleActionsOverflowComponent = ({ ? [ { setIsPopoverOpen(false); await duplicateRulesAction([rule], [rule.id], noop, dispatchToaster); @@ -73,11 +74,12 @@ const RuleActionsOverflowComponent = ({ , { setIsPopoverOpen(false); - setRulesToExport([rule.id]); + setRulesToExport([rule.rule_id]); }} > {i18nActions.EXPORT_RULE} @@ -86,6 +88,7 @@ const RuleActionsOverflowComponent = ({ key={i18nActions.DELETE_RULE} icon="trash" disabled={userHasNoPermissions} + data-test-subj="rules-details-delete-rule" onClick={async () => { setIsPopoverOpen(false); await deleteRulesAction([rule.id], noop, dispatchToaster, onRuleDeletedCallback); @@ -109,6 +112,7 @@ const RuleActionsOverflowComponent = ({ iconType="boxesHorizontal" aria-label={i18n.ALL_ACTIONS} isDisabled={userHasNoPermissions} + data-test-subj="rules-details-popover-button-icon" onClick={handlePopoverOpen} /> @@ -124,15 +128,17 @@ const RuleActionsOverflowComponent = ({ closePopover={() => setIsPopoverOpen(false)} id="ruleActionsOverflow" isOpen={isPopoverOpen} + data-test-subj="rules-details-popover" ownFocus={true} panelPaddingSize="none" > - + { displaySuccessToast( i18nActions.SUCCESSFULLY_EXPORTED_RULES(exportCount), diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/create/index.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/create/index.tsx index 0335216672915..2686bb47925b6 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/create/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/create/index.tsx @@ -24,7 +24,7 @@ import { StepScheduleRule } from '../components/step_schedule_rule'; import { StepRuleActions } from '../components/step_rule_actions'; import { DetectionEngineHeaderPage } from '../../components/detection_engine_header_page'; import * as RuleI18n from '../translations'; -import { redirectToDetections, getActionMessageParams } from '../helpers'; +import { redirectToDetections, getActionMessageParams, userHasNoPermissions } from '../helpers'; import { AboutStepRule, DefineStepRule, @@ -85,7 +85,6 @@ const CreateRulePageComponent: React.FC = () => { isAuthenticated, hasEncryptionKey, canUserCRUD, - hasManageApiKey, } = useUserInfo(); const [, dispatchToaster] = useStateToaster(); const [openAccordionId, setOpenAccordionId] = useState(RuleStep.defineRule); @@ -117,8 +116,6 @@ const CreateRulePageComponent: React.FC = () => { getActionMessageParams((stepsData.current['define-rule'].data as DefineStepRule).ruleType), [stepsData.current['define-rule'].data] ); - const userHasNoPermissions = - canUserCRUD != null && hasManageApiKey != null ? !canUserCRUD || !hasManageApiKey : false; const setStepData = useCallback( (step: RuleStep, data: unknown, isValid: boolean) => { @@ -274,7 +271,7 @@ const CreateRulePageComponent: React.FC = () => { if (redirectToDetections(isSignalIndexExists, isAuthenticated, hasEncryptionKey)) { return ; - } else if (userHasNoPermissions) { + } else if (userHasNoPermissions(canUserCRUD)) { return ; } diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/details/index.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/details/index.tsx index b8e2310ef0614..cb4d88a8bb539 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/details/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/details/index.tsx @@ -53,7 +53,7 @@ import * as detectionI18n from '../../translations'; import { ReadOnlyCallOut } from '../components/read_only_callout'; import { RuleSwitch } from '../components/rule_switch'; import { StepPanel } from '../components/step_panel'; -import { getStepsData, redirectToDetections } from '../helpers'; +import { getStepsData, redirectToDetections, userHasNoPermissions } from '../helpers'; import * as ruleI18n from '../translations'; import * as i18n from './translations'; import { GlobalTime } from '../../../../containers/global_time'; @@ -96,7 +96,6 @@ const RuleDetailsPageComponent: FC = ({ isAuthenticated, hasEncryptionKey, canUserCRUD, - hasManageApiKey, hasIndexWrite, signalIndexName, } = useUserInfo(); @@ -115,8 +114,6 @@ const RuleDetailsPageComponent: FC = ({ scheduleRuleData: null, }; const [lastSignals] = useSignalInfo({ ruleId }); - const userHasNoPermissions = - canUserCRUD != null && hasManageApiKey != null ? !canUserCRUD || !hasManageApiKey : false; const title = isLoading === true || rule === null ? : rule.name; const subTitle = useMemo( @@ -227,7 +224,7 @@ const RuleDetailsPageComponent: FC = ({ return ( <> {hasIndexWrite != null && !hasIndexWrite && } - {userHasNoPermissions && } + {userHasNoPermissions(canUserCRUD) && } {({ indicesExist, indexPattern }) => { return indicesExistOrDataTemporarilyUnavailable(indicesExist) ? ( @@ -264,7 +261,7 @@ const RuleDetailsPageComponent: FC = ({ = ({ {ruleI18n.EDIT_RULE_SETTINGS} @@ -285,7 +282,7 @@ const RuleDetailsPageComponent: FC = ({ diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/edit/index.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/edit/index.tsx index 60d6158987a1d..c42e7b902cd5c 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/edit/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/edit/index.tsx @@ -33,7 +33,12 @@ import { StepDefineRule } from '../components/step_define_rule'; import { StepScheduleRule } from '../components/step_schedule_rule'; import { StepRuleActions } from '../components/step_rule_actions'; import { formatRule } from '../create/helpers'; -import { getStepsData, redirectToDetections, getActionMessageParams } from '../helpers'; +import { + getStepsData, + redirectToDetections, + getActionMessageParams, + userHasNoPermissions, +} from '../helpers'; import * as ruleI18n from '../translations'; import { RuleStep, @@ -69,14 +74,10 @@ const EditRulePageComponent: FC = () => { isAuthenticated, hasEncryptionKey, canUserCRUD, - hasManageApiKey, } = useUserInfo(); const { detailName: ruleId } = useParams(); const [loading, rule] = useRule(ruleId); - const userHasNoPermissions = - canUserCRUD != null && hasManageApiKey != null ? !canUserCRUD || !hasManageApiKey : false; - const [initForm, setInitForm] = useState(false); const [myAboutRuleForm, setMyAboutRuleForm] = useState({ data: null, @@ -346,7 +347,7 @@ const EditRulePageComponent: FC = () => { if (redirectToDetections(isSignalIndexExists, isAuthenticated, hasEncryptionKey)) { return ; - } else if (userHasNoPermissions) { + } else if (userHasNoPermissions(canUserCRUD)) { return ; } diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/helpers.test.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/helpers.test.tsx index 522464d585cca..443dbd2c93a35 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/helpers.test.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/helpers.test.tsx @@ -14,6 +14,7 @@ import { getHumanizedDuration, getModifiedAboutDetailsData, determineDetailsValue, + userHasNoPermissions, } from './helpers'; import { mockRuleWithEverything, mockRule } from './all/__mocks__/mock'; import { esFilters } from '../../../../../../../../src/plugins/data/public'; @@ -337,4 +338,27 @@ describe('rule helpers', () => { expect(result).toEqual(aboutRuleDetailsData); }); }); + + describe('userHasNoPermissions', () => { + test("returns false when user's CRUD operations are null", () => { + const result: boolean = userHasNoPermissions(null); + const userHasNoPermissionsExpectedResult = false; + + expect(result).toEqual(userHasNoPermissionsExpectedResult); + }); + + test('returns true when user cannot CRUD', () => { + const result: boolean = userHasNoPermissions(false); + const userHasNoPermissionsExpectedResult = true; + + expect(result).toEqual(userHasNoPermissionsExpectedResult); + }); + + test('returns false when user can CRUD', () => { + const result: boolean = userHasNoPermissions(true); + const userHasNoPermissionsExpectedResult = false; + + expect(result).toEqual(userHasNoPermissionsExpectedResult); + }); + }); }); diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/helpers.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/helpers.tsx index b6afba527ccdc..db1f2298b5ea7 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/helpers.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/helpers.tsx @@ -267,3 +267,7 @@ export const getActionMessageParams = memoizeOne((ruleType: RuleType | undefined ...actionMessageRuleParams.map(param => `context.rule.${param}`), ]; }); + +// typed as null not undefined as the initial state for this value is null. +export const userHasNoPermissions = (canUserCRUD: boolean | null): boolean => + canUserCRUD != null ? !canUserCRUD : false; diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/index.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/index.tsx index 2b93ec8b10112..8831bc77691fa 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/index.tsx @@ -23,7 +23,7 @@ import { AllRules } from './all'; import { ImportDataModal } from '../../../components/import_data_modal'; import { ReadOnlyCallOut } from './components/read_only_callout'; import { UpdatePrePackagedRulesCallOut } from './components/pre_packaged_rules/update_callout'; -import { getPrePackagedRuleStatus, redirectToDetections } from './helpers'; +import { getPrePackagedRuleStatus, redirectToDetections, userHasNoPermissions } from './helpers'; import * as i18n from './translations'; type Func = (refreshPrePackagedRule?: boolean) => void; @@ -38,7 +38,6 @@ const RulesPageComponent: React.FC = () => { hasEncryptionKey, canUserCRUD, hasIndexWrite, - hasManageApiKey, } = useUserInfo(); const { createPrePackagedRules, @@ -52,7 +51,6 @@ const RulesPageComponent: React.FC = () => { } = usePrePackagedRules({ canUserCRUD, hasIndexWrite, - hasManageApiKey, isSignalIndexExists, isAuthenticated, hasEncryptionKey, @@ -63,9 +61,6 @@ const RulesPageComponent: React.FC = () => { rulesNotUpdated ); - const userHasNoPermissions = - canUserCRUD != null && hasManageApiKey != null ? !canUserCRUD || !hasManageApiKey : false; - const handleRefreshRules = useCallback(async () => { if (refreshRulesData.current != null) { refreshRulesData.current(true); @@ -95,7 +90,7 @@ const RulesPageComponent: React.FC = () => { return ( <> - {userHasNoPermissions && } + {userHasNoPermissions(canUserCRUD) && } setShowImportModal(false)} @@ -125,7 +120,7 @@ const RulesPageComponent: React.FC = () => { {i18n.LOAD_PREPACKAGED_RULES} @@ -138,7 +133,7 @@ const RulesPageComponent: React.FC = () => { data-test-subj="reloadPrebuiltRulesBtn" iconType="plusInCircle" isLoading={loadingCreatePrePackagedRules} - isDisabled={userHasNoPermissions || loading} + isDisabled={userHasNoPermissions(canUserCRUD) || loading} onClick={handleCreatePrePackagedRules} > {i18n.RELOAD_MISSING_PREPACKAGED_RULES(rulesNotInstalled ?? 0)} @@ -148,7 +143,7 @@ const RulesPageComponent: React.FC = () => { { setShowImportModal(true); }} @@ -162,7 +157,7 @@ const RulesPageComponent: React.FC = () => { fill href={getCreateRuleUrl()} iconType="plusInCircle" - isDisabled={userHasNoPermissions || loading} + isDisabled={userHasNoPermissions(canUserCRUD) || loading} > {i18n.ADD_NEW_RULE} @@ -180,7 +175,7 @@ const RulesPageComponent: React.FC = () => { createPrePackagedRules={createPrePackagedRules} loading={loading || prePackagedRuleLoading} loadingCreatePrePackagedRules={loadingCreatePrePackagedRules} - hasNoPermissions={userHasNoPermissions} + hasNoPermissions={userHasNoPermissions(canUserCRUD)} refetchPrePackagedRulesStatus={handleRefetchPrePackagedRulesStatus} rulesCustomInstalled={rulesCustomInstalled} rulesInstalled={rulesInstalled} diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.ts b/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.ts index 27074be1b5cf4..246701e94c99a 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.ts +++ b/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.ts @@ -55,6 +55,7 @@ export const signalRulesAlertType = ({ index, filters, language, + maxSignals, meta, machineLearningJobId, outputIndex, @@ -63,6 +64,14 @@ export const signalRulesAlertType = ({ to, type, } = params; + const searchAfterSize = Math.min(maxSignals, DEFAULT_SEARCH_AFTER_PAGE_SIZE); + let hasError: boolean = false; + let result: SearchAfterAndBulkCreateReturnType = { + success: false, + bulkCreateTimes: [], + searchAfterTimes: [], + lastLookBackDate: null, + }; const ruleStatusClient = ruleStatusSavedObjectsClientFactory(services.savedObjectsClient); const ruleStatusService = await ruleStatusServiceFactory({ alertId, @@ -104,17 +113,10 @@ export const signalRulesAlertType = ({ ); logger.warn(gapMessage); + hasError = true; await ruleStatusService.error(gapMessage, { gap: gapString }); } - const searchAfterSize = Math.min(params.maxSignals, DEFAULT_SEARCH_AFTER_PAGE_SIZE); - let result: SearchAfterAndBulkCreateReturnType = { - success: false, - bulkCreateTimes: [], - searchAfterTimes: [], - lastLookBackDate: null, - }; - try { if (isMlRule(type)) { if (ml == null) { @@ -143,6 +145,7 @@ export const signalRulesAlertType = ({ `datafeed status: "${jobSummary?.datafeedState}"` ); logger.warn(errorMessage); + hasError = true; await ruleStatusService.error(errorMessage); } @@ -270,11 +273,13 @@ export const signalRulesAlertType = ({ } logger.debug(buildRuleMessage('[+] Signal Rule execution completed.')); - await ruleStatusService.success('succeeded', { - bulkCreateTimeDurations: result.bulkCreateTimes, - searchAfterTimeDurations: result.searchAfterTimes, - lastLookBackDate: result.lastLookBackDate?.toISOString(), - }); + if (!hasError) { + await ruleStatusService.success('succeeded', { + bulkCreateTimeDurations: result.bulkCreateTimes, + searchAfterTimeDurations: result.searchAfterTimes, + lastLookBackDate: result.lastLookBackDate?.toISOString(), + }); + } } else { const errorMessage = buildRuleMessage( 'Bulk Indexing of signals failed. Check logs for further details.' diff --git a/x-pack/legacy/plugins/uptime/common/types/ping/histogram.ts b/x-pack/legacy/plugins/uptime/common/types/ping/histogram.ts index a4e03a2b762c8..3ae32e15ca55c 100644 --- a/x-pack/legacy/plugins/uptime/common/types/ping/histogram.ts +++ b/x-pack/legacy/plugins/uptime/common/types/ping/histogram.ts @@ -5,15 +5,15 @@ */ export interface HistogramDataPoint { - upCount?: number | null; + upCount?: number; - downCount?: number | null; + downCount?: number; - x?: number | null; + x?: number; - x0?: number | null; + x0?: number; - y?: number | null; + y?: number; } export interface GetPingHistogramParams { diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/ping_histogram.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/charts/ping_histogram.tsx index 17fa8781b828b..f988afc7fc84d 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/charts/ping_histogram.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/charts/ping_histogram.tsx @@ -37,6 +37,12 @@ export interface PingHistogramComponentProps { loading?: boolean; } +interface BarPoint { + x?: number; + y?: number; + type: string; +} + export const PingHistogramComponent: React.FC = ({ absoluteStartDate, absoluteEndDate, @@ -65,8 +71,8 @@ export const PingHistogramComponent: React.FC = ({ } else { const { histogram } = data; - const downSpecId = i18n.translate('xpack.uptime.snapshotHistogram.downMonitorsId', { - defaultMessage: 'Down Monitors', + const downSpecId = i18n.translate('xpack.uptime.snapshotHistogram.series.downLabel', { + defaultMessage: 'Down', }); const upMonitorsId = i18n.translate('xpack.uptime.snapshotHistogram.series.upLabel', { @@ -79,6 +85,16 @@ export const PingHistogramComponent: React.FC = ({ dateRangeEnd: moment(max).toISOString(), }); }; + + const barData: BarPoint[] = []; + + histogram.forEach(({ x, upCount, downCount }) => { + barData.push( + { x, y: downCount ?? 0, type: downSpecId }, + { x, y: upCount ?? 0, type: upMonitorsId } + ); + }); + content = ( = ({ /> [x, downCount || 0])} + color={[danger, gray]} + data={barData} id={downSpecId} - name={i18n.translate('xpack.uptime.snapshotHistogram.series.downLabel', { - defaultMessage: 'Down', + name={i18n.translate('xpack.uptime.snapshotHistogram.series.pings', { + defaultMessage: 'Monitor Pings', })} - stackAccessors={[0]} - timeZone="local" - xAccessor={0} - xScaleType="time" - yAccessors={[1]} - yScaleType="linear" - /> - [x, upCount || 0])} - id={upMonitorsId} - name={upMonitorsId} - stackAccessors={[0]} + stackAccessors={['x']} + splitSeriesAccessors={['type']} timeZone="local" - xAccessor={0} + xAccessor="x" xScaleType="time" - yAccessors={[1]} + yAccessors={['y']} yScaleType="linear" /> diff --git a/x-pack/package.json b/x-pack/package.json index bbab1a96f52f4..24b23256bf18e 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -315,6 +315,7 @@ "react-portal": "^3.2.0", "react-redux": "^7.1.3", "react-reverse-portal": "^1.0.4", + "react-router": "^5.1.2", "react-router-dom": "^5.1.2", "react-shortcuts": "^2.0.0", "react-sticky": "^6.0.3", diff --git a/x-pack/plugins/actions/server/lib/license_state.mock.ts b/x-pack/plugins/actions/server/lib/license_state.mock.ts index 72a21f878a150..d59e9dbdc540f 100644 --- a/x-pack/plugins/actions/server/lib/license_state.mock.ts +++ b/x-pack/plugins/actions/server/lib/license_state.mock.ts @@ -5,7 +5,6 @@ */ import { ILicenseState } from './license_state'; -import { LICENSE_CHECK_STATE } from '../../../licensing/server'; export const createLicenseStateMock = () => { const licenseState: jest.Mocked = { @@ -14,7 +13,7 @@ export const createLicenseStateMock = () => { ensureLicenseForActionType: jest.fn(), isLicenseValidForActionType: jest.fn(), checkLicense: jest.fn().mockResolvedValue({ - state: LICENSE_CHECK_STATE.Valid, + state: 'valid', }), }; return licenseState; diff --git a/x-pack/plugins/actions/server/lib/license_state.test.ts b/x-pack/plugins/actions/server/lib/license_state.test.ts index ba1fbcb83464a..eb10e69a444e8 100644 --- a/x-pack/plugins/actions/server/lib/license_state.test.ts +++ b/x-pack/plugins/actions/server/lib/license_state.test.ts @@ -8,7 +8,7 @@ import { ActionType } from '../types'; import { BehaviorSubject } from 'rxjs'; import { LicenseState, ILicenseState } from './license_state'; import { licensingMock } from '../../../licensing/server/mocks'; -import { LICENSE_CHECK_STATE, ILicense } from '../../../licensing/server'; +import { ILicense } from '../../../licensing/server'; describe('checkLicense()', () => { let getRawLicense: any; @@ -21,7 +21,7 @@ describe('checkLicense()', () => { beforeEach(() => { const license = licensingMock.createLicense({ license: { status: 'invalid' } }); license.check = jest.fn(() => ({ - state: LICENSE_CHECK_STATE.Invalid, + state: 'invalid', })); getRawLicense.mockReturnValue(license); }); @@ -38,7 +38,7 @@ describe('checkLicense()', () => { beforeEach(() => { const license = licensingMock.createLicense({ license: { status: 'active' } }); license.check = jest.fn(() => ({ - state: LICENSE_CHECK_STATE.Valid, + state: 'valid', })); getRawLicense.mockReturnValue(license); }); diff --git a/x-pack/plugins/actions/server/lib/license_state.ts b/x-pack/plugins/actions/server/lib/license_state.ts index 9d87818805dcf..ae7180c4658bc 100644 --- a/x-pack/plugins/actions/server/lib/license_state.ts +++ b/x-pack/plugins/actions/server/lib/license_state.ts @@ -7,7 +7,7 @@ import { i18n } from '@kbn/i18n'; import { Observable, Subscription } from 'rxjs'; import { assertNever } from '../../../../../src/core/utils'; -import { ILicense, LICENSE_CHECK_STATE } from '../../../licensing/common/types'; +import { ILicense } from '../../../licensing/common/types'; import { PLUGIN } from '../constants/plugin'; import { ActionType } from '../types'; import { ActionTypeDisabledError } from './errors'; @@ -52,13 +52,13 @@ export class LicenseState { const check = this.license.check(actionType.id, actionType.minimumLicenseRequired); switch (check.state) { - case LICENSE_CHECK_STATE.Expired: + case 'expired': return { isValid: false, reason: 'expired' }; - case LICENSE_CHECK_STATE.Invalid: + case 'invalid': return { isValid: false, reason: 'invalid' }; - case LICENSE_CHECK_STATE.Unavailable: + case 'unavailable': return { isValid: false, reason: 'unavailable' }; - case LICENSE_CHECK_STATE.Valid: + case 'valid': return { isValid: true }; default: return assertNever(check.state); @@ -125,20 +125,20 @@ export class LicenseState { const check = license.check(PLUGIN.ID, PLUGIN.MINIMUM_LICENSE_REQUIRED); switch (check.state) { - case LICENSE_CHECK_STATE.Expired: + case 'expired': return { showAppLink: true, enableAppLink: false, message: check.message || '', }; - case LICENSE_CHECK_STATE.Invalid: - case LICENSE_CHECK_STATE.Unavailable: + case 'invalid': + case 'unavailable': return { showAppLink: false, enableAppLink: false, message: check.message || '', }; - case LICENSE_CHECK_STATE.Valid: + case 'valid': return { showAppLink: true, enableAppLink: true, diff --git a/x-pack/plugins/alerting/server/lib/license_state.mock.ts b/x-pack/plugins/alerting/server/lib/license_state.mock.ts index f36f3a9eaeade..aaccbfcc0af0e 100644 --- a/x-pack/plugins/alerting/server/lib/license_state.mock.ts +++ b/x-pack/plugins/alerting/server/lib/license_state.mock.ts @@ -6,7 +6,7 @@ import { of } from 'rxjs'; import { LicenseState } from './license_state'; -import { LICENSE_CHECK_STATE, ILicense } from '../../../licensing/server'; +import { ILicense } from '../../../licensing/server'; export const mockLicenseState = () => { const license: ILicense = { @@ -24,7 +24,7 @@ export const mockLicenseState = () => { }, check() { return { - state: LICENSE_CHECK_STATE.Valid, + state: 'valid', }; }, getFeature() { diff --git a/x-pack/plugins/alerting/server/lib/license_state.test.ts b/x-pack/plugins/alerting/server/lib/license_state.test.ts index 8feb8d74976fd..9bbd619dc4868 100644 --- a/x-pack/plugins/alerting/server/lib/license_state.test.ts +++ b/x-pack/plugins/alerting/server/lib/license_state.test.ts @@ -7,7 +7,6 @@ import expect from '@kbn/expect'; import { LicenseState } from './license_state'; import { licensingMock } from '../../../../plugins/licensing/server/mocks'; -import { LICENSE_CHECK_STATE } from '../../../../plugins/licensing/server'; describe('license_state', () => { let getRawLicense: any; @@ -20,7 +19,7 @@ describe('license_state', () => { beforeEach(() => { const license = licensingMock.createLicense({ license: { status: 'invalid' } }); license.check = jest.fn(() => ({ - state: LICENSE_CHECK_STATE.Invalid, + state: 'invalid', })); getRawLicense.mockReturnValue(license); }); @@ -37,7 +36,7 @@ describe('license_state', () => { beforeEach(() => { const license = licensingMock.createLicense({ license: { status: 'active' } }); license.check = jest.fn(() => ({ - state: LICENSE_CHECK_STATE.Valid, + state: 'valid', })); getRawLicense.mockReturnValue(license); }); diff --git a/x-pack/plugins/alerting/server/lib/license_state.ts b/x-pack/plugins/alerting/server/lib/license_state.ts index 690eaed9e2b89..db60d64db5df4 100644 --- a/x-pack/plugins/alerting/server/lib/license_state.ts +++ b/x-pack/plugins/alerting/server/lib/license_state.ts @@ -7,7 +7,7 @@ import Boom from 'boom'; import { i18n } from '@kbn/i18n'; import { Observable, Subscription } from 'rxjs'; -import { ILicense, LICENSE_CHECK_STATE } from '../../../../plugins/licensing/common/types'; +import { ILicense } from '../../../../plugins/licensing/common/types'; import { assertNever } from '../../../../../src/core/utils'; import { PLUGIN } from '../constants/plugin'; @@ -55,20 +55,20 @@ export class LicenseState { const check = license.check(PLUGIN.ID, PLUGIN.MINIMUM_LICENSE_REQUIRED); switch (check.state) { - case LICENSE_CHECK_STATE.Expired: + case 'expired': return { showAppLink: true, enableAppLink: false, message: check.message || '', }; - case LICENSE_CHECK_STATE.Invalid: - case LICENSE_CHECK_STATE.Unavailable: + case 'invalid': + case 'unavailable': return { showAppLink: false, enableAppLink: false, message: check.message || '', }; - case LICENSE_CHECK_STATE.Valid: + case 'valid': return { showAppLink: true, enableAppLink: true, diff --git a/x-pack/plugins/apm/server/lib/alerts/register_error_rate_alert_type.ts b/x-pack/plugins/apm/server/lib/alerts/register_error_rate_alert_type.ts index 187a75d0b61f2..d6242507e4011 100644 --- a/x-pack/plugins/apm/server/lib/alerts/register_error_rate_alert_type.ts +++ b/x-pack/plugins/apm/server/lib/alerts/register_error_rate_alert_type.ts @@ -7,6 +7,7 @@ import { schema, TypeOf } from '@kbn/config-schema'; import { Observable } from 'rxjs'; import { take } from 'rxjs/operators'; +import { i18n } from '@kbn/i18n'; import { AlertType, ALERT_TYPES_CONFIG } from '../../../common/alert_types'; import { ESSearchResponse, @@ -46,7 +47,19 @@ export function registerErrorRateAlertType({ validate: { params: paramsSchema }, - + actionVariables: { + context: [ + { + description: i18n.translate( + 'xpack.apm.registerErrorRateAlertType.variables.serviceName', + { + defaultMessage: 'Service name' + } + ), + name: 'serviceName' + } + ] + }, executor: async ({ services, params }) => { const config = await config$.pipe(take(1)).toPromise(); @@ -99,7 +112,9 @@ export function registerErrorRateAlertType({ const alertInstance = services.alertInstanceFactory( AlertType.ErrorRate ); - alertInstance.scheduleActions(alertTypeConfig.defaultActionGroupId); + alertInstance.scheduleActions(alertTypeConfig.defaultActionGroupId, { + serviceName: alertParams.serviceName + }); } return {}; diff --git a/x-pack/plugins/apm/server/lib/alerts/register_transaction_duration_alert_type.ts b/x-pack/plugins/apm/server/lib/alerts/register_transaction_duration_alert_type.ts index 7575a8268bc26..2799da16cf6a9 100644 --- a/x-pack/plugins/apm/server/lib/alerts/register_transaction_duration_alert_type.ts +++ b/x-pack/plugins/apm/server/lib/alerts/register_transaction_duration_alert_type.ts @@ -7,6 +7,7 @@ import { schema, TypeOf } from '@kbn/config-schema'; import { Observable } from 'rxjs'; import { take } from 'rxjs/operators'; +import { i18n } from '@kbn/i18n'; import { AlertType, ALERT_TYPES_CONFIG } from '../../../common/alert_types'; import { ESSearchResponse } from '../../../typings/elasticsearch'; import { @@ -51,7 +52,28 @@ export function registerTransactionDurationAlertType({ validate: { params: paramsSchema }, - + actionVariables: { + context: [ + { + description: i18n.translate( + 'xpack.apm.registerTransactionDurationAlertType.variables.serviceName', + { + defaultMessage: 'Service name' + } + ), + name: 'serviceName' + }, + { + description: i18n.translate( + 'xpack.apm.registerTransactionDurationAlertType.variables.transactionType', + { + defaultMessage: 'Transaction type' + } + ), + name: 'transactionType' + } + ] + }, executor: async ({ services, params }) => { const config = await config$.pipe(take(1)).toPromise(); @@ -131,7 +153,10 @@ export function registerTransactionDurationAlertType({ const alertInstance = services.alertInstanceFactory( AlertType.TransactionDuration ); - alertInstance.scheduleActions(alertTypeConfig.defaultActionGroupId); + alertInstance.scheduleActions(alertTypeConfig.defaultActionGroupId, { + transactionType: alertParams.transactionType, + serviceName: alertParams.serviceName + }); } return {}; diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/actions.ts b/x-pack/plugins/endpoint/public/embeddables/resolver/store/actions.ts index 0860c9c62aca4..a26f43e1f8cc0 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/store/actions.ts +++ b/x-pack/plugins/endpoint/public/embeddables/resolver/store/actions.ts @@ -45,7 +45,11 @@ interface AppRequestedResolverData { } /** - * When the user switches the active descendent of the Resolver. + * When the user switches the "active descendant" of the Resolver. + * The "active descendant" (from the point of view of the parent element) + * corresponds to the "current" child element. "active" or "current" here meaning + * the element that is focused on by the user's interactions with the UI, but + * not necessarily "selected" (see UserSelectedResolverNode below) */ interface UserFocusedOnResolverNode { readonly type: 'userFocusedOnResolverNode'; @@ -57,10 +61,27 @@ interface UserFocusedOnResolverNode { }; } +/** + * When the user "selects" a node in the Resolver + * "Selected" refers to the state of being the element that the + * user most recently "picked" (by e.g. pressing a button corresponding + * to the element in a list) as opposed to "active" or "current" (see UserFocusedOnResolverNode above). + */ +interface UserSelectedResolverNode { + readonly type: 'userSelectedResolverNode'; + readonly payload: { + /** + * Used to identify the process node that the user selected + */ + readonly nodeId: string; + }; +} + export type ResolverAction = | CameraAction | DataAction | UserBroughtProcessIntoView | UserChangedSelectedEvent | AppRequestedResolverData - | UserFocusedOnResolverNode; + | UserFocusedOnResolverNode + | UserSelectedResolverNode; diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/reducer.ts b/x-pack/plugins/endpoint/public/embeddables/resolver/store/reducer.ts index 1c66a998a4c22..82206d77f8349 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/store/reducer.ts +++ b/x-pack/plugins/endpoint/public/embeddables/resolver/store/reducer.ts @@ -4,18 +4,44 @@ * you may not use this file except in compliance with the Elastic License. */ import { Reducer, combineReducers } from 'redux'; +import { htmlIdGenerator } from '@elastic/eui'; import { animateProcessIntoView } from './methods'; import { cameraReducer } from './camera/reducer'; import { dataReducer } from './data/reducer'; import { ResolverState, ResolverAction, ResolverUIState } from '../types'; +import { uniquePidForProcess } from '../models/process_event'; + +/** + * Despite the name "generator", this function is entirely determinant + * (i.e. it will return the same html id given the same prefix 'resolverNode' + * and nodeId) + */ +const resolverNodeIdGenerator = htmlIdGenerator('resolverNode'); const uiReducer: Reducer = ( - uiState = { activeDescendentId: null }, + uiState = { activeDescendantId: null, selectedDescendantId: null }, action ) => { if (action.type === 'userFocusedOnResolverNode') { return { - activeDescendentId: action.payload.nodeId, + ...uiState, + activeDescendantId: action.payload.nodeId, + }; + } else if (action.type === 'userSelectedResolverNode') { + return { + ...uiState, + selectedDescendantId: action.payload.nodeId, + }; + } else if (action.type === 'userBroughtProcessIntoView') { + /** + * This action has a process payload (instead of a processId), so we use + * `uniquePidForProcess` and `resolverNodeIdGenerator` to resolve the determinant + * html id of the node being brought into view. + */ + const processNodeId = resolverNodeIdGenerator(uniquePidForProcess(action.payload.process)); + return { + ...uiState, + activeDescendantId: processNodeId, }; } else { return uiState; diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/selectors.ts b/x-pack/plugins/endpoint/public/embeddables/resolver/store/selectors.ts index 37482916496e7..e8ae3d08e5cb6 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/store/selectors.ts +++ b/x-pack/plugins/endpoint/public/embeddables/resolver/store/selectors.ts @@ -6,6 +6,7 @@ import * as cameraSelectors from './camera/selectors'; import * as dataSelectors from './data/selectors'; +import * as uiSelectors from './ui/selectors'; import { ResolverState } from '../types'; /** @@ -59,6 +60,22 @@ export const processAdjacencies = composeSelectors( dataSelectors.processAdjacencies ); +/** + * Returns the id of the "current" tree node (fake-focused) + */ +export const uiActiveDescendantId = composeSelectors( + uiStateSelector, + uiSelectors.activeDescendantId +); + +/** + * Returns the id of the "selected" tree node (the node that is currently "pressed" and possibly controlling other popups / components) + */ +export const uiSelectedDescendantId = composeSelectors( + uiStateSelector, + uiSelectors.selectedDescendantId +); + /** * Returns the camera state from within ResolverState */ @@ -73,6 +90,13 @@ function dataStateSelector(state: ResolverState) { return state.data; } +/** + * Returns the ui state from within ResolverState + */ +function uiStateSelector(state: ResolverState) { + return state.ui; +} + /** * Whether or not the resolver is pending fetching data */ diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/store/ui/selectors.ts b/x-pack/plugins/endpoint/public/embeddables/resolver/store/ui/selectors.ts new file mode 100644 index 0000000000000..196e834c406b3 --- /dev/null +++ b/x-pack/plugins/endpoint/public/embeddables/resolver/store/ui/selectors.ts @@ -0,0 +1,30 @@ +/* + * 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 { createSelector } from 'reselect'; +import { ResolverUIState } from '../../types'; + +/** + * id of the "current" tree node (fake-focused) + */ +export const activeDescendantId = createSelector( + (uiState: ResolverUIState) => uiState, + /* eslint-disable no-shadow */ + ({ activeDescendantId }) => { + return activeDescendantId; + } +); + +/** + * id of the currently "selected" tree node + */ +export const selectedDescendantId = createSelector( + (uiState: ResolverUIState) => uiState, + /* eslint-disable no-shadow */ + ({ selectedDescendantId }) => { + return selectedDescendantId; + } +); diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/types.ts b/x-pack/plugins/endpoint/public/embeddables/resolver/types.ts index 674553aba0937..d370bda0d1842 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/types.ts +++ b/x-pack/plugins/endpoint/public/embeddables/resolver/types.ts @@ -37,7 +37,11 @@ export interface ResolverUIState { /** * The ID attribute of the resolver's aria-activedescendent. */ - readonly activeDescendentId: string | null; + readonly activeDescendantId: string | null; + /** + * The ID attribute of the resolver's currently selected descendant. + */ + readonly selectedDescendantId: string | null; } /** diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/view/defs.tsx b/x-pack/plugins/endpoint/public/embeddables/resolver/view/defs.tsx index 911cda1be6517..8ee9bfafc630e 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/view/defs.tsx +++ b/x-pack/plugins/endpoint/public/embeddables/resolver/view/defs.tsx @@ -193,6 +193,7 @@ export const SymbolIds = { runningTriggerCube: idGenerator('runningTriggerCube'), terminatedProcessCube: idGenerator('terminatedCube'), terminatedTriggerCube: idGenerator('terminatedTriggerCube'), + processCubeActiveBacking: idGenerator('activeBacking'), }; /** @@ -393,6 +394,15 @@ const SymbolsAndShapes = memo(() => ( /> + + resolver active backing + + )); diff --git a/x-pack/plugins/endpoint/public/embeddables/resolver/view/index.tsx b/x-pack/plugins/endpoint/public/embeddables/resolver/view/index.tsx index 58ce9b963de5d..36155ece57a9c 100644 --- a/x-pack/plugins/endpoint/public/embeddables/resolver/view/index.tsx +++ b/x-pack/plugins/endpoint/public/embeddables/resolver/view/index.tsx @@ -59,6 +59,7 @@ export const Resolver = styled( const { projectionMatrix, ref, onMouseDown } = useCamera(); const isLoading = useSelector(selectors.isLoading); + const activeDescendantId = useSelector(selectors.uiActiveDescendantId); useLayoutEffect(() => { dispatch({ @@ -66,6 +67,7 @@ export const Resolver = styled( payload: { selectedEvent }, }); }, [dispatch, selectedEvent]); + return (
{isLoading ? ( @@ -79,6 +81,7 @@ export const Resolver = styled( ref={ref} role="tree" tabIndex={0} + aria-activedescendant={activeDescendantId || undefined} > {edgeLineSegments.map(([startPosition, endPosition], index) => ( ({ left: `${left}px`, @@ -143,6 +148,9 @@ export const ProcessEventDot = styled( const labelId = useMemo(() => resolverNodeIdGenerator(), [resolverNodeIdGenerator]); const descriptionId = useMemo(() => resolverNodeIdGenerator(), [resolverNodeIdGenerator]); + const isActiveDescendant = nodeId === activeDescendantId; + const isSelectedDescendant = nodeId === selectedDescendantId; + const dispatch = useResolverDispatch(); const handleFocus = useCallback( @@ -153,16 +161,24 @@ export const ProcessEventDot = styled( nodeId, }, }); - focusEvent.currentTarget.setAttribute('aria-current', 'true'); }, [dispatch, nodeId] ); - const handleClick = useCallback(() => { - if (animationTarget.current !== null) { - animationTarget.current.beginElement(); - } - }, [animationTarget]); + const handleClick = useCallback( + (clickEvent: React.MouseEvent) => { + if (animationTarget.current !== null) { + (animationTarget.current as any).beginElement(); + } + dispatch({ + type: 'userSelectedResolverNode', + payload: { + nodeId, + }, + }); + }, + [animationTarget, dispatch, nodeId] + ); return ( @@ -179,6 +195,8 @@ export const ProcessEventDot = styled( aria-labelledby={labelId} aria-describedby={descriptionId} aria-haspopup={'true'} + aria-current={isActiveDescendant ? 'true' : undefined} + aria-selected={isSelectedDescendant ? 'true' : undefined} style={nodeViewportStyle} id={nodeId} onClick={handleClick} @@ -186,6 +204,15 @@ export const ProcessEventDot = styled( tabIndex={-1} > + + = { diff --git a/x-pack/plugins/graph/common/check_license.ts b/x-pack/plugins/graph/common/check_license.ts index a918f53776b17..f9a663f35ed47 100644 --- a/x-pack/plugins/graph/common/check_license.ts +++ b/x-pack/plugins/graph/common/check_license.ts @@ -5,7 +5,7 @@ */ import { i18n } from '@kbn/i18n'; -import { ILicense, LICENSE_CHECK_STATE } from '../../licensing/common/types'; +import { ILicense } from '../../licensing/common/types'; import { assertNever } from '../../../../src/core/utils'; export interface GraphLicenseInformation { @@ -43,20 +43,20 @@ export function checkLicense(license: ILicense | undefined): GraphLicenseInforma const check = license.check('graph', 'platinum'); switch (check.state) { - case LICENSE_CHECK_STATE.Expired: + case 'expired': return { showAppLink: true, enableAppLink: false, message: check.message || '', }; - case LICENSE_CHECK_STATE.Invalid: - case LICENSE_CHECK_STATE.Unavailable: + case 'invalid': + case 'unavailable': return { showAppLink: false, enableAppLink: false, message: check.message || '', }; - case LICENSE_CHECK_STATE.Valid: + case 'valid': return { showAppLink: true, enableAppLink: true, diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/create_field.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/create_field.tsx index b41f35b983885..a9cb7c140e427 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/create_field.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/create_field.tsx @@ -5,7 +5,6 @@ */ import React, { useEffect, useCallback } from 'react'; import classNames from 'classnames'; -import * as _ from 'lodash'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/edit_field/edit_field_header_form.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/edit_field/edit_field_header_form.tsx index 75a083d64b6db..23cff2a0d9aba 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/edit_field/edit_field_header_form.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/edit_field/edit_field_header_form.tsx @@ -90,7 +90,6 @@ export const EditFieldHeaderForm = React.memo( {/* Field sub type (if any) - will never be the case if we have an "other" type */} {hasSubType && ( - {' '} +value, + deserializer: (value: string | number) => (value === '' ? value : +value), formatters: [toInt], label: i18n.translate('xpack.idxMgmt.mappingsEditor.parameters.scalingFactorLabel', { defaultMessage: 'Scaling factor', diff --git a/x-pack/plugins/index_management/public/application/mount_management_section.ts b/x-pack/plugins/index_management/public/application/mount_management_section.ts new file mode 100644 index 0000000000000..c47b0603dc1c8 --- /dev/null +++ b/x-pack/plugins/index_management/public/application/mount_management_section.ts @@ -0,0 +1,51 @@ +/* + * 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 { CoreSetup } from 'src/core/public'; +import { ManagementAppMountParams } from 'src/plugins/management/public/'; +import { UsageCollectionSetup } from 'src/plugins/usage_collection/public'; + +import { ExtensionsService } from '../services'; +import { IndexMgmtMetricsType } from '../types'; +import { AppDependencies } from './app_context'; +import { breadcrumbService } from './services/breadcrumbs'; +import { documentationService } from './services/documentation'; +import { HttpService, NotificationService, UiMetricService } from './services'; + +import { renderApp } from '.'; + +interface InternalServices { + httpService: HttpService; + notificationService: NotificationService; + uiMetricService: UiMetricService; + extensionsService: ExtensionsService; +} + +export async function mountManagementSection( + coreSetup: CoreSetup, + usageCollection: UsageCollectionSetup, + services: InternalServices, + params: ManagementAppMountParams +) { + const { element, setBreadcrumbs } = params; + const [core] = await coreSetup.getStartServices(); + const { docLinks, fatalErrors } = core; + + breadcrumbService.setup(setBreadcrumbs); + documentationService.setup(docLinks); + + const appDependencies: AppDependencies = { + core: { + fatalErrors, + }, + plugins: { + usageCollection, + }, + services, + }; + + return renderApp(element, { core, dependencies: appDependencies }); +} diff --git a/x-pack/plugins/index_management/public/plugin.ts b/x-pack/plugins/index_management/public/plugin.ts index c1b26fe3ca56b..4aa06d286e3c4 100644 --- a/x-pack/plugins/index_management/public/plugin.ts +++ b/x-pack/plugins/index_management/public/plugin.ts @@ -10,10 +10,7 @@ import { UsageCollectionSetup } from '../../../../src/plugins/usage_collection/p import { ManagementSetup } from '../../../../src/plugins/management/public'; import { UIM_APP_NAME, PLUGIN } from '../common/constants'; -import { AppDependencies } from './application'; import { httpService } from './application/services/http'; -import { breadcrumbService } from './application/services/breadcrumbs'; -import { documentationService } from './application/services/documentation'; import { notificationService } from './application/services/notification'; import { UiMetricService } from './application/services/ui_metric'; @@ -44,7 +41,7 @@ export class IndexMgmtUIPlugin { } public setup(coreSetup: CoreSetup, plugins: PluginsDependencies): IndexMgmtSetup { - const { http, notifications, getStartServices } = coreSetup; + const { http, notifications } = coreSetup; const { usageCollection, management } = plugins; httpService.setup(http); @@ -55,30 +52,15 @@ export class IndexMgmtUIPlugin { id: PLUGIN.id, title: i18n.translate('xpack.idxMgmt.appTitle', { defaultMessage: 'Index Management' }), order: 1, - mount: async ({ element, setBreadcrumbs }) => { - const [core] = await getStartServices(); - const { docLinks, fatalErrors } = core; - - breadcrumbService.setup(setBreadcrumbs); - documentationService.setup(docLinks); - - const appDependencies: AppDependencies = { - core: { - fatalErrors, - }, - plugins: { - usageCollection, - }, - services: { - uiMetricService: this.uiMetricService, - extensionsService: this.extensionsService, - httpService, - notificationService, - }, + mount: async params => { + const { mountManagementSection } = await import('./application/mount_management_section'); + const services = { + httpService, + notificationService, + uiMetricService: this.uiMetricService, + extensionsService: this.extensionsService, }; - - const { renderApp } = await import('./application'); - return renderApp(element, { core, dependencies: appDependencies }); + return mountManagementSection(coreSetup, usageCollection, services, params); }, }); diff --git a/x-pack/plugins/index_management/server/services/license.ts b/x-pack/plugins/index_management/server/services/license.ts index c490aa7b57ed9..31d3654c51e3e 100644 --- a/x-pack/plugins/index_management/server/services/license.ts +++ b/x-pack/plugins/index_management/server/services/license.ts @@ -12,7 +12,7 @@ import { } from 'kibana/server'; import { LicensingPluginSetup } from '../../../licensing/server'; -import { LicenseType, LICENSE_CHECK_STATE } from '../../../licensing/common/types'; +import { LicenseType } from '../../../licensing/common/types'; export interface LicenseStatus { isValid: boolean; @@ -37,7 +37,7 @@ export class License { ) { licensing.license$.subscribe(license => { const { state, message } = license.check(pluginId, minimumLicenseType); - const hasRequiredLicense = state === LICENSE_CHECK_STATE.Valid; + const hasRequiredLicense = state === 'valid'; if (hasRequiredLicense) { this.licenseStatus = { isValid: true }; diff --git a/x-pack/plugins/licensing/README.md b/x-pack/plugins/licensing/README.md index 7a155dfd405c5..a058d42fe908b 100644 --- a/x-pack/plugins/licensing/README.md +++ b/x-pack/plugins/licensing/README.md @@ -59,7 +59,7 @@ chrome.navLinks.update('myPlugin', { "requiredPlugins": ["licensing"], // my_plugin/server/plugin.ts -import { LicensingPluginSetup, LICENSE_CHECK_STATE } from '../licensing/server' +import { LicensingPluginSetup } from '../licensing/server' interface SetupDeps { licensing: LicensingPluginSetup; @@ -69,7 +69,7 @@ class MyPlugin { setup(core: CoreSetup, deps: SetupDeps) { deps.licensing.license$.subscribe(license => { const { state, message } = license.check('myPlugin', 'gold') - const hasRequiredLicense = state === LICENSE_CHECK_STATE.Valid; + const hasRequiredLicense = state === 'valid'; if (hasRequiredLicense && license.getFeature('name').isAvailable) { // enable some server side logic } else { @@ -81,12 +81,12 @@ class MyPlugin { } // my_plugin/public/plugin.ts -import { LicensingPluginSetup, LICENSE_CHECK_STATE } from '../licensing/public' +import { LicensingPluginSetup } from '../licensing/public' class MyPlugin { setup(core: CoreSetup, deps: SetupDeps) { deps.licensing.license$.subscribe(license => { const { state, message } = license.check('myPlugin', 'gold') - const hasRequiredLicense = state === LICENSE_CHECK_STATE.Valid; + const hasRequiredLicense = state === 'valid'; const showLinks = hasRequiredLicense && license.getFeature('name').isAvailable; chrome.navLinks.update('myPlugin', { diff --git a/x-pack/plugins/licensing/common/license.test.ts b/x-pack/plugins/licensing/common/license.test.ts index 622572a6a95ba..648b0a2180928 100644 --- a/x-pack/plugins/licensing/common/license.test.ts +++ b/x-pack/plugins/licensing/common/license.test.ts @@ -5,7 +5,6 @@ */ import { License } from './license'; -import { LICENSE_CHECK_STATE } from './types'; import { licenseMock } from './licensing.mock'; describe('License', () => { @@ -86,21 +85,21 @@ describe('License', () => { describe('check', () => { it('provides availability status', () => { - expect(basicLicense.check('ccr', 'gold').state).toBe(LICENSE_CHECK_STATE.Invalid); + expect(basicLicense.check('ccr', 'gold').state).toBe('invalid'); - expect(goldLicense.check('ccr', 'gold').state).toBe(LICENSE_CHECK_STATE.Valid); - expect(goldLicense.check('ccr', 'basic').state).toBe(LICENSE_CHECK_STATE.Valid); + expect(goldLicense.check('ccr', 'gold').state).toBe('valid'); + expect(goldLicense.check('ccr', 'basic').state).toBe('valid'); - expect(basicExpiredLicense.check('ccr', 'gold').state).toBe(LICENSE_CHECK_STATE.Expired); + expect(basicExpiredLicense.check('ccr', 'gold').state).toBe('expired'); - expect(errorLicense.check('ccr', 'basic').state).toBe(LICENSE_CHECK_STATE.Unavailable); - expect(errorLicense.check('ccr', 'gold').state).toBe(LICENSE_CHECK_STATE.Unavailable); + expect(errorLicense.check('ccr', 'basic').state).toBe('unavailable'); + expect(errorLicense.check('ccr', 'gold').state).toBe('unavailable'); - expect(unavailableLicense.check('ccr', 'basic').state).toBe(LICENSE_CHECK_STATE.Unavailable); - expect(unavailableLicense.check('ccr', 'gold').state).toBe(LICENSE_CHECK_STATE.Unavailable); + expect(unavailableLicense.check('ccr', 'basic').state).toBe('unavailable'); + expect(unavailableLicense.check('ccr', 'gold').state).toBe('unavailable'); - expect(enterpriseLicense.check('ccr', 'gold').state).toBe(LICENSE_CHECK_STATE.Valid); - expect(enterpriseLicense.check('ccr', 'enterprise').state).toBe(LICENSE_CHECK_STATE.Valid); + expect(enterpriseLicense.check('ccr', 'gold').state).toBe('valid'); + expect(enterpriseLicense.check('ccr', 'enterprise').state).toBe('valid'); }); it('throws in case of unknown license type', () => { diff --git a/x-pack/plugins/licensing/common/license.ts b/x-pack/plugins/licensing/common/license.ts index 41f3c73db9c06..bb3480a482f0f 100644 --- a/x-pack/plugins/licensing/common/license.ts +++ b/x-pack/plugins/licensing/common/license.ts @@ -9,7 +9,7 @@ import { LicenseType, ILicense, LicenseStatus, - LICENSE_CHECK_STATE, + LicenseCheck, LICENSE_TYPE, PublicLicenseJSON, PublicLicense, @@ -98,10 +98,10 @@ export class License implements ILicense { return LICENSE_TYPE[minimumLicenseRequired] <= LICENSE_TYPE[type]; } - check(pluginName: string, minimumLicenseRequired: LicenseType) { + check(pluginName: string, minimumLicenseRequired: LicenseType): LicenseCheck { if (!this.isAvailable) { return { - state: LICENSE_CHECK_STATE.Unavailable, + state: 'unavailable', message: i18n.translate('xpack.licensing.check.errorUnavailableMessage', { defaultMessage: 'You cannot use {pluginName} because license information is not available at this time.', @@ -112,7 +112,7 @@ export class License implements ILicense { if (!this.isActive) { return { - state: LICENSE_CHECK_STATE.Expired, + state: 'expired', message: i18n.translate('xpack.licensing.check.errorExpiredMessage', { defaultMessage: 'You cannot use {pluginName} because your {licenseType} license has expired.', @@ -123,7 +123,7 @@ export class License implements ILicense { if (!this.hasAtLeast(minimumLicenseRequired)) { return { - state: LICENSE_CHECK_STATE.Invalid, + state: 'invalid', message: i18n.translate('xpack.licensing.check.errorUnsupportedMessage', { defaultMessage: 'Your {licenseType} license does not support {pluginName}. Please upgrade your license.', @@ -132,7 +132,7 @@ export class License implements ILicense { }; } - return { state: LICENSE_CHECK_STATE.Valid }; + return { state: 'valid' }; } getFeature(name: string) { diff --git a/x-pack/plugins/licensing/common/licensing.mock.ts b/x-pack/plugins/licensing/common/licensing.mock.ts index bbe63d5c0d70a..bf8b85e3e981b 100644 --- a/x-pack/plugins/licensing/common/licensing.mock.ts +++ b/x-pack/plugins/licensing/common/licensing.mock.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { ILicense, PublicLicense, PublicFeatures, LICENSE_CHECK_STATE } from './types'; +import { ILicense, PublicLicense, PublicFeatures } from './types'; import { License } from './license'; function createLicense({ @@ -51,7 +51,7 @@ const createLicenseMock = () => { check: jest.fn(), hasAtLeast: jest.fn(), }; - mock.check.mockReturnValue({ state: LICENSE_CHECK_STATE.Valid }); + mock.check.mockReturnValue({ state: 'valid' }); mock.hasAtLeast.mockReturnValue(true); return mock; }; diff --git a/x-pack/plugins/licensing/common/types.ts b/x-pack/plugins/licensing/common/types.ts index 78c31963da9b1..f589ba7e9e44f 100644 --- a/x-pack/plugins/licensing/common/types.ts +++ b/x-pack/plugins/licensing/common/types.ts @@ -4,12 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -export enum LICENSE_CHECK_STATE { - Unavailable = 'UNAVAILABLE', - Invalid = 'INVALID', - Expired = 'EXPIRED', - Valid = 'VALID', -} +export type LicenseCheckState = 'unavailable' | 'invalid' | 'valid' | 'expired'; export enum LICENSE_TYPE { basic = 10, @@ -90,7 +85,7 @@ export interface LicenseCheck { /** * The state of checking the results of a license type meeting the license minimum. */ - state: LICENSE_CHECK_STATE; + state: LicenseCheckState; /** * A message containing the reason for a license type not being valid. */ diff --git a/x-pack/plugins/maps/common/constants.ts b/x-pack/plugins/maps/common/constants.ts index bd4406ef5ce63..f3997f741a1bf 100644 --- a/x-pack/plugins/maps/common/constants.ts +++ b/x-pack/plugins/maps/common/constants.ts @@ -213,3 +213,5 @@ export enum SCALING_TYPES { CLUSTERS = 'CLUSTERS', TOP_HITS = 'TOP_HITS', } + +export const RGBA_0000 = 'rgba(0,0,0,0)'; diff --git a/x-pack/plugins/ml/common/license/ml_license.ts b/x-pack/plugins/ml/common/license/ml_license.ts index 31a1b44d297ed..2a60887310447 100644 --- a/x-pack/plugins/ml/common/license/ml_license.ts +++ b/x-pack/plugins/ml/common/license/ml_license.ts @@ -5,7 +5,7 @@ */ import { Observable, Subscription } from 'rxjs'; -import { ILicense, LICENSE_CHECK_STATE } from '../../../licensing/common/types'; +import { ILicense } from '../../../licensing/common/types'; import { PLUGIN_ID } from '../constants/app'; export const MINIMUM_LICENSE = 'basic'; @@ -38,10 +38,8 @@ export class MlLicense { this._isSecurityEnabled = securityIsEnabled; this._hasLicenseExpired = this._license.status === 'expired'; this._isMlEnabled = this._license.getFeature(PLUGIN_ID).isEnabled; - this._isMinimumLicense = - this._license.check(PLUGIN_ID, MINIMUM_LICENSE).state === LICENSE_CHECK_STATE.Valid; - this._isFullLicense = - this._license.check(PLUGIN_ID, MINIMUM_FULL_LICENSE).state === LICENSE_CHECK_STATE.Valid; + this._isMinimumLicense = this._license.check(PLUGIN_ID, MINIMUM_LICENSE).state === 'valid'; + this._isFullLicense = this._license.check(PLUGIN_ID, MINIMUM_FULL_LICENSE).state === 'valid'; if (this._initialized === false && postInitFunctions !== undefined) { postInitFunctions.forEach(f => f(this)); diff --git a/x-pack/plugins/ml/common/util/es_utils.ts b/x-pack/plugins/ml/common/util/es_utils.ts index bed7ba8bc7736..ff632a60dd516 100644 --- a/x-pack/plugins/ml/common/util/es_utils.ts +++ b/x-pack/plugins/ml/common/util/es_utils.ts @@ -26,6 +26,7 @@ function isValidIndexNameLength(indexName: string) { // https://github.com/elastic/elasticsearch/blob/master/docs/reference/indices/create-index.asciidoc export function isValidIndexName(indexName: string) { return ( + typeof indexName === 'string' && // Lowercase only indexName === indexName.toLowerCase() && // Cannot include \, /, *, ?, ", <, >, |, space character, comma, #, : diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts index d77f19c0df79d..511ebb7e1647a 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/common/analytics.ts @@ -33,6 +33,7 @@ interface OutlierAnalysis { interface Regression { dependent_variable: string; training_percent?: number; + num_top_feature_importance_values?: number; prediction_field_name?: string; } export interface RegressionAnalysis { @@ -44,6 +45,7 @@ interface Classification { dependent_variable: string; training_percent?: number; num_top_classes?: string; + num_top_feature_importance_values?: number; prediction_field_name?: string; } export interface ClassificationAnalysis { @@ -65,6 +67,8 @@ export const SEARCH_SIZE = 1000; export const TRAINING_PERCENT_MIN = 1; export const TRAINING_PERCENT_MAX = 100; +export const NUM_TOP_FEATURE_IMPORTANCE_VALUES_MIN = 0; + export const defaultSearchQuery = { match_all: {}, }; @@ -152,7 +156,7 @@ type AnalysisConfig = | ClassificationAnalysis | GenericAnalysis; -export const getAnalysisType = (analysis: AnalysisConfig) => { +export const getAnalysisType = (analysis: AnalysisConfig): string => { const keys = Object.keys(analysis); if (keys.length === 1) { @@ -162,7 +166,11 @@ export const getAnalysisType = (analysis: AnalysisConfig) => { return 'unknown'; }; -export const getDependentVar = (analysis: AnalysisConfig) => { +export const getDependentVar = ( + analysis: AnalysisConfig +): + | RegressionAnalysis['regression']['dependent_variable'] + | ClassificationAnalysis['classification']['dependent_variable'] => { let depVar = ''; if (isRegressionAnalysis(analysis)) { @@ -175,7 +183,11 @@ export const getDependentVar = (analysis: AnalysisConfig) => { return depVar; }; -export const getTrainingPercent = (analysis: AnalysisConfig) => { +export const getTrainingPercent = ( + analysis: AnalysisConfig +): + | RegressionAnalysis['regression']['training_percent'] + | ClassificationAnalysis['classification']['training_percent'] => { let trainingPercent; if (isRegressionAnalysis(analysis)) { @@ -188,7 +200,11 @@ export const getTrainingPercent = (analysis: AnalysisConfig) => { return trainingPercent; }; -export const getPredictionFieldName = (analysis: AnalysisConfig) => { +export const getPredictionFieldName = ( + analysis: AnalysisConfig +): + | RegressionAnalysis['regression']['prediction_field_name'] + | ClassificationAnalysis['classification']['prediction_field_name'] => { // If undefined will be defaulted to dependent_variable when config is created let predictionFieldName; if (isRegressionAnalysis(analysis) && analysis.regression.prediction_field_name !== undefined) { @@ -202,6 +218,26 @@ export const getPredictionFieldName = (analysis: AnalysisConfig) => { return predictionFieldName; }; +export const getNumTopFeatureImportanceValues = ( + analysis: AnalysisConfig +): + | RegressionAnalysis['regression']['num_top_feature_importance_values'] + | ClassificationAnalysis['classification']['num_top_feature_importance_values'] => { + let numTopFeatureImportanceValues; + if ( + isRegressionAnalysis(analysis) && + analysis.regression.num_top_feature_importance_values !== undefined + ) { + numTopFeatureImportanceValues = analysis.regression.num_top_feature_importance_values; + } else if ( + isClassificationAnalysis(analysis) && + analysis.classification.num_top_feature_importance_values !== undefined + ) { + numTopFeatureImportanceValues = analysis.classification.num_top_feature_importance_values; + } + return numTopFeatureImportanceValues; +}; + export const getPredictedFieldName = ( resultsField: string, analysis: AnalysisConfig, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/common/fields.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/common/fields.ts index 59b42935a141d..92d8731959895 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/common/fields.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/common/fields.ts @@ -7,12 +7,13 @@ import { getNestedProperty } from '../../util/object_utils'; import { DataFrameAnalyticsConfig, + getNumTopFeatureImportanceValues, getPredictedFieldName, getDependentVar, getPredictionFieldName, } from './analytics'; import { Field } from '../../../../common/types/fields'; -import { ES_FIELD_TYPES } from '../../../../../../../src/plugins/data/public'; +import { ES_FIELD_TYPES, KBN_FIELD_TYPES } from '../../../../../../../src/plugins/data/public'; import { newJobCapsService } from '../../services/new_job_capabilities_service'; export type EsId = string; @@ -254,6 +255,7 @@ export const getDefaultFieldsFromJobCaps = ( const dependentVariable = getDependentVar(jobConfig.analysis); const type = newJobCapsService.getFieldById(dependentVariable)?.type; const predictionFieldName = getPredictionFieldName(jobConfig.analysis); + const numTopFeatureImportanceValues = getNumTopFeatureImportanceValues(jobConfig.analysis); // default is 'ml' const resultsField = jobConfig.dest.results_field; @@ -261,7 +263,20 @@ export const getDefaultFieldsFromJobCaps = ( const predictedField = `${resultsField}.${ predictionFieldName ? predictionFieldName : defaultPredictionField }`; - // Only need to add these first two fields if we didn't use dest index pattern to get the fields + + const featureImportanceFields = []; + + if ((numTopFeatureImportanceValues ?? 0) > 0) { + featureImportanceFields.push( + ...fields.map(d => ({ + id: `${resultsField}.feature_importance.${d.id}`, + name: `${resultsField}.feature_importance.${d.name}`, + type: KBN_FIELD_TYPES.NUMBER, + })) + ); + } + + // Only need to add these fields if we didn't use dest index pattern to get the fields const allFields: any = needsDestIndexFields === true ? [ @@ -271,16 +286,20 @@ export const getDefaultFieldsFromJobCaps = ( type: ES_FIELD_TYPES.BOOLEAN, }, { id: predictedField, name: predictedField, type }, + ...featureImportanceFields, ] : []; allFields.push(...fields); - // @ts-ignore - allFields.sort(({ name: a }, { name: b }) => sortRegressionResultsFields(a, b, jobConfig)); - - let selectedFields = allFields - .slice(0, DEFAULT_REGRESSION_COLUMNS * 2) - .filter((field: any) => field.name === predictedField || !field.name.includes('.keyword')); + allFields.sort(({ name: a }: { name: string }, { name: b }: { name: string }) => + sortRegressionResultsFields(a, b, jobConfig) + ); + + let selectedFields = allFields.filter( + (field: any) => + field.name === predictedField || + (!field.name.includes('.keyword') && !field.name.includes('.feature_importance.')) + ); if (selectedFields.length > DEFAULT_REGRESSION_COLUMNS) { selectedFields = selectedFields.slice(0, DEFAULT_REGRESSION_COLUMNS); diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.test.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.test.ts index 6225bca592be3..2463da054d140 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.test.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.test.ts @@ -25,6 +25,7 @@ describe('Analytics job clone action', () => { classification: { dependent_variable: 'y', num_top_classes: 2, + num_top_feature_importance_values: 4, prediction_field_name: 'y_prediction', training_percent: 2, randomize_seed: 6233212276062807000, @@ -90,6 +91,7 @@ describe('Analytics job clone action', () => { prediction_field_name: 'stab_prediction', training_percent: 20, randomize_seed: -2228827740028660200, + num_top_feature_importance_values: 4, }, }, analyzed_fields: { @@ -120,6 +122,7 @@ describe('Analytics job clone action', () => { classification: { dependent_variable: 'y', num_top_classes: 2, + num_top_feature_importance_values: 4, prediction_field_name: 'y_prediction', training_percent: 2, randomize_seed: 6233212276062807000, @@ -188,6 +191,7 @@ describe('Analytics job clone action', () => { prediction_field_name: 'stab_prediction', training_percent: 20, randomize_seed: -2228827740028660200, + num_top_feature_importance_values: 4, }, }, analyzed_fields: { @@ -218,6 +222,7 @@ describe('Analytics job clone action', () => { dependent_variable: 'y', training_percent: 71, max_trees: 1500, + num_top_feature_importance_values: 4, }, }, model_memory_limit: '400mb', @@ -243,6 +248,7 @@ describe('Analytics job clone action', () => { dependent_variable: 'y', training_percent: 71, maximum_number_trees: 1500, + num_top_feature_importance_values: 4, }, }, model_memory_limit: '400mb', diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.tsx index 3a0f98fc5acaa..eb1871c98764b 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/action_clone.tsx @@ -11,7 +11,10 @@ import { i18n } from '@kbn/i18n'; import { DeepReadonly } from '../../../../../../../common/types/common'; import { DataFrameAnalyticsConfig, isOutlierAnalysis } from '../../../../common'; import { isClassificationAnalysis, isRegressionAnalysis } from '../../../../common/analytics'; -import { CreateAnalyticsFormProps } from '../../hooks/use_create_analytics_form'; +import { + CreateAnalyticsFormProps, + DEFAULT_NUM_TOP_FEATURE_IMPORTANCE_VALUES, +} from '../../hooks/use_create_analytics_form'; import { State } from '../../hooks/use_create_analytics_form/state'; import { DataFrameAnalyticsListRow } from './common'; @@ -97,6 +100,8 @@ const getAnalyticsJobMeta = (config: CloneDataFrameAnalyticsConfig): AnalyticsJo }, num_top_feature_importance_values: { optional: true, + defaultValue: DEFAULT_NUM_TOP_FEATURE_IMPORTANCE_VALUES, + formKey: 'numTopFeatureImportanceValues', }, class_assignment_objective: { optional: true, @@ -164,6 +169,8 @@ const getAnalyticsJobMeta = (config: CloneDataFrameAnalyticsConfig): AnalyticsJo }, num_top_feature_importance_values: { optional: true, + defaultValue: DEFAULT_NUM_TOP_FEATURE_IMPORTANCE_VALUES, + formKey: 'numTopFeatureImportanceValues', }, randomize_seed: { optional: true, diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_form/create_analytics_form.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_form/create_analytics_form.tsx index 044bb9f517001..e5f30a50ed8f0 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_form/create_analytics_form.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/components/create_analytics_form/create_analytics_form.tsx @@ -10,6 +10,7 @@ import { EuiComboBox, EuiComboBoxOptionOption, EuiForm, + EuiFieldNumber, EuiFieldText, EuiFormRow, EuiLink, @@ -41,6 +42,7 @@ import { ANALYSIS_CONFIG_TYPE, DfAnalyticsExplainResponse, FieldSelectionItem, + NUM_TOP_FEATURE_IMPORTANCE_VALUES_MIN, TRAINING_PERCENT_MIN, TRAINING_PERCENT_MAX, } from '../../../../common/analytics'; @@ -83,6 +85,8 @@ export const CreateAnalyticsForm: FC = ({ actions, sta maxDistinctValuesError, modelMemoryLimit, modelMemoryLimitValidationResult, + numTopFeatureImportanceValues, + numTopFeatureImportanceValuesValid, previousJobType, previousSourceIndex, sourceIndex, @@ -645,6 +649,54 @@ export const CreateAnalyticsForm: FC = ({ actions, sta data-test-subj="mlAnalyticsCreateJobFlyoutTrainingPercentSlider" /> + {/* num_top_feature_importance_values */} + + {i18n.translate( + 'xpack.ml.dataframe.analytics.create.numTopFeatureImportanceValuesErrorText', + { + defaultMessage: + 'Invalid maximum number of feature importance values.', + } + )} + , + ] + : []), + ]} + > + setFormState({ numTopFeatureImportanceValues: +e.target.value })} + step={1} + value={numTopFeatureImportanceValues} + /> + )} merge(getInitialState(), { form: { @@ -34,7 +41,11 @@ const getMockState = ({ source: { index }, dest: { index: 'the-destination-index' }, analysis: { - classification: { dependent_variable: 'the-variable', training_percent: trainingPercent }, + classification: { + dependent_variable: 'the-variable', + num_top_feature_importance_values: numTopFeatureImportanceValues, + training_percent: trainingPercent, + }, }, model_memory_limit: modelMemoryLimit, }, @@ -173,6 +184,27 @@ describe('useCreateAnalyticsForm', () => { .isValid ).toBe(false); }); + + test('validateAdvancedEditor(): check num_top_feature_importance_values validation', () => { + // valid num_top_feature_importance_values value + expect( + validateAdvancedEditor( + getMockState({ index: 'the-source-index', numTopFeatureImportanceValues: 1 }) + ).isValid + ).toBe(true); + // invalid num_top_feature_importance_values numeric value + expect( + validateAdvancedEditor( + getMockState({ index: 'the-source-index', numTopFeatureImportanceValues: -1 }) + ).isValid + ).toBe(false); + // invalid training_percent numeric value if not an integer + expect( + validateAdvancedEditor( + getMockState({ index: 'the-source-index', numTopFeatureImportanceValues: 1.1 }) + ).isValid + ).toBe(false); + }); }); describe('validateMinMML', () => { @@ -194,3 +226,24 @@ describe('validateMinMML', () => { expect(validateMinMML((undefined as unknown) as string)('')).toEqual(null); }); }); + +describe('validateNumTopFeatureImportanceValues()', () => { + test('should not allow below 0', () => { + expect(validateNumTopFeatureImportanceValues(-1)).toBe(false); + }); + + test('should not allow strings', () => { + expect(validateNumTopFeatureImportanceValues('1')).toBe(false); + }); + + test('should not allow floats', () => { + expect(validateNumTopFeatureImportanceValues(0.1)).toBe(false); + expect(validateNumTopFeatureImportanceValues(1.1)).toBe(false); + expect(validateNumTopFeatureImportanceValues(-1.1)).toBe(false); + }); + + test('should allow 0 and higher', () => { + expect(validateNumTopFeatureImportanceValues(0)).toBe(true); + expect(validateNumTopFeatureImportanceValues(1)).toBe(true); + }); +}); diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/reducer.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/reducer.ts index 28d8afbcd88cc..ded6e50947035 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/reducer.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/reducer.ts @@ -31,10 +31,12 @@ import { } from '../../../../../../../common/constants/validation'; import { getDependentVar, + getNumTopFeatureImportanceValues, getTrainingPercent, isRegressionAnalysis, isClassificationAnalysis, ANALYSIS_CONFIG_TYPE, + NUM_TOP_FEATURE_IMPORTANCE_VALUES_MIN, TRAINING_PERCENT_MIN, TRAINING_PERCENT_MAX, } from '../../../../common/analytics'; @@ -100,6 +102,19 @@ const getSourceIndexString = (state: State) => { return ''; }; +/** + * Validates num_top_feature_importance_values. Must be an integer >= 0. + */ +export const validateNumTopFeatureImportanceValues = ( + numTopFeatureImportanceValues: any +): boolean => { + return ( + typeof numTopFeatureImportanceValues === 'number' && + numTopFeatureImportanceValues >= NUM_TOP_FEATURE_IMPORTANCE_VALUES_MIN && + Number.isInteger(numTopFeatureImportanceValues) + ); +}; + export const validateAdvancedEditor = (state: State): State => { const { jobIdEmpty, @@ -147,6 +162,7 @@ export const validateAdvancedEditor = (state: State): State => { let dependentVariableEmpty = false; let excludesValid = true; let trainingPercentValid = true; + let numTopFeatureImportanceValuesValid = true; if ( jobConfig.analysis === undefined && @@ -180,6 +196,7 @@ export const validateAdvancedEditor = (state: State): State => { if ( trainingPercent !== undefined && (isNaN(trainingPercent) || + typeof trainingPercent !== 'number' || trainingPercent < TRAINING_PERCENT_MIN || trainingPercent > TRAINING_PERCENT_MAX) ) { @@ -189,7 +206,7 @@ export const validateAdvancedEditor = (state: State): State => { error: i18n.translate( 'xpack.ml.dataframe.analytics.create.advancedEditorMessage.trainingPercentInvalid', { - defaultMessage: 'The training percent must be a value between {min} and {max}.', + defaultMessage: 'The training percent must be a number between {min} and {max}.', values: { min: TRAINING_PERCENT_MIN, max: TRAINING_PERCENT_MAX, @@ -199,6 +216,28 @@ export const validateAdvancedEditor = (state: State): State => { message: '', }); } + + const numTopFeatureImportanceValues = getNumTopFeatureImportanceValues(jobConfig.analysis); + if (numTopFeatureImportanceValues !== undefined) { + numTopFeatureImportanceValuesValid = validateNumTopFeatureImportanceValues( + numTopFeatureImportanceValues + ); + if (numTopFeatureImportanceValuesValid === false) { + state.advancedEditorMessages.push({ + error: i18n.translate( + 'xpack.ml.dataframe.analytics.create.advancedEditorMessage.numTopFeatureImportanceValuesInvalid', + { + defaultMessage: + 'The value for num_top_feature_importance_values must be an integer of {min} or higher.', + values: { + min: 0, + }, + } + ), + message: '', + }); + } + } } if (sourceIndexNameEmpty) { @@ -233,6 +272,17 @@ export const validateAdvancedEditor = (state: State): State => { ), message: '', }); + } else if (destinationIndexPatternTitleExists && !createIndexPattern) { + state.advancedEditorMessages.push({ + error: i18n.translate( + 'xpack.ml.dataframe.analytics.create.advancedEditorMessage.destinationIndexNameExistsWarn', + { + defaultMessage: + 'An index with this destination index name already exists. Be aware that running this analytics job will modify this destination index.', + } + ), + message: '', + }); } else if (!destinationIndexNameValid) { state.advancedEditorMessages.push({ error: i18n.translate( @@ -276,6 +326,8 @@ export const validateAdvancedEditor = (state: State): State => { }); } + state.form.destinationIndexPatternTitleExists = destinationIndexPatternTitleExists; + state.isValid = maxDistinctValuesError === undefined && excludesValid && @@ -290,6 +342,7 @@ export const validateAdvancedEditor = (state: State): State => { destinationIndexNameValid && !dependentVariableEmpty && !modelMemoryLimitEmpty && + numTopFeatureImportanceValuesValid && (!destinationIndexPatternTitleExists || !createIndexPattern); return state; @@ -343,6 +396,7 @@ const validateForm = (state: State): State => { dependentVariable, maxDistinctValuesError, modelMemoryLimit, + numTopFeatureImportanceValuesValid, } = state.form; const { estimatedModelMemoryLimit } = state; @@ -368,6 +422,7 @@ const validateForm = (state: State): State => { !destinationIndexNameEmpty && destinationIndexNameValid && !dependentVariableEmpty && + numTopFeatureImportanceValuesValid && (!destinationIndexPatternTitleExists || !createIndexPattern); return state; @@ -443,6 +498,12 @@ export function reducer(state: State, action: Action): State { newFormState.sourceIndexNameValid = Object.keys(validationMessages).length === 0; } + if (action.payload.numTopFeatureImportanceValues !== undefined) { + newFormState.numTopFeatureImportanceValuesValid = validateNumTopFeatureImportanceValues( + newFormState?.numTopFeatureImportanceValues + ); + } + return state.isAdvancedEditorEnabled ? validateAdvancedEditor({ ...state, form: newFormState }) : validateForm({ ...state, form: newFormState }); diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/state.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/state.ts index fe741fe9a92d4..01a39d2ef9f3b 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/state.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/state.ts @@ -25,6 +25,8 @@ export enum DEFAULT_MODEL_MEMORY_LIMIT { classification = '100mb', } +export const DEFAULT_NUM_TOP_FEATURE_IMPORTANCE_VALUES = 2; + export type EsIndexName = string; export type DependentVariable = string; export type IndexPatternTitle = string; @@ -69,6 +71,8 @@ export interface State { modelMemoryLimit: string | undefined; modelMemoryLimitUnitValid: boolean; modelMemoryLimitValidationResult: any; + numTopFeatureImportanceValues: number | undefined; + numTopFeatureImportanceValuesValid: boolean; previousJobType: null | AnalyticsJobType; previousSourceIndex: EsIndexName | undefined; sourceIndex: EsIndexName; @@ -124,6 +128,8 @@ export const getInitialState = (): State => ({ modelMemoryLimit: undefined, modelMemoryLimitUnitValid: true, modelMemoryLimitValidationResult: null, + numTopFeatureImportanceValues: DEFAULT_NUM_TOP_FEATURE_IMPORTANCE_VALUES, + numTopFeatureImportanceValuesValid: true, previousJobType: null, previousSourceIndex: undefined, sourceIndex: '', @@ -184,6 +190,7 @@ export const getJobConfigFromFormState = ( jobConfig.analysis = { [formState.jobType]: { dependent_variable: formState.dependentVariable, + num_top_feature_importance_values: formState.numTopFeatureImportanceValues, training_percent: formState.trainingPercent, }, }; @@ -218,6 +225,7 @@ export function getCloneFormStateFromJobConfig( const analysisConfig = analyticsJobConfig.analysis[jobType]; resultState.dependentVariable = analysisConfig.dependent_variable; + resultState.numTopFeatureImportanceValues = analysisConfig.num_top_feature_importance_values; resultState.trainingPercent = analysisConfig.training_percent; } diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/use_create_analytics_form.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/use_create_analytics_form.ts index 44bfc0c5a472c..2478dbf7cf63d 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/use_create_analytics_form.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/use_create_analytics_form.ts @@ -47,7 +47,8 @@ export const useCreateAnalyticsForm = (): CreateAnalyticsFormProps => { const { refresh } = useRefreshAnalyticsList(); const { form, jobConfig, isAdvancedEditorEnabled } = state; - const { createIndexPattern, destinationIndex, jobId } = form; + const { createIndexPattern, jobId } = form; + let { destinationIndex } = form; const addRequestMessage = (requestMessage: FormMessage) => dispatch({ type: ACTION.ADD_REQUEST_MESSAGE, requestMessage }); @@ -90,9 +91,13 @@ export const useCreateAnalyticsForm = (): CreateAnalyticsFormProps => { resetRequestMessages(); setIsModalButtonDisabled(true); - const analyticsJobConfig = isAdvancedEditorEnabled + const analyticsJobConfig = (isAdvancedEditorEnabled ? jobConfig - : getJobConfigFromFormState(form); + : getJobConfigFromFormState(form)) as DataFrameAnalyticsConfig; + + if (isAdvancedEditorEnabled) { + destinationIndex = analyticsJobConfig.dest.index; + } try { await ml.dataFrameAnalytics.createDataFrameAnalytics(jobId, analyticsJobConfig); diff --git a/x-pack/plugins/ml/public/application/management/index.ts b/x-pack/plugins/ml/public/application/management/index.ts index 385140771e08f..a6fe9e1d11953 100644 --- a/x-pack/plugins/ml/public/application/management/index.ts +++ b/x-pack/plugins/ml/public/application/management/index.ts @@ -16,8 +16,6 @@ import { take } from 'rxjs/operators'; import { CoreSetup } from 'kibana/public'; import { MlStartDependencies, MlSetupDependencies } from '../../plugin'; -import { LICENSE_CHECK_STATE } from '../../../../licensing/public'; - import { PLUGIN_ID, PLUGIN_ICON } from '../../../common/constants/app'; import { MINIMUM_FULL_LICENSE } from '../../../common/license'; @@ -27,7 +25,7 @@ export function initManagementSection( ) { const licensing = pluginsSetup.licensing.license$.pipe(take(1)); licensing.subscribe(license => { - if (license.check(PLUGIN_ID, MINIMUM_FULL_LICENSE).state === LICENSE_CHECK_STATE.Valid) { + if (license.check(PLUGIN_ID, MINIMUM_FULL_LICENSE).state === 'valid') { const management = pluginsSetup.management; const mlSection = management.sections.register({ id: PLUGIN_ID, diff --git a/x-pack/plugins/painless_lab/public/plugin.tsx b/x-pack/plugins/painless_lab/public/plugin.tsx index b9ca7031cf670..e76128313545a 100644 --- a/x-pack/plugins/painless_lab/public/plugin.tsx +++ b/x-pack/plugins/painless_lab/public/plugin.tsx @@ -11,7 +11,6 @@ import { first } from 'rxjs/operators'; import { EuiBetaBadge, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { FeatureCatalogueCategory } from '../../../../src/plugins/home/public'; -import { LICENSE_CHECK_STATE } from '../../licensing/public'; import { PLUGIN } from '../common/constants'; @@ -82,7 +81,7 @@ export class PainlessLabUIPlugin implements Plugin { const { state, message } = license.check(pluginId, minimumLicenseType); - const hasRequiredLicense = state === LICENSE_CHECK_STATE.Valid; + const hasRequiredLicense = state === 'valid'; if (hasRequiredLicense) { this.licenseStatus = { isValid: true }; diff --git a/x-pack/plugins/remote_clusters/server/plugin.ts b/x-pack/plugins/remote_clusters/server/plugin.ts index 837d53c7dbc1b..b86f16228878a 100644 --- a/x-pack/plugins/remote_clusters/server/plugin.ts +++ b/x-pack/plugins/remote_clusters/server/plugin.ts @@ -7,7 +7,6 @@ import { i18n } from '@kbn/i18n'; import { CoreSetup, Logger, Plugin, PluginInitializerContext } from 'src/core/server'; import { Observable } from 'rxjs'; -import { LICENSE_CHECK_STATE } from '../../licensing/common/types'; import { PLUGIN } from '../common/constants'; import { Dependencies, LicenseStatus, RouteDependencies } from './types'; @@ -54,7 +53,7 @@ export class RemoteClustersServerPlugin implements Plugin licensing.license$.subscribe(license => { const { state, message } = license.check(PLUGIN.getI18nName(), PLUGIN.minimumLicenseType); - const hasRequiredLicense = state === LICENSE_CHECK_STATE.Valid; + const hasRequiredLicense = state === 'valid'; if (hasRequiredLicense) { this.licenseStatus = { valid: true }; } else { diff --git a/x-pack/plugins/reporting/public/lib/license_check.test.ts b/x-pack/plugins/reporting/public/lib/license_check.test.ts index 24e14969d2c81..22737509923d3 100644 --- a/x-pack/plugins/reporting/public/lib/license_check.test.ts +++ b/x-pack/plugins/reporting/public/lib/license_check.test.ts @@ -4,11 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ import { checkLicense } from './license_check'; -import { LicenseCheck } from '../../../licensing/public'; describe('License check', () => { it('enables and shows links when licenses are good mkay', () => { - expect(checkLicense({ state: 'VALID' } as LicenseCheck)).toEqual({ + expect(checkLicense({ state: 'valid' })).toEqual({ enableLinks: true, showLinks: true, message: '', @@ -16,7 +15,7 @@ describe('License check', () => { }); it('disables and shows links when licenses are not valid', () => { - expect(checkLicense({ state: 'INVALID' } as LicenseCheck)).toEqual({ + expect(checkLicense({ state: 'invalid' })).toEqual({ enableLinks: false, showLinks: false, message: 'Your license does not support Reporting. Please upgrade your license.', @@ -24,7 +23,7 @@ describe('License check', () => { }); it('shows links, but disables them, on expired licenses', () => { - expect(checkLicense({ state: 'EXPIRED' } as LicenseCheck)).toEqual({ + expect(checkLicense({ state: 'expired' })).toEqual({ enableLinks: false, showLinks: true, message: 'You cannot use Reporting because your license has expired.', @@ -32,7 +31,7 @@ describe('License check', () => { }); it('shows links, but disables them, when license checks are unavailable', () => { - expect(checkLicense({ state: 'UNAVAILABLE' } as LicenseCheck)).toEqual({ + expect(checkLicense({ state: 'unavailable' })).toEqual({ enableLinks: false, showLinks: true, message: diff --git a/x-pack/plugins/reporting/public/lib/license_check.ts b/x-pack/plugins/reporting/public/lib/license_check.ts index ca803fb38ef2a..0c16ead0b116d 100644 --- a/x-pack/plugins/reporting/public/lib/license_check.ts +++ b/x-pack/plugins/reporting/public/lib/license_check.ts @@ -4,11 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ import { LicenseCheckResults } from '../..'; -import { LICENSE_CHECK_STATE, LicenseCheck } from '../../../licensing/public'; +import { LicenseCheck } from '../../../licensing/public'; export const checkLicense = (checkResults: LicenseCheck): LicenseCheckResults => { switch (checkResults.state) { - case LICENSE_CHECK_STATE.Valid: { + case 'valid': { return { showLinks: true, enableLinks: true, @@ -16,7 +16,7 @@ export const checkLicense = (checkResults: LicenseCheck): LicenseCheckResults => }; } - case LICENSE_CHECK_STATE.Invalid: { + case 'invalid': { return { showLinks: false, enableLinks: false, @@ -24,7 +24,7 @@ export const checkLicense = (checkResults: LicenseCheck): LicenseCheckResults => }; } - case LICENSE_CHECK_STATE.Unavailable: { + case 'unavailable': { return { showLinks: true, enableLinks: false, @@ -33,7 +33,7 @@ export const checkLicense = (checkResults: LicenseCheck): LicenseCheckResults => }; } - case LICENSE_CHECK_STATE.Expired: { + case 'expired': { return { showLinks: true, enableLinks: false, diff --git a/x-pack/plugins/reporting/public/lib/reporting_api_client.ts b/x-pack/plugins/reporting/public/lib/reporting_api_client.ts index cddfcd3ec855a..b6c33860752d6 100644 --- a/x-pack/plugins/reporting/public/lib/reporting_api_client.ts +++ b/x-pack/plugins/reporting/public/lib/reporting_api_client.ts @@ -9,12 +9,7 @@ import rison from 'rison-node'; import { HttpSetup } from 'src/core/public'; import { add } from './job_completion_notifications'; -import { - API_LIST_URL, - API_BASE_URL, - API_BASE_GENERATE, - REPORTING_MANAGEMENT_HOME, -} from '../../constants'; +import { API_LIST_URL, API_BASE_GENERATE, REPORTING_MANAGEMENT_HOME } from '../../constants'; import { JobId, SourceJob } from '../..'; export interface JobQueueEntry { @@ -129,12 +124,17 @@ export class ReportingAPIClient { }); }; + /* + * Return a URL to queue a job, with the job params encoded in the query string of the URL. Used for copying POST URL + */ public getReportingJobPath = (exportType: string, jobParams: JobParams) => { const params = stringify({ jobParams: rison.encode(jobParams) }); - - return `${this.http.basePath.prepend(API_BASE_URL)}/${exportType}?${params}`; + return `${this.http.basePath.prepend(API_BASE_GENERATE)}/${exportType}?${params}`; }; + /* + * Sends a request to queue a job, with the job params in the POST body + */ public createReportingJob = async (exportType: string, jobParams: any) => { const jobParamsRison = rison.encode(jobParams); const resp = await this.http.post(`${API_BASE_GENERATE}/${exportType}`, { @@ -154,5 +154,8 @@ export class ReportingAPIClient { public getDownloadLink = (jobId: JobId) => this.http.basePath.prepend(`${API_LIST_URL}/download/${jobId}`); - public getBasePath = () => this.http.basePath.get(); + /* + * provides the raw server basePath to allow it to be stripped out from relativeUrls in job params + */ + public getServerBasePath = () => this.http.basePath.serverBasePath; } diff --git a/x-pack/plugins/reporting/public/share_context_menu/register_pdf_png_reporting.tsx b/x-pack/plugins/reporting/public/share_context_menu/register_pdf_png_reporting.tsx index e9eaa9c2ed2a1..2a955ea398bd4 100644 --- a/x-pack/plugins/reporting/public/share_context_menu/register_pdf_png_reporting.tsx +++ b/x-pack/plugins/reporting/public/share_context_menu/register_pdf_png_reporting.tsx @@ -58,9 +58,10 @@ export const reportingPDFPNGProvider = ({ } const getReportingJobParams = () => { + // Relative URL must have URL prefix (Spaces ID prefix), but not server basePath // Replace hashes with original RISON values. const relativeUrl = shareableUrl.replace( - window.location.origin + apiClient.getBasePath(), + window.location.origin + apiClient.getServerBasePath(), '' ); @@ -80,7 +81,7 @@ export const reportingPDFPNGProvider = ({ const getPngJobParams = () => { // Replace hashes with original RISON values. const relativeUrl = shareableUrl.replace( - window.location.origin + apiClient.getBasePath(), + window.location.origin + apiClient.getServerBasePath(), '' ); diff --git a/x-pack/plugins/searchprofiler/public/plugin.ts b/x-pack/plugins/searchprofiler/public/plugin.ts index 7d77b274ec49d..179886c0807d2 100644 --- a/x-pack/plugins/searchprofiler/public/plugin.ts +++ b/x-pack/plugins/searchprofiler/public/plugin.ts @@ -9,7 +9,6 @@ import { Plugin, CoreStart, CoreSetup, PluginInitializerContext } from 'kibana/p import { first } from 'rxjs/operators'; import { FeatureCatalogueCategory } from '../../../../src/plugins/home/public'; -import { LICENSE_CHECK_STATE } from '../../licensing/public'; import { PLUGIN } from '../common'; import { AppPublicPluginDependencies } from './types'; @@ -50,7 +49,7 @@ export class SearchProfilerUIPlugin implements Plugin { const { state, message } = license.check(PLUGIN.id, PLUGIN.minimumLicenseType); - const hasRequiredLicense = state === LICENSE_CHECK_STATE.Valid; + const hasRequiredLicense = state === 'valid'; if (hasRequiredLicense) { this.licenseStatus = { valid: true }; } else { diff --git a/x-pack/plugins/security/server/routes/api_keys/get.test.ts b/x-pack/plugins/security/server/routes/api_keys/get.test.ts index 2b2283edea2e8..f77469552d980 100644 --- a/x-pack/plugins/security/server/routes/api_keys/get.test.ts +++ b/x-pack/plugins/security/server/routes/api_keys/get.test.ts @@ -5,7 +5,7 @@ */ import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../src/core/server'; -import { LICENSE_CHECK_STATE, LicenseCheck } from '../../../../licensing/server'; +import { LicenseCheck } from '../../../../licensing/server'; import { defineGetApiKeysRoutes } from './get'; import { elasticsearchServiceMock, httpServerMock } from '../../../../../../src/core/server/mocks'; @@ -22,12 +22,7 @@ interface TestOptions { describe('Get API keys', () => { const getApiKeysTest = ( description: string, - { - licenseCheckResult = { state: LICENSE_CHECK_STATE.Valid }, - apiResponse, - asserts, - isAdmin = true, - }: TestOptions + { licenseCheckResult = { state: 'valid' }, apiResponse, asserts, isAdmin = true }: TestOptions ) => { test(description, async () => { const mockRouteDefinitionParams = routeDefinitionParamsMock.create(); @@ -71,7 +66,7 @@ describe('Get API keys', () => { describe('failure', () => { getApiKeysTest('returns result of license checker', { - licenseCheckResult: { state: LICENSE_CHECK_STATE.Invalid, message: 'test forbidden message' }, + licenseCheckResult: { state: 'invalid', message: 'test forbidden message' }, asserts: { statusCode: 403, result: { message: 'test forbidden message' } }, }); diff --git a/x-pack/plugins/security/server/routes/api_keys/invalidate.test.ts b/x-pack/plugins/security/server/routes/api_keys/invalidate.test.ts index 4ea21bda5f743..2889cf78aff83 100644 --- a/x-pack/plugins/security/server/routes/api_keys/invalidate.test.ts +++ b/x-pack/plugins/security/server/routes/api_keys/invalidate.test.ts @@ -7,7 +7,7 @@ import Boom from 'boom'; import { Type } from '@kbn/config-schema'; import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../src/core/server'; -import { LICENSE_CHECK_STATE, LicenseCheck } from '../../../../licensing/server'; +import { LicenseCheck } from '../../../../licensing/server'; import { defineInvalidateApiKeysRoutes } from './invalidate'; import { elasticsearchServiceMock, httpServerMock } from '../../../../../../src/core/server/mocks'; @@ -23,12 +23,7 @@ interface TestOptions { describe('Invalidate API keys', () => { const postInvalidateTest = ( description: string, - { - licenseCheckResult = { state: LICENSE_CHECK_STATE.Valid }, - apiResponses = [], - asserts, - payload, - }: TestOptions + { licenseCheckResult = { state: 'valid' }, apiResponses = [], asserts, payload }: TestOptions ) => { test(description, async () => { const mockRouteDefinitionParams = routeDefinitionParamsMock.create(); @@ -116,7 +111,7 @@ describe('Invalidate API keys', () => { describe('failure', () => { postInvalidateTest('returns result of license checker', { - licenseCheckResult: { state: LICENSE_CHECK_STATE.Invalid, message: 'test forbidden message' }, + licenseCheckResult: { state: 'invalid', message: 'test forbidden message' }, payload: { apiKeys: [{ id: 'si8If24B1bKsmSLTAhJV', name: 'my-api-key' }], isAdmin: true }, asserts: { statusCode: 403, result: { message: 'test forbidden message' } }, }); diff --git a/x-pack/plugins/security/server/routes/api_keys/privileges.test.ts b/x-pack/plugins/security/server/routes/api_keys/privileges.test.ts index 866e455063bdc..311d50e9eb169 100644 --- a/x-pack/plugins/security/server/routes/api_keys/privileges.test.ts +++ b/x-pack/plugins/security/server/routes/api_keys/privileges.test.ts @@ -5,7 +5,7 @@ */ import Boom from 'boom'; -import { LICENSE_CHECK_STATE, LicenseCheck } from '../../../../licensing/server'; +import { LicenseCheck } from '../../../../licensing/server'; import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../src/core/server'; import { elasticsearchServiceMock, httpServerMock } from '../../../../../../src/core/server/mocks'; @@ -21,11 +21,7 @@ interface TestOptions { describe('Check API keys privileges', () => { const getPrivilegesTest = ( description: string, - { - licenseCheckResult = { state: LICENSE_CHECK_STATE.Valid }, - apiResponses = [], - asserts, - }: TestOptions + { licenseCheckResult = { state: 'valid' }, apiResponses = [], asserts }: TestOptions ) => { test(description, async () => { const mockRouteDefinitionParams = routeDefinitionParamsMock.create(); @@ -68,7 +64,7 @@ describe('Check API keys privileges', () => { describe('failure', () => { getPrivilegesTest('returns result of license checker', { - licenseCheckResult: { state: LICENSE_CHECK_STATE.Invalid, message: 'test forbidden message' }, + licenseCheckResult: { state: 'invalid', message: 'test forbidden message' }, asserts: { statusCode: 403, result: { message: 'test forbidden message' } }, }); diff --git a/x-pack/plugins/security/server/routes/authentication/basic.test.ts b/x-pack/plugins/security/server/routes/authentication/basic.test.ts index 3c114978f26d2..5eed8e166c957 100644 --- a/x-pack/plugins/security/server/routes/authentication/basic.test.ts +++ b/x-pack/plugins/security/server/routes/authentication/basic.test.ts @@ -12,7 +12,6 @@ import { RequestHandlerContext, RouteConfig, } from '../../../../../../src/core/server'; -import { LICENSE_CHECK_STATE } from '../../../../licensing/server'; import { Authentication, AuthenticationResult } from '../../authentication'; import { defineBasicRoutes } from './basic'; @@ -33,7 +32,7 @@ describe('Basic authentication routes', () => { mockContext = ({ licensing: { - license: { check: jest.fn().mockReturnValue({ check: LICENSE_CHECK_STATE.Valid }) }, + license: { check: jest.fn().mockReturnValue({ check: 'valid' }) }, }, } as unknown) as RequestHandlerContext; diff --git a/x-pack/plugins/security/server/routes/authentication/common.test.ts b/x-pack/plugins/security/server/routes/authentication/common.test.ts index e2f9593bc09ee..156c03e90210b 100644 --- a/x-pack/plugins/security/server/routes/authentication/common.test.ts +++ b/x-pack/plugins/security/server/routes/authentication/common.test.ts @@ -12,7 +12,6 @@ import { RequestHandlerContext, RouteConfig, } from '../../../../../../src/core/server'; -import { LICENSE_CHECK_STATE } from '../../../../licensing/server'; import { Authentication, AuthenticationResult, @@ -37,7 +36,7 @@ describe('Common authentication routes', () => { mockContext = ({ licensing: { - license: { check: jest.fn().mockReturnValue({ check: LICENSE_CHECK_STATE.Valid }) }, + license: { check: jest.fn().mockReturnValue({ check: 'valid' }) }, }, } as unknown) as RequestHandlerContext; diff --git a/x-pack/plugins/security/server/routes/authorization/privileges/get.test.ts b/x-pack/plugins/security/server/routes/authorization/privileges/get.test.ts index 6afbad8e83ebe..7301a3cf51974 100644 --- a/x-pack/plugins/security/server/routes/authorization/privileges/get.test.ts +++ b/x-pack/plugins/security/server/routes/authorization/privileges/get.test.ts @@ -5,7 +5,7 @@ */ import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../../src/core/server'; -import { LicenseCheck, LICENSE_CHECK_STATE } from '../../../../../licensing/server'; +import { LicenseCheck } from '../../../../../licensing/server'; import { RawKibanaPrivileges } from '../../../../common/model'; import { defineGetPrivilegesRoutes } from './get'; @@ -46,11 +46,7 @@ interface TestOptions { describe('GET privileges', () => { const getPrivilegesTest = ( description: string, - { - licenseCheckResult = { state: LICENSE_CHECK_STATE.Valid }, - includeActions, - asserts, - }: TestOptions + { licenseCheckResult = { state: 'valid' }, includeActions, asserts }: TestOptions ) => { test(description, async () => { const mockRouteDefinitionParams = routeDefinitionParamsMock.create(); @@ -82,7 +78,7 @@ describe('GET privileges', () => { describe('failure', () => { getPrivilegesTest('returns result of license checker', { - licenseCheckResult: { state: LICENSE_CHECK_STATE.Invalid, message: 'test forbidden message' }, + licenseCheckResult: { state: 'invalid', message: 'test forbidden message' }, asserts: { statusCode: 403, result: { message: 'test forbidden message' } }, }); }); diff --git a/x-pack/plugins/security/server/routes/authorization/roles/delete.test.ts b/x-pack/plugins/security/server/routes/authorization/roles/delete.test.ts index 22268245c3a44..ada6a1c8d2dc3 100644 --- a/x-pack/plugins/security/server/routes/authorization/roles/delete.test.ts +++ b/x-pack/plugins/security/server/routes/authorization/roles/delete.test.ts @@ -6,7 +6,7 @@ import Boom from 'boom'; import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../../src/core/server'; -import { LicenseCheck, LICENSE_CHECK_STATE } from '../../../../../licensing/server'; +import { LicenseCheck } from '../../../../../licensing/server'; import { defineDeleteRolesRoutes } from './delete'; import { @@ -25,12 +25,7 @@ interface TestOptions { describe('DELETE role', () => { const deleteRoleTest = ( description: string, - { - name, - licenseCheckResult = { state: LICENSE_CHECK_STATE.Valid }, - apiResponse, - asserts, - }: TestOptions + { name, licenseCheckResult = { state: 'valid' }, apiResponse, asserts }: TestOptions ) => { test(description, async () => { const mockRouteDefinitionParams = routeDefinitionParamsMock.create(); @@ -75,7 +70,7 @@ describe('DELETE role', () => { describe('failure', () => { deleteRoleTest('returns result of license checker', { name: 'foo-role', - licenseCheckResult: { state: LICENSE_CHECK_STATE.Invalid, message: 'test forbidden message' }, + licenseCheckResult: { state: 'invalid', message: 'test forbidden message' }, asserts: { statusCode: 403, result: { message: 'test forbidden message' } }, }); diff --git a/x-pack/plugins/security/server/routes/authorization/roles/get.test.ts b/x-pack/plugins/security/server/routes/authorization/roles/get.test.ts index bb9edbd17b2c8..49123fe9c74d7 100644 --- a/x-pack/plugins/security/server/routes/authorization/roles/get.test.ts +++ b/x-pack/plugins/security/server/routes/authorization/roles/get.test.ts @@ -5,7 +5,7 @@ */ import Boom from 'boom'; import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../../src/core/server'; -import { LicenseCheck, LICENSE_CHECK_STATE } from '../../../../../licensing/server'; +import { LicenseCheck } from '../../../../../licensing/server'; import { defineGetRolesRoutes } from './get'; import { @@ -27,12 +27,7 @@ interface TestOptions { describe('GET role', () => { const getRoleTest = ( description: string, - { - name, - licenseCheckResult = { state: LICENSE_CHECK_STATE.Valid }, - apiResponse, - asserts, - }: TestOptions + { name, licenseCheckResult = { state: 'valid' }, apiResponse, asserts }: TestOptions ) => { test(description, async () => { const mockRouteDefinitionParams = routeDefinitionParamsMock.create(); @@ -76,7 +71,7 @@ describe('GET role', () => { describe('failure', () => { getRoleTest('returns result of license checker', { - licenseCheckResult: { state: LICENSE_CHECK_STATE.Invalid, message: 'test forbidden message' }, + licenseCheckResult: { state: 'invalid', message: 'test forbidden message' }, asserts: { statusCode: 403, result: { message: 'test forbidden message' } }, }); diff --git a/x-pack/plugins/security/server/routes/authorization/roles/get_all.test.ts b/x-pack/plugins/security/server/routes/authorization/roles/get_all.test.ts index 96f065d6c765a..5dbe8682c5426 100644 --- a/x-pack/plugins/security/server/routes/authorization/roles/get_all.test.ts +++ b/x-pack/plugins/security/server/routes/authorization/roles/get_all.test.ts @@ -5,7 +5,7 @@ */ import Boom from 'boom'; import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../../src/core/server'; -import { LicenseCheck, LICENSE_CHECK_STATE } from '../../../../../licensing/server'; +import { LicenseCheck } from '../../../../../licensing/server'; import { defineGetAllRolesRoutes } from './get_all'; import { @@ -27,7 +27,7 @@ interface TestOptions { describe('GET all roles', () => { const getRolesTest = ( description: string, - { licenseCheckResult = { state: LICENSE_CHECK_STATE.Valid }, apiResponse, asserts }: TestOptions + { licenseCheckResult = { state: 'valid' }, apiResponse, asserts }: TestOptions ) => { test(description, async () => { const mockRouteDefinitionParams = routeDefinitionParamsMock.create(); @@ -68,7 +68,7 @@ describe('GET all roles', () => { describe('failure', () => { getRolesTest('returns result of license checker', { - licenseCheckResult: { state: LICENSE_CHECK_STATE.Invalid, message: 'test forbidden message' }, + licenseCheckResult: { state: 'invalid', message: 'test forbidden message' }, asserts: { statusCode: 403, result: { message: 'test forbidden message' } }, }); diff --git a/x-pack/plugins/security/server/routes/authorization/roles/put.test.ts b/x-pack/plugins/security/server/routes/authorization/roles/put.test.ts index 62b49f0c4e7f0..d7710bf669ce1 100644 --- a/x-pack/plugins/security/server/routes/authorization/roles/put.test.ts +++ b/x-pack/plugins/security/server/routes/authorization/roles/put.test.ts @@ -6,7 +6,7 @@ import { Type } from '@kbn/config-schema'; import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../../src/core/server'; -import { LicenseCheck, LICENSE_CHECK_STATE } from '../../../../../licensing/server'; +import { LicenseCheck } from '../../../../../licensing/server'; import { GLOBAL_RESOURCE } from '../../../../common/constants'; import { definePutRolesRoutes } from './put'; @@ -55,7 +55,7 @@ const putRoleTest = ( { name, payload, - licenseCheckResult = { state: LICENSE_CHECK_STATE.Valid }, + licenseCheckResult = { state: 'valid' }, apiResponses = [], asserts, }: TestOptions @@ -140,7 +140,7 @@ describe('PUT role', () => { describe('failure', () => { putRoleTest('returns result of license checker', { name: 'foo-role', - licenseCheckResult: { state: LICENSE_CHECK_STATE.Invalid, message: 'test forbidden message' }, + licenseCheckResult: { state: 'invalid', message: 'test forbidden message' }, asserts: { statusCode: 403, result: { message: 'test forbidden message' } }, }); }); diff --git a/x-pack/plugins/security/server/routes/licensed_route_handler.ts b/x-pack/plugins/security/server/routes/licensed_route_handler.ts index bc5a6a1139215..b113b2ca59e3e 100644 --- a/x-pack/plugins/security/server/routes/licensed_route_handler.ts +++ b/x-pack/plugins/security/server/routes/licensed_route_handler.ts @@ -5,16 +5,12 @@ */ import { RequestHandler } from 'kibana/server'; -import { LICENSE_CHECK_STATE } from '../../../licensing/server'; export const createLicensedRouteHandler = (handler: RequestHandler) => { const licensedRouteHandler: RequestHandler = (context, request, responseToolkit) => { const { license } = context.licensing; const licenseCheck = license.check('security', 'basic'); - if ( - licenseCheck.state === LICENSE_CHECK_STATE.Unavailable || - licenseCheck.state === LICENSE_CHECK_STATE.Invalid - ) { + if (licenseCheck.state === 'unavailable' || licenseCheck.state === 'invalid') { return responseToolkit.forbidden({ body: { message: licenseCheck.message! } }); } diff --git a/x-pack/plugins/security/server/routes/role_mapping/delete.test.ts b/x-pack/plugins/security/server/routes/role_mapping/delete.test.ts index e8a8a7216330b..34961dbe27675 100644 --- a/x-pack/plugins/security/server/routes/role_mapping/delete.test.ts +++ b/x-pack/plugins/security/server/routes/role_mapping/delete.test.ts @@ -7,7 +7,6 @@ import { routeDefinitionParamsMock } from '../index.mock'; import { elasticsearchServiceMock, httpServerMock } from 'src/core/server/mocks'; import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../src/core/server'; -import { LICENSE_CHECK_STATE } from '../../../../licensing/server'; import { defineRoleMappingDeleteRoutes } from './delete'; describe('DELETE role mappings', () => { @@ -33,7 +32,7 @@ describe('DELETE role mappings', () => { }); const mockContext = ({ licensing: { - license: { check: jest.fn().mockReturnValue({ state: LICENSE_CHECK_STATE.Valid }) }, + license: { check: jest.fn().mockReturnValue({ state: 'valid' }) }, }, } as unknown) as RequestHandlerContext; @@ -67,7 +66,7 @@ describe('DELETE role mappings', () => { licensing: { license: { check: jest.fn().mockReturnValue({ - state: LICENSE_CHECK_STATE.Invalid, + state: 'invalid', message: 'test forbidden message', }), }, diff --git a/x-pack/plugins/security/server/routes/role_mapping/feature_check.test.ts b/x-pack/plugins/security/server/routes/role_mapping/feature_check.test.ts index f2c48fd370434..4fde93d0ad859 100644 --- a/x-pack/plugins/security/server/routes/role_mapping/feature_check.test.ts +++ b/x-pack/plugins/security/server/routes/role_mapping/feature_check.test.ts @@ -11,7 +11,7 @@ import { RequestHandlerContext, IClusterClient, } from '../../../../../../src/core/server'; -import { LICENSE_CHECK_STATE, LicenseCheck } from '../../../../licensing/server'; +import { LicenseCheck } from '../../../../licensing/server'; import { defineRoleMappingFeatureCheckRoute } from './feature_check'; interface TestOptions { @@ -62,7 +62,7 @@ describe('GET role mappings feature check', () => { const getFeatureCheckTest = ( description: string, { - licenseCheckResult = { state: LICENSE_CHECK_STATE.Valid }, + licenseCheckResult = { state: 'valid' }, canManageRoleMappings = true, nodeSettingsResponse = {}, xpackUsageResponse = defaultXpackUsageResponse, diff --git a/x-pack/plugins/security/server/routes/role_mapping/get.test.ts b/x-pack/plugins/security/server/routes/role_mapping/get.test.ts index c60d5518097ba..e0df59ebe7a00 100644 --- a/x-pack/plugins/security/server/routes/role_mapping/get.test.ts +++ b/x-pack/plugins/security/server/routes/role_mapping/get.test.ts @@ -9,7 +9,6 @@ import { routeDefinitionParamsMock } from '../index.mock'; import { elasticsearchServiceMock, httpServerMock } from 'src/core/server/mocks'; import { defineRoleMappingGetRoutes } from './get'; import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../src/core/server'; -import { LICENSE_CHECK_STATE } from '../../../../licensing/server'; const mockRoleMappingResponse = { mapping1: { @@ -70,7 +69,7 @@ describe('GET role mappings', () => { }); const mockContext = ({ licensing: { - license: { check: jest.fn().mockReturnValue({ state: LICENSE_CHECK_STATE.Valid }) }, + license: { check: jest.fn().mockReturnValue({ state: 'valid' }) }, }, } as unknown) as RequestHandlerContext; @@ -158,7 +157,7 @@ describe('GET role mappings', () => { }); const mockContext = ({ licensing: { - license: { check: jest.fn().mockReturnValue({ state: LICENSE_CHECK_STATE.Valid }) }, + license: { check: jest.fn().mockReturnValue({ state: 'valid' }) }, }, } as unknown) as RequestHandlerContext; @@ -201,7 +200,7 @@ describe('GET role mappings', () => { licensing: { license: { check: jest.fn().mockReturnValue({ - state: LICENSE_CHECK_STATE.Invalid, + state: 'invalid', message: 'test forbidden message', }), }, @@ -238,7 +237,7 @@ describe('GET role mappings', () => { }); const mockContext = ({ licensing: { - license: { check: jest.fn().mockReturnValue({ state: LICENSE_CHECK_STATE.Valid }) }, + license: { check: jest.fn().mockReturnValue({ state: 'valid' }) }, }, } as unknown) as RequestHandlerContext; diff --git a/x-pack/plugins/security/server/routes/role_mapping/post.test.ts b/x-pack/plugins/security/server/routes/role_mapping/post.test.ts index 7d820d668a6da..ed3d1bbd0fca2 100644 --- a/x-pack/plugins/security/server/routes/role_mapping/post.test.ts +++ b/x-pack/plugins/security/server/routes/role_mapping/post.test.ts @@ -7,7 +7,6 @@ import { routeDefinitionParamsMock } from '../index.mock'; import { elasticsearchServiceMock, httpServerMock } from 'src/core/server/mocks'; import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../src/core/server'; -import { LICENSE_CHECK_STATE } from '../../../../licensing/server'; import { defineRoleMappingPostRoutes } from './post'; describe('POST role mappings', () => { @@ -42,7 +41,7 @@ describe('POST role mappings', () => { }); const mockContext = ({ licensing: { - license: { check: jest.fn().mockReturnValue({ state: LICENSE_CHECK_STATE.Valid }) }, + license: { check: jest.fn().mockReturnValue({ state: 'valid' }) }, }, } as unknown) as RequestHandlerContext; @@ -86,7 +85,7 @@ describe('POST role mappings', () => { licensing: { license: { check: jest.fn().mockReturnValue({ - state: LICENSE_CHECK_STATE.Invalid, + state: 'invalid', message: 'test forbidden message', }), }, diff --git a/x-pack/plugins/security/server/routes/users/change_password.test.ts b/x-pack/plugins/security/server/routes/users/change_password.test.ts index bac40202ee6ef..fd05821f9d520 100644 --- a/x-pack/plugins/security/server/routes/users/change_password.test.ts +++ b/x-pack/plugins/security/server/routes/users/change_password.test.ts @@ -16,7 +16,6 @@ import { RouteConfig, ScopeableRequest, } from '../../../../../../src/core/server'; -import { LICENSE_CHECK_STATE } from '../../../../licensing/server'; import { Authentication, AuthenticationResult } from '../../authentication'; import { defineChangeUserPasswordRoutes } from './change_password'; @@ -63,7 +62,7 @@ describe('Change password', () => { mockContext = ({ licensing: { - license: { check: jest.fn().mockReturnValue({ check: LICENSE_CHECK_STATE.Valid }) }, + license: { check: jest.fn().mockReturnValue({ check: 'valid' }) }, }, } as unknown) as RequestHandlerContext; diff --git a/x-pack/plugins/snapshot_restore/public/application/mount_management_section.ts b/x-pack/plugins/snapshot_restore/public/application/mount_management_section.ts new file mode 100644 index 0000000000000..9697e24a7147e --- /dev/null +++ b/x-pack/plugins/snapshot_restore/public/application/mount_management_section.ts @@ -0,0 +1,48 @@ +/* + * 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 { CoreSetup } from 'src/core/public'; +import { ManagementAppMountParams } from 'src/plugins/management/public'; +import { i18n } from '@kbn/i18n'; + +import { ClientConfigType } from '../types'; +import { httpService } from './services/http'; +import { UiMetricService } from './services'; +import { breadcrumbService, docTitleService } from './services/navigation'; +import { documentationLinksService } from './services/documentation'; +import { AppDependencies } from './app_context'; +import { renderApp } from '.'; + +export async function mountManagementSection( + coreSetup: CoreSetup, + services: { + uiMetricService: UiMetricService; + }, + config: ClientConfigType, + params: ManagementAppMountParams +) { + const { element, setBreadcrumbs } = params; + const [core] = await coreSetup.getStartServices(); + const { + docLinks, + chrome: { docTitle }, + } = core; + + docTitleService.setup(docTitle.change); + breadcrumbService.setup(setBreadcrumbs); + documentationLinksService.setup(docLinks); + + const appDependencies: AppDependencies = { + core, + config, + services: { + httpService, + uiMetricService: services.uiMetricService, + i18n, + }, + }; + + return renderApp(element, appDependencies); +} diff --git a/x-pack/plugins/snapshot_restore/public/plugin.ts b/x-pack/plugins/snapshot_restore/public/plugin.ts index 30862c2adb35a..d966d0c32651c 100644 --- a/x-pack/plugins/snapshot_restore/public/plugin.ts +++ b/x-pack/plugins/snapshot_restore/public/plugin.ts @@ -9,11 +9,9 @@ import { CoreSetup, PluginInitializerContext } from 'src/core/public'; import { UsageCollectionSetup } from '../../../../src/plugins/usage_collection/public'; import { ManagementSetup } from '../../../../src/plugins/management/public'; import { PLUGIN } from '../common/constants'; -import { AppDependencies } from './application'; + import { ClientConfigType } from './types'; -import { breadcrumbService, docTitleService } from './application/services/navigation'; -import { documentationLinksService } from './application/services/documentation'; import { httpService, setUiMetricService } from './application/services/http'; import { textService } from './application/services/text'; import { UiMetricService } from './application/services'; @@ -34,7 +32,7 @@ export class SnapshotRestoreUIPlugin { public setup(coreSetup: CoreSetup, plugins: PluginsDependencies): void { const config = this.initializerContext.config.get(); - const { http, getStartServices } = coreSetup; + const { http } = coreSetup; const { management, usageCollection } = plugins; // Initialize services @@ -48,29 +46,12 @@ export class SnapshotRestoreUIPlugin { defaultMessage: 'Snapshot and Restore', }), order: 7, - mount: async ({ element, setBreadcrumbs }) => { - const [core] = await getStartServices(); - const { - docLinks, - chrome: { docTitle }, - } = core; - - docTitleService.setup(docTitle.change); - breadcrumbService.setup(setBreadcrumbs); - documentationLinksService.setup(docLinks); - - const appDependencies: AppDependencies = { - core, - config, - services: { - httpService, - uiMetricService: this.uiMetricService, - i18n, - }, + mount: async params => { + const { mountManagementSection } = await import('./application/mount_management_section'); + const services = { + uiMetricService: this.uiMetricService, }; - - const { renderApp } = await import('./application'); - return renderApp(element, appDependencies); + return await mountManagementSection(coreSetup, services, config, params); }, }); } diff --git a/x-pack/plugins/snapshot_restore/server/services/license.ts b/x-pack/plugins/snapshot_restore/server/services/license.ts index 74696bb966e8a..31d3654c51e3e 100644 --- a/x-pack/plugins/snapshot_restore/server/services/license.ts +++ b/x-pack/plugins/snapshot_restore/server/services/license.ts @@ -13,7 +13,6 @@ import { import { LicensingPluginSetup } from '../../../licensing/server'; import { LicenseType } from '../../../licensing/common/types'; -import { LICENSE_CHECK_STATE } from '../../../licensing/common/types'; export interface LicenseStatus { isValid: boolean; @@ -38,7 +37,7 @@ export class License { ) { licensing.license$.subscribe(license => { const { state, message } = license.check(pluginId, minimumLicenseType); - const hasRequiredLicense = state === LICENSE_CHECK_STATE.Valid; + const hasRequiredLicense = state === 'valid'; if (hasRequiredLicense) { this.licenseStatus = { isValid: true }; diff --git a/x-pack/plugins/spaces/server/routes/api/__fixtures__/route_contexts.ts b/x-pack/plugins/spaces/server/routes/api/__fixtures__/route_contexts.ts index 0bc1685345857..be8322138ec78 100644 --- a/x-pack/plugins/spaces/server/routes/api/__fixtures__/route_contexts.ts +++ b/x-pack/plugins/spaces/server/routes/api/__fixtures__/route_contexts.ts @@ -5,13 +5,12 @@ */ import { RequestHandlerContext } from 'src/core/server'; -import { LICENSE_CHECK_STATE } from '../../../../../licensing/server'; export const mockRouteContext = ({ licensing: { license: { check: jest.fn().mockReturnValue({ - state: LICENSE_CHECK_STATE.Valid, + state: 'valid', }), }, }, @@ -21,7 +20,7 @@ export const mockRouteContextWithInvalidLicense = ({ licensing: { license: { check: jest.fn().mockReturnValue({ - state: LICENSE_CHECK_STATE.Invalid, + state: 'invalid', message: 'License is invalid for spaces', }), }, diff --git a/x-pack/plugins/spaces/server/routes/lib/licensed_route_handler.ts b/x-pack/plugins/spaces/server/routes/lib/licensed_route_handler.ts index 13bed5ce58e2b..d56414a12b838 100644 --- a/x-pack/plugins/spaces/server/routes/lib/licensed_route_handler.ts +++ b/x-pack/plugins/spaces/server/routes/lib/licensed_route_handler.ts @@ -5,16 +5,12 @@ */ import { RequestHandler } from 'kibana/server'; -import { LICENSE_CHECK_STATE } from '../../../../licensing/server'; export const createLicensedRouteHandler = (handler: RequestHandler) => { const licensedRouteHandler: RequestHandler = (context, request, responseToolkit) => { const { license } = context.licensing; const licenseCheck = license.check('spaces', 'basic'); - if ( - licenseCheck.state === LICENSE_CHECK_STATE.Unavailable || - licenseCheck.state === LICENSE_CHECK_STATE.Invalid - ) { + if (licenseCheck.state === 'unavailable' || licenseCheck.state === 'invalid') { return responseToolkit.forbidden({ body: { message: licenseCheck.message! } }); } diff --git a/x-pack/plugins/transform/server/services/license.ts b/x-pack/plugins/transform/server/services/license.ts index 93346160c6f44..18ed7db1e3f6d 100644 --- a/x-pack/plugins/transform/server/services/license.ts +++ b/x-pack/plugins/transform/server/services/license.ts @@ -12,7 +12,7 @@ import { RequestHandlerContext, } from 'kibana/server'; -import { LicensingPluginSetup, LicenseType, LICENSE_CHECK_STATE } from '../../../licensing/server'; +import { LicensingPluginSetup, LicenseType } from '../../../licensing/server'; export interface LicenseStatus { isValid: boolean; @@ -39,7 +39,7 @@ export class License { ) { licensing.license$.subscribe(license => { const { state, message } = license.check(pluginId, minimumLicenseType); - const hasRequiredLicense = state === LICENSE_CHECK_STATE.Valid; + const hasRequiredLicense = state === 'valid'; const securityFeature = license.getFeature('security'); const isSecurityEnabled = diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 1b4810e8fdf0a..d9c47ddb1af99 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -630,6 +630,70 @@ "dashboard.actions.toggleExpandPanelMenuItem.notExpandedDisplayName": "全画面", "dashboard.dashboardGrid.toast.unableToLoadDashboardDangerMessage": "ダッシュボードが読み込めません。", "dashboard.factory.displayName": "ダッシュボード", + "dashboard.addVisualizationLinkAriaLabel": "ビジュアライゼーションを追加", + "dashboard.badge.readOnly.text": "読み込み専用", + "dashboard.badge.readOnly.tooltip": "ダッシュボードを保存できません", + "dashboard.changeViewModeConfirmModal.cancelButtonLabel": "編集を続行", + "dashboard.changeViewModeConfirmModal.confirmButtonLabel": "変更を破棄", + "dashboard.changeViewModeConfirmModal.discardChangesDescription": "変更を破棄すると、元に戻すことはできません。", + "dashboard.changeViewModeConfirmModal.discardChangesTitle": "ダッシュボードへの変更を破棄しますか?", + "dashboard.dashboardAppBreadcrumbsTitle": "ダッシュボード", + "dashboard.dashboardBreadcrumbsTitle": "ダッシュボード", + "dashboard.dashboardWasNotSavedDangerMessage": "ダッシュボード「{dashTitle}」は保存されませんでした。エラー: {errorMessage}", + "dashboard.dashboardWasSavedSuccessMessage": "ダッシュボード「{dashTitle}」が保存されました。", + "dashboard.featureCatalogue.dashboardDescription": "ビジュアライゼーションと保存された検索のコレクションの表示と共有を行います。", + "dashboard.featureCatalogue.dashboardTitle": "ダッシュボード", + "dashboard.fillDashboardTitle": "このダッシュボードは空です。コンテンツを追加しましょう!", + "dashboard.howToStartWorkingOnNewDashboardDescription1": "上のメニューバーの ", + "dashboard.howToStartWorkingOnNewDashboardDescription2": " ダッシュボードの作成を始めましょう。", + "dashboard.howToStartWorkingOnNewDashboardEditLinkText": "編集", + "dashboard.listing.createNewDashboard.combineDataViewFromKibanaAppDescription": "あらゆる Kibana アプリからダッシュボードでデータビューを組み合わせて、すべてを 1 か所に表示できます。", + "dashboard.listing.createNewDashboard.createButtonLabel": "新規ダッシュボードを作成", + "dashboard.listing.createNewDashboard.newToKibanaDescription": "Kibana は初心者ですか?{sampleDataInstallLink} してお試しください。", + "dashboard.listing.createNewDashboard.sampleDataInstallLinkText": "サンプルデータをインストール", + "dashboard.listing.createNewDashboard.title": "初めてのダッシュボードを作成してみましょう。", + "dashboard.listing.dashboardsTitle": "ダッシュボード", + "dashboard.listing.noItemsMessage": "ダッシュボードがないようです。", + "dashboard.listing.table.descriptionColumnName": "説明", + "dashboard.listing.table.entityName": "ダッシュボード", + "dashboard.listing.table.entityNamePlural": "ダッシュボード", + "dashboard.listing.table.titleColumnName": "タイトル", + "dashboard.panel.invalidData": "URLの無効なデータ", + "dashboard.savedDashboard.newDashboardTitle": "新規ダッシュボード", + "dashboard.stateManager.timeNotSavedWithDashboardErrorMessage": "このダッシュボードに時刻が保存されていないため、同期できません。", + "dashboard.strings.dashboardEditTitle": "{title} を編集中", + "dashboard.strings.dashboardUnsavedEditTitle": "{title} を編集中 (未保存)", + "dashboard.topNav.cloneModal.cancelButtonLabel": "キャンセル", + "dashboard.topNav.cloneModal.cloneDashboardModalHeaderTitle": "ダッシュボードのクローンを作成", + "dashboard.topNav.cloneModal.confirmButtonLabel": "クローンの確認", + "dashboard.topNav.cloneModal.confirmCloneDescription": "クローンの確認", + "dashboard.topNav.cloneModal.dashboardExistsDescription": "{confirmClone} をクリックして重複タイトルでダッシュボードのクローンを作成します。", + "dashboard.topNav.cloneModal.dashboardExistsTitle": "「{newDashboardName}」というタイトルのダッシュボードが既に存在します。", + "dashboard.topNav.cloneModal.enterNewNameForDashboardDescription": "ダッシュボードの新しい名前を入力してください。", + "dashboard.topNav.options.hideAllPanelTitlesSwitchLabel": "パネルタイトルを表示", + "dashboard.topNav.options.useMarginsBetweenPanelsSwitchLabel": "パネルの間に余白を使用", + "dashboard.topNav.saveModal.descriptionFormRowLabel": "説明", + "dashboard.topNav.saveModal.storeTimeWithDashboardFormRowHelpText": "有効化すると、ダッシュボードが読み込まれるごとに現在選択された時刻の時間フィルターが変更されます。", + "dashboard.topNav.saveModal.storeTimeWithDashboardFormRowLabel": "ダッシュボードに時刻を保存", + "dashboard.topNav.showCloneModal.dashboardCopyTitle": "{title} のコピー", + "dashboard.topNave.addButtonAriaLabel": "追加", + "dashboard.topNave.addConfigDescription": "ダッシュボードにパネルを追加します", + "dashboard.topNave.cancelButtonAriaLabel": "キャンセル", + "dashboard.topNave.cloneButtonAriaLabel": "クローンを作成", + "dashboard.topNave.cloneConfigDescription": "ダッシュボードのコピーを作成します", + "dashboard.topNave.editButtonAriaLabel": "編集", + "dashboard.topNave.editConfigDescription": "編集モードに切り替えます", + "dashboard.topNave.fullScreenButtonAriaLabel": "全画面", + "dashboard.topNave.fullScreenConfigDescription": "全画面モード", + "dashboard.topNave.optionsButtonAriaLabel": "オプション", + "dashboard.topNave.optionsConfigDescription": "オプション", + "dashboard.topNave.saveButtonAriaLabel": "保存", + "dashboard.topNave.saveConfigDescription": "ダッシュボードを保存します", + "dashboard.topNave.shareButtonAriaLabel": "共有", + "dashboard.topNave.shareConfigDescription": "ダッシュボードを共有します", + "dashboard.topNave.viewConfigDescription": "編集をキャンセルして表示限定モードに切り替えます", + "dashboard.urlWasRemovedInSixZeroWarningMessage": "URL「dashboard/create」は 6.0 で廃止されました。ブックマークを更新してください。", + "dashboard.visitVisualizeAppLinkText": "可視化アプリにアクセス", "embeddableApi.actions.applyFilterActionTitle": "現在のビューにフィルターを適用", "embeddableApi.addPanel.createNewDefaultOption": "新規作成...", "embeddableApi.addPanel.displayName": "パネルの追加", @@ -976,73 +1040,9 @@ "kbn.context.reloadPageDescription.selectValidAnchorDocumentTextMessage": "にアクセスして有効な別のドキュメントを選択してください。", "kbn.context.unableToLoadAnchorDocumentDescription": "別のドキュメントが読み込めません", "kbn.context.unableToLoadDocumentDescription": "ドキュメントが読み込めません", - "kbn.dashboard.addVisualizationLinkAriaLabel": "ビジュアライゼーションを追加", - "kbn.dashboard.badge.readOnly.text": "読み込み専用", - "kbn.dashboard.badge.readOnly.tooltip": "ダッシュボードを保存できません", - "kbn.dashboard.changeViewModeConfirmModal.cancelButtonLabel": "編集を続行", - "kbn.dashboard.changeViewModeConfirmModal.confirmButtonLabel": "変更を破棄", - "kbn.dashboard.changeViewModeConfirmModal.discardChangesDescription": "変更を破棄すると、元に戻すことはできません。", - "kbn.dashboard.changeViewModeConfirmModal.discardChangesTitle": "ダッシュボードへの変更を破棄しますか?", - "kbn.dashboard.dashboardAppBreadcrumbsTitle": "ダッシュボード", - "kbn.dashboard.dashboardBreadcrumbsTitle": "ダッシュボード", - "kbn.dashboard.dashboardWasNotSavedDangerMessage": "ダッシュボード「{dashTitle}」は保存されませんでした。エラー: {errorMessage}", - "kbn.dashboard.dashboardWasSavedSuccessMessage": "ダッシュボード「{dashTitle}」が保存されました。", - "kbn.dashboard.featureCatalogue.dashboardDescription": "ビジュアライゼーションと保存された検索のコレクションの表示と共有を行います。", - "kbn.dashboard.featureCatalogue.dashboardTitle": "ダッシュボード", - "kbn.dashboard.fillDashboardTitle": "このダッシュボードは空です。コンテンツを追加しましょう!", - "kbn.dashboard.howToStartWorkingOnNewDashboardDescription1": "上のメニューバーの ", - "kbn.dashboard.howToStartWorkingOnNewDashboardDescription2": " ダッシュボードの作成を始めましょう。", - "kbn.dashboard.howToStartWorkingOnNewDashboardEditLinkText": "編集", - "kbn.dashboard.listing.createNewDashboard.combineDataViewFromKibanaAppDescription": "あらゆる Kibana アプリからダッシュボードでデータビューを組み合わせて、すべてを 1 か所に表示できます。", - "kbn.dashboard.listing.createNewDashboard.createButtonLabel": "新規ダッシュボードを作成", - "kbn.dashboard.listing.createNewDashboard.newToKibanaDescription": "Kibana は初心者ですか?{sampleDataInstallLink} してお試しください。", - "kbn.dashboard.listing.createNewDashboard.sampleDataInstallLinkText": "サンプルデータをインストール", - "kbn.dashboard.listing.createNewDashboard.title": "初めてのダッシュボードを作成してみましょう。", - "kbn.dashboard.listing.dashboardsTitle": "ダッシュボード", - "kbn.dashboard.listing.noItemsMessage": "ダッシュボードがないようです。", - "kbn.dashboard.listing.table.descriptionColumnName": "説明", - "kbn.dashboard.listing.table.entityName": "ダッシュボード", - "kbn.dashboard.listing.table.entityNamePlural": "ダッシュボード", - "kbn.dashboard.listing.table.titleColumnName": "タイトル", - "kbn.dashboard.panel.invalidData": "URLの無効なデータ", "kbn.dashboard.panel.unableToMigratePanelDataForSixOneZeroErrorMessage": "「6.1.0」のダッシュボードの互換性のため、パネルデータを移行できませんでした。パネルには想定された列または行フィールドがありません", "kbn.dashboard.panel.unableToMigratePanelDataForSixThreeZeroErrorMessage": "「6.3.0」のダッシュボードの互換性のため、パネルデータを移行できませんでした。パネルに必要なフィールドがありません: {key}", - "kbn.dashboard.savedDashboard.newDashboardTitle": "新規ダッシュボード", "kbn.dashboard.savedDashboardsTitle": "ダッシュボード", - "kbn.dashboard.stateManager.timeNotSavedWithDashboardErrorMessage": "このダッシュボードに時刻が保存されていないため、同期できません。", - "kbn.dashboard.strings.dashboardEditTitle": "{title} を編集中", - "kbn.dashboard.strings.dashboardUnsavedEditTitle": "{title} を編集中 (未保存)", - "kbn.dashboard.topNav.cloneModal.cancelButtonLabel": "キャンセル", - "kbn.dashboard.topNav.cloneModal.cloneDashboardModalHeaderTitle": "ダッシュボードのクローンを作成", - "kbn.dashboard.topNav.cloneModal.confirmButtonLabel": "クローンの確認", - "kbn.dashboard.topNav.cloneModal.confirmCloneDescription": "クローンの確認", - "kbn.dashboard.topNav.cloneModal.dashboardExistsDescription": "{confirmClone} をクリックして重複タイトルでダッシュボードのクローンを作成します。", - "kbn.dashboard.topNav.cloneModal.dashboardExistsTitle": "「{newDashboardName}」というタイトルのダッシュボードが既に存在します。", - "kbn.dashboard.topNav.cloneModal.enterNewNameForDashboardDescription": "ダッシュボードの新しい名前を入力してください。", - "kbn.dashboard.topNav.options.hideAllPanelTitlesSwitchLabel": "パネルタイトルを表示", - "kbn.dashboard.topNav.options.useMarginsBetweenPanelsSwitchLabel": "パネルの間に余白を使用", - "kbn.dashboard.topNav.saveModal.descriptionFormRowLabel": "説明", - "kbn.dashboard.topNav.saveModal.storeTimeWithDashboardFormRowHelpText": "有効化すると、ダッシュボードが読み込まれるごとに現在選択された時刻の時間フィルターが変更されます。", - "kbn.dashboard.topNav.saveModal.storeTimeWithDashboardFormRowLabel": "ダッシュボードに時刻を保存", - "kbn.dashboard.topNav.showCloneModal.dashboardCopyTitle": "{title} のコピー", - "kbn.dashboard.topNave.addButtonAriaLabel": "追加", - "kbn.dashboard.topNave.addConfigDescription": "ダッシュボードにパネルを追加します", - "kbn.dashboard.topNave.cancelButtonAriaLabel": "キャンセル", - "kbn.dashboard.topNave.cloneButtonAriaLabel": "クローンを作成", - "kbn.dashboard.topNave.cloneConfigDescription": "ダッシュボードのコピーを作成します", - "kbn.dashboard.topNave.editButtonAriaLabel": "編集", - "kbn.dashboard.topNave.editConfigDescription": "編集モードに切り替えます", - "kbn.dashboard.topNave.fullScreenButtonAriaLabel": "全画面", - "kbn.dashboard.topNave.fullScreenConfigDescription": "全画面モード", - "kbn.dashboard.topNave.optionsButtonAriaLabel": "オプション", - "kbn.dashboard.topNave.optionsConfigDescription": "オプション", - "kbn.dashboard.topNave.saveButtonAriaLabel": "保存", - "kbn.dashboard.topNave.saveConfigDescription": "ダッシュボードを保存します", - "kbn.dashboard.topNave.shareButtonAriaLabel": "共有", - "kbn.dashboard.topNave.shareConfigDescription": "ダッシュボードを共有します", - "kbn.dashboard.topNave.viewConfigDescription": "編集をキャンセルして表示限定モードに切り替えます", - "kbn.dashboard.urlWasRemovedInSixZeroWarningMessage": "URL「dashboard/create」は 6.0 で廃止されました。ブックマークを更新してください。", - "kbn.dashboard.visitVisualizeAppLinkText": "可視化アプリにアクセス", "kbn.dashboardTitle": "ダッシュボード", "kbn.devToolsTitle": "開発ツール", "kbn.discover.backToTopLinkText": "最上部へ戻る。", @@ -12589,7 +12589,6 @@ "xpack.uptime.snapshot.noDataTitle": "ヒストグラムデータがありません", "xpack.uptime.snapshot.pingsOverTimeTitle": "一定時間のピング", "xpack.uptime.snapshotHistogram.description": "{startTime} から {endTime} までの期間のアップタイムステータスを表示する棒グラフです。", - "xpack.uptime.snapshotHistogram.downMonitorsId": "ダウンモニター", "xpack.uptime.snapshotHistogram.series.downLabel": "ダウン", "xpack.uptime.snapshotHistogram.series.upLabel": "アップ", "xpack.uptime.snapshotHistogram.xAxisId": "スナップショットX軸", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 5b3baa3552dbe..0901cc7fab59a 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -630,6 +630,70 @@ "dashboard.actions.toggleExpandPanelMenuItem.notExpandedDisplayName": "全屏", "dashboard.dashboardGrid.toast.unableToLoadDashboardDangerMessage": "无法加载仪表板。", "dashboard.factory.displayName": "仪表板", + "dashboard.addVisualizationLinkAriaLabel": "添加可视化", + "dashboard.badge.readOnly.text": "只读", + "dashboard.badge.readOnly.tooltip": "无法保存仪表板", + "dashboard.changeViewModeConfirmModal.cancelButtonLabel": "继续编辑", + "dashboard.changeViewModeConfirmModal.confirmButtonLabel": "放弃更改", + "dashboard.changeViewModeConfirmModal.discardChangesDescription": "放弃更改后,它们将无法恢复。", + "dashboard.changeViewModeConfirmModal.discardChangesTitle": "放弃对仪表板的更改?", + "dashboard.dashboardAppBreadcrumbsTitle": "仪表板", + "dashboard.dashboardBreadcrumbsTitle": "仪表板", + "dashboard.dashboardWasNotSavedDangerMessage": "仪表板 “{dashTitle}” 未保存。错误:{errorMessage}", + "dashboard.dashboardWasSavedSuccessMessage": "仪表板 “{dashTitle}” 已保存", + "dashboard.featureCatalogue.dashboardDescription": "显示和共享可视化和已保存搜索的集合。", + "dashboard.featureCatalogue.dashboardTitle": "仪表板", + "dashboard.fillDashboardTitle": "此仪表板是空的。让我们来填充它!", + "dashboard.howToStartWorkingOnNewDashboardDescription1": "单击上述菜单栏中的 ", + "dashboard.howToStartWorkingOnNewDashboardDescription2": " 按钮以着手处理新的仪表板。", + "dashboard.howToStartWorkingOnNewDashboardEditLinkText": "编辑", + "dashboard.listing.createNewDashboard.combineDataViewFromKibanaAppDescription": "您可以将任何 Kibana 应用的数据视图组合到一个仪表板中,从而在一个位置查看所有内容。", + "dashboard.listing.createNewDashboard.createButtonLabel": "创建新的仪表板", + "dashboard.listing.createNewDashboard.newToKibanaDescription": "Kibana 新手?{sampleDataInstallLink}来试用一下。", + "dashboard.listing.createNewDashboard.sampleDataInstallLinkText": "安装一些样例数据", + "dashboard.listing.createNewDashboard.title": "创建您的首个仪表板", + "dashboard.listing.dashboardsTitle": "仪表板", + "dashboard.listing.noItemsMessage": "似乎您没有任何仪表板。", + "dashboard.listing.table.descriptionColumnName": "描述", + "dashboard.listing.table.entityName": "仪表板", + "dashboard.listing.table.entityNamePlural": "仪表板", + "dashboard.listing.table.titleColumnName": "标题", + "dashboard.panel.invalidData": "url 中的数据无效", + "dashboard.savedDashboard.newDashboardTitle": "新建仪表板", + "dashboard.stateManager.timeNotSavedWithDashboardErrorMessage": "时间未随此仪表板保存,因此无法同步。", + "dashboard.strings.dashboardEditTitle": "编辑 {title}", + "dashboard.strings.dashboardUnsavedEditTitle": "编辑 {title}(未保存)", + "dashboard.topNav.cloneModal.cancelButtonLabel": "取消", + "dashboard.topNav.cloneModal.cloneDashboardModalHeaderTitle": "克隆面板", + "dashboard.topNav.cloneModal.confirmButtonLabel": "确认克隆", + "dashboard.topNav.cloneModal.confirmCloneDescription": "确认克隆", + "dashboard.topNav.cloneModal.dashboardExistsDescription": "单击 “{confirmClone}” 以克隆具有重复标题的仪表板。", + "dashboard.topNav.cloneModal.dashboardExistsTitle": "具有标题 {newDashboardName} 的仪表板已存在。", + "dashboard.topNav.cloneModal.enterNewNameForDashboardDescription": "请为您的仪表板输入新的名称。", + "dashboard.topNav.options.hideAllPanelTitlesSwitchLabel": "显示面板标题", + "dashboard.topNav.options.useMarginsBetweenPanelsSwitchLabel": "在面板间使用边距", + "dashboard.topNav.saveModal.descriptionFormRowLabel": "描述", + "dashboard.topNav.saveModal.storeTimeWithDashboardFormRowHelpText": "每次加载此仪表板时,这都会将时间筛选更改为当前选定的时间。", + "dashboard.topNav.saveModal.storeTimeWithDashboardFormRowLabel": "将时间随仪表板保存", + "dashboard.topNav.showCloneModal.dashboardCopyTitle": "{title} 副本", + "dashboard.topNave.addButtonAriaLabel": "添加", + "dashboard.topNave.addConfigDescription": "将面板保存到仪表板", + "dashboard.topNave.cancelButtonAriaLabel": "取消", + "dashboard.topNave.cloneButtonAriaLabel": "克隆", + "dashboard.topNave.cloneConfigDescription": "创建仪表板的副本", + "dashboard.topNave.editButtonAriaLabel": "编辑", + "dashboard.topNave.editConfigDescription": "切换到编辑模式", + "dashboard.topNave.fullScreenButtonAriaLabel": "全屏", + "dashboard.topNave.fullScreenConfigDescription": "全屏模式", + "dashboard.topNave.optionsButtonAriaLabel": "选项", + "dashboard.topNave.optionsConfigDescription": "选项", + "dashboard.topNave.saveButtonAriaLabel": "保存", + "dashboard.topNave.saveConfigDescription": "保存您的仪表板", + "dashboard.topNave.shareButtonAriaLabel": "共享", + "dashboard.topNave.shareConfigDescription": "共享仪表板", + "dashboard.topNave.viewConfigDescription": "取消编辑并切换到仅查看模式", + "dashboard.urlWasRemovedInSixZeroWarningMessage": "6.0 中未移除 url“dashboard/create”。请更新您的书签。", + "dashboard.visitVisualizeAppLinkText": "访问 Visualize 应用", "embeddableApi.actions.applyFilterActionTitle": "将筛选应用于当前视图", "embeddableApi.addPanel.createNewDefaultOption": "创建新的......", "embeddableApi.addPanel.displayName": "添加面板", @@ -976,73 +1040,9 @@ "kbn.context.reloadPageDescription.selectValidAnchorDocumentTextMessage": "以选择有效地定位点文档。", "kbn.context.unableToLoadAnchorDocumentDescription": "无法加载该定位点文档", "kbn.context.unableToLoadDocumentDescription": "无法加载文档", - "kbn.dashboard.addVisualizationLinkAriaLabel": "添加可视化", - "kbn.dashboard.badge.readOnly.text": "只读", - "kbn.dashboard.badge.readOnly.tooltip": "无法保存仪表板", - "kbn.dashboard.changeViewModeConfirmModal.cancelButtonLabel": "继续编辑", - "kbn.dashboard.changeViewModeConfirmModal.confirmButtonLabel": "放弃更改", - "kbn.dashboard.changeViewModeConfirmModal.discardChangesDescription": "放弃更改后,它们将无法恢复。", - "kbn.dashboard.changeViewModeConfirmModal.discardChangesTitle": "放弃对仪表板的更改?", - "kbn.dashboard.dashboardAppBreadcrumbsTitle": "仪表板", - "kbn.dashboard.dashboardBreadcrumbsTitle": "仪表板", - "kbn.dashboard.dashboardWasNotSavedDangerMessage": "仪表板 “{dashTitle}” 未保存。错误:{errorMessage}", - "kbn.dashboard.dashboardWasSavedSuccessMessage": "仪表板 “{dashTitle}” 已保存", - "kbn.dashboard.featureCatalogue.dashboardDescription": "显示和共享可视化和已保存搜索的集合。", - "kbn.dashboard.featureCatalogue.dashboardTitle": "仪表板", - "kbn.dashboard.fillDashboardTitle": "此仪表板是空的。让我们来填充它!", - "kbn.dashboard.howToStartWorkingOnNewDashboardDescription1": "单击上述菜单栏中的 ", - "kbn.dashboard.howToStartWorkingOnNewDashboardDescription2": " 按钮以着手处理新的仪表板。", - "kbn.dashboard.howToStartWorkingOnNewDashboardEditLinkText": "编辑", - "kbn.dashboard.listing.createNewDashboard.combineDataViewFromKibanaAppDescription": "您可以将任何 Kibana 应用的数据视图组合到一个仪表板中,从而在一个位置查看所有内容。", - "kbn.dashboard.listing.createNewDashboard.createButtonLabel": "创建新的仪表板", - "kbn.dashboard.listing.createNewDashboard.newToKibanaDescription": "Kibana 新手?{sampleDataInstallLink}来试用一下。", - "kbn.dashboard.listing.createNewDashboard.sampleDataInstallLinkText": "安装一些样例数据", - "kbn.dashboard.listing.createNewDashboard.title": "创建您的首个仪表板", - "kbn.dashboard.listing.dashboardsTitle": "仪表板", - "kbn.dashboard.listing.noItemsMessage": "似乎您没有任何仪表板。", - "kbn.dashboard.listing.table.descriptionColumnName": "描述", - "kbn.dashboard.listing.table.entityName": "仪表板", - "kbn.dashboard.listing.table.entityNamePlural": "仪表板", - "kbn.dashboard.listing.table.titleColumnName": "标题", - "kbn.dashboard.panel.invalidData": "url 中的数据无效", "kbn.dashboard.panel.unableToMigratePanelDataForSixOneZeroErrorMessage": "无法迁移用于“6.1.0”向后兼容的面板数据,面板不包含所需的列和/或行字段", "kbn.dashboard.panel.unableToMigratePanelDataForSixThreeZeroErrorMessage": "无法迁移用于“6.3.0”向后兼容的面板数据,面板不包含预期字段:{key}", - "kbn.dashboard.savedDashboard.newDashboardTitle": "新建仪表板", "kbn.dashboard.savedDashboardsTitle": "仪表板", - "kbn.dashboard.stateManager.timeNotSavedWithDashboardErrorMessage": "时间未随此仪表板保存,因此无法同步。", - "kbn.dashboard.strings.dashboardEditTitle": "编辑 {title}", - "kbn.dashboard.strings.dashboardUnsavedEditTitle": "编辑 {title}(未保存)", - "kbn.dashboard.topNav.cloneModal.cancelButtonLabel": "取消", - "kbn.dashboard.topNav.cloneModal.cloneDashboardModalHeaderTitle": "克隆面板", - "kbn.dashboard.topNav.cloneModal.confirmButtonLabel": "确认克隆", - "kbn.dashboard.topNav.cloneModal.confirmCloneDescription": "确认克隆", - "kbn.dashboard.topNav.cloneModal.dashboardExistsDescription": "单击 “{confirmClone}” 以克隆具有重复标题的仪表板。", - "kbn.dashboard.topNav.cloneModal.dashboardExistsTitle": "具有标题 {newDashboardName} 的仪表板已存在。", - "kbn.dashboard.topNav.cloneModal.enterNewNameForDashboardDescription": "请为您的仪表板输入新的名称。", - "kbn.dashboard.topNav.options.hideAllPanelTitlesSwitchLabel": "显示面板标题", - "kbn.dashboard.topNav.options.useMarginsBetweenPanelsSwitchLabel": "在面板间使用边距", - "kbn.dashboard.topNav.saveModal.descriptionFormRowLabel": "描述", - "kbn.dashboard.topNav.saveModal.storeTimeWithDashboardFormRowHelpText": "每次加载此仪表板时,这都会将时间筛选更改为当前选定的时间。", - "kbn.dashboard.topNav.saveModal.storeTimeWithDashboardFormRowLabel": "将时间随仪表板保存", - "kbn.dashboard.topNav.showCloneModal.dashboardCopyTitle": "{title} 副本", - "kbn.dashboard.topNave.addButtonAriaLabel": "添加", - "kbn.dashboard.topNave.addConfigDescription": "将面板保存到仪表板", - "kbn.dashboard.topNave.cancelButtonAriaLabel": "取消", - "kbn.dashboard.topNave.cloneButtonAriaLabel": "克隆", - "kbn.dashboard.topNave.cloneConfigDescription": "创建仪表板的副本", - "kbn.dashboard.topNave.editButtonAriaLabel": "编辑", - "kbn.dashboard.topNave.editConfigDescription": "切换到编辑模式", - "kbn.dashboard.topNave.fullScreenButtonAriaLabel": "全屏", - "kbn.dashboard.topNave.fullScreenConfigDescription": "全屏模式", - "kbn.dashboard.topNave.optionsButtonAriaLabel": "选项", - "kbn.dashboard.topNave.optionsConfigDescription": "选项", - "kbn.dashboard.topNave.saveButtonAriaLabel": "保存", - "kbn.dashboard.topNave.saveConfigDescription": "保存您的仪表板", - "kbn.dashboard.topNave.shareButtonAriaLabel": "共享", - "kbn.dashboard.topNave.shareConfigDescription": "共享仪表板", - "kbn.dashboard.topNave.viewConfigDescription": "取消编辑并切换到仅查看模式", - "kbn.dashboard.urlWasRemovedInSixZeroWarningMessage": "6.0 中未移除 url“dashboard/create”。请更新您的书签。", - "kbn.dashboard.visitVisualizeAppLinkText": "访问 Visualize 应用", "kbn.dashboardTitle": "仪表板", "kbn.devToolsTitle": "开发工具", "kbn.discover.backToTopLinkText": "返至顶部。", @@ -12589,7 +12589,6 @@ "xpack.uptime.snapshot.noDataTitle": "没有可用的直方图数据", "xpack.uptime.snapshot.pingsOverTimeTitle": "时移 Ping 数", "xpack.uptime.snapshotHistogram.description": "显示从 {startTime} 到 {endTime} 的运行时间时移状态的条形图。", - "xpack.uptime.snapshotHistogram.downMonitorsId": "已关闭监测", "xpack.uptime.snapshotHistogram.series.downLabel": "关闭", "xpack.uptime.snapshotHistogram.series.upLabel": "运行", "xpack.uptime.snapshotHistogram.xAxisId": "快照 X 轴", diff --git a/x-pack/plugins/upgrade_assistant/public/application/mount_management_section.ts b/x-pack/plugins/upgrade_assistant/public/application/mount_management_section.ts new file mode 100644 index 0000000000000..c0124d52e45d7 --- /dev/null +++ b/x-pack/plugins/upgrade_assistant/public/application/mount_management_section.ts @@ -0,0 +1,23 @@ +/* + * 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 { CoreSetup } from 'src/core/public'; +import { ManagementAppMountParams } from '../../../../../src/plugins/management/public'; +import { renderApp } from './render_app'; + +export async function mountManagementSection( + coreSetup: CoreSetup, + isCloudEnabled: boolean, + params: ManagementAppMountParams +) { + const [{ i18n, docLinks }] = await coreSetup.getStartServices(); + return renderApp({ + element: params.element, + isCloudEnabled, + http: coreSetup.http, + i18n, + docLinks, + }); +} diff --git a/x-pack/plugins/upgrade_assistant/public/plugin.ts b/x-pack/plugins/upgrade_assistant/public/plugin.ts index 300da4eccae15..bb0f21062c151 100644 --- a/x-pack/plugins/upgrade_assistant/public/plugin.ts +++ b/x-pack/plugins/upgrade_assistant/public/plugin.ts @@ -12,8 +12,6 @@ import { ManagementSetup } from '../../../../src/plugins/management/public'; import { NEXT_MAJOR_VERSION } from '../common/version'; import { Config } from '../common/config'; -import { renderApp } from './application/render_app'; - interface Dependencies { cloud: CloudSetup; management: ManagementSetup; @@ -21,7 +19,7 @@ interface Dependencies { export class UpgradeAssistantUIPlugin implements Plugin { constructor(private ctx: PluginInitializerContext) {} - setup({ http, getStartServices }: CoreSetup, { cloud, management }: Dependencies) { + setup(coreSetup: CoreSetup, { cloud, management }: Dependencies) { const { enabled } = this.ctx.config.get(); if (!enabled) { return; @@ -36,9 +34,9 @@ export class UpgradeAssistantUIPlugin implements Plugin { values: { version: `${NEXT_MAJOR_VERSION}.0` }, }), order: 1000, - async mount({ element }) { - const [{ i18n: i18nDep, docLinks }] = await getStartServices(); - return renderApp({ element, isCloudEnabled, http, i18n: i18nDep, docLinks }); + async mount(params) { + const { mountManagementSection } = await import('./application/mount_management_section'); + return mountManagementSection(coreSetup, isCloudEnabled, params); }, }); } diff --git a/x-pack/plugins/uptime/server/lib/helper/__test__/get_histogram_interval_formatted.test.ts b/x-pack/plugins/uptime/server/lib/helper/__test__/get_histogram_interval_formatted.test.ts deleted file mode 100644 index e67a93f24b3ca..0000000000000 --- a/x-pack/plugins/uptime/server/lib/helper/__test__/get_histogram_interval_formatted.test.ts +++ /dev/null @@ -1,35 +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 { getHistogramIntervalFormatted } from '../get_histogram_interval_formatted'; - -describe('getHistogramIntervalFormatted', () => { - it('specifies the interval necessary to divide a given timespan into equal buckets, rounded to the nearest integer, expressed in ms', () => { - const intervalFormatted = getHistogramIntervalFormatted('now-15m', 'now', 10); - /** - * Expected result is 90000. - * These assertions were verbatim comparisons but that introduced - * some flakiness at the ms resolution, sometimes values like "9001ms" - * are returned. - */ - expect(intervalFormatted.startsWith('9000')).toBeTruthy(); - expect(intervalFormatted.endsWith('ms')).toBeTruthy(); - expect(intervalFormatted).toHaveLength(7); - }); - - it('will supply a default constant value for bucketCount when none is provided', () => { - const intervalFormatted = getHistogramIntervalFormatted('now-15m', 'now'); - /** - * Expected result is 36000. - * These assertions were verbatim comparisons but that introduced - * some flakiness at the ms resolution, sometimes values like "9001ms" - * are returned. - */ - expect(intervalFormatted.startsWith('3600')).toBeTruthy(); - expect(intervalFormatted.endsWith('ms')).toBeTruthy(); - expect(intervalFormatted).toHaveLength(7); - }); -}); diff --git a/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval_formatted.ts b/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval_formatted.ts deleted file mode 100644 index 29af862611ca4..0000000000000 --- a/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval_formatted.ts +++ /dev/null @@ -1,13 +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 { getHistogramInterval } from './get_histogram_interval'; - -export const getHistogramIntervalFormatted = ( - dateRangeStart: string, - dateRangeEnd: string, - bucketCount?: number -): string => `${getHistogramInterval(dateRangeStart, dateRangeEnd, bucketCount)}ms`; diff --git a/x-pack/plugins/uptime/server/lib/helper/index.ts b/x-pack/plugins/uptime/server/lib/helper/index.ts index 1607c36f1d1b7..02e5d065c9813 100644 --- a/x-pack/plugins/uptime/server/lib/helper/index.ts +++ b/x-pack/plugins/uptime/server/lib/helper/index.ts @@ -6,6 +6,5 @@ export { getFilterClause } from './get_filter_clause'; export { parseRelativeDate } from './get_histogram_interval'; -export { getHistogramIntervalFormatted } from './get_histogram_interval_formatted'; export { assertCloseTo } from './assert_close_to'; export { objectValuesToArrays } from './object_to_array'; diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/__snapshots__/get_monitor_charts.test.ts.snap b/x-pack/plugins/uptime/server/lib/requests/__tests__/__snapshots__/get_monitor_charts.test.ts.snap index 5acf6ef40a1e3..7b717949c70c5 100644 --- a/x-pack/plugins/uptime/server/lib/requests/__tests__/__snapshots__/get_monitor_charts.test.ts.snap +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/__snapshots__/get_monitor_charts.test.ts.snap @@ -29,77 +29,12 @@ Array [ }, }, }, - "date_histogram": Object { + "auto_date_histogram": Object { + "buckets": 25, "field": "@timestamp", - "fixed_interval": "36000ms", - "min_doc_count": 0, - }, - }, - }, - "query": Object { - "bool": Object { - "filter": Array [ - Object { - "range": Object { - "@timestamp": Object { - "gte": "now-15m", - "lte": "now", - }, - }, - }, - Object { - "term": Object { - "monitor.id": "fooID", - }, - }, - Object { - "term": Object { - "monitor.status": "up", - }, - }, - ], - }, - }, - "size": 0, - }, - "index": "heartbeat-8*", - }, -] -`; - -exports[`ElasticsearchMonitorsAdapter getMonitorChartsData will run expected parameters when no location is specified 1`] = ` -Array [ - "search", - Object { - "body": Object { - "aggs": Object { - "timeseries": Object { - "aggs": Object { - "location": Object { - "aggs": Object { - "duration": Object { - "stats": Object { - "field": "monitor.duration.us", - }, - }, - "status": Object { - "terms": Object { - "field": "monitor.status", - "shard_size": 2, - "size": 2, - }, - }, - }, - "terms": Object { - "field": "observer.geo.name", - "missing": "N/A", - }, - }, }, "date_histogram": Object { - "field": "@timestamp", "fixed_interval": "36000ms", - "min_doc_count": 0, }, }, }, diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts index e54a17f934bcc..c740581734fdd 100644 --- a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts @@ -4,51 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ -import { get, set } from 'lodash'; +import { set } from 'lodash'; import mockChartsData from './monitor_charts_mock.json'; -import { assertCloseTo } from '../../helper'; import { getMonitorDurationChart } from '../get_monitor_duration'; import { defaultDynamicSettings } from '../../../../../../legacy/plugins/uptime/common/runtime_types'; describe('ElasticsearchMonitorsAdapter', () => { - it('getMonitorChartsData will run expected parameters when no location is specified', async () => { - expect.assertions(3); - const searchMock = jest.fn(); - const search = searchMock.bind({}); - await getMonitorDurationChart({ - callES: search, - dynamicSettings: defaultDynamicSettings, - monitorId: 'fooID', - dateStart: 'now-15m', - dateEnd: 'now', - }); - expect(searchMock).toHaveBeenCalledTimes(1); - // protect against possible rounding errors polluting the snapshot comparison - const fixedInterval = parseInt( - get( - searchMock.mock.calls[0][1], - 'body.aggs.timeseries.date_histogram.fixed_interval', - '' - ).split('ms')[0], - 10 - ); - expect(fixedInterval).not.toBeNaN(); - - /** - * The value based on the input should be ~36000 - */ - assertCloseTo(fixedInterval, 36000, 100); - - set( - searchMock.mock.calls[0][1], - 'body.aggs.timeseries.date_histogram.fixed_interval', - '36000ms' - ); - expect(searchMock.mock.calls[0]).toMatchSnapshot(); - }); - it('getMonitorChartsData will provide expected filters', async () => { - expect.assertions(3); + expect.assertions(2); const searchMock = jest.fn(); const search = searchMock.bind({}); await getMonitorDurationChart({ @@ -60,20 +23,6 @@ describe('ElasticsearchMonitorsAdapter', () => { }); expect(searchMock).toHaveBeenCalledTimes(1); // protect against possible rounding errors polluting the snapshot comparison - const fixedInterval = parseInt( - get( - searchMock.mock.calls[0][1], - 'body.aggs.timeseries.date_histogram.fixed_interval', - '' - ).split('ms')[0], - 10 - ); - expect(fixedInterval).not.toBeNaN(); - - /** - * The value based on the input should be ~36000 - */ - assertCloseTo(fixedInterval, 36000, 100); set( searchMock.mock.calls[0][1], diff --git a/x-pack/plugins/uptime/server/lib/requests/get_monitor_duration.ts b/x-pack/plugins/uptime/server/lib/requests/get_monitor_duration.ts index 40156132aafcf..01bfc52489bf3 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_monitor_duration.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_monitor_duration.ts @@ -5,7 +5,7 @@ */ import { UMElasticsearchQueryFn } from '../adapters'; -import { getHistogramIntervalFormatted } from '../helper'; +import { QUERY } from '../../../../../legacy/plugins/uptime/common/constants'; import { LocationDurationLine, MonitorDurationResult, @@ -62,10 +62,9 @@ export const getMonitorDurationChart: UMElasticsearchQueryFn< size: 0, aggs: { timeseries: { - date_histogram: { + auto_date_histogram: { field: '@timestamp', - fixed_interval: getHistogramIntervalFormatted(dateStart, dateEnd), - min_doc_count: 0, + buckets: QUERY.DEFAULT_BUCKET_COUNT, }, aggs: { location: { diff --git a/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts b/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts index bcb106eef0ba6..1798550875276 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts @@ -6,8 +6,7 @@ import { get, sortBy } from 'lodash'; import { QueryContext } from './query_context'; -import { getHistogramIntervalFormatted } from '../../helper'; -import { STATES } from '../../../../../../legacy/plugins/uptime/common/constants'; +import { QUERY, STATES } from '../../../../../../legacy/plugins/uptime/common/constants'; import { MonitorSummary, SummaryHistogram, @@ -322,12 +321,9 @@ const getHistogramForMonitors = async ( }, aggs: { histogram: { - date_histogram: { + auto_date_histogram: { field: '@timestamp', - fixed_interval: getHistogramIntervalFormatted( - queryContext.dateRangeStart, - queryContext.dateRangeEnd - ), + buckets: QUERY.DEFAULT_BUCKET_COUNT, missing: 0, }, aggs: { diff --git a/x-pack/plugins/watcher/public/plugin.ts b/x-pack/plugins/watcher/public/plugin.ts index cb9ad4eb21fcf..9bee7e60273e4 100644 --- a/x-pack/plugins/watcher/public/plugin.ts +++ b/x-pack/plugins/watcher/public/plugin.ts @@ -11,7 +11,7 @@ import { FeatureCatalogueCategory } from '../../../../src/plugins/home/public'; import { LicenseStatus } from '../common/types/license_status'; -import { ILicense, LICENSE_CHECK_STATE } from '../../licensing/public'; +import { ILicense } from '../../licensing/public'; import { TimeBuckets } from './legacy'; import { PLUGIN } from '../common/constants'; import { Dependencies } from './types'; @@ -19,7 +19,7 @@ import { Dependencies } from './types'; const licenseToLicenseStatus = (license: ILicense): LicenseStatus => { const { state, message } = license.check(PLUGIN.ID, PLUGIN.MINIMUM_LICENSE_REQUIRED); return { - valid: state === LICENSE_CHECK_STATE.Valid && license.getFeature(PLUGIN.ID).isAvailable, + valid: state === 'valid' && license.getFeature(PLUGIN.ID).isAvailable, message, }; }; diff --git a/x-pack/plugins/watcher/server/plugin.ts b/x-pack/plugins/watcher/server/plugin.ts index 51d85c2001bd2..6a2e3b2e596b6 100644 --- a/x-pack/plugins/watcher/server/plugin.ts +++ b/x-pack/plugins/watcher/server/plugin.ts @@ -19,7 +19,6 @@ import { } from 'kibana/server'; import { PLUGIN } from '../common/constants'; import { Dependencies, LicenseStatus, RouteDependencies } from './types'; -import { LICENSE_CHECK_STATE } from '../../licensing/server'; import { registerSettingsRoutes } from './routes/api/settings'; import { registerIndicesRoutes } from './routes/api/indices'; @@ -73,7 +72,7 @@ export class WatcherServerPlugin implements Plugin { licensing.license$.subscribe(async license => { const { state, message } = license.check(PLUGIN.ID, PLUGIN.MINIMUM_LICENSE_REQUIRED); - const hasMinimumLicense = state === LICENSE_CHECK_STATE.Valid; + const hasMinimumLicense = state === 'valid'; if (hasMinimumLicense && license.getFeature(PLUGIN.ID)) { this.log.info('Enabling Watcher plugin.'); this.licenseStatus = { diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states.json index 05724f0716e8d..a748225dda7cf 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 0, "down": 1 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_id_filtered.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_id_filtered.json index 6e62787069f40..44644be5a0724 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_id_filtered.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_id_filtered.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -194,4 +166,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_1.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_1.json index 05724f0716e8d..a748225dda7cf 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_1.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_1.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 0, "down": 1 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_10.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_10.json index 6cbe4ee3659a8..fbd0776fade62 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_10.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_10.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 0, "down": 1 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 0, "down": 1 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 0, "down": 1 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_10_previous.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_10_previous.json index 9a3f781735cb7..e630e227f473b 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_10_previous.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_10_previous.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 0, "down": 1 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 0, "down": 1 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 0, "down": 1 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 0, "down": 1 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 0, "down": 1 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 0, "down": 1 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 0, "down": 1 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 0, "down": 1 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 0, "down": 1 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 0, "down": 1 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 0, "down": 1 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 0, "down": 1 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 0, "down": 1 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 0, "down": 1 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 0, "down": 1 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 0, "down": 1 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 0, "down": 1 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 0, "down": 1 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 0, "down": 1 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 0, "down": 1 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_2.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_2.json index 4f4af9c2c6012..26b4b1a195567 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_2.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_2.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 0, "down": 1 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 0, "down": 1 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 0, "down": 1 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 0, "down": 1 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 0, "down": 1 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 0, "down": 1 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 0, "down": 1 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 0, "down": 1 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 0, "down": 1 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 0, "down": 1 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 0, "down": 1 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 0, "down": 1 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 0, "down": 1 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 0, "down": 1 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 0, "down": 1 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 0, "down": 1 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 0, "down": 1 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 0, "down": 1 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 0, "down": 1 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 0, "down": 1 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 0, "down": 1 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 0, "down": 1 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 0, "down": 1 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_2_previous.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_2_previous.json index fe48ad49d13ba..0b93e66f50246 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_2_previous.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_2_previous.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 0, "down": 1 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_3.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_3.json index 70ca665704a79..7b47742f8859a 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_3.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_3.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 0, "down": 1 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 0, "down": 1 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 0, "down": 1 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 0, "down": 1 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 0, "down": 1 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 0, "down": 1 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 0, "down": 1 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 0, "down": 1 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 0, "down": 1 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 0, "down": 1 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 0, "down": 1 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 0, "down": 1 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 0, "down": 1 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 0, "down": 1 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 0, "down": 1 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 0, "down": 1 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 0, "down": 1 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 0, "down": 1 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 0, "down": 1 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 0, "down": 1 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_3_previous.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_3_previous.json index 3f09c951ec2fa..0d5a76059d004 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_3_previous.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_3_previous.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 0, "down": 1 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 0, "down": 1 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 0, "down": 1 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 0, "down": 1 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 0, "down": 1 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 0, "down": 1 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 0, "down": 1 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 0, "down": 1 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 0, "down": 1 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 0, "down": 1 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 0, "down": 1 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 0, "down": 1 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 0, "down": 1 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 0, "down": 1 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 0, "down": 1 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 0, "down": 1 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 0, "down": 1 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 0, "down": 1 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 0, "down": 1 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 0, "down": 1 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 0, "down": 1 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 0, "down": 1 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 0, "down": 1 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_4.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_4.json index cdc0f32c9765e..4caff800ac96e 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_4.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_4.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 0, "down": 1 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 0, "down": 1 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 0, "down": 1 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 0, "down": 1 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 0, "down": 1 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 0, "down": 1 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_4_previous.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_4_previous.json index 9f6d004380c16..02bd149b50247 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_4_previous.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_4_previous.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 0, "down": 1 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 0, "down": 1 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 0, "down": 1 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 0, "down": 1 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 0, "down": 1 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 0, "down": 1 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 0, "down": 1 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 0, "down": 1 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 0, "down": 1 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 0, "down": 1 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 0, "down": 1 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 0, "down": 1 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 0, "down": 1 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 0, "down": 1 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 0, "down": 1 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 0, "down": 1 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 0, "down": 1 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 0, "down": 1 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 0, "down": 1 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 0, "down": 1 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_5.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_5.json index dedddb2a78ade..11e880f1ec329 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_5.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_5.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 0, "down": 1 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 0, "down": 1 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 0, "down": 1 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 0, "down": 1 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 0, "down": 1 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 0, "down": 1 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 0, "down": 1 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 0, "down": 1 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 0, "down": 1 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 0, "down": 1 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 0, "down": 1 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 0, "down": 1 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 0, "down": 1 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 0, "down": 1 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 0, "down": 1 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 0, "down": 1 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 0, "down": 1 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 0, "down": 1 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 0, "down": 1 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 0, "down": 1 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 0, "down": 1 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 0, "down": 1 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 0, "down": 1 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 0, "down": 1 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_5_previous.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_5_previous.json index fabcf70404952..26cfa7c7162e8 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_5_previous.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_5_previous.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 0, "down": 1 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 0, "down": 1 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 0, "down": 1 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 0, "down": 1 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 0, "down": 1 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 0, "down": 1 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_6.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_6.json index 943cc68249dc1..8f4b5d4c52e71 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_6.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_6.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 0, "down": 1 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 0, "down": 1 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 0, "down": 1 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 0, "down": 1 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 0, "down": 1 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 0, "down": 1 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 0, "down": 1 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 0, "down": 1 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 0, "down": 1 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 0, "down": 1 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 0, "down": 1 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 0, "down": 1 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 0, "down": 1 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 0, "down": 1 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 0, "down": 1 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 0, "down": 1 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 0, "down": 1 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 0, "down": 1 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 0, "down": 1 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 0, "down": 1 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_6_previous.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_6_previous.json index 564f58f59f373..50f8f61b13d68 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_6_previous.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_6_previous.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 0, "down": 1 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 0, "down": 1 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 0, "down": 1 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 0, "down": 1 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 0, "down": 1 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 0, "down": 1 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 0, "down": 1 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 0, "down": 1 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 0, "down": 1 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 0, "down": 1 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 0, "down": 1 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 0, "down": 1 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 0, "down": 1 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 0, "down": 1 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 0, "down": 1 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 0, "down": 1 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 0, "down": 1 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 0, "down": 1 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 0, "down": 1 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 0, "down": 1 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 0, "down": 1 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 0, "down": 1 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 0, "down": 1 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 0, "down": 1 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_7.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_7.json index cb94273e91fd8..18ab2c6fdf336 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_7.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_7.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 0, "down": 1 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 0, "down": 1 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 0, "down": 1 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_7_previous.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_7_previous.json index 7aac62bba84f7..825d6365e3a9d 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_7_previous.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_7_previous.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 0, "down": 1 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 0, "down": 1 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 0, "down": 1 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 0, "down": 1 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 0, "down": 1 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 0, "down": 1 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 0, "down": 1 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 0, "down": 1 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 0, "down": 1 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 0, "down": 1 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 0, "down": 1 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 0, "down": 1 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 0, "down": 1 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 0, "down": 1 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 0, "down": 1 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 0, "down": 1 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 0, "down": 1 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 0, "down": 1 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 0, "down": 1 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 0, "down": 1 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_8.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_8.json index 08cbd0d878b44..abb9bcdd804ed 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_8.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_8.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 0, "down": 1 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 0, "down": 1 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 0, "down": 1 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 0, "down": 1 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 0, "down": 1 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 0, "down": 1 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 0, "down": 1 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 0, "down": 1 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 0, "down": 1 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 0, "down": 1 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 0, "down": 1 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 0, "down": 1 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 0, "down": 1 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 0, "down": 1 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 0, "down": 1 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 0, "down": 1 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 0, "down": 1 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 0, "down": 1 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 0, "down": 1 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 0, "down": 1 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 0, "down": 1 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 0, "down": 1 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 0, "down": 1 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_8_previous.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_8_previous.json index 8de639b705ee9..46a5f195e6a82 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_8_previous.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_8_previous.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 0, "down": 1 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 0, "down": 1 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 0, "down": 1 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_9.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_9.json index c38f5c801a267..035baf0ab5b5e 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_9.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_9.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 0, "down": 1 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 0, "down": 1 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 0, "down": 1 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 0, "down": 1 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 0, "down": 1 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 0, "down": 1 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 0, "down": 1 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 0, "down": 1 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 0, "down": 1 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 0, "down": 1 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 0, "down": 1 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 0, "down": 1 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 0, "down": 1 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 0, "down": 1 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 0, "down": 1 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 0, "down": 1 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 0, "down": 1 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 0, "down": 1 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 0, "down": 1 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 0, "down": 1 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_9_previous.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_9_previous.json index 5c2ec8512e320..a6d274056eec6 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_9_previous.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_9_previous.json @@ -10,132 +10,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 0, "down": 1 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 0, "down": 1 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 0, "down": 1 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 0, "down": 1 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 0, "down": 1 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 0, "down": 1 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 0, "down": 1 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 0, "down": 1 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 0, "down": 1 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 0, "down": 1 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 0, "down": 1 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 0, "down": 1 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 0, "down": 1 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 0, "down": 1 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 0, "down": 1 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 0, "down": 1 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 0, "down": 1 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 0, "down": 1 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 0, "down": 1 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 0, "down": 1 } @@ -170,7 +140,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -198,132 +170,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -358,7 +300,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -386,132 +330,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -546,7 +460,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -574,132 +490,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -734,7 +620,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -762,132 +650,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -922,7 +780,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -950,132 +810,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 0, "down": 1 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 0, "down": 1 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 0, "down": 1 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1110,7 +940,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1138,132 +970,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1298,7 +1100,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1326,132 +1130,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1486,7 +1260,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1514,132 +1290,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1674,7 +1420,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1702,132 +1450,102 @@ "count": 20, "points": [ { - "timestamp": 1568172657286, + "timestamp": 1568172664000, "up": 1, "down": 0 }, { - "timestamp": 1568172680087, + "timestamp": 1568172694000, "up": 1, "down": 0 }, { - "timestamp": 1568172702888, + "timestamp": 1568172724000, "up": 1, "down": 0 }, { - "timestamp": 1568172725689, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172748490, + "timestamp": 1568172754000, "up": 1, "down": 0 }, { - "timestamp": 1568172771291, + "timestamp": 1568172784000, "up": 1, "down": 0 }, { - "timestamp": 1568172794092, + "timestamp": 1568172814000, "up": 1, "down": 0 }, { - "timestamp": 1568172816893, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172839694, + "timestamp": 1568172844000, "up": 1, "down": 0 }, { - "timestamp": 1568172862495, + "timestamp": 1568172874000, "up": 1, "down": 0 }, { - "timestamp": 1568172885296, + "timestamp": 1568172904000, "up": 1, "down": 0 }, { - "timestamp": 1568172908097, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568172930898, + "timestamp": 1568172934000, "up": 1, "down": 0 }, { - "timestamp": 1568172953699, + "timestamp": 1568172964000, "up": 1, "down": 0 }, { - "timestamp": 1568172976500, + "timestamp": 1568172994000, "up": 1, "down": 0 }, { - "timestamp": 1568172999301, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173022102, + "timestamp": 1568173024000, "up": 1, "down": 0 }, { - "timestamp": 1568173044903, + "timestamp": 1568173054000, "up": 1, "down": 0 }, { - "timestamp": 1568173067704, + "timestamp": 1568173084000, "up": 1, "down": 0 }, { - "timestamp": 1568173090505, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173113306, + "timestamp": 1568173114000, "up": 1, "down": 0 }, { - "timestamp": 1568173136107, + "timestamp": 1568173144000, "up": 1, "down": 0 }, { - "timestamp": 1568173158908, + "timestamp": 1568173174000, "up": 1, "down": 0 }, { - "timestamp": 1568173181709, + "timestamp": 1568173204000, "up": 1, "down": 0 }, { - "timestamp": 1568173204510, - "up": 0, - "down": 0 - }, - { - "timestamp": 1568173227311, + "timestamp": 1568173234000, "up": 1, "down": 0 } @@ -1862,7 +1580,9 @@ "geo": null, "observer": { "geo": { - "name": ["mpls"], + "name": [ + "mpls" + ], "location": null } }, @@ -1886,4 +1606,4 @@ } ] } -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot.json index 12d8f514a3a30..87042f2acb677 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot.json @@ -1,5 +1,5 @@ { + "total": 17, "up": 10, - "down": 7, - "total": 17 + "down": 7 } \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_empty.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_empty.json index c1e7f0ba247fb..6816dd3c15428 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_empty.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_empty.json @@ -1,5 +1,5 @@ { + "total": 0, "up": 0, - "down": 0, - "total": 0 + "down": 0 } \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_filtered_by_down.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_filtered_by_down.json index 94777570dd6f0..27ba69411f88d 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_filtered_by_down.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_filtered_by_down.json @@ -1,5 +1,5 @@ { + "total": 7, "up": 0, - "down": 7, - "total": 7 + "down": 7 } \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_filtered_by_up.json b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_filtered_by_up.json index 42a1581707360..33e60a4340a13 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_filtered_by_up.json +++ b/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_filtered_by_up.json @@ -1,5 +1,5 @@ { + "total": 10, "up": 10, - "down": 0, - "total": 10 + "down": 0 } \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/rest/fixtures/doc_count.json b/x-pack/test/api_integration/apis/uptime/rest/fixtures/doc_count.json index 41b9af392dded..69d768b1126df 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/fixtures/doc_count.json +++ b/x-pack/test/api_integration/apis/uptime/rest/fixtures/doc_count.json @@ -1,4 +1,4 @@ { - "docCount": 2000, - "indexExists": true -} + "indexExists": true, + "docCount": 2000 +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_charts.json b/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_charts.json index 1aa0788a6da05..8edcff158b0ae 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_charts.json +++ b/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_charts.json @@ -4,107 +4,83 @@ "name": "mpls", "line": [ { - "x": 1568172657286, + "x": 1568172664000, "y": 16274 }, { - "x": 1568172680087, + "x": 1568172694000, "y": 16713 }, { - "x": 1568172702888, + "x": 1568172724000, "y": 34756 }, { - "x": 1568172725689, - "y": null - }, - { - "x": 1568172748490, + "x": 1568172754000, "y": 22205 }, { - "x": 1568172771291, + "x": 1568172784000, "y": 6071 }, { - "x": 1568172794092, + "x": 1568172814000, "y": 15681 }, { - "x": 1568172816893, - "y": null - }, - { - "x": 1568172839694, + "x": 1568172844000, "y": 1669 }, { - "x": 1568172862495, + "x": 1568172874000, "y": 956 }, { - "x": 1568172885296, + "x": 1568172904000, "y": 1435 }, { - "x": 1568172908097, - "y": null - }, - { - "x": 1568172930898, + "x": 1568172934000, "y": 32906 }, { - "x": 1568172953699, + "x": 1568172964000, "y": 892 }, { - "x": 1568172976500, + "x": 1568172994000, "y": 1514 }, { - "x": 1568172999301, - "y": null - }, - { - "x": 1568173022102, + "x": 1568173024000, "y": 2367 }, { - "x": 1568173044903, + "x": 1568173054000, "y": 3389 }, { - "x": 1568173067704, + "x": 1568173084000, "y": 362 }, { - "x": 1568173090505, - "y": null - }, - { - "x": 1568173113306, + "x": 1568173114000, "y": 3066 }, { - "x": 1568173136107, + "x": 1568173144000, "y": 44513 }, { - "x": 1568173158908, + "x": 1568173174000, "y": 6417 }, { - "x": 1568173181709, + "x": 1568173204000, "y": 1416 }, { - "x": 1568173204510, - "y": null - }, - { - "x": 1568173227311, + "x": 1568173234000, "y": 24627 } ] @@ -112,162 +88,126 @@ ], "status": [ { - "x": 1568172657286, + "x": 1568172664000, "up": null, "down": null, "total": 1 }, { - "x": 1568172680087, + "x": 1568172694000, "up": null, "down": null, "total": 1 }, { - "x": 1568172702888, + "x": 1568172724000, "up": null, "down": null, "total": 1 }, { - "x": 1568172725689, - "up": null, - "down": null, - "total": 0 - }, - { - "x": 1568172748490, + "x": 1568172754000, "up": null, "down": null, "total": 1 }, { - "x": 1568172771291, + "x": 1568172784000, "up": null, "down": null, "total": 1 }, { - "x": 1568172794092, + "x": 1568172814000, "up": null, "down": null, "total": 1 }, { - "x": 1568172816893, - "up": null, - "down": null, - "total": 0 - }, - { - "x": 1568172839694, + "x": 1568172844000, "up": null, "down": null, "total": 1 }, { - "x": 1568172862495, + "x": 1568172874000, "up": null, "down": null, "total": 1 }, { - "x": 1568172885296, + "x": 1568172904000, "up": null, "down": null, "total": 1 }, { - "x": 1568172908097, - "up": null, - "down": null, - "total": 0 - }, - { - "x": 1568172930898, + "x": 1568172934000, "up": null, "down": null, "total": 1 }, { - "x": 1568172953699, + "x": 1568172964000, "up": null, "down": null, "total": 1 }, { - "x": 1568172976500, + "x": 1568172994000, "up": null, "down": null, "total": 1 }, { - "x": 1568172999301, - "up": null, - "down": null, - "total": 0 - }, - { - "x": 1568173022102, + "x": 1568173024000, "up": null, "down": null, "total": 1 }, { - "x": 1568173044903, + "x": 1568173054000, "up": null, "down": null, "total": 1 }, { - "x": 1568173067704, + "x": 1568173084000, "up": null, "down": null, "total": 1 }, { - "x": 1568173090505, - "up": null, - "down": null, - "total": 0 - }, - { - "x": 1568173113306, + "x": 1568173114000, "up": null, "down": null, "total": 1 }, { - "x": 1568173136107, + "x": 1568173144000, "up": null, "down": null, "total": 1 }, { - "x": 1568173158908, + "x": 1568173174000, "up": null, "down": null, "total": 1 }, { - "x": 1568173181709, + "x": 1568173204000, "up": null, "down": null, "total": 1 }, { - "x": 1568173204510, - "up": null, - "down": null, - "total": 0 - }, - { - "x": 1568173227311, + "x": 1568173234000, "up": null, "down": null, "total": 1 } ], - "statusMaxCount": 0, - "durationMaxValue": 0 -} + "durationMaxValue": 0, + "statusMaxCount": 0 +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_charts_empty_sets.json b/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_charts_empty_sets.json index e7245a479a962..674338101bc5b 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_charts_empty_sets.json +++ b/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_charts_empty_sets.json @@ -1,6 +1,6 @@ { "locationDurationLines": [], "status": [], - "statusMaxCount": 0, - "durationMaxValue": 0 -} + "durationMaxValue": 0, + "statusMaxCount": 0 +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_latest_status.json b/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_latest_status.json index 5d41cdf611824..2e5854f4d9866 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_latest_status.json +++ b/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_latest_status.json @@ -26,4 +26,4 @@ "query": "r=200x1", "full": "http://localhost:5678/pattern?r=200x1" } -} \ No newline at end of file +} diff --git a/x-pack/test/api_integration/apis/uptime/rest/fixtures/ping_histogram.json b/x-pack/test/api_integration/apis/uptime/rest/fixtures/ping_histogram.json index 972d1fd51760c..562ba64c24b0b 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/fixtures/ping_histogram.json +++ b/x-pack/test/api_integration/apis/uptime/rest/fixtures/ping_histogram.json @@ -1,24 +1,124 @@ { "histogram": [ - { "x": 1568172664000, "downCount": 7, "upCount": 93, "y": 1 }, - { "x": 1568172694000, "downCount": 7, "upCount": 93, "y": 1 }, - { "x": 1568172724000, "downCount": 7, "upCount": 93, "y": 1 }, - { "x": 1568172754000, "downCount": 7, "upCount": 93, "y": 1 }, - { "x": 1568172784000, "downCount": 7, "upCount": 93, "y": 1 }, - { "x": 1568172814000, "downCount": 8, "upCount": 92, "y": 1 }, - { "x": 1568172844000, "downCount": 7, "upCount": 93, "y": 1 }, - { "x": 1568172874000, "downCount": 7, "upCount": 93, "y": 1 }, - { "x": 1568172904000, "downCount": 7, "upCount": 93, "y": 1 }, - { "x": 1568172934000, "downCount": 7, "upCount": 93, "y": 1 }, - { "x": 1568172964000, "downCount": 7, "upCount": 93, "y": 1 }, - { "x": 1568172994000, "downCount": 8, "upCount": 92, "y": 1 }, - { "x": 1568173024000, "downCount": 7, "upCount": 93, "y": 1 }, - { "x": 1568173054000, "downCount": 7, "upCount": 93, "y": 1 }, - { "x": 1568173084000, "downCount": 7, "upCount": 93, "y": 1 }, - { "x": 1568173114000, "downCount": 7, "upCount": 93, "y": 1 }, - { "x": 1568173144000, "downCount": 7, "upCount": 93, "y": 1 }, - { "x": 1568173174000, "downCount": 8, "upCount": 92, "y": 1 }, - { "x": 1568173204000, "downCount": 7, "upCount": 93, "y": 1 }, - { "x": 1568173234000, "downCount": 7, "upCount": 93, "y": 1 } + { + "x": 1568172664000, + "downCount": 7, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172694000, + "downCount": 7, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172724000, + "downCount": 7, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172754000, + "downCount": 7, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172784000, + "downCount": 7, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172814000, + "downCount": 8, + "upCount": 92, + "y": 1 + }, + { + "x": 1568172844000, + "downCount": 7, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172874000, + "downCount": 7, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172904000, + "downCount": 7, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172934000, + "downCount": 7, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172964000, + "downCount": 7, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172994000, + "downCount": 8, + "upCount": 92, + "y": 1 + }, + { + "x": 1568173024000, + "downCount": 7, + "upCount": 93, + "y": 1 + }, + { + "x": 1568173054000, + "downCount": 7, + "upCount": 93, + "y": 1 + }, + { + "x": 1568173084000, + "downCount": 7, + "upCount": 93, + "y": 1 + }, + { + "x": 1568173114000, + "downCount": 7, + "upCount": 93, + "y": 1 + }, + { + "x": 1568173144000, + "downCount": 7, + "upCount": 93, + "y": 1 + }, + { + "x": 1568173174000, + "downCount": 8, + "upCount": 92, + "y": 1 + }, + { + "x": 1568173204000, + "downCount": 7, + "upCount": 93, + "y": 1 + }, + { + "x": 1568173234000, + "downCount": 7, + "upCount": 93, + "y": 1 + } ] -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/rest/fixtures/ping_histogram_by_filter.json b/x-pack/test/api_integration/apis/uptime/rest/fixtures/ping_histogram_by_filter.json index 72b2d5276e025..42be715c4acd4 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/fixtures/ping_histogram_by_filter.json +++ b/x-pack/test/api_integration/apis/uptime/rest/fixtures/ping_histogram_by_filter.json @@ -1,24 +1,124 @@ { "histogram": [ - { "x": 1568172664000, "downCount": 0, "upCount": 93, "y": 1 }, - { "x": 1568172694000, "downCount": 0, "upCount": 93, "y": 1 }, - { "x": 1568172724000, "downCount": 0, "upCount": 93, "y": 1 }, - { "x": 1568172754000, "downCount": 0, "upCount": 93, "y": 1 }, - { "x": 1568172784000, "downCount": 0, "upCount": 93, "y": 1 }, - { "x": 1568172814000, "downCount": 0, "upCount": 92, "y": 1 }, - { "x": 1568172844000, "downCount": 0, "upCount": 93, "y": 1 }, - { "x": 1568172874000, "downCount": 0, "upCount": 93, "y": 1 }, - { "x": 1568172904000, "downCount": 0, "upCount": 93, "y": 1 }, - { "x": 1568172934000, "downCount": 0, "upCount": 93, "y": 1 }, - { "x": 1568172964000, "downCount": 0, "upCount": 93, "y": 1 }, - { "x": 1568172994000, "downCount": 0, "upCount": 92, "y": 1 }, - { "x": 1568173024000, "downCount": 0, "upCount": 93, "y": 1 }, - { "x": 1568173054000, "downCount": 0, "upCount": 93, "y": 1 }, - { "x": 1568173084000, "downCount": 0, "upCount": 93, "y": 1 }, - { "x": 1568173114000, "downCount": 0, "upCount": 93, "y": 1 }, - { "x": 1568173144000, "downCount": 0, "upCount": 93, "y": 1 }, - { "x": 1568173174000, "downCount": 0, "upCount": 92, "y": 1 }, - { "x": 1568173204000, "downCount": 0, "upCount": 93, "y": 1 }, - { "x": 1568173234000, "downCount": 0, "upCount": 93, "y": 1 } + { + "x": 1568172664000, + "downCount": 0, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172694000, + "downCount": 0, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172724000, + "downCount": 0, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172754000, + "downCount": 0, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172784000, + "downCount": 0, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172814000, + "downCount": 0, + "upCount": 92, + "y": 1 + }, + { + "x": 1568172844000, + "downCount": 0, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172874000, + "downCount": 0, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172904000, + "downCount": 0, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172934000, + "downCount": 0, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172964000, + "downCount": 0, + "upCount": 93, + "y": 1 + }, + { + "x": 1568172994000, + "downCount": 0, + "upCount": 92, + "y": 1 + }, + { + "x": 1568173024000, + "downCount": 0, + "upCount": 93, + "y": 1 + }, + { + "x": 1568173054000, + "downCount": 0, + "upCount": 93, + "y": 1 + }, + { + "x": 1568173084000, + "downCount": 0, + "upCount": 93, + "y": 1 + }, + { + "x": 1568173114000, + "downCount": 0, + "upCount": 93, + "y": 1 + }, + { + "x": 1568173144000, + "downCount": 0, + "upCount": 93, + "y": 1 + }, + { + "x": 1568173174000, + "downCount": 0, + "upCount": 92, + "y": 1 + }, + { + "x": 1568173204000, + "downCount": 0, + "upCount": 93, + "y": 1 + }, + { + "x": 1568173234000, + "downCount": 0, + "upCount": 93, + "y": 1 + } ] -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/rest/fixtures/ping_histogram_by_id.json b/x-pack/test/api_integration/apis/uptime/rest/fixtures/ping_histogram_by_id.json index 8e184b247ab52..9a726db616325 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/fixtures/ping_histogram_by_id.json +++ b/x-pack/test/api_integration/apis/uptime/rest/fixtures/ping_histogram_by_id.json @@ -1,24 +1,124 @@ { "histogram": [ - { "x": 1568172664000, "downCount": 0, "upCount": 1, "y": 1 }, - { "x": 1568172694000, "downCount": 0, "upCount": 1, "y": 1 }, - { "x": 1568172724000, "downCount": 0, "upCount": 1, "y": 1 }, - { "x": 1568172754000, "downCount": 0, "upCount": 1, "y": 1 }, - { "x": 1568172784000, "downCount": 0, "upCount": 1, "y": 1 }, - { "x": 1568172814000, "downCount": 0, "upCount": 1, "y": 1 }, - { "x": 1568172844000, "downCount": 0, "upCount": 1, "y": 1 }, - { "x": 1568172874000, "downCount": 0, "upCount": 1, "y": 1 }, - { "x": 1568172904000, "downCount": 0, "upCount": 1, "y": 1 }, - { "x": 1568172934000, "downCount": 0, "upCount": 1, "y": 1 }, - { "x": 1568172964000, "downCount": 0, "upCount": 1, "y": 1 }, - { "x": 1568172994000, "downCount": 0, "upCount": 1, "y": 1 }, - { "x": 1568173024000, "downCount": 0, "upCount": 1, "y": 1 }, - { "x": 1568173054000, "downCount": 0, "upCount": 1, "y": 1 }, - { "x": 1568173084000, "downCount": 0, "upCount": 1, "y": 1 }, - { "x": 1568173114000, "downCount": 0, "upCount": 1, "y": 1 }, - { "x": 1568173144000, "downCount": 0, "upCount": 1, "y": 1 }, - { "x": 1568173174000, "downCount": 0, "upCount": 1, "y": 1 }, - { "x": 1568173204000, "downCount": 0, "upCount": 1, "y": 1 }, - { "x": 1568173234000, "downCount": 0, "upCount": 1, "y": 1 } + { + "x": 1568172664000, + "downCount": 0, + "upCount": 1, + "y": 1 + }, + { + "x": 1568172694000, + "downCount": 0, + "upCount": 1, + "y": 1 + }, + { + "x": 1568172724000, + "downCount": 0, + "upCount": 1, + "y": 1 + }, + { + "x": 1568172754000, + "downCount": 0, + "upCount": 1, + "y": 1 + }, + { + "x": 1568172784000, + "downCount": 0, + "upCount": 1, + "y": 1 + }, + { + "x": 1568172814000, + "downCount": 0, + "upCount": 1, + "y": 1 + }, + { + "x": 1568172844000, + "downCount": 0, + "upCount": 1, + "y": 1 + }, + { + "x": 1568172874000, + "downCount": 0, + "upCount": 1, + "y": 1 + }, + { + "x": 1568172904000, + "downCount": 0, + "upCount": 1, + "y": 1 + }, + { + "x": 1568172934000, + "downCount": 0, + "upCount": 1, + "y": 1 + }, + { + "x": 1568172964000, + "downCount": 0, + "upCount": 1, + "y": 1 + }, + { + "x": 1568172994000, + "downCount": 0, + "upCount": 1, + "y": 1 + }, + { + "x": 1568173024000, + "downCount": 0, + "upCount": 1, + "y": 1 + }, + { + "x": 1568173054000, + "downCount": 0, + "upCount": 1, + "y": 1 + }, + { + "x": 1568173084000, + "downCount": 0, + "upCount": 1, + "y": 1 + }, + { + "x": 1568173114000, + "downCount": 0, + "upCount": 1, + "y": 1 + }, + { + "x": 1568173144000, + "downCount": 0, + "upCount": 1, + "y": 1 + }, + { + "x": 1568173174000, + "downCount": 0, + "upCount": 1, + "y": 1 + }, + { + "x": 1568173204000, + "downCount": 0, + "upCount": 1, + "y": 1 + }, + { + "x": 1568173234000, + "downCount": 0, + "upCount": 1, + "y": 1 + } ] -} +} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/rest/fixtures/selected_monitor.json b/x-pack/test/api_integration/apis/uptime/rest/fixtures/selected_monitor.json new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_security.ts b/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_security.ts index de68ec0c64c17..b6889f21bb1ab 100644 --- a/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_security.ts +++ b/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_security.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { createDashboardEditUrl, DashboardConstants, -} from '../../../../../../src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_constants'; +} from '../../../../../../src/plugins/dashboard/public/dashboard_constants'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function({ getPageObjects, getService }: FtrProviderContext) { diff --git a/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_spaces.ts b/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_spaces.ts index 5ab26e4189096..1e6f8d5b5a97e 100644 --- a/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_spaces.ts +++ b/x-pack/test/functional/apps/dashboard/feature_controls/dashboard_spaces.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { createDashboardEditUrl, DashboardConstants, -} from '../../../../../../src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_constants'; +} from '../../../../../../src/plugins/dashboard/public/dashboard_constants'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function({ getPageObjects, getService }: FtrProviderContext) { diff --git a/x-pack/test/functional/apps/maps/discover.js b/x-pack/test/functional/apps/maps/discover.js index ce33596476755..43a7a93ad62e4 100644 --- a/x-pack/test/functional/apps/maps/discover.js +++ b/x-pack/test/functional/apps/maps/discover.js @@ -17,7 +17,6 @@ export default function({ getService, getPageObjects }) { it('should link geo_shape fields to Maps application', async () => { await PageObjects.discover.selectIndexPattern('geo_shapes*'); - await PageObjects.discover.clickFieldListItem('geometry'); await PageObjects.discover.clickFieldListItemVisualize('geometry'); await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.maps.waitForLayersToLoad(); @@ -37,7 +36,6 @@ export default function({ getService, getPageObjects }) { await queryBar.submitQuery(); await PageObjects.header.waitUntilLoadingHasFinished(); - await PageObjects.discover.clickFieldListItem('geo.coordinates'); await PageObjects.discover.clickFieldListItemVisualize('geo.coordinates'); await PageObjects.header.waitUntilLoadingHasFinished(); await PageObjects.maps.waitForLayersToLoad(); diff --git a/yarn.lock b/yarn.lock index 8176eab436afd..d9edb55a32039 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9651,7 +9651,7 @@ core-js@^2.2.0, core-js@^2.4.0, core-js@^2.5.0, core-js@^2.5.1, core-js@^2.5.3, resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2" integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A== -core-js@^3.0.1, core-js@^3.0.4, core-js@^3.2.1, core-js@^3.4.1, core-js@^3.6.4: +core-js@^3.0.1, core-js@^3.0.4, core-js@^3.4.1, core-js@^3.6.4: version "3.6.4" resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.6.4.tgz#440a83536b458114b9cb2ac1580ba377dc470647" integrity sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw== @@ -24284,7 +24284,7 @@ react-router-redux@^4.0.8: resolved "https://registry.yarnpkg.com/react-router-redux/-/react-router-redux-4.0.8.tgz#227403596b5151e182377dab835b5d45f0f8054e" integrity sha1-InQDWWtRUeGCN32rg1tdRfD4BU4= -react-router@5.1.2: +react-router@5.1.2, react-router@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.1.2.tgz#6ea51d789cb36a6be1ba5f7c0d48dd9e817d3418" integrity sha512-yjEuMFy1ONK246B+rsa0cUam5OeAQ8pyclRDgpxuSCrAlJ1qN9uZ5IgyKC7gQg0w8OM50NXHEegPh/ks9YuR2A==