diff --git a/.eslintrc.js b/.eslintrc.js index dc2eaa993ce8b3..a2b8ae7622d0b0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -567,7 +567,7 @@ module.exports = { }, { // typescript only for front and back end - files: ['x-pack/legacy/plugins/siem/**/*.{ts,tsx}'], + files: ['x-pack/{,legacy/}plugins/siem/**/*.{ts,tsx}'], rules: { // This will be turned on after bug fixes are complete // '@typescript-eslint/explicit-member-accessibility': 'warn', @@ -613,7 +613,7 @@ module.exports = { // }, { // typescript and javascript for front and back end - files: ['x-pack/legacy/plugins/siem/**/*.{js,ts,tsx}'], + files: ['x-pack/{,legacy/}plugins/siem/**/*.{js,ts,tsx}'], plugins: ['eslint-plugin-node', 'react'], env: { mocha: true, diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5c745f1611cce9..e4a9d87bc56fcc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,6 +22,7 @@ A high level overview of our contributing guidelines. - [Setting Up SSL](#setting-up-ssl) - [Linting](#linting) - [Internationalization](#internationalization) + - [Localization](#localization) - [Testing and Building](#testing-and-building) - [Debugging server code](#debugging-server-code) - [Instrumenting with Elastic APM](#instrumenting-with-elastic-apm) @@ -408,6 +409,11 @@ ReactDOM.render( There are a number of tools created to support internationalization in Kibana that would allow one to validate internationalized labels, extract them to a `JSON` file or integrate translations back to Kibana. To know more, please read corresponding [readme](src/dev/i18n/README.md) file. +### Localization + +We cannot support accepting contributions to the translations from any source other than the translators we have engaged to do the work. +We are still to develop a proper process to accept any contributed translations. We certainly appreciate that people care enough about the localization effort to want to help improve the quality. We aim to build out a more comprehensive localization process for the future and will notify you once contributions can be supported, but for the time being, we are not able to incorporate suggestions. + ### Testing and Building To ensure that your changes will not break other functionality, please run the test suite and build process before submitting your Pull Request. diff --git a/Jenkinsfile b/Jenkinsfile index 79d3c93006cb6a..6646ee15ba1c29 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -41,7 +41,7 @@ kibanaPipeline(timeoutMinutes: 135, checkPrChanges: true) { 'xpack-ciGroup10': kibanaPipeline.xpackCiGroupProcess(10), 'xpack-accessibility': kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'), 'xpack-siemCypress': { processNumber -> - whenChanged(['x-pack/legacy/plugins/siem/', 'x-pack/test/siem_cypress/']) { + whenChanged(['x-pack/plugins/siem/', 'x-pack/legacy/plugins/siem/', 'x-pack/test/siem_cypress/']) { kibanaPipeline.functionalTestProcess('xpack-siemCypress', './test/scripts/jenkins_siem_cypress.sh')(processNumber) } }, diff --git a/docs/api/saved-objects/create.asciidoc b/docs/api/saved-objects/create.asciidoc index dc010c80fd0121..571b57a5ef9c28 100644 --- a/docs/api/saved-objects/create.asciidoc +++ b/docs/api/saved-objects/create.asciidoc @@ -57,12 +57,12 @@ any data that you send to the API is properly formed. [source,sh] -------------------------------------------------- -$ curl -X POST "localhost:5601/api/saved_objects/index-pattern/my-pattern" +$ curl -X POST "localhost:5601/api/saved_objects/index-pattern/my-pattern" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' { "attributes": { "title": "my-pattern-*" } -} +}' -------------------------------------------------- // KIBANA diff --git a/docs/api/saved-objects/export.asciidoc b/docs/api/saved-objects/export.asciidoc index e8c762b9543a18..a992d13ed9b9c8 100644 --- a/docs/api/saved-objects/export.asciidoc +++ b/docs/api/saved-objects/export.asciidoc @@ -68,10 +68,10 @@ Export all index pattern saved objects: [source,sh] -------------------------------------------------- -$ curl -X POST "localhost:5601/api/saved_objects/_export" +$ curl -X POST "localhost:5601/api/saved_objects/_export" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' { "type": "index-pattern" -} +}' -------------------------------------------------- // KIBANA @@ -79,11 +79,11 @@ Export all index pattern saved objects and exclude the export summary from the s [source,sh] -------------------------------------------------- -$ curl -X POST "localhost:5601/api/saved_objects/_export" +$ curl -X POST "localhost:5601/api/saved_objects/_export" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' { "type": "index-pattern", "excludeExportDetails": true -} +}' -------------------------------------------------- // KIBANA @@ -91,7 +91,7 @@ Export a specific saved object: [source,sh] -------------------------------------------------- -$ curl -X POST "localhost:5601/api/saved_objects/_export" +$ curl -X POST "localhost:5601/api/saved_objects/_export" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' { "objects": [ { @@ -99,7 +99,7 @@ $ curl -X POST "localhost:5601/api/saved_objects/_export" "id": "be3733a0-9efe-11e7-acb3-3dab96693fab" } ] -} +}' -------------------------------------------------- // KIBANA @@ -107,7 +107,7 @@ Export a specific saved object and it's related objects : [source,sh] -------------------------------------------------- -$ curl -X POST "localhost:5601/api/saved_objects/_export" +$ curl -X POST "localhost:5601/api/saved_objects/_export" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' { "objects": [ { @@ -116,6 +116,6 @@ $ curl -X POST "localhost:5601/api/saved_objects/_export" } ], "includeReferencesDeep": true -} +}' -------------------------------------------------- // KIBANA diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md index fc0dab94a0f656..bf29c883e4eb96 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.md @@ -88,7 +88,6 @@ | [SavedQuery](./kibana-plugin-plugins-data-public.savedquery.md) | | | [SavedQueryService](./kibana-plugin-plugins-data-public.savedqueryservice.md) | | | [SearchSourceFields](./kibana-plugin-plugins-data-public.searchsourcefields.md) | | -| [SearchStrategyProvider](./kibana-plugin-plugins-data-public.searchstrategyprovider.md) | | | [TabbedAggColumn](./kibana-plugin-plugins-data-public.tabbedaggcolumn.md) | \* | | [TabbedTable](./kibana-plugin-plugins-data-public.tabbedtable.md) | \* | | [TimeRange](./kibana-plugin-plugins-data-public.timerange.md) | | diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.id.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.id.md deleted file mode 100644 index d60ffba6a05ca8..00000000000000 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.id.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchStrategyProvider](./kibana-plugin-plugins-data-public.searchstrategyprovider.md) > [id](./kibana-plugin-plugins-data-public.searchstrategyprovider.id.md) - -## SearchStrategyProvider.id property - -Signature: - -```typescript -id: string; -``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.isviable.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.isviable.md deleted file mode 100644 index aa8ed49051ee9a..00000000000000 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.isviable.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchStrategyProvider](./kibana-plugin-plugins-data-public.searchstrategyprovider.md) > [isViable](./kibana-plugin-plugins-data-public.searchstrategyprovider.isviable.md) - -## SearchStrategyProvider.isViable property - -Signature: - -```typescript -isViable: (indexPattern: IndexPattern) => boolean; -``` diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.md deleted file mode 100644 index b271a921906a71..00000000000000 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.md +++ /dev/null @@ -1,20 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchStrategyProvider](./kibana-plugin-plugins-data-public.searchstrategyprovider.md) - -## SearchStrategyProvider interface - -Signature: - -```typescript -export interface SearchStrategyProvider -``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [id](./kibana-plugin-plugins-data-public.searchstrategyprovider.id.md) | string | | -| [isViable](./kibana-plugin-plugins-data-public.searchstrategyprovider.isviable.md) | (indexPattern: IndexPattern) => boolean | | -| [search](./kibana-plugin-plugins-data-public.searchstrategyprovider.search.md) | (params: SearchStrategySearchParams) => SearchStrategyResponse | | - diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.search.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.search.md deleted file mode 100644 index 6e2561c3b0ad00..00000000000000 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.search.md +++ /dev/null @@ -1,11 +0,0 @@ - - -[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchStrategyProvider](./kibana-plugin-plugins-data-public.searchstrategyprovider.md) > [search](./kibana-plugin-plugins-data-public.searchstrategyprovider.search.md) - -## SearchStrategyProvider.search property - -Signature: - -```typescript -search: (params: SearchStrategySearchParams) => SearchStrategyResponse; -``` diff --git a/docs/user/alerting/action-types.asciidoc b/docs/user/alerting/action-types.asciidoc index 2913bf28dd765e..49e7bd1d777432 100644 --- a/docs/user/alerting/action-types.asciidoc +++ b/docs/user/alerting/action-types.asciidoc @@ -34,14 +34,23 @@ a| <> [NOTE] ============================================== -Some action types are paid commercial features, while others are free. -For a comparison of the Elastic subscription levels, -see https://www.elastic.co/subscriptions[the subscription page]. +Some action types are paid commercial features, while others are free. +For a comparison of the Elastic subscription levels, +see https://www.elastic.co/subscriptions[the subscription page]. ============================================== +[float] +[[create-connectors]] +=== Connectors + +You can create connectors for actions in <> or via the action API. +For out-of-the-box and standardized connectors, you can <> +before {kib} starts. + include::action-types/email.asciidoc[] include::action-types/index.asciidoc[] include::action-types/pagerduty.asciidoc[] include::action-types/server-log.asciidoc[] include::action-types/slack.asciidoc[] include::action-types/webhook.asciidoc[] +include::pre-configured-connectors.asciidoc[] diff --git a/docs/user/alerting/images/alert-pre-configured-connectors-dropdown.png b/docs/user/alerting/images/alert-pre-configured-connectors-dropdown.png new file mode 100644 index 00000000000000..4e6c713298626f Binary files /dev/null and b/docs/user/alerting/images/alert-pre-configured-connectors-dropdown.png differ diff --git a/docs/user/alerting/images/alert-pre-configured-slack-connector.png b/docs/user/alerting/images/alert-pre-configured-slack-connector.png new file mode 100644 index 00000000000000..de05e2074dddeb Binary files /dev/null and b/docs/user/alerting/images/alert-pre-configured-slack-connector.png differ diff --git a/docs/user/alerting/images/pre-configured-connectors-managing.png b/docs/user/alerting/images/pre-configured-connectors-managing.png new file mode 100644 index 00000000000000..f97e93175fa368 Binary files /dev/null and b/docs/user/alerting/images/pre-configured-connectors-managing.png differ diff --git a/docs/user/alerting/images/pre-configured-connectors-view-screen.png b/docs/user/alerting/images/pre-configured-connectors-view-screen.png new file mode 100644 index 00000000000000..43ac44e7536d8f Binary files /dev/null and b/docs/user/alerting/images/pre-configured-connectors-view-screen.png differ diff --git a/docs/user/alerting/pre-configured-connectors.asciidoc b/docs/user/alerting/pre-configured-connectors.asciidoc new file mode 100644 index 00000000000000..3db13acfb423e0 --- /dev/null +++ b/docs/user/alerting/pre-configured-connectors.asciidoc @@ -0,0 +1,88 @@ +[role="xpack"] +[[pre-configured-connectors]] + +== Preconfigured connectors + +You can preconfigure an action connector to have all the information it needs prior to startup +by adding it to the `kibana.yml` file. +Sensitive configuration information, such as credentials, can use the {kib} keystore. + +Preconfigured connectors offer the following capabilities: + +- Require no setup. Configuration and credentials needed to execute an +action are predefined, including the connector name and ID. +- Appear in all spaces because they are not saved objects. +- Cannot be edited or deleted. + +[float] +[[preconfigured-connector-example]] +=== Example of a preconfigured connector + +The following example shows a valid configuration 2 out-of-the box connector. + +[source,console] +------------------------ + xpack.actions.preconfigured: + - id: 'my-slack1' <1> + actionTypeId: .slack <2> + name: 'Slack #xyz' <3> + config: <4> + webhookUrl: 'https://hooks.slack.com/services/abcd/efgh/ijklmnopqrstuvwxyz' + - id: 'webhook-service' + actionTypeId: .webhook + name: 'Email service' + config: + url: 'https://email-alert-service.elastic.co' + method: post + headers: + header1: value1 + header2: value2 + secrets: <5> + user: elastic + password: changeme +------------------------ + +<1> `id` is the action connector identifier. +<2> `actionTypeId` is the action type identifier. +<3> `name` is the name of the preconfigured connector. +<4> `config` is the action type specific to the configuration. +<5> `secrets` is sensitive configuration, such as username, password, and keys. + +[NOTE] +============================================== +Sensitive properties, such as passwords, can also be stored in the {kib} keystore. +============================================== + +[float] +[[pre-configured-connector-alert-form]] +=== Creating an alert with a preconfigured connector + +When attaching an action to an alert, +select from a list of available action types, and +then select the Slack or Webhook type. Those action types were configured previously. +The preconfigured connector is installed and is automatically selected. + +[role="screenshot"] +image::images/alert-pre-configured-slack-connector.png[Create alert with selected Slack action type] + +The dropdown is populated with additional preconfigured Slack connectors. +The `preconfigured` label distinguishes them from space-aware connectors that use saved objects. + +[role="screenshot"] +image::images/alert-pre-configured-connectors-dropdown.png[Dropdown list with pre-cofigured connectors] + +[float] +[[managing-pre-configured-connectors]] +=== Managing preconfigured connectors + +Preconfigured connectors appear in the connector list, regardless of which space the user is in. +They are tagged as “preconfigured” and cannot be deleted. + +[role="screenshot"] +image::images/pre-configured-connectors-managing.png[Connectors managing tab with pre-cofigured] + +Clicking on a preconfigured connector shows the description, but not any of the configuration. +A message indicates that this is a preconfigured connector. + +[role="screenshot"] +image::images/pre-configured-connectors-view-screen.png[Pre-configured connector view details] diff --git a/packages/kbn-config-schema/src/index.ts b/packages/kbn-config-schema/src/index.ts index fc3e3c541846ab..5d387f327e58fd 100644 --- a/packages/kbn-config-schema/src/index.ts +++ b/packages/kbn-config-schema/src/index.ts @@ -60,6 +60,7 @@ import { export { ObjectType, TypeOf, Type }; export { ByteSizeValue } from './byte_size_value'; export { SchemaTypeError, ValidationError } from './errors'; +export { isConfigSchema } from './typeguards'; function any(options?: TypeOptions) { return new AnyType(options); diff --git a/packages/kbn-config-schema/src/typeguards/index.ts b/packages/kbn-config-schema/src/typeguards/index.ts new file mode 100644 index 00000000000000..e724878eb33e9a --- /dev/null +++ b/packages/kbn-config-schema/src/typeguards/index.ts @@ -0,0 +1,20 @@ +/* + * 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 { isConfigSchema } from './is_config_schema'; diff --git a/packages/kbn-config-schema/src/typeguards/is_config_schema.test.ts b/packages/kbn-config-schema/src/typeguards/is_config_schema.test.ts new file mode 100644 index 00000000000000..e0ef3835ca0a37 --- /dev/null +++ b/packages/kbn-config-schema/src/typeguards/is_config_schema.test.ts @@ -0,0 +1,56 @@ +/* + * 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 { schema } from '..'; +import { isConfigSchema } from './is_config_schema'; + +describe('isConfigSchema', () => { + it('returns true for every sub classes of `Type`', () => { + expect(isConfigSchema(schema.any())).toBe(true); + expect(isConfigSchema(schema.arrayOf(schema.string()))).toBe(true); + expect(isConfigSchema(schema.boolean())).toBe(true); + expect(isConfigSchema(schema.buffer())).toBe(true); + expect(isConfigSchema(schema.byteSize())).toBe(true); + expect(isConfigSchema(schema.duration())).toBe(true); + expect(isConfigSchema(schema.literal(''))).toBe(true); + expect(isConfigSchema(schema.mapOf(schema.string(), schema.number()))).toBe(true); + expect(isConfigSchema(schema.nullable(schema.string()))).toBe(true); + expect(isConfigSchema(schema.number())).toBe(true); + expect(isConfigSchema(schema.object({}))).toBe(true); + expect(isConfigSchema(schema.oneOf([schema.string()]))).toBe(true); + expect(isConfigSchema(schema.recordOf(schema.string(), schema.object({})))).toBe(true); + expect(isConfigSchema(schema.string())).toBe(true); + expect(isConfigSchema(schema.stream())).toBe(true); + }); + + it('returns false for every javascript data type', () => { + expect(isConfigSchema('foo')).toBe(false); + expect(isConfigSchema(42)).toBe(false); + expect(isConfigSchema(new Date())).toBe(false); + expect(isConfigSchema(null)).toBe(false); + expect(isConfigSchema(undefined)).toBe(false); + expect(isConfigSchema([1, 2, 3])).toBe(false); + expect(isConfigSchema({ foo: 'bar' })).toBe(false); + expect(isConfigSchema(function() {})).toBe(false); + }); + + it('returns true as long as `__isKbnConfigSchemaType` is true', () => { + expect(isConfigSchema({ __isKbnConfigSchemaType: true })).toBe(true); + }); +}); diff --git a/src/plugins/data/public/search/search_strategy/index.ts b/packages/kbn-config-schema/src/typeguards/is_config_schema.ts similarity index 79% rename from src/plugins/data/public/search/search_strategy/index.ts rename to packages/kbn-config-schema/src/typeguards/is_config_schema.ts index e3de2ea46e3eca..20e68ab2ead254 100644 --- a/src/plugins/data/public/search/search_strategy/index.ts +++ b/packages/kbn-config-schema/src/typeguards/is_config_schema.ts @@ -17,8 +17,8 @@ * under the License. */ -export { SearchError, getSearchErrorType } from './search_error'; +import { Type } from '../types'; -export { SearchStrategyProvider, SearchStrategySearchParams } from './types'; - -export { defaultSearchStrategy } from './default_search_strategy'; +export function isConfigSchema(obj: any): obj is Type { + return obj ? obj.__isKbnConfigSchemaType === true : false; +} diff --git a/packages/kbn-config-schema/src/types/type.ts b/packages/kbn-config-schema/src/types/type.ts index 6d5ddf6b24afb5..5ca16c61399e7e 100644 --- a/packages/kbn-config-schema/src/types/type.ts +++ b/packages/kbn-config-schema/src/types/type.ts @@ -32,6 +32,9 @@ export abstract class Type { // sets the value to `null` while still keeping the type. public readonly type: V = null! as V; + // used for the `isConfigSchema` typeguard + public readonly __isKbnConfigSchemaType = true; + /** * Internal "schema" backed by Joi. * @type {Schema} diff --git a/packages/kbn-optimizer/src/optimizer/optimizer_config.test.ts b/packages/kbn-optimizer/src/optimizer/optimizer_config.test.ts index d67b9574167530..cc564dd4a8387c 100644 --- a/packages/kbn-optimizer/src/optimizer/optimizer_config.test.ts +++ b/packages/kbn-optimizer/src/optimizer/optimizer_config.test.ts @@ -146,6 +146,7 @@ describe('OptimizerConfig::parseOptions()', () => { /x-pack/plugins, /plugins, /examples, + /x-pack/examples, -extra, ], "profileWebpack": false, diff --git a/packages/kbn-optimizer/src/optimizer/optimizer_config.ts b/packages/kbn-optimizer/src/optimizer/optimizer_config.ts index 1c8ae265bf6bb8..7e1514058446b9 100644 --- a/packages/kbn-optimizer/src/optimizer/optimizer_config.ts +++ b/packages/kbn-optimizer/src/optimizer/optimizer_config.ts @@ -91,14 +91,14 @@ export class OptimizerConfig { /** * BEWARE: this needs to stay roughly synchronized with - * `src/core/server/config/env.ts` which determins which paths + * `src/core/server/config/env.ts` which determines which paths * should be searched for plugins to load */ const pluginScanDirs = options.pluginScanDirs || [ Path.resolve(repoRoot, 'src/plugins'), ...(oss ? [] : [Path.resolve(repoRoot, 'x-pack/plugins')]), Path.resolve(repoRoot, 'plugins'), - ...(examples ? [Path.resolve('examples')] : []), + ...(examples ? [Path.resolve('examples'), Path.resolve('x-pack/examples')] : []), Path.resolve(repoRoot, '../kibana-extra'), ]; if (!pluginScanDirs.every(p => Path.isAbsolute(p))) { diff --git a/src/cli/cluster/cluster_manager.ts b/src/cli/cluster/cluster_manager.ts index 44b6c39556afd8..a87e2aa11f2c0d 100644 --- a/src/cli/cluster/cluster_manager.ts +++ b/src/cli/cluster/cluster_manager.ts @@ -263,7 +263,7 @@ export class ClusterManager { ...pluginInternalDirsIgnore, fromRoot('src/legacy/server/sass/__tmp__'), fromRoot('x-pack/legacy/plugins/reporting/.chromium'), - fromRoot('x-pack/legacy/plugins/siem/cypress'), + fromRoot('x-pack/plugins/siem/cypress'), fromRoot('x-pack/legacy/plugins/apm/e2e'), fromRoot('x-pack/legacy/plugins/apm/scripts'), fromRoot('x-pack/legacy/plugins/canvas/canvas_plugin_src'), // prevents server from restarting twice for Canvas plugin changes, diff --git a/src/core/public/plugins/plugin_loader.test.ts b/src/core/public/plugins/plugin_loader.test.ts index b4e2c3095f14a7..18cc2d7a6f182e 100644 --- a/src/core/public/plugins/plugin_loader.test.ts +++ b/src/core/public/plugins/plugin_loader.test.ts @@ -62,7 +62,7 @@ test('`loadPluginBundles` creates a script tag and loads initializer', async () const fakeScriptTag = createdScriptTags[0]; expect(fakeScriptTag.setAttribute).toHaveBeenCalledWith( 'src', - '/bundles/plugin/plugin-a/plugin-a.plugin.js' + '/bundles/plugin:plugin-a/plugin-a.plugin.js' ); expect(fakeScriptTag.setAttribute).toHaveBeenCalledWith('id', 'kbn-plugin-plugin-a'); expect(fakeScriptTag.onload).toBeInstanceOf(Function); @@ -85,7 +85,7 @@ test('`loadPluginBundles` includes the basePath', async () => { const fakeScriptTag = createdScriptTags[0]; expect(fakeScriptTag.setAttribute).toHaveBeenCalledWith( 'src', - '/mybasepath/bundles/plugin/plugin-a/plugin-a.plugin.js' + '/mybasepath/bundles/plugin:plugin-a/plugin-a.plugin.js' ); }); @@ -96,7 +96,7 @@ test('`loadPluginBundles` rejects if script.onerror is called', async () => { fakeScriptTag1.onerror(new Error('Whoa there!')); await expect(loadPromise).rejects.toThrowErrorMatchingInlineSnapshot( - `"Failed to load \\"plugin-a\\" bundle (/bundles/plugin/plugin-a/plugin-a.plugin.js)"` + `"Failed to load \\"plugin-a\\" bundle (/bundles/plugin:plugin-a/plugin-a.plugin.js)"` ); }); @@ -105,7 +105,7 @@ test('`loadPluginBundles` rejects if timeout is reached', async () => { // Override the timeout to 1 ms for testi. loadPluginBundle(addBasePath, 'plugin-a', { timeoutMs: 1 }) ).rejects.toThrowErrorMatchingInlineSnapshot( - `"Timeout reached when loading \\"plugin-a\\" bundle (/bundles/plugin/plugin-a/plugin-a.plugin.js)"` + `"Timeout reached when loading \\"plugin-a\\" bundle (/bundles/plugin:plugin-a/plugin-a.plugin.js)"` ); }); @@ -115,11 +115,11 @@ test('`loadPluginBundles` rejects if bundle does attach an initializer to window const fakeScriptTag1 = createdScriptTags[0]; // Setup a fake initializer as if a plugin bundle had actually been loaded. - coreWindow.__kbnBundles__['plugin/plugin-a'] = undefined; + coreWindow.__kbnBundles__['plugin:plugin-a'] = undefined; // Call the onload callback fakeScriptTag1.onload(); await expect(loadPromise).rejects.toThrowErrorMatchingInlineSnapshot( - `"Definition of plugin \\"plugin-a\\" should be a function (/bundles/plugin/plugin-a/plugin-a.plugin.js)."` + `"Definition of plugin \\"plugin-a\\" should be a function (/bundles/plugin:plugin-a/plugin-a.plugin.js)."` ); }); diff --git a/src/core/public/plugins/plugin_loader.ts b/src/core/public/plugins/plugin_loader.ts index bf7711055e97ba..9b35588dfe7262 100644 --- a/src/core/public/plugins/plugin_loader.ts +++ b/src/core/public/plugins/plugin_loader.ts @@ -93,7 +93,7 @@ export const loadPluginBundle: LoadPluginBundle = < const script = document.createElement('script'); // Assumes that all plugin bundles get put into the bundles/plugins subdirectory - const bundlePath = addBasePath(`/bundles/plugin/${pluginName}/${pluginName}.plugin.js`); + const bundlePath = addBasePath(`/bundles/plugin:${pluginName}/${pluginName}.plugin.js`); script.setAttribute('src', bundlePath); script.setAttribute('id', `kbn-plugin-${pluginName}`); script.setAttribute('async', ''); diff --git a/src/core/server/config/env.test.ts b/src/core/server/config/env.test.ts index c244012e344697..0fffcc44781d9c 100644 --- a/src/core/server/config/env.test.ts +++ b/src/core/server/config/env.test.ts @@ -164,6 +164,17 @@ test('pluginSearchPaths contains examples plugins path if --run-examples flag is expect(env.pluginSearchPaths).toContain('/some/home/dir/examples'); }); +test('pluginSearchPaths contains x-pack/examples plugins path if --run-examples flag is true', () => { + const env = new Env( + '/some/home/dir', + getEnvOptions({ + cliArgs: { runExamples: true }, + }) + ); + + expect(env.pluginSearchPaths).toContain('/some/home/dir/x-pack/examples'); +}); + test('pluginSearchPaths does not contains examples plugins path if --run-examples flag is false', () => { const env = new Env( '/some/home/dir', @@ -174,3 +185,14 @@ test('pluginSearchPaths does not contains examples plugins path if --run-example expect(env.pluginSearchPaths).not.toContain('/some/home/dir/examples'); }); + +test('pluginSearchPaths does not contains x-pack/examples plugins path if --run-examples flag is false', () => { + const env = new Env( + '/some/home/dir', + getEnvOptions({ + cliArgs: { runExamples: false }, + }) + ); + + expect(env.pluginSearchPaths).not.toContain('/some/home/dir/x-pack/examples'); +}); diff --git a/src/core/server/config/env.ts b/src/core/server/config/env.ts index 05a8f40a09a88f..d8068c5b383fab 100644 --- a/src/core/server/config/env.ts +++ b/src/core/server/config/env.ts @@ -109,7 +109,9 @@ export class Env { resolve(this.homeDir, 'src', 'plugins'), ...(options.cliArgs.oss ? [] : [resolve(this.homeDir, 'x-pack', 'plugins')]), resolve(this.homeDir, 'plugins'), - ...(options.cliArgs.runExamples ? [resolve(this.homeDir, 'examples')] : []), + ...(options.cliArgs.runExamples + ? [resolve(this.homeDir, 'examples'), resolve(this.homeDir, 'x-pack', 'examples')] + : []), resolve(this.homeDir, '..', 'kibana-extra'), ]; diff --git a/src/core/server/http/router/router.ts b/src/core/server/http/router/router.ts index b4e7fc2a989b69..69402a74eda5f2 100644 --- a/src/core/server/http/router/router.ts +++ b/src/core/server/http/router/router.ts @@ -20,7 +20,7 @@ import { Request, ResponseObject, ResponseToolkit } from 'hapi'; import Boom from 'boom'; -import { Type } from '@kbn/config-schema'; +import { isConfigSchema } from '@kbn/config-schema'; import { Logger } from '../../logging'; import { KibanaRequest } from './request'; import { KibanaResponseFactory, kibanaResponseFactory, IKibanaResponse } from './response'; @@ -139,7 +139,7 @@ function routeSchemasFromRouteConfig( if (route.validate !== false) { Object.entries(route.validate).forEach(([key, schema]) => { - if (!(schema instanceof Type || typeof schema === 'function')) { + if (!(isConfigSchema(schema) || typeof schema === 'function')) { throw new Error( `Expected a valid validation logic declared with '@kbn/config-schema' package or a RouteValidationFunction at key: [${key}].` ); diff --git a/src/core/server/http/router/validator/validator.ts b/src/core/server/http/router/validator/validator.ts index 97dd2bc894f813..6c766e69f0f37f 100644 --- a/src/core/server/http/router/validator/validator.ts +++ b/src/core/server/http/router/validator/validator.ts @@ -17,7 +17,7 @@ * under the License. */ -import { ValidationError, Type, schema, ObjectType } from '@kbn/config-schema'; +import { ValidationError, Type, schema, ObjectType, isConfigSchema } from '@kbn/config-schema'; import { Stream } from 'stream'; import { RouteValidationError } from './validator_error'; @@ -236,7 +236,7 @@ export class RouteValidator

{ data?: unknown, namespace?: string ): RouteValidationResultType { - if (validationRule instanceof Type) { + if (isConfigSchema(validationRule)) { return validationRule.validate(data, {}, namespace); } else if (typeof validationRule === 'function') { return this.validateFunction(validationRule, data, namespace); diff --git a/src/core/server/plugins/plugin.ts b/src/core/server/plugins/plugin.ts index 7c67ab7a48df1d..d7cfaa14d23434 100644 --- a/src/core/server/plugins/plugin.ts +++ b/src/core/server/plugins/plugin.ts @@ -21,7 +21,7 @@ import { join } from 'path'; import typeDetect from 'type-detect'; import { Subject } from 'rxjs'; import { first } from 'rxjs/operators'; -import { Type } from '@kbn/config-schema'; +import { isConfigSchema } from '@kbn/config-schema'; import { Logger } from '../logging'; import { @@ -150,7 +150,7 @@ export class PluginWrapper< } const configDescriptor = pluginDefinition.config; - if (!(configDescriptor.schema instanceof Type)) { + if (!isConfigSchema(configDescriptor.schema)) { throw new Error('Configuration schema expected to be an instance of Type'); } return configDescriptor; diff --git a/src/dev/storybook/aliases.ts b/src/dev/storybook/aliases.ts index 8ed64f004c9be3..43114b2edccfc8 100644 --- a/src/dev/storybook/aliases.ts +++ b/src/dev/storybook/aliases.ts @@ -24,6 +24,6 @@ export const storybookAliases = { drilldowns: 'x-pack/plugins/drilldowns/scripts/storybook.js', embeddable: 'src/plugins/embeddable/scripts/storybook.js', infra: 'x-pack/legacy/plugins/infra/scripts/storybook.js', - siem: 'x-pack/legacy/plugins/siem/scripts/storybook.js', + siem: 'x-pack/plugins/siem/scripts/storybook.js', ui_actions: 'x-pack/plugins/advanced_ui_actions/scripts/storybook.js', }; diff --git a/src/dev/typescript/projects.ts b/src/dev/typescript/projects.ts index 34756912fc247e..01d8a30b598c19 100644 --- a/src/dev/typescript/projects.ts +++ b/src/dev/typescript/projects.ts @@ -27,7 +27,7 @@ export const PROJECTS = [ new Project(resolve(REPO_ROOT, 'test/tsconfig.json'), { name: 'kibana/test' }), new Project(resolve(REPO_ROOT, 'x-pack/tsconfig.json')), new Project(resolve(REPO_ROOT, 'x-pack/test/tsconfig.json'), { name: 'x-pack/test' }), - new Project(resolve(REPO_ROOT, 'x-pack/legacy/plugins/siem/cypress/tsconfig.json'), { + new Project(resolve(REPO_ROOT, 'x-pack/plugins/siem/cypress/tsconfig.json'), { name: 'siem/cypress', }), new Project(resolve(REPO_ROOT, 'x-pack/legacy/plugins/apm/e2e/tsconfig.json'), { @@ -44,6 +44,9 @@ export const PROJECTS = [ ...glob .sync('examples/*/tsconfig.json', { cwd: REPO_ROOT }) .map(path => new Project(resolve(REPO_ROOT, path))), + ...glob + .sync('x-pack/examples/*/tsconfig.json', { cwd: REPO_ROOT }) + .map(path => new Project(resolve(REPO_ROOT, path))), ...glob .sync('test/plugin_functional/plugins/*/tsconfig.json', { cwd: REPO_ROOT }) .map(path => new Project(resolve(REPO_ROOT, path))), diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/lib/get_indices.test.ts b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/lib/get_indices.test.ts index 40583af7177fee..b1500f8303b666 100644 --- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/lib/get_indices.test.ts +++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/lib/get_indices.test.ts @@ -20,7 +20,7 @@ import { getIndices } from './get_indices'; import { IndexPatternCreationConfig } from '../../../../../../../../../plugins/index_pattern_management/public'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { LegacyApiCaller } from '../../../../../../../../../plugins/data/public/search'; +import { LegacyApiCaller } from '../../../../../../../../../plugins/data/public/search/legacy'; export const successfulResponse = { hits: { diff --git a/src/legacy/server/logging/log_reporter.js b/src/legacy/server/logging/log_reporter.js index 6e62a5ee284e38..b784d03a5b86e9 100644 --- a/src/legacy/server/logging/log_reporter.js +++ b/src/legacy/server/logging/log_reporter.js @@ -30,7 +30,7 @@ import { LogInterceptor } from './log_interceptor'; // thrown every time we start the server. // In order to keep using the legacy logger until we remove it I'm just adding // a new hard limit here. -process.stdout.setMaxListeners(15); +process.stdout.setMaxListeners(25); export function getLoggerStream({ events, config }) { const squeeze = new Squeeze(events); diff --git a/src/legacy/ui/ui_render/bootstrap/template.js.hbs b/src/legacy/ui/ui_render/bootstrap/template.js.hbs index 1093153edbbf7e..4557d911620a23 100644 --- a/src/legacy/ui/ui_render/bootstrap/template.js.hbs +++ b/src/legacy/ui/ui_render/bootstrap/template.js.hbs @@ -78,10 +78,10 @@ if (window.__kbnStrictCsp__ && window.__kbnCspNotEnforced__) { '{{this}}', {{/each}} '{{regularBundlePath}}/commons.bundle.js', - {{!-- '{{regularBundlePath}}/plugin/data/data.plugin.js', --}} - '{{regularBundlePath}}/plugin/kibanaUtils/kibanaUtils.plugin.js', - '{{regularBundlePath}}/plugin/esUiShared/esUiShared.plugin.js', - '{{regularBundlePath}}/plugin/kibanaReact/kibanaReact.plugin.js' + {{!-- '{{regularBundlePath}}/plugin:data/data.plugin.js', --}} + '{{regularBundlePath}}/plugin:kibanaUtils/kibanaUtils.plugin.js', + '{{regularBundlePath}}/plugin:esUiShared/esUiShared.plugin.js', + '{{regularBundlePath}}/plugin:kibanaReact/kibanaReact.plugin.js' ], function () { load([ '{{regularBundlePath}}/{{appId}}.bundle.js', diff --git a/src/optimize/bundles_route/bundles_route.js b/src/optimize/bundles_route/bundles_route.js index 0c2e98b5acd63c..f4e3108f80a3b8 100644 --- a/src/optimize/bundles_route/bundles_route.js +++ b/src/optimize/bundles_route/bundles_route.js @@ -79,8 +79,8 @@ export function createBundlesRoute({ ), ...npUiPluginPublicDirs.map(({ id, path }) => buildRouteForBundles( - `${basePublicPath}/bundles/plugin/${id}/`, - `/bundles/plugin/${id}/`, + `${basePublicPath}/bundles/plugin:${id}/`, + `/bundles/plugin:${id}/`, path, fileHashCache ) diff --git a/src/plugins/console/server/__tests__/proxy_route/proxy_fallback.test.ts b/src/plugins/console/server/__tests__/proxy_route/proxy_fallback.test.ts new file mode 100644 index 00000000000000..b226bad11a01af --- /dev/null +++ b/src/plugins/console/server/__tests__/proxy_route/proxy_fallback.test.ts @@ -0,0 +1,64 @@ +/* + * 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 { duration } from 'moment'; +import { getProxyRouteHandlerDeps } from './mocks'; + +import { kibanaResponseFactory } from '../../../../../core/server'; +import { createHandler } from '../../routes/api/console/proxy/create_handler'; +import * as requestModule from '../../lib/proxy_request'; + +describe('Console Proxy Route', () => { + afterEach(async () => { + jest.resetAllMocks(); + }); + + describe('fallback behaviour', () => { + it('falls back to all configured endpoints regardless of error', async () => { + // Describe a situation where all three configured nodes reject + (requestModule.proxyRequest as jest.Mock).mockRejectedValueOnce(new Error('ECONNREFUSED')); + (requestModule.proxyRequest as jest.Mock).mockRejectedValueOnce(new Error('EHOSTUNREACH')); + (requestModule.proxyRequest as jest.Mock).mockRejectedValueOnce(new Error('ESOCKETTIMEDOUT')); + + const handler = createHandler( + getProxyRouteHandlerDeps({ + readLegacyESConfig: () => ({ + requestTimeout: duration(30000), + customHeaders: {}, + requestHeadersWhitelist: [], + hosts: ['http://localhost:9201', 'http://localhost:9202', 'http://localhost:9203'], + }), + }) + ); + + const response = await handler( + {} as any, + { + headers: {}, + query: { method: 'get', path: 'test' }, + } as any, + kibanaResponseFactory + ); + + expect(response.status).toBe(502); + // Return the message from the ES node we attempted last. + expect(response.payload.message).toBe('ESOCKETTIMEDOUT'); + }); + }); +}); diff --git a/src/plugins/console/server/routes/api/console/proxy/create_handler.ts b/src/plugins/console/server/routes/api/console/proxy/create_handler.ts index 50a9fcf03c2093..9446289ff03ea1 100644 --- a/src/plugins/console/server/routes/api/console/proxy/create_handler.ts +++ b/src/plugins/console/server/routes/api/console/proxy/create_handler.ts @@ -175,10 +175,9 @@ export const createHandler = ({ break; } catch (e) { + // If we reached here it means we hit a lower level network issue than just, for e.g., a 500. + // We try contacting another node in that case. log.error(e); - if (e.code !== 'ECONNREFUSED') { - return response.internalError(e); - } if (idx === hosts.length - 1) { log.warn(`Could not connect to any configured ES node [${hosts.join(', ')}]`); return response.customError({ diff --git a/src/plugins/dashboard/public/application/actions/clone_panel_action.test.tsx b/src/plugins/dashboard/public/application/actions/clone_panel_action.test.tsx new file mode 100644 index 00000000000000..17943333d25b04 --- /dev/null +++ b/src/plugins/dashboard/public/application/actions/clone_panel_action.test.tsx @@ -0,0 +1,155 @@ +/* + * 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 { isErrorEmbeddable, IContainer } from '../../embeddable_plugin'; +import { DashboardContainer, DashboardPanelState } from '../embeddable'; +import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers'; +import { + CONTACT_CARD_EMBEDDABLE, + ContactCardEmbeddableFactory, + ContactCardEmbeddable, + ContactCardEmbeddableInput, + ContactCardEmbeddableOutput, +} from '../../embeddable_plugin_test_samples'; +import { coreMock } from '../../../../../core/public/mocks'; +import { CoreStart } from 'kibana/public'; +import { ClonePanelAction } from '.'; + +// eslint-disable-next-line +import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks'; + +const { setup, doStart } = embeddablePluginMock.createInstance(); +setup.registerEmbeddableFactory( + CONTACT_CARD_EMBEDDABLE, + new ContactCardEmbeddableFactory((() => null) as any, {} as any) +); +const start = doStart(); + +let container: DashboardContainer; +let embeddable: ContactCardEmbeddable; +let coreStart: CoreStart; +beforeEach(async () => { + coreStart = coreMock.createStart(); + coreStart.savedObjects.client = { + ...coreStart.savedObjects.client, + get: jest.fn().mockImplementation(() => ({ attributes: { title: 'Holy moly' } })), + find: jest.fn().mockImplementation(() => ({ total: 15 })), + create: jest.fn().mockImplementation(() => ({ id: 'brandNewSavedObject' })), + }; + + const options = { + ExitFullScreenButton: () => null, + SavedObjectFinder: () => null, + application: {} as any, + embeddable: start, + inspector: {} as any, + notifications: {} as any, + overlays: coreStart.overlays, + savedObjectMetaData: {} as any, + uiActions: {} as any, + }; + const input = getSampleDashboardInput({ + panels: { + '123': getSampleDashboardPanel({ + explicitInput: { firstName: 'Kibanana', id: '123' }, + type: CONTACT_CARD_EMBEDDABLE, + }), + }, + }); + container = new DashboardContainer(input, options); + + const contactCardEmbeddable = await container.addNewEmbeddable< + ContactCardEmbeddableInput, + ContactCardEmbeddableOutput, + ContactCardEmbeddable + >(CONTACT_CARD_EMBEDDABLE, { + firstName: 'Kibana', + }); + + if (isErrorEmbeddable(contactCardEmbeddable)) { + throw new Error('Failed to create embeddable'); + } else { + embeddable = contactCardEmbeddable; + } +}); + +test('Clone adds a new embeddable', async () => { + const dashboard = embeddable.getRoot() as IContainer; + const originalPanelCount = Object.keys(dashboard.getInput().panels).length; + const originalPanelKeySet = new Set(Object.keys(dashboard.getInput().panels)); + const action = new ClonePanelAction(coreStart); + await action.execute({ embeddable }); + expect(Object.keys(container.getInput().panels).length).toEqual(originalPanelCount + 1); + const newPanelId = Object.keys(container.getInput().panels).find( + key => !originalPanelKeySet.has(key) + ); + expect(newPanelId).toBeDefined(); + const newPanel = container.getInput().panels[newPanelId!]; + expect(newPanel.type).toEqual(embeddable.type); +}); + +test('Clones an embeddable without a saved object ID', async () => { + const dashboard = embeddable.getRoot() as IContainer; + const panel = dashboard.getInput().panels[embeddable.id] as DashboardPanelState; + const action = new ClonePanelAction(coreStart); + // @ts-ignore + const newPanel = await action.cloneEmbeddable(panel, embeddable.type); + expect(newPanel.type).toEqual(embeddable.type); +}); + +test('Clones an embeddable with a saved object ID', async () => { + const dashboard = embeddable.getRoot() as IContainer; + const panel = dashboard.getInput().panels[embeddable.id] as DashboardPanelState; + panel.explicitInput.savedObjectId = 'holySavedObjectBatman'; + const action = new ClonePanelAction(coreStart); + // @ts-ignore + const newPanel = await action.cloneEmbeddable(panel, embeddable.type); + expect(coreStart.savedObjects.client.get).toHaveBeenCalledTimes(1); + expect(coreStart.savedObjects.client.find).toHaveBeenCalledTimes(1); + expect(coreStart.savedObjects.client.create).toHaveBeenCalledTimes(1); + expect(newPanel.type).toEqual(embeddable.type); +}); + +test('Gets a unique title ', async () => { + coreStart.savedObjects.client.find = jest.fn().mockImplementation(({ search }) => { + if (search === '"testFirstTitle"') return { total: 1 }; + else if (search === '"testSecondTitle"') return { total: 41 }; + else if (search === '"testThirdTitle"') return { total: 90 }; + }); + const action = new ClonePanelAction(coreStart); + // @ts-ignore + expect(await action.getUniqueTitle('testFirstTitle', embeddable.type)).toEqual( + 'testFirstTitle (copy)' + ); + // @ts-ignore + expect(await action.getUniqueTitle('testSecondTitle (copy 39)', embeddable.type)).toEqual( + 'testSecondTitle (copy 40)' + ); + // @ts-ignore + expect(await action.getUniqueTitle('testSecondTitle (copy 20)', embeddable.type)).toEqual( + 'testSecondTitle (copy 40)' + ); + // @ts-ignore + expect(await action.getUniqueTitle('testThirdTitle', embeddable.type)).toEqual( + 'testThirdTitle (copy 89)' + ); + // @ts-ignore + expect(await action.getUniqueTitle('testThirdTitle (copy 10000)', embeddable.type)).toEqual( + 'testThirdTitle (copy 89)' + ); +}); diff --git a/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx b/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx new file mode 100644 index 00000000000000..4d15e7e899fa89 --- /dev/null +++ b/src/plugins/dashboard/public/application/actions/clone_panel_action.tsx @@ -0,0 +1,158 @@ +/* + * 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 { i18n } from '@kbn/i18n'; +import { CoreStart } from 'src/core/public'; +import uuid from 'uuid'; +import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin'; +import { ViewMode, PanelState, IEmbeddable } from '../../embeddable_plugin'; +import { SavedObject } from '../../../../saved_objects/public'; +import { PanelNotFoundError, EmbeddableInput } from '../../../../embeddable/public'; +import { + placePanelBeside, + IPanelPlacementBesideArgs, +} from '../embeddable/panel/dashboard_panel_placement'; +import { DashboardPanelState, DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '..'; + +export const ACTION_CLONE_PANEL = 'clonePanel'; + +export interface ClonePanelActionContext { + embeddable: IEmbeddable; +} + +export class ClonePanelAction implements ActionByType { + public readonly type = ACTION_CLONE_PANEL; + public readonly id = ACTION_CLONE_PANEL; + public order = 11; + + constructor(private core: CoreStart) {} + + public getDisplayName({ embeddable }: ClonePanelActionContext) { + if (!embeddable.getRoot() || !embeddable.getRoot().isContainer) { + throw new IncompatibleActionError(); + } + return i18n.translate('dashboard.panel.clonePanel', { + defaultMessage: 'Clone panel', + }); + } + + public getIconType({ embeddable }: ClonePanelActionContext) { + if (!embeddable.getRoot() || !embeddable.getRoot().isContainer) { + throw new IncompatibleActionError(); + } + return 'copy'; + } + + public async isCompatible({ embeddable }: ClonePanelActionContext) { + return Boolean( + embeddable.getInput()?.viewMode !== ViewMode.VIEW && + embeddable.getRoot() && + embeddable.getRoot().isContainer && + embeddable.getRoot().type === DASHBOARD_CONTAINER_TYPE + ); + } + + public async execute({ embeddable }: ClonePanelActionContext) { + if (!embeddable.getRoot() || !embeddable.getRoot().isContainer) { + throw new IncompatibleActionError(); + } + + const dashboard = embeddable.getRoot() as DashboardContainer; + const panelToClone = dashboard.getInput().panels[embeddable.id] as DashboardPanelState; + if (!panelToClone) { + throw new PanelNotFoundError(); + } + + dashboard.showPlaceholderUntil( + this.cloneEmbeddable(panelToClone, embeddable.type), + placePanelBeside, + { + width: panelToClone.gridData.w, + height: panelToClone.gridData.h, + currentPanels: dashboard.getInput().panels, + placeBesideId: panelToClone.explicitInput.id, + } as IPanelPlacementBesideArgs + ); + } + + private async getUniqueTitle(rawTitle: string, embeddableType: string): Promise { + const clonedTag = i18n.translate('dashboard.panel.title.clonedTag', { + defaultMessage: 'copy', + }); + const cloneRegex = new RegExp(`\\(${clonedTag}\\)`, 'g'); + const cloneNumberRegex = new RegExp(`\\(${clonedTag} [0-9]+\\)`, 'g'); + const baseTitle = rawTitle + .replace(cloneNumberRegex, '') + .replace(cloneRegex, '') + .trim(); + + const similarSavedObjects = await this.core.savedObjects.client.find({ + type: embeddableType, + perPage: 0, + fields: ['title'], + searchFields: ['title'], + search: `"${baseTitle}"`, + }); + const similarBaseTitlesCount: number = similarSavedObjects.total - 1; + + return similarBaseTitlesCount <= 0 + ? baseTitle + ` (${clonedTag})` + : baseTitle + ` (${clonedTag} ${similarBaseTitlesCount})`; + } + + private async cloneEmbeddable( + panelToClone: DashboardPanelState, + embeddableType: string + ): Promise> { + const panelState: PanelState = { + type: embeddableType, + explicitInput: { + ...panelToClone.explicitInput, + id: uuid.v4(), + }, + }; + let newTitle: string = ''; + if (panelToClone.explicitInput.savedObjectId) { + // Fetch existing saved object + const savedObjectToClone = await this.core.savedObjects.client.get( + embeddableType, + panelToClone.explicitInput.savedObjectId + ); + + // Clone the saved object + newTitle = await this.getUniqueTitle(savedObjectToClone.attributes.title, embeddableType); + const clonedSavedObject = await this.core.savedObjects.client.create( + embeddableType, + { + ..._.cloneDeep(savedObjectToClone.attributes), + title: newTitle, + }, + { references: _.cloneDeep(savedObjectToClone.references) } + ); + panelState.explicitInput.savedObjectId = clonedSavedObject.id; + } + this.core.notifications.toasts.addSuccess({ + title: i18n.translate('dashboard.panel.clonedToast', { + defaultMessage: 'Cloned panel', + }), + 'data-test-subj': 'addObjectToContainerSuccess', + }); + return panelState; + } +} diff --git a/src/plugins/dashboard/public/application/actions/index.ts b/src/plugins/dashboard/public/application/actions/index.ts index 23c26dbd280f8e..d7a84fb79f6af3 100644 --- a/src/plugins/dashboard/public/application/actions/index.ts +++ b/src/plugins/dashboard/public/application/actions/index.ts @@ -27,3 +27,8 @@ export { ReplacePanelActionContext, ACTION_REPLACE_PANEL, } from './replace_panel_action'; +export { + ClonePanelAction, + ClonePanelActionContext, + ACTION_CLONE_PANEL, +} from './clone_panel_action'; diff --git a/src/plugins/dashboard/public/application/dashboard_state_manager.ts b/src/plugins/dashboard/public/application/dashboard_state_manager.ts index 13ba3c6d0b60d4..b03ea95069a3da 100644 --- a/src/plugins/dashboard/public/application/dashboard_state_manager.ts +++ b/src/plugins/dashboard/public/application/dashboard_state_manager.ts @@ -34,6 +34,7 @@ import { FilterUtils } from './lib/filter_utils'; import { DashboardAppState, DashboardAppStateDefaults, + DashboardAppStateInUrl, DashboardAppStateTransitions, SavedDashboardPanel, } from '../types'; @@ -165,11 +166,12 @@ export class DashboardStateManager { }); // setup state syncing utils. state container will be synced with url into `this.STATE_STORAGE_KEY` query param - this.stateSyncRef = syncState({ + this.stateSyncRef = syncState({ storageKey: this.STATE_STORAGE_KEY, stateContainer: { ...this.stateContainer, - set: (state: DashboardAppState | null) => { + get: () => this.toUrlState(this.stateContainer.get()), + set: (state: DashboardAppStateInUrl | null) => { // sync state required state container to be able to handle null // overriding set() so it could handle null coming from url if (state) { @@ -558,9 +560,9 @@ export class DashboardStateManager { */ private saveState({ replace }: { replace: boolean }): boolean { // schedules setting current state to url - this.kbnUrlStateStorage.set( + this.kbnUrlStateStorage.set( this.STATE_STORAGE_KEY, - this.stateContainer.get() + this.toUrlState(this.stateContainer.get()) ); // immediately forces scheduled updates and changes location return this.kbnUrlStateStorage.flush({ replace }); @@ -620,4 +622,13 @@ export class DashboardStateManager { const current = _.omit(this.stateContainer.get(), propsToIgnore); return !_.isEqual(initial, current); } + + private toUrlState(state: DashboardAppState): DashboardAppStateInUrl { + if (state.viewMode === ViewMode.VIEW) { + const { panels, ...stateWithoutPanels } = state; + return stateWithoutPanels; + } + + return state; + } } diff --git a/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx b/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx index 50089f1f061f4e..8346fd900caef8 100644 --- a/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx +++ b/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx @@ -23,6 +23,7 @@ import { I18nProvider } from '@kbn/i18n/react'; 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 uuid from 'uuid'; import { UiActionsStart } from '../../ui_actions_plugin'; import { Container, @@ -32,6 +33,7 @@ import { EmbeddableFactory, IEmbeddable, EmbeddableStart, + PanelState, } from '../../embeddable_plugin'; import { DASHBOARD_CONTAINER_TYPE } from './dashboard_constants'; import { createPanelState } from './panel'; @@ -42,6 +44,8 @@ import { KibanaReactContext, KibanaReactContextValue, } from '../../../../kibana_react/public'; +import { PLACEHOLDER_EMBEDDABLE } from './placeholder'; +import { PanelPlacementMethod, IPanelPlacementArgs } from './panel/dashboard_panel_placement'; export interface DashboardContainerInput extends ContainerInput { viewMode: ViewMode; @@ -120,7 +124,61 @@ export class DashboardContainer extends Container = {} ): DashboardPanelState { const panelState = super.createNewPanelState(factory, partial); - return createPanelState(panelState, Object.values(this.input.panels)); + return createPanelState(panelState, this.input.panels); + } + + public showPlaceholderUntil( + newStateComplete: Promise>, + placementMethod?: PanelPlacementMethod, + placementArgs?: TPlacementMethodArgs + ): void { + const originalPanelState = { + type: PLACEHOLDER_EMBEDDABLE, + explicitInput: { + id: uuid.v4(), + disabledActions: [ + 'ACTION_CUSTOMIZE_PANEL', + 'CUSTOM_TIME_RANGE', + 'clonePanel', + 'replacePanel', + 'togglePanel', + ], + }, + } as PanelState; + const placeholderPanelState = createPanelState( + originalPanelState, + this.input.panels, + placementMethod, + placementArgs + ); + this.updateInput({ + panels: { + ...this.input.panels, + [placeholderPanelState.explicitInput.id]: placeholderPanelState, + }, + }); + newStateComplete.then((newPanelState: Partial) => { + const finalPanels = { ...this.input.panels }; + delete finalPanels[placeholderPanelState.explicitInput.id]; + const newPanelId = newPanelState.explicitInput?.id + ? newPanelState.explicitInput.id + : uuid.v4(); + finalPanels[newPanelId] = { + ...placeholderPanelState, + ...newPanelState, + gridData: { + ...placeholderPanelState.gridData, + i: newPanelId, + }, + explicitInput: { + ...newPanelState.explicitInput, + id: newPanelId, + }, + }; + this.updateInput({ + panels: finalPanels, + }); + }); } public render(dom: HTMLElement) { diff --git a/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.test.ts b/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.test.ts index 409cae8b49a531..7c11ac8a5031bf 100644 --- a/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.test.ts +++ b/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.test.ts @@ -26,7 +26,7 @@ import { CONTACT_CARD_EMBEDDABLE } from '../../../embeddable_plugin_test_samples interface TestInput extends EmbeddableInput { test: string; } -const panels: DashboardPanelState[] = []; +const panels: { [key: string]: DashboardPanelState } = {}; test('createPanelState adds a new panel state in 0,0 position', () => { const panelState = createPanelState( @@ -34,7 +34,7 @@ test('createPanelState adds a new panel state in 0,0 position', () => { type: CONTACT_CARD_EMBEDDABLE, explicitInput: { test: 'hi', id: '123' }, }, - [] + panels ); expect(panelState.explicitInput.test).toBe('hi'); expect(panelState.type).toBe(CONTACT_CARD_EMBEDDABLE); @@ -44,7 +44,7 @@ test('createPanelState adds a new panel state in 0,0 position', () => { expect(panelState.gridData.h).toBe(DEFAULT_PANEL_HEIGHT); expect(panelState.gridData.w).toBe(DEFAULT_PANEL_WIDTH); - panels.push(panelState); + panels[panelState.explicitInput.id] = panelState; }); test('createPanelState adds a second new panel state', () => { @@ -58,7 +58,7 @@ test('createPanelState adds a second new panel state', () => { expect(panelState.gridData.h).toBe(DEFAULT_PANEL_HEIGHT); expect(panelState.gridData.w).toBe(DEFAULT_PANEL_WIDTH); - panels.push(panelState); + panels[panelState.explicitInput.id] = panelState; }); test('createPanelState adds a third new panel state', () => { @@ -74,17 +74,17 @@ test('createPanelState adds a third new panel state', () => { expect(panelState.gridData.h).toBe(DEFAULT_PANEL_HEIGHT); expect(panelState.gridData.w).toBe(DEFAULT_PANEL_WIDTH); - panels.push(panelState); + panels[panelState.explicitInput.id] = panelState; }); test('createPanelState adds a new panel state in the top most position', () => { - const panelsWithEmptySpace = panels.filter(panel => panel.gridData.x === 0); + delete panels['456']; const panelState = createPanelState( { type: CONTACT_CARD_EMBEDDABLE, explicitInput: { test: 'bye', id: '987' }, }, - panelsWithEmptySpace + panels ); expect(panelState.gridData.x).toBe(DEFAULT_PANEL_WIDTH); expect(panelState.gridData.y).toBe(0); diff --git a/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.ts b/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.ts index f3a48368fe1b3d..79116a57869d35 100644 --- a/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.ts +++ b/src/plugins/dashboard/public/application/embeddable/panel/create_panel_state.ts @@ -19,98 +19,45 @@ import _ from 'lodash'; import { PanelState, EmbeddableInput } from '../../../embeddable_plugin'; -import { - DASHBOARD_GRID_COLUMN_COUNT, - DEFAULT_PANEL_HEIGHT, - DEFAULT_PANEL_WIDTH, -} from '../dashboard_constants'; +import { DEFAULT_PANEL_HEIGHT, DEFAULT_PANEL_WIDTH } from '../dashboard_constants'; import { DashboardPanelState } from '../types'; - -// Look for the smallest y and x value where the default panel will fit. -function findTopLeftMostOpenSpace( - width: number, - height: number, - currentPanels: DashboardPanelState[] -) { - let maxY = -1; - - currentPanels.forEach(panel => { - maxY = Math.max(panel.gridData.y + panel.gridData.h, maxY); - }); - - // Handle case of empty grid. - if (maxY < 0) { - return { x: 0, y: 0 }; - } - - const grid = new Array(maxY); - for (let y = 0; y < maxY; y++) { - grid[y] = new Array(DASHBOARD_GRID_COLUMN_COUNT).fill(0); - } - - currentPanels.forEach(panel => { - for (let x = panel.gridData.x; x < panel.gridData.x + panel.gridData.w; x++) { - for (let y = panel.gridData.y; y < panel.gridData.y + panel.gridData.h; y++) { - const row = grid[y]; - if (row === undefined) { - throw new Error( - `Attempted to access a row that doesn't exist at ${y} for panel ${JSON.stringify( - panel - )}` - ); - } - grid[y][x] = 1; - } - } - }); - - for (let y = 0; y < maxY; y++) { - for (let x = 0; x < DASHBOARD_GRID_COLUMN_COUNT; x++) { - if (grid[y][x] === 1) { - // Space is filled - continue; - } else { - for (let h = y; h < Math.min(y + height, maxY); h++) { - for (let w = x; w < Math.min(x + width, DASHBOARD_GRID_COLUMN_COUNT); w++) { - const spaceIsEmpty = grid[h][w] === 0; - const fitsPanelWidth = w === x + width - 1; - // If the panel is taller than any other panel in the current grid, it can still fit in the space, hence - // we check the minimum of maxY and the panel height. - const fitsPanelHeight = h === Math.min(y + height - 1, maxY - 1); - - if (spaceIsEmpty && fitsPanelWidth && fitsPanelHeight) { - // Found space - return { x, y }; - } else if (grid[h][w] === 1) { - // x, y spot doesn't work, break. - break; - } - } - } - } - } - } - return { x: 0, y: maxY }; -} +import { + IPanelPlacementArgs, + findTopLeftMostOpenSpace, + PanelPlacementMethod, +} from './dashboard_panel_placement'; /** * Creates and initializes a basic panel state. */ -export function createPanelState( +export function createPanelState< + TEmbeddableInput extends EmbeddableInput, + TPlacementMethodArgs extends IPanelPlacementArgs = IPanelPlacementArgs +>( panelState: PanelState, - currentPanels: DashboardPanelState[] + currentPanels: { [key: string]: DashboardPanelState }, + placementMethod?: PanelPlacementMethod, + placementArgs?: TPlacementMethodArgs ): DashboardPanelState { - const { x, y } = findTopLeftMostOpenSpace( - DEFAULT_PANEL_WIDTH, - DEFAULT_PANEL_HEIGHT, - currentPanels - ); + const defaultPlacementArgs = { + width: DEFAULT_PANEL_WIDTH, + height: DEFAULT_PANEL_HEIGHT, + currentPanels, + }; + const finalPlacementArgs = placementArgs + ? { + ...defaultPlacementArgs, + ...placementArgs, + } + : defaultPlacementArgs; + + const gridDataLocation = placementMethod + ? placementMethod(finalPlacementArgs as TPlacementMethodArgs) + : findTopLeftMostOpenSpace(defaultPlacementArgs); + return { gridData: { - w: DEFAULT_PANEL_WIDTH, - h: DEFAULT_PANEL_HEIGHT, - x, - y, + ...gridDataLocation, i: panelState.explicitInput.id, }, ...panelState, diff --git a/src/plugins/dashboard/public/application/embeddable/panel/dashboard_panel_placement.ts b/src/plugins/dashboard/public/application/embeddable/panel/dashboard_panel_placement.ts new file mode 100644 index 00000000000000..70a6c83418587d --- /dev/null +++ b/src/plugins/dashboard/public/application/embeddable/panel/dashboard_panel_placement.ts @@ -0,0 +1,167 @@ +/* + * 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 { PanelNotFoundError } from '../../../embeddable_plugin'; +import { DashboardPanelState, GridData, DASHBOARD_GRID_COLUMN_COUNT } from '..'; + +export type PanelPlacementMethod = ( + args: PlacementArgs +) => Omit; + +export interface IPanelPlacementArgs { + width: number; + height: number; + currentPanels: { [key: string]: DashboardPanelState }; +} + +export interface IPanelPlacementBesideArgs extends IPanelPlacementArgs { + placeBesideId: string; +} + +// Look for the smallest y and x value where the default panel will fit. +export function findTopLeftMostOpenSpace({ + width, + height, + currentPanels, +}: IPanelPlacementArgs): Omit { + let maxY = -1; + + const currentPanelsArray = Object.values(currentPanels); + currentPanelsArray.forEach(panel => { + maxY = Math.max(panel.gridData.y + panel.gridData.h, maxY); + }); + + // Handle case of empty grid. + if (maxY < 0) { + return { x: 0, y: 0, w: width, h: height }; + } + + const grid = new Array(maxY); + for (let y = 0; y < maxY; y++) { + grid[y] = new Array(DASHBOARD_GRID_COLUMN_COUNT).fill(0); + } + + currentPanelsArray.forEach(panel => { + for (let x = panel.gridData.x; x < panel.gridData.x + panel.gridData.w; x++) { + for (let y = panel.gridData.y; y < panel.gridData.y + panel.gridData.h; y++) { + const row = grid[y]; + if (row === undefined) { + throw new Error( + `Attempted to access a row that doesn't exist at ${y} for panel ${JSON.stringify( + panel + )}` + ); + } + grid[y][x] = 1; + } + } + }); + + for (let y = 0; y < maxY; y++) { + for (let x = 0; x < DASHBOARD_GRID_COLUMN_COUNT; x++) { + if (grid[y][x] === 1) { + // Space is filled + continue; + } else { + for (let h = y; h < Math.min(y + height, maxY); h++) { + for (let w = x; w < Math.min(x + width, DASHBOARD_GRID_COLUMN_COUNT); w++) { + const spaceIsEmpty = grid[h][w] === 0; + const fitsPanelWidth = w === x + width - 1; + // If the panel is taller than any other panel in the current grid, it can still fit in the space, hence + // we check the minimum of maxY and the panel height. + const fitsPanelHeight = h === Math.min(y + height - 1, maxY - 1); + + if (spaceIsEmpty && fitsPanelWidth && fitsPanelHeight) { + // Found space + return { x, y, w: width, h: height }; + } else if (grid[h][w] === 1) { + // x, y spot doesn't work, break. + break; + } + } + } + } + } + } + return { x: 0, y: maxY, w: width, h: height }; +} + +interface IplacementDirection { + grid: Omit; + fits: boolean; +} + +export function placePanelBeside({ + width, + height, + currentPanels, + placeBesideId, +}: IPanelPlacementBesideArgs): Omit { + // const clonedPanels = _.cloneDeep(currentPanels); + if (!placeBesideId) { + throw new Error('Place beside method called without placeBesideId'); + } + const panelToPlaceBeside = currentPanels[placeBesideId]; + if (!panelToPlaceBeside) { + throw new PanelNotFoundError(); + } + const beside = panelToPlaceBeside.gridData; + const otherPanels: GridData[] = []; + _.forOwn(currentPanels, (panel: DashboardPanelState, key: string | undefined) => { + otherPanels.push(panel.gridData); + }); + + const possiblePlacementDirections: IplacementDirection[] = [ + { grid: { x: beside.x + beside.w, y: beside.y, w: width, h: height }, fits: true }, // right + { grid: { x: beside.x - width, y: beside.y, w: width, h: height }, fits: true }, // left + { grid: { x: beside.x, y: beside.y + beside.h, w: width, h: height }, fits: true }, // bottom + ]; + + for (const direction of possiblePlacementDirections) { + if ( + direction.grid.x >= 0 && + direction.grid.x + direction.grid.w <= DASHBOARD_GRID_COLUMN_COUNT && + direction.grid.y >= 0 + ) { + const intersection = otherPanels.some((currentPanelGrid: GridData) => { + return ( + direction.grid.x + direction.grid.w > currentPanelGrid.x && + direction.grid.x < currentPanelGrid.x + currentPanelGrid.w && + direction.grid.y < currentPanelGrid.y + currentPanelGrid.h && + direction.grid.y + direction.grid.h > currentPanelGrid.y + ); + }); + if (!intersection) { + return direction.grid; + } + } else { + direction.fits = false; + } + } + // if we get here that means there is no blank space around the panel we are placing beside. This means it's time to mess up the dashboard's groove. Fun! + const [, , bottomPlacement] = possiblePlacementDirections; + for (const currentPanelGrid of otherPanels) { + if (bottomPlacement.grid.y <= currentPanelGrid.y) { + const movedPanel = _.cloneDeep(currentPanels[currentPanelGrid.i]); + movedPanel.gridData.y = movedPanel.gridData.y + bottomPlacement.grid.h; + currentPanels[currentPanelGrid.i] = movedPanel; + } + } + return bottomPlacement.grid; +} diff --git a/src/plugins/dashboard/public/application/embeddable/placeholder/index.ts b/src/plugins/dashboard/public/application/embeddable/placeholder/index.ts new file mode 100644 index 00000000000000..7c65d50ce3fea1 --- /dev/null +++ b/src/plugins/dashboard/public/application/embeddable/placeholder/index.ts @@ -0,0 +1,21 @@ +/* + * 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 * from './placeholder_embeddable'; +export * from './placeholder_embeddable_factory'; diff --git a/src/plugins/dashboard/public/application/embeddable/placeholder/placeholder_embeddable.tsx b/src/plugins/dashboard/public/application/embeddable/placeholder/placeholder_embeddable.tsx new file mode 100644 index 00000000000000..1a5c3386bdeda0 --- /dev/null +++ b/src/plugins/dashboard/public/application/embeddable/placeholder/placeholder_embeddable.tsx @@ -0,0 +1,52 @@ +/* + * 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 ReactDOM from 'react-dom'; +import { EuiLoadingChart } from '@elastic/eui'; +import classNames from 'classnames'; +import { Embeddable, EmbeddableInput, IContainer } from '../../../embeddable_plugin'; + +export const PLACEHOLDER_EMBEDDABLE = 'placeholder'; + +export class PlaceholderEmbeddable extends Embeddable { + public readonly type = PLACEHOLDER_EMBEDDABLE; + private node?: HTMLElement; + + constructor(initialInput: EmbeddableInput, parent?: IContainer) { + super(initialInput, {}, parent); + this.input = initialInput; + } + public render(node: HTMLElement) { + if (this.node) { + ReactDOM.unmountComponentAtNode(this.node); + } + this.node = node; + + const classes = classNames('embPanel', 'embPanel-isLoading'); + ReactDOM.render( +

+ +
, + node + ); + } + + public reload() {} +} diff --git a/src/plugins/dashboard/public/application/embeddable/placeholder/placeholder_embeddable_factory.ts b/src/plugins/dashboard/public/application/embeddable/placeholder/placeholder_embeddable_factory.ts new file mode 100644 index 00000000000000..30a93989649a7a --- /dev/null +++ b/src/plugins/dashboard/public/application/embeddable/placeholder/placeholder_embeddable_factory.ts @@ -0,0 +1,45 @@ +/* + * 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 { i18n } from '@kbn/i18n'; + +import { + EmbeddableFactoryDefinition, + EmbeddableInput, + IContainer, +} from '../../../embeddable_plugin'; +import { PlaceholderEmbeddable, PLACEHOLDER_EMBEDDABLE } from './placeholder_embeddable'; + +export class PlaceholderEmbeddableFactory implements EmbeddableFactoryDefinition { + public readonly type = PLACEHOLDER_EMBEDDABLE; + + public async isEditable() { + return false; + } + + public async create(initialInput: EmbeddableInput, parent?: IContainer) { + return new PlaceholderEmbeddable(initialInput, parent); + } + + public getDisplayName() { + return i18n.translate('dashboard.placeholder.factory.displayName', { + defaultMessage: 'placeholder', + }); + } +} diff --git a/src/plugins/dashboard/public/plugin.tsx b/src/plugins/dashboard/public/plugin.tsx index 322d734d9f39f4..203c784d9df4e3 100644 --- a/src/plugins/dashboard/public/plugin.tsx +++ b/src/plugins/dashboard/public/plugin.tsx @@ -67,9 +67,12 @@ import { ExpandPanelActionContext, ReplacePanelAction, ReplacePanelActionContext, + ClonePanelAction, + ClonePanelActionContext, ACTION_EXPAND_PANEL, ACTION_REPLACE_PANEL, RenderDeps, + ACTION_CLONE_PANEL, } from './application'; import { DashboardAppLinkGeneratorState, @@ -78,6 +81,7 @@ import { } from './url_generator'; import { createSavedDashboardLoader } from './saved_dashboards'; import { DashboardConstants } from './dashboard_constants'; +import { PlaceholderEmbeddableFactory } from './application/embeddable/placeholder'; declare module '../../share/public' { export interface UrlGeneratorStateMapping { @@ -115,6 +119,7 @@ declare module '../../../plugins/ui_actions/public' { export interface ActionContextMapping { [ACTION_EXPAND_PANEL]: ExpandPanelActionContext; [ACTION_REPLACE_PANEL]: ReplacePanelActionContext; + [ACTION_CLONE_PANEL]: ClonePanelActionContext; } } @@ -173,6 +178,9 @@ export class DashboardPlugin const factory = new DashboardContainerFactory(getStartServices); embeddable.registerEmbeddableFactory(factory.type, factory); + const placeholderFactory = new PlaceholderEmbeddableFactory(); + embeddable.registerEmbeddableFactory(placeholderFactory.type, placeholderFactory); + const { appMounted, appUnMounted, stop: stopUrlTracker } = createKbnUrlTracker({ baseUrl: core.http.basePath.prepend('/app/kibana'), defaultSubUrl: `#${DashboardConstants.LANDING_PAGE_PATH}`, @@ -297,6 +305,11 @@ export class DashboardPlugin ); uiActions.registerAction(changeViewAction); uiActions.attachAction(CONTEXT_MENU_TRIGGER, changeViewAction); + + const clonePanelAction = new ClonePanelAction(core); + uiActions.registerAction(clonePanelAction); + uiActions.attachAction(CONTEXT_MENU_TRIGGER, clonePanelAction); + const savedDashboardLoader = createSavedDashboardLoader({ savedObjectsClient: core.savedObjects.client, indexPatterns, diff --git a/src/plugins/dashboard/public/types.ts b/src/plugins/dashboard/public/types.ts index 7bccd3de6eca84..d96d2cdf75626d 100644 --- a/src/plugins/dashboard/public/types.ts +++ b/src/plugins/dashboard/public/types.ts @@ -152,6 +152,14 @@ export type DashboardAppStateDefaults = DashboardAppState & { description?: string; }; +/** + * In URL panels are optional, + * Panels are not added to the URL when in "view" mode + */ +export type DashboardAppStateInUrl = Omit & { + panels?: SavedDashboardPanel[]; +}; + export interface DashboardAppStateTransitions { set: ( state: DashboardAppState diff --git a/src/plugins/data/public/index.ts b/src/plugins/data/public/index.ts index 06a46065baa847..b62b728beca35f 100644 --- a/src/plugins/data/public/index.ts +++ b/src/plugins/data/public/index.ts @@ -363,7 +363,6 @@ export { SearchRequest, SearchResponse, SearchError, - SearchStrategyProvider, ISearchSource, SearchSource, createSearchSource, diff --git a/src/plugins/data/public/public.api.md b/src/plugins/data/public/public.api.md index 6e06d063e7ebe1..427c4f7864554d 100644 --- a/src/plugins/data/public/public.api.md +++ b/src/plugins/data/public/public.api.md @@ -1724,21 +1724,6 @@ export interface SearchSourceFields { version?: boolean; } -// Warning: (ae-missing-release-tag) "SearchStrategyProvider" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) -export interface SearchStrategyProvider { - // (undocumented) - id: string; - // (undocumented) - isViable: (indexPattern: IndexPattern) => boolean; - // Warning: (ae-forgotten-export) The symbol "SearchStrategySearchParams" needs to be exported by the entry point index.d.ts - // Warning: (ae-forgotten-export) The symbol "SearchStrategyResponse" needs to be exported by the entry point index.d.ts - // - // (undocumented) - search: (params: SearchStrategySearchParams) => SearchStrategyResponse; -} - // Warning: (ae-missing-release-tag) "SortDirection" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) @@ -1889,21 +1874,21 @@ export type TSearchStrategyProvider = (context: ISearc // src/plugins/data/public/index.ts:234:27 - (ae-forgotten-export) The symbol "flattenHitWrapper" needs to be exported by the entry point index.d.ts // src/plugins/data/public/index.ts:234:27 - (ae-forgotten-export) The symbol "getRoutes" needs to be exported by the entry point index.d.ts // src/plugins/data/public/index.ts:234:27 - (ae-forgotten-export) The symbol "formatHitProvider" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:383:20 - (ae-forgotten-export) The symbol "getRequestInspectorStats" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:383:20 - (ae-forgotten-export) The symbol "getResponseInspectorStats" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:383:20 - (ae-forgotten-export) The symbol "tabifyAggResponse" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:383:20 - (ae-forgotten-export) The symbol "tabifyGetColumns" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:388:1 - (ae-forgotten-export) The symbol "CidrMask" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:389:1 - (ae-forgotten-export) The symbol "convertDateRangeToString" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:391:1 - (ae-forgotten-export) The symbol "dateHistogramInterval" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:400:1 - (ae-forgotten-export) The symbol "InvalidEsCalendarIntervalError" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:401:1 - (ae-forgotten-export) The symbol "InvalidEsIntervalFormatError" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:402:1 - (ae-forgotten-export) The symbol "isDateHistogramBucketAggConfig" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:405:1 - (ae-forgotten-export) The symbol "isValidEsInterval" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:406:1 - (ae-forgotten-export) The symbol "isValidInterval" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:409:1 - (ae-forgotten-export) The symbol "parseInterval" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:410:1 - (ae-forgotten-export) The symbol "propFilter" needs to be exported by the entry point index.d.ts -// src/plugins/data/public/index.ts:413:1 - (ae-forgotten-export) The symbol "toAbsoluteDates" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:382:20 - (ae-forgotten-export) The symbol "getRequestInspectorStats" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:382:20 - (ae-forgotten-export) The symbol "getResponseInspectorStats" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:382:20 - (ae-forgotten-export) The symbol "tabifyAggResponse" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:382:20 - (ae-forgotten-export) The symbol "tabifyGetColumns" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:387:1 - (ae-forgotten-export) The symbol "CidrMask" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:388:1 - (ae-forgotten-export) The symbol "convertDateRangeToString" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:390:1 - (ae-forgotten-export) The symbol "dateHistogramInterval" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:399:1 - (ae-forgotten-export) The symbol "InvalidEsCalendarIntervalError" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:400:1 - (ae-forgotten-export) The symbol "InvalidEsIntervalFormatError" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:401:1 - (ae-forgotten-export) The symbol "isDateHistogramBucketAggConfig" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:404:1 - (ae-forgotten-export) The symbol "isValidEsInterval" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:405:1 - (ae-forgotten-export) The symbol "isValidInterval" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:408:1 - (ae-forgotten-export) The symbol "parseInterval" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:409:1 - (ae-forgotten-export) The symbol "propFilter" needs to be exported by the entry point index.d.ts +// src/plugins/data/public/index.ts:412:1 - (ae-forgotten-export) The symbol "toAbsoluteDates" needs to be exported by the entry point index.d.ts // src/plugins/data/public/query/state_sync/connect_to_query_state.ts:33:33 - (ae-forgotten-export) The symbol "FilterStateStore" needs to be exported by the entry point index.d.ts // src/plugins/data/public/query/state_sync/connect_to_query_state.ts:37:1 - (ae-forgotten-export) The symbol "QueryStateChange" needs to be exported by the entry point index.d.ts // src/plugins/data/public/types.ts:52:5 - (ae-forgotten-export) The symbol "createFiltersFromEvent" needs to be exported by the entry point index.d.ts diff --git a/src/plugins/data/public/search/aggs/test_helpers/mock_data_services.ts b/src/plugins/data/public/search/aggs/test_helpers/mock_data_services.ts index d1d591771743c7..e807e084c683a2 100644 --- a/src/plugins/data/public/search/aggs/test_helpers/mock_data_services.ts +++ b/src/plugins/data/public/search/aggs/test_helpers/mock_data_services.ts @@ -18,8 +18,8 @@ */ // eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { coreMock } from '../../../../../../../src/core/public/mocks'; -import { dataPluginMock } from '../../../../public/mocks'; +import { coreMock } from '../../../../../../core/public/mocks'; +import { dataPluginMock } from '../../../mocks'; import { setFieldFormats, setIndexPatterns, @@ -29,7 +29,7 @@ import { setQueryService, setSearchService, setUiSettings, -} from '../../../../public/services'; +} from '../../../services'; /** * Testing helper which calls all of the service setters used in the @@ -49,4 +49,9 @@ export function mockDataServices() { setQueryService(data.query); setSearchService(data.search); setUiSettings(core.uiSettings); + + return { + core, + data, + }; } diff --git a/src/plugins/data/public/search/fetch/get_search_params.test.ts b/src/plugins/data/public/search/fetch/get_search_params.test.ts new file mode 100644 index 00000000000000..edf18405e8ff71 --- /dev/null +++ b/src/plugins/data/public/search/fetch/get_search_params.test.ts @@ -0,0 +1,70 @@ +/* + * 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 { getSearchParams } from './get_search_params'; +import { IUiSettingsClient } from 'kibana/public'; + +function getConfigStub(config: any = {}) { + return { + get: key => config[key], + } as IUiSettingsClient; +} + +describe('getSearchParams', () => { + test('includes rest_total_hits_as_int', () => { + const config = getConfigStub(); + const searchParams = getSearchParams(config); + expect(searchParams.rest_total_hits_as_int).toBe(true); + }); + + test('includes ignore_unavailable', () => { + const config = getConfigStub(); + const searchParams = getSearchParams(config); + expect(searchParams.ignore_unavailable).toBe(true); + }); + + test('includes ignore_throttled according to search:includeFrozen', () => { + let config = getConfigStub({ 'search:includeFrozen': true }); + let searchParams = getSearchParams(config); + expect(searchParams.ignore_throttled).toBe(false); + + config = getConfigStub({ 'search:includeFrozen': false }); + searchParams = getSearchParams(config); + expect(searchParams.ignore_throttled).toBe(true); + }); + + test('includes max_concurrent_shard_requests according to courier:maxConcurrentShardRequests', () => { + let config = getConfigStub({ 'courier:maxConcurrentShardRequests': 0 }); + let searchParams = getSearchParams(config); + expect(searchParams.max_concurrent_shard_requests).toBe(undefined); + + config = getConfigStub({ 'courier:maxConcurrentShardRequests': 5 }); + searchParams = getSearchParams(config); + expect(searchParams.max_concurrent_shard_requests).toBe(5); + }); + + test('includes timeout according to esShardTimeout if greater than 0', () => { + const config = getConfigStub(); + let searchParams = getSearchParams(config, 0); + expect(searchParams.timeout).toBe(undefined); + + searchParams = getSearchParams(config, 100); + expect(searchParams.timeout).toBe('100ms'); + }); +}); diff --git a/src/plugins/data/public/search/search_strategy/get_search_params.ts b/src/plugins/data/public/search/fetch/get_search_params.ts similarity index 81% rename from src/plugins/data/public/search/search_strategy/get_search_params.ts rename to src/plugins/data/public/search/fetch/get_search_params.ts index 9fb8f2c728c6f0..f0c43bd2e74cd1 100644 --- a/src/plugins/data/public/search/search_strategy/get_search_params.ts +++ b/src/plugins/data/public/search/fetch/get_search_params.ts @@ -17,18 +17,10 @@ * under the License. */ -import { IUiSettingsClient } from '../../../../../core/public'; +import { IUiSettingsClient } from 'kibana/public'; const sessionId = Date.now(); -export function getMSearchParams(config: IUiSettingsClient) { - return { - rest_total_hits_as_int: true, - ignore_throttled: getIgnoreThrottled(config), - max_concurrent_shard_requests: getMaxConcurrentShardRequests(config), - }; -} - export function getSearchParams(config: IUiSettingsClient, esShardTimeout: number = 0) { return { rest_total_hits_as_int: true, @@ -40,11 +32,11 @@ export function getSearchParams(config: IUiSettingsClient, esShardTimeout: numbe }; } -function getIgnoreThrottled(config: IUiSettingsClient) { +export function getIgnoreThrottled(config: IUiSettingsClient) { return !config.get('search:includeFrozen'); } -function getMaxConcurrentShardRequests(config: IUiSettingsClient) { +export function getMaxConcurrentShardRequests(config: IUiSettingsClient) { const maxConcurrentShardRequests = config.get('courier:maxConcurrentShardRequests'); return maxConcurrentShardRequests > 0 ? maxConcurrentShardRequests : undefined; } diff --git a/src/plugins/data/public/search/fetch/index.ts b/src/plugins/data/public/search/fetch/index.ts index 8a80b716add321..39845ec31bfaaa 100644 --- a/src/plugins/data/public/search/fetch/index.ts +++ b/src/plugins/data/public/search/fetch/index.ts @@ -18,5 +18,14 @@ */ export * from './types'; -export { fetchSoon } from './fetch_soon'; -export { RequestFailure } from './errors'; +export { + getSearchParams, + getPreference, + getTimeout, + getIgnoreThrottled, + getMaxConcurrentShardRequests, +} from './get_search_params'; + +export { SearchError, getSearchErrorType } from './search_error'; +export { RequestFailure } from './request_error'; +export { handleResponse } from './handle_response'; diff --git a/src/plugins/data/public/search/fetch/errors.ts b/src/plugins/data/public/search/fetch/request_error.ts similarity index 100% rename from src/plugins/data/public/search/fetch/errors.ts rename to src/plugins/data/public/search/fetch/request_error.ts diff --git a/src/plugins/data/public/search/search_strategy/search_error.ts b/src/plugins/data/public/search/fetch/search_error.ts similarity index 100% rename from src/plugins/data/public/search/search_strategy/search_error.ts rename to src/plugins/data/public/search/fetch/search_error.ts diff --git a/src/plugins/data/public/search/fetch/types.ts b/src/plugins/data/public/search/fetch/types.ts index e8de0576b8a72f..475b2abbc019f4 100644 --- a/src/plugins/data/public/search/fetch/types.ts +++ b/src/plugins/data/public/search/fetch/types.ts @@ -20,6 +20,9 @@ import { IUiSettingsClient } from '../../../../../core/public'; import { ISearchStart } from '../types'; +export type SearchRequest = any; +export type SearchResponse = any; + export interface FetchOptions { abortSignal?: AbortSignal; searchStrategyId?: string; diff --git a/src/plugins/data/public/search/index.ts b/src/plugins/data/public/search/index.ts index cce973d632f417..75c0eb8b6f0229 100644 --- a/src/plugins/data/public/search/index.ts +++ b/src/plugins/data/public/search/index.ts @@ -44,9 +44,13 @@ export { esSearchStrategyProvider, getEsPreference } from './es_search'; export { IKibanaSearchResponse, IKibanaSearchRequest } from '../../common/search'; -export { LegacyApiCaller, SearchRequest, SearchResponse } from './es_client'; - -export { SearchError, SearchStrategyProvider, getSearchErrorType } from './search_strategy'; +export { + SearchError, + FetchOptions, + SearchRequest, + SearchResponse, + getSearchErrorType, +} from './fetch'; export { ISearchSource, @@ -59,5 +63,3 @@ export { export { SearchInterceptor } from './search_interceptor'; export { RequestTimeoutError } from './request_timeout_error'; - -export { FetchOptions } from './fetch'; diff --git a/src/plugins/data/public/search/fetch/call_client.test.ts b/src/plugins/data/public/search/legacy/call_client.test.ts similarity index 91% rename from src/plugins/data/public/search/fetch/call_client.test.ts rename to src/plugins/data/public/search/legacy/call_client.test.ts index 7a99b7c064515b..f919187d46784d 100644 --- a/src/plugins/data/public/search/fetch/call_client.test.ts +++ b/src/plugins/data/public/search/legacy/call_client.test.ts @@ -18,16 +18,17 @@ */ import { callClient } from './call_client'; -import { handleResponse } from './handle_response'; -import { FetchHandlers } from './types'; -import { SearchStrategySearchParams, defaultSearchStrategy } from '../search_strategy'; +import { SearchStrategySearchParams } from './types'; +import { defaultSearchStrategy } from './default_search_strategy'; +import { FetchHandlers } from '../fetch'; +import { handleResponse } from '../fetch/handle_response'; const mockAbortFn = jest.fn(); -jest.mock('./handle_response', () => ({ +jest.mock('../fetch/handle_response', () => ({ handleResponse: jest.fn((request, response) => response), })); -jest.mock('../search_strategy', () => { +jest.mock('./default_search_strategy', () => { return { defaultSearchStrategy: { search: jest.fn(({ searchRequests }: SearchStrategySearchParams) => { diff --git a/src/plugins/data/public/search/fetch/call_client.ts b/src/plugins/data/public/search/legacy/call_client.ts similarity index 89% rename from src/plugins/data/public/search/fetch/call_client.ts rename to src/plugins/data/public/search/legacy/call_client.ts index b3c4c682fa60c0..c484c46aa4879f 100644 --- a/src/plugins/data/public/search/fetch/call_client.ts +++ b/src/plugins/data/public/search/legacy/call_client.ts @@ -17,10 +17,9 @@ * under the License. */ -import { handleResponse } from './handle_response'; -import { FetchOptions, FetchHandlers } from './types'; -import { defaultSearchStrategy } from '../search_strategy'; -import { SearchRequest } from '..'; +import { FetchOptions, FetchHandlers, handleResponse } from '../fetch'; +import { defaultSearchStrategy } from './default_search_strategy'; +import { SearchRequest } from '../index'; export function callClient( searchRequests: SearchRequest[], diff --git a/src/plugins/data/public/search/search_strategy/default_search_strategy.test.ts b/src/plugins/data/public/search/legacy/default_search_strategy.test.ts similarity index 83% rename from src/plugins/data/public/search/search_strategy/default_search_strategy.test.ts rename to src/plugins/data/public/search/legacy/default_search_strategy.test.ts index 210a0e5fd1ac78..835b02b3cd5c74 100644 --- a/src/plugins/data/public/search/search_strategy/default_search_strategy.test.ts +++ b/src/plugins/data/public/search/legacy/default_search_strategy.test.ts @@ -17,10 +17,10 @@ * under the License. */ -import { IUiSettingsClient } from '../../../../../core/public'; -import { SearchStrategySearchParams } from './types'; +import { IUiSettingsClient } from 'kibana/public'; import { defaultSearchStrategy } from './default_search_strategy'; import { searchStartMock } from '../mocks'; +import { SearchStrategySearchParams } from './types'; const { search } = defaultSearchStrategy; @@ -38,12 +38,6 @@ const searchMockResponse: any = Promise.resolve([]); searchMockResponse.abort = jest.fn(); const searchMock = jest.fn().mockReturnValue(searchMockResponse); -const newSearchMockResponse: any = Promise.resolve([]); -newSearchMockResponse.abort = jest.fn(); -const newSearchMock = jest.fn().mockReturnValue({ - toPromise: () => searchMockResponse, -}); - describe('defaultSearchStrategy', function() { describe('search', function() { let searchArgs: MockedKeys>; @@ -58,7 +52,6 @@ describe('defaultSearchStrategy', function() { const searchService = searchStartMock; searchService.aggs.calculateAutoTimeExpression = jest.fn().mockReturnValue('1d'); - searchService.search = newSearchMock; searchService.__LEGACY.esClient.search = searchMock; searchService.__LEGACY.esClient.msearch = msearchMock; @@ -112,18 +105,5 @@ describe('defaultSearchStrategy', function() { search({ ...searchArgs, config }).abort(); expect(msearchMockResponse.abort).toHaveBeenCalled(); }); - - test('should call new search service', () => { - const config = getConfigStub(); - search({ ...searchArgs, config }); - expect(newSearchMock).toHaveBeenCalledTimes(1); - }); - - test('should properly abort with new search service', async () => { - const abortSpy = jest.spyOn(AbortController.prototype, 'abort'); - const config = getConfigStub({}); - search({ ...searchArgs, config }).abort(); - expect(abortSpy).toHaveBeenCalled(); - }); }); }); diff --git a/src/plugins/data/public/search/search_strategy/default_search_strategy.ts b/src/plugins/data/public/search/legacy/default_search_strategy.ts similarity index 64% rename from src/plugins/data/public/search/search_strategy/default_search_strategy.ts rename to src/plugins/data/public/search/legacy/default_search_strategy.ts index 2bd88f51587a8a..1552410f9090ca 100644 --- a/src/plugins/data/public/search/search_strategy/default_search_strategy.ts +++ b/src/plugins/data/public/search/legacy/default_search_strategy.ts @@ -17,23 +17,19 @@ * under the License. */ +import { getPreference, getTimeout } from '../fetch'; +import { getMSearchParams } from './get_msearch_params'; import { SearchStrategyProvider, SearchStrategySearchParams } from './types'; -import { isDefault } from '../../index_patterns'; -import { getSearchParams, getMSearchParams, getPreference, getTimeout } from './get_search_params'; +// @deprecated export const defaultSearchStrategy: SearchStrategyProvider = { id: 'default', search: params => { - return params.config.get('courier:batchSearches') ? msearch(params) : search(params); - }, - - isViable: indexPattern => { - return indexPattern && isDefault(indexPattern); + return msearch(params); }, }; -// @deprecated function msearch({ searchRequests, searchService, @@ -65,29 +61,3 @@ function msearch({ abort: searching.abort, }; } - -function search({ - searchRequests, - searchService, - config, - esShardTimeout, -}: SearchStrategySearchParams) { - const abortController = new AbortController(); - const searchParams = getSearchParams(config, esShardTimeout); - const promises = searchRequests.map(({ index, indexType, body }) => { - const params = { - index: index.title || index, - body, - ...searchParams, - }; - const { signal } = abortController; - return searchService - .search({ params, indexType }, { signal }) - .toPromise() - .then(({ rawResponse }) => rawResponse); - }); - return { - searching: Promise.all(promises), - abort: () => abortController.abort(), - }; -} diff --git a/src/plugins/data/public/search/es_client/get_es_client.ts b/src/plugins/data/public/search/legacy/es_client/get_es_client.ts similarity index 100% rename from src/plugins/data/public/search/es_client/get_es_client.ts rename to src/plugins/data/public/search/legacy/es_client/get_es_client.ts diff --git a/src/plugins/data/public/search/es_client/index.ts b/src/plugins/data/public/search/legacy/es_client/index.ts similarity index 91% rename from src/plugins/data/public/search/es_client/index.ts rename to src/plugins/data/public/search/legacy/es_client/index.ts index b1e0ce31168242..78ac83af642d83 100644 --- a/src/plugins/data/public/search/es_client/index.ts +++ b/src/plugins/data/public/search/legacy/es_client/index.ts @@ -18,4 +18,4 @@ */ export { getEsClient } from './get_es_client'; -export { SearchRequest, SearchResponse, LegacyApiCaller } from './types'; +export { LegacyApiCaller } from './types'; diff --git a/src/plugins/data/public/search/es_client/types.ts b/src/plugins/data/public/search/legacy/es_client/types.ts similarity index 94% rename from src/plugins/data/public/search/es_client/types.ts rename to src/plugins/data/public/search/legacy/es_client/types.ts index 3ca0513a14238d..7a56b9b0cb00a8 100644 --- a/src/plugins/data/public/search/es_client/types.ts +++ b/src/plugins/data/public/search/legacy/es_client/types.ts @@ -17,8 +17,7 @@ * under the License. */ -export type SearchRequest = any; -export type SearchResponse = any; +import { SearchRequest, SearchResponse } from '../../fetch'; export interface LegacyApiCaller { search: (searchRequest: SearchRequest) => LegacyApiCallerResponse; diff --git a/src/plugins/data/public/search/fetch/fetch_soon.test.ts b/src/plugins/data/public/search/legacy/fetch_soon.test.ts similarity index 96% rename from src/plugins/data/public/search/fetch/fetch_soon.test.ts rename to src/plugins/data/public/search/legacy/fetch_soon.test.ts index a8d593c8501f68..b2e17798ccc9fa 100644 --- a/src/plugins/data/public/search/fetch/fetch_soon.test.ts +++ b/src/plugins/data/public/search/legacy/fetch_soon.test.ts @@ -19,9 +19,9 @@ import { fetchSoon } from './fetch_soon'; import { callClient } from './call_client'; -import { IUiSettingsClient } from '../../../../../core/public'; -import { FetchHandlers, FetchOptions } from './types'; -import { SearchRequest, SearchResponse } from '..'; +import { IUiSettingsClient } from 'kibana/public'; +import { FetchHandlers, FetchOptions } from '../fetch/types'; +import { SearchRequest, SearchResponse } from '../index'; function getConfigStub(config: any = {}) { return { diff --git a/src/plugins/data/public/search/fetch/fetch_soon.ts b/src/plugins/data/public/search/legacy/fetch_soon.ts similarity index 95% rename from src/plugins/data/public/search/fetch/fetch_soon.ts rename to src/plugins/data/public/search/legacy/fetch_soon.ts index b1405747426ee9..18fa410a5bef03 100644 --- a/src/plugins/data/public/search/fetch/fetch_soon.ts +++ b/src/plugins/data/public/search/legacy/fetch_soon.ts @@ -18,8 +18,8 @@ */ import { callClient } from './call_client'; -import { FetchHandlers, FetchOptions } from './types'; -import { SearchRequest, SearchResponse } from '..'; +import { FetchHandlers, FetchOptions } from '../fetch/types'; +import { SearchRequest, SearchResponse } from '../index'; /** * This function introduces a slight delay in the request process to allow multiple requests to queue diff --git a/src/plugins/data/public/search/search_strategy/get_search_params.test.ts b/src/plugins/data/public/search/legacy/get_msearch_params.test.ts similarity index 60% rename from src/plugins/data/public/search/search_strategy/get_search_params.test.ts rename to src/plugins/data/public/search/legacy/get_msearch_params.test.ts index 76f3105d7f942e..9f16d5b408178d 100644 --- a/src/plugins/data/public/search/search_strategy/get_search_params.test.ts +++ b/src/plugins/data/public/search/legacy/get_msearch_params.test.ts @@ -17,7 +17,7 @@ * under the License. */ -import { getMSearchParams, getSearchParams } from './get_search_params'; +import { getMSearchParams } from './get_msearch_params'; import { IUiSettingsClient } from '../../../../../core/public'; function getConfigStub(config: any = {}) { @@ -64,46 +64,3 @@ describe('getMSearchParams', () => { expect(msearchParams.hasOwnProperty('timeout')).toBe(false); }); }); - -describe('getSearchParams', () => { - test('includes rest_total_hits_as_int', () => { - const config = getConfigStub(); - const searchParams = getSearchParams(config); - expect(searchParams.rest_total_hits_as_int).toBe(true); - }); - - test('includes ignore_unavailable', () => { - const config = getConfigStub(); - const searchParams = getSearchParams(config); - expect(searchParams.ignore_unavailable).toBe(true); - }); - - test('includes ignore_throttled according to search:includeFrozen', () => { - let config = getConfigStub({ 'search:includeFrozen': true }); - let searchParams = getSearchParams(config); - expect(searchParams.ignore_throttled).toBe(false); - - config = getConfigStub({ 'search:includeFrozen': false }); - searchParams = getSearchParams(config); - expect(searchParams.ignore_throttled).toBe(true); - }); - - test('includes max_concurrent_shard_requests according to courier:maxConcurrentShardRequests', () => { - let config = getConfigStub({ 'courier:maxConcurrentShardRequests': 0 }); - let searchParams = getSearchParams(config); - expect(searchParams.max_concurrent_shard_requests).toBe(undefined); - - config = getConfigStub({ 'courier:maxConcurrentShardRequests': 5 }); - searchParams = getSearchParams(config); - expect(searchParams.max_concurrent_shard_requests).toBe(5); - }); - - test('includes timeout according to esShardTimeout if greater than 0', () => { - const config = getConfigStub(); - let searchParams = getSearchParams(config, 0); - expect(searchParams.timeout).toBe(undefined); - - searchParams = getSearchParams(config, 100); - expect(searchParams.timeout).toBe('100ms'); - }); -}); diff --git a/src/plugins/data/public/search/legacy/get_msearch_params.ts b/src/plugins/data/public/search/legacy/get_msearch_params.ts new file mode 100644 index 00000000000000..48d13903c972fe --- /dev/null +++ b/src/plugins/data/public/search/legacy/get_msearch_params.ts @@ -0,0 +1,29 @@ +/* + * 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 { IUiSettingsClient } from 'kibana/public'; +import { getIgnoreThrottled, getMaxConcurrentShardRequests } from '../fetch'; + +export function getMSearchParams(config: IUiSettingsClient) { + return { + rest_total_hits_as_int: true, + ignore_throttled: getIgnoreThrottled(config), + max_concurrent_shard_requests: getMaxConcurrentShardRequests(config), + }; +} diff --git a/src/plugins/data/public/search/legacy/index.ts b/src/plugins/data/public/search/legacy/index.ts new file mode 100644 index 00000000000000..e2ae72824f3f49 --- /dev/null +++ b/src/plugins/data/public/search/legacy/index.ts @@ -0,0 +1,21 @@ +/* + * 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 { fetchSoon } from './fetch_soon'; +export { getEsClient, LegacyApiCaller } from './es_client'; diff --git a/src/plugins/data/public/search/search_strategy/types.ts b/src/plugins/data/public/search/legacy/types.ts similarity index 89% rename from src/plugins/data/public/search/search_strategy/types.ts rename to src/plugins/data/public/search/legacy/types.ts index 764370d8ff6497..3812cec7a2aa20 100644 --- a/src/plugins/data/public/search/search_strategy/types.ts +++ b/src/plugins/data/public/search/legacy/types.ts @@ -17,21 +17,20 @@ * under the License. */ -import { IndexPattern } from '../..'; -import { FetchHandlers } from '../fetch/types'; +import { FetchHandlers } from '../fetch'; import { SearchRequest, SearchResponse } from '..'; +export interface SearchStrategySearchParams extends FetchHandlers { + searchRequests: SearchRequest[]; +} + +// @deprecated export interface SearchStrategyProvider { id: string; search: (params: SearchStrategySearchParams) => SearchStrategyResponse; - isViable: (indexPattern: IndexPattern) => boolean; } export interface SearchStrategyResponse { searching: Promise; abort: () => void; } - -export interface SearchStrategySearchParams extends FetchHandlers { - searchRequests: SearchRequest[]; -} diff --git a/src/plugins/data/public/search/search_service.ts b/src/plugins/data/public/search/search_service.ts index a539736991adb4..916278a96659b4 100644 --- a/src/plugins/data/public/search/search_service.ts +++ b/src/plugins/data/public/search/search_service.ts @@ -22,12 +22,12 @@ import { Plugin, CoreSetup, CoreStart, PackageInfo } from '../../../../core/publ import { SYNC_SEARCH_STRATEGY, syncSearchStrategyProvider } from './sync_search_strategy'; import { ISearchSetup, ISearchStart, TSearchStrategyProvider, TSearchStrategiesMap } from './types'; import { TStrategyTypes } from './strategy_types'; -import { getEsClient, LegacyApiCaller } from './es_client'; +import { getEsClient, LegacyApiCaller } from './legacy'; import { ES_SEARCH_STRATEGY, DEFAULT_SEARCH_STRATEGY } from '../../common/search'; -import { esSearchStrategyProvider } from './es_search/es_search_strategy'; +import { esSearchStrategyProvider } from './es_search'; import { IndexPatternsContract } from '../index_patterns/index_patterns'; import { createSearchSource } from './search_source'; -import { QuerySetup } from '../query/query_service'; +import { QuerySetup } from '../query'; import { GetInternalStartServicesFn } from '../types'; import { SearchInterceptor } from './search_interceptor'; import { diff --git a/src/plugins/data/public/search/search_source/search_source.test.ts b/src/plugins/data/public/search/search_source/search_source.test.ts index 6bad093d31402b..6e878844664ad2 100644 --- a/src/plugins/data/public/search/search_source/search_source.test.ts +++ b/src/plugins/data/public/search/search_source/search_source.test.ts @@ -20,8 +20,26 @@ import { SearchSource } from './search_source'; import { IndexPattern, SortDirection } from '../..'; import { mockDataServices } from '../aggs/test_helpers'; +import { setSearchService } from '../../services'; +import { searchStartMock } from '../mocks'; +import { fetchSoon } from '../legacy'; +import { CoreStart } from 'kibana/public'; +import { Observable } from 'rxjs'; -jest.mock('../fetch', () => ({ +// Setup search service mock +searchStartMock.search = jest.fn(() => { + return new Observable(subscriber => { + setTimeout(() => { + subscriber.next({ + rawResponse: '', + }); + subscriber.complete(); + }, 100); + }); +}) as any; +setSearchService(searchStartMock); + +jest.mock('../legacy', () => ({ fetchSoon: jest.fn().mockResolvedValue({}), })); @@ -44,8 +62,11 @@ const indexPattern2 = ({ } as unknown) as IndexPattern; describe('SearchSource', function() { + let uiSettingsMock: jest.Mocked; beforeEach(() => { - mockDataServices(); + const { core } = mockDataServices(); + uiSettingsMock = core.uiSettings; + jest.clearAllMocks(); }); describe('#setField()', function() { @@ -151,6 +172,36 @@ describe('SearchSource', function() { }); }); + describe('#legacy fetch()', () => { + beforeEach(() => { + uiSettingsMock.get.mockImplementation(() => { + return true; // batchSearches = true + }); + }); + + afterEach(() => { + uiSettingsMock.get.mockImplementation(() => { + return false; // batchSearches = false + }); + }); + + it('should call msearch', async () => { + const searchSource = new SearchSource({ index: indexPattern }); + const options = {}; + await searchSource.fetch(options); + expect(fetchSoon).toBeCalledTimes(1); + }); + }); + + describe('#search service fetch()', () => { + it('should call msearch', async () => { + const searchSource = new SearchSource({ index: indexPattern }); + const options = {}; + await searchSource.fetch(options); + expect(searchStartMock.search).toBeCalledTimes(1); + }); + }); + describe('#serialize', function() { it('should reference index patterns', () => { const indexPattern123 = { id: '123' } as IndexPattern; diff --git a/src/plugins/data/public/search/search_source/search_source.ts b/src/plugins/data/public/search/search_source/search_source.ts index c70db7bb82ef7f..9d2bb889953cf2 100644 --- a/src/plugins/data/public/search/search_source/search_source.ts +++ b/src/plugins/data/public/search/search_source/search_source.ts @@ -70,17 +70,19 @@ */ import _ from 'lodash'; +import { map } from 'rxjs/operators'; import { SavedObjectReference } from 'kibana/public'; import { normalizeSortRequest } from './normalize_sort_request'; import { filterDocvalueFields } from './filter_docvalue_fields'; import { fieldWildcardFilter } from '../../../../kibana_utils/public'; import { IIndexPattern, SearchRequest } from '../..'; import { SearchSourceOptions, SearchSourceFields } from './types'; -import { fetchSoon, FetchOptions, RequestFailure } from '../fetch'; +import { FetchOptions, RequestFailure, getSearchParams, handleResponse } from '../fetch'; import { getSearchService, getUiSettings, getInjectedMetadata } from '../../services'; import { getEsQueryConfig, buildEsQuery, Filter } from '../../../common'; import { getHighlightRequest } from '../../../common/field_formats'; +import { fetchSoon } from '../legacy'; export type ISearchSource = Pick; @@ -185,18 +187,29 @@ export class SearchSource { } /** - * Fetch this source and reject the returned Promise on error - * - * @async + * Run a search using the search service + * @return {Observable>} */ - async fetch(options: FetchOptions = {}) { - await this.requestIsStarting(options); - - const searchRequest = await this.flatten(); - this.history = [searchRequest]; + private fetch$(searchRequest: SearchRequest, signal?: AbortSignal) { + const esShardTimeout = getInjectedMetadata().getInjectedVar('esShardTimeout') as number; + const searchParams = getSearchParams(getUiSettings(), esShardTimeout); + const params = { + index: searchRequest.index.title || searchRequest.index, + body: searchRequest.body, + ...searchParams, + }; + return getSearchService() + .search({ params, indexType: searchRequest.indexType }, { signal }) + .pipe(map(({ rawResponse }) => handleResponse(searchRequest, rawResponse))); + } + /** + * Run a search using the search service + * @return {Promise>} + */ + private async legacyFetch(searchRequest: SearchRequest, options: FetchOptions) { const esShardTimeout = getInjectedMetadata().getInjectedVar('esShardTimeout') as number; - const response = await fetchSoon( + return await fetchSoon( searchRequest, { ...(this.searchStrategyId && { searchStrategyId: this.searchStrategyId }), @@ -208,6 +221,24 @@ export class SearchSource { esShardTimeout, } ); + } + /** + * Fetch this source and reject the returned Promise on error + * + * @async + */ + async fetch(options: FetchOptions = {}) { + await this.requestIsStarting(options); + + const searchRequest = await this.flatten(); + this.history = [searchRequest]; + + let response; + if (getUiSettings().get('courier:batchSearches')) { + response = await this.legacyFetch(searchRequest, options); + } else { + response = this.fetch$(searchRequest, options.abortSignal).toPromise(); + } if (response.error) { throw new RequestFailure(null, response); @@ -246,7 +277,6 @@ export class SearchSource { /** * Called by requests of this search source when they are started - * @param {Courier.Request} request * @param options * @return {Promise} */ @@ -430,7 +460,6 @@ export class SearchSource { * and `kibanaSavedObjectMeta.searchSourceJSON.filter[].meta.index`. * * Using `createSearchSource`, the instance can be re-created. - * @param searchSource The search source to serialize * @public */ public serialize() { const references: SavedObjectReference[] = []; diff --git a/src/plugins/data/public/search/search_strategy/no_op_search_strategy.ts b/src/plugins/data/public/search/search_strategy/no_op_search_strategy.ts deleted file mode 100644 index dc7331e614a0e4..00000000000000 --- a/src/plugins/data/public/search/search_strategy/no_op_search_strategy.ts +++ /dev/null @@ -1,55 +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 { i18n } from '@kbn/i18n'; -import { SearchError } from './search_error'; -import { SearchStrategyProvider } from './types'; - -export const noOpSearchStrategy: SearchStrategyProvider = { - id: 'noOp', - - search: () => { - const searchError = new SearchError({ - status: '418', // "I'm a teapot" error - title: i18n.translate( - 'data.search.searchSource.noSearchStrategyRegisteredErrorMessageTitle', - { - defaultMessage: 'No search strategy registered', - } - ), - message: i18n.translate( - 'data.search.searchSource.noSearchStrategyRegisteredErrorMessageDescription', - { - defaultMessage: `Couldn't find a search strategy for the search request`, - } - ), - type: 'NO_OP_SEARCH_STRATEGY', - path: '', - }); - - return { - searching: Promise.reject(searchError), - abort: () => {}, - }; - }, - - isViable: () => { - return true; - }, -}; diff --git a/src/plugins/data/public/search/types.ts b/src/plugins/data/public/search/types.ts index ba6e44f47b75eb..2122e4e82ec1d7 100644 --- a/src/plugins/data/public/search/types.ts +++ b/src/plugins/data/public/search/types.ts @@ -22,7 +22,7 @@ import { createSearchSource } from './search_source'; import { SearchAggsSetup, SearchAggsStart, SearchAggsStartLegacy } from './aggs'; import { ISearch, ISearchGeneric } from './i_search'; import { TStrategyTypes } from './strategy_types'; -import { LegacyApiCaller } from './es_client'; +import { LegacyApiCaller } from './legacy/es_client'; import { SearchInterceptor } from './search_interceptor'; export interface ISearchContext { @@ -38,15 +38,6 @@ export interface ISearchStrategy { search: ISearch; } -/** - * Search strategy provider creates an instance of a search strategy with the request - * handler context bound to it. This way every search strategy can use - * whatever information they require from the request context. - */ -export type TSearchStrategyProviderEnhanced = ( - search: ISearchGeneric -) => Promise>; - export type TSearchStrategiesMap = { [K in TStrategyTypes]?: TSearchStrategyProvider; }; diff --git a/src/plugins/maps_legacy/public/__tests__/map/service_settings.js b/src/plugins/maps_legacy/public/__tests__/map/service_settings.js index a9272ea3966397..4cbe098501c675 100644 --- a/src/plugins/maps_legacy/public/__tests__/map/service_settings.js +++ b/src/plugins/maps_legacy/public/__tests__/map/service_settings.js @@ -143,24 +143,24 @@ describe('service_settings (FKA tilemaptest)', function() { } it('accepts an object', async () => { - serviceSettings.addQueryParams({ foo: 'bar' }); + serviceSettings.setQueryParams({ foo: 'bar' }); tilemapServices = await serviceSettings.getTMSServices(); await assertQuery({ foo: 'bar' }); }); it('merged additions with previous values', async () => { // ensure that changes are always additive - serviceSettings.addQueryParams({ foo: 'bar' }); - serviceSettings.addQueryParams({ bar: 'stool' }); + serviceSettings.setQueryParams({ foo: 'bar' }); + serviceSettings.setQueryParams({ bar: 'stool' }); tilemapServices = await serviceSettings.getTMSServices(); await assertQuery({ foo: 'bar', bar: 'stool' }); }); it('overwrites conflicting previous values', async () => { // ensure that conflicts are overwritten - serviceSettings.addQueryParams({ foo: 'bar' }); - serviceSettings.addQueryParams({ bar: 'stool' }); - serviceSettings.addQueryParams({ foo: 'tstool' }); + serviceSettings.setQueryParams({ foo: 'bar' }); + serviceSettings.setQueryParams({ bar: 'stool' }); + serviceSettings.setQueryParams({ foo: 'tstool' }); tilemapServices = await serviceSettings.getTMSServices(); await assertQuery({ foo: 'tstool', bar: 'stool' }); }); @@ -168,7 +168,7 @@ describe('service_settings (FKA tilemaptest)', function() { it('when overridden, should continue to work', async () => { mapConfig.emsFileApiUrl = emsFileApiUrl2; mapConfig.emsTileApiUrl = emsTileApiUrl2; - serviceSettings.addQueryParams({ foo: 'bar' }); + serviceSettings.setQueryParams({ foo: 'bar' }); tilemapServices = await serviceSettings.getTMSServices(); await assertQuery({ foo: 'bar' }); }); @@ -292,7 +292,7 @@ describe('service_settings (FKA tilemaptest)', function() { describe('File layers', function() { it('should load manifest (all props)', async function() { - serviceSettings.addQueryParams({ foo: 'bar' }); + serviceSettings.setQueryParams({ foo: 'bar' }); const fileLayers = await serviceSettings.getFileLayers(); expect(fileLayers.length).to.be(18); const assertions = fileLayers.map(async function(fileLayer) { diff --git a/src/plugins/maps_legacy/public/map/service_settings.js b/src/plugins/maps_legacy/public/map/service_settings.js index 11c853d39e1072..f4f0d66ee20ded 100644 --- a/src/plugins/maps_legacy/public/map/service_settings.js +++ b/src/plugins/maps_legacy/public/map/service_settings.js @@ -69,6 +69,10 @@ export class ServiceSettings { return origin === ORIGIN.EMS && this._showZoomMessage; } + enableZoomMessage() { + this._showZoomMessage = true; + } + disableZoomMessage() { this._showZoomMessage = false; } @@ -148,11 +152,12 @@ export class ServiceSettings { } /** - * Add optional query-parameters to all requests + * Set optional query-parameters for all requests * * @param additionalQueryParams */ - addQueryParams(additionalQueryParams) { + setQueryParams(additionalQueryParams) { + // Functions more as a "set" than an "add" in ems-client this._emsClient.addQueryParams(additionalQueryParams); } diff --git a/test/examples/embeddables/adding_children.ts b/test/examples/embeddables/adding_children.ts index 5fe88b5dd33f07..9ec4b6cffd31ab 100644 --- a/test/examples/embeddables/adding_children.ts +++ b/test/examples/embeddables/adding_children.ts @@ -25,7 +25,8 @@ export default function({ getService }: PluginFunctionalProviderContext) { const testSubjects = getService('testSubjects'); const flyout = getService('flyout'); - describe('creating and adding children', () => { + // FLAKY: https://github.com/elastic/kibana/issues/58692 + describe.skip('creating and adding children', () => { before(async () => { await testSubjects.click('embeddablePanelExamplae'); }); diff --git a/test/functional/apps/dashboard/dashboard_back_button.ts b/test/functional/apps/dashboard/dashboard_back_button.ts new file mode 100644 index 00000000000000..8a488c1780fcc5 --- /dev/null +++ b/test/functional/apps/dashboard/dashboard_back_button.ts @@ -0,0 +1,47 @@ +/* + * 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'; +import { FtrProviderContext } from '../../ftr_provider_context'; + +export default function({ getService, getPageObjects }: FtrProviderContext) { + const esArchiver = getService('esArchiver'); + const kibanaServer = getService('kibanaServer'); + const PageObjects = getPageObjects(['dashboard', 'header', 'common', 'visualize', 'timePicker']); + const browser = getService('browser'); + + describe('dashboard back button', () => { + before(async () => { + await esArchiver.loadIfNeeded('dashboard/current/kibana'); + await kibanaServer.uiSettings.replace({ + defaultIndex: '0bf35f60-3dc9-11e8-8660-4d65aa086b3c', + }); + await PageObjects.common.navigateToApp('dashboard'); + await PageObjects.dashboard.preserveCrossAppState(); + }); + + it('after navigation from listing page to dashboard back button works', async () => { + await PageObjects.dashboard.gotoDashboardLandingPage(); + await PageObjects.dashboard.loadSavedDashboard('dashboard with everything'); + await PageObjects.dashboard.waitForRenderComplete(); + await browser.goBack(); + expect(await PageObjects.dashboard.onDashboardLandingPage()).to.be(true); + }); + }); +} diff --git a/test/functional/apps/dashboard/index.js b/test/functional/apps/dashboard/index.js index 5e96a55b190149..6666ccc57d5845 100644 --- a/test/functional/apps/dashboard/index.js +++ b/test/functional/apps/dashboard/index.js @@ -55,6 +55,7 @@ export default function({ getService, loadTestFile }) { loadTestFile(require.resolve('./dashboard_options')); loadTestFile(require.resolve('./data_shared_attributes')); loadTestFile(require.resolve('./embed_mode')); + loadTestFile(require.resolve('./dashboard_back_button')); // Note: This one must be last because it unloads some data for one of its tests! // No, this isn't ideal, but loading/unloading takes so much time and these are all bunched diff --git a/test/functional/apps/dashboard/panel_controls.js b/test/functional/apps/dashboard/panel_controls.js index 52c4a11360355b..6e24b9f3570a3b 100644 --- a/test/functional/apps/dashboard/panel_controls.js +++ b/test/functional/apps/dashboard/panel_controls.js @@ -113,6 +113,50 @@ export default function({ getService, getPageObjects }) { }); }); + describe('panel cloning', function() { + before(async () => { + await PageObjects.dashboard.clickNewDashboard(); + await PageObjects.timePicker.setHistoricalDataRange(); + await dashboardAddPanel.addVisualization(PIE_CHART_VIS_NAME); + }); + + after(async function() { + await PageObjects.dashboard.gotoDashboardLandingPage(); + }); + + it('clones a panel', async () => { + const initialPanelTitles = await PageObjects.dashboard.getPanelTitles(); + await dashboardPanelActions.clonePanelByTitle(PIE_CHART_VIS_NAME); + await PageObjects.header.waitUntilLoadingHasFinished(); + await PageObjects.dashboard.waitForRenderComplete(); + const postPanelTitles = await PageObjects.dashboard.getPanelTitles(); + expect(postPanelTitles.length).to.equal(initialPanelTitles.length + 1); + }); + + it('appends a clone title tag', async () => { + const panelTitles = await PageObjects.dashboard.getPanelTitles(); + expect(panelTitles[1]).to.equal(PIE_CHART_VIS_NAME + ' (copy)'); + }); + + it('retains original panel dimensions', async () => { + const panelDimensions = await PageObjects.dashboard.getPanelDimensions(); + expect(panelDimensions[0]).to.eql(panelDimensions[1]); + }); + + it('gives a correct title to the clone of a clone', async () => { + const initialPanelTitles = await PageObjects.dashboard.getPanelTitles(); + const clonedPanelName = initialPanelTitles[initialPanelTitles.length - 1]; + await dashboardPanelActions.clonePanelByTitle(clonedPanelName); + await PageObjects.header.waitUntilLoadingHasFinished(); + await PageObjects.dashboard.waitForRenderComplete(); + const postPanelTitles = await PageObjects.dashboard.getPanelTitles(); + expect(postPanelTitles.length).to.equal(initialPanelTitles.length + 1); + expect(postPanelTitles[postPanelTitles.length - 1]).to.equal( + PIE_CHART_VIS_NAME + ' (copy 1)' + ); + }); + }); + describe('panel edit controls', function() { before(async () => { await PageObjects.dashboard.clickNewDashboard(); @@ -137,6 +181,7 @@ export default function({ getService, getPageObjects }) { await dashboardPanelActions.expectExistsEditPanelAction(); await dashboardPanelActions.expectExistsReplacePanelAction(); + await dashboardPanelActions.expectExistsDuplicatePanelAction(); await dashboardPanelActions.expectExistsRemovePanelAction(); }); @@ -151,6 +196,7 @@ export default function({ getService, getPageObjects }) { await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.expectExistsEditPanelAction(); await dashboardPanelActions.expectExistsReplacePanelAction(); + await dashboardPanelActions.expectExistsDuplicatePanelAction(); await dashboardPanelActions.expectExistsRemovePanelAction(); // Get rid of the timestamp in the url. @@ -166,6 +212,7 @@ export default function({ getService, getPageObjects }) { await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.expectMissingEditPanelAction(); await dashboardPanelActions.expectMissingReplacePanelAction(); + await dashboardPanelActions.expectMissingDuplicatePanelAction(); await dashboardPanelActions.expectMissingRemovePanelAction(); }); @@ -174,6 +221,7 @@ export default function({ getService, getPageObjects }) { await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.expectExistsEditPanelAction(); await dashboardPanelActions.expectExistsReplacePanelAction(); + await dashboardPanelActions.expectExistsDuplicatePanelAction(); await dashboardPanelActions.expectMissingRemovePanelAction(); await dashboardPanelActions.clickExpandPanelToggle(); }); diff --git a/test/functional/services/dashboard/panel_actions.js b/test/functional/services/dashboard/panel_actions.js index baea2a52208c16..b155d747f3b939 100644 --- a/test/functional/services/dashboard/panel_actions.js +++ b/test/functional/services/dashboard/panel_actions.js @@ -20,6 +20,7 @@ const REMOVE_PANEL_DATA_TEST_SUBJ = 'embeddablePanelAction-deletePanel'; const EDIT_PANEL_DATA_TEST_SUBJ = 'embeddablePanelAction-editPanel'; const REPLACE_PANEL_DATA_TEST_SUBJ = 'embeddablePanelAction-replacePanel'; +const CLONE_PANEL_DATA_TEST_SUBJ = 'embeddablePanelAction-clonePanel'; const TOGGLE_EXPAND_PANEL_DATA_TEST_SUBJ = 'embeddablePanelAction-togglePanel'; const CUSTOMIZE_PANEL_DATA_TEST_SUBJ = 'embeddablePanelAction-ACTION_CUSTOMIZE_PANEL'; const OPEN_CONTEXT_MENU_ICON_DATA_TEST_SUBJ = 'embeddablePanelToggleMenuIcon'; @@ -97,6 +98,16 @@ export function DashboardPanelActionsProvider({ getService, getPageObjects }) { await testSubjects.click(REPLACE_PANEL_DATA_TEST_SUBJ); } + async clonePanelByTitle(title) { + log.debug(`clonePanel(${title})`); + let panelOptions = null; + if (title) { + panelOptions = await this.getPanelHeading(title); + } + await this.openContextMenu(panelOptions); + await testSubjects.click(CLONE_PANEL_DATA_TEST_SUBJ); + } + async openInspectorByTitle(title) { const header = await this.getPanelHeading(title); await this.openInspector(header); @@ -123,7 +134,12 @@ export function DashboardPanelActionsProvider({ getService, getPageObjects }) { } async expectExistsReplacePanelAction() { - log.debug('expectExistsEditPanelAction'); + log.debug('expectExistsReplacePanelAction'); + await testSubjects.existOrFail(REPLACE_PANEL_DATA_TEST_SUBJ); + } + + async expectExistsDuplicatePanelAction() { + log.debug('expectExistsDuplicatePanelAction'); await testSubjects.existOrFail(REPLACE_PANEL_DATA_TEST_SUBJ); } @@ -133,7 +149,12 @@ export function DashboardPanelActionsProvider({ getService, getPageObjects }) { } async expectMissingReplacePanelAction() { - log.debug('expectMissingEditPanelAction'); + log.debug('expectMissingReplacePanelAction'); + await testSubjects.missingOrFail(REPLACE_PANEL_DATA_TEST_SUBJ); + } + + async expectMissingDuplicatePanelAction() { + log.debug('expectMissingDuplicatePanelAction'); await testSubjects.missingOrFail(REPLACE_PANEL_DATA_TEST_SUBJ); } diff --git a/test/scripts/jenkins_xpack.sh b/test/scripts/jenkins_xpack.sh index 7070fb1063cb51..67d88b308ed91c 100755 --- a/test/scripts/jenkins_xpack.sh +++ b/test/scripts/jenkins_xpack.sh @@ -17,7 +17,7 @@ if [[ -z "$CODE_COVERAGE" ]] ; then echo " -> Running SIEM cyclic dependency test" cd "$XPACK_DIR" - checks-reporter-with-killswitch "X-Pack SIEM cyclic dependency test" node legacy/plugins/siem/scripts/check_circular_deps + checks-reporter-with-killswitch "X-Pack SIEM cyclic dependency test" node plugins/siem/scripts/check_circular_deps echo "" echo "" diff --git a/x-pack/.i18nrc.json b/x-pack/.i18nrc.json index 50f36ddd21c97d..c8715ac3447bd8 100644 --- a/x-pack/.i18nrc.json +++ b/x-pack/.i18nrc.json @@ -32,11 +32,11 @@ "xpack.remoteClusters": "plugins/remote_clusters", "xpack.painlessLab": "plugins/painless_lab", "xpack.reporting": ["plugins/reporting", "legacy/plugins/reporting"], - "xpack.rollupJobs": "legacy/plugins/rollup", + "xpack.rollupJobs": ["legacy/plugins/rollup", "plugins/rollup"], "xpack.searchProfiler": "plugins/searchprofiler", "xpack.security": ["legacy/plugins/security", "plugins/security"], "xpack.server": "legacy/server", - "xpack.siem": "legacy/plugins/siem", + "xpack.siem": ["plugins/siem", "legacy/plugins/siem"], "xpack.snapshotRestore": "plugins/snapshot_restore", "xpack.spaces": ["legacy/plugins/spaces", "plugins/spaces"], "xpack.taskManager": "legacy/plugins/task_manager", diff --git a/x-pack/examples/README.md b/x-pack/examples/README.md new file mode 100644 index 00000000000000..babf744f9777d0 --- /dev/null +++ b/x-pack/examples/README.md @@ -0,0 +1,7 @@ +## Example plugins + +This folder contains X-Pack example plugins. To run the plugins in this folder, use the `--run-examples` flag, via + +``` +yarn start --run-examples +``` diff --git a/x-pack/examples/ui_actions_enhanced_examples/README.md b/x-pack/examples/ui_actions_enhanced_examples/README.md new file mode 100644 index 00000000000000..c9f53137d86875 --- /dev/null +++ b/x-pack/examples/ui_actions_enhanced_examples/README.md @@ -0,0 +1,3 @@ +## Ui actions enhanced examples + +To run this example, use the command `yarn start --run-examples`. diff --git a/x-pack/examples/ui_actions_enhanced_examples/kibana.json b/x-pack/examples/ui_actions_enhanced_examples/kibana.json new file mode 100644 index 00000000000000..f75852edced5c0 --- /dev/null +++ b/x-pack/examples/ui_actions_enhanced_examples/kibana.json @@ -0,0 +1,10 @@ +{ + "id": "uiActionsEnhancedExamples", + "version": "0.0.1", + "kibanaVersion": "kibana", + "configPath": ["ui_actions_enhanced_examples"], + "server": false, + "ui": true, + "requiredPlugins": ["uiActions", "data"], + "optionalPlugins": [] +} diff --git a/x-pack/examples/ui_actions_enhanced_examples/package.json b/x-pack/examples/ui_actions_enhanced_examples/package.json new file mode 100644 index 00000000000000..a9f004b075cec7 --- /dev/null +++ b/x-pack/examples/ui_actions_enhanced_examples/package.json @@ -0,0 +1,17 @@ +{ + "name": "ui_actions_enhanced_examples", + "version": "1.0.0", + "main": "target/examples/ui_actions_enhanced_examples", + "kibana": { + "version": "kibana", + "templateVersion": "1.0.0" + }, + "license": "Apache-2.0", + "scripts": { + "kbn": "node ../../scripts/kbn.js", + "build": "rm -rf './target' && tsc" + }, + "devDependencies": { + "typescript": "3.7.2" + } +} diff --git a/x-pack/legacy/plugins/siem/scripts/check_circular_deps.js b/x-pack/examples/ui_actions_enhanced_examples/public/index.ts similarity index 66% rename from x-pack/legacy/plugins/siem/scripts/check_circular_deps.js rename to x-pack/examples/ui_actions_enhanced_examples/public/index.ts index 046cc010621d70..7f3f36089d576f 100644 --- a/x-pack/legacy/plugins/siem/scripts/check_circular_deps.js +++ b/x-pack/examples/ui_actions_enhanced_examples/public/index.ts @@ -4,5 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -require('../../../../../src/setup_node_env'); -require('../dev_tools/circular_deps/run_check_circular_deps_cli'); +import { UiActionsEnhancedExamplesPlugin } from './plugin'; + +export const plugin = () => new UiActionsEnhancedExamplesPlugin(); diff --git a/x-pack/examples/ui_actions_enhanced_examples/public/plugin.ts b/x-pack/examples/ui_actions_enhanced_examples/public/plugin.ts new file mode 100644 index 00000000000000..a4c43753c82479 --- /dev/null +++ b/x-pack/examples/ui_actions_enhanced_examples/public/plugin.ts @@ -0,0 +1,31 @@ +/* + * 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 { Plugin, CoreSetup, CoreStart } from '../../../../src/core/public'; +import { UiActionsSetup, UiActionsStart } from '../../../../src/plugins/ui_actions/public'; +import { DataPublicPluginSetup, DataPublicPluginStart } from '../../../../src/plugins/data/public'; + +export interface SetupDependencies { + data: DataPublicPluginSetup; + uiActions: UiActionsSetup; +} + +export interface StartDependencies { + data: DataPublicPluginStart; + uiActions: UiActionsStart; +} + +export class UiActionsEnhancedExamplesPlugin + implements Plugin { + public setup(core: CoreSetup, plugins: SetupDependencies) { + // eslint-disable-next-line + console.log('ui_actions_enhanced_examples'); + } + + public start(core: CoreStart, plugins: StartDependencies) {} + + public stop() {} +} diff --git a/x-pack/examples/ui_actions_enhanced_examples/tsconfig.json b/x-pack/examples/ui_actions_enhanced_examples/tsconfig.json new file mode 100644 index 00000000000000..d508076b331990 --- /dev/null +++ b/x-pack/examples/ui_actions_enhanced_examples/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./target", + "skipLibCheck": true + }, + "include": [ + "index.ts", + "public/**/*.ts", + "public/**/*.tsx", + "server/**/*.ts", + "../../typings/**/*", + ], + "exclude": [] +} diff --git a/x-pack/index.js b/x-pack/index.js index 61fd4f17523160..7fbd992120ea68 100644 --- a/x-pack/index.js +++ b/x-pack/index.js @@ -9,7 +9,6 @@ import { graph } from './legacy/plugins/graph'; import { monitoring } from './legacy/plugins/monitoring'; import { reporting } from './legacy/plugins/reporting'; import { security } from './legacy/plugins/security'; -import { tilemap } from './legacy/plugins/tilemap'; import { dashboardMode } from './legacy/plugins/dashboard_mode'; import { logstash } from './legacy/plugins/logstash'; import { beats } from './legacy/plugins/beats_management'; @@ -40,7 +39,6 @@ module.exports = function(kibana) { reporting(kibana), spaces(kibana), security(kibana), - tilemap(kibana), dashboardMode(kibana), logstash(kibana), beats(kibana), diff --git a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/waterfall_helpers/waterfall_helpers.test.ts b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/waterfall_helpers/waterfall_helpers.test.ts index 416eb879d5974f..d844ac8b5988dd 100644 --- a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/waterfall_helpers/waterfall_helpers.test.ts +++ b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/waterfall_helpers/waterfall_helpers.test.ts @@ -166,6 +166,212 @@ describe('waterfall_helpers', () => { expect(waterfall.errorsCount).toEqual(0); expect(waterfall).toMatchSnapshot(); }); + it('should reparent spans', () => { + const traceItems = [ + { + processor: { event: 'transaction' }, + trace: { id: 'myTraceId' }, + service: { name: 'opbeans-node' }, + transaction: { + duration: { us: 49660 }, + name: 'GET /api', + id: 'myTransactionId1' + }, + timestamp: { us: 1549324795784006 } + } as Transaction, + { + parent: { id: 'mySpanIdD' }, + processor: { event: 'span' }, + trace: { id: 'myTraceId' }, + service: { name: 'opbeans-ruby' }, + transaction: { id: 'myTransactionId1' }, + timestamp: { us: 1549324795825633 }, + span: { + duration: { us: 481 }, + name: 'SELECT FROM products', + id: 'mySpanIdB' + }, + child_ids: ['mySpanIdA', 'mySpanIdC'] + } as Span, + { + parent: { id: 'mySpanIdD' }, + processor: { event: 'span' }, + trace: { id: 'myTraceId' }, + service: { name: 'opbeans-ruby' }, + transaction: { id: 'myTransactionId1' }, + span: { + duration: { us: 6161 }, + name: 'Api::ProductsController#index', + id: 'mySpanIdA' + }, + timestamp: { us: 1549324795824504 } + } as Span, + { + parent: { id: 'mySpanIdD' }, + processor: { event: 'span' }, + trace: { id: 'myTraceId' }, + service: { name: 'opbeans-ruby' }, + transaction: { id: 'myTransactionId1' }, + span: { + duration: { us: 532 }, + name: 'SELECT FROM product', + id: 'mySpanIdC' + }, + timestamp: { us: 1549324795827905 } + } as Span, + { + parent: { id: 'myTransactionId1' }, + processor: { event: 'span' }, + trace: { id: 'myTraceId' }, + service: { name: 'opbeans-node' }, + transaction: { id: 'myTransactionId1' }, + span: { + duration: { us: 47557 }, + name: 'GET opbeans-ruby:3000/api/products', + id: 'mySpanIdD' + }, + timestamp: { us: 1549324795785760 } + } as Span + ]; + const entryTransactionId = 'myTransactionId1'; + const waterfall = getWaterfall( + { + trace: { items: traceItems, errorDocs: [], exceedsMax: false }, + errorsPerTransaction: {} + }, + entryTransactionId + ); + const getIdAndParentId = (item: IWaterfallItem) => ({ + id: item.id, + parentId: item.parent?.id + }); + expect(waterfall.items.length).toBe(5); + expect(getIdAndParentId(waterfall.items[0])).toEqual({ + id: 'myTransactionId1', + parentId: undefined + }); + expect(getIdAndParentId(waterfall.items[1])).toEqual({ + id: 'mySpanIdD', + parentId: 'myTransactionId1' + }); + expect(getIdAndParentId(waterfall.items[2])).toEqual({ + id: 'mySpanIdB', + parentId: 'mySpanIdD' + }); + expect(getIdAndParentId(waterfall.items[3])).toEqual({ + id: 'mySpanIdA', + parentId: 'mySpanIdB' + }); + expect(getIdAndParentId(waterfall.items[4])).toEqual({ + id: 'mySpanIdC', + parentId: 'mySpanIdB' + }); + expect(waterfall.errorItems.length).toBe(0); + expect(waterfall.errorsCount).toEqual(0); + }); + it("shouldn't reparent spans when child id isn't found", () => { + const traceItems = [ + { + processor: { event: 'transaction' }, + trace: { id: 'myTraceId' }, + service: { name: 'opbeans-node' }, + transaction: { + duration: { us: 49660 }, + name: 'GET /api', + id: 'myTransactionId1' + }, + timestamp: { us: 1549324795784006 } + } as Transaction, + { + parent: { id: 'mySpanIdD' }, + processor: { event: 'span' }, + trace: { id: 'myTraceId' }, + service: { name: 'opbeans-ruby' }, + transaction: { id: 'myTransactionId1' }, + timestamp: { us: 1549324795825633 }, + span: { + duration: { us: 481 }, + name: 'SELECT FROM products', + id: 'mySpanIdB' + }, + child_ids: ['incorrectId', 'mySpanIdC'] + } as Span, + { + parent: { id: 'mySpanIdD' }, + processor: { event: 'span' }, + trace: { id: 'myTraceId' }, + service: { name: 'opbeans-ruby' }, + transaction: { id: 'myTransactionId1' }, + span: { + duration: { us: 6161 }, + name: 'Api::ProductsController#index', + id: 'mySpanIdA' + }, + timestamp: { us: 1549324795824504 } + } as Span, + { + parent: { id: 'mySpanIdD' }, + processor: { event: 'span' }, + trace: { id: 'myTraceId' }, + service: { name: 'opbeans-ruby' }, + transaction: { id: 'myTransactionId1' }, + span: { + duration: { us: 532 }, + name: 'SELECT FROM product', + id: 'mySpanIdC' + }, + timestamp: { us: 1549324795827905 } + } as Span, + { + parent: { id: 'myTransactionId1' }, + processor: { event: 'span' }, + trace: { id: 'myTraceId' }, + service: { name: 'opbeans-node' }, + transaction: { id: 'myTransactionId1' }, + span: { + duration: { us: 47557 }, + name: 'GET opbeans-ruby:3000/api/products', + id: 'mySpanIdD' + }, + timestamp: { us: 1549324795785760 } + } as Span + ]; + const entryTransactionId = 'myTransactionId1'; + const waterfall = getWaterfall( + { + trace: { items: traceItems, errorDocs: [], exceedsMax: false }, + errorsPerTransaction: {} + }, + entryTransactionId + ); + const getIdAndParentId = (item: IWaterfallItem) => ({ + id: item.id, + parentId: item.parent?.id + }); + expect(waterfall.items.length).toBe(5); + expect(getIdAndParentId(waterfall.items[0])).toEqual({ + id: 'myTransactionId1', + parentId: undefined + }); + expect(getIdAndParentId(waterfall.items[1])).toEqual({ + id: 'mySpanIdD', + parentId: 'myTransactionId1' + }); + expect(getIdAndParentId(waterfall.items[2])).toEqual({ + id: 'mySpanIdA', + parentId: 'mySpanIdD' + }); + expect(getIdAndParentId(waterfall.items[3])).toEqual({ + id: 'mySpanIdB', + parentId: 'mySpanIdD' + }); + expect(getIdAndParentId(waterfall.items[4])).toEqual({ + id: 'mySpanIdC', + parentId: 'mySpanIdB' + }); + expect(waterfall.errorItems.length).toBe(0); + expect(waterfall.errorsCount).toEqual(0); + }); }); describe('getWaterfallItems', () => { diff --git a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/waterfall_helpers/waterfall_helpers.ts b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/waterfall_helpers/waterfall_helpers.ts index 58d9134c4d787b..8a873b2ddf1c91 100644 --- a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/waterfall_helpers/waterfall_helpers.ts +++ b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/waterfall_helpers/waterfall_helpers.ts @@ -236,6 +236,29 @@ const getWaterfallItems = (items: TraceAPIResponse['trace']['items']) => } }); +/** + * Changes the parent_id of items based on the child_ids property. + * Solves the problem of Inferred spans that are created as child of trace spans + * when it actually should be its parent. + * @param waterfallItems + */ +const reparentSpans = (waterfallItems: IWaterfallItem[]) => { + return waterfallItems.map(waterfallItem => { + if (waterfallItem.docType === 'span') { + const { child_ids: childIds } = waterfallItem.doc; + if (childIds) { + childIds.forEach(childId => { + const item = waterfallItems.find(_item => _item.id === childId); + if (item) { + item.parentId = waterfallItem.id; + } + }); + } + } + return waterfallItem; + }); +}; + const getChildrenGroupedByParentId = (waterfallItems: IWaterfallItem[]) => groupBy(waterfallItems, item => (item.parentId ? item.parentId : ROOT_ID)); @@ -306,7 +329,9 @@ export function getWaterfall( const waterfallItems: IWaterfallItem[] = getWaterfallItems(trace.items); - const childrenByParentId = getChildrenGroupedByParentId(waterfallItems); + const childrenByParentId = getChildrenGroupedByParentId( + reparentSpans(waterfallItems) + ); const entryWaterfallTransaction = getEntryWaterfallTransaction( entryTransactionId, diff --git a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/WaterfallContainer.stories.tsx b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/WaterfallContainer.stories.tsx index 938962cc9dd189..f681f4dfc675ad 100644 --- a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/WaterfallContainer.stories.tsx +++ b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/WaterfallContainer.stories.tsx @@ -14,7 +14,8 @@ import { urlParams, simpleTrace, traceWithErrors, - traceChildStartBeforeParent + traceChildStartBeforeParent, + inferredSpans } from './waterfallContainer.stories.data'; import { getWaterfall } from './Waterfall/waterfall_helpers/waterfall_helpers'; @@ -74,3 +75,22 @@ storiesOf('app/TransactionDetails/Waterfall', module).add( }, { info: { source: false } } ); + +storiesOf('app/TransactionDetails/Waterfall', module).add( + 'inferred spans', + () => { + const waterfall = getWaterfall( + inferredSpans as TraceAPIResponse, + 'f2387d37260d00bd' + ); + return ( + + ); + }, + { info: { source: false } } +); diff --git a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/waterfallContainer.stories.data.ts b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/waterfallContainer.stories.data.ts index 835183e73b298b..306c8e4f3fedbc 100644 --- a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/waterfallContainer.stories.data.ts +++ b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/waterfallContainer.stories.data.ts @@ -1645,3 +1645,667 @@ export const traceChildStartBeforeParent = { }, errorsPerTransaction: {} }; + +export const inferredSpans = { + trace: { + items: [ + { + container: { + id: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad' + }, + agent: { + name: 'java', + ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', + version: '1.15.1-SNAPSHOT' + }, + process: { + pid: 6, + title: '/opt/java/openjdk/bin/java', + ppid: 1 + }, + source: { + ip: '172.18.0.8' + }, + processor: { + name: 'transaction', + event: 'transaction' + }, + url: { + path: '/api/products/2', + scheme: 'http', + port: 3000, + domain: '172.18.0.7', + full: 'http://172.18.0.7:3000/api/products/2' + }, + observer: { + hostname: '7189f754b5a3', + id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', + ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', + type: 'apm-server', + version: '8.0.0', + version_major: 8 + }, + trace: { + id: '3b0dc77f3754e5bcb9da0e4c15e0db97' + }, + '@timestamp': '2020-04-09T11:36:00.786Z', + ecs: { + version: '1.5.0' + }, + service: { + node: { + name: + 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad' + }, + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '11.0.6' + }, + language: { + name: 'Java', + version: '11.0.6' + }, + version: 'None' + }, + host: { + hostname: 'fc2ae281f56f', + os: { + platform: 'Linux' + }, + ip: '172.18.0.7', + name: 'fc2ae281f56f', + architecture: 'amd64' + }, + client: { + ip: '172.18.0.8' + }, + http: { + request: { + headers: { + Accept: ['*/*'], + 'User-Agent': ['Python/3.7 aiohttp/3.3.2'], + Host: ['172.18.0.7:3000'], + 'Accept-Encoding': ['gzip, deflate'] + }, + method: 'get', + socket: { + encrypted: false, + remote_address: '172.18.0.8' + } + }, + response: { + headers: { + 'Transfer-Encoding': ['chunked'], + Date: ['Thu, 09 Apr 2020 11:36:01 GMT'], + 'Content-Type': ['application/json;charset=UTF-8'] + }, + status_code: 200, + finished: true, + headers_sent: true + }, + version: '1.1' + }, + user_agent: { + original: 'Python/3.7 aiohttp/3.3.2', + name: 'Other', + device: { + name: 'Other' + } + }, + transaction: { + duration: { + us: 237537 + }, + result: 'HTTP 2xx', + name: 'APIRestController#product', + span_count: { + dropped: 0, + started: 3 + }, + id: 'f2387d37260d00bd', + type: 'request', + sampled: true + }, + timestamp: { + us: 1586432160786001 + } + }, + { + container: { + id: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad' + }, + parent: { + id: 'f2387d37260d00bd' + }, + agent: { + name: 'java', + ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', + version: '1.15.1-SNAPSHOT' + }, + process: { + pid: 6, + title: '/opt/java/openjdk/bin/java', + ppid: 1 + }, + processor: { + name: 'transaction', + event: 'span' + }, + observer: { + hostname: '7189f754b5a3', + id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', + ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', + type: 'apm-server', + version: '8.0.0', + version_major: 8 + }, + trace: { + id: '3b0dc77f3754e5bcb9da0e4c15e0db97' + }, + '@timestamp': '2020-04-09T11:36:00.810Z', + ecs: { + version: '1.5.0' + }, + service: { + node: { + name: + 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad' + }, + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '11.0.6' + }, + language: { + name: 'Java', + version: '11.0.6' + }, + version: 'None' + }, + host: { + hostname: 'fc2ae281f56f', + os: { + platform: 'Linux' + }, + ip: '172.18.0.7', + name: 'fc2ae281f56f', + architecture: 'amd64' + }, + transaction: { + id: 'f2387d37260d00bd' + }, + span: { + duration: { + us: 204574 + }, + subtype: 'inferred', + name: 'ServletInvocableHandlerMethod#invokeAndHandle', + id: 'a5df600bd7bd5e38', + type: 'app' + }, + timestamp: { + us: 1586432160810441 + } + }, + { + container: { + id: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad' + }, + parent: { + id: 'a5df600bd7bd5e38' + }, + agent: { + name: 'java', + ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', + version: '1.15.1-SNAPSHOT' + }, + process: { + pid: 6, + title: '/opt/java/openjdk/bin/java', + ppid: 1 + }, + processor: { + name: 'transaction', + event: 'span' + }, + observer: { + hostname: '7189f754b5a3', + id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', + type: 'apm-server', + ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', + version: '8.0.0', + version_major: 8 + }, + trace: { + id: '3b0dc77f3754e5bcb9da0e4c15e0db97' + }, + '@timestamp': '2020-04-09T11:36:00.810Z', + ecs: { + version: '1.5.0' + }, + service: { + node: { + name: + 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad' + }, + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '11.0.6' + }, + language: { + name: 'Java', + version: '11.0.6' + }, + version: 'None' + }, + host: { + hostname: 'fc2ae281f56f', + os: { + platform: 'Linux' + }, + ip: '172.18.0.7', + name: 'fc2ae281f56f', + architecture: 'amd64' + }, + transaction: { + id: 'f2387d37260d00bd' + }, + timestamp: { + us: 1586432160810441 + }, + span: { + duration: { + us: 102993 + }, + stacktrace: [ + { + library_frame: true, + exclude_from_grouping: false, + filename: 'InvocableHandlerMethod.java', + line: { + number: -1 + }, + function: 'doInvoke' + }, + { + exclude_from_grouping: false, + library_frame: true, + filename: 'InvocableHandlerMethod.java', + line: { + number: -1 + }, + function: 'invokeForRequest' + } + ], + subtype: 'inferred', + name: 'APIRestController#product', + id: '808dc34fc41ce522', + type: 'app' + } + }, + { + container: { + id: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad' + }, + parent: { + id: 'f2387d37260d00bd' + }, + agent: { + name: 'java', + ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', + version: '1.15.1-SNAPSHOT' + }, + process: { + pid: 6, + title: '/opt/java/openjdk/bin/java', + ppid: 1 + }, + processor: { + name: 'transaction', + event: 'span' + }, + labels: { + productId: '2' + }, + observer: { + hostname: '7189f754b5a3', + id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', + ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', + type: 'apm-server', + version: '8.0.0', + version_major: 8 + }, + trace: { + id: '3b0dc77f3754e5bcb9da0e4c15e0db97' + }, + '@timestamp': '2020-04-09T11:36:00.832Z', + ecs: { + version: '1.5.0' + }, + service: { + node: { + name: + 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad' + }, + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '11.0.6' + }, + language: { + name: 'Java', + version: '11.0.6' + }, + version: 'None' + }, + host: { + hostname: 'fc2ae281f56f', + os: { + platform: 'Linux' + }, + ip: '172.18.0.7', + name: 'fc2ae281f56f', + architecture: 'amd64' + }, + transaction: { + id: 'f2387d37260d00bd' + }, + timestamp: { + us: 1586432160832300 + }, + span: { + duration: { + us: 99295 + }, + name: 'OpenTracing product span', + id: '41226ae63af4f235', + type: 'unknown' + }, + child_ids: ['8d80de06aa11a6fc'] + }, + { + container: { + id: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad' + }, + parent: { + id: '808dc34fc41ce522' + }, + process: { + pid: 6, + title: '/opt/java/openjdk/bin/java', + ppid: 1 + }, + agent: { + name: 'java', + ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', + version: '1.15.1-SNAPSHOT' + }, + processor: { + name: 'transaction', + event: 'span' + }, + observer: { + hostname: '7189f754b5a3', + id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', + ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', + type: 'apm-server', + version: '8.0.0', + version_major: 8 + }, + trace: { + id: '3b0dc77f3754e5bcb9da0e4c15e0db97' + }, + '@timestamp': '2020-04-09T11:36:00.859Z', + ecs: { + version: '1.5.0' + }, + service: { + node: { + name: + 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad' + }, + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '11.0.6' + }, + language: { + name: 'Java', + version: '11.0.6' + }, + version: 'None' + }, + host: { + hostname: 'fc2ae281f56f', + os: { + platform: 'Linux' + }, + ip: '172.18.0.7', + name: 'fc2ae281f56f', + architecture: 'amd64' + }, + transaction: { + id: 'f2387d37260d00bd' + }, + timestamp: { + us: 1586432160859600 + }, + span: { + duration: { + us: 53835 + }, + subtype: 'inferred', + name: 'Loader#executeQueryStatement', + id: '8d80de06aa11a6fc', + type: 'app' + } + }, + { + container: { + id: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad' + }, + parent: { + id: '41226ae63af4f235' + }, + agent: { + name: 'java', + ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', + version: '1.15.1-SNAPSHOT' + }, + process: { + pid: 6, + title: '/opt/java/openjdk/bin/java', + ppid: 1 + }, + destination: { + address: 'postgres', + port: 5432 + }, + processor: { + name: 'transaction', + event: 'span' + }, + observer: { + hostname: '7189f754b5a3', + id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', + ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', + type: 'apm-server', + version: '8.0.0', + version_major: 8 + }, + trace: { + id: '3b0dc77f3754e5bcb9da0e4c15e0db97' + }, + '@timestamp': '2020-04-09T11:36:00.903Z', + ecs: { + version: '1.5.0' + }, + service: { + node: { + name: + 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad' + }, + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '11.0.6' + }, + language: { + name: 'Java', + version: '11.0.6' + }, + version: 'None' + }, + host: { + hostname: 'fc2ae281f56f', + os: { + platform: 'Linux' + }, + ip: '172.18.0.7', + name: 'fc2ae281f56f', + architecture: 'amd64' + }, + transaction: { + id: 'f2387d37260d00bd' + }, + timestamp: { + us: 1586432160903236 + }, + span: { + duration: { + us: 10211 + }, + subtype: 'postgresql', + destination: { + service: { + resource: 'postgresql', + name: 'postgresql', + type: 'db' + } + }, + name: 'SELECT FROM products', + action: 'query', + id: '3708d5623658182f', + type: 'db', + db: { + statement: + 'select product0_.id as col_0_0_, product0_.sku as col_1_0_, product0_.name as col_2_0_, product0_.description as col_3_0_, product0_.cost as col_4_0_, product0_.selling_price as col_5_0_, product0_.stock as col_6_0_, producttyp1_.id as col_7_0_, producttyp1_.name as col_8_0_, (select sum(orderline2_.amount) from order_lines orderline2_ where orderline2_.product_id=product0_.id) as col_9_0_ from products product0_ left outer join product_types producttyp1_ on product0_.type_id=producttyp1_.id where product0_.id=?', + type: 'sql', + user: { + name: 'postgres' + } + } + } + }, + { + container: { + id: 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad' + }, + parent: { + id: '41226ae63af4f235' + }, + process: { + pid: 6, + title: '/opt/java/openjdk/bin/java', + ppid: 1 + }, + agent: { + name: 'java', + ephemeral_id: '1cb5c830-c677-4b13-b340-ab1502f527c3', + version: '1.15.1-SNAPSHOT' + }, + destination: { + address: 'postgres', + port: 5432 + }, + processor: { + name: 'transaction', + event: 'span' + }, + observer: { + hostname: '7189f754b5a3', + id: 'f32d8d9f-a9f9-4355-8370-548dfd8024dc', + ephemeral_id: 'bff20764-0195-4f78-aa84-d799fc47b954', + type: 'apm-server', + version: '8.0.0', + version_major: 8 + }, + trace: { + id: '3b0dc77f3754e5bcb9da0e4c15e0db97' + }, + '@timestamp': '2020-04-09T11:36:00.859Z', + ecs: { + version: '1.5.0' + }, + service: { + node: { + name: + 'fc2ae281f56fb84728bc9b5e6c17f3d13bbb7f4efd461158558e5c38e655abad' + }, + environment: 'production', + name: 'opbeans-java', + runtime: { + name: 'Java', + version: '11.0.6' + }, + language: { + name: 'Java', + version: '11.0.6' + }, + version: 'None' + }, + host: { + hostname: 'fc2ae281f56f', + os: { + platform: 'Linux' + }, + ip: '172.18.0.7', + name: 'fc2ae281f56f', + architecture: 'amd64' + }, + transaction: { + id: 'f2387d37260d00bd' + }, + timestamp: { + us: 1586432160859508 + }, + span: { + duration: { + us: 4503 + }, + subtype: 'postgresql', + destination: { + service: { + resource: 'postgresql', + name: 'postgresql', + type: 'db' + } + }, + name: 'empty query', + action: 'query', + id: '9871cfd612368932', + type: 'db', + db: { + rows_affected: 0, + statement: '(empty query)', + type: 'sql', + user: { + name: 'postgres' + } + } + } + } + ], + exceedsMax: false, + errorDocs: [] + }, + errorsPerTransaction: {} +}; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.scss b/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.scss index 04f2f393d1e80e..ae26a1bee99a6f 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.scss +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.scss @@ -26,8 +26,4 @@ .euiTable { background: none; } - - .lnsExpressionRenderer { - @include euiScrollBar; - } -} \ No newline at end of file +} diff --git a/x-pack/legacy/plugins/cross_cluster_replication/public/np_ready/app/services/api.js b/x-pack/legacy/plugins/cross_cluster_replication/public/np_ready/app/services/api.js index b50c36aa8df9f5..24bc7e17356e25 100644 --- a/x-pack/legacy/plugins/cross_cluster_replication/public/np_ready/app/services/api.js +++ b/x-pack/legacy/plugins/cross_cluster_replication/public/np_ready/app/services/api.js @@ -145,9 +145,35 @@ export const updateFollowerIndex = (id, followerIndex) => { if (isUsingAdvancedSettings) { uiMetrics.push(UIM_FOLLOWER_INDEX_USE_ADVANCED_OPTIONS); } + + const { + maxReadRequestOperationCount, + maxOutstandingReadRequests, + maxReadRequestSize, + maxWriteRequestOperationCount, + maxWriteRequestSize, + maxOutstandingWriteRequests, + maxWriteBufferCount, + maxWriteBufferSize, + maxRetryDelay, + readPollTimeout, + } = followerIndex; + const request = httpClient.put(`${API_BASE_PATH}/follower_indices/${encodeURIComponent(id)}`, { - body: JSON.stringify(followerIndex), + body: JSON.stringify({ + maxReadRequestOperationCount, + maxOutstandingReadRequests, + maxReadRequestSize, + maxWriteRequestOperationCount, + maxWriteRequestSize, + maxOutstandingWriteRequests, + maxWriteBufferCount, + maxWriteBufferSize, + maxRetryDelay, + readPollTimeout, + }), }); + return trackUserRequest(request, uiMetrics); }; diff --git a/x-pack/legacy/plugins/cross_cluster_replication/server/np_ready/routes/api/follower_index.ts b/x-pack/legacy/plugins/cross_cluster_replication/server/np_ready/routes/api/follower_index.ts index 3896e1c02c9150..1d7dacf4a86887 100644 --- a/x-pack/legacy/plugins/cross_cluster_replication/server/np_ready/routes/api/follower_index.ts +++ b/x-pack/legacy/plugins/cross_cluster_replication/server/np_ready/routes/api/follower_index.ts @@ -164,6 +164,18 @@ export const registerFollowerIndexRoutes = ({ router, __LEGACY }: RouteDependenc path: `${API_BASE_PATH}/follower_indices/{id}`, validate: { params: schema.object({ id: schema.string() }), + body: schema.object({ + maxReadRequestOperationCount: schema.maybe(schema.number()), + maxOutstandingReadRequests: schema.maybe(schema.number()), + maxReadRequestSize: schema.maybe(schema.string()), // byte value + maxWriteRequestOperationCount: schema.maybe(schema.number()), + maxWriteRequestSize: schema.maybe(schema.string()), // byte value + maxOutstandingWriteRequests: schema.maybe(schema.number()), + maxWriteBufferCount: schema.maybe(schema.number()), + maxWriteBufferSize: schema.maybe(schema.string()), // byte value + maxRetryDelay: schema.maybe(schema.string()), // time value + readPollTimeout: schema.maybe(schema.string()), // time value + }), }, }, licensePreRoutingFactory({ diff --git a/x-pack/legacy/plugins/rollup/README.md b/x-pack/legacy/plugins/rollup/README.md index 6d04973de591e1..3647be38b6a09e 100644 --- a/x-pack/legacy/plugins/rollup/README.md +++ b/x-pack/legacy/plugins/rollup/README.md @@ -14,7 +14,7 @@ The rest of this doc dives into the implementation details of each of the above ## Create and manage rollup jobs -The most straight forward part of this plugin! A new app called Rollup Jobs is registered in the Management section and follows a typical CRUD UI pattern. This app allows users to create, start, stop, clone, and delete rollup jobs. There is no way to edit an existing rollup job; instead, the UI offers a cloning ability. The client-side portion of this app lives [here](public/crud_app) and uses endpoints registered [here](server/routes/api/jobs.js). +The most straight forward part of this plugin! A new app called Rollup Jobs is registered in the Management section and follows a typical CRUD UI pattern. This app allows users to create, start, stop, clone, and delete rollup jobs. There is no way to edit an existing rollup job; instead, the UI offers a cloning ability. The client-side portion of this app lives [here](../../../plugins/rollup/public/crud_app) and uses endpoints registered [here](server/routes/api/jobs.js). Refer to the [Elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/rollup-getting-started.html) to understand rollup indices and how to create rollup jobs. @@ -22,22 +22,22 @@ Refer to the [Elasticsearch documentation](https://www.elastic.co/guide/en/elast Kibana uses index patterns to consume and visualize rollup indices. Typically, Kibana can inspect the indices captured by an index pattern, identify its aggregations and fields, and determine how to consume the data. Rollup indices don't contain this type of information, so we predefine how to consume a rollup index pattern with the type and typeMeta fields on the index pattern saved object. All rollup index patterns have `type` defined as "rollup" and `typeMeta` defined as an object of the index pattern's capabilities. -In the Index Pattern app, the "Create index pattern" button includes a context menu when a rollup index is detected. This menu offers items for creating a standard index pattern and a rollup index pattern. A [rollup config is registered to index pattern creation extension point](public/index_pattern_creation/rollup_index_pattern_creation_config.js). The context menu behavior in particular uses the `getIndexPatternCreationOption()` method. When the user chooses to create a rollup index pattern, this config changes the behavior of the index pattern creation wizard: +In the Index Pattern app, the "Create index pattern" button includes a context menu when a rollup index is detected. This menu offers items for creating a standard index pattern and a rollup index pattern. A [rollup config is registered to index pattern creation extension point](../../../plugins/rollup/public/index_pattern_creation/rollup_index_pattern_creation_config.js). The context menu behavior in particular uses the `getIndexPatternCreationOption()` method. When the user chooses to create a rollup index pattern, this config changes the behavior of the index pattern creation wizard: 1. Adds a `Rollup` badge to rollup indices using `getIndexTags()`. 2. Enforces index pattern rules using `checkIndicesForErrors()`. Rollup index patterns must match **one** rollup index, and optionally, any number of regular indices. A rollup index pattern configured with one or more regular indices is known as a "hybrid" index pattern. This allows the user to visualize historical (rollup) data and live (regular) data in the same visualization. 3. Routes to this plugin's [rollup `_fields_for_wildcard` endpoint](server/routes/api/index_patterns.js), instead of the standard one, using `getFetchForWildcardOptions()`, so that the internal rollup data field names are mapped to the original field names. 4. Writes additional information about aggregations, fields, histogram interval, and date histogram interval and timezone to the rollup index pattern saved object using `getIndexPatternMappings()`. This collection of information is referred to as its "capabilities". -Once a rollup index pattern is created, it is tagged with `Rollup` in the list of index patterns, and its details page displays capabilities information. This is done by registering [yet another config for the index pattern list](public/index_pattern_list/rollup_index_pattern_list_config.js) extension points. +Once a rollup index pattern is created, it is tagged with `Rollup` in the list of index patterns, and its details page displays capabilities information. This is done by registering [yet another config for the index pattern list](../../../plugins/rollup/public/index_pattern_list/rollup_index_pattern_list_config.js) extension points. ## Create visualizations from rollup index patterns This plugin enables the user to create visualizations from rollup data using the Visualize app, excluding TSVB, Vega, and Timelion. When Visualize sends search requests, this plugin routes the requests to the [Elasticsearch rollup search endpoint](https://www.elastic.co/guide/en/elasticsearch/reference/current/rollup-search.html), which searches the special document structure within rollup indices. The visualization options available to users are based on the capabilities of the rollup index pattern they're visualizing. -Routing to the Elasticsearch rollup search endpoint is done by creating an extension point in Courier, effectively allowing multiple "search strategies" to be registered. A [rollup search strategy](public/search/register.js) is registered by this plugin that queries [this plugin's rollup search endpoint](server/routes/api/search.js). +Routing to the Elasticsearch rollup search endpoint is done by creating an extension point in Courier, effectively allowing multiple "search strategies" to be registered. A [rollup search strategy](../../../plugins/rollup/public/search/register.js) is registered by this plugin that queries [this plugin's rollup search endpoint](server/routes/api/search.js). -Limiting visualization editor options is done by [registering configs](public/visualize/index.js) to various vis extension points. These configs use information stored on the rollup index pattern to limit: +Limiting visualization editor options is done by [registering configs](../../../plugins/rollup/public/visualize/index.js) to various vis extension points. These configs use information stored on the rollup index pattern to limit: * Available aggregation types * Available fields for a particular aggregation * Default and base interval for histogram aggregation @@ -47,6 +47,6 @@ Limiting visualization editor options is done by [registering configs](public/vi In Index Management, similar to system indices, rollup indices are hidden by default. A toggle is provided to show rollup indices and add a badge to the table rows. This is done by using Index Management's extension points. -The toggle and badge are registered on client-side [here](public/extend_index_management/index.js). +The toggle and badge are registered on client-side [here](../../../plugins/rollup/public/extend_index_management/index.js). Additional data needed to filter rollup indices in Index Management is provided with a [data enricher](rollup_data_enricher.js). diff --git a/x-pack/legacy/plugins/rollup/common/index.ts b/x-pack/legacy/plugins/rollup/common/index.ts index 42298034622034..526af055a3ef65 100644 --- a/x-pack/legacy/plugins/rollup/common/index.ts +++ b/x-pack/legacy/plugins/rollup/common/index.ts @@ -16,24 +16,4 @@ export const PLUGIN = { }, }; -export const CONFIG_ROLLUPS = 'rollups:enableIndexPatterns'; - -export const API_BASE_PATH = '/api/rollup'; - -export { - UIM_APP_NAME, - UIM_APP_LOAD, - UIM_JOB_CREATE, - UIM_JOB_DELETE, - UIM_JOB_DELETE_MANY, - UIM_JOB_START, - UIM_JOB_START_MANY, - UIM_JOB_STOP, - UIM_JOB_STOP_MANY, - UIM_SHOW_DETAILS_CLICK, - UIM_DETAIL_PANEL_SUMMARY_TAB_CLICK, - UIM_DETAIL_PANEL_TERMS_TAB_CLICK, - UIM_DETAIL_PANEL_HISTOGRAM_TAB_CLICK, - UIM_DETAIL_PANEL_METRICS_TAB_CLICK, - UIM_DETAIL_PANEL_JSON_TAB_CLICK, -} from './ui_metric'; +export * from '../../../../plugins/rollup/common'; diff --git a/x-pack/legacy/plugins/rollup/index.ts b/x-pack/legacy/plugins/rollup/index.ts index 621667f3618b2c..f33ae7cfee0a22 100644 --- a/x-pack/legacy/plugins/rollup/index.ts +++ b/x-pack/legacy/plugins/rollup/index.ts @@ -4,40 +4,16 @@ * you may not use this file except in compliance with the Elastic License. */ -import { resolve } from 'path'; -import { i18n } from '@kbn/i18n'; import { PluginInitializerContext } from 'src/core/server'; import { RollupSetup } from '../../../plugins/rollup/server'; -import { PLUGIN, CONFIG_ROLLUPS } from './common'; +import { PLUGIN } from './common'; import { plugin } from './server'; export function rollup(kibana: any) { return new kibana.Plugin({ id: PLUGIN.ID, configPrefix: 'xpack.rollup', - publicDir: resolve(__dirname, 'public'), require: ['kibana', 'elasticsearch', 'xpack_main'], - uiExports: { - styleSheetPaths: resolve(__dirname, 'public/index.scss'), - managementSections: ['plugins/rollup/legacy'], - uiSettingDefaults: { - [CONFIG_ROLLUPS]: { - name: i18n.translate('xpack.rollupJobs.rollupIndexPatternsTitle', { - defaultMessage: 'Enable rollup index patterns', - }), - value: true, - description: i18n.translate('xpack.rollupJobs.rollupIndexPatternsDescription', { - defaultMessage: `Enable the creation of index patterns which capture rollup indices, - which in turn enable visualizations based on rollup data. Refresh - the page to apply the changes.`, - }), - category: ['rollups'], - }, - }, - indexManagement: ['plugins/rollup/legacy'], - visualize: ['plugins/rollup/legacy'], - search: ['plugins/rollup/legacy'], - }, init(server: any) { const { core: coreSetup, plugins } = server.newPlatform.setup; const { usageCollection, visTypeTimeseries, indexManagement } = plugins; diff --git a/x-pack/legacy/plugins/rollup/public/legacy.ts b/x-pack/legacy/plugins/rollup/public/legacy.ts deleted file mode 100644 index 83945110c2c760..00000000000000 --- a/x-pack/legacy/plugins/rollup/public/legacy.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 { npSetup, npStart } from 'ui/new_platform'; -import { RollupPlugin } from './plugin'; - -const plugin = new RollupPlugin(); - -export const setup = plugin.setup(npSetup.core, npSetup.plugins); -export const start = plugin.start(npStart.core, npStart.plugins); diff --git a/x-pack/legacy/plugins/rollup/public/legacy_imports.ts b/x-pack/legacy/plugins/rollup/public/legacy_imports.ts deleted file mode 100644 index e82a41f60b1cae..00000000000000 --- a/x-pack/legacy/plugins/rollup/public/legacy_imports.ts +++ /dev/null @@ -1,7 +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. - */ - -export { PluginsStart } from 'ui/new_platform/new_platform'; diff --git a/x-pack/legacy/plugins/rollup/public/search/rollup_search_strategy.ts b/x-pack/legacy/plugins/rollup/public/search/rollup_search_strategy.ts deleted file mode 100644 index 4709c0aa498f81..00000000000000 --- a/x-pack/legacy/plugins/rollup/public/search/rollup_search_strategy.ts +++ /dev/null @@ -1,104 +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 { HttpSetup } from 'src/core/public'; -import { - SearchError, - getSearchErrorType, - IIndexPattern, - SearchStrategyProvider, - SearchResponse, - SearchRequest, -} from '../../../../../../src/plugins/data/public'; - -function serializeFetchParams(searchRequests: SearchRequest[]) { - return JSON.stringify( - searchRequests.map(searchRequestWithFetchParams => { - const indexPattern = - searchRequestWithFetchParams.index.title || searchRequestWithFetchParams.index; - const { - body: { size, aggs, query: _query }, - } = searchRequestWithFetchParams; - - const query = { - size, - aggregations: aggs, - query: _query, - }; - - return { index: indexPattern, query }; - }) - ); -} - -// Rollup search always returns 0 hits, but visualizations expect search responses -// to return hits > 0, otherwise they do not render. We fake the number of hits here -// by counting the number of aggregation buckets/values returned by rollup search. -function shimHitsInFetchResponse(response: SearchResponse[]) { - return response.map(result => { - const buckets = result.aggregations - ? Object.keys(result.aggregations).reduce((allBuckets, agg) => { - return allBuckets.concat( - result.aggregations[agg].buckets || [result.aggregations[agg].value] || [] - ); - }, []) - : []; - return buckets && buckets.length - ? { - ...result, - hits: { - ...result.hits, - total: buckets.length, - }, - } - : result; - }); -} - -export const getRollupSearchStrategy = (fetch: HttpSetup['fetch']): SearchStrategyProvider => ({ - id: 'rollup', - - search: ({ searchRequests }) => { - // Serialize the fetch params into a format suitable for the body of an ES query. - const serializedFetchParams = serializeFetchParams(searchRequests); - - const controller = new AbortController(); - const promise = fetch('../api/rollup/search', { - signal: controller.signal, - method: 'POST', - body: serializedFetchParams, - }); - - return { - searching: promise.then(shimHitsInFetchResponse).catch(error => { - const { - body: { statusCode, error: title, message }, - res: { url }, - } = error; - - // Format fetch error as a SearchError. - const searchError = new SearchError({ - status: statusCode, - title, - message: `Rollup search error: ${message}`, - path: url, - type: getSearchErrorType({ message }) || '', - }); - - return Promise.reject(searchError); - }), - abort: () => controller.abort(), - }; - }, - - isViable: (indexPattern: IIndexPattern) => { - if (!indexPattern) { - return false; - } - - return indexPattern.type === 'rollup'; - }, -}); diff --git a/x-pack/legacy/plugins/siem/.gitattributes b/x-pack/legacy/plugins/siem/.gitattributes index f40e829b654535..a4071d39e63c0f 100644 --- a/x-pack/legacy/plugins/siem/.gitattributes +++ b/x-pack/legacy/plugins/siem/.gitattributes @@ -1,6 +1,5 @@ # Auto-collapse generated files in GitHub # https://help.github.com/en/articles/customizing-how-changed-files-appear-on-github x-pack/legacy/plugins/siem/public/graphql/types.ts linguist-generated=true -x-pack/legacy/plugins/siem/server/graphql/types.ts linguist-generated=true x-pack/legacy/plugins/siem/public/graphql/introspection.json linguist-generated=true diff --git a/x-pack/legacy/plugins/siem/cypress.json b/x-pack/legacy/plugins/siem/cypress.json deleted file mode 100644 index a0333a1068146e..00000000000000 --- a/x-pack/legacy/plugins/siem/cypress.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "baseUrl": "http://localhost:5601", - "defaultCommandTimeout": 120000, - "screenshotsFolder": "../../../../target/kibana-siem/cypress/screenshots", - "trashAssetsBeforeRuns": false, - "video": false, - "videosFolder": "../../../../target/kibana-siem/cypress/videos" -} diff --git a/x-pack/legacy/plugins/siem/index.ts b/x-pack/legacy/plugins/siem/index.ts index 3773283555b32f..6e03583dda69fa 100644 --- a/x-pack/legacy/plugins/siem/index.ts +++ b/x-pack/legacy/plugins/siem/index.ts @@ -6,11 +6,10 @@ import { i18n } from '@kbn/i18n'; import { resolve } from 'path'; -import { Server } from 'hapi'; import { Root } from 'joi'; -import { plugin } from './server'; -import { savedObjectMappings } from './server/saved_objects'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths +import { savedObjectMappings } from '../../../plugins/siem/server/saved_objects'; import { APP_ID, @@ -23,15 +22,13 @@ import { DEFAULT_INTERVAL_VALUE, DEFAULT_FROM, DEFAULT_TO, - DEFAULT_SIGNALS_INDEX, ENABLE_NEWS_FEED_SETTING, NEWS_FEED_URL_SETTING, NEWS_FEED_URL_SETTING_DEFAULT, - SIGNALS_INDEX_KEY, IP_REPUTATION_LINKS_SETTING, IP_REPUTATION_LINKS_SETTING_DEFAULT, -} from './common/constants'; -import { defaultIndexPattern } from './default_index_pattern'; + DEFAULT_INDEX_PATTERN, +} from '../../../plugins/siem/common/constants'; import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/utils'; // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -102,7 +99,7 @@ export const siem = (kibana: any) => { name: i18n.translate('xpack.siem.uiSettings.defaultIndexLabel', { defaultMessage: 'Elasticsearch indices', }), - value: defaultIndexPattern, + value: DEFAULT_INDEX_PATTERN, description: i18n.translate('xpack.siem.uiSettings.defaultIndexDescription', { defaultMessage: '

Comma-delimited list of Elasticsearch indices from which the SIEM app collects events.

', @@ -162,31 +159,12 @@ export const siem = (kibana: any) => { }, mappings: savedObjectMappings, }, - init(server: Server) { - const { coreContext, env, setup, start } = server.newPlatform; - const initializerContext = { ...coreContext, env }; - const __legacy = { - config: server.config, - route: server.route.bind(server), - }; - - // @ts-ignore-next-line: NewPlatform shim is too loosely typed - const pluginInstance = plugin(initializerContext); - // @ts-ignore-next-line: NewPlatform shim is too loosely typed - pluginInstance.setup(setup.core, setup.plugins, __legacy); - // @ts-ignore-next-line: NewPlatform shim is too loosely typed - pluginInstance.start(start.core, start.plugins); - }, config(Joi: Root) { - // See x-pack/plugins/siem/server/config.ts if you're adding another - // value where the configuration has to be duplicated at the moment. - // When we move over to the new platform completely this will be - // removed and only server/config.ts should be used. return Joi.object() .keys({ enabled: Joi.boolean().default(true), - [SIGNALS_INDEX_KEY]: Joi.string().default(DEFAULT_SIGNALS_INDEX), }) + .unknown(true) .default(); }, }); diff --git a/x-pack/legacy/plugins/siem/package.json b/x-pack/legacy/plugins/siem/package.json index 472a473842f023..3a93beef963a08 100644 --- a/x-pack/legacy/plugins/siem/package.json +++ b/x-pack/legacy/plugins/siem/package.json @@ -1,16 +1,10 @@ { "author": "Elastic", - "name": "siem", + "name": "siem-legacy-ui", "version": "8.0.0", "private": true, "license": "Elastic-License", - "scripts": { - "extract-mitre-attacks": "node scripts/extract_tactics_techniques_mitre.js & node ../../../../scripts/eslint ./public/pages/detection_engine/mitre/mitre_tactics_techniques.ts --fix", - "build-graphql-types": "node scripts/generate_types_from_graphql.js", - "cypress:open": "../../../node_modules/.bin/cypress open", - "cypress:run": "../../../node_modules/.bin/cypress run --spec ./cypress/integration/**/*.spec.ts --reporter ../../../node_modules/cypress-multi-reporters --reporter-options configFile=./reporter_config.json; status=$?; ../../../node_modules/.bin/mochawesome-merge --reportDir ../../../../target/kibana-siem/cypress/results > ../../../../target/kibana-siem/cypress/results/output.json; ../../../../node_modules/.bin/marge ../../../../target/kibana-siem/cypress/results/output.json --reportDir ../../../../target/kibana-siem/cypress/results; mkdir -p ../../../../target/junit && cp ../../../../target/kibana-siem/cypress/results/*.xml ../../../../target/junit/ && exit $status;", - "cypress:run-as-ci": "node ../../../../scripts/functional_tests --config ../../../test/siem_cypress/config.ts" - }, + "scripts": {}, "devDependencies": { "@types/lodash": "^4.14.110", "@types/js-yaml": "^3.12.1", diff --git a/x-pack/legacy/plugins/siem/public/app/app.tsx b/x-pack/legacy/plugins/siem/public/app/app.tsx index 7413aeab549db8..44c1c923cd6eea 100644 --- a/x-pack/legacy/plugins/siem/public/app/app.tsx +++ b/x-pack/legacy/plugins/siem/public/app/app.tsx @@ -20,7 +20,7 @@ import { pluck } from 'rxjs/operators'; import { KibanaContextProvider, useKibana, useUiSetting$ } from '../lib/kibana'; import { Storage } from '../../../../../../src/plugins/kibana_utils/public'; -import { DEFAULT_DARK_MODE } from '../../common/constants'; +import { DEFAULT_DARK_MODE } from '../../../../../plugins/siem/common/constants'; import { ErrorToastDispatcher } from '../components/error_toast_dispatcher'; import { compose } from '../lib/compose/kibana_compose'; import { AppFrontendLibs, AppApolloClient } from '../lib/lib'; diff --git a/x-pack/legacy/plugins/siem/public/components/alerts_viewer/index.tsx b/x-pack/legacy/plugins/siem/public/components/alerts_viewer/index.tsx index 587002c24d5269..778adc708d9012 100644 --- a/x-pack/legacy/plugins/siem/public/components/alerts_viewer/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/alerts_viewer/index.tsx @@ -6,11 +6,11 @@ import React, { useEffect, useCallback, useMemo } from 'react'; import numeral from '@elastic/numeral'; +import { DEFAULT_NUMBER_FORMAT } from '../../../../../../plugins/siem/common/constants'; import { AlertsComponentsQueryProps } from './types'; import { AlertsTable } from './alerts_table'; import * as i18n from './translations'; import { useUiSetting$ } from '../../lib/kibana'; -import { DEFAULT_NUMBER_FORMAT } from '../../../common/constants'; import { MatrixHistogramContainer } from '../matrix_histogram'; import { histogramConfigs } from './histogram_configs'; import { MatrixHisrogramConfigs } from '../matrix_histogram/types'; diff --git a/x-pack/legacy/plugins/siem/public/components/charts/common.tsx b/x-pack/legacy/plugins/siem/public/components/charts/common.tsx index d8429cba1b4fb9..c7b40c50ffde89 100644 --- a/x-pack/legacy/plugins/siem/public/components/charts/common.tsx +++ b/x-pack/legacy/plugins/siem/public/components/charts/common.tsx @@ -19,8 +19,8 @@ import { import React, { useMemo } from 'react'; import styled from 'styled-components'; +import { DEFAULT_DARK_MODE } from '../../../../../../plugins/siem/common/constants'; import { useUiSetting } from '../../lib/kibana'; -import { DEFAULT_DARK_MODE } from '../../../common/constants'; export const defaultChartHeight = '100%'; export const defaultChartWidth = '100%'; diff --git a/x-pack/legacy/plugins/siem/public/components/draggables/index.tsx b/x-pack/legacy/plugins/siem/public/components/draggables/index.tsx index a0b825ea244415..b3811d05eea048 100644 --- a/x-pack/legacy/plugins/siem/public/components/draggables/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/draggables/index.tsx @@ -8,7 +8,6 @@ import { EuiBadge, EuiToolTip, IconType } from '@elastic/eui'; import React from 'react'; import styled from 'styled-components'; -import { Omit } from '../../../common/utility_types'; import { DragEffects, DraggableWrapper } from '../drag_and_drop/draggable_wrapper'; import { escapeDataProviderId } from '../drag_and_drop/helpers'; import { getEmptyStringTag } from '../empty_value'; diff --git a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.tsx b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.tsx index cbb4006bbf9334..a7272593c2b27f 100644 --- a/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.tsx +++ b/x-pack/legacy/plugins/siem/public/components/embeddables/embedded_map.tsx @@ -14,7 +14,7 @@ import { EmbeddablePanel, ErrorEmbeddable, } from '../../../../../../../src/plugins/embeddable/public'; -import { DEFAULT_INDEX_KEY } from '../../../common/constants'; +import { DEFAULT_INDEX_KEY } from '../../../../../../plugins/siem/common/constants'; import { getIndexPatternTitleIdMapping } from '../../hooks/api/helpers'; import { useIndexPatterns } from '../../hooks/use_index_patterns'; import { Loader } from '../loader'; diff --git a/x-pack/legacy/plugins/siem/public/components/events_viewer/index.tsx b/x-pack/legacy/plugins/siem/public/components/events_viewer/index.tsx index 9b31be40dd9557..c6d9dbc2fcfc89 100644 --- a/x-pack/legacy/plugins/siem/public/components/events_viewer/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/events_viewer/index.tsx @@ -8,6 +8,7 @@ import React, { useCallback, useMemo, useEffect } from 'react'; import { connect, ConnectedProps } from 'react-redux'; import deepEqual from 'fast-deep-equal'; +import { DEFAULT_INDEX_KEY } from '../../../../../../plugins/siem/common/constants'; import { inputsModel, inputsSelectors, State, timelineSelectors } from '../../store'; import { inputsActions, timelineActions } from '../../store/actions'; import { @@ -17,12 +18,10 @@ import { } from '../../store/timeline/model'; import { OnChangeItemsPerPage } from '../timeline/events'; import { Filter } from '../../../../../../../src/plugins/data/public'; - import { useUiSetting } from '../../lib/kibana'; import { EventsViewer } from './events_viewer'; import { useFetchIndexPatterns } from '../../containers/detection_engine/rules/fetch_index_patterns'; import { TimelineTypeContextProps } from '../timeline/timeline_context'; -import { DEFAULT_INDEX_KEY } from '../../../common/constants'; import { InspectButtonContainer } from '../inspect'; import * as i18n from './translations'; diff --git a/x-pack/legacy/plugins/siem/public/components/formatted_bytes/index.tsx b/x-pack/legacy/plugins/siem/public/components/formatted_bytes/index.tsx index 98a1acf471629e..abde602c1bdacc 100644 --- a/x-pack/legacy/plugins/siem/public/components/formatted_bytes/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/formatted_bytes/index.tsx @@ -7,7 +7,7 @@ import React from 'react'; import numeral from '@elastic/numeral'; -import { DEFAULT_BYTES_FORMAT } from '../../../common/constants'; +import { DEFAULT_BYTES_FORMAT } from '../../../../../../plugins/siem/common/constants'; import { useUiSetting$ } from '../../lib/kibana'; type Bytes = string | number; diff --git a/x-pack/legacy/plugins/siem/public/components/links/index.tsx b/x-pack/legacy/plugins/siem/public/components/links/index.tsx index 62a67af6e08b11..45225e31e9ac82 100644 --- a/x-pack/legacy/plugins/siem/public/components/links/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/links/index.tsx @@ -6,9 +6,10 @@ import { EuiLink, EuiToolTip, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import React, { useMemo } from 'react'; - import { isNil } from 'lodash/fp'; import styled from 'styled-components'; + +import { IP_REPUTATION_LINKS_SETTING } from '../../../../../../plugins/siem/common/constants'; import { DefaultFieldRendererOverflow, DEFAULT_MORE_MAX_HEIGHT, @@ -22,7 +23,6 @@ import { } from '../link_to'; import { FlowTarget, FlowTargetSourceDest } from '../../graphql/types'; import { useUiSetting$ } from '../../lib/kibana'; -import { IP_REPUTATION_LINKS_SETTING } from '../../../common/constants'; import { isUrlInvalid } from '../../pages/detection_engine/rules/components/step_about_rule/helpers'; import { ExternalLinkIcon } from '../external_link_icon'; import { navTabs } from '../../pages/home/home_navigations'; diff --git a/x-pack/legacy/plugins/siem/public/components/matrix_histogram/types.ts b/x-pack/legacy/plugins/siem/public/components/matrix_histogram/types.ts index c59775ad325d07..98437845a3ab7d 100644 --- a/x-pack/legacy/plugins/siem/public/components/matrix_histogram/types.ts +++ b/x-pack/legacy/plugins/siem/public/components/matrix_histogram/types.ts @@ -7,7 +7,7 @@ import { EuiTitleSize } from '@elastic/eui'; import { ScaleType, Position, TickFormatter } from '@elastic/charts'; import { ActionCreator } from 'redux'; -import { ESQuery } from '../../../common/typed_json'; +import { ESQuery } from '../../../../../../plugins/siem/common/typed_json'; import { SetQuery } from '../../pages/hosts/navigation/types'; import { InputsModelId } from '../../store/inputs/constants'; import { HistogramType } from '../../graphql/types'; diff --git a/x-pack/legacy/plugins/siem/public/components/ml/anomaly/use_anomalies_table_data.ts b/x-pack/legacy/plugins/siem/public/components/ml/anomaly/use_anomalies_table_data.ts index c4ca7dc203619f..cebfc172ee6fff 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml/anomaly/use_anomalies_table_data.ts +++ b/x-pack/legacy/plugins/siem/public/components/ml/anomaly/use_anomalies_table_data.ts @@ -5,6 +5,8 @@ */ import { useState, useEffect } from 'react'; + +import { DEFAULT_ANOMALY_SCORE } from '../../../../../../../plugins/siem/common/constants'; import { anomaliesTableData } from '../api/anomalies_table_data'; import { InfluencerInput, Anomalies, CriteriaFields } from '../types'; import { hasMlUserPermissions } from '../permissions/has_ml_user_permissions'; @@ -14,7 +16,6 @@ import { useStateToaster, errorToToaster } from '../../toasters'; import * as i18n from './translations'; import { useTimeZone, useUiSetting$ } from '../../../lib/kibana'; -import { DEFAULT_ANOMALY_SCORE } from '../../../../common/constants'; interface Args { influencers?: InfluencerInput[]; diff --git a/x-pack/legacy/plugins/siem/public/components/ml/score/create_description_list.tsx b/x-pack/legacy/plugins/siem/public/components/ml/score/create_description_list.tsx index e0f3ea162ee786..24f203a3682d56 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml/score/create_description_list.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml/score/create_description_list.tsx @@ -7,11 +7,12 @@ import { EuiText, EuiSpacer, EuiFlexGroup, EuiFlexItem, EuiLink } from '@elastic/eui'; import React from 'react'; import styled from 'styled-components'; + +import { DescriptionList } from '../../../../../../../plugins/siem/common/utility_types'; import { Anomaly, NarrowDateRange } from '../types'; import { getScoreString } from './score_health'; import { PreferenceFormattedDate } from '../../formatted_date'; import { createInfluencers } from './../influencers/create_influencers'; -import { DescriptionList } from '../../../../common/utility_types'; import * as i18n from './translations'; import { createExplorerLink } from '../links/create_explorer_link'; diff --git a/x-pack/legacy/plugins/siem/public/components/ml_popover/hooks/use_siem_jobs.tsx b/x-pack/legacy/plugins/siem/public/components/ml_popover/hooks/use_siem_jobs.tsx index 9a82859066f540..bc488ee00988b2 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml_popover/hooks/use_siem_jobs.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml_popover/hooks/use_siem_jobs.tsx @@ -6,12 +6,12 @@ import { useEffect, useState } from 'react'; +import { DEFAULT_INDEX_KEY } from '../../../../../../../plugins/siem/common/constants'; import { checkRecognizer, getJobsSummary, getModules } from '../api'; import { SiemJob } from '../types'; import { hasMlUserPermissions } from '../../ml/permissions/has_ml_user_permissions'; import { errorToToaster, useStateToaster } from '../../toasters'; import { useUiSetting$ } from '../../../lib/kibana'; -import { DEFAULT_INDEX_KEY } from '../../../../common/constants'; import * as i18n from './translations'; import { createSiemJobs } from './use_siem_jobs_helpers'; diff --git a/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/job_switch.tsx b/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/job_switch.tsx index a0e0c70d2f2044..a0343608dc67a8 100644 --- a/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/job_switch.tsx +++ b/x-pack/legacy/plugins/siem/public/components/ml_popover/jobs_table/job_switch.tsx @@ -7,12 +7,12 @@ import styled from 'styled-components'; import React, { useState, useCallback } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner, EuiSwitch } from '@elastic/eui'; -import { SiemJob } from '../types'; import { isJobLoading, isJobFailed, isJobStarted, -} from '../../../../common/detection_engine/ml_helpers'; +} from '../../../../../../../plugins/siem/common/detection_engine/ml_helpers'; +import { SiemJob } from '../types'; const StaticSwitch = styled(EuiSwitch)` .euiSwitch__thumb, diff --git a/x-pack/legacy/plugins/siem/public/components/navigation/breadcrumbs/index.ts b/x-pack/legacy/plugins/siem/public/components/navigation/breadcrumbs/index.ts index 155f63145ca959..5407eba8b5b29d 100644 --- a/x-pack/legacy/plugins/siem/public/components/navigation/breadcrumbs/index.ts +++ b/x-pack/legacy/plugins/siem/public/components/navigation/breadcrumbs/index.ts @@ -7,7 +7,7 @@ import { getOr, omit } from 'lodash/fp'; import { ChromeBreadcrumb } from '../../../../../../../../src/core/public'; -import { APP_NAME } from '../../../../common/constants'; +import { APP_NAME } from '../../../../../../../plugins/siem/common/constants'; import { StartServices } from '../../../plugin'; import { getBreadcrumbs as getHostDetailsBreadcrumbs } from '../../../pages/hosts/details/utils'; import { getBreadcrumbs as getIPDetailsBreadcrumbs } from '../../../pages/network/ip_details'; diff --git a/x-pack/legacy/plugins/siem/public/components/news_feed/helpers.test.ts b/x-pack/legacy/plugins/siem/public/components/news_feed/helpers.test.ts index e7cd03d098da8d..686ec4e86e7852 100644 --- a/x-pack/legacy/plugins/siem/public/components/news_feed/helpers.test.ts +++ b/x-pack/legacy/plugins/siem/public/components/news_feed/helpers.test.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +import { NEWS_FEED_URL_SETTING_DEFAULT } from '../../../../../../plugins/siem/common/constants'; import { KibanaServices } from '../../lib/kibana'; -import { NEWS_FEED_URL_SETTING_DEFAULT } from '../../../common/constants'; import { rawNewsApiResponse } from '../../mock/news'; import { rawNewsJSON } from '../../mock/raw_news'; diff --git a/x-pack/legacy/plugins/siem/public/components/page/hosts/host_overview/index.tsx b/x-pack/legacy/plugins/siem/public/components/page/hosts/host_overview/index.tsx index 4d0e6a737d303f..a0ca5f855237c5 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/hosts/host_overview/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/hosts/host_overview/index.tsx @@ -10,8 +10,8 @@ import lightTheme from '@elastic/eui/dist/eui_theme_light.json'; import { getOr } from 'lodash/fp'; import React from 'react'; -import { DEFAULT_DARK_MODE } from '../../../../../common/constants'; -import { DescriptionList } from '../../../../../common/utility_types'; +import { DEFAULT_DARK_MODE } from '../../../../../../../../plugins/siem/common/constants'; +import { DescriptionList } from '../../../../../../../../plugins/siem/common/utility_types'; import { useUiSetting$ } from '../../../../lib/kibana'; import { getEmptyTagValue } from '../../../empty_value'; import { DefaultFieldRenderer, hostIdRenderer } from '../../../field_renderers/field_renderers'; diff --git a/x-pack/legacy/plugins/siem/public/components/page/network/ip_overview/index.tsx b/x-pack/legacy/plugins/siem/public/components/page/network/ip_overview/index.tsx index 56b59ca97156f6..a652fef5508fca 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/network/ip_overview/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/network/ip_overview/index.tsx @@ -9,8 +9,8 @@ import darkTheme from '@elastic/eui/dist/eui_theme_dark.json'; import lightTheme from '@elastic/eui/dist/eui_theme_light.json'; import React from 'react'; -import { DEFAULT_DARK_MODE } from '../../../../../common/constants'; -import { DescriptionList } from '../../../../../common/utility_types'; +import { DEFAULT_DARK_MODE } from '../../../../../../../../plugins/siem/common/constants'; +import { DescriptionList } from '../../../../../../../../plugins/siem/common/utility_types'; import { useUiSetting$ } from '../../../../lib/kibana'; import { FlowTarget, IpOverviewData, Overview } from '../../../../graphql/types'; import { networkModel } from '../../../../store'; diff --git a/x-pack/legacy/plugins/siem/public/components/page/overview/overview_host/index.tsx b/x-pack/legacy/plugins/siem/public/components/page/overview/overview_host/index.tsx index 52c142ceff4805..b43efbbde51b33 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/overview/overview_host/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/overview/overview_host/index.tsx @@ -10,8 +10,8 @@ import numeral from '@elastic/numeral'; import { FormattedMessage } from '@kbn/i18n/react'; import React, { useMemo } from 'react'; -import { DEFAULT_NUMBER_FORMAT } from '../../../../../common/constants'; -import { ESQuery } from '../../../../../common/typed_json'; +import { DEFAULT_NUMBER_FORMAT } from '../../../../../../../../plugins/siem/common/constants'; +import { ESQuery } from '../../../../../../../../plugins/siem/common/typed_json'; import { ID as OverviewHostQueryId, OverviewHostQuery, diff --git a/x-pack/legacy/plugins/siem/public/components/page/overview/overview_network/index.tsx b/x-pack/legacy/plugins/siem/public/components/page/overview/overview_network/index.tsx index d649a0dd9e9237..af50fa88e5fe8e 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/overview/overview_network/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/overview/overview_network/index.tsx @@ -10,8 +10,8 @@ import numeral from '@elastic/numeral'; import { FormattedMessage } from '@kbn/i18n/react'; import React, { useMemo } from 'react'; -import { DEFAULT_NUMBER_FORMAT } from '../../../../../common/constants'; -import { ESQuery } from '../../../../../common/typed_json'; +import { DEFAULT_NUMBER_FORMAT } from '../../../../../../../../plugins/siem/common/constants'; +import { ESQuery } from '../../../../../../../../plugins/siem/common/typed_json'; import { HeaderSection } from '../../../header_section'; import { useUiSetting$ } from '../../../../lib/kibana'; import { manageQuery } from '../../../page/manage_query'; diff --git a/x-pack/legacy/plugins/siem/public/components/page/overview/stat_value.tsx b/x-pack/legacy/plugins/siem/public/components/page/overview/stat_value.tsx index 7615001eec9da3..cada0a9aff9390 100644 --- a/x-pack/legacy/plugins/siem/public/components/page/overview/stat_value.tsx +++ b/x-pack/legacy/plugins/siem/public/components/page/overview/stat_value.tsx @@ -9,7 +9,7 @@ import numeral from '@elastic/numeral'; import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; -import { DEFAULT_NUMBER_FORMAT } from '../../../../common/constants'; +import { DEFAULT_NUMBER_FORMAT } from '../../../../../../../plugins/siem/common/constants'; import { useUiSetting$ } from '../../../lib/kibana'; const ProgressContainer = styled.div` diff --git a/x-pack/legacy/plugins/siem/public/components/paginated_table/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/paginated_table/index.test.tsx index 947bdee6a5cd23..2f743c33872090 100644 --- a/x-pack/legacy/plugins/siem/public/components/paginated_table/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/paginated_table/index.test.tsx @@ -7,13 +7,13 @@ import { mount, shallow } from 'enzyme'; import React from 'react'; +import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../../plugins/siem/common/constants'; import { Direction } from '../../graphql/types'; import { BasicTableProps, PaginatedTable } from './index'; import { getHostsColumns, mockData, rowItems, sortedHosts } from './index.mock'; import { ThemeProvider } from 'styled-components'; import euiDarkVars from '@elastic/eui/dist/eui_theme_dark.json'; -import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../common/constants'; jest.mock('react', () => { const r = jest.requireActual('react'); diff --git a/x-pack/legacy/plugins/siem/public/components/paginated_table/index.tsx b/x-pack/legacy/plugins/siem/public/components/paginated_table/index.tsx index 73c3d2da184e75..e481fe72452019 100644 --- a/x-pack/legacy/plugins/siem/public/components/paginated_table/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/paginated_table/index.tsx @@ -22,6 +22,7 @@ import { noop } from 'lodash/fp'; import React, { FC, memo, useState, useEffect, ComponentType } from 'react'; import styled from 'styled-components'; +import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../../../../plugins/siem/common/constants'; import { AuthTableColumns } from '../page/hosts/authentications_table'; import { HostsTableColumns } from '../page/hosts/hosts_table'; import { NetworkDnsColumns } from '../page/network/network_dns_table/columns'; @@ -40,7 +41,6 @@ import { UsersColumns } from '../page/network/users_table/columns'; import { HeaderSection } from '../header_section'; import { Loader } from '../loader'; import { useStateToaster } from '../toasters'; -import { DEFAULT_MAX_TABLE_QUERY_SIZE } from '../../../common/constants'; import * as i18n from './translations'; import { Panel } from '../panel'; diff --git a/x-pack/legacy/plugins/siem/public/components/query_bar/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/query_bar/index.test.tsx index 870d0b40d8cd48..49afc8d5ef68b3 100644 --- a/x-pack/legacy/plugins/siem/public/components/query_bar/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/query_bar/index.test.tsx @@ -7,9 +7,9 @@ import { mount } from 'enzyme'; import React from 'react'; +import { DEFAULT_FROM, DEFAULT_TO } from '../../../../../../plugins/siem/common/constants'; import { TestProviders, mockIndexPattern } from '../../mock'; import { createKibanaCoreStartMock } from '../../mock/kibana_core'; -import { DEFAULT_FROM, DEFAULT_TO } from '../../../common/constants'; import { FilterManager, SearchBar } from '../../../../../../../src/plugins/data/public'; import { QueryBar, QueryBarComponentProps } from '.'; import { createKibanaContextProviderMock } from '../../mock/kibana_react'; diff --git a/x-pack/legacy/plugins/siem/public/components/super_date_picker/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/super_date_picker/index.test.tsx index c5838fa283e177..d64ddb9bb40b13 100644 --- a/x-pack/legacy/plugins/siem/public/components/super_date_picker/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/super_date_picker/index.test.tsx @@ -8,6 +8,7 @@ import { mount } from 'enzyme'; import React from 'react'; import { Provider as ReduxStoreProvider } from 'react-redux'; +import { DEFAULT_TIMEPICKER_QUICK_RANGES } from '../../../../../../plugins/siem/common/constants'; import { useUiSetting$ } from '../../lib/kibana'; import { apolloClientObservable, mockGlobalState } from '../../mock'; import { createUseUiSetting$Mock } from '../../mock/kibana_react'; @@ -15,7 +16,6 @@ import { createStore, State } from '../../store'; import { SuperDatePicker, makeMapStateToProps } from '.'; import { cloneDeep } from 'lodash/fp'; -import { DEFAULT_TIMEPICKER_QUICK_RANGES } from '../../../common/constants'; jest.mock('../../lib/kibana'); const mockUseUiSetting$ = useUiSetting$ as jest.Mock; diff --git a/x-pack/legacy/plugins/siem/public/components/super_date_picker/index.tsx b/x-pack/legacy/plugins/siem/public/components/super_date_picker/index.tsx index ad38a7d61bcba6..cf350b3993a4b9 100644 --- a/x-pack/legacy/plugins/siem/public/components/super_date_picker/index.tsx +++ b/x-pack/legacy/plugins/siem/public/components/super_date_picker/index.tsx @@ -17,7 +17,7 @@ import React, { useState, useCallback } from 'react'; import { connect, ConnectedProps } from 'react-redux'; import { Dispatch } from 'redux'; -import { DEFAULT_TIMEPICKER_QUICK_RANGES } from '../../../common/constants'; +import { DEFAULT_TIMEPICKER_QUICK_RANGES } from '../../../../../../plugins/siem/common/constants'; import { useUiSetting$ } from '../../lib/kibana'; import { inputsModel, State } from '../../store'; import { inputsActions, timelineActions } from '../../store/actions'; diff --git a/x-pack/legacy/plugins/siem/public/components/timeline/query_bar/index.test.tsx b/x-pack/legacy/plugins/siem/public/components/timeline/query_bar/index.test.tsx index 943133dc2063cf..a49f6cc930abda 100644 --- a/x-pack/legacy/plugins/siem/public/components/timeline/query_bar/index.test.tsx +++ b/x-pack/legacy/plugins/siem/public/components/timeline/query_bar/index.test.tsx @@ -7,7 +7,7 @@ import { mount } from 'enzyme'; import React from 'react'; -import { DEFAULT_FROM, DEFAULT_TO } from '../../../../common/constants'; +import { DEFAULT_FROM, DEFAULT_TO } from '../../../../../../../plugins/siem/common/constants'; import { mockBrowserFields } from '../../../containers/source/mock'; import { convertKueryToElasticSearchQuery } from '../../../lib/keury'; import { mockIndexPattern, TestProviders } from '../../../mock'; diff --git a/x-pack/legacy/plugins/siem/public/containers/anomalies/anomalies_query_tab_body/index.tsx b/x-pack/legacy/plugins/siem/public/containers/anomalies/anomalies_query_tab_body/index.tsx index 85e19248f2eb52..83c38f2a76175f 100644 --- a/x-pack/legacy/plugins/siem/public/containers/anomalies/anomalies_query_tab_body/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/anomalies/anomalies_query_tab_body/index.tsx @@ -5,11 +5,12 @@ */ import React, { useEffect } from 'react'; + +import { DEFAULT_ANOMALY_SCORE } from '../../../../../../../plugins/siem/common/constants'; import { AnomaliesQueryTabBodyProps } from './types'; import { getAnomaliesFilterQuery } from './utils'; import { useSiemJobs } from '../../../components/ml_popover/hooks/use_siem_jobs'; import { useUiSetting$ } from '../../../lib/kibana'; -import { DEFAULT_ANOMALY_SCORE } from '../../../../common/constants'; import { MatrixHistogramContainer } from '../../../components/matrix_histogram'; import { histogramConfigs } from './histogram_configs'; const ID = 'anomaliesOverTimeQuery'; diff --git a/x-pack/legacy/plugins/siem/public/containers/anomalies/anomalies_query_tab_body/types.ts b/x-pack/legacy/plugins/siem/public/containers/anomalies/anomalies_query_tab_body/types.ts index f6cae81e3c6c4b..d17eadc68d04b6 100644 --- a/x-pack/legacy/plugins/siem/public/containers/anomalies/anomalies_query_tab_body/types.ts +++ b/x-pack/legacy/plugins/siem/public/containers/anomalies/anomalies_query_tab_body/types.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ESTermQuery } from '../../../../common/typed_json'; +import { ESTermQuery } from '../../../../../../../plugins/siem/common/typed_json'; import { NarrowDateRange } from '../../../components/ml/types'; import { UpdateDateRange } from '../../../components/charts/common'; import { SetQuery } from '../../../pages/hosts/navigation/types'; diff --git a/x-pack/legacy/plugins/siem/public/containers/anomalies/anomalies_query_tab_body/utils.ts b/x-pack/legacy/plugins/siem/public/containers/anomalies/anomalies_query_tab_body/utils.ts index 9609619916ab15..f698e302d34232 100644 --- a/x-pack/legacy/plugins/siem/public/containers/anomalies/anomalies_query_tab_body/utils.ts +++ b/x-pack/legacy/plugins/siem/public/containers/anomalies/anomalies_query_tab_body/utils.ts @@ -5,8 +5,9 @@ */ import deepmerge from 'deepmerge'; + +import { ESTermQuery } from '../../../../../../../plugins/siem/common/typed_json'; import { createFilter } from '../../helpers'; -import { ESTermQuery } from '../../../../common/typed_json'; import { SiemJob } from '../../../components/ml_popover/types'; import { FlowTarget } from '../../../graphql/types'; diff --git a/x-pack/legacy/plugins/siem/public/containers/authentications/index.tsx b/x-pack/legacy/plugins/siem/public/containers/authentications/index.tsx index 6d4a88c45a7681..13bb40dad04bd8 100644 --- a/x-pack/legacy/plugins/siem/public/containers/authentications/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/authentications/index.tsx @@ -10,7 +10,7 @@ import { Query } from 'react-apollo'; import { connect } from 'react-redux'; import { compose } from 'redux'; -import { DEFAULT_INDEX_KEY } from '../../../common/constants'; +import { DEFAULT_INDEX_KEY } from '../../../../../../plugins/siem/common/constants'; import { AuthenticationsEdges, GetAuthenticationsQuery, diff --git a/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/api.ts b/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/api.ts index 5cc73e17662c65..69f4c93a82e2cc 100644 --- a/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/api.ts +++ b/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/api.ts @@ -4,6 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ +import { + DETECTION_ENGINE_RULES_URL, + DETECTION_ENGINE_PREPACKAGED_URL, + DETECTION_ENGINE_RULES_STATUS_URL, + DETECTION_ENGINE_PREPACKAGED_RULES_STATUS_URL, + DETECTION_ENGINE_TAGS_URL, +} from '../../../../../../../plugins/siem/common/constants'; import { AddRulesProps, DeleteRulesProps, @@ -23,13 +30,6 @@ import { BulkRuleResponse, } from './types'; import { KibanaServices } from '../../../lib/kibana'; -import { - DETECTION_ENGINE_RULES_URL, - DETECTION_ENGINE_PREPACKAGED_URL, - DETECTION_ENGINE_RULES_STATUS_URL, - DETECTION_ENGINE_PREPACKAGED_RULES_STATUS_URL, - DETECTION_ENGINE_TAGS_URL, -} from '../../../../common/constants'; import * as i18n from '../../../pages/detection_engine/rules/translations'; /** diff --git a/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/fetch_index_patterns.test.tsx b/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/fetch_index_patterns.test.tsx index cad78ac565903a..83b8a3581a4be1 100644 --- a/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/fetch_index_patterns.test.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/fetch_index_patterns.test.tsx @@ -6,7 +6,7 @@ import { renderHook, act } from '@testing-library/react-hooks'; -import { defaultIndexPattern } from '../../../../default_index_pattern'; +import { DEFAULT_INDEX_PATTERN } from '../../../../../../../plugins/siem/common/constants'; import { useApolloClient } from '../../../utils/apollo_context'; import { mocksSource } from '../../source/mock'; @@ -25,7 +25,7 @@ describe('useFetchIndexPatterns', () => { query: () => Promise.resolve(mocksSource[0].result), })); const { result, waitForNextUpdate } = renderHook(() => - useFetchIndexPatterns(defaultIndexPattern) + useFetchIndexPatterns(DEFAULT_INDEX_PATTERN) ); await waitForNextUpdate(); await waitForNextUpdate(); @@ -429,7 +429,7 @@ describe('useFetchIndexPatterns', () => { query: () => Promise.reject(new Error('Something went wrong')), })); const { result, waitForNextUpdate } = renderHook(() => - useFetchIndexPatterns(defaultIndexPattern) + useFetchIndexPatterns(DEFAULT_INDEX_PATTERN) ); await waitForNextUpdate(); diff --git a/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/types.ts b/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/types.ts index f89d21ef1aeb19..2f2de2e151664e 100644 --- a/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/types.ts +++ b/x-pack/legacy/plugins/siem/public/containers/detection_engine/rules/types.ts @@ -6,7 +6,7 @@ import * as t from 'io-ts'; -import { RuleTypeSchema } from '../../../../common/detection_engine/types'; +import { RuleTypeSchema } from '../../../../../../../plugins/siem/common/detection_engine/types'; /** * Params is an "record", since it is a type of AlertActionParams which is action templates. diff --git a/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/api.ts b/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/api.ts index 25263c2d327355..ece2483adde3ad 100644 --- a/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/api.ts +++ b/x-pack/legacy/plugins/siem/public/containers/detection_engine/signals/api.ts @@ -4,13 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import { KibanaServices } from '../../../lib/kibana'; import { DETECTION_ENGINE_QUERY_SIGNALS_URL, DETECTION_ENGINE_SIGNALS_STATUS_URL, DETECTION_ENGINE_INDEX_URL, DETECTION_ENGINE_PRIVILEGES_URL, -} from '../../../../common/constants'; +} from '../../../../../../../plugins/siem/common/constants'; +import { KibanaServices } from '../../../lib/kibana'; import { BasicSignals, Privilege, diff --git a/x-pack/legacy/plugins/siem/public/containers/events/last_event_time/index.ts b/x-pack/legacy/plugins/siem/public/containers/events/last_event_time/index.ts index 9cae503d309408..8628ba502f0819 100644 --- a/x-pack/legacy/plugins/siem/public/containers/events/last_event_time/index.ts +++ b/x-pack/legacy/plugins/siem/public/containers/events/last_event_time/index.ts @@ -7,7 +7,7 @@ import { get } from 'lodash/fp'; import React, { useEffect, useState } from 'react'; -import { DEFAULT_INDEX_KEY } from '../../../../common/constants'; +import { DEFAULT_INDEX_KEY } from '../../../../../../../plugins/siem/common/constants'; import { GetLastEventTimeQuery, LastEventIndexKey, LastTimeDetails } from '../../../graphql/types'; import { inputsModel } from '../../../store'; import { QueryTemplateProps } from '../../query_template'; diff --git a/x-pack/legacy/plugins/siem/public/containers/events/last_event_time/mock.ts b/x-pack/legacy/plugins/siem/public/containers/events/last_event_time/mock.ts index ca8786077851f9..5ef8e67dedddbf 100644 --- a/x-pack/legacy/plugins/siem/public/containers/events/last_event_time/mock.ts +++ b/x-pack/legacy/plugins/siem/public/containers/events/last_event_time/mock.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { defaultIndexPattern } from '../../../../default_index_pattern'; +import { DEFAULT_INDEX_PATTERN } from '../../../../../../../plugins/siem/common/constants'; import { GetLastEventTimeQuery, LastEventIndexKey } from '../../../graphql/types'; import { LastEventTimeGqlQuery } from './last_event_time.gql_query'; @@ -43,7 +43,7 @@ export const mockLastEventTimeQuery: MockLastEventTimeQuery[] = [ sourceId: 'default', indexKey: LastEventIndexKey.hosts, details: {}, - defaultIndex: defaultIndexPattern, + defaultIndex: DEFAULT_INDEX_PATTERN, }, }, result: { diff --git a/x-pack/legacy/plugins/siem/public/containers/helpers.test.ts b/x-pack/legacy/plugins/siem/public/containers/helpers.test.ts index 5d378d79acc7a4..67cfe259927ab2 100644 --- a/x-pack/legacy/plugins/siem/public/containers/helpers.test.ts +++ b/x-pack/legacy/plugins/siem/public/containers/helpers.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ESQuery } from '../../common/typed_json'; +import { ESQuery } from '../../../../../plugins/siem/common/typed_json'; import { createFilter } from './helpers'; diff --git a/x-pack/legacy/plugins/siem/public/containers/helpers.ts b/x-pack/legacy/plugins/siem/public/containers/helpers.ts index 5f66e3f4b88d4d..7ff9577bfb05e7 100644 --- a/x-pack/legacy/plugins/siem/public/containers/helpers.ts +++ b/x-pack/legacy/plugins/siem/public/containers/helpers.ts @@ -7,7 +7,7 @@ import { FetchPolicy } from 'apollo-client'; import { isString } from 'lodash/fp'; -import { ESQuery } from '../../common/typed_json'; +import { ESQuery } from '../../../../../plugins/siem/common/typed_json'; export const createFilter = (filterQuery: ESQuery | string | undefined) => isString(filterQuery) ? filterQuery : JSON.stringify(filterQuery); diff --git a/x-pack/legacy/plugins/siem/public/containers/hosts/first_last_seen/index.ts b/x-pack/legacy/plugins/siem/public/containers/hosts/first_last_seen/index.ts index e36da5bfbe4ee3..5806125f2397b9 100644 --- a/x-pack/legacy/plugins/siem/public/containers/hosts/first_last_seen/index.ts +++ b/x-pack/legacy/plugins/siem/public/containers/hosts/first_last_seen/index.ts @@ -8,8 +8,8 @@ import ApolloClient from 'apollo-client'; import { get } from 'lodash/fp'; import React, { useEffect, useState } from 'react'; +import { DEFAULT_INDEX_KEY } from '../../../../../../../plugins/siem/common/constants'; import { useUiSetting$ } from '../../../lib/kibana'; -import { DEFAULT_INDEX_KEY } from '../../../../common/constants'; import { GetHostFirstLastSeenQuery } from '../../../graphql/types'; import { inputsModel } from '../../../store'; import { QueryTemplateProps } from '../../query_template'; diff --git a/x-pack/legacy/plugins/siem/public/containers/hosts/first_last_seen/mock.ts b/x-pack/legacy/plugins/siem/public/containers/hosts/first_last_seen/mock.ts index 2c9d418763e8e2..7376f38ae8d0fd 100644 --- a/x-pack/legacy/plugins/siem/public/containers/hosts/first_last_seen/mock.ts +++ b/x-pack/legacy/plugins/siem/public/containers/hosts/first_last_seen/mock.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { defaultIndexPattern } from '../../../../default_index_pattern'; +import { DEFAULT_INDEX_PATTERN } from '../../../../../../../plugins/siem/common/constants'; import { GetHostFirstLastSeenQuery } from '../../../graphql/types'; import { HostFirstLastSeenGqlQuery } from './first_last_seen.gql_query'; @@ -34,7 +34,7 @@ export const mockFirstLastSeenHostQuery: MockedProvidedQuery[] = [ variables: { sourceId: 'default', hostName: 'kibana-siem', - defaultIndex: defaultIndexPattern, + defaultIndex: DEFAULT_INDEX_PATTERN, }, }, result: { diff --git a/x-pack/legacy/plugins/siem/public/containers/hosts/index.tsx b/x-pack/legacy/plugins/siem/public/containers/hosts/index.tsx index 733c2224d840a7..edf3f6855f955f 100644 --- a/x-pack/legacy/plugins/siem/public/containers/hosts/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/hosts/index.tsx @@ -11,7 +11,7 @@ import { Query } from 'react-apollo'; import { connect } from 'react-redux'; import { compose } from 'redux'; -import { DEFAULT_INDEX_KEY } from '../../../common/constants'; +import { DEFAULT_INDEX_KEY } from '../../../../../../plugins/siem/common/constants'; import { Direction, GetHostsTableQuery, diff --git a/x-pack/legacy/plugins/siem/public/containers/hosts/overview/index.tsx b/x-pack/legacy/plugins/siem/public/containers/hosts/overview/index.tsx index 5057e872b53131..405c45348b54da 100644 --- a/x-pack/legacy/plugins/siem/public/containers/hosts/overview/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/hosts/overview/index.tsx @@ -10,7 +10,7 @@ import { Query } from 'react-apollo'; import { connect } from 'react-redux'; import { compose } from 'redux'; -import { DEFAULT_INDEX_KEY } from '../../../../common/constants'; +import { DEFAULT_INDEX_KEY } from '../../../../../../../plugins/siem/common/constants'; import { inputsModel, inputsSelectors, State } from '../../../store'; import { getDefaultFetchPolicy } from '../../helpers'; import { QueryTemplate, QueryTemplateProps } from '../../query_template'; diff --git a/x-pack/legacy/plugins/siem/public/containers/ip_overview/index.tsx b/x-pack/legacy/plugins/siem/public/containers/ip_overview/index.tsx index ade94c430c6efb..954bfede07139e 100644 --- a/x-pack/legacy/plugins/siem/public/containers/ip_overview/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/ip_overview/index.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { Query } from 'react-apollo'; import { connect, ConnectedProps } from 'react-redux'; -import { DEFAULT_INDEX_KEY } from '../../../common/constants'; +import { DEFAULT_INDEX_KEY } from '../../../../../../plugins/siem/common/constants'; import { GetIpOverviewQuery, IpOverviewData } from '../../graphql/types'; import { networkModel, inputsModel, inputsSelectors, State } from '../../store'; import { useUiSetting } from '../../lib/kibana'; diff --git a/x-pack/legacy/plugins/siem/public/containers/kpi_host_details/index.tsx b/x-pack/legacy/plugins/siem/public/containers/kpi_host_details/index.tsx index de9d54b1a185c8..3933aefa60483c 100644 --- a/x-pack/legacy/plugins/siem/public/containers/kpi_host_details/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/kpi_host_details/index.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { Query } from 'react-apollo'; import { connect, ConnectedProps } from 'react-redux'; -import { DEFAULT_INDEX_KEY } from '../../../common/constants'; +import { DEFAULT_INDEX_KEY } from '../../../../../../plugins/siem/common/constants'; import { KpiHostDetailsData, GetKpiHostDetailsQuery } from '../../graphql/types'; import { inputsModel, inputsSelectors, State } from '../../store'; import { useUiSetting } from '../../lib/kibana'; diff --git a/x-pack/legacy/plugins/siem/public/containers/kpi_hosts/index.tsx b/x-pack/legacy/plugins/siem/public/containers/kpi_hosts/index.tsx index 5be2423e8a162a..7035d631931188 100644 --- a/x-pack/legacy/plugins/siem/public/containers/kpi_hosts/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/kpi_hosts/index.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { Query } from 'react-apollo'; import { connect, ConnectedProps } from 'react-redux'; -import { DEFAULT_INDEX_KEY } from '../../../common/constants'; +import { DEFAULT_INDEX_KEY } from '../../../../../../plugins/siem/common/constants'; import { GetKpiHostsQuery, KpiHostsData } from '../../graphql/types'; import { inputsModel, inputsSelectors, State } from '../../store'; import { useUiSetting } from '../../lib/kibana'; diff --git a/x-pack/legacy/plugins/siem/public/containers/kpi_network/index.tsx b/x-pack/legacy/plugins/siem/public/containers/kpi_network/index.tsx index 338cdc39b178c1..002a819417df64 100644 --- a/x-pack/legacy/plugins/siem/public/containers/kpi_network/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/kpi_network/index.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { Query } from 'react-apollo'; import { connect, ConnectedProps } from 'react-redux'; -import { DEFAULT_INDEX_KEY } from '../../../common/constants'; +import { DEFAULT_INDEX_KEY } from '../../../../../../plugins/siem/common/constants'; import { GetKpiNetworkQuery, KpiNetworkData } from '../../graphql/types'; import { inputsModel, inputsSelectors, State } from '../../store'; import { useUiSetting } from '../../lib/kibana'; diff --git a/x-pack/legacy/plugins/siem/public/containers/matrix_histogram/index.ts b/x-pack/legacy/plugins/siem/public/containers/matrix_histogram/index.ts index 83b3a8fdbb68cb..55d7e7cdc6e543 100644 --- a/x-pack/legacy/plugins/siem/public/containers/matrix_histogram/index.ts +++ b/x-pack/legacy/plugins/siem/public/containers/matrix_histogram/index.ts @@ -3,11 +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 { isEmpty } from 'lodash/fp'; import { useEffect, useMemo, useState, useRef } from 'react'; +import { DEFAULT_INDEX_KEY } from '../../../../../../plugins/siem/common/constants'; import { MatrixHistogramQueryProps } from '../../components/matrix_histogram/types'; -import { DEFAULT_INDEX_KEY } from '../../../common/constants'; import { errorToToaster, useStateToaster } from '../../components/toasters'; import { useUiSetting$ } from '../../lib/kibana'; import { createFilter } from '../helpers'; diff --git a/x-pack/legacy/plugins/siem/public/containers/network_dns/index.tsx b/x-pack/legacy/plugins/siem/public/containers/network_dns/index.tsx index 04c8783c30a0ff..060b66fc3cbbef 100644 --- a/x-pack/legacy/plugins/siem/public/containers/network_dns/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/network_dns/index.tsx @@ -12,7 +12,7 @@ import { compose } from 'redux'; import { DocumentNode } from 'graphql'; import { ScaleType } from '@elastic/charts'; -import { DEFAULT_INDEX_KEY } from '../../../common/constants'; +import { DEFAULT_INDEX_KEY } from '../../../../../../plugins/siem/common/constants'; import { GetNetworkDnsQuery, NetworkDnsEdges, diff --git a/x-pack/legacy/plugins/siem/public/containers/network_http/index.tsx b/x-pack/legacy/plugins/siem/public/containers/network_http/index.tsx index bf4e64f63d5599..b13637fa88d07b 100644 --- a/x-pack/legacy/plugins/siem/public/containers/network_http/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/network_http/index.tsx @@ -10,7 +10,7 @@ import { Query } from 'react-apollo'; import { connect } from 'react-redux'; import { compose } from 'redux'; -import { DEFAULT_INDEX_KEY } from '../../../common/constants'; +import { DEFAULT_INDEX_KEY } from '../../../../../../plugins/siem/common/constants'; import { GetNetworkHttpQuery, NetworkHttpEdges, diff --git a/x-pack/legacy/plugins/siem/public/containers/network_top_countries/index.tsx b/x-pack/legacy/plugins/siem/public/containers/network_top_countries/index.tsx index bd1e1a002bbcdc..17a14ce3a11205 100644 --- a/x-pack/legacy/plugins/siem/public/containers/network_top_countries/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/network_top_countries/index.tsx @@ -10,7 +10,7 @@ import { Query } from 'react-apollo'; import { connect } from 'react-redux'; import { compose } from 'redux'; -import { DEFAULT_INDEX_KEY } from '../../../common/constants'; +import { DEFAULT_INDEX_KEY } from '../../../../../../plugins/siem/common/constants'; import { FlowTargetSourceDest, GetNetworkTopCountriesQuery, diff --git a/x-pack/legacy/plugins/siem/public/containers/network_top_n_flow/index.tsx b/x-pack/legacy/plugins/siem/public/containers/network_top_n_flow/index.tsx index f0f1f8257f29f1..fdac282292a4bc 100644 --- a/x-pack/legacy/plugins/siem/public/containers/network_top_n_flow/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/network_top_n_flow/index.tsx @@ -10,7 +10,7 @@ import { Query } from 'react-apollo'; import { connect } from 'react-redux'; import { compose } from 'redux'; -import { DEFAULT_INDEX_KEY } from '../../../common/constants'; +import { DEFAULT_INDEX_KEY } from '../../../../../../plugins/siem/common/constants'; import { FlowTargetSourceDest, GetNetworkTopNFlowQuery, diff --git a/x-pack/legacy/plugins/siem/public/containers/overview/overview_host/index.tsx b/x-pack/legacy/plugins/siem/public/containers/overview/overview_host/index.tsx index 2dd9ccf24d802f..e7b68bf557a219 100644 --- a/x-pack/legacy/plugins/siem/public/containers/overview/overview_host/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/overview/overview_host/index.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { Query } from 'react-apollo'; import { connect, ConnectedProps } from 'react-redux'; -import { DEFAULT_INDEX_KEY } from '../../../../common/constants'; +import { DEFAULT_INDEX_KEY } from '../../../../../../../plugins/siem/common/constants'; import { GetOverviewHostQuery, OverviewHostData } from '../../../graphql/types'; import { useUiSetting } from '../../../lib/kibana'; import { inputsModel, inputsSelectors } from '../../../store/inputs'; diff --git a/x-pack/legacy/plugins/siem/public/containers/overview/overview_network/index.tsx b/x-pack/legacy/plugins/siem/public/containers/overview/overview_network/index.tsx index d0acd41c224a5f..c7f72ac6193f40 100644 --- a/x-pack/legacy/plugins/siem/public/containers/overview/overview_network/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/overview/overview_network/index.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { Query } from 'react-apollo'; import { connect, ConnectedProps } from 'react-redux'; -import { DEFAULT_INDEX_KEY } from '../../../../common/constants'; +import { DEFAULT_INDEX_KEY } from '../../../../../../../plugins/siem/common/constants'; import { GetOverviewNetworkQuery, OverviewNetworkData } from '../../../graphql/types'; import { useUiSetting } from '../../../lib/kibana'; import { State } from '../../../store'; diff --git a/x-pack/legacy/plugins/siem/public/containers/query_template.tsx b/x-pack/legacy/plugins/siem/public/containers/query_template.tsx index dfb452c24b86e5..c33f5fd89a79b4 100644 --- a/x-pack/legacy/plugins/siem/public/containers/query_template.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/query_template.tsx @@ -8,7 +8,7 @@ import { ApolloQueryResult } from 'apollo-client'; import React from 'react'; import { FetchMoreOptions, FetchMoreQueryOptions, OperationVariables } from 'react-apollo'; -import { ESQuery } from '../../common/typed_json'; +import { ESQuery } from '../../../../../plugins/siem/common/typed_json'; export interface QueryTemplateProps { id?: string; diff --git a/x-pack/legacy/plugins/siem/public/containers/query_template_paginated.tsx b/x-pack/legacy/plugins/siem/public/containers/query_template_paginated.tsx index db618f216d83e7..45041a64476118 100644 --- a/x-pack/legacy/plugins/siem/public/containers/query_template_paginated.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/query_template_paginated.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { FetchMoreOptions, FetchMoreQueryOptions, OperationVariables } from 'react-apollo'; import deepEqual from 'fast-deep-equal'; -import { ESQuery } from '../../common/typed_json'; +import { ESQuery } from '../../../../../plugins/siem/common/typed_json'; import { inputsModel } from '../store/model'; import { generateTablePaginationOptions } from '../components/paginated_table/helpers'; diff --git a/x-pack/legacy/plugins/siem/public/containers/source/index.tsx b/x-pack/legacy/plugins/siem/public/containers/source/index.tsx index e454421ca955d6..3467e2b5f18d84 100644 --- a/x-pack/legacy/plugins/siem/public/containers/source/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/source/index.tsx @@ -11,9 +11,9 @@ import React, { useEffect, useMemo, useState } from 'react'; import memoizeOne from 'memoize-one'; import { IIndexPattern } from 'src/plugins/data/public'; +import { DEFAULT_INDEX_KEY } from '../../../../../../plugins/siem/common/constants'; import { useUiSetting$ } from '../../lib/kibana'; -import { DEFAULT_INDEX_KEY } from '../../../common/constants'; import { IndexField, SourceQuery } from '../../graphql/types'; import { sourceQuery } from './index.gql_query'; diff --git a/x-pack/legacy/plugins/siem/public/containers/source/mock.ts b/x-pack/legacy/plugins/siem/public/containers/source/mock.ts index 738c1681f40afe..805c69f7fcc12a 100644 --- a/x-pack/legacy/plugins/siem/public/containers/source/mock.ts +++ b/x-pack/legacy/plugins/siem/public/containers/source/mock.ts @@ -4,9 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ +import { DEFAULT_INDEX_PATTERN } from '../../../../../../plugins/siem/common/constants'; + import { BrowserFields } from '.'; import { sourceQuery } from './index.gql_query'; -import { defaultIndexPattern } from '../../../default_index_pattern'; export const mocksSource = [ { @@ -14,7 +15,7 @@ export const mocksSource = [ query: sourceQuery, variables: { sourceId: 'default', - defaultIndex: defaultIndexPattern, + defaultIndex: DEFAULT_INDEX_PATTERN, }, }, result: { @@ -333,7 +334,7 @@ export const mocksSource = [ 'event.end contains the date when the event ended or when the activity was last observed.', example: null, format: '', - indexes: defaultIndexPattern, + indexes: DEFAULT_INDEX_PATTERN, name: 'event.end', searchable: true, type: 'date', @@ -661,7 +662,7 @@ export const mockBrowserFields: BrowserFields = { 'event.end contains the date when the event ended or when the activity was last observed.', example: null, format: '', - indexes: defaultIndexPattern, + indexes: DEFAULT_INDEX_PATTERN, name: 'event.end', searchable: true, type: 'date', diff --git a/x-pack/legacy/plugins/siem/public/containers/timeline/all/api.ts b/x-pack/legacy/plugins/siem/public/containers/timeline/all/api.ts index 4c8e2384de5858..32ac62d594e1c9 100644 --- a/x-pack/legacy/plugins/siem/public/containers/timeline/all/api.ts +++ b/x-pack/legacy/plugins/siem/public/containers/timeline/all/api.ts @@ -4,9 +4,12 @@ * you may not use this file except in compliance with the Elastic License. */ +import { + TIMELINE_IMPORT_URL, + TIMELINE_EXPORT_URL, +} from '../../../../../../../plugins/siem/common/constants'; import { ImportDataProps, ImportDataResponse } from '../../detection_engine/rules'; import { KibanaServices } from '../../../lib/kibana'; -import { TIMELINE_IMPORT_URL, TIMELINE_EXPORT_URL } from '../../../../common/constants'; import { ExportSelectedData } from '../../../components/generic_downloader'; export const importTimelines = async ({ diff --git a/x-pack/legacy/plugins/siem/public/containers/timeline/details/index.tsx b/x-pack/legacy/plugins/siem/public/containers/timeline/details/index.tsx index cf1b8954307e7b..0debed9c5f9aae 100644 --- a/x-pack/legacy/plugins/siem/public/containers/timeline/details/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/timeline/details/index.tsx @@ -9,7 +9,7 @@ import memoizeOne from 'memoize-one'; import React from 'react'; import { Query } from 'react-apollo'; -import { DEFAULT_INDEX_KEY } from '../../../../common/constants'; +import { DEFAULT_INDEX_KEY } from '../../../../../../../plugins/siem/common/constants'; import { DetailItem, GetTimelineDetailsQuery } from '../../../graphql/types'; import { useUiSetting } from '../../../lib/kibana'; diff --git a/x-pack/legacy/plugins/siem/public/containers/timeline/index.tsx b/x-pack/legacy/plugins/siem/public/containers/timeline/index.tsx index f726ec9779dc8d..3c089ef6926dde 100644 --- a/x-pack/legacy/plugins/siem/public/containers/timeline/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/timeline/index.tsx @@ -11,8 +11,8 @@ import { Query } from 'react-apollo'; import { compose, Dispatch } from 'redux'; import { connect, ConnectedProps } from 'react-redux'; +import { DEFAULT_INDEX_KEY } from '../../../../../../plugins/siem/common/constants'; import { IIndexPattern } from '../../../../../../../src/plugins/data/common/index_patterns'; -import { DEFAULT_INDEX_KEY } from '../../../common/constants'; import { GetTimelineQuery, PageInfo, diff --git a/x-pack/legacy/plugins/siem/public/containers/tls/index.tsx b/x-pack/legacy/plugins/siem/public/containers/tls/index.tsx index 3738355c8846eb..20617b88bda941 100644 --- a/x-pack/legacy/plugins/siem/public/containers/tls/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/tls/index.tsx @@ -10,7 +10,7 @@ import { Query } from 'react-apollo'; import { connect } from 'react-redux'; import { compose } from 'redux'; -import { DEFAULT_INDEX_KEY } from '../../../common/constants'; +import { DEFAULT_INDEX_KEY } from '../../../../../../plugins/siem/common/constants'; import { PageInfoPaginated, TlsEdges, diff --git a/x-pack/legacy/plugins/siem/public/containers/uncommon_processes/index.tsx b/x-pack/legacy/plugins/siem/public/containers/uncommon_processes/index.tsx index 0a2ce67d9be805..72e4e46bc6ae03 100644 --- a/x-pack/legacy/plugins/siem/public/containers/uncommon_processes/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/uncommon_processes/index.tsx @@ -10,7 +10,7 @@ import { Query } from 'react-apollo'; import { connect, ConnectedProps } from 'react-redux'; import { compose } from 'redux'; -import { DEFAULT_INDEX_KEY } from '../../../common/constants'; +import { DEFAULT_INDEX_KEY } from '../../../../../../plugins/siem/common/constants'; import { GetUncommonProcessesQuery, PageInfoPaginated, diff --git a/x-pack/legacy/plugins/siem/public/containers/users/index.tsx b/x-pack/legacy/plugins/siem/public/containers/users/index.tsx index 5f71449c524606..658cb5785b54c6 100644 --- a/x-pack/legacy/plugins/siem/public/containers/users/index.tsx +++ b/x-pack/legacy/plugins/siem/public/containers/users/index.tsx @@ -10,7 +10,7 @@ import { Query } from 'react-apollo'; import { connect, ConnectedProps } from 'react-redux'; import { compose } from 'redux'; -import { DEFAULT_INDEX_KEY } from '../../../common/constants'; +import { DEFAULT_INDEX_KEY } from '../../../../../../plugins/siem/common/constants'; import { GetUsersQuery, FlowTarget, PageInfoPaginated, UsersEdges } from '../../graphql/types'; import { inputsModel, networkModel, networkSelectors, State, inputsSelectors } from '../../store'; import { withKibana, WithKibanaProps } from '../../lib/kibana'; diff --git a/x-pack/legacy/plugins/siem/public/lib/kibana/hooks.ts b/x-pack/legacy/plugins/siem/public/lib/kibana/hooks.ts index 775a7d7c0acca2..e1d0a445bf2fb0 100644 --- a/x-pack/legacy/plugins/siem/public/lib/kibana/hooks.ts +++ b/x-pack/legacy/plugins/siem/public/lib/kibana/hooks.ts @@ -8,7 +8,10 @@ import moment from 'moment-timezone'; import { useCallback, useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { DEFAULT_DATE_FORMAT, DEFAULT_DATE_FORMAT_TZ } from '../../../common/constants'; +import { + DEFAULT_DATE_FORMAT, + DEFAULT_DATE_FORMAT_TZ, +} from '../../../../../../plugins/siem/common/constants'; import { useUiSetting, useKibana } from './kibana_react'; import { errorToToaster, useStateToaster } from '../../components/toasters'; import { AuthenticatedUser } from '../../../../../../plugins/security/common/model'; diff --git a/x-pack/legacy/plugins/siem/public/lib/theme/use_eui_theme.tsx b/x-pack/legacy/plugins/siem/public/lib/theme/use_eui_theme.tsx index 1696001203bc87..b72c34d3b59a71 100644 --- a/x-pack/legacy/plugins/siem/public/lib/theme/use_eui_theme.tsx +++ b/x-pack/legacy/plugins/siem/public/lib/theme/use_eui_theme.tsx @@ -7,7 +7,7 @@ import darkTheme from '@elastic/eui/dist/eui_theme_dark.json'; import lightTheme from '@elastic/eui/dist/eui_theme_light.json'; -import { DEFAULT_DARK_MODE } from '../../../common/constants'; +import { DEFAULT_DARK_MODE } from '../../../../../../plugins/siem/common/constants'; import { useUiSetting$ } from '../kibana'; export const useEuiTheme = () => { diff --git a/x-pack/legacy/plugins/siem/public/mock/global_state.ts b/x-pack/legacy/plugins/siem/public/mock/global_state.ts index 6678c3043a3da4..266c3aadea8af1 100644 --- a/x-pack/legacy/plugins/siem/public/mock/global_state.ts +++ b/x-pack/legacy/plugins/siem/public/mock/global_state.ts @@ -22,7 +22,7 @@ import { DEFAULT_TO, DEFAULT_INTERVAL_TYPE, DEFAULT_INTERVAL_VALUE, -} from '../../common/constants'; +} from '../../../../../plugins/siem/common/constants'; export const mockGlobalState: State = { app: { diff --git a/x-pack/legacy/plugins/siem/public/mock/kibana_react.ts b/x-pack/legacy/plugins/siem/public/mock/kibana_react.ts index 968ab6543f4fc5..db7a931b3fb153 100644 --- a/x-pack/legacy/plugins/siem/public/mock/kibana_react.ts +++ b/x-pack/legacy/plugins/siem/public/mock/kibana_react.ts @@ -23,8 +23,8 @@ import { DEFAULT_INTERVAL_PAUSE, DEFAULT_INTERVAL_VALUE, DEFAULT_BYTES_FORMAT, -} from '../../common/constants'; -import { defaultIndexPattern } from '../../default_index_pattern'; + DEFAULT_INDEX_PATTERN, +} from '../../../../../plugins/siem/common/constants'; import { createKibanaCoreStartMock, createKibanaPluginsStartMock } from './kibana_core'; // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -39,7 +39,7 @@ export const mockUiSettings: Record = { pause: DEFAULT_INTERVAL_PAUSE, value: DEFAULT_INTERVAL_VALUE, }, - [DEFAULT_INDEX_KEY]: defaultIndexPattern, + [DEFAULT_INDEX_KEY]: DEFAULT_INDEX_PATTERN, [DEFAULT_BYTES_FORMAT]: '0,0.[0]b', [DEFAULT_DATE_FORMAT_TZ]: 'UTC', [DEFAULT_DATE_FORMAT]: 'MMM D, YYYY @ HH:mm:ss.SSS', diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/components/signals/signals_utility_bar/index.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/components/signals/signals_utility_bar/index.tsx index 2000a699ab18d2..847fcc78600851 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/components/signals/signals_utility_bar/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/components/signals/signals_utility_bar/index.tsx @@ -7,6 +7,8 @@ import { isEmpty } from 'lodash/fp'; import React, { useCallback } from 'react'; import numeral from '@elastic/numeral'; + +import { DEFAULT_NUMBER_FORMAT } from '../../../../../../../../../plugins/siem/common/constants'; import { UtilityBar, UtilityBarAction, @@ -16,7 +18,6 @@ import { } from '../../../../../components/utility_bar'; import * as i18n from './translations'; import { useUiSetting$ } from '../../../../../lib/kibana'; -import { DEFAULT_NUMBER_FORMAT } from '../../../../../../common/constants'; import { TimelineNonEcsData } from '../../../../../graphql/types'; import { UpdateSignalsStatus } from '../types'; import { FILTER_CLOSED, FILTER_OPEN } from '../signals_filter_group'; diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/components/signals_histogram_panel/helpers.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/components/signals_histogram_panel/helpers.tsx index 5c89a7e25b7a41..90bdd39e4a6faf 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/components/signals_histogram_panel/helpers.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/components/signals_histogram_panel/helpers.tsx @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +import { showAllOthersBucket } from '../../../../../../../../plugins/siem/common/constants'; import { HistogramData, SignalsAggregation, SignalsBucket, SignalsGroupBucket } from './types'; -import { showAllOthersBucket } from '../../../../../common/constants'; import { SignalSearchResponse } from '../../../../containers/detection_engine/signals/types'; import * as i18n from './translations'; diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/components/signals_histogram_panel/index.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/components/signals_histogram_panel/index.tsx index f2d722e5a66d74..e70ba804ec0187 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/components/signals_histogram_panel/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/components/signals_histogram_panel/index.tsx @@ -11,11 +11,11 @@ import styled from 'styled-components'; import { isEmpty } from 'lodash/fp'; import uuid from 'uuid'; +import { DEFAULT_NUMBER_FORMAT } from '../../../../../../../../plugins/siem/common/constants'; import { LegendItem } from '../../../../components/charts/draggable_legend_item'; import { escapeDataProviderId } from '../../../../components/drag_and_drop/helpers'; import { HeaderSection } from '../../../../components/header_section'; import { Filter, esQuery, Query } from '../../../../../../../../../src/plugins/data/public'; -import { DEFAULT_NUMBER_FORMAT } from '../../../../../common/constants'; import { useQuerySignals } from '../../../../containers/detection_engine/signals/use_query'; import { getDetectionEngineUrl } from '../../../../components/link_to'; import { defaultLegendColors } from '../../../../components/matrix_histogram/utils'; 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 80e644f800334a..8bea504f842065 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 @@ -19,6 +19,7 @@ import { FormattedRelative } from '@kbn/i18n/react'; import * as H from 'history'; import React, { Dispatch } from 'react'; +import { isMlRule } from '../../../../../../../../plugins/siem/common/detection_engine/ml_helpers'; import { Rule, RuleStatus } from '../../../../containers/detection_engine/rules'; import { getEmptyTagValue } from '../../../../components/empty_value'; import { FormattedDate } from '../../../../components/formatted_date'; @@ -38,7 +39,6 @@ import { import { Action } from './reducer'; import { LocalizedDateTooltip } from '../../../../components/localized_date_tooltip'; import * as detectionI18n from '../../translations'; -import { isMlRule } from '../../../../../common/detection_engine/ml_helpers'; export const getActions = ( dispatch: React.Dispatch, diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/description_step/helpers.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/description_step/helpers.tsx index 79da7999b081a4..5b7a85e23834d0 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/description_step/helpers.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/description_step/helpers.tsx @@ -19,9 +19,9 @@ import { isEmpty } from 'lodash/fp'; import React from 'react'; import styled from 'styled-components'; +import { RuleType } from '../../../../../../../../../plugins/siem/common/detection_engine/types'; import { esFilters } from '../../../../../../../../../../src/plugins/data/public'; -import { RuleType } from '../../../../../../common/detection_engine/types'; import { tacticsOptions, techniquesOptions } from '../../../mitre/mitre_tactics_techniques'; import * as i18n from './translations'; diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/description_step/index.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/description_step/index.tsx index 05e47225c8f4b4..49977713a585ad 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/description_step/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/description_step/index.tsx @@ -9,13 +9,13 @@ import { isEmpty, chunk, get, pick, isNumber } from 'lodash/fp'; import React, { memo, useState } from 'react'; import styled from 'styled-components'; +import { RuleType } from '../../../../../../../../../plugins/siem/common/detection_engine/types'; import { IIndexPattern, Filter, esFilters, FilterManager, } from '../../../../../../../../../../src/plugins/data/public'; -import { RuleType } from '../../../../../../common/detection_engine/types'; import { DEFAULT_TIMELINE_TITLE } from '../../../../../components/timeline/translations'; import { useKibana } from '../../../../../lib/kibana'; import { IMitreEnterpriseAttack } from '../../types'; diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/description_step/ml_job_description.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/description_step/ml_job_description.tsx index 1664ea320bc1e8..5e8681a90d428b 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/description_step/ml_job_description.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/description_step/ml_job_description.tsx @@ -8,11 +8,11 @@ import React from 'react'; import styled from 'styled-components'; import { EuiBadge, EuiIcon, EuiLink, EuiToolTip } from '@elastic/eui'; +import { isJobStarted } from '../../../../../../../../../plugins/siem/common/detection_engine/ml_helpers'; import { useKibana } from '../../../../../lib/kibana'; import { SiemJob } from '../../../../../components/ml_popover/types'; import { ListItems } from './types'; import { ML_JOB_STARTED, ML_JOB_STOPPED } from './translations'; -import { isJobStarted } from '../../../../../../common/detection_engine/ml_helpers'; enum MessageLevels { info = 'info', diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/ml_job_select/index.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/ml_job_select/index.tsx index 794edf0ab5de71..82350150488d05 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/ml_job_select/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/ml_job_select/index.tsx @@ -17,6 +17,7 @@ import { } from '@elastic/eui'; import styled from 'styled-components'; +import { isJobStarted } from '../../../../../../../../../plugins/siem/common/detection_engine/ml_helpers'; import { FieldHook, getFieldValidityAndErrorMessage } from '../../../../../shared_imports'; import { useSiemJobs } from '../../../../../components/ml_popover/hooks/use_siem_jobs'; import { useKibana } from '../../../../../lib/kibana'; @@ -24,7 +25,6 @@ import { ML_JOB_SELECT_PLACEHOLDER_TEXT, ENABLE_ML_JOB_WARNING, } from '../step_define_rule/translations'; -import { isJobStarted } from '../../../../../../common/detection_engine/ml_helpers'; const HelpTextWarningContainer = styled.div` margin-top: 10px; diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/rule_actions_field/index.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/rule_actions_field/index.tsx index a746d381c494c4..b4d813c48b43f2 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/rule_actions_field/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/rule_actions_field/index.tsx @@ -7,6 +7,7 @@ import React, { useCallback, useEffect, useState } from 'react'; import deepMerge from 'deepmerge'; +import { NOTIFICATION_SUPPORTED_ACTION_TYPES_IDS } from '../../../../../../../../../plugins/siem/common/constants'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths import { loadActionTypes } from '../../../../../../../../../plugins/triggers_actions_ui/public/application/lib/action_connector_api'; import { SelectField } from '../../../../../shared_imports'; @@ -16,7 +17,6 @@ import { } from '../../../../../../../../../plugins/triggers_actions_ui/public'; import { AlertAction } from '../../../../../../../../../plugins/alerting/common'; import { useKibana } from '../../../../../lib/kibana'; -import { NOTIFICATION_SUPPORTED_ACTION_TYPES_IDS } from '../../../../../../common/constants'; type ThrottleSelectField = typeof SelectField; diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/select_rule_type/index.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/select_rule_type/index.tsx index 6f3d299da8d452..2b1e5a367a9651 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/select_rule_type/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/select_rule_type/index.tsx @@ -16,8 +16,8 @@ import { EuiText, } from '@elastic/eui'; -import { isMlRule } from '../../../../../../common/detection_engine/ml_helpers'; -import { RuleType } from '../../../../../../common/detection_engine/types'; +import { isMlRule } from '../../../../../../../../../plugins/siem/common/detection_engine/ml_helpers'; +import { RuleType } from '../../../../../../../../../plugins/siem/common/detection_engine/types'; import { FieldHook } from '../../../../../shared_imports'; import { useKibana } from '../../../../../lib/kibana'; import * as i18n from './translations'; diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/step_define_rule/index.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/step_define_rule/index.tsx index 05043e5b96a30e..be9e919b806b5f 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/step_define_rule/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/step_define_rule/index.tsx @@ -9,10 +9,10 @@ import React, { FC, memo, useCallback, useState, useEffect } from 'react'; import styled from 'styled-components'; import deepEqual from 'fast-deep-equal'; +import { DEFAULT_INDEX_KEY } from '../../../../../../../../../plugins/siem/common/constants'; +import { isMlRule } from '../../../../../../../../../plugins/siem/common/detection_engine/ml_helpers'; import { IIndexPattern } from '../../../../../../../../../../src/plugins/data/public'; import { useFetchIndexPatterns } from '../../../../../containers/detection_engine/rules'; -import { DEFAULT_INDEX_KEY } from '../../../../../../common/constants'; -import { isMlRule } from '../../../../../../common/detection_engine/ml_helpers'; import { DEFAULT_TIMELINE_TITLE } from '../../../../../components/timeline/translations'; import { useMlCapabilities } from '../../../../../components/ml_popover/hooks/use_ml_capabilities'; import { useUiSetting$ } from '../../../../../lib/kibana'; diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/step_define_rule/schema.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/step_define_rule/schema.tsx index 4a132f94a9871e..629c6758a14147 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/step_define_rule/schema.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/step_define_rule/schema.tsx @@ -9,8 +9,8 @@ import { EuiText } from '@elastic/eui'; import { isEmpty } from 'lodash/fp'; import React from 'react'; +import { isMlRule } from '../../../../../../../../../plugins/siem/common/detection_engine/ml_helpers'; import { esKuery } from '../../../../../../../../../../src/plugins/data/public'; -import { isMlRule } from '../../../../../../common/detection_engine/ml_helpers'; import { FieldValueQueryBar } from '../query_bar'; import { ERROR_CODE, diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/throttle_select_field/index.tsx b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/throttle_select_field/index.tsx index 0cf15c41a0f913..3b297a623e34d5 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/throttle_select_field/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/components/throttle_select_field/index.tsx @@ -9,7 +9,7 @@ import React, { useCallback } from 'react'; import { NOTIFICATION_THROTTLE_RULE, NOTIFICATION_THROTTLE_NO_ACTIONS, -} from '../../../../../../common/constants'; +} from '../../../../../../../../../plugins/siem/common/constants'; import { SelectField } from '../../../../../shared_imports'; export const THROTTLE_OPTIONS = [ diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/create/helpers.ts b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/create/helpers.ts index 7ad116c313361d..a65e8178f75c42 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/create/helpers.ts +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/create/helpers.ts @@ -8,10 +8,10 @@ import { has, isEmpty } from 'lodash/fp'; import moment from 'moment'; import deepmerge from 'deepmerge'; -import { NOTIFICATION_THROTTLE_NO_ACTIONS } from '../../../../../common/constants'; -import { transformAlertToRuleAction } from '../../../../../common/detection_engine/transform_actions'; -import { RuleType } from '../../../../../common/detection_engine/types'; -import { isMlRule } from '../../../../../common/detection_engine/ml_helpers'; +import { NOTIFICATION_THROTTLE_NO_ACTIONS } from '../../../../../../../../plugins/siem/common/constants'; +import { transformAlertToRuleAction } from '../../../../../../../../plugins/siem/common/detection_engine/transform_actions'; +import { RuleType } from '../../../../../../../../plugins/siem/common/detection_engine/types'; +import { isMlRule } from '../../../../../../../../plugins/siem/common/detection_engine/ml_helpers'; import { NewRule } from '../../../../containers/detection_engine/rules'; import { 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 58a1b0fd3133e6..7bea41c2ab4d54 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 @@ -10,9 +10,12 @@ import moment from 'moment'; import memoizeOne from 'memoize-one'; import { useLocation } from 'react-router-dom'; -import { RuleAlertAction, RuleType } from '../../../../common/detection_engine/types'; -import { isMlRule } from '../../../../common/detection_engine/ml_helpers'; -import { transformRuleToAlertAction } from '../../../../common/detection_engine/transform_actions'; +import { + RuleAlertAction, + RuleType, +} from '../../../../../../../plugins/siem/common/detection_engine/types'; +import { isMlRule } from '../../../../../../../plugins/siem/common/detection_engine/ml_helpers'; +import { transformRuleToAlertAction } from '../../../../../../../plugins/siem/common/detection_engine/transform_actions'; import { Filter } from '../../../../../../../../src/plugins/data/public'; import { Rule } from '../../../containers/detection_engine/rules'; import { FormData, FormHook, FormSchema } from '../../../shared_imports'; diff --git a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/types.ts b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/types.ts index 1c366e6640b29c..380ef521903490 100644 --- a/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/types.ts +++ b/x-pack/legacy/plugins/siem/public/pages/detection_engine/rules/types.ts @@ -4,8 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ +import { + RuleAlertAction, + RuleType, +} from '../../../../../../../plugins/siem/common/detection_engine/types'; import { AlertAction } from '../../../../../../../plugins/alerting/common'; -import { RuleAlertAction, RuleType } from '../../../../common/detection_engine/types'; import { Filter } from '../../../../../../../../src/plugins/data/common'; import { FieldValueQueryBar } from './components/query_bar'; import { FormData, FormHook } from '../../../shared_imports'; diff --git a/x-pack/legacy/plugins/siem/public/pages/hosts/navigation/types.ts b/x-pack/legacy/plugins/siem/public/pages/hosts/navigation/types.ts index cb5fc62b965828..207b86fee02b93 100644 --- a/x-pack/legacy/plugins/siem/public/pages/hosts/navigation/types.ts +++ b/x-pack/legacy/plugins/siem/public/pages/hosts/navigation/types.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ +import { ESTermQuery } from '../../../../../../../plugins/siem/common/typed_json'; import { Filter, IIndexPattern } from '../../../../../../../../src/plugins/data/public'; import { NarrowDateRange } from '../../../components/ml/types'; -import { ESTermQuery } from '../../../../common/typed_json'; import { InspectQuery, Refetch } from '../../../store/inputs/model'; import { HostsTableType, HostsType } from '../../../store/hosts/model'; diff --git a/x-pack/legacy/plugins/siem/public/pages/network/ip_details/types.ts b/x-pack/legacy/plugins/siem/public/pages/network/ip_details/types.ts index ef989fb64eabee..efd9c644ec6b6f 100644 --- a/x-pack/legacy/plugins/siem/public/pages/network/ip_details/types.ts +++ b/x-pack/legacy/plugins/siem/public/pages/network/ip_details/types.ts @@ -6,8 +6,8 @@ import { IIndexPattern } from 'src/plugins/data/public'; +import { ESTermQuery } from '../../../../../../../plugins/siem/common/typed_json'; import { NetworkType } from '../../../store/network/model'; -import { ESTermQuery } from '../../../../common/typed_json'; import { InspectQuery, Refetch } from '../../../store/inputs/model'; import { FlowTarget, FlowTargetSourceDest } from '../../../graphql/types'; import { GlobalTimeArgs } from '../../../containers/global_time'; diff --git a/x-pack/legacy/plugins/siem/public/pages/network/navigation/types.ts b/x-pack/legacy/plugins/siem/public/pages/network/navigation/types.ts index 222a99992917d3..90c18b6ff69f46 100644 --- a/x-pack/legacy/plugins/siem/public/pages/network/navigation/types.ts +++ b/x-pack/legacy/plugins/siem/public/pages/network/navigation/types.ts @@ -4,12 +4,12 @@ * you may not use this file except in compliance with the Elastic License. */ +import { ESTermQuery } from '../../../../../../../plugins/siem/common/typed_json'; import { IIndexPattern } from '../../../../../../../../src/plugins/data/common/'; import { NavTab } from '../../../components/navigation/types'; import { FlowTargetSourceDest } from '../../../graphql/types'; import { networkModel } from '../../../store'; -import { ESTermQuery } from '../../../../common/typed_json'; import { GlobalTimeArgs } from '../../../containers/global_time'; import { SetAbsoluteRangeDatePicker } from '../types'; diff --git a/x-pack/legacy/plugins/siem/public/pages/overview/alerts_by_category/index.tsx b/x-pack/legacy/plugins/siem/public/pages/overview/alerts_by_category/index.tsx index 744102fbac4b39..8e09572cb27966 100644 --- a/x-pack/legacy/plugins/siem/public/pages/overview/alerts_by_category/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/overview/alerts_by_category/index.tsx @@ -7,9 +7,9 @@ import { EuiButton } from '@elastic/eui'; import numeral from '@elastic/numeral'; import React, { useEffect, useMemo } from 'react'; - import { Position } from '@elastic/charts'; -import { DEFAULT_NUMBER_FORMAT } from '../../../../common/constants'; + +import { DEFAULT_NUMBER_FORMAT } from '../../../../../../../plugins/siem/common/constants'; import { SHOWING, UNIT } from '../../../components/alerts_viewer/translations'; import { getDetectionEngineAlertUrl } from '../../../components/link_to/redirect_to_detection_engine'; import { MatrixHistogramContainer } from '../../../components/matrix_histogram'; diff --git a/x-pack/legacy/plugins/siem/public/pages/overview/events_by_dataset/index.tsx b/x-pack/legacy/plugins/siem/public/pages/overview/events_by_dataset/index.tsx index 485fec31db240b..14cc29adb505a4 100644 --- a/x-pack/legacy/plugins/siem/public/pages/overview/events_by_dataset/index.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/overview/events_by_dataset/index.tsx @@ -10,7 +10,7 @@ import numeral from '@elastic/numeral'; import React, { useEffect, useMemo } from 'react'; import uuid from 'uuid'; -import { DEFAULT_NUMBER_FORMAT } from '../../../../common/constants'; +import { DEFAULT_NUMBER_FORMAT } from '../../../../../../../plugins/siem/common/constants'; import { SHOWING, UNIT } from '../../../components/events_viewer/translations'; import { getTabsOnHostsUrl } from '../../../components/link_to/redirect_to_hosts'; import { MatrixHistogramContainer } from '../../../components/matrix_histogram'; diff --git a/x-pack/legacy/plugins/siem/public/pages/overview/sidebar/sidebar.tsx b/x-pack/legacy/plugins/siem/public/pages/overview/sidebar/sidebar.tsx index 52e36b472a0ec2..4d4d96803cd658 100644 --- a/x-pack/legacy/plugins/siem/public/pages/overview/sidebar/sidebar.tsx +++ b/x-pack/legacy/plugins/siem/public/pages/overview/sidebar/sidebar.tsx @@ -8,9 +8,12 @@ import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; import React, { useMemo } from 'react'; import styled from 'styled-components'; +import { + ENABLE_NEWS_FEED_SETTING, + NEWS_FEED_URL_SETTING, +} from '../../../../../../../plugins/siem/common/constants'; import { Filters as RecentCasesFilters } from '../../../components/recent_cases/filters'; import { Filters as RecentTimelinesFilters } from '../../../components/recent_timelines/filters'; -import { ENABLE_NEWS_FEED_SETTING, NEWS_FEED_URL_SETTING } from '../../../../common/constants'; import { StatefulRecentCases } from '../../../components/recent_cases'; import { StatefulRecentTimelines } from '../../../components/recent_timelines'; import { StatefulNewsFeed } from '../../../components/news_feed'; diff --git a/x-pack/legacy/plugins/siem/public/register_feature.ts b/x-pack/legacy/plugins/siem/public/register_feature.ts index ca7a22408b6ff2..b5e8f78ebc560f 100644 --- a/x-pack/legacy/plugins/siem/public/register_feature.ts +++ b/x-pack/legacy/plugins/siem/public/register_feature.ts @@ -6,7 +6,7 @@ import { npSetup } from 'ui/new_platform'; import { FeatureCatalogueCategory } from '../../../../../src/plugins/home/public'; -import { APP_ID } from '../common/constants'; +import { APP_ID } from '../../../../plugins/siem/common/constants'; // TODO(rylnd): move this into Plugin.setup once we're on NP npSetup.plugins.home.featureCatalogue.register({ diff --git a/x-pack/legacy/plugins/siem/public/store/inputs/model.ts b/x-pack/legacy/plugins/siem/public/store/inputs/model.ts index 04facf3b98c3bb..e851caf523eb4b 100644 --- a/x-pack/legacy/plugins/siem/public/store/inputs/model.ts +++ b/x-pack/legacy/plugins/siem/public/store/inputs/model.ts @@ -5,7 +5,6 @@ */ import { Dispatch } from 'redux'; -import { Omit } from '../../../common/utility_types'; import { InputsModelId } from './constants'; import { CONSTANTS } from '../../components/url_state/constants'; import { Query, Filter, SavedQuery } from '../../../../../../../src/plugins/data/public'; diff --git a/x-pack/legacy/plugins/siem/public/utils/default_date_settings.test.ts b/x-pack/legacy/plugins/siem/public/utils/default_date_settings.test.ts index 9dc179ba7a6e2d..bb66067512d1fd 100644 --- a/x-pack/legacy/plugins/siem/public/utils/default_date_settings.test.ts +++ b/x-pack/legacy/plugins/siem/public/utils/default_date_settings.test.ts @@ -21,7 +21,7 @@ import { DEFAULT_INTERVAL_PAUSE, DEFAULT_INTERVAL_VALUE, DEFAULT_INTERVAL_TYPE, -} from '../../common/constants'; +} from '../../../../../plugins/siem/common/constants'; import { KibanaServices } from '../lib/kibana'; import { Policy } from '../store/inputs/model'; @@ -30,7 +30,7 @@ import { Policy } from '../store/inputs/model'; // we have to repeat ourselves once const DEFAULT_FROM_DATE = '1983-05-31T13:03:54.234Z'; const DEFAULT_TO_DATE = '1990-05-31T13:03:54.234Z'; -jest.mock('../../common/constants', () => ({ +jest.mock('../../../../../plugins/siem/common/constants', () => ({ DEFAULT_FROM: '1983-05-31T13:03:54.234Z', DEFAULT_TO: '1990-05-31T13:03:54.234Z', DEFAULT_INTERVAL_PAUSE: true, diff --git a/x-pack/legacy/plugins/siem/public/utils/default_date_settings.ts b/x-pack/legacy/plugins/siem/public/utils/default_date_settings.ts index c4869a4851ae50..89f7d34d851310 100644 --- a/x-pack/legacy/plugins/siem/public/utils/default_date_settings.ts +++ b/x-pack/legacy/plugins/siem/public/utils/default_date_settings.ts @@ -15,7 +15,7 @@ import { DEFAULT_TO, DEFAULT_INTERVAL_TYPE, DEFAULT_INTERVAL_VALUE, -} from '../../common/constants'; +} from '../../../../../plugins/siem/common/constants'; import { KibanaServices } from '../lib/kibana'; import { Policy } from '../store/inputs/model'; diff --git a/x-pack/legacy/plugins/siem/reporter_config.json b/x-pack/legacy/plugins/siem/reporter_config.json deleted file mode 100644 index dda68d501f9756..00000000000000 --- a/x-pack/legacy/plugins/siem/reporter_config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "reporterEnabled": "mochawesome, mocha-junit-reporter", - "reporterOptions": { - "html": false, - "json": true, - "mochaFile": "../../../../target/kibana-siem/cypress/results/TEST-siem-cypress-[hash].xml", - "overwrite": false, - "reportDir": "../../../../target/kibana-siem/cypress/results" - } -} diff --git a/x-pack/legacy/plugins/siem/server/index.ts b/x-pack/legacy/plugins/siem/server/index.ts deleted file mode 100644 index 8513f871cb6c1a..00000000000000 --- a/x-pack/legacy/plugins/siem/server/index.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 { PluginInitializerContext } from '../../../../../src/core/server'; -import { Plugin } from './plugin'; - -export const plugin = (context: PluginInitializerContext) => { - return new Plugin(context); -}; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_list.json b/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_list.json deleted file mode 100644 index 997d03369a699a..00000000000000 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_list.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "Query with a list", - "description": "Query with a list", - "rule_id": "query-with-list", - "risk_score": 1, - "severity": "high", - "type": "query", - "query": "user.name: root or user.name: admin", - "lists": [ - { - "field": "source.ip", - "values_operator": "included", - "values_type": "exists" - }, - { - "field": "host.name", - "values_operator": "excluded", - "values_type": "match", - "values": [ - { - "name": "rock01" - } - ], - "and": [ - { - "field": "host.id", - "values_operator": "included", - "values_type": "match_all", - "values": [ - { - "name": "123" - }, - { - "name": "678" - } - ] - } - ] - } - ] -} diff --git a/x-pack/legacy/plugins/siem/server/plugin.ts b/x-pack/legacy/plugins/siem/server/plugin.ts deleted file mode 100644 index 13b58fa1d57eb3..00000000000000 --- a/x-pack/legacy/plugins/siem/server/plugin.ts +++ /dev/null @@ -1,200 +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 { - PluginStartContract as AlertingStart, - PluginSetupContract as AlertingSetup, -} from '../../../../plugins/alerting/server'; -import { - CoreSetup, - CoreStart, - PluginInitializerContext, - Logger, -} from '../../../../../src/core/server'; -import { SecurityPluginSetup as SecuritySetup } from '../../../../plugins/security/server'; -import { PluginSetupContract as FeaturesSetup } from '../../../../plugins/features/server'; -import { MlPluginSetup as MlSetup } from '../../../../plugins/ml/server'; -import { EncryptedSavedObjectsPluginSetup as EncryptedSavedObjectsSetup } from '../../../../plugins/encrypted_saved_objects/server'; -import { SpacesPluginSetup as SpacesSetup } from '../../../../plugins/spaces/server'; -import { PluginStartContract as ActionsStart } from '../../../../plugins/actions/server'; -import { LicensingPluginSetup } from '../../../../plugins/licensing/server'; -import { LegacyServices } from './types'; -import { initServer } from './init_server'; -import { compose } from './lib/compose/kibana'; -import { initRoutes } from './routes'; -import { isAlertExecutor } from './lib/detection_engine/signals/types'; -import { signalRulesAlertType } from './lib/detection_engine/signals/signal_rule_alert_type'; -import { rulesNotificationAlertType } from './lib/detection_engine/notifications/rules_notification_alert_type'; -import { isNotificationAlertExecutor } from './lib/detection_engine/notifications/types'; -import { - noteSavedObjectType, - pinnedEventSavedObjectType, - timelineSavedObjectType, - ruleStatusSavedObjectType, - ruleActionsSavedObjectType, -} from './saved_objects'; -import { SiemClientFactory } from './client'; -import { hasListsFeature, listsEnvFeatureFlagName } from './lib/detection_engine/feature_flags'; - -export { CoreSetup, CoreStart }; - -export interface SetupPlugins { - alerting: AlertingSetup; - encryptedSavedObjects: EncryptedSavedObjectsSetup; - features: FeaturesSetup; - licensing: LicensingPluginSetup; - security?: SecuritySetup; - spaces?: SpacesSetup; - ml?: MlSetup; -} - -export interface StartPlugins { - actions: ActionsStart; - alerting: AlertingStart; -} - -export class Plugin { - readonly name = 'siem'; - private readonly logger: Logger; - private context: PluginInitializerContext; - private siemClientFactory: SiemClientFactory; - - constructor(context: PluginInitializerContext) { - this.context = context; - this.logger = context.logger.get('plugins', this.name); - this.siemClientFactory = new SiemClientFactory(); - - this.logger.debug('Shim plugin initialized'); - } - - public setup(core: CoreSetup, plugins: SetupPlugins, __legacy: LegacyServices) { - this.logger.debug('Shim plugin setup'); - if (hasListsFeature()) { - // TODO: Remove this once we have the lists feature supported - this.logger.error( - `You have activated the lists feature flag which is NOT currently supported for SIEM! You should turn this feature flag off immediately by un-setting the environment variable: ${listsEnvFeatureFlagName} and restarting Kibana` - ); - } - - const router = core.http.createRouter(); - core.http.registerRouteHandlerContext(this.name, (context, request, response) => ({ - getSiemClient: () => this.siemClientFactory.create(request), - })); - - this.siemClientFactory.setup({ - getSpaceId: plugins.spaces?.spacesService?.getSpaceId, - config: __legacy.config, - }); - - initRoutes( - router, - __legacy.config, - plugins.encryptedSavedObjects?.usingEphemeralEncryptionKey ?? false, - plugins.security - ); - - plugins.features.registerFeature({ - id: this.name, - name: i18n.translate('xpack.siem.featureRegistry.linkSiemTitle', { - defaultMessage: 'SIEM', - }), - order: 1100, - icon: 'securityAnalyticsApp', - navLinkId: 'siem', - app: ['siem', 'kibana'], - catalogue: ['siem'], - privileges: { - all: { - app: ['siem', 'kibana'], - catalogue: ['siem'], - api: ['siem', 'actions-read', 'actions-all', 'alerting-read', 'alerting-all'], - savedObject: { - all: [ - 'alert', - 'action', - 'action_task_params', - noteSavedObjectType, - pinnedEventSavedObjectType, - timelineSavedObjectType, - ruleStatusSavedObjectType, - ruleActionsSavedObjectType, - 'cases', - 'cases-comments', - 'cases-configure', - 'cases-user-actions', - ], - read: ['config'], - }, - ui: [ - 'show', - 'crud', - 'alerting:show', - 'actions:show', - 'alerting:save', - 'actions:save', - 'alerting:delete', - 'actions:delete', - ], - }, - read: { - app: ['siem', 'kibana'], - catalogue: ['siem'], - api: ['siem', 'actions-read', 'actions-all', 'alerting-read', 'alerting-all'], - savedObject: { - all: ['alert', 'action', 'action_task_params'], - read: [ - 'config', - noteSavedObjectType, - pinnedEventSavedObjectType, - timelineSavedObjectType, - ruleStatusSavedObjectType, - ruleActionsSavedObjectType, - 'cases', - 'cases-comments', - 'cases-configure', - 'cases-user-actions', - ], - }, - ui: [ - 'show', - 'alerting:show', - 'actions:show', - 'alerting:save', - 'actions:save', - 'alerting:delete', - 'actions:delete', - ], - }, - }, - }); - - if (plugins.alerting != null) { - const signalRuleType = signalRulesAlertType({ - logger: this.logger, - version: this.context.env.packageInfo.version, - ml: plugins.ml, - }); - const ruleNotificationType = rulesNotificationAlertType({ - logger: this.logger, - }); - - if (isAlertExecutor(signalRuleType)) { - plugins.alerting.registerType(signalRuleType); - } - - if (isNotificationAlertExecutor(ruleNotificationType)) { - plugins.alerting.registerType(ruleNotificationType); - } - } - - const libs = compose(core, plugins, this.context.env.mode.prod); - initServer(libs); - } - - public start(core: CoreStart, plugins: StartPlugins) {} -} diff --git a/x-pack/legacy/plugins/siem/tsconfig.json b/x-pack/legacy/plugins/siem/tsconfig.json deleted file mode 100644 index b027bb4567b971..00000000000000 --- a/x-pack/legacy/plugins/siem/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.json" -} \ No newline at end of file diff --git a/x-pack/legacy/plugins/tilemap/index.js b/x-pack/legacy/plugins/tilemap/index.js deleted file mode 100644 index d4105519ee0a77..00000000000000 --- a/x-pack/legacy/plugins/tilemap/index.js +++ /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 { mirrorPluginStatus } from '../../server/lib/mirror_plugin_status'; -import { inspectSettings } from './server/lib/inspect_settings'; -import { resolve } from 'path'; - -export const tilemap = kibana => { - return new kibana.Plugin({ - id: 'tilemap', - configPrefix: 'xpack.tilemap', - require: ['xpack_main', 'vis_type_vislib'], - publicDir: resolve(__dirname, 'public'), - uiExports: { - hacks: ['plugins/tilemap/vis_type_enhancers/update_tilemap_settings'], - }, - init: function(server) { - const thisPlugin = this; - const xpackMainPlugin = server.plugins.xpack_main; - mirrorPluginStatus(xpackMainPlugin, thisPlugin); - xpackMainPlugin.status.once('green', () => { - xpackMainPlugin.info - .feature(thisPlugin.id) - .registerLicenseCheckResultsGenerator(inspectSettings); - }); - }, - }); -}; diff --git a/x-pack/legacy/plugins/tilemap/public/vis_type_enhancers/update_tilemap_settings.js b/x-pack/legacy/plugins/tilemap/public/vis_type_enhancers/update_tilemap_settings.js deleted file mode 100644 index 294bc31e3893e9..00000000000000 --- a/x-pack/legacy/plugins/tilemap/public/vis_type_enhancers/update_tilemap_settings.js +++ /dev/null @@ -1,16 +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 { xpackInfo } from 'plugins/xpack_main/services/xpack_info'; -import { npSetup } from 'ui/new_platform'; - -const tileMapPluginInfo = xpackInfo.get('features.tilemap'); - -if (tileMapPluginInfo && (tileMapPluginInfo.license.active || tileMapPluginInfo.license.valid)) { - const { serviceSettings } = npSetup.plugins.mapsLegacy; - serviceSettings.addQueryParams({ license: tileMapPluginInfo.license.uid }); - serviceSettings.disableZoomMessage(); -} diff --git a/x-pack/legacy/plugins/tilemap/server/lib/__tests__/inspect_settings.js b/x-pack/legacy/plugins/tilemap/server/lib/__tests__/inspect_settings.js deleted file mode 100644 index ce7987ee396b8d..00000000000000 --- a/x-pack/legacy/plugins/tilemap/server/lib/__tests__/inspect_settings.js +++ /dev/null @@ -1,36 +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 { inspectSettings } from '../../../server/lib/inspect_settings'; - -describe('inspectSettings', function() { - it('should propagate x-pack info', function() { - const mockSettings = { - isAvailable: () => true, - license: { - getUid: () => 'foobar', - isActive: () => true, - isOneOf: () => true, - }, - }; - - const licenseInfo = inspectSettings(mockSettings); - expect(licenseInfo.license.uid).to.equal('foobar'); - expect(licenseInfo.license.active).to.equal(true); - expect(licenseInfo.license.valid).to.equal(true); - }); - - it('should break when unavailable info', function() { - const mockSettings = { - isAvailable: () => false, - }; - - const licenseInfo = inspectSettings(mockSettings); - expect(licenseInfo).to.have.property('message'); - expect(typeof licenseInfo.message === 'string').to.be.ok(); - }); -}); diff --git a/x-pack/legacy/plugins/tilemap/server/lib/inspect_settings.js b/x-pack/legacy/plugins/tilemap/server/lib/inspect_settings.js deleted file mode 100644 index cd6fb8bd8c1100..00000000000000 --- a/x-pack/legacy/plugins/tilemap/server/lib/inspect_settings.js +++ /dev/null @@ -1,32 +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. - */ - -export function inspectSettings(xpackInfo) { - if (!xpackInfo || !xpackInfo.isAvailable()) { - return { - message: - 'You cannot use the Tilemap Plugin because license information is not available at this time.', - }; - } - - /** - *Propagate these settings to the client - */ - return { - license: { - uid: xpackInfo.license.getUid(), - active: xpackInfo.license.isActive(), - valid: xpackInfo.license.isOneOf([ - 'trial', - 'standard', - 'basic', - 'gold', - 'platinum', - 'enterprise', - ]), - }, - }; -} diff --git a/x-pack/legacy/plugins/uptime/README.md b/x-pack/legacy/plugins/uptime/README.md index 2ed0e2fc77cbc8..92162341ff4266 100644 --- a/x-pack/legacy/plugins/uptime/README.md +++ b/x-pack/legacy/plugins/uptime/README.md @@ -3,7 +3,7 @@ ## Purpose The purpose of this plugin is to provide users of Heartbeat more visibility of what's happening -in their infrastructure. It's primarily built using React and Apollo's GraphQL tools. +in their infrastructure. ## Layout @@ -11,13 +11,15 @@ There are three sections to the app, `common`, `public`, and `server`. ### common -Contains GraphQL types, constants and a few other files. +Contains runtime types types, constants and a few other files. + +Notably, we use `io-ts`/`fp-ts` functions and types to help provide +additional runtime safety for our API requests/responses. ### public -Components come in two main types, queries and functional. Queries are extended from Apollo's queries -type which abstracts a lot of the GraphQL connectivity away. Functional are dumb components that -don't store any state. +We use Redux and associated tools for managing our app state. Components come in the usual `connect`ed and +presentational varieties. The `lib` directory controls bootstrapping code and adapter types. @@ -27,12 +29,13 @@ The principal structure of the app is stored in `uptime_app.tsx`. ### server -There is a `graphql` directory which contains the resolvers, schema files, and constants. - The `lib` directory contains `adapters`, which are connections to external resources like Kibana Server, Elasticsearch, etc. In addition, it contains domains, which are libraries that provide functionality via adapters. +The `requests` directory contains functions responsible for querying Elasticsearch and parsing its +responses. + There's also a `rest_api` folder that defines the structure of the RESTful API endpoints. ## Testing diff --git a/x-pack/legacy/plugins/uptime/common/constants/context_defaults.ts b/x-pack/legacy/plugins/uptime/common/constants/context_defaults.ts index 540e60a28b066c..c6b79afd9043b5 100644 --- a/x-pack/legacy/plugins/uptime/common/constants/context_defaults.ts +++ b/x-pack/legacy/plugins/uptime/common/constants/context_defaults.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SortOrder, CursorDirection } from '../graphql/types'; +import { CursorDirection, SortOrder } from '../runtime_types'; /** * The Uptime UI utilizes a settings context, the defaults for which are stored here. diff --git a/x-pack/legacy/plugins/uptime/common/constants/rest_api.ts b/x-pack/legacy/plugins/uptime/common/constants/rest_api.ts index dffa131870db15..169d175f02d3bb 100644 --- a/x-pack/legacy/plugins/uptime/common/constants/rest_api.ts +++ b/x-pack/legacy/plugins/uptime/common/constants/rest_api.ts @@ -5,8 +5,10 @@ */ export enum API_URLS { + CERTS = '/api/uptime/certs', INDEX_PATTERN = `/api/uptime/index_pattern`, INDEX_STATUS = '/api/uptime/index_status', + MONITOR_LIST = `/api/uptime/monitor/list`, MONITOR_LOCATIONS = `/api/uptime/monitor/locations`, MONITOR_DURATION = `/api/uptime/monitor/duration`, MONITOR_DETAILS = `/api/uptime/monitor/details`, diff --git a/x-pack/legacy/plugins/uptime/common/graphql/types.ts b/x-pack/legacy/plugins/uptime/common/graphql/types.ts deleted file mode 100644 index 506966ec6b5c9c..00000000000000 --- a/x-pack/legacy/plugins/uptime/common/graphql/types.ts +++ /dev/null @@ -1,232 +0,0 @@ -/* tslint:disable */ - -// ==================================================== -// START: Typescript template -// ==================================================== - -// ==================================================== -// Scalars -// ==================================================== - -export type UnsignedInteger = any; - -// ==================================================== -// Types -// ==================================================== - -export interface Query { - /** Fetches the current state of Uptime monitors for the given parameters. */ - getMonitorStates?: MonitorSummaryResult | null; -} - -/** The monitor's status for a ping */ -export interface Duration { - us?: UnsignedInteger | null; -} - -export interface Rtt { - connect?: Duration | null; - - handshake?: Duration | null; - - validate?: Duration | null; -} - -export interface Summary { - up?: number | null; - - down?: number | null; - - geo?: CheckGeo | null; -} - -export interface CheckGeo { - name?: string | null; - - location?: Location | null; -} - -export interface Location { - lat?: number | null; - - lon?: number | null; -} - -export interface DocCount { - count: UnsignedInteger; -} - -/** The primary object returned for monitor states. */ -export interface MonitorSummaryResult { - /** Used to go to the next page of results */ - prevPagePagination?: string | null; - /** Used to go to the previous page of results */ - nextPagePagination?: string | null; - /** The objects representing the state of a series of heartbeat monitors. */ - summaries?: MonitorSummary[] | null; - /** The number of summaries. */ - totalSummaryCount: number; -} -/** Represents the current state and associated data for an Uptime monitor. */ -export interface MonitorSummary { - /** The ID assigned by the config or generated by the user. */ - monitor_id: string; - /** The state of the monitor and its associated details. */ - state: State; - - histogram?: SummaryHistogram | null; -} -/** Unifies the subsequent data for an uptime monitor. */ -export interface State { - /** The agent processing the monitor. */ - agent?: Agent | null; - /** There is a check object for each instance of the monitoring agent. */ - checks?: Check[] | null; - - geo?: StateGeo | null; - - observer?: StateObserver | null; - - monitor?: MonitorState | null; - - summary: Summary; - - timestamp: UnsignedInteger; - /** Transport encryption information. */ - tls?: (StateTls | null)[] | null; - - url?: StateUrl | null; -} - -export interface Agent { - id: string; -} - -export interface Check { - agent?: Agent | null; - - container?: StateContainer | null; - - kubernetes?: StateKubernetes | null; - - monitor: CheckMonitor; - - observer?: CheckObserver | null; - - timestamp: string; -} - -export interface StateContainer { - id?: string | null; -} - -export interface StateKubernetes { - pod?: StatePod | null; -} - -export interface StatePod { - uid?: string | null; -} - -export interface CheckMonitor { - ip?: string | null; - - name?: string | null; - - status: string; -} - -export interface CheckObserver { - geo?: CheckGeo | null; -} - -export interface StateGeo { - name?: (string | null)[] | null; - - location?: Location | null; -} - -export interface StateObserver { - geo?: StateGeo | null; -} - -export interface MonitorState { - status?: string | null; - - name?: string | null; - - id?: string | null; - - type?: string | null; -} -/** Contains monitor transmission encryption information. */ -export interface StateTls { - /** The date and time after which the certificate is invalid. */ - certificate_not_valid_after?: string | null; - - certificate_not_valid_before?: string | null; - - certificates?: string | null; - - rtt?: Rtt | null; -} - -export interface StateUrl { - domain?: string | null; - - full?: string | null; - - path?: string | null; - - port?: number | null; - - scheme?: string | null; -} -/** Monitor status data over time. */ -export interface SummaryHistogram { - /** The number of documents used to assemble the histogram. */ - count: number; - /** The individual histogram data points. */ - points: SummaryHistogramPoint[]; -} -/** Represents a monitor's statuses for a period of time. */ -export interface SummaryHistogramPoint { - /** The time at which these data were collected. */ - timestamp: UnsignedInteger; - /** The number of _up_ documents. */ - up: number; - /** The number of _down_ documents. */ - down: number; -} - -export interface GetMonitorStatesQueryArgs { - dateRangeStart: string; - - dateRangeEnd: string; - - pagination?: string | null; - - filters?: string | null; - - statusFilter?: string | null; - - pageSize: number; -} - -// ==================================================== -// Enums -// ==================================================== - -export enum CursorDirection { - AFTER = 'AFTER', - BEFORE = 'BEFORE', -} - -export enum SortOrder { - ASC = 'ASC', - DESC = 'DESC', -} - -// ==================================================== -// END: Typescript template -// ==================================================== diff --git a/x-pack/legacy/plugins/uptime/common/runtime_types/certs.ts b/x-pack/legacy/plugins/uptime/common/runtime_types/certs.ts new file mode 100644 index 00000000000000..e8be67abf3a443 --- /dev/null +++ b/x-pack/legacy/plugins/uptime/common/runtime_types/certs.ts @@ -0,0 +1,42 @@ +/* + * 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 * as t from 'io-ts'; + +export const GetCertsParamsType = t.intersection([ + t.type({ + from: t.string, + to: t.string, + index: t.number, + size: t.number, + }), + t.partial({ + search: t.string, + }), +]); + +export type GetCertsParams = t.TypeOf; + +export const CertType = t.intersection([ + t.type({ + monitors: t.array( + t.partial({ + name: t.string, + id: t.string, + }) + ), + sha256: t.string, + }), + t.partial({ + certificate_not_valid_after: t.string, + certificate_not_valid_before: t.string, + common_name: t.string, + issuer: t.string, + sha1: t.string, + }), +]); + +export type Cert = t.TypeOf; diff --git a/x-pack/legacy/plugins/uptime/common/runtime_types/index.ts b/x-pack/legacy/plugins/uptime/common/runtime_types/index.ts index 652d60cbe304de..78aab3806ae049 100644 --- a/x-pack/legacy/plugins/uptime/common/runtime_types/index.ts +++ b/x-pack/legacy/plugins/uptime/common/runtime_types/index.ts @@ -5,6 +5,7 @@ */ export * from './alerts'; +export * from './certs'; export * from './common'; export * from './monitor'; export * from './overview_filters'; diff --git a/x-pack/legacy/plugins/uptime/common/runtime_types/monitor/index.ts b/x-pack/legacy/plugins/uptime/common/runtime_types/monitor/index.ts index 80b48d09dc5b80..46b19d8442a943 100644 --- a/x-pack/legacy/plugins/uptime/common/runtime_types/monitor/index.ts +++ b/x-pack/legacy/plugins/uptime/common/runtime_types/monitor/index.ts @@ -6,3 +6,4 @@ export * from './details'; export * from './locations'; +export * from './state'; diff --git a/x-pack/legacy/plugins/uptime/common/runtime_types/monitor/state.ts b/x-pack/legacy/plugins/uptime/common/runtime_types/monitor/state.ts new file mode 100644 index 00000000000000..90aa692f89a42f --- /dev/null +++ b/x-pack/legacy/plugins/uptime/common/runtime_types/monitor/state.ts @@ -0,0 +1,145 @@ +/* + * 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 * as t from 'io-ts'; + +export const CheckMonitorType = t.intersection([ + t.partial({ + name: t.string, + ip: t.union([t.array(t.string), t.string]), + }), + t.type({ + status: t.string, + }), +]); + +export const CheckType = t.intersection([ + t.partial({ + agent: t.partial({ + id: t.string, + }), + container: t.type({ + id: t.string, + }), + kubernetes: t.type({ + pod: t.type({ + uid: t.string, + }), + }), + observer: t.type({ + geo: t.partial({ + name: t.string, + location: t.partial({ + lat: t.number, + lon: t.number, + }), + }), + }), + }), + t.type({ + monitor: CheckMonitorType, + timestamp: t.number, + }), +]); + +export type Check = t.TypeOf; + +export const StateType = t.intersection([ + t.partial({ + checks: t.array(CheckType), + observer: t.partial({ + geo: t.partial({ + name: t.array(t.string), + }), + }), + summary: t.partial({ + up: t.number, + down: t.number, + geo: t.partial({ + name: t.string, + location: t.partial({ + lat: t.number, + lon: t.number, + }), + }), + }), + }), + t.type({ + timestamp: t.string, + url: t.partial({ + domain: t.string, + full: t.string, + path: t.string, + port: t.number, + scheme: t.string, + }), + }), +]); + +export const HistogramPointType = t.type({ + timestamp: t.number, + up: t.number, + down: t.number, +}); + +export type HistogramPoint = t.TypeOf; + +export const HistogramType = t.type({ + count: t.number, + points: t.array(HistogramPointType), +}); + +export type Histogram = t.TypeOf; + +export const MonitorSummaryType = t.intersection([ + t.type({ + monitor_id: t.string, + state: StateType, + }), + t.partial({ + histogram: HistogramType, + }), +]); + +export type MonitorSummary = t.TypeOf; + +export const MonitorSummaryResultType = t.intersection([ + t.partial({ + summaries: t.array(MonitorSummaryType), + }), + t.type({ + prevPagePagination: t.union([t.string, t.null]), + nextPagePagination: t.union([t.string, t.null]), + totalSummaryCount: t.number, + }), +]); + +export type MonitorSummaryResult = t.TypeOf; + +export const FetchMonitorStatesQueryArgsType = t.intersection([ + t.partial({ + pagination: t.string, + filters: t.string, + statusFilter: t.string, + }), + t.type({ + dateRangeStart: t.string, + dateRangeEnd: t.string, + pageSize: t.number, + }), +]); + +export type FetchMonitorStatesQueryArgs = t.TypeOf; + +export enum CursorDirection { + AFTER = 'AFTER', + BEFORE = 'BEFORE', +} + +export enum SortOrder { + ASC = 'ASC', + DESC = 'DESC', +} diff --git a/x-pack/legacy/plugins/uptime/public/components/connected/empty_state/empty_state.tsx b/x-pack/legacy/plugins/uptime/public/components/connected/empty_state/empty_state.tsx index 55c92e70b6066d..b0868af70480a5 100644 --- a/x-pack/legacy/plugins/uptime/public/components/connected/empty_state/empty_state.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/connected/empty_state/empty_state.tsx @@ -7,26 +7,44 @@ import React, { useContext, useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { indexStatusAction } from '../../../state/actions'; -import { indexStatusSelector } from '../../../state/selectors'; +import { indexStatusSelector, selectDynamicSettings } from '../../../state/selectors'; import { EmptyStateComponent } from '../../functional/empty_state/empty_state'; import { UptimeRefreshContext } from '../../../contexts'; +import { getDynamicSettings } from '../../../state/actions/dynamic_settings'; export const EmptyState: React.FC = ({ children }) => { const { data, loading, error } = useSelector(indexStatusSelector); const { lastRefresh } = useContext(UptimeRefreshContext); + const { settings } = useSelector(selectDynamicSettings); + + const heartbeatIndices = settings?.heartbeatIndices || ''; + const dispatch = useDispatch(); useEffect(() => { - dispatch(indexStatusAction.get()); + if (!data || data?.docCount === 0 || data?.indexExists === false) { + dispatch(indexStatusAction.get()); + } + // Don't add data , it will create endless loop + // eslint-disable-next-line react-hooks/exhaustive-deps }, [dispatch, lastRefresh]); + useEffect(() => { + dispatch(indexStatusAction.get()); + }, [dispatch, heartbeatIndices]); + + useEffect(() => { + dispatch(getDynamicSettings()); + }, [dispatch]); + return ( ); }; diff --git a/x-pack/legacy/plugins/uptime/public/components/connected/index.ts b/x-pack/legacy/plugins/uptime/public/components/connected/index.ts index be3cc5b65aa0ee..94e2529a46a00d 100644 --- a/x-pack/legacy/plugins/uptime/public/components/connected/index.ts +++ b/x-pack/legacy/plugins/uptime/public/components/connected/index.ts @@ -11,6 +11,7 @@ export { KueryBar } from './kuerybar/kuery_bar_container'; export { FilterGroup } from './filter_group/filter_group_container'; export { MonitorStatusDetails } from './monitor/status_details_container'; export { MonitorStatusBar } from './monitor/status_bar_container'; +export { MonitorList } from './monitor/monitor_list'; export { MonitorListDrawer } from './monitor/list_drawer_container'; export { MonitorListActionsPopover } from './monitor/drawer_popover_container'; export { PingList, PingListProps } from './pings'; diff --git a/x-pack/legacy/plugins/uptime/public/components/connected/monitor/list_drawer_container.tsx b/x-pack/legacy/plugins/uptime/public/components/connected/monitor/list_drawer_container.tsx index 70da62d5833af2..37a96ba0396aa5 100644 --- a/x-pack/legacy/plugins/uptime/public/components/connected/monitor/list_drawer_container.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/connected/monitor/list_drawer_container.tsx @@ -12,8 +12,7 @@ import { MonitorDetailsActionPayload } from '../../../state/actions/types'; import { getMonitorDetailsAction } from '../../../state/actions/monitor'; import { MonitorListDrawerComponent } from '../../functional/monitor_list/monitor_list_drawer/monitor_list_drawer'; import { useGetUrlParams } from '../../../hooks'; -import { MonitorSummary } from '../../../../common/graphql/types'; -import { MonitorDetails } from '../../../../common/runtime_types/monitor'; +import { MonitorDetails, MonitorSummary } from '../../../../common/runtime_types'; interface ContainerProps { summary: MonitorSummary; diff --git a/x-pack/legacy/plugins/uptime/public/components/connected/monitor/monitor_list.tsx b/x-pack/legacy/plugins/uptime/public/components/connected/monitor/monitor_list.tsx new file mode 100644 index 00000000000000..c9457664566b75 --- /dev/null +++ b/x-pack/legacy/plugins/uptime/public/components/connected/monitor/monitor_list.tsx @@ -0,0 +1,31 @@ +/* + * 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, { useCallback } from 'react'; +import { useSelector, useDispatch } from 'react-redux'; +import { getMonitorList } from '../../../state/actions'; +import { FetchMonitorStatesQueryArgs } from '../../../../common/runtime_types'; +import { monitorListSelector } from '../../../state/selectors'; +import { MonitorListComponent } from '../../functional/monitor_list'; + +export interface MonitorListProps { + filters?: string; + linkParameters?: string; +} + +export const MonitorList: React.FC = props => { + const dispatch = useDispatch(); + const dispatchCallback = useCallback( + (params: FetchMonitorStatesQueryArgs) => { + dispatch(getMonitorList(params)); + }, + [dispatch] + ); + const monitorListState = useSelector(monitorListSelector); + return ( + + ); +}; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/monitor_bar_series.test.tsx.snap b/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/monitor_bar_series.test.tsx.snap index 8ca73879cab8c0..b389139d71dbfe 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/monitor_bar_series.test.tsx.snap +++ b/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/monitor_bar_series.test.tsx.snap @@ -82,7 +82,6 @@ exports[`MonitorBarSeries component shallow renders a series when there are down } > { let props: MonitorBarSeriesProps; - let histogramSeries: SummaryHistogramPoint[]; + let histogramSeries: HistogramPoint[]; beforeEach(() => { props = { - dangerColor: 'A danger color', histogramSeries: [ { timestamp: 124, @@ -193,16 +192,12 @@ describe('MonitorBarSeries component', () => { }); it('shallow renders nothing if the data series is null', () => { - const component = shallowWithRouter( - - ); + const component = shallowWithRouter(); expect(component).toEqual({}); }); it('renders if the data series is present', () => { - const component = renderWithRouter( - - ); + const component = renderWithRouter(); expect(component).toMatchSnapshot(); }); }); diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/monitor_bar_series.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/charts/monitor_bar_series.tsx index 6a1e255d308d75..5e11685e361400 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/charts/monitor_bar_series.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/charts/monitor_bar_series.tsx @@ -14,23 +14,20 @@ import { timeFormatter, } from '@elastic/charts'; import { i18n } from '@kbn/i18n'; -import React from 'react'; +import React, { useContext } from 'react'; import moment from 'moment'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiText, EuiToolTip } from '@elastic/eui'; -import { SummaryHistogramPoint } from '../../../../common/graphql/types'; +import { HistogramPoint } from '../../../../common/runtime_types'; import { getChartDateLabel, seriesHasDownValues } from '../../../lib/helper'; import { useUrlParams } from '../../../hooks'; +import { UptimeThemeContext } from '../../../contexts'; export interface MonitorBarSeriesProps { - /** - * The color to use for the display of down states. - */ - dangerColor: string; /** * The timeseries data to display. */ - histogramSeries: SummaryHistogramPoint[] | null; + histogramSeries: HistogramPoint[] | null; } /** @@ -38,7 +35,10 @@ export interface MonitorBarSeriesProps { * so we will only render the series component if there are down counts for the selected monitor. * @param props - the values for the monitor this chart visualizes */ -export const MonitorBarSeries = ({ dangerColor, histogramSeries }: MonitorBarSeriesProps) => { +export const MonitorBarSeries = ({ histogramSeries }: MonitorBarSeriesProps) => { + const { + colors: { danger }, + } = useContext(UptimeThemeContext); const [getUrlParams, updateUrlParams] = useUrlParams(); const { absoluteDateRangeStart, absoluteDateRangeEnd } = getUrlParams(); @@ -68,7 +68,7 @@ export const MonitorBarSeries = ({ dangerColor, histogramSeries }: MonitorBarSer /> [timestamp, down])} name={i18n.translate('xpack.uptime.monitorList.downLineSeries.downLabel', { defaultMessage: 'Down checks', diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/data_missing.test.tsx.snap b/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/data_missing.test.tsx.snap deleted file mode 100644 index 2182bfb4e656c5..00000000000000 --- a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/data_missing.test.tsx.snap +++ /dev/null @@ -1,52 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`DataMissing component renders basePath and headingMessage 1`] = ` - - - - - - - - , - } - } - /> -

- } - iconType="uptimeApp" - title={ - -

- bar -

-
- } - /> -
-
-
-`; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/data_or_index_missing.test.tsx.snap b/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/data_or_index_missing.test.tsx.snap new file mode 100644 index 00000000000000..25ac5a1f0974e9 --- /dev/null +++ b/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/data_or_index_missing.test.tsx.snap @@ -0,0 +1,92 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`DataOrIndexMissing component renders headingMessage 1`] = ` + + + + + + + + + + + + + + + + + } + body={ + +

+ +

+

+ +

+
+ } + iconType="logoUptime" + title={ + +

+ + heartbeat-* + , + } + } + /> +

+
+ } + /> +
+
+
+`; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/empty_state.test.tsx.snap b/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/empty_state.test.tsx.snap index 2d45bbd18a60c2..d0e7af24e1c1b9 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/empty_state.test.tsx.snap +++ b/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/empty_state.test.tsx.snap @@ -1,7 +1,39 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`EmptyState component does not render empty state with appropriate base path and no docs 1`] = ` - - - , + } + } + /> + } > -
- -
- -
- - -
- - - - , - } - } - /> -

- } - iconType="uptimeApp" - title={ - -

- No uptime data found -

-
- } +
+ + +
-
+ + + + + + + + + + + + } + body={ + +

+ +

+

+ +

+
+ } + iconType="logoUptime" + title={ + +

+ , + } + } + /> +

+
+ } > - -
- - -
- - - - - -

+ + +
+ + + + + - No uptime data found -

+

+ , + } + } + > + No uptime data found in index + + +

+
- - -
- - -
-

- + + +

+

+ + If you have not setup heartbeat yet, you can setup heartbeat to start monitoring your services. + +

+

+ + If you have setup heartbeat and confirmed data is being sent to Elasticsearch, update your index pattern settings and insure they are aligned with your Heartbeat config. + +

+
+ + + + +
+ + +
+ + +
+ + + + +
+ - - - - Configure Heartbeat - - - - to start logging uptime data. - -

-
- - - -
- -
- -
- -
- - - + + Update index pattern settings + + + + + +
+ +
+ +
+ +
+ +
+ +
+ + + + `; exports[`EmptyState component doesn't render child components when count is falsy 1`] = ` - - - - - - -

- Loading… -

-
- - } - > -
+ + + + + +

+ Loading… +

+
+ + } > - - - -
- - - - -
- - + +
-

+ + + +
+ + - Loading… -

- -
-
- - -
- - - +

+ Loading… +

+ +
+
+
+
+
+
+
+
+ `; exports[`EmptyState component notifies when index does not exist 1`] = ` - - - , + } + } + /> + } > -
- -
- -
- - -
- - - - , - } - } - /> -

- } - iconType="uptimeApp" - title={ - -

- Uptime index not found -

-
- } +
+ + +
-
+ + + + + + + + + + + + } + body={ + +

+ +

+

+ +

+
+ } + iconType="logoUptime" + title={ + +

+ , + } + } + /> +

+
+ } > - -
- - -
- - - - - -

+ + +
+ + + + + - Uptime index not found -

+

+ , + } + } + > + No indices found matching pattern + + +

+
- - -
- - -
-

- + + +

+

+ + If you have not setup heartbeat yet, you can setup heartbeat to start monitoring your services. + +

+

+ + If you have setup heartbeat and confirmed data is being sent to Elasticsearch, update your index pattern settings and insure they are aligned with your Heartbeat config. + +

+
+ + + + +
+ + +
+ + +
+ + + + +
+ - - - - Configure Heartbeat - - - - to start logging uptime data. - -

-
- - - -
- -
- -
- -
- - - + + Update index pattern settings + + + + + +
+ +
+ +
+ +
+ +
+ +
+ + + + `; exports[`EmptyState component renders child components when count is truthy 1`] = ` - -
- Foo -
-
- Bar -
-
- Baz -
-
+ + +
+ Foo +
+
+ Bar +
+
+ Baz +
+
+
`; exports[`EmptyState component renders error message when an error occurs 1`] = ` - - - -
- -
- -
- -

- There was an error fetching your data. -

- - } - iconColor="subdued" - iconType="securityApp" - title={ - -

- Error -

-
- } +
+ +
-
+

+ There was an error fetching your data. +

+ + } + iconColor="subdued" + iconType="securityApp" + title={ + +

+ Error +

+
+ } > - -
- - -
- - - - - -

+ + +
+ + + + + - Error -

+

+ Error +

+
- - -
- - -
-

+ + +

- There was an error fetching your data. -

-
- - - -
- -
- -
- -
- - - +

+ There was an error fetching your data. +

+
+ + + +
+ +
+ +
+ +
+ + + + `; exports[`EmptyState component renders loading state if no errors or doc count 1`] = ` - - - - - - -

- Loading… -

-
- - } - > -
+ + + + + +

+ Loading… +

+
+ + } > - - - -
- - - - -
- - + +
-

- Loading… -

- -
-
- - -
- - - + + + +
+ + +

+ Loading… +

+
+
+ +
+ +
+
+
+ + `; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/data_missing.test.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/data_missing.test.tsx deleted file mode 100644 index 8605d2966aaaec..00000000000000 --- a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/data_missing.test.tsx +++ /dev/null @@ -1,16 +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 { shallowWithIntl } from 'test_utils/enzyme_helpers'; -import React from 'react'; -import { DataMissing } from '../data_missing'; - -describe('DataMissing component', () => { - it('renders basePath and headingMessage', () => { - const component = shallowWithIntl(); - expect(component).toMatchSnapshot(); - }); -}); diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/data_or_index_missing.test.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/data_or_index_missing.test.tsx new file mode 100644 index 00000000000000..333802962fd3e1 --- /dev/null +++ b/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/data_or_index_missing.test.tsx @@ -0,0 +1,24 @@ +/* + * 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 from 'react'; +import { shallowWithIntl } from 'test_utils/enzyme_helpers'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { DataOrIndexMissing } from '../data_or_index_missing'; + +describe('DataOrIndexMissing component', () => { + it('renders headingMessage', () => { + const headingMessage = ( + heartbeat-*
}} + /> + ); + const component = shallowWithIntl(); + expect(component).toMatchSnapshot(); + }); +}); diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/empty_state.test.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/empty_state.test.tsx index a74ad543c3318f..acfe2ada5b68d1 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/empty_state.test.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/empty_state.test.tsx @@ -5,11 +5,11 @@ */ import React from 'react'; -import { mountWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers'; import { EmptyStateComponent } from '../empty_state'; import { StatesIndexStatus } from '../../../../../common/runtime_types'; import { IHttpFetchError } from '../../../../../../../../../target/types/core/public/http'; import { HttpFetchError } from '../../../../../../../../../src/core/public/http/http_fetch_error'; +import { mountWithRouter, shallowWithRouter } from '../../../../lib'; describe('EmptyState component', () => { let statesIndexStatus: StatesIndexStatus; @@ -22,7 +22,7 @@ describe('EmptyState component', () => { }); it('renders child components when count is truthy', () => { - const component = shallowWithIntl( + const component = shallowWithRouter(
Foo
Bar
@@ -33,7 +33,7 @@ describe('EmptyState component', () => { }); it(`doesn't render child components when count is falsy`, () => { - const component = mountWithIntl( + const component = mountWithRouter(
Shouldn't be rendered
@@ -45,7 +45,7 @@ describe('EmptyState component', () => { const errors: IHttpFetchError[] = [ new HttpFetchError('There was an error fetching your data.', 'error', {} as any), ]; - const component = mountWithIntl( + const component = mountWithRouter(
Shouldn't appear...
@@ -54,7 +54,7 @@ describe('EmptyState component', () => { }); it('renders loading state if no errors or doc count', () => { - const component = mountWithIntl( + const component = mountWithRouter(
Should appear even while loading...
@@ -67,7 +67,7 @@ describe('EmptyState component', () => { docCount: 0, indexExists: true, }; - const component = mountWithIntl( + const component = mountWithRouter(
If this is in the snapshot the test should fail
@@ -77,7 +77,7 @@ describe('EmptyState component', () => { it('notifies when index does not exist', () => { statesIndexStatus.indexExists = false; - const component = mountWithIntl( + const component = mountWithRouter(
This text should not render
diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/data_missing.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/data_missing.tsx deleted file mode 100644 index 337c08774e8e80..00000000000000 --- a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/data_missing.tsx +++ /dev/null @@ -1,64 +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 { - EuiFlexGroup, - EuiEmptyPrompt, - EuiFlexItem, - EuiSpacer, - EuiPanel, - EuiTitle, - EuiLink, -} from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; -import React, { useContext } from 'react'; -import { UptimeSettingsContext } from '../../../contexts'; - -interface DataMissingProps { - headingMessage: string; -} - -export const DataMissing = ({ headingMessage }: DataMissingProps) => { - const { basePath } = useContext(UptimeSettingsContext); - return ( - - - - - -

{headingMessage}

- - } - body={ -

- - - - ), - }} - /> -

- } - /> -
-
-
- ); -}; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/data_or_index_missing.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/data_or_index_missing.tsx new file mode 100644 index 00000000000000..88c0920138f682 --- /dev/null +++ b/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/data_or_index_missing.tsx @@ -0,0 +1,86 @@ +/* + * 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 { + EuiFlexGroup, + EuiEmptyPrompt, + EuiFlexItem, + EuiSpacer, + EuiPanel, + EuiTitle, + EuiButton, +} from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n/react'; +import React, { useContext } from 'react'; +import { UptimeSettingsContext } from '../../../contexts'; +import { DynamicSettings } from '../../../../common/runtime_types'; + +interface DataMissingProps { + headingMessage: JSX.Element; + settings?: DynamicSettings; +} + +export const DataOrIndexMissing = ({ headingMessage, settings }: DataMissingProps) => { + const { basePath } = useContext(UptimeSettingsContext); + return ( + + + + + +

{headingMessage}

+ + } + body={ + <> +

+ +

+

+ +

+ + } + actions={ + + + + + + + + + + + + + } + /> +
+
+
+ ); +}; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/empty_index.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/empty_index.tsx deleted file mode 100644 index 0141198ec15e0d..00000000000000 --- a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/empty_index.tsx +++ /dev/null @@ -1,67 +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 { - EuiEmptyPrompt, - EuiFlexGroup, - EuiFlexItem, - EuiLink, - EuiPanel, - EuiSpacer, - EuiTitle, -} from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; -import React, { Fragment } from 'react'; - -interface EmptyIndexProps { - basePath: string; -} - -export const EmptyIndex = ({ basePath }: EmptyIndexProps) => ( - - - - - -

- -

- - } - body={ - -

- - - - ), - }} - /> -

-
- } - /> -
-
-
-); diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/empty_state.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/empty_state.tsx index ae6a1b892bc991..651103a34bf212 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/empty_state.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/empty_state.tsx @@ -5,11 +5,11 @@ */ import React, { Fragment } from 'react'; -import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n/react'; import { EmptyStateError } from './empty_state_error'; import { EmptyStateLoading } from './empty_state_loading'; -import { DataMissing } from './data_missing'; -import { StatesIndexStatus } from '../../../../common/runtime_types'; +import { DataOrIndexMissing } from './data_or_index_missing'; +import { DynamicSettings, StatesIndexStatus } from '../../../../common/runtime_types'; import { IHttpFetchError } from '../../../../../../../../target/types/core/public/http'; interface EmptyStateProps { @@ -17,6 +17,7 @@ interface EmptyStateProps { statesIndexStatus: StatesIndexStatus | null; loading: boolean; errors?: IHttpFetchError[]; + settings?: DynamicSettings; } export const EmptyStateComponent = ({ @@ -24,6 +25,7 @@ export const EmptyStateComponent = ({ statesIndexStatus, loading, errors, + settings, }: EmptyStateProps) => { if (errors?.length) { return ; @@ -32,18 +34,28 @@ export const EmptyStateComponent = ({ const { indexExists, docCount } = statesIndexStatus; if (!indexExists) { return ( - {settings?.heartbeatIndices}
}} + /> + } /> ); } else if (indexExists && docCount === 0) { return ( - {settings?.heartbeatIndices} }} + /> + } /> ); } diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/index.ts b/x-pack/legacy/plugins/uptime/public/components/functional/index.ts index d82912a6216e86..07809561c31b7c 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/index.ts +++ b/x-pack/legacy/plugins/uptime/public/components/functional/index.ts @@ -13,7 +13,7 @@ export * from './alerts'; export { DonutChart } from './charts/donut_chart'; export { KueryBarComponent } from './kuery_bar/kuery_bar'; export { MonitorCharts } from './monitor_charts'; -export { MonitorList } from './monitor_list'; +export { MonitorListComponent } from './monitor_list'; export { OverviewPageParsingErrorCallout } from './overview_page_parsing_error_callout'; export { PingListComponent } from './ping_list'; export { PingHistogramComponent } from './charts'; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list.test.tsx.snap b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list.test.tsx.snap index 2b8bc0bb06ddfa..ed5602323d254f 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list.test.tsx.snap +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list.test.tsx.snap @@ -1,125 +1,535 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`MonitorList component renders a no items message when no data is provided 1`] = ` - - - -
- -
-
- - + + +`; + +exports[`MonitorList component MonitorListPagination component renders the pagination 1`] = ` + + + +`; + +exports[`MonitorList component renders a no items message when no data is provided 1`] = ` + + + +`; + +exports[`MonitorList component renders error list 1`] = ` + + + +`; + +exports[`MonitorList component renders loading state 1`] = ` + + - - - - - - - - - - - - - - - - -
-
+ } + /> + `; exports[`MonitorList component renders the monitor list 1`] = ` @@ -672,185 +1082,132 @@ exports[`MonitorList component renders the monitor list 1`] = ` `; exports[`MonitorList component shallow renders the monitor list 1`] = ` - - - -
- -
-
- - + - - - - - - - - - - - - - - - - -
-
+ } + /> + `; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list_pagination.test.tsx.snap b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list_pagination.test.tsx.snap deleted file mode 100644 index db5bfa72deb368..00000000000000 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list_pagination.test.tsx.snap +++ /dev/null @@ -1,307 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`MonitorListPagination component renders a no items message when no data is provided 1`] = ` - - - -
- -
-
- - - - - - - - - - - - - - - - - - -
-
-`; - -exports[`MonitorListPagination component renders the monitor list 1`] = ` - - - -
- -
-
- - - - - - - - - - - - - - - - - - -
-
-`; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list.test.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list.test.tsx index d2030155d0092e..9b1d799a23e379 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list.test.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list.test.tsx @@ -4,17 +4,30 @@ * you may not use this file except in compliance with the Elastic License. */ -import { shallowWithIntl } from 'test_utils/enzyme_helpers'; import React from 'react'; -import { MonitorSummaryResult } from '../../../../../common/graphql/types'; +import { + MonitorSummaryResult, + CursorDirection, + SortOrder, +} from '../../../../../common/runtime_types'; import { MonitorListComponent } from '../monitor_list'; -import { renderWithRouter } from '../../../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../../../lib'; describe('MonitorList component', () => { let result: MonitorSummaryResult; + let localStorageMock: any; beforeEach(() => { + localStorageMock = { + getItem: jest.fn().mockImplementation(() => '25'), + setItem: jest.fn(), + }; + + // @ts-ignore replacing a call to localStorage we use for monitor list size + global.localStorage = localStorageMock; result = { + nextPagePagination: null, + prevPagePagination: null, summaries: [ { monitor_id: 'foo', @@ -25,21 +38,21 @@ describe('MonitorList component', () => { ip: '127.0.0.1', status: 'up', }, - timestamp: '124', + timestamp: 124, }, { monitor: { ip: '127.0.0.2', status: 'down', }, - timestamp: '125', + timestamp: 125, }, { monitor: { ip: '127.0.0.3', status: 'down', }, - timestamp: '126', + timestamp: 126, }, ], summary: { @@ -47,6 +60,7 @@ describe('MonitorList component', () => { down: 2, }, timestamp: '123', + url: {}, }, }, { @@ -58,14 +72,14 @@ describe('MonitorList component', () => { ip: '127.0.0.1', status: 'up', }, - timestamp: '125', + timestamp: 125, }, { monitor: { ip: '127.0.0.2', status: 'up', }, - timestamp: '126', + timestamp: 126, }, ], summary: { @@ -73,6 +87,7 @@ describe('MonitorList component', () => { down: 0, }, timestamp: '125', + url: {}, }, }, ], @@ -81,15 +96,11 @@ describe('MonitorList component', () => { }); it('shallow renders the monitor list', () => { - const component = shallowWithIntl( + const component = shallowWithRouter( ); @@ -97,15 +108,19 @@ describe('MonitorList component', () => { }); it('renders a no items message when no data is provided', () => { - const component = shallowWithIntl( + const component = shallowWithRouter( ); expect(component).toMatchSnapshot(); @@ -114,16 +129,156 @@ describe('MonitorList component', () => { it('renders the monitor list', () => { const component = renderWithRouter( + ); + + expect(component).toMatchSnapshot(); + }); + + it('renders error list', () => { + const component = shallowWithRouter( + ); expect(component).toMatchSnapshot(); }); + + it('renders loading state', () => { + const component = shallowWithRouter( + + ); + + expect(component).toMatchSnapshot(); + }); + + describe('MonitorListPagination component', () => { + let paginationResult: MonitorSummaryResult; + + beforeEach(() => { + paginationResult = { + prevPagePagination: JSON.stringify({ + cursorKey: { monitor_id: 123 }, + cursorDirection: CursorDirection.BEFORE, + sortOrder: SortOrder.ASC, + }), + nextPagePagination: JSON.stringify({ + cursorKey: { monitor_id: 456 }, + cursorDirection: CursorDirection.AFTER, + sortOrder: SortOrder.ASC, + }), + summaries: [ + { + monitor_id: 'foo', + state: { + checks: [ + { + monitor: { + ip: '127.0.0.1', + status: 'up', + }, + timestamp: 124, + }, + { + monitor: { + ip: '127.0.0.2', + status: 'down', + }, + timestamp: 125, + }, + { + monitor: { + ip: '127.0.0.3', + status: 'down', + }, + timestamp: 126, + }, + ], + summary: { + up: 1, + down: 2, + }, + timestamp: '123', + url: {}, + }, + }, + { + monitor_id: 'bar', + state: { + checks: [ + { + monitor: { + ip: '127.0.0.1', + status: 'up', + }, + timestamp: 125, + }, + { + monitor: { + ip: '127.0.0.2', + status: 'up', + }, + timestamp: 126, + }, + ], + summary: { + up: 2, + down: 0, + }, + timestamp: '125', + url: {}, + }, + }, + ], + totalSummaryCount: 2, + }; + }); + + it('renders the pagination', () => { + const component = shallowWithRouter( + + ); + + expect(component).toMatchSnapshot(); + }); + + it('renders a no items message when no data is provided', () => { + const component = shallowWithRouter( + + ); + + expect(component).toMatchSnapshot(); + }); + }); }); diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_pagination.test.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_pagination.test.tsx deleted file mode 100644 index b08b8b3fabc3e3..00000000000000 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_pagination.test.tsx +++ /dev/null @@ -1,126 +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 { shallowWithIntl } from 'test_utils/enzyme_helpers'; -import React from 'react'; -import { - CursorDirection, - MonitorSummaryResult, - SortOrder, -} from '../../../../../common/graphql/types'; -import { MonitorListComponent } from '../monitor_list'; - -describe('MonitorListPagination component', () => { - let result: MonitorSummaryResult; - - beforeEach(() => { - result = { - prevPagePagination: JSON.stringify({ - cursorKey: { monitor_id: 123 }, - cursorDirection: CursorDirection.BEFORE, - sortOrder: SortOrder.ASC, - }), - nextPagePagination: JSON.stringify({ - cursorKey: { monitor_id: 456 }, - cursorDirection: CursorDirection.AFTER, - sortOrder: SortOrder.ASC, - }), - summaries: [ - { - monitor_id: 'foo', - state: { - checks: [ - { - monitor: { - ip: '127.0.0.1', - status: 'up', - }, - timestamp: '124', - }, - { - monitor: { - ip: '127.0.0.2', - status: 'down', - }, - timestamp: '125', - }, - { - monitor: { - ip: '127.0.0.3', - status: 'down', - }, - timestamp: '126', - }, - ], - summary: { - up: 1, - down: 2, - }, - timestamp: '123', - }, - }, - { - monitor_id: 'bar', - state: { - checks: [ - { - monitor: { - ip: '127.0.0.1', - status: 'up', - }, - timestamp: '125', - }, - { - monitor: { - ip: '127.0.0.2', - status: 'up', - }, - timestamp: '126', - }, - ], - summary: { - up: 2, - down: 0, - }, - timestamp: '125', - }, - }, - ], - totalSummaryCount: 2, - }; - }); - - it('renders the monitor list', () => { - const component = shallowWithIntl( - - ); - - expect(component).toMatchSnapshot(); - }); - - it('renders a no items message when no data is provided', () => { - const component = shallowWithIntl( - - ); - expect(component).toMatchSnapshot(); - }); -}); diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_status_column.test.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_status_column.test.tsx index 406e18535f34c3..d765c0b33ea4bb 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_status_column.test.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_status_column.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import moment from 'moment'; import { renderWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers'; import { getLocationStatus, MonitorListStatusColumn } from '../monitor_list_status_column'; -import { Check } from '../../../../../common/graphql/types'; +import { Check } from '../../../../../common/runtime_types'; import { STATUS } from '../../../../../common/constants'; describe('MonitorListStatusColumn', () => { @@ -29,9 +29,6 @@ describe('MonitorListStatusColumn', () => { beforeEach(() => { upChecks = [ { - agent: { id: '6a2f2a1c-e346-49ed-8418-6d48af8841d6' }, - container: null, - kubernetes: null, monitor: { ip: '104.86.46.103', name: '', @@ -46,12 +43,9 @@ describe('MonitorListStatusColumn', () => { }, }, }, - timestamp: '1579794631464', + timestamp: 1579794631464, }, { - agent: { id: '1117fd01-bc1a-4aa5-bfab-40ab455eadf9' }, - container: null, - kubernetes: null, monitor: { ip: '104.86.46.103', name: '', @@ -66,12 +60,9 @@ describe('MonitorListStatusColumn', () => { }, }, }, - timestamp: '1579794634220', + timestamp: 1579794634220, }, { - agent: { id: 'eda59510-45e8-4dfe-b0f8-959c449e3565' }, - container: null, - kubernetes: null, monitor: { ip: '104.86.46.103', name: '', @@ -86,15 +77,12 @@ describe('MonitorListStatusColumn', () => { }, }, }, - timestamp: '1579794628368', + timestamp: 1579794628368, }, ]; downChecks = [ { - agent: { id: '6a2f2a1c-e346-49ed-8418-6d48af8841d6' }, - container: null, - kubernetes: null, monitor: { ip: '104.86.46.103', name: '', @@ -109,12 +97,9 @@ describe('MonitorListStatusColumn', () => { }, }, }, - timestamp: '1579794631464', + timestamp: 1579794631464, }, { - agent: { id: '1117fd01-bc1a-4aa5-bfab-40ab455eadf9' }, - container: null, - kubernetes: null, monitor: { ip: '104.86.46.103', name: '', @@ -129,12 +114,9 @@ describe('MonitorListStatusColumn', () => { }, }, }, - timestamp: '1579794634220', + timestamp: 1579794634220, }, { - agent: { id: 'eda59510-45e8-4dfe-b0f8-959c449e3565' }, - container: null, - kubernetes: null, monitor: { ip: '104.86.46.103', name: '', @@ -149,15 +131,12 @@ describe('MonitorListStatusColumn', () => { }, }, }, - timestamp: '1579794628368', + timestamp: 1579794628368, }, ]; checks = [ { - agent: { id: '6a2f2a1c-e346-49ed-8418-6d48af8841d6' }, - container: null, - kubernetes: null, monitor: { ip: '104.86.46.103', name: '', @@ -172,12 +151,9 @@ describe('MonitorListStatusColumn', () => { }, }, }, - timestamp: '1579794631464', + timestamp: 1579794631464, }, { - agent: { id: '1117fd01-bc1a-4aa5-bfab-40ab455eadf9' }, - container: null, - kubernetes: null, monitor: { ip: '104.86.46.103', name: '', @@ -192,12 +168,9 @@ describe('MonitorListStatusColumn', () => { }, }, }, - timestamp: '1579794634220', + timestamp: 1579794634220, }, { - agent: { id: 'eda59510-45e8-4dfe-b0f8-959c449e3565' }, - container: null, - kubernetes: null, monitor: { ip: '104.86.46.103', name: '', @@ -212,7 +185,7 @@ describe('MonitorListStatusColumn', () => { }, }, }, - timestamp: '1579794628368', + timestamp: 1579794628368, }, ]; }); diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/index.ts b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/index.ts index a83330a7a3a0b9..2dc43050f95155 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/index.ts +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/index.ts @@ -4,6 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -export { MonitorList } from './monitor_list'; +export { MonitorListComponent } from './monitor_list'; export { Criteria, Pagination } from './types'; export { LocationLink } from './monitor_list_drawer'; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list.tsx index a9fb1ce2f4be16..6705101ccd5723 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list.tsx @@ -16,17 +16,11 @@ import { EuiTitle, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import styled from 'styled-components'; -import { withUptimeGraphQL, UptimeGraphQLQueryProps } from '../../higher_order'; -import { monitorStatesQuery } from '../../../queries/monitor_states_query'; -import { - MonitorSummary, - MonitorSummaryResult, - SummaryHistogramPoint, -} from '../../../../common/graphql/types'; +import { HistogramPoint, FetchMonitorStatesQueryArgs } from '../../../../common/runtime_types'; +import { MonitorSummary } from '../../../../common/runtime_types'; import { MonitorListStatusColumn } from './monitor_list_status_column'; -import { formatUptimeGraphQLErrorList } from '../../../lib/helper/format_error_list'; import { ExpandedRowMap } from './types'; import { MonitorBarSeries } from '../charts'; import { MonitorPageLink } from './monitor_page_link'; @@ -34,36 +28,69 @@ import { OverviewPageLink } from './overview_page_link'; import * as labels from './translations'; import { MonitorListDrawer } from '../../connected'; import { MonitorListPageSizeSelect } from './monitor_list_page_size_select'; +import { MonitorListProps } from '../../connected/monitor/monitor_list'; +import { MonitorList } from '../../../state/reducers/monitor_list'; +import { useUrlParams } from '../../../hooks'; -interface MonitorListQueryResult { - monitorStates?: MonitorSummaryResult; -} - -interface MonitorListProps { - dangerColor: string; - hasActiveFilters: boolean; - successColor: string; - linkParameters?: string; - pageSize: number; - setPageSize: (size: number) => void; +interface Props extends MonitorListProps { + lastRefresh: number; + monitorList: MonitorList; + getMonitorList: (params: FetchMonitorStatesQueryArgs) => void; } -type Props = UptimeGraphQLQueryProps & MonitorListProps; - const TruncatedEuiLink = styled(EuiLink)` white-space: nowrap; overflow: hidden; text-overflow: ellipsis; `; -export const MonitorListComponent = (props: Props) => { - const { dangerColor, data, errors, hasActiveFilters, linkParameters, loading } = props; +const DEFAULT_PAGE_SIZE = 10; +const LOCAL_STORAGE_KEY = 'xpack.uptime.monitorList.pageSize'; +const getPageSizeValue = () => { + const value = parseInt(localStorage.getItem(LOCAL_STORAGE_KEY) ?? '', 10); + if (isNaN(value)) { + return DEFAULT_PAGE_SIZE; + } + return value; +}; + +export const MonitorListComponent: React.FC = ({ + filters, + getMonitorList, + lastRefresh, + monitorList: { list, error, loading }, + linkParameters, +}) => { + const [pageSize, setPageSize] = useState(getPageSizeValue()); const [drawerIds, updateDrawerIds] = useState([]); - const items = data?.monitorStates?.summaries ?? []; + const [getUrlValues] = useUrlParams(); + const { dateRangeStart, dateRangeEnd, pagination, statusFilter } = getUrlValues(); + + useEffect(() => { + getMonitorList({ + dateRangeStart, + dateRangeEnd, + filters, + pageSize, + pagination, + statusFilter, + }); + }, [ + getMonitorList, + dateRangeStart, + dateRangeEnd, + filters, + lastRefresh, + pageSize, + pagination, + statusFilter, + ]); + + const items = list.summaries ?? []; - const nextPagePagination = data?.monitorStates?.nextPagePagination ?? ''; - const prevPagePagination = data?.monitorStates?.prevPagePagination ?? ''; + const nextPagePagination = list.nextPagePagination ?? ''; + const prevPagePagination = list.prevPagePagination ?? ''; const getExpandedRowMap = () => { return drawerIds.reduce((map: ExpandedRowMap, id: string) => { @@ -123,8 +150,8 @@ export const MonitorListComponent = (props: Props) => { mobileOptions: { show: false, }, - render: (histogramSeries: SummaryHistogramPoint[] | null) => ( - + render: (histogramSeries: HistogramPoint[] | null) => ( + ), }, { @@ -153,70 +180,61 @@ export const MonitorListComponent = (props: Props) => { ]; return ( - <> - - -
- -
-
- - - - - - - - - - - - - - - - - - -
- + + +
+ +
+
+ + + + + + + + + + + + + + + + + + +
); }; - -export const MonitorList = withUptimeGraphQL( - MonitorListComponent, - monitorStatesQuery -); diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/monitor_list_drawer.test.tsx.snap b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/monitor_list_drawer.test.tsx.snap index cf754581b1a335..4520b760be3794 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/monitor_list_drawer.test.tsx.snap +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/monitor_list_drawer.test.tsx.snap @@ -71,21 +71,21 @@ exports[`MonitorListDrawer component renders a MonitorListDrawer when there are "ip": "127.0.0.1", "status": "up", }, - "timestamp": "121", + "timestamp": 121, }, Object { "monitor": Object { "ip": "127.0.0.2", "status": "down", }, - "timestamp": "123", + "timestamp": 123, }, Object { "monitor": Object { "ip": "127.0.0.3", "status": "up", }, - "timestamp": "125", + "timestamp": 125, }, ], "summary": Object { @@ -175,7 +175,7 @@ exports[`MonitorListDrawer component renders a MonitorListDrawer when there is o "ip": "127.0.0.1", "status": "up", }, - "timestamp": "121", + "timestamp": 121, }, ], "summary": Object { diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/integration_group.test.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/integration_group.test.tsx index 723f8f9f4430a9..48fa2c97666819 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/integration_group.test.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/integration_group.test.tsx @@ -5,7 +5,7 @@ */ import React from 'react'; -import { MonitorSummary } from '../../../../../../common/graphql/types'; +import { MonitorSummary } from '../../../../../../common/runtime_types'; import { shallowWithIntl } from 'test_utils/enzyme_helpers'; import { IntegrationGroup } from '../integration_group'; @@ -19,6 +19,7 @@ describe('IntegrationGroup', () => { summary: {}, checks: [], timestamp: '123', + url: {}, }, }; }); diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx index d870acefaaea61..4bc0c3f0a40bac 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx @@ -4,10 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ import 'jest'; -import { MonitorSummary, Check } from '../../../../../../common/graphql/types'; import React from 'react'; import { MonitorListDrawerComponent } from '../monitor_list_drawer'; -import { MonitorDetails } from '../../../../../../common/runtime_types'; +import { Check, MonitorDetails, MonitorSummary } from '../../../../../../common/runtime_types'; import { shallowWithRouter } from '../../../../../lib'; describe('MonitorListDrawer component', () => { @@ -24,7 +23,7 @@ describe('MonitorListDrawer component', () => { ip: '127.0.0.1', status: 'up', }, - timestamp: '121', + timestamp: 121, }, ], summary: { @@ -77,21 +76,21 @@ describe('MonitorListDrawer component', () => { ip: '127.0.0.1', status: 'up', }, - timestamp: '121', + timestamp: 121, }, { monitor: { ip: '127.0.0.2', status: 'down', }, - timestamp: '123', + timestamp: 123, }, { monitor: { ip: '127.0.0.3', status: 'up', }, - timestamp: '125', + timestamp: 125, }, ]; summary.state.checks = checks; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_status_list.test.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_status_list.test.tsx index 8c07d0b1a7d224..c7f3aef4075e13 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_status_list.test.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_status_list.test.tsx @@ -8,7 +8,7 @@ import { shallowWithIntl } from 'test_utils/enzyme_helpers'; import React from 'react'; import moment from 'moment'; import { MonitorStatusList } from '../monitor_status_list'; -import { Check } from '../../../../../../common/graphql/types'; +import { Check } from '../../../../../../common/runtime_types'; describe('MonitorStatusList component', () => { let checks: Check[]; @@ -21,110 +21,92 @@ describe('MonitorStatusList component', () => { beforeEach(() => { checks = [ { - agent: { id: '8f9a37fb-573a-4fdc-9895-440a5b39c250' }, monitor: { ip: '151.101.130.217', name: 'elastic', status: 'up', }, observer: { - geo: { name: null, location: null }, + geo: {}, }, - timestamp: '1570538236414', + timestamp: 1570538236414, }, { - agent: { id: '8f9a37fb-573a-4fdc-9895-440a5b39c250' }, monitor: { ip: '151.101.194.217', name: 'elastic', status: 'up', }, observer: { - geo: { name: null, location: null }, + geo: {}, }, - timestamp: '1570538236414', + timestamp: 1570538236414, }, { - agent: { id: '8f9a37fb-573a-4fdc-9895-440a5b39c250' }, monitor: { ip: '151.101.2.217', name: 'elastic', status: 'up', }, observer: { - geo: { name: null, location: null }, + geo: {}, }, - timestamp: '1570538236414', + timestamp: 1570538236414, }, { - agent: { id: '8f9a37fb-573a-4fdc-9895-440a5b39c250' }, - container: null, - kubernetes: null, monitor: { ip: '151.101.66.217', name: 'elastic', status: 'up', }, observer: { - geo: { name: null, location: null }, + geo: {}, }, - timestamp: '1570538236414', + timestamp: 1570538236414, }, { - agent: { id: '8f9a37fb-573a-4fdc-9895-440a5b39c250' }, - container: null, - kubernetes: null, monitor: { ip: '2a04:4e42:200::729', name: 'elastic', status: 'down', }, observer: { - geo: { name: null, location: null }, + geo: {}, }, - timestamp: '1570538236414', + timestamp: 1570538236414, }, { - agent: { id: '8f9a37fb-573a-4fdc-9895-440a5b39c250' }, - container: null, - kubernetes: null, monitor: { ip: '2a04:4e42:400::729', name: 'elastic', status: 'down', }, observer: { - geo: { name: null, location: null }, + geo: {}, }, - timestamp: '1570538236414', + timestamp: 1570538236414, }, { - agent: { id: '8f9a37fb-573a-4fdc-9895-440a5b39c250' }, - container: null, - kubernetes: null, monitor: { ip: '2a04:4e42:600::729', name: 'elastic', status: 'down', }, observer: { - geo: { name: null, location: null }, + geo: {}, }, - timestamp: '1570538236414', + timestamp: 1570538236414, }, { - agent: { id: '8f9a37fb-573a-4fdc-9895-440a5b39c250' }, - container: null, - kubernetes: null, monitor: { ip: '2a04:4e42::729', name: 'elastic', status: 'down', }, observer: { - geo: { name: null, location: null }, + geo: {}, }, - timestamp: '1570538236414', + timestamp: 1570538236414, }, ]; }); diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/integration_group.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/integration_group.tsx index 34bff58a3e2d98..cc06b9a2306c70 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/integration_group.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/integration_group.tsx @@ -19,7 +19,7 @@ import { getLoggingIpHref, getLoggingKubernetesHref, } from '../../../../lib/helper'; -import { MonitorSummary } from '../../../../../common/graphql/types'; +import { MonitorSummary } from '../../../../../common/runtime_types'; import { UptimeSettingsContext } from '../../../../contexts'; interface IntegrationGroupProps { diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_list_actions_popover.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_list_actions_popover.tsx index 6b946baa8d4037..c57ecbaa4d3ed5 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_list_actions_popover.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_list_actions_popover.tsx @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; import React from 'react'; import { EuiPopover, EuiButton } from '@elastic/eui'; import { IntegrationGroup } from './integration_group'; -import { MonitorSummary } from '../../../../../common/graphql/types'; +import { MonitorSummary } from '../../../../../common/runtime_types'; import { toggleIntegrationsPopover, PopoverState } from '../../../../state/actions'; interface MonitorListActionsPopoverProps { diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx index 8383596ccc346a..6dc9ebbef1287d 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx @@ -7,10 +7,9 @@ import React from 'react'; import styled from 'styled-components'; import { EuiLink, EuiSpacer, EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText } from '@elastic/eui'; -import { MonitorSummary } from '../../../../../common/graphql/types'; import { MostRecentError } from './most_recent_error'; import { MonitorStatusList } from './monitor_status_list'; -import { MonitorDetails } from '../../../../../common/runtime_types'; +import { MonitorDetails, MonitorSummary } from '../../../../../common/runtime_types'; import { MonitorListActionsPopover } from '../../../connected'; const ContainerDiv = styled.div` diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_status_list.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_status_list.tsx index a2042e379dd80f..8a46167dcd3bc0 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_status_list.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_status_list.tsx @@ -8,9 +8,9 @@ import React from 'react'; import { get, capitalize } from 'lodash'; import { EuiCallOut, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { Check } from '../../../../../common/graphql/types'; import { LocationLink } from './location_link'; import { MonitorStatusRow } from './monitor_status_row'; +import { Check } from '../../../../../common/runtime_types'; import { STATUS, UNNAMED_LOCATION } from '../../../../../common/constants'; interface MonitorStatusListProps { diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_status_column.tsx b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_status_column.tsx index 7e23be572a6f9c..8076fe66cc2086 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_status_column.tsx +++ b/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_status_column.tsx @@ -11,7 +11,7 @@ import { capitalize } from 'lodash'; import styled from 'styled-components'; import { EuiHealth, EuiFlexGroup, EuiFlexItem, EuiText, EuiToolTip } from '@elastic/eui'; import { parseTimestamp } from './parse_timestamp'; -import { Check } from '../../../../common/graphql/types'; +import { Check } from '../../../../common/runtime_types'; import { STATUS, SHORT_TIMESPAN_LOCALE, diff --git a/x-pack/legacy/plugins/uptime/public/components/higher_order/index.ts b/x-pack/legacy/plugins/uptime/public/components/higher_order/index.ts index e0e14456cfc684..0682f6d0478f36 100644 --- a/x-pack/legacy/plugins/uptime/public/components/higher_order/index.ts +++ b/x-pack/legacy/plugins/uptime/public/components/higher_order/index.ts @@ -4,5 +4,4 @@ * you may not use this file except in compliance with the Elastic License. */ -export { UptimeGraphQLQueryProps, withUptimeGraphQL } from './uptime_graphql_query'; export { ResponsiveWrapperProps, withResponsiveWrapper } from './responsive_wrapper'; diff --git a/x-pack/legacy/plugins/uptime/public/components/higher_order/uptime_graphql_query.tsx b/x-pack/legacy/plugins/uptime/public/components/higher_order/uptime_graphql_query.tsx deleted file mode 100644 index 6839050cec7a8b..00000000000000 --- a/x-pack/legacy/plugins/uptime/public/components/higher_order/uptime_graphql_query.tsx +++ /dev/null @@ -1,89 +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 { OperationVariables } from 'apollo-client'; -import { GraphQLError } from 'graphql'; -import React, { Fragment, useContext, useEffect, useState } from 'react'; -import { withApollo, WithApolloClient } from 'react-apollo'; -import { formatUptimeGraphQLErrorList } from '../../lib/helper/format_error_list'; -import { UptimeRefreshContext } from '../../contexts'; - -export interface UptimeGraphQLQueryProps { - loading: boolean; - data?: T; - errors?: GraphQLError[]; -} - -interface UptimeGraphQLProps { - implementsCustomErrorState?: boolean; - variables: OperationVariables; -} - -/** - * This HOC abstracts the task of querying our GraphQL endpoint, - * which eliminates the need for a lot of boilerplate code in the other components. - * - * @type T - the expected result's type - * @type P - any props the wrapped component will require - * @param WrappedComponent - the consuming component - * @param query - the graphQL query - */ -export function withUptimeGraphQL(WrappedComponent: any, query: any) { - type Props = UptimeGraphQLProps & WithApolloClient & P; - - return withApollo((props: Props) => { - const { lastRefresh } = useContext(UptimeRefreshContext); - const [loading, setLoading] = useState(true); - const [data, setData] = useState(undefined); - const [errors, setErrors] = useState(undefined); - let updateState = ( - loadingVal: boolean, - dataVal: T | undefined, - errorsVal: GraphQLError[] | undefined - ) => { - setLoading(loadingVal); - setData(dataVal); - setErrors(errorsVal); - }; - const { client, implementsCustomErrorState, variables } = props; - const fetch = () => { - setLoading(true); - client - .query({ fetchPolicy: 'network-only', query, variables }) - .then( - (result: any) => { - updateState(result.loading, result.data, result.errors); - }, - (result: any) => { - updateState(false, undefined, result.graphQLErrors); - } - ); - }; - useEffect(() => { - fetch(); - - /** - * If the `then` handler in `fetch`'s promise is fired after - * this component has unmounted, it will try to set state on an - * unmounted component, which indicates a memory leak and will trigger - * React warnings. - * - * We counteract this side effect by providing a cleanup function that will - * reassign the update function to do nothing with the returned values. - */ - return () => { - // this component is planned to be deprecated, for the time being - // we will want to preserve this for the reason above. - // eslint-disable-next-line react-hooks/exhaustive-deps - updateState = () => {}; - }; - }, [variables, lastRefresh]); - if (!implementsCustomErrorState && errors && errors.length > 0) { - return {formatUptimeGraphQLErrorList(errors)}; - } - return ; - }); -} diff --git a/x-pack/legacy/plugins/uptime/public/lib/adapters/framework/apollo_client_adapter.ts b/x-pack/legacy/plugins/uptime/public/lib/adapters/framework/apollo_client_adapter.ts deleted file mode 100644 index 2cec0d5fc8c64d..00000000000000 --- a/x-pack/legacy/plugins/uptime/public/lib/adapters/framework/apollo_client_adapter.ts +++ /dev/null @@ -1,16 +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 { InMemoryCache } from 'apollo-cache-inmemory'; -import { ApolloClient } from 'apollo-client'; -import { HttpLink } from 'apollo-link-http'; -import { CreateGraphQLClient } from './framework_adapter_types'; - -export const createApolloClient: CreateGraphQLClient = (uri: string, xsrfHeader: string) => - new ApolloClient({ - link: new HttpLink({ uri, credentials: 'same-origin', headers: { 'kbn-xsrf': xsrfHeader } }), - cache: new InMemoryCache({ dataIdFromObject: () => undefined }), - }); diff --git a/x-pack/legacy/plugins/uptime/public/lib/adapters/framework/framework_adapter_types.ts b/x-pack/legacy/plugins/uptime/public/lib/adapters/framework/framework_adapter_types.ts deleted file mode 100644 index 34cf48514c9324..00000000000000 --- a/x-pack/legacy/plugins/uptime/public/lib/adapters/framework/framework_adapter_types.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 { NormalizedCacheObject } from 'apollo-cache-inmemory'; -import { ApolloClient } from 'apollo-client'; - -export type GraphQLClient = ApolloClient; - -export type CreateGraphQLClient = (url: string, xsrfHeader: string) => GraphQLClient; diff --git a/x-pack/legacy/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx b/x-pack/legacy/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx index a2f3328b986128..71c73bf5ba5d4f 100644 --- a/x-pack/legacy/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx +++ b/x-pack/legacy/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx @@ -20,7 +20,6 @@ import { DEFAULT_TIMEPICKER_QUICK_RANGES, } from '../../../../common/constants'; import { UMFrameworkAdapter } from '../../lib'; -import { createApolloClient } from './apollo_client_adapter'; export const getKibanaFrameworkAdapter = ( core: CoreStart, @@ -60,7 +59,6 @@ export const getKibanaFrameworkAdapter = ( const props: UptimeAppProps = { basePath: basePath.get(), canSave, - client: createApolloClient(`${basePath.get()}/api/uptime/graphql`, 'true'), core, darkMode: core.uiSettings.get(DEFAULT_DARK_MODE), commonlyUsedRanges: core.uiSettings.get(DEFAULT_TIMEPICKER_QUICK_RANGES), diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/__snapshots__/format_error_string.test.ts.snap b/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/__snapshots__/format_error_string.test.ts.snap deleted file mode 100644 index 8519157e4039e0..00000000000000 --- a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/__snapshots__/format_error_string.test.ts.snap +++ /dev/null @@ -1,7 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`formatErrorString returns a formatted string containing each error 1`] = ` -"Error: foo is bar -Error: bar is not foo -" -`; diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/format_error_string.test.ts b/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/format_error_string.test.ts deleted file mode 100644 index ba437c05cbe2b0..00000000000000 --- a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/format_error_string.test.ts +++ /dev/null @@ -1,41 +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 { formatUptimeGraphQLErrorList } from '../format_error_list'; - -describe('formatErrorString', () => { - it('returns an empty string for empty array', () => { - const result = formatUptimeGraphQLErrorList([]); - expect(result).toEqual(''); - }); - it('returns a formatted string containing each error', () => { - const result = formatUptimeGraphQLErrorList([ - { - message: 'foo is bar', - locations: undefined, - path: undefined, - nodes: undefined, - source: undefined, - positions: undefined, - originalError: undefined, - extensions: undefined, - name: 'test error', - }, - { - message: 'bar is not foo', - locations: undefined, - path: undefined, - nodes: undefined, - source: undefined, - positions: undefined, - originalError: undefined, - extensions: undefined, - name: 'test error', - }, - ]); - expect(result).toMatchSnapshot(); - }); -}); diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/format_error_list.ts b/x-pack/legacy/plugins/uptime/public/lib/helper/format_error_list.ts deleted file mode 100644 index a23122c5eead51..00000000000000 --- a/x-pack/legacy/plugins/uptime/public/lib/helper/format_error_list.ts +++ /dev/null @@ -1,20 +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 { GraphQLError } from 'graphql'; - -export const formatUptimeGraphQLErrorList = (errors: GraphQLError[]) => - errors.reduce( - (errorString, error) => - errorString.concat( - `${i18n.translate('xpack.uptime.errorMessage', { - values: { message: error.message }, - defaultMessage: 'Error: {message}', - })}\n` - ), - '' - ); diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_apm_href.test.ts.snap b/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_apm_href.test.ts.snap deleted file mode 100644 index 53d336b52bd241..00000000000000 --- a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_apm_href.test.ts.snap +++ /dev/null @@ -1,5 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`getApmHref creates href with base path when present 1`] = `"foo/app/apm#/services?kuery=url.domain:%20%22www.elastic.co%22&rangeFrom=now-15m&rangeTo=now"`; - -exports[`getApmHref does not add a base path or extra slash when base path is empty string 1`] = `"/app/apm#/services?kuery=url.domain:%20%22www.elastic.co%22&rangeFrom=now-15m&rangeTo=now"`; diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_infra_href.test.ts.snap b/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_infra_href.test.ts.snap deleted file mode 100644 index e79eb50d384a8d..00000000000000 --- a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_infra_href.test.ts.snap +++ /dev/null @@ -1,19 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`getInfraHref getInfraContainerHref creates a link for valid parameters 1`] = `"foo/app/metrics/link-to/container-detail/test-container-id"`; - -exports[`getInfraHref getInfraContainerHref does not specify a base path when none is available 1`] = `"/app/metrics/link-to/container-detail/test-container-id"`; - -exports[`getInfraHref getInfraContainerHref returns the first item when multiple container ids are supplied 1`] = `"bar/app/metrics/link-to/container-detail/test-container-id"`; - -exports[`getInfraHref getInfraIpHref creates a link for valid parameters 1`] = `"bar/app/metrics/inventory?waffleFilter=(expression:'host.ip%20%3A%20151.101.202.217',kind:kuery)"`; - -exports[`getInfraHref getInfraIpHref does not specify a base path when none is available 1`] = `"/app/metrics/inventory?waffleFilter=(expression:'host.ip%20%3A%20151.101.202.217',kind:kuery)"`; - -exports[`getInfraHref getInfraIpHref returns a url for ors between multiple ips 1`] = `"foo/app/metrics/inventory?waffleFilter=(expression:'host.ip%20%3A%20152.151.23.192%20or%20host.ip%20%3A%20151.101.202.217',kind:kuery)"`; - -exports[`getInfraHref getInfraKubernetesHref creates a link for valid parameters 1`] = `"foo/app/metrics/link-to/pod-detail/test-pod-uid"`; - -exports[`getInfraHref getInfraKubernetesHref does not specify a base path when none is available 1`] = `"/app/metrics/link-to/pod-detail/test-pod-uid"`; - -exports[`getInfraHref getInfraKubernetesHref selects the first pod uid when there are multiple 1`] = `"/app/metrics/link-to/pod-detail/test-pod-uid"`; diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_logging_href.test.ts.snap b/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_logging_href.test.ts.snap deleted file mode 100644 index cfac6ce133c8ab..00000000000000 --- a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_logging_href.test.ts.snap +++ /dev/null @@ -1,13 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`getLoggingHref creates a container href with base path when present 1`] = `"bar/app/logs?logFilter=(expression:'container.id%20:%20test-container-id',kind:kuery)"`; - -exports[`getLoggingHref creates a container href without a base path if it's an empty string 1`] = `"/app/logs?logFilter=(expression:'container.id%20:%20test-container-id',kind:kuery)"`; - -exports[`getLoggingHref creates a pod href with base path when present 1`] = `"bar/app/logs?logFilter=(expression:'pod.uid%20:%20test-pod-id',kind:kuery)"`; - -exports[`getLoggingHref creates a pod href without a base path when it's an empty string 1`] = `"/app/logs?logFilter=(expression:'pod.uid%20:%20test-pod-id',kind:kuery)"`; - -exports[`getLoggingHref creates an ip href with base path when present 1`] = `"bar/app/logs?logFilter=(expression:'pod.uid%20:%20test-pod-id',kind:kuery)"`; - -exports[`getLoggingHref creates an ip href without a base path when it's an empty string 1`] = `"/app/logs?logFilter=(expression:'host.ip%20%3A%20151.101.202.217',kind:kuery)"`; diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_apm_href.test.ts b/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_apm_href.test.ts index db49e95896ac1d..f27ed78d593acc 100644 --- a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_apm_href.test.ts +++ b/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_apm_href.test.ts @@ -5,7 +5,7 @@ */ import { getApmHref } from '../get_apm_href'; -import { MonitorSummary } from '../../../../../common/graphql/types'; +import { MonitorSummary } from '../../../../../common/runtime_types'; describe('getApmHref', () => { let summary: MonitorSummary; @@ -29,7 +29,7 @@ describe('getApmHref', () => { uid: 'test-pod-id', }, }, - timestamp: '123', + timestamp: 123, }, ], timestamp: '123', @@ -43,11 +43,15 @@ describe('getApmHref', () => { it('creates href with base path when present', () => { const result = getApmHref(summary, 'foo', 'now-15m', 'now'); - expect(result).toMatchSnapshot(); + expect(result).toMatchInlineSnapshot( + `"foo/app/apm#/services?kuery=url.domain:%20%22www.elastic.co%22&rangeFrom=now-15m&rangeTo=now"` + ); }); it('does not add a base path or extra slash when base path is empty string', () => { const result = getApmHref(summary, '', 'now-15m', 'now'); - expect(result).toMatchSnapshot(); + expect(result).toMatchInlineSnapshot( + `"/app/apm#/services?kuery=url.domain:%20%22www.elastic.co%22&rangeFrom=now-15m&rangeTo=now"` + ); }); }); diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts b/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts index c2360c321da8fd..ee5db74af22c2c 100644 --- a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts +++ b/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts @@ -5,7 +5,7 @@ */ import { getInfraContainerHref, getInfraKubernetesHref, getInfraIpHref } from '../get_infra_href'; -import { MonitorSummary } from '../../../../../common/graphql/types'; +import { MonitorSummary } from '../../../../../common/runtime_types'; describe('getInfraHref', () => { let summary: MonitorSummary; @@ -13,7 +13,6 @@ describe('getInfraHref', () => { summary = { monitor_id: 'foo', state: { - summary: {}, checks: [ { monitor: { @@ -28,9 +27,11 @@ describe('getInfraHref', () => { uid: 'test-pod-uid', }, }, - timestamp: '123', + timestamp: 123, }, ], + summary: {}, + url: {}, timestamp: '123', }, }; @@ -38,11 +39,15 @@ describe('getInfraHref', () => { it('getInfraContainerHref creates a link for valid parameters', () => { const result = getInfraContainerHref(summary, 'foo'); - expect(result).toMatchSnapshot(); + expect(result).toMatchInlineSnapshot( + `"foo/app/metrics/link-to/container-detail/test-container-id"` + ); }); it('getInfraContainerHref does not specify a base path when none is available', () => { - expect(getInfraContainerHref(summary, '')).toMatchSnapshot(); + expect(getInfraContainerHref(summary, '')).toMatchInlineSnapshot( + `"/app/metrics/link-to/container-detail/test-container-id"` + ); }); it('getInfraContainerHref returns undefined when no container id is present', () => { @@ -65,7 +70,7 @@ describe('getInfraHref', () => { uid: 'test-pod-uid', }, }, - timestamp: '123', + timestamp: 123, }, { monitor: { @@ -80,10 +85,12 @@ describe('getInfraHref', () => { uid: 'test-pod-uid-bar', }, }, - timestamp: '123', + timestamp: 123, }, ]; - expect(getInfraContainerHref(summary, 'bar')).toMatchSnapshot(); + expect(getInfraContainerHref(summary, 'bar')).toMatchInlineSnapshot( + `"bar/app/metrics/link-to/container-detail/test-container-id"` + ); }); it('getInfraContainerHref returns undefined when checks are undefined', () => { @@ -94,11 +101,13 @@ describe('getInfraHref', () => { it('getInfraKubernetesHref creates a link for valid parameters', () => { const result = getInfraKubernetesHref(summary, 'foo'); expect(result).not.toBeUndefined(); - expect(result).toMatchSnapshot(); + expect(result).toMatchInlineSnapshot(`"foo/app/metrics/link-to/pod-detail/test-pod-uid"`); }); it('getInfraKubernetesHref does not specify a base path when none is available', () => { - expect(getInfraKubernetesHref(summary, '')).toMatchSnapshot(); + expect(getInfraKubernetesHref(summary, '')).toMatchInlineSnapshot( + `"/app/metrics/link-to/pod-detail/test-pod-uid"` + ); }); it('getInfraKubernetesHref returns undefined when no pod data is present', () => { @@ -121,7 +130,7 @@ describe('getInfraHref', () => { uid: 'test-pod-uid', }, }, - timestamp: '123', + timestamp: 123, }, { monitor: { @@ -136,10 +145,12 @@ describe('getInfraHref', () => { uid: 'test-pod-uid-bar', }, }, - timestamp: '123', + timestamp: 123, }, ]; - expect(getInfraKubernetesHref(summary, '')).toMatchSnapshot(); + expect(getInfraKubernetesHref(summary, '')).toMatchInlineSnapshot( + `"/app/metrics/link-to/pod-detail/test-pod-uid"` + ); }); it('getInfraKubernetesHref returns undefined when checks are undefined', () => { @@ -148,17 +159,21 @@ describe('getInfraHref', () => { }); it('getInfraKubernetesHref returns undefined when checks are null', () => { - summary.state.checks![0]!.kubernetes!.pod!.uid = null; + delete summary.state.checks![0]!.kubernetes!.pod!.uid; expect(getInfraKubernetesHref(summary, '')).toBeUndefined(); }); it('getInfraIpHref creates a link for valid parameters', () => { const result = getInfraIpHref(summary, 'bar'); - expect(result).toMatchSnapshot(); + expect(result).toMatchInlineSnapshot( + `"bar/app/metrics/inventory?waffleFilter=(expression:'host.ip%20%3A%20151.101.202.217',kind:kuery)"` + ); }); it('getInfraIpHref does not specify a base path when none is available', () => { - expect(getInfraIpHref(summary, '')).toMatchSnapshot(); + expect(getInfraIpHref(summary, '')).toMatchInlineSnapshot( + `"/app/metrics/inventory?waffleFilter=(expression:'host.ip%20%3A%20151.101.202.217',kind:kuery)"` + ); }); it('getInfraIpHref returns undefined when ip is undefined', () => { @@ -167,14 +182,14 @@ describe('getInfraHref', () => { }); it('getInfraIpHref returns undefined when ip is null', () => { - summary.state.checks![0].monitor.ip = null; + delete summary.state.checks![0].monitor.ip; expect(getInfraIpHref(summary, 'foo')).toBeUndefined(); }); it('getInfraIpHref returns a url for ors between multiple ips', () => { summary.state.checks = [ { - timestamp: '123', + timestamp: 123, monitor: { ip: '152.151.23.192', status: 'up', @@ -193,10 +208,12 @@ describe('getInfraHref', () => { uid: 'test-pod-uid', }, }, - timestamp: '123', + timestamp: 123, }, ]; - expect(getInfraIpHref(summary, 'foo')).toMatchSnapshot(); + expect(getInfraIpHref(summary, 'foo')).toMatchInlineSnapshot( + `"foo/app/metrics/inventory?waffleFilter=(expression:'host.ip%20%3A%20152.151.23.192%20or%20host.ip%20%3A%20151.101.202.217',kind:kuery)"` + ); }); it('getInfraIpHref returns undefined if checks are undefined', () => { diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts b/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts index 1117fa14299621..b188a8d1b8ef6e 100644 --- a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts +++ b/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts @@ -9,7 +9,7 @@ import { getLoggingKubernetesHref, getLoggingIpHref, } from '../get_logging_href'; -import { MonitorSummary } from '../../../../../common/graphql/types'; +import { MonitorSummary } from '../../../../../common/runtime_types'; describe('getLoggingHref', () => { let summary: MonitorSummary; @@ -33,10 +33,11 @@ describe('getLoggingHref', () => { uid: 'test-pod-id', }, }, - timestamp: '123', + timestamp: 123, }, ], timestamp: '123', + url: {}, }, }; }); @@ -44,37 +45,49 @@ describe('getLoggingHref', () => { it('creates a container href with base path when present', () => { const result = getLoggingContainerHref(summary, 'bar'); expect(result).not.toBeUndefined(); - expect(result).toMatchSnapshot(); + expect(result).toMatchInlineSnapshot( + `"bar/app/logs?logFilter=(expression:'container.id%20:%20test-container-id',kind:kuery)"` + ); }); it(`creates a container href without a base path if it's an empty string`, () => { const result = getLoggingContainerHref(summary, ''); expect(result).not.toBeUndefined(); - expect(result).toMatchSnapshot(); + expect(result).toMatchInlineSnapshot( + `"/app/logs?logFilter=(expression:'container.id%20:%20test-container-id',kind:kuery)"` + ); }); it(`creates an ip href with base path when present`, () => { const result = getLoggingKubernetesHref(summary, 'bar'); expect(result).not.toBeUndefined(); - expect(result).toMatchSnapshot(); + expect(result).toMatchInlineSnapshot( + `"bar/app/logs?logFilter=(expression:'pod.uid%20:%20test-pod-id',kind:kuery)"` + ); }); it('creates a pod href with base path when present', () => { const result = getLoggingKubernetesHref(summary, 'bar'); expect(result).not.toBeUndefined(); - expect(result).toMatchSnapshot(); + expect(result).toMatchInlineSnapshot( + `"bar/app/logs?logFilter=(expression:'pod.uid%20:%20test-pod-id',kind:kuery)"` + ); }); it(`creates a pod href without a base path when it's an empty string`, () => { const result = getLoggingKubernetesHref(summary, ''); expect(result).not.toBeUndefined(); - expect(result).toMatchSnapshot(); + expect(result).toMatchInlineSnapshot( + `"/app/logs?logFilter=(expression:'pod.uid%20:%20test-pod-id',kind:kuery)"` + ); }); it(`creates an ip href without a base path when it's an empty string`, () => { const result = getLoggingIpHref(summary, ''); expect(result).not.toBeUndefined(); - expect(result).toMatchSnapshot(); + expect(result).toMatchInlineSnapshot( + `"/app/logs?logFilter=(expression:'host.ip%20%3A%20151.101.202.217',kind:kuery)"` + ); }); it('returns undefined if necessary container is not present', () => { @@ -83,7 +96,7 @@ describe('getLoggingHref', () => { }); it('returns undefined if necessary container is null', () => { - summary.state.checks![0].container!.id = null; + delete summary.state.checks![0].container!.id; expect(getLoggingContainerHref(summary, '')).toBeUndefined(); }); @@ -93,7 +106,7 @@ describe('getLoggingHref', () => { }); it('returns undefined if necessary pod is null', () => { - summary.state.checks![0].kubernetes!.pod!.uid = null; + delete summary.state.checks![0].kubernetes!.pod!.uid; expect(getLoggingKubernetesHref(summary, '')).toBeUndefined(); }); @@ -103,7 +116,7 @@ describe('getLoggingHref', () => { }); it('returns undefined ip href if ip is null', () => { - summary.state.checks![0].monitor.ip = null; + delete summary.state.checks![0].monitor.ip; expect(getLoggingIpHref(summary, '')).toBeUndefined(); }); }); diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/build_href.ts b/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/build_href.ts index 19e437651090b7..0f830435be89de 100644 --- a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/build_href.ts +++ b/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/build_href.ts @@ -5,7 +5,7 @@ */ import { get } from 'lodash'; -import { Check } from '../../../../common/graphql/types'; +import { Check } from '../../../../common/runtime_types'; /** * Builds URLs to the designated features by extracting values from the provided diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/get_apm_href.ts b/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/get_apm_href.ts index aaa57acee6c6a7..0ff5a8acb33674 100644 --- a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/get_apm_href.ts +++ b/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/get_apm_href.ts @@ -6,7 +6,7 @@ import { get } from 'lodash'; import { addBasePath } from './add_base_path'; -import { MonitorSummary } from '../../../../common/graphql/types'; +import { MonitorSummary } from '../../../../common/runtime_types'; export const getApmHref = ( summary: MonitorSummary, diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/get_infra_href.ts b/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/get_infra_href.ts index 73065be395c764..384067e4b033bd 100644 --- a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/get_infra_href.ts +++ b/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/get_infra_href.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { MonitorSummary } from '../../../../common/graphql/types'; +import { MonitorSummary } from '../../../../common/runtime_types'; import { addBasePath } from './add_base_path'; import { buildHref } from './build_href'; diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/get_logging_href.ts b/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/get_logging_href.ts index b97b5a34855fb5..222c7b57c92725 100644 --- a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/get_logging_href.ts +++ b/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/get_logging_href.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { MonitorSummary } from '../../../../common/graphql/types'; +import { MonitorSummary } from '../../../../common/runtime_types'; import { addBasePath } from './add_base_path'; import { buildHref } from './build_href'; diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/series_has_down_values.ts b/x-pack/legacy/plugins/uptime/public/lib/helper/series_has_down_values.ts index 13079b912a1470..4ebeb350ed8927 100644 --- a/x-pack/legacy/plugins/uptime/public/lib/helper/series_has_down_values.ts +++ b/x-pack/legacy/plugins/uptime/public/lib/helper/series_has_down_values.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SummaryHistogramPoint } from '../../../common/graphql/types'; +import { HistogramPoint } from '../../../common/runtime_types'; -export const seriesHasDownValues = (series: SummaryHistogramPoint[] | null): boolean => { +export const seriesHasDownValues = (series: HistogramPoint[] | null): boolean => { return series ? series.some(point => !!point.down) : false; }; diff --git a/x-pack/legacy/plugins/uptime/public/lib/lib.ts b/x-pack/legacy/plugins/uptime/public/lib/lib.ts index aba151bf5aab3a..6b6191441c9316 100644 --- a/x-pack/legacy/plugins/uptime/public/lib/lib.ts +++ b/x-pack/legacy/plugins/uptime/public/lib/lib.ts @@ -4,9 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { NormalizedCacheObject } from 'apollo-cache-inmemory'; -import ApolloClient from 'apollo-client'; -import React from 'react'; +import { ReactElement } from 'react'; import { ChromeBreadcrumb } from 'src/core/public'; import { UMBadge } from '../badge'; import { UptimeAppProps } from '../uptime_app'; @@ -19,9 +17,7 @@ export type UMUpdateBreadcrumbs = (breadcrumbs: ChromeBreadcrumb[]) => void; export type UMUpdateBadge = (badge: UMBadge) => void; -export type UMGraphQLClient = ApolloClient; // | OtherClientType - -export type BootstrapUptimeApp = (props: UptimeAppProps) => React.ReactElement; +export type BootstrapUptimeApp = (props: UptimeAppProps) => ReactElement; export interface UMFrameworkAdapter { render(element: any): void; diff --git a/x-pack/legacy/plugins/uptime/public/pages/overview.tsx b/x-pack/legacy/plugins/uptime/public/pages/overview.tsx index 5550facaf42e9f..5b51a208a4c37b 100644 --- a/x-pack/legacy/plugins/uptime/public/pages/overview.tsx +++ b/x-pack/legacy/plugins/uptime/public/pages/overview.tsx @@ -5,20 +5,15 @@ */ import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import React, { useContext, useEffect, useState } from 'react'; +import React, { useEffect } from 'react'; import styled from 'styled-components'; import { i18n } from '@kbn/i18n'; -import { - MonitorList, - OverviewPageParsingErrorCallout, - StatusPanel, -} from '../components/functional'; +import { OverviewPageParsingErrorCallout, StatusPanel } from '../components/functional'; import { useUptimeTelemetry, UptimePage, useGetUrlParams } from '../hooks'; import { stringifyUrlParams } from '../lib/helper/stringify_url_params'; import { useTrackPageview } from '../../../../../plugins/observability/public'; import { DataPublicPluginSetup, IIndexPattern } from '../../../../../../src/plugins/data/public'; -import { UptimeThemeContext } from '../contexts'; -import { EmptyState, FilterGroup, KueryBar } from '../components/connected'; +import { EmptyState, FilterGroup, KueryBar, MonitorList } from '../components/connected'; import { useUpdateKueryString } from '../hooks'; import { PageHeader } from './page_header'; import { useBreadcrumbs } from '../hooks/use_breadcrumbs'; @@ -40,34 +35,9 @@ const EuiFlexItemStyled = styled(EuiFlexItem)` } `; -// TODO: these values belong deeper down in the monitor -// list pagination control, but are here temporarily until we -// are done removing GraphQL -const DEFAULT_PAGE_SIZE = 10; -const LOCAL_STORAGE_KEY = 'xpack.uptime.monitorList.pageSize'; -const getMonitorListPageSizeValue = () => { - const value = parseInt(localStorage.getItem(LOCAL_STORAGE_KEY) ?? '', 10); - if (isNaN(value)) { - return DEFAULT_PAGE_SIZE; - } - return value; -}; - export const OverviewPageComponent = ({ autocomplete, indexPattern, setEsKueryFilters }: Props) => { - const { colors } = useContext(UptimeThemeContext); - // TODO: this is temporary until we migrate the monitor list to our Redux implementation - const [monitorListPageSize, setMonitorListPageSize] = useState( - getMonitorListPageSizeValue() - ); const { absoluteDateRangeStart, absoluteDateRangeEnd, ...params } = useGetUrlParams(); - const { - dateRangeStart, - dateRangeEnd, - pagination, - statusFilter, - search, - filters: urlFilters, - } = params; + const { search, filters: urlFilters } = params; useUptimeTelemetry(UptimePage.Overview); @@ -80,13 +50,6 @@ export const OverviewPageComponent = ({ autocomplete, indexPattern, setEsKueryFi setEsKueryFilters(esFilters ?? ''); }, [esFilters, setEsKueryFilters]); - const sharedProps = { - dateRangeStart, - dateRangeEnd, - statusFilter, - filters: esFilters, - }; - const linkParameters = stringifyUrlParams(params, true); const heading = i18n.translate('xpack.uptime.overviewPage.headerText', { @@ -117,20 +80,7 @@ export const OverviewPageComponent = ({ autocomplete, indexPattern, setEsKueryFi - + ); diff --git a/x-pack/legacy/plugins/uptime/public/pages/page_header.tsx b/x-pack/legacy/plugins/uptime/public/pages/page_header.tsx index 821a70c85dc7c5..49e6ddb56602ca 100644 --- a/x-pack/legacy/plugins/uptime/public/pages/page_header.tsx +++ b/x-pack/legacy/plugins/uptime/public/pages/page_header.tsx @@ -17,7 +17,9 @@ interface PageHeaderProps { extraLinks?: boolean; datePicker?: boolean; } - +const SETTINGS_LINK_TEXT = i18n.translate('xpack.uptime.page_header.settingsLink', { + defaultMessage: 'Settings', +}); export const PageHeader = React.memo( ({ headingText, extraLinks = false, datePicker = true }: PageHeaderProps) => { const datePickerComponent = datePicker ? ( @@ -26,9 +28,6 @@ export const PageHeader = React.memo( ) : null; - const settingsLinkText = i18n.translate('xpack.uptime.page_header.settingsLink', { - defaultMessage: 'Settings', - }); const extraLinkComponents = !extraLinks ? null : ( @@ -37,7 +36,7 @@ export const PageHeader = React.memo( - {settingsLinkText} + {SETTINGS_LINK_TEXT} diff --git a/x-pack/legacy/plugins/uptime/public/pages/settings.tsx b/x-pack/legacy/plugins/uptime/public/pages/settings.tsx index 049dffecd3f2ef..6defb96e0da3d7 100644 --- a/x-pack/legacy/plugins/uptime/public/pages/settings.tsx +++ b/x-pack/legacy/plugins/uptime/public/pages/settings.tsx @@ -67,7 +67,7 @@ export const SettingsPage = () => { const dispatch = useDispatch(); useEffect(() => { - dispatch(getDynamicSettings({})); + dispatch(getDynamicSettings()); }, [dispatch]); const [formFields, setFormFields] = useState(dss.settings || null); diff --git a/x-pack/legacy/plugins/uptime/public/queries/monitor_states_query.ts b/x-pack/legacy/plugins/uptime/public/queries/monitor_states_query.ts deleted file mode 100644 index 676e638c239de2..00000000000000 --- a/x-pack/legacy/plugins/uptime/public/queries/monitor_states_query.ts +++ /dev/null @@ -1,110 +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 gql from 'graphql-tag'; - -export const monitorStatesQueryString = ` -query MonitorStates($dateRangeStart: String!, $dateRangeEnd: String!, $pagination: String, $filters: String, $statusFilter: String, $pageSize: Int) { - monitorStates: getMonitorStates( - dateRangeStart: $dateRangeStart - dateRangeEnd: $dateRangeEnd - pagination: $pagination - filters: $filters - statusFilter: $statusFilter - pageSize: $pageSize - ) { - prevPagePagination - nextPagePagination - totalSummaryCount - summaries { - monitor_id - histogram { - count - points { - timestamp - up - down - } - } - state { - agent { - id - } - checks { - agent { - id - } - container { - id - } - kubernetes { - pod { - uid - } - } - monitor { - ip - name - status - } - observer { - geo { - name - location { - lat - lon - } - } - } - timestamp - } - geo { - name - location { - lat - lon - } - } - observer { - geo { - name - location { - lat - lon - } - } - } - monitor { - id - name - status - type - } - summary { - up - down - geo { - name - location { - lat - lon - } - } - } - url { - full - domain - } - timestamp - } - } - } -} -`; - -export const monitorStatesQuery = gql` - ${monitorStatesQueryString} -`; diff --git a/x-pack/legacy/plugins/uptime/public/state/actions/dynamic_settings.ts b/x-pack/legacy/plugins/uptime/public/state/actions/dynamic_settings.ts index d78c725c4b599d..3dbb1aa2346216 100644 --- a/x-pack/legacy/plugins/uptime/public/state/actions/dynamic_settings.ts +++ b/x-pack/legacy/plugins/uptime/public/state/actions/dynamic_settings.ts @@ -6,7 +6,7 @@ import { createAction } from 'redux-actions'; import { DynamicSettings } from '../../../common/runtime_types'; -export const getDynamicSettings = createAction<{}>('GET_DYNAMIC_SETTINGS'); +export const getDynamicSettings = createAction('GET_DYNAMIC_SETTINGS'); export const getDynamicSettingsSuccess = createAction( 'GET_DYNAMIC_SETTINGS_SUCCESS' ); @@ -17,4 +17,3 @@ export const setDynamicSettingsSuccess = createAction( 'SET_DYNAMIC_SETTINGS_SUCCESS' ); export const setDynamicSettingsFail = createAction('SET_DYNAMIC_SETTINGS_FAIL'); -export const acknowledgeSetDynamicSettings = createAction<{}>('ACKNOWLEDGE_SET_DYNAMIC_SETTINGS'); diff --git a/x-pack/legacy/plugins/uptime/public/state/actions/index.ts b/x-pack/legacy/plugins/uptime/public/state/actions/index.ts index 4563e6bfc4f0eb..0dc6baa0b2e50d 100644 --- a/x-pack/legacy/plugins/uptime/public/state/actions/index.ts +++ b/x-pack/legacy/plugins/uptime/public/state/actions/index.ts @@ -7,6 +7,7 @@ export * from './overview_filters'; export * from './snapshot'; export * from './ui'; +export * from './monitor_list'; export * from './monitor_status'; export * from './index_patternts'; export * from './ping'; diff --git a/x-pack/legacy/plugins/uptime/public/state/actions/monitor_list.ts b/x-pack/legacy/plugins/uptime/public/state/actions/monitor_list.ts new file mode 100644 index 00000000000000..ee2267a9058afc --- /dev/null +++ b/x-pack/legacy/plugins/uptime/public/state/actions/monitor_list.ts @@ -0,0 +1,12 @@ +/* + * 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 { createAction } from 'redux-actions'; +import { FetchMonitorStatesQueryArgs, MonitorSummaryResult } from '../../../common/runtime_types'; + +export const getMonitorList = createAction('GET_MONITOR_LIST'); +export const getMonitorListSuccess = createAction('GET_MONITOR_LIST_SUCCESS'); +export const getMonitorListFailure = createAction('GET_MONITOR_LIST_FAIL'); diff --git a/x-pack/legacy/plugins/uptime/public/state/actions/monitor_status.ts b/x-pack/legacy/plugins/uptime/public/state/actions/monitor_status.ts index e8c862e209739a..3d480e66c9e0b2 100644 --- a/x-pack/legacy/plugins/uptime/public/state/actions/monitor_status.ts +++ b/x-pack/legacy/plugins/uptime/public/state/actions/monitor_status.ts @@ -3,6 +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 { createAction } from 'redux-actions'; import { QueryParams } from './types'; import { Ping } from '../../../common/runtime_types'; diff --git a/x-pack/legacy/plugins/uptime/public/state/api/dynamic_settings.ts b/x-pack/legacy/plugins/uptime/public/state/api/dynamic_settings.ts index 8ade2aa4595dcd..e52e40c53513cb 100644 --- a/x-pack/legacy/plugins/uptime/public/state/api/dynamic_settings.ts +++ b/x-pack/legacy/plugins/uptime/public/state/api/dynamic_settings.ts @@ -14,22 +14,15 @@ import { apiService } from './utils'; const apiPath = '/api/uptime/dynamic_settings'; -interface BaseApiRequest { - basePath: string; -} - -type SaveApiRequest = BaseApiRequest & { +interface SaveApiRequest { settings: DynamicSettings; -}; +} -export const getDynamicSettings = async ({ - basePath, -}: BaseApiRequest): Promise => { +export const getDynamicSettings = async (): Promise => { return await apiService.get(apiPath, undefined, DynamicSettingsType); }; export const setDynamicSettings = async ({ - basePath, settings, }: SaveApiRequest): Promise => { return await apiService.post(apiPath, settings, DynamicSettingsSaveType); diff --git a/x-pack/legacy/plugins/uptime/public/state/api/index.ts b/x-pack/legacy/plugins/uptime/public/state/api/index.ts index 793762c0f4a10a..a50afb3f866de7 100644 --- a/x-pack/legacy/plugins/uptime/public/state/api/index.ts +++ b/x-pack/legacy/plugins/uptime/public/state/api/index.ts @@ -5,6 +5,7 @@ */ export * from './monitor'; +export * from './monitor_list'; export * from './overview_filters'; export * from './snapshot'; export * from './monitor_status'; diff --git a/x-pack/legacy/plugins/uptime/public/state/api/monitor_list.ts b/x-pack/legacy/plugins/uptime/public/state/api/monitor_list.ts new file mode 100644 index 00000000000000..084bcb4bd2a915 --- /dev/null +++ b/x-pack/legacy/plugins/uptime/public/state/api/monitor_list.ts @@ -0,0 +1,19 @@ +/* + * 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 { API_URLS } from '../../../common/constants'; +import { apiService } from './utils'; +import { + FetchMonitorStatesQueryArgs, + MonitorSummaryResult, + MonitorSummaryResultType, +} from '../../../common/runtime_types'; + +export const fetchMonitorList = async ( + params: FetchMonitorStatesQueryArgs +): Promise => { + return await apiService.get(API_URLS.MONITOR_LIST, params, MonitorSummaryResultType); +}; diff --git a/x-pack/legacy/plugins/uptime/public/state/effects/dynamic_settings.ts b/x-pack/legacy/plugins/uptime/public/state/effects/dynamic_settings.ts index 9bc8bd95be68c6..bee92813aa1f0a 100644 --- a/x-pack/legacy/plugins/uptime/public/state/effects/dynamic_settings.ts +++ b/x-pack/legacy/plugins/uptime/public/state/effects/dynamic_settings.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { takeLatest, put, call, select } from 'redux-saga/effects'; +import { takeLatest, put, call } from 'redux-saga/effects'; import { Action } from 'redux-actions'; import { i18n } from '@kbn/i18n'; import { fetchEffectFactory } from './fetch_effect'; @@ -21,7 +21,6 @@ import { setDynamicSettings as setDynamicSettingsAPI, } from '../api'; import { DynamicSettings } from '../../../common/runtime_types'; -import { getBasePath } from '../selectors'; import { kibanaService } from '../kibana_service'; export function* fetchDynamicSettingsEffect() { @@ -46,8 +45,7 @@ export function* setDynamicSettingsEffect() { }); return; } - const basePath = yield select(getBasePath); - yield call(setDynamicSettingsAPI, { settings: action.payload, basePath }); + yield call(setDynamicSettingsAPI, { settings: action.payload }); yield put(setDynamicSettingsSuccess(action.payload)); kibanaService.core.notifications.toasts.addSuccess('Settings saved!'); } catch (err) { diff --git a/x-pack/legacy/plugins/uptime/public/state/effects/index.ts b/x-pack/legacy/plugins/uptime/public/state/effects/index.ts index 8df11312b64550..739179c5bbeae6 100644 --- a/x-pack/legacy/plugins/uptime/public/state/effects/index.ts +++ b/x-pack/legacy/plugins/uptime/public/state/effects/index.ts @@ -8,6 +8,7 @@ import { fork } from 'redux-saga/effects'; import { fetchMonitorDetailsEffect } from './monitor'; import { fetchOverviewFiltersEffect } from './overview_filters'; import { fetchSnapshotCountEffect } from './snapshot'; +import { fetchMonitorListEffect } from './monitor_list'; import { fetchMonitorStatusEffect } from './monitor_status'; import { fetchDynamicSettingsEffect, setDynamicSettingsEffect } from './dynamic_settings'; import { fetchIndexPatternEffect } from './index_pattern'; @@ -20,6 +21,7 @@ export function* rootEffect() { yield fork(fetchMonitorDetailsEffect); yield fork(fetchSnapshotCountEffect); yield fork(fetchOverviewFiltersEffect); + yield fork(fetchMonitorListEffect); yield fork(fetchMonitorStatusEffect); yield fork(fetchDynamicSettingsEffect); yield fork(setDynamicSettingsEffect); diff --git a/x-pack/legacy/plugins/uptime/public/state/effects/monitor_list.ts b/x-pack/legacy/plugins/uptime/public/state/effects/monitor_list.ts new file mode 100644 index 00000000000000..b607641ecd7d0e --- /dev/null +++ b/x-pack/legacy/plugins/uptime/public/state/effects/monitor_list.ts @@ -0,0 +1,17 @@ +/* + * 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 { takeLatest } from 'redux-saga/effects'; +import { getMonitorList, getMonitorListSuccess, getMonitorListFailure } from '../actions'; +import { fetchMonitorList } from '../api'; +import { fetchEffectFactory } from './fetch_effect'; + +export function* fetchMonitorListEffect() { + yield takeLatest( + getMonitorList, + fetchEffectFactory(fetchMonitorList, getMonitorListSuccess, getMonitorListFailure) + ); +} diff --git a/x-pack/legacy/plugins/uptime/public/state/reducers/index.ts b/x-pack/legacy/plugins/uptime/public/state/reducers/index.ts index 0a3ff35df0599f..294bde2f277ec5 100644 --- a/x-pack/legacy/plugins/uptime/public/state/reducers/index.ts +++ b/x-pack/legacy/plugins/uptime/public/state/reducers/index.ts @@ -10,6 +10,7 @@ import { overviewFiltersReducer } from './overview_filters'; import { snapshotReducer } from './snapshot'; import { uiReducer } from './ui'; import { monitorStatusReducer } from './monitor_status'; +import { monitorListReducer } from './monitor_list'; import { dynamicSettingsReducer } from './dynamic_settings'; import { indexPatternReducer } from './index_pattern'; import { pingReducer } from './ping'; @@ -23,6 +24,7 @@ export const rootReducer = combineReducers({ overviewFilters: overviewFiltersReducer, snapshot: snapshotReducer, ui: uiReducer, + monitorList: monitorListReducer, monitorStatus: monitorStatusReducer, dynamicSettings: dynamicSettingsReducer, indexPattern: indexPatternReducer, diff --git a/x-pack/legacy/plugins/uptime/public/state/reducers/monitor_duration.ts b/x-pack/legacy/plugins/uptime/public/state/reducers/monitor_duration.ts index 0e1771c393e50c..ec6b374c1057ce 100644 --- a/x-pack/legacy/plugins/uptime/public/state/reducers/monitor_duration.ts +++ b/x-pack/legacy/plugins/uptime/public/state/reducers/monitor_duration.ts @@ -24,9 +24,9 @@ const initialState: MonitorDuration = { errors: [], }; -type PayLoad = MonitorDurationResult & Error; +type Payload = MonitorDurationResult & Error; -export const monitorDurationReducer = handleActions( +export const monitorDurationReducer = handleActions( { [String(getMonitorDurationAction)]: (state: MonitorDuration) => ({ ...state, diff --git a/x-pack/legacy/plugins/uptime/public/state/reducers/monitor_list.ts b/x-pack/legacy/plugins/uptime/public/state/reducers/monitor_list.ts new file mode 100644 index 00000000000000..cf895aebeb7558 --- /dev/null +++ b/x-pack/legacy/plugins/uptime/public/state/reducers/monitor_list.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 { handleActions, Action } from 'redux-actions'; +import { getMonitorList, getMonitorListSuccess, getMonitorListFailure } from '../actions'; +import { MonitorSummaryResult } from '../../../common/runtime_types'; + +export interface MonitorList { + list: MonitorSummaryResult; + error?: Error; + loading: boolean; +} + +export const initialState: MonitorList = { + list: { + nextPagePagination: null, + prevPagePagination: null, + summaries: [], + totalSummaryCount: 0, + }, + loading: false, +}; + +type Payload = MonitorSummaryResult & Error; + +export const monitorListReducer = handleActions( + { + [String(getMonitorList)]: (state: MonitorList) => ({ + ...state, + loading: true, + }), + [String(getMonitorListSuccess)]: ( + state: MonitorList, + action: Action + ) => ({ + ...state, + loading: false, + error: undefined, + list: { ...action.payload }, + }), + [String(getMonitorListFailure)]: (state: MonitorList, action: Action) => ({ + ...state, + error: action.payload, + loading: false, + }), + }, + initialState +); diff --git a/x-pack/legacy/plugins/uptime/public/state/selectors/__tests__/index.test.ts b/x-pack/legacy/plugins/uptime/public/state/selectors/__tests__/index.test.ts index 77902f347f6f93..2b7c04178e9b4b 100644 --- a/x-pack/legacy/plugins/uptime/public/state/selectors/__tests__/index.test.ts +++ b/x-pack/legacy/plugins/uptime/public/state/selectors/__tests__/index.test.ts @@ -71,6 +71,15 @@ describe('state selectors', () => { loading: false, errors: [], }, + monitorList: { + list: { + prevPagePagination: null, + nextPagePagination: null, + summaries: [], + totalSummaryCount: 0, + }, + loading: false, + }, ml: { mlJob: { data: null, diff --git a/x-pack/legacy/plugins/uptime/public/state/selectors/index.ts b/x-pack/legacy/plugins/uptime/public/state/selectors/index.ts index 37695e42743066..dc5df3f93804db 100644 --- a/x-pack/legacy/plugins/uptime/public/state/selectors/index.ts +++ b/x-pack/legacy/plugins/uptime/public/state/selectors/index.ts @@ -92,3 +92,8 @@ export const selectMonitorStatusAlert = ({ indexPattern, overviewFilters, ui }: export const indexStatusSelector = ({ indexStatus }: AppState) => { return indexStatus.indexStatus; }; + +export const monitorListSelector = ({ monitorList, ui: { lastRefresh } }: AppState) => ({ + monitorList, + lastRefresh, +}); diff --git a/x-pack/legacy/plugins/uptime/public/uptime_app.tsx b/x-pack/legacy/plugins/uptime/public/uptime_app.tsx index dafb20dc9c323d..556e5b9bf299ed 100644 --- a/x-pack/legacy/plugins/uptime/public/uptime_app.tsx +++ b/x-pack/legacy/plugins/uptime/public/uptime_app.tsx @@ -7,13 +7,12 @@ import { EuiPage, EuiErrorBoundary } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { useEffect } from 'react'; -import { ApolloProvider } from 'react-apollo'; import { Provider as ReduxProvider } from 'react-redux'; import { BrowserRouter as Router } from 'react-router-dom'; import { I18nStart, ChromeBreadcrumb, CoreStart } from 'src/core/public'; import { PluginsSetup } from 'ui/new_platform/new_platform'; import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public'; -import { UMGraphQLClient, UMUpdateBadge } from './lib/lib'; +import { UMUpdateBadge } from './lib/lib'; import { UptimeRefreshContextProvider, UptimeSettingsContextProvider, @@ -39,7 +38,6 @@ export interface UptimeAppColors { export interface UptimeAppProps { basePath: string; canSave: boolean; - client: UMGraphQLClient; core: CoreStart; darkMode: boolean; i18n: I18nStart; @@ -59,7 +57,6 @@ const Application = (props: UptimeAppProps) => { const { basePath, canSave, - client, core, darkMode, i18n: i18nCore, @@ -97,25 +94,23 @@ const Application = (props: UptimeAppProps) => { - - - - - - -
- - -
-
-
-
-
-
-
+ + + + + +
+ + +
+
+
+
+
+
diff --git a/x-pack/legacy/plugins/uptime/scripts/gql_gen.json b/x-pack/legacy/plugins/uptime/scripts/gql_gen.json deleted file mode 100644 index 87b8233dd1eeb3..00000000000000 --- a/x-pack/legacy/plugins/uptime/scripts/gql_gen.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "flattenTypes": true, - "generatorConfig": {}, - "primitives": { - "String": "string", - "Int": "number", - "Float": "number", - "Boolean": "boolean", - "ID": "string" - } -} diff --git a/x-pack/legacy/plugins/uptime/scripts/infer_graphql_types.js b/x-pack/legacy/plugins/uptime/scripts/infer_graphql_types.js deleted file mode 100644 index 2499e15bf4e239..00000000000000 --- a/x-pack/legacy/plugins/uptime/scripts/infer_graphql_types.js +++ /dev/null @@ -1,45 +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. - */ - -require('../../../../../src/setup_node_env'); - -const { resolve } = require('path'); -// eslint-disable-next-line import/no-extraneous-dependencies, import/no-unresolved -const { generate } = require('graphql-code-generator'); - -const CONFIG_PATH = resolve(__dirname, 'gql_gen.json'); -const OUTPUT_INTROSPECTION_PATH = resolve('common', 'graphql', 'introspection.json'); -const OUTPUT_TYPES_PATH = resolve('common', 'graphql', 'types.ts'); -const SCHEMA_PATH = resolve(__dirname, 'graphql_schemas.ts'); - -async function main() { - await generate( - { - args: [], - config: CONFIG_PATH, - out: OUTPUT_INTROSPECTION_PATH, - overwrite: true, - schema: SCHEMA_PATH, - template: 'graphql-codegen-introspection-template', - }, - true - ); - await generate( - { - args: [], - config: CONFIG_PATH, - out: OUTPUT_TYPES_PATH, - overwrite: true, - schema: SCHEMA_PATH, - template: 'graphql-codegen-typescript-template', - }, - true - ); -} - -if (require.main === module) { - main(); -} diff --git a/x-pack/plugins/apm/server/lib/apm_telemetry/index.ts b/x-pack/plugins/apm/server/lib/apm_telemetry/index.ts index a78b2b93a250d1..3eb61bb1307258 100644 --- a/x-pack/plugins/apm/server/lib/apm_telemetry/index.ts +++ b/x-pack/plugins/apm/server/lib/apm_telemetry/index.ts @@ -87,7 +87,8 @@ export async function createApmTelemetry({ return { run: async () => { await collectAndStore(); - } + }, + cancel: async () => {} }; } } diff --git a/x-pack/plugins/apm/typings/es_schemas/raw/span_raw.ts b/x-pack/plugins/apm/typings/es_schemas/raw/span_raw.ts index 4d5d2c5c4a12e8..e98b2f52089b32 100644 --- a/x-pack/plugins/apm/typings/es_schemas/raw/span_raw.ts +++ b/x-pack/plugins/apm/typings/es_schemas/raw/span_raw.ts @@ -52,4 +52,5 @@ export interface SpanRaw extends APMBaseDoc { id: string; }; observer?: Observer; + child_ids?: string[]; } diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/action.ts b/x-pack/plugins/endpoint/public/applications/endpoint/store/action.ts index 2dce8ead385847..a32ecb4b455617 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/action.ts +++ b/x-pack/plugins/endpoint/public/applications/endpoint/store/action.ts @@ -10,6 +10,9 @@ import { RoutingAction } from './routing'; import { PolicyListAction } from './policy_list'; import { PolicyDetailsAction } from './policy_details'; +/** + * The entire set of redux actions recognized by our reducer. + */ export type AppAction = | HostAction | AlertAction diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/middleware.ts b/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/middleware.ts index 52d72c66314433..90d6b8b82198af 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/middleware.ts +++ b/x-pack/plugins/endpoint/public/applications/endpoint/store/alerts/middleware.ts @@ -6,13 +6,15 @@ import { IIndexPattern } from 'src/plugins/data/public'; import { AlertResultList, AlertDetails } from '../../../../../common/types'; -import { AppAction } from '../action'; -import { MiddlewareFactory, AlertListState } from '../../types'; +import { ImmutableMiddlewareFactory, AlertListState } from '../../types'; import { isOnAlertPage, apiQueryParams, hasSelectedAlert, uiQueryParams } from './selectors'; import { cloneHttpFetchQuery } from '../../../../common/clone_http_fetch_query'; import { EndpointAppConstants } from '../../../../../common/types'; -export const alertMiddlewareFactory: MiddlewareFactory = (coreStart, depsStart) => { +export const alertMiddlewareFactory: ImmutableMiddlewareFactory = ( + coreStart, + depsStart +) => { async function fetchIndexPatterns(): Promise { const { indexPatterns } = depsStart.data; const eventsPattern: { indexPattern: string } = await coreStart.http.get( @@ -29,7 +31,7 @@ export const alertMiddlewareFactory: MiddlewareFactory = (coreSt return [indexPattern]; } - return api => next => async (action: AppAction) => { + return api => next => async action => { next(action); const state = api.getState(); if (action.type === 'userChangedUrl' && isOnAlertPage(state)) { diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/middleware.ts b/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/middleware.ts index 9481b6633f12e5..83e11f5408bcda 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/middleware.ts +++ b/x-pack/plugins/endpoint/public/applications/endpoint/store/hosts/middleware.ts @@ -4,13 +4,12 @@ * you may not use this file except in compliance with the Elastic License. */ -import { MiddlewareFactory } from '../../types'; +import { ImmutableMiddlewareFactory } from '../../types'; import { pageIndex, pageSize, isOnHostPage, hasSelectedHost, uiQueryParams } from './selectors'; import { HostListState } from '../../types'; -import { AppAction } from '../action'; -export const hostMiddlewareFactory: MiddlewareFactory = coreStart => { - return ({ getState, dispatch }) => next => async (action: AppAction) => { +export const hostMiddlewareFactory: ImmutableMiddlewareFactory = coreStart => { + return ({ getState, dispatch }) => next => async action => { next(action); const state = getState(); if ( diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/index.ts b/x-pack/plugins/endpoint/public/applications/endpoint/store/index.ts index 60758f0f5fea08..a4d0b3a8b98156 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/index.ts +++ b/x-pack/plugins/endpoint/public/applications/endpoint/store/index.ts @@ -4,44 +4,25 @@ * you may not use this file except in compliance with the Elastic License. */ -import { - createStore, - compose, - applyMiddleware, - Store, - MiddlewareAPI, - Dispatch, - Middleware, -} from 'redux'; +import { createStore, compose, applyMiddleware, Store } from 'redux'; import { CoreStart } from 'kibana/public'; import { appReducer } from './reducer'; import { alertMiddlewareFactory } from './alerts/middleware'; import { hostMiddlewareFactory } from './hosts'; import { policyListMiddlewareFactory } from './policy_list'; import { policyDetailsMiddlewareFactory } from './policy_details'; -import { GlobalState, MiddlewareFactory } from '../types'; -import { AppAction } from './action'; +import { ImmutableMiddlewareFactory, SubstateMiddlewareFactory } from '../types'; import { EndpointPluginStartDependencies } from '../../../plugin'; const composeWithReduxDevTools = (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({ name: 'EndpointApp' }) : compose; -export type Selector = (state: S) => R; - -/** - * Wrap Redux Middleware and adjust 'getState()' to return the namespace from 'GlobalState that applies to the given Middleware concern. - * - * @param selector - * @param middleware - */ -export const substateMiddlewareFactory = ( - selector: Selector, - middleware: Middleware<{}, Substate, Dispatch> -): Middleware<{}, GlobalState, Dispatch> => { +export const substateMiddlewareFactory: SubstateMiddlewareFactory = (selector, middleware) => { return api => { - const substateAPI: MiddlewareAPI, Substate> = { + const substateAPI = { ...api, + // Return just the substate instead of global state. getState() { return selector(api.getState()); }, @@ -66,7 +47,7 @@ export const appStoreFactory: (middlewareDeps?: { * Any additional Redux Middlewares * (should only be used for testing - example: to inject the action spy middleware) */ - additionalMiddleware?: Array>; + additionalMiddleware?: Array>; }) => Store = middlewareDeps => { let middleware; if (middlewareDeps) { diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/middleware.ts b/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/middleware.ts index 7a3fbe7f23b9bb..7f17f5381fbda8 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/middleware.ts +++ b/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/middleware.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { MiddlewareFactory, PolicyDetailsState, UpdatePolicyResponse } from '../../types'; +import { ImmutableMiddlewareFactory, PolicyDetailsState, UpdatePolicyResponse } from '../../types'; import { policyIdFromParams, isOnPolicyDetailsPage, policyDetails } from './selectors'; import { sendGetDatasource, @@ -14,7 +14,7 @@ import { import { PolicyData } from '../../../../../common/types'; import { factory as policyConfigFactory } from '../../../../../common/models/policy_config'; -export const policyDetailsMiddlewareFactory: MiddlewareFactory = coreStart => { +export const policyDetailsMiddlewareFactory: ImmutableMiddlewareFactory = coreStart => { const http = coreStart.http; return ({ getState, dispatch }) => next => async action => { diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/selectors.ts b/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/selectors.ts index 98e129132e1cb1..4fd36d8d0a33fe 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/selectors.ts +++ b/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_details/selectors.ts @@ -23,8 +23,8 @@ export const isOnPolicyDetailsPage = (state: Immutable) => { }; /** Returns the policyId from the url */ -export const policyIdFromParams: (state: PolicyDetailsState) => string = createSelector( - (state: PolicyDetailsState) => state.location, +export const policyIdFromParams: (state: Immutable) => string = createSelector( + state => state.location, (location: PolicyDetailsState['location']) => { if (location) { return location.pathname.split('/')[2]; diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/middleware.ts b/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/middleware.ts index cc771a4619e783..78ebacd9718409 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/middleware.ts +++ b/x-pack/plugins/endpoint/public/applications/endpoint/store/policy_list/middleware.ts @@ -4,11 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -import { GetPolicyListResponse, MiddlewareFactory, PolicyListState } from '../../types'; +import { GetPolicyListResponse, ImmutableMiddlewareFactory, PolicyListState } from '../../types'; import { sendGetEndpointSpecificDatasources } from './services/ingest'; import { isOnPolicyListPage, urlSearchParams } from './selectors'; -export const policyListMiddlewareFactory: MiddlewareFactory = coreStart => { +export const policyListMiddlewareFactory: ImmutableMiddlewareFactory = coreStart => { const http = coreStart.http; return ({ getState, dispatch }) => next => async action => { diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/store/test_utils.ts b/x-pack/plugins/endpoint/public/applications/endpoint/store/test_utils.ts index 99e14cef73e8b8..df17cf8cf6638c 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/store/test_utils.ts +++ b/x-pack/plugins/endpoint/public/applications/endpoint/store/test_utils.ts @@ -5,7 +5,7 @@ */ import { Dispatch } from 'redux'; -import { AppAction, GlobalState, MiddlewareFactory } from '../types'; +import { AppAction, GlobalState, ImmutableMiddlewareFactory } from '../types'; /** * Utilities for testing Redux middleware @@ -35,7 +35,7 @@ export interface MiddlewareActionSpyHelper>; + actionSpyMiddleware: ReturnType>; } /** @@ -109,7 +109,7 @@ export const createSpyMiddleware = < return spyDispatch.mock; }, - actionSpyMiddleware: api => { + actionSpyMiddleware: () => { return next => { spyDispatch = jest.fn(action => { next(action); diff --git a/x-pack/plugins/endpoint/public/applications/endpoint/types.ts b/x-pack/plugins/endpoint/public/applications/endpoint/types.ts index 59cd8f806e5b0d..f407d32cb3b42a 100644 --- a/x-pack/plugins/endpoint/public/applications/endpoint/types.ts +++ b/x-pack/plugins/endpoint/public/applications/endpoint/types.ts @@ -4,7 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Dispatch, MiddlewareAPI, Action as ReduxAction, AnyAction as ReduxAnyAction } from 'redux'; +import { + Dispatch, + Action as ReduxAction, + AnyAction as ReduxAnyAction, + Action, + Middleware, +} from 'redux'; import { IIndexPattern } from 'src/plugins/data/public'; import { HostMetadata, @@ -28,12 +34,59 @@ import { } from '../../../../ingest_manager/common'; export { AppAction }; -export type MiddlewareFactory = ( + +/** + * like redux's `MiddlewareAPI` but `getState` returns an `Immutable` version of + * state and `dispatch` accepts `Immutable` versions of actions. + */ +export interface ImmutableMiddlewareAPI { + dispatch: Dispatch>; + getState(): Immutable; +} + +/** + * Like redux's `Middleware` but without the ability to mutate actions or state. + * Differences: + * * `getState` returns an `Immutable` version of state + * * `dispatch` accepts `Immutable` versions of actions + * * `action`s received will be `Immutable` + */ +export type ImmutableMiddleware = ( + api: ImmutableMiddlewareAPI +) => (next: Dispatch>) => (action: Immutable) => unknown; + +/** + * Takes application-standard middleware dependencies + * and returns a redux middleware. + * Middleware will be of the `ImmutableMiddleware` variety. Not able to directly + * change actions or state. + */ +export type ImmutableMiddlewareFactory = ( coreStart: CoreStart, depsStart: EndpointPluginStartDependencies -) => ( - api: MiddlewareAPI, S> -) => (next: Dispatch) => (action: AppAction) => unknown; +) => ImmutableMiddleware; + +/** + * Simple type for a redux selector. + */ +type Selector = (state: S) => R; + +/** + * Takes a selector and an `ImmutableMiddleware`. The + * middleware's version of `getState` will receive + * the result of the selector instead of the global state. + * + * This allows middleware to have knowledge of only a subsection of state. + * + * `selector` returns an `Immutable` version of the substate. + * `middleware` must be an `ImmutableMiddleware`. + * + * Returns a regular middleware, meant to be used with `applyMiddleware`. + */ +export type SubstateMiddlewareFactory = ( + selector: Selector>, + middleware: ImmutableMiddleware +) => Middleware<{}, GlobalState, Dispatch>>; export interface HostListState { hosts: HostMetadata[]; diff --git a/x-pack/plugins/event_log/server/es/context.mock.ts b/x-pack/plugins/event_log/server/es/context.mock.ts index 6581cd689e43d9..c15fee803fb71e 100644 --- a/x-pack/plugins/event_log/server/es/context.mock.ts +++ b/x-pack/plugins/event_log/server/es/context.mock.ts @@ -19,6 +19,7 @@ const createContextMock = () => { initialize: jest.fn(), waitTillReady: jest.fn(), esAdapter: clusterClientAdapterMock.create(), + initialized: true, }; return mock; }; diff --git a/x-pack/plugins/event_log/server/es/context.test.ts b/x-pack/plugins/event_log/server/es/context.test.ts new file mode 100644 index 00000000000000..09fe676a5762ed --- /dev/null +++ b/x-pack/plugins/event_log/server/es/context.test.ts @@ -0,0 +1,95 @@ +/* + * 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 { createEsContext } from './context'; +import { ClusterClient, Logger } from '../../../../../src/core/server'; +import { elasticsearchServiceMock, loggingServiceMock } from '../../../../../src/core/server/mocks'; +jest.mock('../lib/../../../../package.json', () => ({ + version: '1.2.3', +})); +type EsClusterClient = Pick, 'callAsInternalUser' | 'asScoped'>; + +let logger: Logger; +let clusterClient: EsClusterClient; + +beforeEach(() => { + logger = loggingServiceMock.createLogger(); + clusterClient = elasticsearchServiceMock.createClusterClient(); +}); + +describe('createEsContext', () => { + test('should return is ready state as falsy if not initialized', () => { + const context = createEsContext({ + logger, + clusterClientPromise: Promise.resolve(clusterClient), + indexNameRoot: 'test0', + }); + + expect(context.initialized).toBeFalsy(); + + context.initialize(); + expect(context.initialized).toBeTruthy(); + }); + + test('should return esNames', () => { + const context = createEsContext({ + logger, + clusterClientPromise: Promise.resolve(clusterClient), + indexNameRoot: 'test-index', + }); + + const esNames = context.esNames; + expect(esNames).toStrictEqual({ + base: 'test-index', + alias: 'test-index-event-log-1.2.3', + ilmPolicy: 'test-index-event-log-policy', + indexPattern: 'test-index-event-log-*', + indexPatternWithVersion: 'test-index-event-log-1.2.3-*', + indexTemplate: 'test-index-event-log-1.2.3-template', + initialIndex: 'test-index-event-log-1.2.3-000001', + }); + }); + + test('should return exist false for esAdapter ilm policy, index template and alias before initialize', async () => { + const context = createEsContext({ + logger, + clusterClientPromise: Promise.resolve(clusterClient), + indexNameRoot: 'test1', + }); + clusterClient.callAsInternalUser.mockResolvedValue(false); + + const doesAliasExist = await context.esAdapter.doesAliasExist(context.esNames.alias); + expect(doesAliasExist).toBeFalsy(); + + const doesIndexTemplateExist = await context.esAdapter.doesIndexTemplateExist( + context.esNames.indexTemplate + ); + expect(doesIndexTemplateExist).toBeFalsy(); + }); + + test('should return exist true for esAdapter ilm policy, index template and alias after initialize', async () => { + const context = createEsContext({ + logger, + clusterClientPromise: Promise.resolve(clusterClient), + indexNameRoot: 'test2', + }); + clusterClient.callAsInternalUser.mockResolvedValue(true); + context.initialize(); + + const doesIlmPolicyExist = await context.esAdapter.doesIlmPolicyExist( + context.esNames.ilmPolicy + ); + expect(doesIlmPolicyExist).toBeTruthy(); + + const doesAliasExist = await context.esAdapter.doesAliasExist(context.esNames.alias); + expect(doesAliasExist).toBeTruthy(); + + const doesIndexTemplateExist = await context.esAdapter.doesIndexTemplateExist( + context.esNames.indexTemplate + ); + expect(doesIndexTemplateExist).toBeTruthy(); + }); +}); diff --git a/x-pack/plugins/event_log/server/es/context.ts b/x-pack/plugins/event_log/server/es/context.ts index b8e351367b6955..0b3f22c6eecc06 100644 --- a/x-pack/plugins/event_log/server/es/context.ts +++ b/x-pack/plugins/event_log/server/es/context.ts @@ -19,6 +19,7 @@ export interface EsContext { esAdapter: IClusterClientAdapter; initialize(): void; waitTillReady(): Promise; + initialized: boolean; } export interface EsError { @@ -41,7 +42,7 @@ class EsContextImpl implements EsContext { public readonly esNames: EsNames; public esAdapter: IClusterClientAdapter; private readonly readySignal: ReadySignal; - private initialized: boolean; + public initialized: boolean; constructor(params: EsContextCtorParams) { this.logger = params.logger; diff --git a/x-pack/plugins/infra/common/http_api/source_api.ts b/x-pack/plugins/infra/common/http_api/source_api.ts new file mode 100644 index 00000000000000..218f8cebc98692 --- /dev/null +++ b/x-pack/plugins/infra/common/http_api/source_api.ts @@ -0,0 +1,188 @@ +/* + * 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. + */ + +/* eslint-disable @typescript-eslint/no-empty-interface */ + +import * as rt from 'io-ts'; +import moment from 'moment'; +import { pipe } from 'fp-ts/lib/pipeable'; +import { chain } from 'fp-ts/lib/Either'; + +export const TimestampFromString = new rt.Type( + 'TimestampFromString', + (input): input is number => typeof input === 'number', + (input, context) => + pipe( + rt.string.validate(input, context), + chain(stringInput => { + const momentValue = moment(stringInput); + return momentValue.isValid() + ? rt.success(momentValue.valueOf()) + : rt.failure(stringInput, context); + }) + ), + output => new Date(output).toISOString() +); + +/** + * Stored source configuration as read from and written to saved objects + */ + +const SavedSourceConfigurationFieldsRuntimeType = rt.partial({ + container: rt.string, + host: rt.string, + pod: rt.string, + tiebreaker: rt.string, + timestamp: rt.string, +}); + +export const SavedSourceConfigurationTimestampColumnRuntimeType = rt.type({ + timestampColumn: rt.type({ + id: rt.string, + }), +}); + +export const SavedSourceConfigurationMessageColumnRuntimeType = rt.type({ + messageColumn: rt.type({ + id: rt.string, + }), +}); + +export const SavedSourceConfigurationFieldColumnRuntimeType = rt.type({ + fieldColumn: rt.type({ + id: rt.string, + field: rt.string, + }), +}); + +export const SavedSourceConfigurationColumnRuntimeType = rt.union([ + SavedSourceConfigurationTimestampColumnRuntimeType, + SavedSourceConfigurationMessageColumnRuntimeType, + SavedSourceConfigurationFieldColumnRuntimeType, +]); + +export const SavedSourceConfigurationRuntimeType = rt.partial({ + name: rt.string, + description: rt.string, + metricAlias: rt.string, + logAlias: rt.string, + fields: SavedSourceConfigurationFieldsRuntimeType, + logColumns: rt.array(SavedSourceConfigurationColumnRuntimeType), +}); + +export interface InfraSavedSourceConfiguration + extends rt.TypeOf {} + +export const pickSavedSourceConfiguration = ( + value: InfraSourceConfiguration +): InfraSavedSourceConfiguration => { + const { name, description, metricAlias, logAlias, fields, logColumns } = value; + const { container, host, pod, tiebreaker, timestamp } = fields; + + return { + name, + description, + metricAlias, + logAlias, + fields: { container, host, pod, tiebreaker, timestamp }, + logColumns, + }; +}; + +/** + * Static source configuration as read from the configuration file + */ + +const StaticSourceConfigurationFieldsRuntimeType = rt.partial({ + ...SavedSourceConfigurationFieldsRuntimeType.props, + message: rt.array(rt.string), +}); + +export const StaticSourceConfigurationRuntimeType = rt.partial({ + name: rt.string, + description: rt.string, + metricAlias: rt.string, + logAlias: rt.string, + fields: StaticSourceConfigurationFieldsRuntimeType, + logColumns: rt.array(SavedSourceConfigurationColumnRuntimeType), +}); + +export interface InfraStaticSourceConfiguration + extends rt.TypeOf {} + +/** + * Full source configuration type after all cleanup has been done at the edges + */ + +const SourceConfigurationFieldsRuntimeType = rt.type({ + ...StaticSourceConfigurationFieldsRuntimeType.props, +}); + +export const SourceConfigurationRuntimeType = rt.type({ + ...SavedSourceConfigurationRuntimeType.props, + fields: SourceConfigurationFieldsRuntimeType, + logColumns: rt.array(SavedSourceConfigurationColumnRuntimeType), +}); + +export const SourceRuntimeType = rt.intersection([ + rt.type({ + id: rt.string, + origin: rt.keyof({ + fallback: null, + internal: null, + stored: null, + }), + configuration: SourceConfigurationRuntimeType, + }), + rt.partial({ + version: rt.string, + updatedAt: rt.number, + }), +]); + +export interface InfraSourceConfiguration + extends rt.TypeOf {} + +export interface InfraSource extends rt.TypeOf {} + +const SourceStatusFieldRuntimeType = rt.type({ + name: rt.string, + type: rt.string, + searchable: rt.boolean, + aggregatable: rt.boolean, + displayable: rt.boolean, +}); + +const SourceStatusRuntimeType = rt.type({ + logIndicesExist: rt.boolean, + metricIndicesExist: rt.boolean, + indexFields: rt.array(SourceStatusFieldRuntimeType), +}); + +export const SourceResponseRuntimeType = rt.type({ + source: SourceRuntimeType, + status: SourceStatusRuntimeType, +}); + +export type SourceResponse = rt.TypeOf; + +/** + * Saved object type with metadata + */ + +export const SourceConfigurationSavedObjectRuntimeType = rt.intersection([ + rt.type({ + id: rt.string, + attributes: SavedSourceConfigurationRuntimeType, + }), + rt.partial({ + version: rt.string, + updated_at: TimestampFromString, + }), +]); + +export interface SourceConfigurationSavedObject + extends rt.TypeOf {} diff --git a/x-pack/plugins/infra/public/components/alerting/metrics/expression.tsx b/x-pack/plugins/infra/public/components/alerting/metrics/expression.tsx index 7de52840777f9c..0e9da32aaa5093 100644 --- a/x-pack/plugins/infra/public/components/alerting/metrics/expression.tsx +++ b/x-pack/plugins/infra/public/components/alerting/metrics/expression.tsx @@ -17,9 +17,6 @@ import { import { IFieldType } from 'src/plugins/data/public'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; -import { EuiExpression } from '@elastic/eui'; -import { EuiCallOut } from '@elastic/eui'; -import { EuiLink } from '@elastic/eui'; import { MetricExpressionParams, Comparator, @@ -41,8 +38,8 @@ import { AlertsContextValue } from '../../../../../triggers_actions_ui/public/ap import { MetricsExplorerOptions } from '../../../containers/metrics_explorer/use_metrics_explorer_options'; import { MetricsExplorerKueryBar } from '../../metrics_explorer/kuery_bar'; import { MetricsExplorerSeries } from '../../../../common/http_api/metrics_explorer'; -import { useSource } from '../../../containers/source'; import { MetricsExplorerGroupBy } from '../../metrics_explorer/group_by'; +import { useSourceViaHttp } from '../../../containers/source/use_source_via_http'; interface AlertContextMeta { currentOptions?: Partial; @@ -87,7 +84,12 @@ const defaultExpression = { export const Expressions: React.FC = props => { const { setAlertParams, alertParams, errors, alertsContext } = props; - const { source, createDerivedIndexPattern } = useSource({ sourceId: 'default' }); + const { source, createDerivedIndexPattern } = useSourceViaHttp({ + sourceId: 'default', + type: 'metrics', + fetch: alertsContext.http.fetch, + toastWarning: alertsContext.toastNotifications.addWarning, + }); const [timeSize, setTimeSize] = useState(1); const [timeUnit, setTimeUnit] = useState('m'); @@ -208,40 +210,11 @@ export const Expressions: React.FC = props => { setAlertParams('groupBy', md.currentOptions.groupBy); } setAlertParams('sourceId', source?.id); + } else { + setAlertParams('criteria', [defaultExpression]); } }, [alertsContext.metadata, defaultExpression, source]); // eslint-disable-line react-hooks/exhaustive-deps - // INFO: If there is metadata, you're in the metrics explorer context - const canAddConditions = !!alertsContext.metadata; - - if (!canAddConditions && !alertParams.criteria) { - return ( - <> - - - {' '} - - - - . - - } - color="warning" - iconType="help" - /> - - - ); - } - return ( <> @@ -258,7 +231,6 @@ export const Expressions: React.FC = props => { alertParams.criteria.map((e, idx) => { return ( 1} fields={derivedIndexPattern.fields} remove={removeExpression} @@ -281,20 +253,18 @@ export const Expressions: React.FC = props => { />
- {canAddConditions && ( - - - - )} + + +
@@ -347,7 +317,6 @@ export const Expressions: React.FC = props => { interface ExpressionRowProps { fields: IFieldType[]; - canEditAggField: boolean; expressionId: number; expression: MetricExpression; errors: IErrorObject; @@ -378,7 +347,11 @@ export const ExpressionRow: React.FC = props => { const updateAggType = useCallback( (at: string) => { - setAlertParams(expressionId, { ...expression, aggType: at as MetricExpression['aggType'] }); + setAlertParams(expressionId, { + ...expression, + aggType: at as MetricExpression['aggType'], + metric: at === 'count' ? undefined : expression.metric, + }); }, [expressionId, expression, setAlertParams] ); @@ -420,20 +393,17 @@ export const ExpressionRow: React.FC = props => { {aggType !== 'count' && ( - {!props.canEditAggField && } - {props.canEditAggField && ( - ({ - normalizedType: f.type, - name: f.name, - }))} - aggType={aggType} - errors={errors} - onChangeSelectedAggField={updateMetric} - /> - )} + ({ + normalizedType: f.type, + name: f.name, + }))} + aggType={aggType} + errors={errors} + onChangeSelectedAggField={updateMetric} + /> )} @@ -465,19 +435,6 @@ export const ExpressionRow: React.FC = props => { ); }; -export const DisabledAggField = ({ text }: { text: string }) => { - return ( - - ); -}; - export const aggregationType: { [key: string]: any } = { avg: { text: i18n.translate('xpack.infra.metrics.alertFlyout.aggregationText.avg', { diff --git a/x-pack/plugins/infra/public/containers/source/source.tsx b/x-pack/plugins/infra/public/containers/source/source.tsx index a1310b1f336140..c2206769ef0efd 100644 --- a/x-pack/plugins/infra/public/containers/source/source.tsx +++ b/x-pack/plugins/infra/public/containers/source/source.tsx @@ -21,7 +21,7 @@ import { updateSourceMutation } from './update_source.gql_query'; type Source = SourceQuery.Query['source']; -const pickIndexPattern = (source: Source | undefined, type: 'logs' | 'metrics' | 'both') => { +export const pickIndexPattern = (source: Source | undefined, type: 'logs' | 'metrics' | 'both') => { if (!source) { return 'unknown-index'; } diff --git a/x-pack/plugins/infra/public/containers/source/use_source_via_http.ts b/x-pack/plugins/infra/public/containers/source/use_source_via_http.ts new file mode 100644 index 00000000000000..bc6374a6538e37 --- /dev/null +++ b/x-pack/plugins/infra/public/containers/source/use_source_via_http.ts @@ -0,0 +1,92 @@ +/* + * 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 { useEffect, useMemo } from 'react'; +import { fold } from 'fp-ts/lib/Either'; +import { identity } from 'fp-ts/lib/function'; +import { pipe } from 'fp-ts/lib/pipeable'; +import createContainer from 'constate'; +import { HttpHandler } from 'target/types/core/public/http'; +import { ToastInput } from 'target/types/core/public/notifications/toasts/toasts_api'; +import { + SourceResponseRuntimeType, + SourceResponse, + InfraSource, +} from '../../../common/http_api/source_api'; +import { useHTTPRequest } from '../../hooks/use_http_request'; +import { throwErrors, createPlainError } from '../../../common/runtime_types'; + +export const pickIndexPattern = ( + source: InfraSource | undefined, + type: 'logs' | 'metrics' | 'both' +) => { + if (!source) { + return 'unknown-index'; + } + if (type === 'logs') { + return source.configuration.logAlias; + } + if (type === 'metrics') { + return source.configuration.metricAlias; + } + return `${source.configuration.logAlias},${source.configuration.metricAlias}`; +}; + +interface Props { + sourceId: string; + type: 'logs' | 'metrics' | 'both'; + fetch?: HttpHandler; + toastWarning?: (input: ToastInput) => void; +} + +export const useSourceViaHttp = ({ + sourceId = 'default', + type = 'both', + fetch, + toastWarning, +}: Props) => { + const decodeResponse = (response: any) => { + return pipe( + SourceResponseRuntimeType.decode(response), + fold(throwErrors(createPlainError), identity) + ); + }; + + const { error, loading, response, makeRequest } = useHTTPRequest( + `/api/metrics/source/${sourceId}/${type}`, + 'GET', + null, + decodeResponse, + fetch, + toastWarning + ); + + useEffect(() => { + (async () => { + await makeRequest(); + })(); + }, [makeRequest]); + + const createDerivedIndexPattern = (indexType: 'logs' | 'metrics' | 'both' = type) => { + return { + fields: response?.source ? response.status.indexFields : [], + title: pickIndexPattern(response?.source, indexType), + }; + }; + + const source = useMemo(() => { + return response ? { ...response.source, status: response.status } : null; + }, [response]); + + return { + createDerivedIndexPattern, + source, + loading, + error, + }; +}; + +export const SourceViaHttp = createContainer(useSourceViaHttp); +export const [SourceViaHttpProvider, useSourceViaHttpContext] = SourceViaHttp; diff --git a/x-pack/plugins/infra/public/hooks/use_http_request.tsx b/x-pack/plugins/infra/public/hooks/use_http_request.tsx index 50f4a636b48a35..e00abe6380498f 100644 --- a/x-pack/plugins/infra/public/hooks/use_http_request.tsx +++ b/x-pack/plugins/infra/public/hooks/use_http_request.tsx @@ -7,28 +7,32 @@ import React, { useMemo, useState } from 'react'; import { IHttpFetchError } from 'src/core/public'; import { i18n } from '@kbn/i18n'; +import { HttpHandler } from 'target/types/core/public/http'; +import { ToastInput } from 'target/types/core/public/notifications/toasts/toasts_api'; import { useTrackedPromise } from '../utils/use_tracked_promise'; import { useKibana } from '../../../../../src/plugins/kibana_react/public'; export function useHTTPRequest( pathname: string, method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD', - body?: string, - decode: (response: any) => Response = response => response + body?: string | null, + decode: (response: any) => Response = response => response, + fetch?: HttpHandler, + toastWarning?: (input: ToastInput) => void ) { const kibana = useKibana(); - const fetch = kibana.services.http?.fetch; - const toasts = kibana.notifications.toasts; + const fetchService = fetch ? fetch : kibana.services.http?.fetch; + const toast = toastWarning ? toastWarning : kibana.notifications.toasts.warning; const [response, setResponse] = useState(null); const [error, setError] = useState(null); const [request, makeRequest] = useTrackedPromise( { cancelPreviousOn: 'resolution', createPromise: () => { - if (!fetch) { + if (!fetchService) { throw new Error('HTTP service is unavailable'); } - return fetch(pathname, { + return fetchService(pathname, { method, body, }); @@ -37,7 +41,7 @@ export function useHTTPRequest( onReject: (e: unknown) => { const err = e as IHttpFetchError; setError(err); - toasts.warning({ + toast({ toastLifeTimeMs: 3000, title: i18n.translate('xpack.infra.useHTTPRequest.error.title', { defaultMessage: `Error while fetching resource`, @@ -67,7 +71,7 @@ export function useHTTPRequest( }); }, }, - [pathname, body, method, fetch, toasts] + [pathname, body, method, fetch, toast] ); const loading = useMemo(() => { diff --git a/x-pack/plugins/infra/server/infra_server.ts b/x-pack/plugins/infra/server/infra_server.ts index fb9dd172bf6ede..88b78dfd3e41c3 100644 --- a/x-pack/plugins/infra/server/infra_server.ts +++ b/x-pack/plugins/infra/server/infra_server.ts @@ -29,6 +29,7 @@ import { initLogEntriesItemRoute, } from './routes/log_entries'; import { initInventoryMetaRoute } from './routes/inventory_metadata'; +import { initSourceRoute } from './routes/source'; export const initInfraServer = (libs: InfraBackendLibs) => { const schema = makeExecutableSchema({ @@ -48,6 +49,7 @@ export const initInfraServer = (libs: InfraBackendLibs) => { initGetLogEntryRateRoute(libs); initSnapshotRoute(libs); initNodeDetailsRoute(libs); + initSourceRoute(libs); initValidateLogAnalysisIndicesRoute(libs); initLogEntriesRoute(libs); initLogEntriesHighlightsRoute(libs); diff --git a/x-pack/plugins/infra/server/lib/sources/defaults.ts b/x-pack/plugins/infra/server/lib/sources/defaults.ts index b9ead0d169ee60..6b00f59cca1f41 100644 --- a/x-pack/plugins/infra/server/lib/sources/defaults.ts +++ b/x-pack/plugins/infra/server/lib/sources/defaults.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { InfraSourceConfiguration } from './types'; +import { InfraSourceConfiguration } from '../../../common/http_api/source_api'; export const defaultSourceConfiguration: InfraSourceConfiguration = { name: 'Default', diff --git a/x-pack/plugins/infra/server/lib/sources/index.ts b/x-pack/plugins/infra/server/lib/sources/index.ts index 6837f953ea18ae..9dcbe02bd064bc 100644 --- a/x-pack/plugins/infra/server/lib/sources/index.ts +++ b/x-pack/plugins/infra/server/lib/sources/index.ts @@ -7,4 +7,4 @@ export * from './defaults'; export * from './saved_object_mappings'; export * from './sources'; -export * from './types'; +export * from '../../../common/http_api/source_api'; diff --git a/x-pack/plugins/infra/server/lib/sources/saved_object_mappings.ts b/x-pack/plugins/infra/server/lib/sources/saved_object_mappings.ts index 973a790eeedafd..e5b230373b7ec1 100644 --- a/x-pack/plugins/infra/server/lib/sources/saved_object_mappings.ts +++ b/x-pack/plugins/infra/server/lib/sources/saved_object_mappings.ts @@ -5,7 +5,7 @@ */ import { ElasticsearchMappingOf } from '../../utils/typed_elasticsearch_mappings'; -import { InfraSavedSourceConfiguration } from './types'; +import { InfraSavedSourceConfiguration } from '../../../common/http_api/source_api'; export const infraSourceConfigurationSavedObjectType = 'infrastructure-ui-source'; diff --git a/x-pack/plugins/infra/server/lib/sources/sources.ts b/x-pack/plugins/infra/server/lib/sources/sources.ts index c7ff6c96382043..99e062aa49ccf3 100644 --- a/x-pack/plugins/infra/server/lib/sources/sources.ts +++ b/x-pack/plugins/infra/server/lib/sources/sources.ts @@ -20,7 +20,8 @@ import { pickSavedSourceConfiguration, SourceConfigurationSavedObjectRuntimeType, StaticSourceConfigurationRuntimeType, -} from './types'; + InfraSource, +} from '../../../common/http_api/source_api'; import { InfraConfig } from '../../../server'; interface Libs { @@ -35,7 +36,10 @@ export class InfraSources { this.libs = libs; } - public async getSourceConfiguration(requestContext: RequestHandlerContext, sourceId: string) { + public async getSourceConfiguration( + requestContext: RequestHandlerContext, + sourceId: string + ): Promise { const staticDefaultSourceConfiguration = await this.getStaticDefaultSourceConfiguration(); const savedSourceConfiguration = await this.getInternalSourceConfiguration(sourceId) diff --git a/x-pack/plugins/infra/server/lib/sources/types.ts b/x-pack/plugins/infra/server/lib/sources/types.ts deleted file mode 100644 index 1f850635cf35a2..00000000000000 --- a/x-pack/plugins/infra/server/lib/sources/types.ts +++ /dev/null @@ -1,149 +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. - */ - -/* eslint-disable @typescript-eslint/no-empty-interface */ - -import * as runtimeTypes from 'io-ts'; -import moment from 'moment'; -import { pipe } from 'fp-ts/lib/pipeable'; -import { chain } from 'fp-ts/lib/Either'; - -export const TimestampFromString = new runtimeTypes.Type( - 'TimestampFromString', - (input): input is number => typeof input === 'number', - (input, context) => - pipe( - runtimeTypes.string.validate(input, context), - chain(stringInput => { - const momentValue = moment(stringInput); - return momentValue.isValid() - ? runtimeTypes.success(momentValue.valueOf()) - : runtimeTypes.failure(stringInput, context); - }) - ), - output => new Date(output).toISOString() -); - -/** - * Stored source configuration as read from and written to saved objects - */ - -const SavedSourceConfigurationFieldsRuntimeType = runtimeTypes.partial({ - container: runtimeTypes.string, - host: runtimeTypes.string, - pod: runtimeTypes.string, - tiebreaker: runtimeTypes.string, - timestamp: runtimeTypes.string, -}); - -export const SavedSourceConfigurationTimestampColumnRuntimeType = runtimeTypes.type({ - timestampColumn: runtimeTypes.type({ - id: runtimeTypes.string, - }), -}); - -export const SavedSourceConfigurationMessageColumnRuntimeType = runtimeTypes.type({ - messageColumn: runtimeTypes.type({ - id: runtimeTypes.string, - }), -}); - -export const SavedSourceConfigurationFieldColumnRuntimeType = runtimeTypes.type({ - fieldColumn: runtimeTypes.type({ - id: runtimeTypes.string, - field: runtimeTypes.string, - }), -}); - -export const SavedSourceConfigurationColumnRuntimeType = runtimeTypes.union([ - SavedSourceConfigurationTimestampColumnRuntimeType, - SavedSourceConfigurationMessageColumnRuntimeType, - SavedSourceConfigurationFieldColumnRuntimeType, -]); - -export const SavedSourceConfigurationRuntimeType = runtimeTypes.partial({ - name: runtimeTypes.string, - description: runtimeTypes.string, - metricAlias: runtimeTypes.string, - logAlias: runtimeTypes.string, - fields: SavedSourceConfigurationFieldsRuntimeType, - logColumns: runtimeTypes.array(SavedSourceConfigurationColumnRuntimeType), -}); - -export interface InfraSavedSourceConfiguration - extends runtimeTypes.TypeOf {} - -export const pickSavedSourceConfiguration = ( - value: InfraSourceConfiguration -): InfraSavedSourceConfiguration => { - const { name, description, metricAlias, logAlias, fields, logColumns } = value; - const { container, host, pod, tiebreaker, timestamp } = fields; - - return { - name, - description, - metricAlias, - logAlias, - fields: { container, host, pod, tiebreaker, timestamp }, - logColumns, - }; -}; - -/** - * Static source configuration as read from the configuration file - */ - -const StaticSourceConfigurationFieldsRuntimeType = runtimeTypes.partial({ - ...SavedSourceConfigurationFieldsRuntimeType.props, - message: runtimeTypes.array(runtimeTypes.string), -}); - -export const StaticSourceConfigurationRuntimeType = runtimeTypes.partial({ - name: runtimeTypes.string, - description: runtimeTypes.string, - metricAlias: runtimeTypes.string, - logAlias: runtimeTypes.string, - fields: StaticSourceConfigurationFieldsRuntimeType, - logColumns: runtimeTypes.array(SavedSourceConfigurationColumnRuntimeType), -}); - -export interface InfraStaticSourceConfiguration - extends runtimeTypes.TypeOf {} - -/** - * Full source configuration type after all cleanup has been done at the edges - */ - -const SourceConfigurationFieldsRuntimeType = runtimeTypes.type({ - ...StaticSourceConfigurationFieldsRuntimeType.props, -}); - -export const SourceConfigurationRuntimeType = runtimeTypes.type({ - ...SavedSourceConfigurationRuntimeType.props, - fields: SourceConfigurationFieldsRuntimeType, - logColumns: runtimeTypes.array(SavedSourceConfigurationColumnRuntimeType), -}); - -export interface InfraSourceConfiguration - extends runtimeTypes.TypeOf {} - -/** - * Saved object type with metadata - */ - -export const SourceConfigurationSavedObjectRuntimeType = runtimeTypes.intersection([ - runtimeTypes.type({ - id: runtimeTypes.string, - attributes: SavedSourceConfigurationRuntimeType, - }), - runtimeTypes.partial({ - version: runtimeTypes.string, - updated_at: TimestampFromString, - }), -]); - -export interface SourceConfigurationSavedObject - extends runtimeTypes.TypeOf {} diff --git a/x-pack/plugins/infra/server/plugin.ts b/x-pack/plugins/infra/server/plugin.ts index 64fc496f3597e1..e3804078604cc5 100644 --- a/x-pack/plugins/infra/server/plugin.ts +++ b/x-pack/plugins/infra/server/plugin.ts @@ -26,7 +26,7 @@ import { InfraSources } from './lib/sources'; import { InfraServerPluginDeps } from './lib/adapters/framework'; import { METRICS_FEATURE, LOGS_FEATURE } from './features'; import { UsageCollector } from './usage/usage_collector'; -import { InfraStaticSourceConfiguration } from './lib/sources/types'; +import { InfraStaticSourceConfiguration } from '../common/http_api/source_api'; import { registerAlertTypes } from './lib/alerting'; export const config = { diff --git a/x-pack/plugins/infra/server/routes/source/index.ts b/x-pack/plugins/infra/server/routes/source/index.ts new file mode 100644 index 00000000000000..2f29320d7bb81d --- /dev/null +++ b/x-pack/plugins/infra/server/routes/source/index.ts @@ -0,0 +1,65 @@ +/* + * 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 { schema } from '@kbn/config-schema'; +import { SourceResponseRuntimeType } from '../../../common/http_api/source_api'; +import { InfraBackendLibs } from '../../lib/infra_types'; +import { InfraIndexType } from '../../graphql/types'; + +const typeToInfraIndexType = (value: string | undefined) => { + switch (value) { + case 'metrics': + return InfraIndexType.METRICS; + case 'logs': + return InfraIndexType.LOGS; + default: + return InfraIndexType.ANY; + } +}; + +export const initSourceRoute = (libs: InfraBackendLibs) => { + const { framework } = libs; + + framework.registerRoute( + { + method: 'get', + path: '/api/metrics/source/{sourceId}/{type?}', + validate: { + params: schema.object({ + sourceId: schema.string(), + type: schema.string(), + }), + }, + }, + async (requestContext, request, response) => { + try { + const { type, sourceId } = request.params; + + const source = await libs.sources.getSourceConfiguration(requestContext, sourceId); + if (!source) { + return response.notFound(); + } + + const status = { + logIndicesExist: await libs.sourceStatus.hasLogIndices(requestContext, sourceId), + metricIndicesExist: await libs.sourceStatus.hasMetricIndices(requestContext, sourceId), + indexFields: await libs.fields.getFields( + requestContext, + sourceId, + typeToInfraIndexType(type) + ), + }; + + return response.ok({ + body: SourceResponseRuntimeType.encode({ source, status }), + }); + } catch (error) { + return response.internalError({ + body: error.message, + }); + } + } + ); +}; diff --git a/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.test.ts b/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.test.ts index cde2e5b420f3bf..1a73c9581a2de7 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.test.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.test.ts @@ -161,3 +161,101 @@ test('tests processing keyword field with multi fields with analyzed text field' const mappings = generateMappings(processedFields); expect(JSON.stringify(mappings)).toEqual(JSON.stringify(keywordWithAnalyzedMultiFieldsMapping)); }); + +test('tests processing object field with no other attributes', () => { + const objectFieldLiteralYml = ` +- name: objectField + type: object +`; + const objectFieldMapping = { + properties: { + objectField: { + type: 'object', + }, + }, + }; + const fields: Field[] = safeLoad(objectFieldLiteralYml); + const processedFields = processFields(fields); + const mappings = generateMappings(processedFields); + expect(JSON.stringify(mappings)).toEqual(JSON.stringify(objectFieldMapping)); +}); + +test('tests processing object field with enabled set to false', () => { + const objectFieldEnabledFalseLiteralYml = ` +- name: objectField + type: object + enabled: false +`; + const objectFieldEnabledFalseMapping = { + properties: { + objectField: { + type: 'object', + enabled: false, + }, + }, + }; + const fields: Field[] = safeLoad(objectFieldEnabledFalseLiteralYml); + const processedFields = processFields(fields); + const mappings = generateMappings(processedFields); + expect(JSON.stringify(mappings)).toEqual(JSON.stringify(objectFieldEnabledFalseMapping)); +}); + +test('tests processing object field with dynamic set to false', () => { + const objectFieldDynamicFalseLiteralYml = ` +- name: objectField + type: object + dynamic: false +`; + const objectFieldDynamicFalseMapping = { + properties: { + objectField: { + type: 'object', + dynamic: false, + }, + }, + }; + const fields: Field[] = safeLoad(objectFieldDynamicFalseLiteralYml); + const processedFields = processFields(fields); + const mappings = generateMappings(processedFields); + expect(JSON.stringify(mappings)).toEqual(JSON.stringify(objectFieldDynamicFalseMapping)); +}); + +test('tests processing object field with dynamic set to true', () => { + const objectFieldDynamicTrueLiteralYml = ` +- name: objectField + type: object + dynamic: true +`; + const objectFieldDynamicTrueMapping = { + properties: { + objectField: { + type: 'object', + dynamic: true, + }, + }, + }; + const fields: Field[] = safeLoad(objectFieldDynamicTrueLiteralYml); + const processedFields = processFields(fields); + const mappings = generateMappings(processedFields); + expect(JSON.stringify(mappings)).toEqual(JSON.stringify(objectFieldDynamicTrueMapping)); +}); + +test('tests processing object field with dynamic set to strict', () => { + const objectFieldDynamicStrictLiteralYml = ` +- name: objectField + type: object + dynamic: strict +`; + const objectFieldDynamicStrictMapping = { + properties: { + objectField: { + type: 'object', + dynamic: 'strict', + }, + }, + }; + const fields: Field[] = safeLoad(objectFieldDynamicStrictLiteralYml); + const processedFields = processFields(fields); + const mappings = generateMappings(processedFields); + expect(JSON.stringify(mappings)).toEqual(JSON.stringify(objectFieldDynamicStrictMapping)); +}); diff --git a/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts b/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts index e876c8a2efb4f9..22a61d2bdfb7c3 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/template.ts @@ -89,8 +89,13 @@ export function generateMappings(fields: Field[]): Mappings { } break; case 'object': - // TODO improve fieldProps.type = 'object'; + if (field.hasOwnProperty('enabled')) { + fieldProps.enabled = field.enabled; + } + if (field.hasOwnProperty('dynamic')) { + fieldProps.dynamic = field.dynamic; + } break; case 'array': // this assumes array fields were validated in an earlier step diff --git a/x-pack/plugins/ingest_manager/server/services/epm/fields/field.ts b/x-pack/plugins/ingest_manager/server/services/epm/fields/field.ts index 810896bb50389f..9c9843e0454ab5 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/fields/field.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/fields/field.ts @@ -27,6 +27,7 @@ export interface Field { ignore_above?: number; object_type?: string; scaling_factor?: number; + dynamic?: 'strict' | boolean; // Kibana specific analyzed?: boolean; diff --git a/x-pack/plugins/lens/public/datatable_visualization/expression.tsx b/x-pack/plugins/lens/public/datatable_visualization/expression.tsx index cbdc0617e8568b..772ee13168d026 100644 --- a/x-pack/plugins/lens/public/datatable_visualization/expression.tsx +++ b/x-pack/plugins/lens/public/datatable_visualization/expression.tsx @@ -140,6 +140,7 @@ function DatatableComponent(props: DatatableProps & { formatFactory: FormatFacto { const col = firstTable.columns.find(c => c.id === field); diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/_expression_renderer.scss b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/_expression_renderer.scss index d43a857e05639c..9519544ece575c 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/_expression_renderer.scss +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/_expression_renderer.scss @@ -1,9 +1,10 @@ .lnsExpressionRenderer { + @include euiScrollBar; position: relative; width: 100%; height: 100%; display: flex; - overflow-x: hidden; + overflow: auto; .lnsExpressionRenderer__component { position: static; // Let the progress indicator position itself against the outer parent diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/_workspace_panel_wrapper.scss b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/_workspace_panel_wrapper.scss index 3ef387eca1e8b1..4ba19cb4ab05b9 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/_workspace_panel_wrapper.scss +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/_workspace_panel_wrapper.scss @@ -29,7 +29,7 @@ display: flex; align-items: center; justify-content: center; - overflow-x: hidden; + overflow: hidden; } } } diff --git a/x-pack/plugins/lens/server/routes/existing_fields.test.ts b/x-pack/plugins/lens/server/routes/existing_fields.test.ts index 9bd11b6863d93b..ed1f85ab902f8c 100644 --- a/x-pack/plugins/lens/server/routes/existing_fields.test.ts +++ b/x-pack/plugins/lens/server/routes/existing_fields.test.ts @@ -57,6 +57,24 @@ describe('existingFields', () => { expect(result).toEqual(['geo.coordinates']); }); + it('should handle objects with dotted fields', () => { + const result = existingFields( + [indexPattern({ 'geo.country_name': 'US' })], + [field('geo.country_name')] + ); + + expect(result).toEqual(['geo.country_name']); + }); + + it('should handle arrays with dotted fields on both sides', () => { + const result = existingFields( + [indexPattern({ 'process.cpu': [{ 'user.pct': 50 }] })], + [field('process.cpu.user.pct')] + ); + + expect(result).toEqual(['process.cpu.user.pct']); + }); + it('should be false if it hits a positive leaf before the end of the path', () => { const result = existingFields( [indexPattern({ geo: { coordinates: 32 } })], diff --git a/x-pack/plugins/lens/server/routes/existing_fields.ts b/x-pack/plugins/lens/server/routes/existing_fields.ts index b1964a91509826..3e91d17950061d 100644 --- a/x-pack/plugins/lens/server/routes/existing_fields.ts +++ b/x-pack/plugins/lens/server/routes/existing_fields.ts @@ -258,6 +258,8 @@ async function fetchIndexPatternStats({ return result.hits.hits; } +// Recursive function to determine if the _source of a document +// contains a known path. function exists(obj: unknown, path: string[], i = 0): boolean { if (obj == null) { return false; @@ -272,6 +274,22 @@ function exists(obj: unknown, path: string[], i = 0): boolean { } if (typeof obj === 'object') { + // Because Elasticsearch flattens paths, dots in the field name are allowed + // as JSON keys. For example, { 'a.b': 10 } + const partialKeyMatches = Object.getOwnPropertyNames(obj) + .map(key => key.split('.')) + .filter(keyPaths => keyPaths.every((key, keyIndex) => key === path[keyIndex + i])); + + if (partialKeyMatches.length) { + return partialKeyMatches.every(keyPaths => { + return exists( + (obj as Record)[keyPaths.join('.')], + path, + i + keyPaths.length + ); + }); + } + return exists((obj as Record)[path[i]], path, i + 1); } diff --git a/x-pack/plugins/lens/server/usage/task.ts b/x-pack/plugins/lens/server/usage/task.ts index 469457f973b62b..e1a0bf20f7b484 100644 --- a/x-pack/plugins/lens/server/usage/task.ts +++ b/x-pack/plugins/lens/server/usage/task.ts @@ -210,6 +210,7 @@ export function telemetryTaskRunner( }) .catch(errMsg => logger.warn(`Error executing lens telemetry task: ${errMsg}`)); }, + async cancel() {}, }; }; } diff --git a/x-pack/legacy/plugins/tilemap/README.md b/x-pack/plugins/maps_legacy_licensing/README.md similarity index 100% rename from x-pack/legacy/plugins/tilemap/README.md rename to x-pack/plugins/maps_legacy_licensing/README.md diff --git a/x-pack/plugins/maps_legacy_licensing/kibana.json b/x-pack/plugins/maps_legacy_licensing/kibana.json new file mode 100644 index 00000000000000..e98c33d21ec406 --- /dev/null +++ b/x-pack/plugins/maps_legacy_licensing/kibana.json @@ -0,0 +1,8 @@ +{ + "id": "mapsLegacyLicensing", + "version": "8.0.0", + "kibanaVersion": "kibana", + "server": false, + "ui": true, + "requiredPlugins": ["licensing", "mapsLegacy"] +} diff --git a/x-pack/plugins/uptime/server/graphql/monitor_states/index.ts b/x-pack/plugins/maps_legacy_licensing/public/index.ts similarity index 68% rename from x-pack/plugins/uptime/server/graphql/monitor_states/index.ts rename to x-pack/plugins/maps_legacy_licensing/public/index.ts index fb0893dbc4dbff..edda6118f92ddd 100644 --- a/x-pack/plugins/uptime/server/graphql/monitor_states/index.ts +++ b/x-pack/plugins/maps_legacy_licensing/public/index.ts @@ -4,5 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -export { createMonitorStatesResolvers } from './resolvers'; -export { monitorStatesSchema } from './schema.gql'; +import { MapsLegacyLicensing } from './plugin'; + +export function plugin() { + return new MapsLegacyLicensing(); +} diff --git a/x-pack/plugins/maps_legacy_licensing/public/plugin.ts b/x-pack/plugins/maps_legacy_licensing/public/plugin.ts new file mode 100644 index 00000000000000..69c25efd96e758 --- /dev/null +++ b/x-pack/plugins/maps_legacy_licensing/public/plugin.ts @@ -0,0 +1,49 @@ +/* + * 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, CoreStart, Plugin } from 'kibana/public'; +import { LicensingPluginSetup, ILicense } from '../../licensing/public'; + +/** + * These are the interfaces with your public contracts. You should export these + * for other plugins to use in _their_ `SetupDeps`/`StartDeps` interfaces. + * @public + */ + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MapsLegacyLicensingSetupDependencies { + licensing: LicensingPluginSetup; + mapsLegacy: any; +} +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface MapsLegacyLicensingStartDependencies {} + +export type MapsLegacyLicensingSetup = ReturnType; +export type MapsLegacyLicensingStart = ReturnType; + +export class MapsLegacyLicensing + implements Plugin { + public setup(core: CoreSetup, plugins: MapsLegacyLicensingSetupDependencies) { + const { + licensing, + mapsLegacy: { serviceSettings }, + } = plugins; + if (licensing) { + licensing.license$.subscribe((license: ILicense) => { + const { uid, isActive } = license; + if (isActive && license.hasAtLeast('basic')) { + serviceSettings.setQueryParams({ license: uid }); + serviceSettings.disableZoomMessage(); + } else { + serviceSettings.setQueryParams({ license: undefined }); + serviceSettings.enableZoomMessage(); + } + }); + } + } + + public start(core: CoreStart, plugins: MapsLegacyLicensingStartDependencies) {} +} diff --git a/x-pack/plugins/ml/common/util/__tests__/job_utils.js b/x-pack/plugins/ml/common/util/job_utils.test.js similarity index 50% rename from x-pack/plugins/ml/common/util/__tests__/job_utils.js rename to x-pack/plugins/ml/common/util/job_utils.test.js index 60270fd4388465..a5df160bdf5ca6 100644 --- a/x-pack/plugins/ml/common/util/__tests__/job_utils.js +++ b/x-pack/plugins/ml/common/util/job_utils.test.js @@ -4,7 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from '@kbn/expect'; import { calculateDatafeedFrequencyDefaultSeconds, isTimeSeriesViewJob, @@ -20,38 +19,38 @@ import { prefixDatafeedId, getSafeAggregationName, getLatestDataOrBucketTimestamp, -} from '../job_utils'; +} from './job_utils'; describe('ML - job utils', () => { describe('calculateDatafeedFrequencyDefaultSeconds', () => { - it('returns correct frequency for 119', () => { + test('returns correct frequency for 119', () => { const result = calculateDatafeedFrequencyDefaultSeconds(119); - expect(result).to.be(60); + expect(result).toBe(60); }); - it('returns correct frequency for 120', () => { + test('returns correct frequency for 120', () => { const result = calculateDatafeedFrequencyDefaultSeconds(120); - expect(result).to.be(60); + expect(result).toBe(60); }); - it('returns correct frequency for 300', () => { + test('returns correct frequency for 300', () => { const result = calculateDatafeedFrequencyDefaultSeconds(300); - expect(result).to.be(150); + expect(result).toBe(150); }); - it('returns correct frequency for 601', () => { + test('returns correct frequency for 601', () => { const result = calculateDatafeedFrequencyDefaultSeconds(601); - expect(result).to.be(300); + expect(result).toBe(300); }); - it('returns correct frequency for 43200', () => { + test('returns correct frequency for 43200', () => { const result = calculateDatafeedFrequencyDefaultSeconds(43200); - expect(result).to.be(600); + expect(result).toBe(600); }); - it('returns correct frequency for 43201', () => { + test('returns correct frequency for 43201', () => { const result = calculateDatafeedFrequencyDefaultSeconds(43201); - expect(result).to.be(3600); + expect(result).toBe(3600); }); }); describe('isTimeSeriesViewJob', () => { - it('returns true when job has a single detector with a metric function', () => { + test('returns true when job has a single detector with a metric function', () => { const job = { analysis_config: { detectors: [ @@ -64,10 +63,10 @@ describe('ML - job utils', () => { }, }; - expect(isTimeSeriesViewJob(job)).to.be(true); + expect(isTimeSeriesViewJob(job)).toBe(true); }); - it('returns true when job has at least one detector with a metric function', () => { + test('returns true when job has at least one detector with a metric function', () => { const job = { analysis_config: { detectors: [ @@ -86,10 +85,10 @@ describe('ML - job utils', () => { }, }; - expect(isTimeSeriesViewJob(job)).to.be(true); + expect(isTimeSeriesViewJob(job)).toBe(true); }); - it('returns false when job does not have at least one detector with a metric function', () => { + test('returns false when job does not have at least one detector with a metric function', () => { const job = { analysis_config: { detectors: [ @@ -108,10 +107,10 @@ describe('ML - job utils', () => { }, }; - expect(isTimeSeriesViewJob(job)).to.be(false); + expect(isTimeSeriesViewJob(job)).toBe(false); }); - it('returns false when job has a single count by category detector', () => { + test('returns false when job has a single count by category detector', () => { const job = { analysis_config: { detectors: [ @@ -124,7 +123,7 @@ describe('ML - job utils', () => { }, }; - expect(isTimeSeriesViewJob(job)).to.be(false); + expect(isTimeSeriesViewJob(job)).toBe(false); }); }); @@ -171,24 +170,24 @@ describe('ML - job utils', () => { }, }; - it('returns true for a detector with a metric function', () => { - expect(isTimeSeriesViewDetector(job, 0)).to.be(true); + test('returns true for a detector with a metric function', () => { + expect(isTimeSeriesViewDetector(job, 0)).toBe(true); }); - it('returns false for a detector with a non-metric function', () => { - expect(isTimeSeriesViewDetector(job, 1)).to.be(false); + test('returns false for a detector with a non-metric function', () => { + expect(isTimeSeriesViewDetector(job, 1)).toBe(false); }); - it('returns false for a detector using count on an mlcategory field', () => { - expect(isTimeSeriesViewDetector(job, 2)).to.be(false); + test('returns false for a detector using count on an mlcategory field', () => { + expect(isTimeSeriesViewDetector(job, 2)).toBe(false); }); - it('returns false for a detector using a script field as a by field', () => { - expect(isTimeSeriesViewDetector(job, 3)).to.be(false); + test('returns false for a detector using a script field as a by field', () => { + expect(isTimeSeriesViewDetector(job, 3)).toBe(false); }); - it('returns false for a detector using a script field as a metric field_name', () => { - expect(isTimeSeriesViewDetector(job, 4)).to.be(false); + test('returns false for a detector using a script field as a metric field_name', () => { + expect(isTimeSeriesViewDetector(job, 4)).toBe(false); }); }); @@ -233,7 +232,7 @@ describe('ML - job utils', () => { { function: 'time_of_day' }, // 34 { function: 'time_of_week' }, // 35 { function: 'lat_long' }, // 36 - { function: 'mean', field_name: 'NetworkDiff' }, //37 + { function: 'mean', field_name: 'NetworkDiff' }, // 37 ], }, datafeed_config: { @@ -254,48 +253,48 @@ describe('ML - job utils', () => { }, }; - it('returns true for expected detectors', () => { - expect(isSourceDataChartableForDetector(job, 0)).to.be(true); - expect(isSourceDataChartableForDetector(job, 1)).to.be(true); - expect(isSourceDataChartableForDetector(job, 2)).to.be(true); - expect(isSourceDataChartableForDetector(job, 3)).to.be(true); - expect(isSourceDataChartableForDetector(job, 4)).to.be(true); - expect(isSourceDataChartableForDetector(job, 5)).to.be(true); - expect(isSourceDataChartableForDetector(job, 6)).to.be(true); - expect(isSourceDataChartableForDetector(job, 7)).to.be(true); - expect(isSourceDataChartableForDetector(job, 8)).to.be(true); - expect(isSourceDataChartableForDetector(job, 9)).to.be(true); - expect(isSourceDataChartableForDetector(job, 10)).to.be(true); - expect(isSourceDataChartableForDetector(job, 11)).to.be(true); - expect(isSourceDataChartableForDetector(job, 12)).to.be(true); - expect(isSourceDataChartableForDetector(job, 13)).to.be(true); - expect(isSourceDataChartableForDetector(job, 14)).to.be(true); - expect(isSourceDataChartableForDetector(job, 15)).to.be(true); - expect(isSourceDataChartableForDetector(job, 16)).to.be(true); - expect(isSourceDataChartableForDetector(job, 17)).to.be(true); - expect(isSourceDataChartableForDetector(job, 18)).to.be(true); - expect(isSourceDataChartableForDetector(job, 19)).to.be(true); - expect(isSourceDataChartableForDetector(job, 20)).to.be(true); - expect(isSourceDataChartableForDetector(job, 21)).to.be(true); - expect(isSourceDataChartableForDetector(job, 22)).to.be(true); - expect(isSourceDataChartableForDetector(job, 23)).to.be(true); - expect(isSourceDataChartableForDetector(job, 24)).to.be(true); - }); - - it('returns false for expected detectors', () => { - expect(isSourceDataChartableForDetector(job, 25)).to.be(false); - expect(isSourceDataChartableForDetector(job, 26)).to.be(false); - expect(isSourceDataChartableForDetector(job, 27)).to.be(false); - expect(isSourceDataChartableForDetector(job, 28)).to.be(false); - expect(isSourceDataChartableForDetector(job, 29)).to.be(false); - expect(isSourceDataChartableForDetector(job, 30)).to.be(false); - expect(isSourceDataChartableForDetector(job, 31)).to.be(false); - expect(isSourceDataChartableForDetector(job, 32)).to.be(false); - expect(isSourceDataChartableForDetector(job, 33)).to.be(false); - expect(isSourceDataChartableForDetector(job, 34)).to.be(false); - expect(isSourceDataChartableForDetector(job, 35)).to.be(false); - expect(isSourceDataChartableForDetector(job, 36)).to.be(false); - expect(isSourceDataChartableForDetector(job, 37)).to.be(false); + test('returns true for expected detectors', () => { + expect(isSourceDataChartableForDetector(job, 0)).toBe(true); + expect(isSourceDataChartableForDetector(job, 1)).toBe(true); + expect(isSourceDataChartableForDetector(job, 2)).toBe(true); + expect(isSourceDataChartableForDetector(job, 3)).toBe(true); + expect(isSourceDataChartableForDetector(job, 4)).toBe(true); + expect(isSourceDataChartableForDetector(job, 5)).toBe(true); + expect(isSourceDataChartableForDetector(job, 6)).toBe(true); + expect(isSourceDataChartableForDetector(job, 7)).toBe(true); + expect(isSourceDataChartableForDetector(job, 8)).toBe(true); + expect(isSourceDataChartableForDetector(job, 9)).toBe(true); + expect(isSourceDataChartableForDetector(job, 10)).toBe(true); + expect(isSourceDataChartableForDetector(job, 11)).toBe(true); + expect(isSourceDataChartableForDetector(job, 12)).toBe(true); + expect(isSourceDataChartableForDetector(job, 13)).toBe(true); + expect(isSourceDataChartableForDetector(job, 14)).toBe(true); + expect(isSourceDataChartableForDetector(job, 15)).toBe(true); + expect(isSourceDataChartableForDetector(job, 16)).toBe(true); + expect(isSourceDataChartableForDetector(job, 17)).toBe(true); + expect(isSourceDataChartableForDetector(job, 18)).toBe(true); + expect(isSourceDataChartableForDetector(job, 19)).toBe(true); + expect(isSourceDataChartableForDetector(job, 20)).toBe(true); + expect(isSourceDataChartableForDetector(job, 21)).toBe(true); + expect(isSourceDataChartableForDetector(job, 22)).toBe(true); + expect(isSourceDataChartableForDetector(job, 23)).toBe(true); + expect(isSourceDataChartableForDetector(job, 24)).toBe(true); + }); + + test('returns false for expected detectors', () => { + expect(isSourceDataChartableForDetector(job, 25)).toBe(false); + expect(isSourceDataChartableForDetector(job, 26)).toBe(false); + expect(isSourceDataChartableForDetector(job, 27)).toBe(false); + expect(isSourceDataChartableForDetector(job, 28)).toBe(false); + expect(isSourceDataChartableForDetector(job, 29)).toBe(false); + expect(isSourceDataChartableForDetector(job, 30)).toBe(false); + expect(isSourceDataChartableForDetector(job, 31)).toBe(false); + expect(isSourceDataChartableForDetector(job, 32)).toBe(false); + expect(isSourceDataChartableForDetector(job, 33)).toBe(false); + expect(isSourceDataChartableForDetector(job, 34)).toBe(false); + expect(isSourceDataChartableForDetector(job, 35)).toBe(false); + expect(isSourceDataChartableForDetector(job, 36)).toBe(false); + expect(isSourceDataChartableForDetector(job, 37)).toBe(false); }); }); @@ -315,16 +314,16 @@ describe('ML - job utils', () => { }, }; - it('returns false when model plot is not enabled', () => { - expect(isModelPlotChartableForDetector(job1, 0)).to.be(false); + test('returns false when model plot is not enabled', () => { + expect(isModelPlotChartableForDetector(job1, 0)).toBe(false); }); - it('returns true for count detector when model plot is enabled', () => { - expect(isModelPlotChartableForDetector(job2, 0)).to.be(true); + test('returns true for count detector when model plot is enabled', () => { + expect(isModelPlotChartableForDetector(job2, 0)).toBe(true); }); - it('returns true for info_content detector when model plot is enabled', () => { - expect(isModelPlotChartableForDetector(job2, 1)).to.be(true); + test('returns true for info_content detector when model plot is enabled', () => { + expect(isModelPlotChartableForDetector(job2, 1)).toBe(true); }); }); @@ -359,39 +358,29 @@ describe('ML - job utils', () => { }, }; - it('returns empty array for a detector with no partitioning fields', () => { + test('returns empty array for a detector with no partitioning fields', () => { const resp = getPartitioningFieldNames(job, 0); - expect(resp).to.be.an('array'); - expect(resp).to.be.empty(); + expect(resp).toEqual([]); }); - it('returns expected array for a detector with a partition field', () => { + test('returns expected array for a detector with a partition field', () => { const resp = getPartitioningFieldNames(job, 1); - expect(resp).to.be.an('array'); - expect(resp).to.have.length(1); - expect(resp).to.contain('clientip'); + expect(resp).toEqual(['clientip']); }); - it('returns expected array for a detector with by and over fields', () => { + test('returns expected array for a detector with by and over fields', () => { const resp = getPartitioningFieldNames(job, 2); - expect(resp).to.be.an('array'); - expect(resp).to.have.length(2); - expect(resp).to.contain('uri'); - expect(resp).to.contain('clientip'); + expect(resp).toEqual(['uri', 'clientip']); }); - it('returns expected array for a detector with partition, by and over fields', () => { + test('returns expected array for a detector with partition, by and over fields', () => { const resp = getPartitioningFieldNames(job, 3); - expect(resp).to.be.an('array'); - expect(resp).to.have.length(3); - expect(resp).to.contain('uri'); - expect(resp).to.contain('clientip'); - expect(resp).to.contain('method'); + expect(resp).toEqual(['method', 'uri', 'clientip']); }); }); describe('isModelPlotEnabled', () => { - it('returns true for a job in which model plot has been enabled', () => { + test('returns true for a job in which model plot has been enabled', () => { const job = { analysis_config: { detectors: [ @@ -407,10 +396,10 @@ describe('ML - job utils', () => { }, }; - expect(isModelPlotEnabled(job, 0)).to.be(true); + expect(isModelPlotEnabled(job, 0)).toBe(true); }); - it('returns expected values for a job in which model plot has been enabled with terms', () => { + test('returns expected values for a job in which model plot has been enabled with terms', () => { const job = { analysis_config: { detectors: [ @@ -433,23 +422,23 @@ describe('ML - job utils', () => { { fieldName: 'country', fieldValue: 'US' }, { fieldName: 'airline', fieldValue: 'AAL' }, ]) - ).to.be(true); - expect(isModelPlotEnabled(job, 0, [{ fieldName: 'country', fieldValue: 'US' }])).to.be(false); + ).toBe(true); + expect(isModelPlotEnabled(job, 0, [{ fieldName: 'country', fieldValue: 'US' }])).toBe(false); expect( isModelPlotEnabled(job, 0, [ { fieldName: 'country', fieldValue: 'GB' }, { fieldName: 'airline', fieldValue: 'AAL' }, ]) - ).to.be(false); + ).toBe(false); expect( isModelPlotEnabled(job, 0, [ { fieldName: 'country', fieldValue: 'JP' }, { fieldName: 'airline', fieldValue: 'JAL' }, ]) - ).to.be(false); + ).toBe(false); }); - it('returns true for jobs in which model plot has not been enabled', () => { + test('returns true for jobs in which model plot has not been enabled', () => { const job1 = { analysis_config: { detectors: [ @@ -466,8 +455,8 @@ describe('ML - job utils', () => { }; const job2 = {}; - expect(isModelPlotEnabled(job1, 0)).to.be(false); - expect(isModelPlotEnabled(job2, 0)).to.be(false); + expect(isModelPlotEnabled(job1, 0)).toBe(false); + expect(isModelPlotEnabled(job2, 0)).toBe(false); }); }); @@ -476,115 +465,115 @@ describe('ML - job utils', () => { job_version: '6.1.1', }; - it('returns true for later job version', () => { - expect(isJobVersionGte(job, '6.1.0')).to.be(true); + test('returns true for later job version', () => { + expect(isJobVersionGte(job, '6.1.0')).toBe(true); }); - it('returns true for equal job version', () => { - expect(isJobVersionGte(job, '6.1.1')).to.be(true); + test('returns true for equal job version', () => { + expect(isJobVersionGte(job, '6.1.1')).toBe(true); }); - it('returns false for earlier job version', () => { - expect(isJobVersionGte(job, '6.1.2')).to.be(false); + test('returns false for earlier job version', () => { + expect(isJobVersionGte(job, '6.1.2')).toBe(false); }); }); describe('mlFunctionToESAggregation', () => { - it('returns correct ES aggregation type for ML function', () => { - expect(mlFunctionToESAggregation('count')).to.be('count'); - expect(mlFunctionToESAggregation('low_count')).to.be('count'); - expect(mlFunctionToESAggregation('high_count')).to.be('count'); - expect(mlFunctionToESAggregation('non_zero_count')).to.be('count'); - expect(mlFunctionToESAggregation('low_non_zero_count')).to.be('count'); - expect(mlFunctionToESAggregation('high_non_zero_count')).to.be('count'); - expect(mlFunctionToESAggregation('distinct_count')).to.be('cardinality'); - expect(mlFunctionToESAggregation('low_distinct_count')).to.be('cardinality'); - expect(mlFunctionToESAggregation('high_distinct_count')).to.be('cardinality'); - expect(mlFunctionToESAggregation('metric')).to.be('avg'); - expect(mlFunctionToESAggregation('mean')).to.be('avg'); - expect(mlFunctionToESAggregation('low_mean')).to.be('avg'); - expect(mlFunctionToESAggregation('high_mean')).to.be('avg'); - expect(mlFunctionToESAggregation('min')).to.be('min'); - expect(mlFunctionToESAggregation('max')).to.be('max'); - expect(mlFunctionToESAggregation('sum')).to.be('sum'); - expect(mlFunctionToESAggregation('low_sum')).to.be('sum'); - expect(mlFunctionToESAggregation('high_sum')).to.be('sum'); - expect(mlFunctionToESAggregation('non_null_sum')).to.be('sum'); - expect(mlFunctionToESAggregation('low_non_null_sum')).to.be('sum'); - expect(mlFunctionToESAggregation('high_non_null_sum')).to.be('sum'); - expect(mlFunctionToESAggregation('rare')).to.be('count'); - expect(mlFunctionToESAggregation('freq_rare')).to.be(null); - expect(mlFunctionToESAggregation('info_content')).to.be(null); - expect(mlFunctionToESAggregation('low_info_content')).to.be(null); - expect(mlFunctionToESAggregation('high_info_content')).to.be(null); - expect(mlFunctionToESAggregation('median')).to.be('percentiles'); - expect(mlFunctionToESAggregation('low_median')).to.be('percentiles'); - expect(mlFunctionToESAggregation('high_median')).to.be('percentiles'); - expect(mlFunctionToESAggregation('varp')).to.be(null); - expect(mlFunctionToESAggregation('low_varp')).to.be(null); - expect(mlFunctionToESAggregation('high_varp')).to.be(null); - expect(mlFunctionToESAggregation('time_of_day')).to.be(null); - expect(mlFunctionToESAggregation('time_of_week')).to.be(null); - expect(mlFunctionToESAggregation('lat_long')).to.be(null); + test('returns correct ES aggregation type for ML function', () => { + expect(mlFunctionToESAggregation('count')).toBe('count'); + expect(mlFunctionToESAggregation('low_count')).toBe('count'); + expect(mlFunctionToESAggregation('high_count')).toBe('count'); + expect(mlFunctionToESAggregation('non_zero_count')).toBe('count'); + expect(mlFunctionToESAggregation('low_non_zero_count')).toBe('count'); + expect(mlFunctionToESAggregation('high_non_zero_count')).toBe('count'); + expect(mlFunctionToESAggregation('distinct_count')).toBe('cardinality'); + expect(mlFunctionToESAggregation('low_distinct_count')).toBe('cardinality'); + expect(mlFunctionToESAggregation('high_distinct_count')).toBe('cardinality'); + expect(mlFunctionToESAggregation('metric')).toBe('avg'); + expect(mlFunctionToESAggregation('mean')).toBe('avg'); + expect(mlFunctionToESAggregation('low_mean')).toBe('avg'); + expect(mlFunctionToESAggregation('high_mean')).toBe('avg'); + expect(mlFunctionToESAggregation('min')).toBe('min'); + expect(mlFunctionToESAggregation('max')).toBe('max'); + expect(mlFunctionToESAggregation('sum')).toBe('sum'); + expect(mlFunctionToESAggregation('low_sum')).toBe('sum'); + expect(mlFunctionToESAggregation('high_sum')).toBe('sum'); + expect(mlFunctionToESAggregation('non_null_sum')).toBe('sum'); + expect(mlFunctionToESAggregation('low_non_null_sum')).toBe('sum'); + expect(mlFunctionToESAggregation('high_non_null_sum')).toBe('sum'); + expect(mlFunctionToESAggregation('rare')).toBe('count'); + expect(mlFunctionToESAggregation('freq_rare')).toBe(null); + expect(mlFunctionToESAggregation('info_content')).toBe(null); + expect(mlFunctionToESAggregation('low_info_content')).toBe(null); + expect(mlFunctionToESAggregation('high_info_content')).toBe(null); + expect(mlFunctionToESAggregation('median')).toBe('percentiles'); + expect(mlFunctionToESAggregation('low_median')).toBe('percentiles'); + expect(mlFunctionToESAggregation('high_median')).toBe('percentiles'); + expect(mlFunctionToESAggregation('varp')).toBe(null); + expect(mlFunctionToESAggregation('low_varp')).toBe(null); + expect(mlFunctionToESAggregation('high_varp')).toBe(null); + expect(mlFunctionToESAggregation('time_of_day')).toBe(null); + expect(mlFunctionToESAggregation('time_of_week')).toBe(null); + expect(mlFunctionToESAggregation('lat_long')).toBe(null); }); }); describe('isJobIdValid', () => { - it('returns true for job id: "good_job-name"', () => { - expect(isJobIdValid('good_job-name')).to.be(true); + test('returns true for job id: "good_job-name"', () => { + expect(isJobIdValid('good_job-name')).toBe(true); }); - it('returns false for job id: "_bad_job-name"', () => { - expect(isJobIdValid('_bad_job-name')).to.be(false); + test('returns false for job id: "_bad_job-name"', () => { + expect(isJobIdValid('_bad_job-name')).toBe(false); }); - it('returns false for job id: "bad_job-name_"', () => { - expect(isJobIdValid('bad_job-name_')).to.be(false); + test('returns false for job id: "bad_job-name_"', () => { + expect(isJobIdValid('bad_job-name_')).toBe(false); }); - it('returns false for job id: "-bad_job-name"', () => { - expect(isJobIdValid('-bad_job-name')).to.be(false); + test('returns false for job id: "-bad_job-name"', () => { + expect(isJobIdValid('-bad_job-name')).toBe(false); }); - it('returns false for job id: "bad_job-name-"', () => { - expect(isJobIdValid('bad_job-name-')).to.be(false); + test('returns false for job id: "bad_job-name-"', () => { + expect(isJobIdValid('bad_job-name-')).toBe(false); }); - it('returns false for job id: "bad&job-name"', () => { - expect(isJobIdValid('bad&job-name')).to.be(false); + test('returns false for job id: "bad&job-name"', () => { + expect(isJobIdValid('bad&job-name')).toBe(false); }); }); describe('ML_MEDIAN_PERCENTS', () => { - it("is '50.0'", () => { - expect(ML_MEDIAN_PERCENTS).to.be('50.0'); + test("is '50.0'", () => { + expect(ML_MEDIAN_PERCENTS).toBe('50.0'); }); }); describe('prefixDatafeedId', () => { - it('returns datafeed-prefix-job from datafeed-job"', () => { - expect(prefixDatafeedId('datafeed-job', 'prefix-')).to.be('datafeed-prefix-job'); + test('returns datafeed-prefix-job from datafeed-job"', () => { + expect(prefixDatafeedId('datafeed-job', 'prefix-')).toBe('datafeed-prefix-job'); }); - it('returns datafeed-prefix-job from job"', () => { - expect(prefixDatafeedId('job', 'prefix-')).to.be('datafeed-prefix-job'); + test('returns datafeed-prefix-job from job"', () => { + expect(prefixDatafeedId('job', 'prefix-')).toBe('datafeed-prefix-job'); }); }); describe('getSafeAggregationName', () => { - it('"foo" should be "foo"', () => { - expect(getSafeAggregationName('foo', 0)).to.be('foo'); + test('"foo" should be "foo"', () => { + expect(getSafeAggregationName('foo', 0)).toBe('foo'); }); - it('"foo.bar" should be "foo.bar"', () => { - expect(getSafeAggregationName('foo.bar', 0)).to.be('foo.bar'); + test('"foo.bar" should be "foo.bar"', () => { + expect(getSafeAggregationName('foo.bar', 0)).toBe('foo.bar'); }); - it('"foo&bar" should be "field_0"', () => { - expect(getSafeAggregationName('foo&bar', 0)).to.be('field_0'); + test('"foo&bar" should be "field_0"', () => { + expect(getSafeAggregationName('foo&bar', 0)).toBe('field_0'); }); }); describe('getLatestDataOrBucketTimestamp', () => { - it('returns expected value when no gap in data at end of bucket processing', () => { - expect(getLatestDataOrBucketTimestamp(1549929594000, 1549928700000)).to.be(1549929594000); + test('returns expected value when no gap in data at end of bucket processing', () => { + expect(getLatestDataOrBucketTimestamp(1549929594000, 1549928700000)).toBe(1549929594000); }); - it('returns expected value when there is a gap in data at end of bucket processing', () => { - expect(getLatestDataOrBucketTimestamp(1549929594000, 1562256600000)).to.be(1562256600000); + test('returns expected value when there is a gap in data at end of bucket processing', () => { + expect(getLatestDataOrBucketTimestamp(1549929594000, 1562256600000)).toBe(1562256600000); }); - it('returns expected value when job has not run', () => { - expect(getLatestDataOrBucketTimestamp(undefined, undefined)).to.be(undefined); + test('returns expected value when job has not run', () => { + expect(getLatestDataOrBucketTimestamp(undefined, undefined)).toBe(undefined); }); }); }); diff --git a/x-pack/plugins/ml/server/lib/__tests__/query_utils.js b/x-pack/plugins/ml/server/lib/query_utils.test.ts similarity index 67% rename from x-pack/plugins/ml/server/lib/__tests__/query_utils.js rename to x-pack/plugins/ml/server/lib/query_utils.test.ts index 05292abb36b254..c2f5e814da3322 100644 --- a/x-pack/plugins/ml/server/lib/__tests__/query_utils.js +++ b/x-pack/plugins/ml/server/lib/query_utils.test.ts @@ -4,12 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -import expect from '@kbn/expect'; import { buildBaseFilterCriteria, buildSamplerAggregation, getSamplerAggregationsResponsePath, -} from '../query_utils'; +} from './query_utils'; describe('ML - query utils', () => { describe('buildBaseFilterCriteria', () => { @@ -23,8 +22,8 @@ describe('ML - query utils', () => { }, }; - it('returns correct criteria for time range', () => { - expect(buildBaseFilterCriteria('timestamp', earliestMs, latestMs)).to.eql([ + test('returns correct criteria for time range', () => { + expect(buildBaseFilterCriteria('timestamp', earliestMs, latestMs)).toEqual([ { range: { timestamp: { @@ -37,8 +36,8 @@ describe('ML - query utils', () => { ]); }); - it('returns correct criteria for time range and query', () => { - expect(buildBaseFilterCriteria('timestamp', earliestMs, latestMs, query)).to.eql([ + test('returns correct criteria for time range and query', () => { + expect(buildBaseFilterCriteria('timestamp', earliestMs, latestMs, query)).toEqual([ { range: { timestamp: { @@ -60,8 +59,8 @@ describe('ML - query utils', () => { }, }; - it('returns wrapped sampler aggregation for sampler shard size of 1000', () => { - expect(buildSamplerAggregation(testAggs, 1000)).to.eql({ + test('returns wrapped sampler aggregation for sampler shard size of 1000', () => { + expect(buildSamplerAggregation(testAggs, 1000)).toEqual({ sample: { sampler: { shard_size: 1000, @@ -71,18 +70,18 @@ describe('ML - query utils', () => { }); }); - it('returns un-sampled aggregation as-is for sampler shard size of 0', () => { - expect(buildSamplerAggregation(testAggs, 0)).to.eql(testAggs); + test('returns un-sampled aggregation as-is for sampler shard size of 0', () => { + expect(buildSamplerAggregation(testAggs, 0)).toEqual(testAggs); }); }); describe('getSamplerAggregationsResponsePath', () => { - it('returns correct path for sampler shard size of 1000', () => { - expect(getSamplerAggregationsResponsePath(1000)).to.eql(['sample']); + test('returns correct path for sampler shard size of 1000', () => { + expect(getSamplerAggregationsResponsePath(1000)).toEqual(['sample']); }); - it('returns correct path for sampler shard size of 0', () => { - expect(getSamplerAggregationsResponsePath(0)).to.eql([]); + test('returns correct path for sampler shard size of 0', () => { + expect(getSamplerAggregationsResponsePath(0)).toEqual([]); }); }); }); diff --git a/x-pack/plugins/oss_telemetry/server/lib/tasks/index.ts b/x-pack/plugins/oss_telemetry/server/lib/tasks/index.ts index 9342c2574beddb..415aeb2791d9eb 100644 --- a/x-pack/plugins/oss_telemetry/server/lib/tasks/index.ts +++ b/x-pack/plugins/oss_telemetry/server/lib/tasks/index.ts @@ -41,6 +41,7 @@ export function registerTasks({ createTaskRunner({ taskInstance }: { taskInstance: TaskInstance }) { return { run: visualizationsTaskRunner(taskInstance, config, esClientPromise), + cancel: async () => {}, }; }, }, diff --git a/x-pack/plugins/rollup/common/index.ts b/x-pack/plugins/rollup/common/index.ts new file mode 100644 index 00000000000000..aeffa3dc3959fd --- /dev/null +++ b/x-pack/plugins/rollup/common/index.ts @@ -0,0 +1,27 @@ +/* + * 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. + */ + +export const CONFIG_ROLLUPS = 'rollups:enableIndexPatterns'; + +export const API_BASE_PATH = '/api/rollup'; + +export { + UIM_APP_NAME, + UIM_APP_LOAD, + UIM_JOB_CREATE, + UIM_JOB_DELETE, + UIM_JOB_DELETE_MANY, + UIM_JOB_START, + UIM_JOB_START_MANY, + UIM_JOB_STOP, + UIM_JOB_STOP_MANY, + UIM_SHOW_DETAILS_CLICK, + UIM_DETAIL_PANEL_SUMMARY_TAB_CLICK, + UIM_DETAIL_PANEL_TERMS_TAB_CLICK, + UIM_DETAIL_PANEL_HISTOGRAM_TAB_CLICK, + UIM_DETAIL_PANEL_METRICS_TAB_CLICK, + UIM_DETAIL_PANEL_JSON_TAB_CLICK, +} from './ui_metric'; diff --git a/x-pack/legacy/plugins/rollup/common/ui_metric.ts b/x-pack/plugins/rollup/common/ui_metric.ts similarity index 100% rename from x-pack/legacy/plugins/rollup/common/ui_metric.ts rename to x-pack/plugins/rollup/common/ui_metric.ts diff --git a/x-pack/legacy/plugins/rollup/fixtures/index.js b/x-pack/plugins/rollup/fixtures/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/fixtures/index.js rename to x-pack/plugins/rollup/fixtures/index.js diff --git a/x-pack/legacy/plugins/rollup/fixtures/job.js b/x-pack/plugins/rollup/fixtures/job.js similarity index 95% rename from x-pack/legacy/plugins/rollup/fixtures/job.js rename to x-pack/plugins/rollup/fixtures/job.js index 3889cc6087d836..310244a5031e7a 100644 --- a/x-pack/legacy/plugins/rollup/fixtures/job.js +++ b/x-pack/plugins/rollup/fixtures/job.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { getRandomString } from '../../../../test_utils'; +import { getRandomString } from '../../../test_utils'; const initialValues = { dateHistogramField: 'timestamp', diff --git a/x-pack/plugins/rollup/kibana.json b/x-pack/plugins/rollup/kibana.json index 6ab2fc8907c0db..8f832f6c6a345a 100644 --- a/x-pack/plugins/rollup/kibana.json +++ b/x-pack/plugins/rollup/kibana.json @@ -2,5 +2,8 @@ "id": "rollup", "version": "8.0.0", "kibanaVersion": "kibana", - "server": true + "server": true, + "ui": true, + "optionalPlugins": ["home", "indexManagement", "indexPatternManagement", "usageCollection"], + "requiredPlugins": ["management", "data"] } diff --git a/x-pack/legacy/plugins/rollup/public/application.tsx b/x-pack/plugins/rollup/public/application.tsx similarity index 87% rename from x-pack/legacy/plugins/rollup/public/application.tsx rename to x-pack/plugins/rollup/public/application.tsx index df17d37bc34656..1bdf940d746b28 100644 --- a/x-pack/legacy/plugins/rollup/public/application.tsx +++ b/x-pack/plugins/rollup/public/application.tsx @@ -5,15 +5,17 @@ */ import React from 'react'; +import { ChromeBreadcrumb, CoreSetup } from 'kibana/public'; import { render, unmountComponentAtNode } from 'react-dom'; import { Provider } from 'react-redux'; -import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public'; -import { ChromeBreadcrumb, CoreSetup } from '../../../../../src/core/public'; +import { KibanaContextProvider } from '../../../../src/plugins/kibana_react/public'; // @ts-ignore import { rollupJobsStore } from './crud_app/store'; // @ts-ignore import { App } from './crud_app/app'; +import './index.scss'; + /** * This module will be loaded asynchronously to reduce the bundle size of your plugin's main bundle. */ diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/_crud_app.scss b/x-pack/plugins/rollup/public/crud_app/_crud_app.scss similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/_crud_app.scss rename to x-pack/plugins/rollup/public/crud_app/_crud_app.scss diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/app.js b/x-pack/plugins/rollup/public/crud_app/app.js similarity index 93% rename from x-pack/legacy/plugins/rollup/public/crud_app/app.js rename to x-pack/plugins/rollup/public/crud_app/app.js index da35c8a56f2d20..0ef3253eeb94ea 100644 --- a/x-pack/legacy/plugins/rollup/public/crud_app/app.js +++ b/x-pack/plugins/rollup/public/crud_app/app.js @@ -10,7 +10,8 @@ import { HashRouter, Switch, Route, Redirect, withRouter } from 'react-router-do import { UIM_APP_LOAD } from '../../common'; import { CRUD_APP_BASE_PATH } from './constants'; -import { registerRouter, setUserHasLeftApp, trackUiMetric, METRIC_TYPE } from './services'; +import { registerRouter, setUserHasLeftApp, METRIC_TYPE } from './services'; +import { trackUiMetric } from '../kibana_services'; import { JobList, JobCreate } from './sections'; class ShareRouterComponent extends Component { diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/constants/index.js b/x-pack/plugins/rollup/public/crud_app/constants/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/constants/index.js rename to x-pack/plugins/rollup/public/crud_app/constants/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/constants/metrics_config.js b/x-pack/plugins/rollup/public/crud_app/constants/metrics_config.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/constants/metrics_config.js rename to x-pack/plugins/rollup/public/crud_app/constants/metrics_config.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/constants/paths.js b/x-pack/plugins/rollup/public/crud_app/constants/paths.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/constants/paths.js rename to x-pack/plugins/rollup/public/crud_app/constants/paths.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/components/field_list/field_list.js b/x-pack/plugins/rollup/public/crud_app/sections/components/field_list/field_list.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/components/field_list/field_list.js rename to x-pack/plugins/rollup/public/crud_app/sections/components/field_list/field_list.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/components/field_list/index.js b/x-pack/plugins/rollup/public/crud_app/sections/components/field_list/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/components/field_list/index.js rename to x-pack/plugins/rollup/public/crud_app/sections/components/field_list/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/components/index.js b/x-pack/plugins/rollup/public/crud_app/sections/components/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/components/index.js rename to x-pack/plugins/rollup/public/crud_app/sections/components/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_action_menu/confirm_delete_modal/confirm_delete_modal.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/confirm_delete_modal/confirm_delete_modal.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_action_menu/confirm_delete_modal/confirm_delete_modal.js rename to x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/confirm_delete_modal/confirm_delete_modal.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_action_menu/confirm_delete_modal/index.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/confirm_delete_modal/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_action_menu/confirm_delete_modal/index.js rename to x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/confirm_delete_modal/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_action_menu/index.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_action_menu/index.js rename to x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.container.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.container.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.container.js rename to x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.container.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.js rename to x-pack/plugins/rollup/public/crud_app/sections/components/job_action_menu/job_action_menu.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_details/index.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_details/index.js rename to x-pack/plugins/rollup/public/crud_app/sections/components/job_details/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_details/job_details.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/job_details.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_details/job_details.js rename to x-pack/plugins/rollup/public/crud_app/sections/components/job_details/job_details.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_details/tabs/index.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_details/tabs/index.js rename to x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_histogram.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_histogram.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_histogram.js rename to x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_histogram.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_json.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_json.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_json.js rename to x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_json.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_metrics.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_metrics.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_metrics.js rename to x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_metrics.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_request.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_request.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_request.js rename to x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_request.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_summary.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_summary.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_summary.js rename to x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_summary.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_terms.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_terms.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_terms.js rename to x-pack/plugins/rollup/public/crud_app/sections/components/job_details/tabs/tab_terms.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_status/index.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_status/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_status/index.js rename to x-pack/plugins/rollup/public/crud_app/sections/components/job_status/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_status/job_status.js b/x-pack/plugins/rollup/public/crud_app/sections/components/job_status/job_status.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/components/job_status/job_status.js rename to x-pack/plugins/rollup/public/crud_app/sections/components/job_status/job_status.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/index.js b/x-pack/plugins/rollup/public/crud_app/sections/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/index.js rename to x-pack/plugins/rollup/public/crud_app/sections/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/index.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/index.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/job_create.container.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.container.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/job_create.container.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.container.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/job_create.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.js similarity index 99% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/job_create.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.js index 5379778c77e2f5..4458054f30dd1f 100644 --- a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/job_create.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.js @@ -14,7 +14,7 @@ import first from 'lodash/array/first'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; -import { withKibana } from '../../../../../../../../src/plugins/kibana_react/public/'; +import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; import { EuiCallOut, diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/navigation/index.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/navigation/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/navigation/index.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/navigation/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/navigation/navigation.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/navigation/navigation.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/navigation/navigation.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/navigation/navigation.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/components/field_chooser.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/components/field_chooser.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/components/field_chooser.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/components/field_chooser.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/components/index.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/components/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/components/index.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/components/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/components/step_error.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/components/step_error.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/components/step_error.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/components/step_error.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/index.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/index.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/step_date_histogram.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_date_histogram.js similarity index 99% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/step_date_histogram.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_date_histogram.js index ba65d082c0b4b8..c327e51a6b7eeb 100644 --- a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/step_date_histogram.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_date_histogram.js @@ -24,7 +24,7 @@ import { EuiTitle, } from '@elastic/eui'; -import { search } from '../../../../../../../../../src/plugins/data/public'; +import { search } from '../../../../../../../../src/plugins/data/public'; const { parseEsInterval } = search.aggs; import { getDateHistogramDetailsUrl, getDateHistogramAggregationUrl } from '../../../services'; diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/step_histogram.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_histogram.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/step_histogram.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_histogram.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/step_logistics.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_logistics.js similarity index 99% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/step_logistics.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_logistics.js index 5462a46bf59b96..0fd76e572b2e50 100644 --- a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/step_logistics.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_logistics.js @@ -24,8 +24,8 @@ import { EuiTitle, } from '@elastic/eui'; -import { CronEditor } from '../../../../../../../../../src/plugins/es_ui_shared/public'; -import { indexPatterns } from '../../../../../../../../../src/plugins/data/public'; +import { CronEditor } from '../../../../../../../../src/plugins/es_ui_shared/public'; +import { indexPatterns } from '../../../../../../../../src/plugins/data/public'; import { indices } from '../../../../shared_imports'; import { getLogisticalDetailsUrl, getCronUrl } from '../../../services'; diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/step_metrics.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_metrics.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/step_metrics.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_metrics.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/step_review.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_review.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/step_review.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_review.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/step_terms.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_terms.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps/step_terms.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps/step_terms.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/index.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/index.js similarity index 96% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/index.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/index.js index e1efcfdd24627b..4a55c4679c3d86 100644 --- a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/index.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/index.js @@ -8,7 +8,7 @@ import cloneDeep from 'lodash/lang/cloneDeep'; import get from 'lodash/object/get'; import pick from 'lodash/object/pick'; -import { WEEK } from '../../../../../../../../../src/plugins/es_ui_shared/public'; +import { WEEK } from '../../../../../../../../src/plugins/es_ui_shared/public'; import { validateId } from './validate_id'; import { validateIndexPattern } from './validate_index_pattern'; @@ -42,7 +42,7 @@ export const stepIds = [ * 1. getDefaultFields: (overrides) => object * 2. fieldValidations * - * See x-pack/legacy/plugins/rollup/public/crud_app/services/jobs.js for more information on override's shape + * See x-pack/plugins/rollup/public/crud_app/services/jobs.js for more information on override's shape */ export const stepIdToStepConfigMap = { [STEP_LOGISTICS]: { diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_date_histogram_field.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_date_histogram_field.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_date_histogram_field.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_date_histogram_field.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_date_histogram_interval.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_date_histogram_interval.js similarity index 95% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_date_histogram_interval.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_date_histogram_interval.js index b6c824bc8c553a..819c814e373d59 100644 --- a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_date_histogram_interval.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_date_histogram_interval.js @@ -6,7 +6,7 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; -import { search } from '../../../../../../../../../src/plugins/data/public'; +import { search } from '../../../../../../../../src/plugins/data/public'; const { InvalidEsIntervalFormatError, InvalidEsCalendarIntervalError, diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_histogram_interval.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_histogram_interval.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_histogram_interval.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_histogram_interval.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_id.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_id.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_id.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_id.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_index_pattern.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_index_pattern.js similarity index 95% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_index_pattern.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_index_pattern.js index 206cc325813c0d..534fcaa744744a 100644 --- a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_index_pattern.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_index_pattern.js @@ -7,7 +7,7 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; -import { indexPatterns } from '../../../../../../../../../src/plugins/data/public'; +import { indexPatterns } from '../../../../../../../../src/plugins/data/public'; export function validateIndexPattern(indexPattern, rollupIndex) { if (!indexPattern || !indexPattern.trim()) { return [ diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_metrics.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_metrics.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_metrics.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_metrics.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_cron.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_cron.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_cron.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_cron.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_delay.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_delay.js similarity index 95% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_delay.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_delay.js index 37c2ca9a1d775d..66bfd43bc3d1bd 100644 --- a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_delay.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_delay.js @@ -6,7 +6,7 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; -import { search } from '../../../../../../../../../src/plugins/data/public'; +import { search } from '../../../../../../../../src/plugins/data/public'; const { InvalidEsIntervalFormatError, InvalidEsCalendarIntervalError, diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_index.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_index.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_page_size.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_page_size.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_page_size.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_create/steps_config/validate_rollup_page_size.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.container.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.container.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.container.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.container.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.js similarity index 98% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.js index f774b1d7f63b72..3f168a66feed84 100644 --- a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.js @@ -34,7 +34,8 @@ import { UIM_DETAIL_PANEL_METRICS_TAB_CLICK, UIM_DETAIL_PANEL_JSON_TAB_CLICK, } from '../../../../../common'; -import { trackUiMetric, METRIC_TYPE } from '../../../services'; +import { METRIC_TYPE } from '../../../services'; +import { trackUiMetric } from '../../../../kibana_services'; import { JobActionMenu, diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.test.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.test.js similarity index 98% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.test.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.test.js index 9ac8e6075e4cf3..cea5b3c3e96e57 100644 --- a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.test.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_list/detail_panel/detail_panel.test.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { registerTestBed } from '../../../../../../../../test_utils'; +import { registerTestBed } from '../../../../../../../test_utils'; import { getJob } from '../../../../../fixtures'; import { rollupJobsStore } from '../../../store'; import { DetailPanel } from './detail_panel'; @@ -17,9 +17,8 @@ import { tabToHumanizedMap, } from '../../components'; -jest.mock('ui/new_platform'); -jest.mock('../../../services', () => { - const services = require.requireActual('../../../services'); +jest.mock('../../../../kibana_services', () => { + const services = require.requireActual('../../../../kibana_services'); return { ...services, trackUiMetric: jest.fn(), diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/detail_panel/index.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/detail_panel/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/detail_panel/index.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_list/detail_panel/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/index.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/index.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_list/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_list.container.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.container.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_list.container.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.container.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_list.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.js similarity index 98% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_list.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.js index 98329a687217a7..011becded148cf 100644 --- a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_list.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.js @@ -25,7 +25,7 @@ import { EuiCallOut, } from '@elastic/eui'; -import { withKibana } from '../../../../../../../../src/plugins/kibana_react/public/'; +import { withKibana } from '../../../../../../../src/plugins/kibana_react/public'; import { CRUD_APP_BASE_PATH } from '../../constants'; import { getRouterLinkProps, extractQueryParams, listBreadcrumb } from '../../services'; diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_list.test.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.test.js similarity index 90% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_list.test.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.test.js index 725789fc584de5..8c3bffd223ca9c 100644 --- a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_list.test.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_list.test.js @@ -5,16 +5,14 @@ */ import React from 'react'; -import { registerTestBed } from '../../../../../../../test_utils'; +import { registerTestBed } from '../../../../../../test_utils'; import { rollupJobsStore } from '../../store'; import { JobList } from './job_list'; -import { KibanaContextProvider } from '../../../../../../../../src/plugins/kibana_react/public'; -import { coreMock } from '../../../../../../../../src/core/public/mocks'; +import { KibanaContextProvider } from '../../../../../../../src/plugins/kibana_react/public'; +import { coreMock } from '../../../../../../../src/core/public/mocks'; const startMock = coreMock.createStart(); -jest.mock('ui/new_platform'); - jest.mock('../../services', () => { const services = require.requireActual('../../services'); return { diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_table/index.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_table/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_table/index.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_list/job_table/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.container.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.container.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.container.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.container.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.js similarity index 99% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.js index 4dbe396ab8410f..f47992e1b501ae 100644 --- a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.js @@ -30,7 +30,8 @@ import { } from '@elastic/eui'; import { UIM_SHOW_DETAILS_CLICK } from '../../../../../common'; -import { trackUiMetric, METRIC_TYPE } from '../../../services'; +import { METRIC_TYPE } from '../../../services'; +import { trackUiMetric } from '../../../../kibana_services'; import { JobActionMenu, JobStatus } from '../../components'; const COLUMNS = [ diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.test.js b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.test.js similarity index 96% rename from x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.test.js rename to x-pack/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.test.js index c688343d5f7681..c6a3d3a8f69add 100644 --- a/x-pack/legacy/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.test.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_list/job_table/job_table.test.js @@ -6,14 +6,13 @@ import { Pager } from '@elastic/eui'; -import { registerTestBed } from '../../../../../../../../test_utils'; +import { registerTestBed } from '../../../../../../../test_utils'; import { getJobs, jobCount } from '../../../../../fixtures'; import { rollupJobsStore } from '../../../store'; import { JobTable } from './job_table'; -jest.mock('ui/new_platform'); -jest.mock('../../../services', () => { - const services = require.requireActual('../../../services'); +jest.mock('../../../../kibana_services', () => { + const services = require.requireActual('../../../../kibana_services'); return { ...services, trackUiMetric: jest.fn(), diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/services/api.js b/x-pack/plugins/rollup/public/crud_app/services/api.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/services/api.js rename to x-pack/plugins/rollup/public/crud_app/services/api.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/services/api_errors.ts b/x-pack/plugins/rollup/public/crud_app/services/api_errors.ts similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/services/api_errors.ts rename to x-pack/plugins/rollup/public/crud_app/services/api_errors.ts diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/services/breadcrumbs.js b/x-pack/plugins/rollup/public/crud_app/services/breadcrumbs.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/services/breadcrumbs.js rename to x-pack/plugins/rollup/public/crud_app/services/breadcrumbs.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/services/documentation_links.js b/x-pack/plugins/rollup/public/crud_app/services/documentation_links.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/services/documentation_links.js rename to x-pack/plugins/rollup/public/crud_app/services/documentation_links.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/services/filter_items.js b/x-pack/plugins/rollup/public/crud_app/services/filter_items.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/services/filter_items.js rename to x-pack/plugins/rollup/public/crud_app/services/filter_items.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/services/flatten_panel_tree.js b/x-pack/plugins/rollup/public/crud_app/services/flatten_panel_tree.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/services/flatten_panel_tree.js rename to x-pack/plugins/rollup/public/crud_app/services/flatten_panel_tree.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/services/format_fields.js b/x-pack/plugins/rollup/public/crud_app/services/format_fields.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/services/format_fields.js rename to x-pack/plugins/rollup/public/crud_app/services/format_fields.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/services/http_provider.ts b/x-pack/plugins/rollup/public/crud_app/services/http_provider.ts similarity index 91% rename from x-pack/legacy/plugins/rollup/public/crud_app/services/http_provider.ts rename to x-pack/plugins/rollup/public/crud_app/services/http_provider.ts index dd84328084d050..93898610b844ed 100644 --- a/x-pack/legacy/plugins/rollup/public/crud_app/services/http_provider.ts +++ b/x-pack/plugins/rollup/public/crud_app/services/http_provider.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HttpStart } from 'src/core/public'; +import { HttpStart } from 'kibana/public'; let _http: HttpStart | null = null; diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/services/index.js b/x-pack/plugins/rollup/public/crud_app/services/index.js similarity index 95% rename from x-pack/legacy/plugins/rollup/public/crud_app/services/index.js rename to x-pack/plugins/rollup/public/crud_app/services/index.js index 790770b9b6a9f4..0b45b1bdb6b5fb 100644 --- a/x-pack/legacy/plugins/rollup/public/crud_app/services/index.js +++ b/x-pack/plugins/rollup/public/crud_app/services/index.js @@ -47,4 +47,4 @@ export { sortTable } from './sort_table'; export { retypeMetrics } from './retype_metrics'; -export { trackUiMetric, METRIC_TYPE } from './track_ui_metric'; +export { METRIC_TYPE } from './track_ui_metric'; diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/services/jobs.js b/x-pack/plugins/rollup/public/crud_app/services/jobs.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/services/jobs.js rename to x-pack/plugins/rollup/public/crud_app/services/jobs.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/services/noticeable_delay.js b/x-pack/plugins/rollup/public/crud_app/services/noticeable_delay.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/services/noticeable_delay.js rename to x-pack/plugins/rollup/public/crud_app/services/noticeable_delay.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/services/query_params.js b/x-pack/plugins/rollup/public/crud_app/services/query_params.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/services/query_params.js rename to x-pack/plugins/rollup/public/crud_app/services/query_params.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/services/retype_metrics.js b/x-pack/plugins/rollup/public/crud_app/services/retype_metrics.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/services/retype_metrics.js rename to x-pack/plugins/rollup/public/crud_app/services/retype_metrics.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/services/routing.js b/x-pack/plugins/rollup/public/crud_app/services/routing.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/services/routing.js rename to x-pack/plugins/rollup/public/crud_app/services/routing.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/services/sort_table.js b/x-pack/plugins/rollup/public/crud_app/services/sort_table.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/services/sort_table.js rename to x-pack/plugins/rollup/public/crud_app/services/sort_table.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/services/track_ui_metric.js b/x-pack/plugins/rollup/public/crud_app/services/track_ui_metric.ts similarity index 70% rename from x-pack/legacy/plugins/rollup/public/crud_app/services/track_ui_metric.js rename to x-pack/plugins/rollup/public/crud_app/services/track_ui_metric.ts index 69a5995386bd74..aa1cc2dfea323d 100644 --- a/x-pack/legacy/plugins/rollup/public/crud_app/services/track_ui_metric.js +++ b/x-pack/plugins/rollup/public/crud_app/services/track_ui_metric.ts @@ -4,20 +4,16 @@ * you may not use this file except in compliance with the Elastic License. */ -import { - createUiStatsReporter, - METRIC_TYPE, -} from '../../../../../../../src/legacy/core_plugins/ui_metric/public'; -import { UIM_APP_NAME } from '../../../common'; +import { METRIC_TYPE } from '@kbn/analytics'; +import { trackUiMetric } from '../../kibana_services'; -export const trackUiMetric = createUiStatsReporter(UIM_APP_NAME); export { METRIC_TYPE }; /** * Transparently return provided request Promise, while allowing us to track * a successful completion of the request. */ -export function trackUserRequest(request, actionType) { +export function trackUserRequest(request: Promise, actionType: string) { // Only track successful actions. return request.then(response => { trackUiMetric(METRIC_TYPE.LOADED, actionType); diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/action_types.js b/x-pack/plugins/rollup/public/crud_app/store/action_types.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/action_types.js rename to x-pack/plugins/rollup/public/crud_app/store/action_types.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/actions/change_job_status.js b/x-pack/plugins/rollup/public/crud_app/store/actions/change_job_status.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/actions/change_job_status.js rename to x-pack/plugins/rollup/public/crud_app/store/actions/change_job_status.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/actions/clone_job.js b/x-pack/plugins/rollup/public/crud_app/store/actions/clone_job.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/actions/clone_job.js rename to x-pack/plugins/rollup/public/crud_app/store/actions/clone_job.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/actions/create_job.js b/x-pack/plugins/rollup/public/crud_app/store/actions/create_job.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/actions/create_job.js rename to x-pack/plugins/rollup/public/crud_app/store/actions/create_job.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/actions/delete_jobs.js b/x-pack/plugins/rollup/public/crud_app/store/actions/delete_jobs.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/actions/delete_jobs.js rename to x-pack/plugins/rollup/public/crud_app/store/actions/delete_jobs.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/actions/detail_panel.js b/x-pack/plugins/rollup/public/crud_app/store/actions/detail_panel.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/actions/detail_panel.js rename to x-pack/plugins/rollup/public/crud_app/store/actions/detail_panel.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/actions/index.js b/x-pack/plugins/rollup/public/crud_app/store/actions/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/actions/index.js rename to x-pack/plugins/rollup/public/crud_app/store/actions/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/actions/load_jobs.js b/x-pack/plugins/rollup/public/crud_app/store/actions/load_jobs.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/actions/load_jobs.js rename to x-pack/plugins/rollup/public/crud_app/store/actions/load_jobs.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/actions/refresh_jobs.js b/x-pack/plugins/rollup/public/crud_app/store/actions/refresh_jobs.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/actions/refresh_jobs.js rename to x-pack/plugins/rollup/public/crud_app/store/actions/refresh_jobs.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/actions/table_state.js b/x-pack/plugins/rollup/public/crud_app/store/actions/table_state.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/actions/table_state.js rename to x-pack/plugins/rollup/public/crud_app/store/actions/table_state.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/index.js b/x-pack/plugins/rollup/public/crud_app/store/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/index.js rename to x-pack/plugins/rollup/public/crud_app/store/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/middleware/clone_job.js b/x-pack/plugins/rollup/public/crud_app/store/middleware/clone_job.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/middleware/clone_job.js rename to x-pack/plugins/rollup/public/crud_app/store/middleware/clone_job.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/middleware/detail_panel.js b/x-pack/plugins/rollup/public/crud_app/store/middleware/detail_panel.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/middleware/detail_panel.js rename to x-pack/plugins/rollup/public/crud_app/store/middleware/detail_panel.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/middleware/index.js b/x-pack/plugins/rollup/public/crud_app/store/middleware/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/middleware/index.js rename to x-pack/plugins/rollup/public/crud_app/store/middleware/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/reducers/clone_job.js b/x-pack/plugins/rollup/public/crud_app/store/reducers/clone_job.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/reducers/clone_job.js rename to x-pack/plugins/rollup/public/crud_app/store/reducers/clone_job.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/reducers/create_job.js b/x-pack/plugins/rollup/public/crud_app/store/reducers/create_job.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/reducers/create_job.js rename to x-pack/plugins/rollup/public/crud_app/store/reducers/create_job.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/reducers/detail_panel.js b/x-pack/plugins/rollup/public/crud_app/store/reducers/detail_panel.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/reducers/detail_panel.js rename to x-pack/plugins/rollup/public/crud_app/store/reducers/detail_panel.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/reducers/index.js b/x-pack/plugins/rollup/public/crud_app/store/reducers/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/reducers/index.js rename to x-pack/plugins/rollup/public/crud_app/store/reducers/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/reducers/jobs.js b/x-pack/plugins/rollup/public/crud_app/store/reducers/jobs.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/reducers/jobs.js rename to x-pack/plugins/rollup/public/crud_app/store/reducers/jobs.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/reducers/table_state.js b/x-pack/plugins/rollup/public/crud_app/store/reducers/table_state.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/reducers/table_state.js rename to x-pack/plugins/rollup/public/crud_app/store/reducers/table_state.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/reducers/update_job.js b/x-pack/plugins/rollup/public/crud_app/store/reducers/update_job.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/reducers/update_job.js rename to x-pack/plugins/rollup/public/crud_app/store/reducers/update_job.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/selectors/index.js b/x-pack/plugins/rollup/public/crud_app/store/selectors/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/selectors/index.js rename to x-pack/plugins/rollup/public/crud_app/store/selectors/index.js diff --git a/x-pack/legacy/plugins/rollup/public/crud_app/store/store.js b/x-pack/plugins/rollup/public/crud_app/store/store.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/crud_app/store/store.js rename to x-pack/plugins/rollup/public/crud_app/store/store.js diff --git a/x-pack/legacy/plugins/rollup/public/extend_index_management/index.ts b/x-pack/plugins/rollup/public/extend_index_management/index.ts similarity index 100% rename from x-pack/legacy/plugins/rollup/public/extend_index_management/index.ts rename to x-pack/plugins/rollup/public/extend_index_management/index.ts diff --git a/x-pack/legacy/plugins/rollup/public/index.scss b/x-pack/plugins/rollup/public/index.scss similarity index 67% rename from x-pack/legacy/plugins/rollup/public/index.scss rename to x-pack/plugins/rollup/public/index.scss index 0ad0eac50f7b93..cbbedcebb043e1 100644 --- a/x-pack/legacy/plugins/rollup/public/index.scss +++ b/x-pack/plugins/rollup/public/index.scss @@ -1,6 +1,3 @@ -// Import the EUI global scope so we can use EUI constants -@import 'src/legacy/ui/public/styles/_styling_constants'; - // Index management plugin styles // Prefix all styles with "rollup" to avoid conflicts. diff --git a/x-pack/plugins/uptime/server/graphql/pings/index.ts b/x-pack/plugins/rollup/public/index.ts similarity index 72% rename from x-pack/plugins/uptime/server/graphql/pings/index.ts rename to x-pack/plugins/rollup/public/index.ts index 100ce29c398ec1..4c965fc38f4e7d 100644 --- a/x-pack/plugins/uptime/server/graphql/pings/index.ts +++ b/x-pack/plugins/rollup/public/index.ts @@ -4,4 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -export { pingsSchema } from './schema.gql'; +import { RollupPlugin } from './plugin'; + +export const plugin = () => new RollupPlugin(); diff --git a/x-pack/legacy/plugins/rollup/public/index_pattern_creation/components/rollup_prompt/index.js b/x-pack/plugins/rollup/public/index_pattern_creation/components/rollup_prompt/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/index_pattern_creation/components/rollup_prompt/index.js rename to x-pack/plugins/rollup/public/index_pattern_creation/components/rollup_prompt/index.js diff --git a/x-pack/legacy/plugins/rollup/public/index_pattern_creation/components/rollup_prompt/rollup_prompt.js b/x-pack/plugins/rollup/public/index_pattern_creation/components/rollup_prompt/rollup_prompt.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/index_pattern_creation/components/rollup_prompt/rollup_prompt.js rename to x-pack/plugins/rollup/public/index_pattern_creation/components/rollup_prompt/rollup_prompt.js diff --git a/x-pack/legacy/plugins/rollup/public/index_pattern_creation/rollup_index_pattern_creation_config.js b/x-pack/plugins/rollup/public/index_pattern_creation/rollup_index_pattern_creation_config.js similarity index 97% rename from x-pack/legacy/plugins/rollup/public/index_pattern_creation/rollup_index_pattern_creation_config.js rename to x-pack/plugins/rollup/public/index_pattern_creation/rollup_index_pattern_creation_config.js index f4de2a30981276..c29fba44285be0 100644 --- a/x-pack/legacy/plugins/rollup/public/index_pattern_creation/rollup_index_pattern_creation_config.js +++ b/x-pack/plugins/rollup/public/index_pattern_creation/rollup_index_pattern_creation_config.js @@ -8,7 +8,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { RollupPrompt } from './components/rollup_prompt'; -import { IndexPatternCreationConfig } from '../../../../../../src/plugins/index_pattern_management/public'; +import { IndexPatternCreationConfig } from '../../../../../src/plugins/index_pattern_management/public'; const rollupIndexPatternTypeName = i18n.translate( 'xpack.rollupJobs.editRollupIndexPattern.createIndex.defaultTypeName', diff --git a/x-pack/legacy/plugins/rollup/public/index_pattern_list/rollup_index_pattern_list_config.js b/x-pack/plugins/rollup/public/index_pattern_list/rollup_index_pattern_list_config.js similarity index 93% rename from x-pack/legacy/plugins/rollup/public/index_pattern_list/rollup_index_pattern_list_config.js rename to x-pack/plugins/rollup/public/index_pattern_list/rollup_index_pattern_list_config.js index 809a76d1868b22..e61287d303643c 100644 --- a/x-pack/legacy/plugins/rollup/public/index_pattern_list/rollup_index_pattern_list_config.js +++ b/x-pack/plugins/rollup/public/index_pattern_list/rollup_index_pattern_list_config.js @@ -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 { IndexPatternListConfig } from '../../../../../../src/plugins/index_pattern_management/public'; +import { IndexPatternListConfig } from '../../../../../src/plugins/index_pattern_management/public'; function isRollup(indexPattern) { return ( diff --git a/x-pack/legacy/plugins/rollup/public/kibana_services.ts b/x-pack/plugins/rollup/public/kibana_services.ts similarity index 57% rename from x-pack/legacy/plugins/rollup/public/kibana_services.ts rename to x-pack/plugins/rollup/public/kibana_services.ts index 335eeb90282ca9..edbf69568f5e50 100644 --- a/x-pack/legacy/plugins/rollup/public/kibana_services.ts +++ b/x-pack/plugins/rollup/public/kibana_services.ts @@ -4,7 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { NotificationsStart, FatalErrorsSetup } from 'src/core/public'; +import { NotificationsStart, FatalErrorsSetup } from 'kibana/public'; +import { UiStatsMetricType } from '@kbn/analytics'; +import { createGetterSetter } from '../../../../src/plugins/kibana_utils/common'; let notifications: NotificationsStart | null = null; let fatalErrors: FatalErrorsSetup | null = null; @@ -28,3 +30,18 @@ export function getFatalErrors() { export function setFatalErrors(newFatalErrors: FatalErrorsSetup) { fatalErrors = newFatalErrors; } + +export const [getUiStatsReporter, setUiStatsReporter] = createGetterSetter< + (type: UiStatsMetricType, eventNames: string | string[], count?: number) => void +>('uiMetric'); + +// default value if usageCollection is not available +setUiStatsReporter(() => {}); + +export function trackUiMetric( + type: UiStatsMetricType, + eventNames: string | string[], + count?: number +) { + getUiStatsReporter()(type, eventNames, count); +} diff --git a/x-pack/legacy/plugins/rollup/public/plugin.ts b/x-pack/plugins/rollup/public/plugin.ts similarity index 73% rename from x-pack/legacy/plugins/rollup/public/plugin.ts rename to x-pack/plugins/rollup/public/plugin.ts index 17ec8a5a4aedf1..fd1b90fbc98557 100644 --- a/x-pack/legacy/plugins/rollup/public/plugin.ts +++ b/x-pack/plugins/rollup/public/plugin.ts @@ -6,7 +6,6 @@ import { i18n } from '@kbn/i18n'; import { CoreSetup, CoreStart, Plugin } from 'kibana/public'; -import { PluginsStart } from './legacy_imports'; import { rollupBadgeExtension, rollupToggleExtension } from './extend_index_management'; // @ts-ignore import { RollupIndexPatternCreationConfig } from './index_pattern_creation/rollup_index_pattern_creation_config'; @@ -16,35 +15,49 @@ import { RollupIndexPatternListConfig } from './index_pattern_list/rollup_index_ import { initAggTypeFilter } from './visualize/agg_type_filter'; // @ts-ignore import { initAggTypeFieldFilter } from './visualize/agg_type_field_filter'; -import { CONFIG_ROLLUPS } from '../common'; +import { CONFIG_ROLLUPS, UIM_APP_NAME } from '../common'; import { FeatureCatalogueCategory, HomePublicPluginSetup, -} from '../../../../../src/plugins/home/public'; +} from '../../../../src/plugins/home/public'; // @ts-ignore import { CRUD_APP_BASE_PATH } from './crud_app/constants'; -import { ManagementSetup } from '../../../../../src/plugins/management/public'; -import { IndexManagementPluginSetup } from '../../../../plugins/index_management/public'; -import { IndexPatternManagementSetup } from '../../../../../src/plugins/index_pattern_management/public'; -import { search } from '../../../../../src/plugins/data/public'; +import { ManagementSetup } from '../../../../src/plugins/management/public'; +import { IndexManagementPluginSetup } from '../../index_management/public'; +import { IndexPatternManagementSetup } from '../../../../src/plugins/index_pattern_management/public'; +import { DataPublicPluginStart, search } from '../../../../src/plugins/data/public'; // @ts-ignore -import { setEsBaseAndXPackBase, setHttp } from './crud_app/services'; -import { setNotifications, setFatalErrors } from './kibana_services'; -import { renderApp } from './application'; +import { setEsBaseAndXPackBase, setHttp } from './crud_app/services/index'; +import { setNotifications, setFatalErrors, setUiStatsReporter } from './kibana_services'; +import { UsageCollectionSetup } from '../../../../src/plugins/usage_collection/public'; export interface RollupPluginSetupDependencies { home?: HomePublicPluginSetup; management: ManagementSetup; indexManagement?: IndexManagementPluginSetup; indexPatternManagement: IndexPatternManagementSetup; + usageCollection?: UsageCollectionSetup; +} + +export interface RollupPluginStartDependencies { + data: DataPublicPluginStart; } export class RollupPlugin implements Plugin { setup( core: CoreSetup, - { home, management, indexManagement, indexPatternManagement }: RollupPluginSetupDependencies + { + home, + management, + indexManagement, + indexPatternManagement, + usageCollection, + }: RollupPluginSetupDependencies ) { setFatalErrors(core.fatalErrors); + if (usageCollection) { + setUiStatsReporter(usageCollection.reportUiStats.bind(usageCollection, UIM_APP_NAME)); + } if (indexManagement) { indexManagement.extensionsService.addBadge(rollupBadgeExtension); @@ -79,7 +92,7 @@ export class RollupPlugin implements Plugin { id: 'rollup_jobs', title: i18n.translate('xpack.rollupJobs.appTitle', { defaultMessage: 'Rollup Jobs' }), order: 3, - mount(params) { + async mount(params) { params.setBreadcrumbs([ { text: i18n.translate('xpack.rollupJobs.breadcrumbsTitle', { @@ -87,6 +100,7 @@ export class RollupPlugin implements Plugin { }), }, ]); + const { renderApp } = await import('./application'); return renderApp(core, params); }, @@ -94,7 +108,7 @@ export class RollupPlugin implements Plugin { } } - start(core: CoreStart, plugins: PluginsStart) { + start(core: CoreStart, plugins: RollupPluginStartDependencies) { setHttp(core.http); setNotifications(core.notifications); setEsBaseAndXPackBase(core.docLinks.ELASTIC_WEBSITE_URL, core.docLinks.DOC_LINK_VERSION); diff --git a/x-pack/legacy/plugins/rollup/public/shared_imports.ts b/x-pack/plugins/rollup/public/shared_imports.ts similarity index 76% rename from x-pack/legacy/plugins/rollup/public/shared_imports.ts rename to x-pack/plugins/rollup/public/shared_imports.ts index 6bf74da6db6fe5..1ac25a1a0e5f8e 100644 --- a/x-pack/legacy/plugins/rollup/public/shared_imports.ts +++ b/x-pack/plugins/rollup/public/shared_imports.ts @@ -4,4 +4,4 @@ * you may not use this file except in compliance with the Elastic License. */ -export { indices } from '../../../../../src/plugins/es_ui_shared/public'; +export { indices } from '../../../../src/plugins/es_ui_shared/public'; diff --git a/x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/constants.js b/x-pack/plugins/rollup/public/test/client_integration/helpers/constants.js similarity index 100% rename from x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/constants.js rename to x-pack/plugins/rollup/public/test/client_integration/helpers/constants.js diff --git a/x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/index.js b/x-pack/plugins/rollup/public/test/client_integration/helpers/index.js similarity index 100% rename from x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/index.js rename to x-pack/plugins/rollup/public/test/client_integration/helpers/index.js diff --git a/x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/job_clone.helpers.js b/x-pack/plugins/rollup/public/test/client_integration/helpers/job_clone.helpers.js similarity index 83% rename from x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/job_clone.helpers.js rename to x-pack/plugins/rollup/public/test/client_integration/helpers/job_clone.helpers.js index a8376bb31b23ff..fa9929a2076158 100644 --- a/x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/job_clone.helpers.js +++ b/x-pack/plugins/rollup/public/test/client_integration/helpers/job_clone.helpers.js @@ -5,10 +5,10 @@ */ import { registerTestBed } from '../../../../../../test_utils'; -import { createRollupJobsStore } from '../../../public/crud_app/store'; -import { JobCreate } from '../../../public/crud_app/sections'; +import { createRollupJobsStore } from '../../../crud_app/store'; +import { JobCreate } from '../../../crud_app/sections'; import { JOB_TO_CLONE } from './constants'; -import { deserializeJob } from '../../../public/crud_app/services'; +import { deserializeJob } from '../../../crud_app/services'; import { wrapComponent } from './setup_context'; diff --git a/x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/job_create.helpers.js b/x-pack/plugins/rollup/public/test/client_integration/helpers/job_create.helpers.js similarity index 96% rename from x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/job_create.helpers.js rename to x-pack/plugins/rollup/public/test/client_integration/helpers/job_create.helpers.js index 2395fd014dd1e5..7ddcfa9eb83ff5 100644 --- a/x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/job_create.helpers.js +++ b/x-pack/plugins/rollup/public/test/client_integration/helpers/job_create.helpers.js @@ -5,8 +5,8 @@ */ import { registerTestBed } from '../../../../../../test_utils'; -import { rollupJobsStore } from '../../../public/crud_app/store'; -import { JobCreate } from '../../../public/crud_app/sections'; +import { rollupJobsStore } from '../../../crud_app/store'; +import { JobCreate } from '../../../crud_app/sections'; import { JOB_TO_CREATE } from './constants'; diff --git a/x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/job_list.helpers.js b/x-pack/plugins/rollup/public/test/client_integration/helpers/job_list.helpers.js similarity index 74% rename from x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/job_list.helpers.js rename to x-pack/plugins/rollup/public/test/client_integration/helpers/job_list.helpers.js index bcad8c29c87c03..fda1ec8cfed22d 100644 --- a/x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/job_list.helpers.js +++ b/x-pack/plugins/rollup/public/test/client_integration/helpers/job_list.helpers.js @@ -5,9 +5,9 @@ */ import { registerTestBed } from '../../../../../../test_utils'; -import { registerRouter } from '../../../public/crud_app/services'; -import { createRollupJobsStore } from '../../../public/crud_app/store'; -import { JobList } from '../../../public/crud_app/sections/job_list'; +import { registerRouter } from '../../../crud_app/services'; +import { createRollupJobsStore } from '../../../crud_app/store'; +import { JobList } from '../../../crud_app/sections/job_list'; import { wrapComponent } from './setup_context'; diff --git a/x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/setup_context.tsx b/x-pack/plugins/rollup/public/test/client_integration/helpers/setup_context.tsx similarity index 100% rename from x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/setup_context.tsx rename to x-pack/plugins/rollup/public/test/client_integration/helpers/setup_context.tsx diff --git a/x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/setup_environment.ts b/x-pack/plugins/rollup/public/test/client_integration/helpers/setup_environment.ts similarity index 100% rename from x-pack/legacy/plugins/rollup/__jest__/client_integration/helpers/setup_environment.ts rename to x-pack/plugins/rollup/public/test/client_integration/helpers/setup_environment.ts diff --git a/x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_clone.test.js b/x-pack/plugins/rollup/public/test/client_integration/job_create_clone.test.js similarity index 93% rename from x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_clone.test.js rename to x-pack/plugins/rollup/public/test/client_integration/job_create_clone.test.js index b7c98ed179c7ab..7b61a03dcde456 100644 --- a/x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_clone.test.js +++ b/x-pack/plugins/rollup/public/test/client_integration/job_create_clone.test.js @@ -4,11 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { setHttp } from '../../public/crud_app/services'; +import { setHttp } from '../../crud_app/services'; import { mockHttpRequest, pageHelpers, nextTick } from './helpers'; import { JOB_TO_CLONE, JOB_CLONE_INDEX_PATTERN_CHECK } from './helpers/constants'; - -jest.mock('ui/new_platform'); +import { coreMock } from '../../../../../../src/core/public/mocks'; jest.mock('lodash/function/debounce', () => fn => fn); @@ -23,23 +22,23 @@ describe('Cloning a rollup job through create job wizard', () => { let form; let table; let actions; - let npStart; + let startMock; beforeAll(() => { - npStart = require('ui/new_platform').npStart; // eslint-disable-line - setHttp(npStart.core.http); + startMock = coreMock.createStart(); + setHttp(startMock.http); }); beforeEach(() => { - mockHttpRequest(npStart.core.http, { indxPatternVldtResp: JOB_CLONE_INDEX_PATTERN_CHECK }); + mockHttpRequest(startMock.http, { indxPatternVldtResp: JOB_CLONE_INDEX_PATTERN_CHECK }); ({ exists, find, form, actions, table } = setup()); }); afterEach(() => { - npStart.core.http.get.mockClear(); - npStart.core.http.post.mockClear(); - npStart.core.http.put.mockClear(); + startMock.http.get.mockClear(); + startMock.http.post.mockClear(); + startMock.http.put.mockClear(); }); it('should have fields correctly pre-populated', async () => { diff --git a/x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_date_histogram.test.js b/x-pack/plugins/rollup/public/test/client_integration/job_create_date_histogram.test.js similarity index 88% rename from x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_date_histogram.test.js rename to x-pack/plugins/rollup/public/test/client_integration/job_create_date_histogram.test.js index b8ec7d9f85d009..095609ac2b2d77 100644 --- a/x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_date_histogram.test.js +++ b/x-pack/plugins/rollup/public/test/client_integration/job_create_date_histogram.test.js @@ -6,10 +6,9 @@ import moment from 'moment-timezone'; -import { setHttp } from '../../public/crud_app/services'; +import { setHttp } from '../../crud_app/services'; import { mockHttpRequest, pageHelpers } from './helpers'; - -jest.mock('ui/new_platform'); +import { coreMock } from '../../../../../../src/core/public/mocks'; jest.mock('lodash/function/debounce', () => fn => fn); @@ -22,23 +21,23 @@ describe('Create Rollup Job, step 2: Date histogram', () => { let goToStep; let form; let getEuiStepsHorizontalActive; - let npStart; + let startMock; beforeAll(() => { - npStart = require('ui/new_platform').npStart; // eslint-disable-line - setHttp(npStart.core.http); + startMock = coreMock.createStart(); + setHttp(startMock.http); }); beforeEach(() => { // Set "default" mock responses by not providing any arguments - mockHttpRequest(npStart.core.http); + mockHttpRequest(startMock.http); ({ find, exists, actions, form, getEuiStepsHorizontalActive, goToStep } = setup()); }); afterEach(() => { - npStart.core.http.get.mockClear(); - npStart.core.http.post.mockClear(); - npStart.core.http.put.mockClear(); + startMock.http.get.mockClear(); + startMock.http.post.mockClear(); + startMock.http.put.mockClear(); }); describe('layout', () => { @@ -73,7 +72,7 @@ describe('Create Rollup Job, step 2: Date histogram', () => { describe('Date field select', () => { it('should set the options value from the index pattern', async () => { const dateFields = ['field1', 'field2', 'field3']; - mockHttpRequest(npStart.core.http, { indxPatternVldtResp: { dateFields } }); + mockHttpRequest(startMock.http, { indxPatternVldtResp: { dateFields } }); await goToStep(2); @@ -85,7 +84,7 @@ describe('Create Rollup Job, step 2: Date histogram', () => { it('should sort the options in ascending order', async () => { const dateFields = ['field3', 'field2', 'field1']; - mockHttpRequest(npStart.core.http, { indxPatternVldtResp: { dateFields } }); + mockHttpRequest(startMock.http, { indxPatternVldtResp: { dateFields } }); await goToStep(2); diff --git a/x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_histogram.test.js b/x-pack/plugins/rollup/public/test/client_integration/job_create_histogram.test.js similarity index 91% rename from x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_histogram.test.js rename to x-pack/plugins/rollup/public/test/client_integration/job_create_histogram.test.js index c4b5d753f1a262..141aa068435567 100644 --- a/x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_histogram.test.js +++ b/x-pack/plugins/rollup/public/test/client_integration/job_create_histogram.test.js @@ -4,10 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { setHttp } from '../../public/crud_app/services'; +import { setHttp } from '../../crud_app/services'; import { mockHttpRequest, pageHelpers } from './helpers'; - -jest.mock('ui/new_platform'); +import { coreMock } from '../../../../../../src/core/public/mocks'; jest.mock('lodash/function/debounce', () => fn => fn); @@ -21,24 +20,24 @@ describe('Create Rollup Job, step 4: Histogram', () => { let goToStep; let table; let form; - let npStart; + let startMock; beforeAll(() => { - npStart = require('ui/new_platform').npStart; // eslint-disable-line - setHttp(npStart.core.http); + startMock = coreMock.createStart(); + setHttp(startMock.http); }); beforeEach(() => { // Set "default" mock responses by not providing any arguments - mockHttpRequest(npStart.core.http); + mockHttpRequest(startMock.http); ({ find, exists, actions, getEuiStepsHorizontalActive, goToStep, table, form } = setup()); }); afterEach(() => { - npStart.core.http.get.mockClear(); - npStart.core.http.post.mockClear(); - npStart.core.http.put.mockClear(); + startMock.http.get.mockClear(); + startMock.http.post.mockClear(); + startMock.http.put.mockClear(); }); const numericFields = ['a-numericField', 'b-numericField']; @@ -111,7 +110,7 @@ describe('Create Rollup Job, step 4: Histogram', () => { describe('when no histogram fields are availalbe', () => { it('should indicate it to the user', async () => { - mockHttpRequest(npStart.core.http, { indxPatternVldtResp: { numericFields: [] } }); + mockHttpRequest(startMock.http, { indxPatternVldtResp: { numericFields: [] } }); await goToStepAndOpenFieldChooser(); const { tableCellsValues } = table.getMetaData('rollupJobHistogramFieldChooser-table'); @@ -122,7 +121,7 @@ describe('Create Rollup Job, step 4: Histogram', () => { describe('when histogram fields are available', () => { beforeEach(async () => { - mockHttpRequest(npStart.core.http, { indxPatternVldtResp: { numericFields } }); + mockHttpRequest(startMock.http, { indxPatternVldtResp: { numericFields } }); await goToStepAndOpenFieldChooser(); }); @@ -156,7 +155,7 @@ describe('Create Rollup Job, step 4: Histogram', () => { it('should have a delete button on each row to remove an histogram field', async () => { // First let's add a term to the list - mockHttpRequest(npStart.core.http, { indxPatternVldtResp: { numericFields } }); + mockHttpRequest(startMock.http, { indxPatternVldtResp: { numericFields } }); await goToStepAndOpenFieldChooser(); const { rows: fieldChooserRows } = table.getMetaData('rollupJobHistogramFieldChooser-table'); fieldChooserRows[0].reactWrapper.simulate('click'); @@ -183,7 +182,7 @@ describe('Create Rollup Job, step 4: Histogram', () => { }; beforeEach(async () => { - mockHttpRequest(npStart.core.http, { indxPatternVldtResp: { numericFields } }); + mockHttpRequest(startMock.http, { indxPatternVldtResp: { numericFields } }); await goToStep(4); addHistogramFieldToList(); }); diff --git a/x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_logistics.test.js b/x-pack/plugins/rollup/public/test/client_integration/job_create_logistics.test.js similarity index 96% rename from x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_logistics.test.js rename to x-pack/plugins/rollup/public/test/client_integration/job_create_logistics.test.js index ebc03e40cc2b9a..7b89244bb52a9c 100644 --- a/x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_logistics.test.js +++ b/x-pack/plugins/rollup/public/test/client_integration/job_create_logistics.test.js @@ -13,10 +13,9 @@ import { YEAR, } from '../../../../../../src/plugins/es_ui_shared/public'; import { indexPatterns } from '../../../../../../src/plugins/data/public'; -import { setHttp } from '../../public/crud_app/services'; +import { setHttp } from '../../crud_app/services'; import { mockHttpRequest, pageHelpers } from './helpers'; - -jest.mock('ui/new_platform'); +import { coreMock } from '../../../../../../src/core/public/mocks'; jest.mock('lodash/function/debounce', () => fn => fn); @@ -28,24 +27,24 @@ describe('Create Rollup Job, step 1: Logistics', () => { let actions; let form; let getEuiStepsHorizontalActive; - let npStart; + let startMock; beforeAll(() => { - npStart = require('ui/new_platform').npStart; // eslint-disable-line - setHttp(npStart.core.http); + startMock = coreMock.createStart(); + setHttp(startMock.http); }); beforeEach(() => { // Set "default" mock responses by not providing any arguments - mockHttpRequest(npStart.core.http); + mockHttpRequest(startMock.http); ({ find, exists, actions, form, getEuiStepsHorizontalActive } = setup()); }); afterEach(() => { - npStart.core.http.get.mockClear(); - npStart.core.http.post.mockClear(); - npStart.core.http.put.mockClear(); + startMock.http.get.mockClear(); + startMock.http.post.mockClear(); + startMock.http.put.mockClear(); }); it('should have the horizontal step active on "Logistics"', () => { @@ -97,14 +96,14 @@ describe('Create Rollup Job, step 1: Logistics', () => { }); it('should not allow an unknown index pattern', async () => { - mockHttpRequest(npStart.core.http, { indxPatternVldtResp: { doesMatchIndices: false } }); + mockHttpRequest(startMock.http, { indxPatternVldtResp: { doesMatchIndices: false } }); await form.setInputValue('rollupIndexPattern', 'unknown', true); actions.clickNextStep(); expect(form.getErrorsMessages()).toContain("Index pattern doesn't match any indices."); }); it('should not allow an index pattern without time fields', async () => { - mockHttpRequest(npStart.core.http, { indxPatternVldtResp: { dateFields: [] } }); + mockHttpRequest(startMock.http, { indxPatternVldtResp: { dateFields: [] } }); await form.setInputValue('rollupIndexPattern', 'abc', true); actions.clickNextStep(); expect(form.getErrorsMessages()).toContain( @@ -113,7 +112,7 @@ describe('Create Rollup Job, step 1: Logistics', () => { }); it('should not allow an index pattern that matches a rollup index', async () => { - mockHttpRequest(npStart.core.http, { + mockHttpRequest(startMock.http, { indxPatternVldtResp: { doesMatchRollupIndices: true }, }); await form.setInputValue('rollupIndexPattern', 'abc', true); diff --git a/x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_metrics.test.js b/x-pack/plugins/rollup/public/test/client_integration/job_create_metrics.test.js similarity index 95% rename from x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_metrics.test.js rename to x-pack/plugins/rollup/public/test/client_integration/job_create_metrics.test.js index a72dc8b25c0839..1e9dd88648da65 100644 --- a/x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_metrics.test.js +++ b/x-pack/plugins/rollup/public/test/client_integration/job_create_metrics.test.js @@ -4,10 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { setHttp } from '../../public/crud_app/services'; +import { setHttp } from '../../crud_app/services'; import { mockHttpRequest, pageHelpers } from './helpers'; - -jest.mock('ui/new_platform'); +import { coreMock } from '../../../../../../src/core/public/mocks'; jest.mock('lodash/function/debounce', () => fn => fn); @@ -21,24 +20,24 @@ describe('Create Rollup Job, step 5: Metrics', () => { let goToStep; let table; let metrics; - let npStart; + let startMock; beforeAll(() => { - npStart = require('ui/new_platform').npStart; // eslint-disable-line - setHttp(npStart.core.http); + startMock = coreMock.createStart(); + setHttp(startMock.http); }); beforeEach(() => { // Set "default" mock responses by not providing any arguments - mockHttpRequest(npStart.core.http); + mockHttpRequest(startMock.http); ({ find, exists, actions, getEuiStepsHorizontalActive, goToStep, table, metrics } = setup()); }); afterEach(() => { - npStart.core.http.get.mockClear(); - npStart.core.http.post.mockClear(); - npStart.core.http.put.mockClear(); + startMock.http.get.mockClear(); + startMock.http.post.mockClear(); + startMock.http.put.mockClear(); }); const numericFields = ['a-numericField', 'c-numericField']; @@ -112,7 +111,7 @@ describe('Create Rollup Job, step 5: Metrics', () => { describe('table', () => { beforeEach(async () => { - mockHttpRequest(npStart.core.http, { indxPatternVldtResp: { numericFields, dateFields } }); + mockHttpRequest(startMock.http, { indxPatternVldtResp: { numericFields, dateFields } }); await goToStepAndOpenFieldChooser(); }); @@ -169,7 +168,7 @@ describe('Create Rollup Job, step 5: Metrics', () => { describe('when fields are added', () => { beforeEach(async () => { - mockHttpRequest(npStart.core.http, { indxPatternVldtResp: { numericFields, dateFields } }); + mockHttpRequest(startMock.http, { indxPatternVldtResp: { numericFields, dateFields } }); await goToStepAndOpenFieldChooser(); }); @@ -260,7 +259,7 @@ describe('Create Rollup Job, step 5: Metrics', () => { let getFieldListTableRows; beforeEach(async () => { - mockHttpRequest(npStart.core.http, { indxPatternVldtResp: { numericFields, dateFields } }); + mockHttpRequest(startMock.http, { indxPatternVldtResp: { numericFields, dateFields } }); await goToStep(5); await addFieldToList('numeric'); diff --git a/x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_review.test.js b/x-pack/plugins/rollup/public/test/client_integration/job_create_review.test.js similarity index 71% rename from x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_review.test.js rename to x-pack/plugins/rollup/public/test/client_integration/job_create_review.test.js index 0fa9509368d3f7..d625b8f11208f7 100644 --- a/x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_review.test.js +++ b/x-pack/plugins/rollup/public/test/client_integration/job_create_review.test.js @@ -6,13 +6,20 @@ import { pageHelpers, mockHttpRequest } from './helpers'; import { first } from 'lodash'; -import { setHttp } from '../../public/crud_app/services'; +import { setHttp } from '../../crud_app/services'; import { JOBS } from './helpers/constants'; - -jest.mock('ui/new_platform'); +import { coreMock } from '../../../../../../src/core/public/mocks'; jest.mock('lodash/function/debounce', () => fn => fn); +jest.mock('../../kibana_services', () => { + const services = require.requireActual('../../kibana_services'); + return { + ...services, + getUiStatsReporter: jest.fn(() => () => {}), + }; +}); + const { setup } = pageHelpers.jobCreate; describe('Create Rollup Job, step 6: Review', () => { @@ -23,23 +30,23 @@ describe('Create Rollup Job, step 6: Review', () => { let goToStep; let table; let form; - let npStart; + let startMock; beforeAll(() => { - npStart = require('ui/new_platform').npStart; // eslint-disable-line - setHttp(npStart.core.http); + startMock = coreMock.createStart(); + setHttp(startMock.http); }); beforeEach(() => { // Set "default" mock responses by not providing any arguments - mockHttpRequest(npStart.core.http); + mockHttpRequest(startMock.http); ({ find, exists, actions, getEuiStepsHorizontalActive, goToStep, table, form } = setup()); }); afterEach(() => { - npStart.core.http.get.mockClear(); - npStart.core.http.post.mockClear(); - npStart.core.http.put.mockClear(); + startMock.http.get.mockClear(); + startMock.http.post.mockClear(); + startMock.http.put.mockClear(); }); describe('layout', () => { @@ -84,7 +91,7 @@ describe('Create Rollup Job, step 6: Review', () => { }); it('should have a "Summary", "Terms" & "Request" tab if a term aggregation was added', async () => { - mockHttpRequest(npStart.core.http, { indxPatternVldtResp: { numericFields: ['my-field'] } }); + mockHttpRequest(startMock.http, { indxPatternVldtResp: { numericFields: ['my-field'] } }); await goToStep(3); selectFirstField('Terms'); @@ -96,7 +103,7 @@ describe('Create Rollup Job, step 6: Review', () => { }); it('should have a "Summary", "Histogram" & "Request" tab if a histogram field was added', async () => { - mockHttpRequest(npStart.core.http, { indxPatternVldtResp: { numericFields: ['a-field'] } }); + mockHttpRequest(startMock.http, { indxPatternVldtResp: { numericFields: ['a-field'] } }); await goToStep(4); selectFirstField('Histogram'); form.setInputValue('rollupJobCreateHistogramInterval', 3); // set an interval @@ -108,7 +115,7 @@ describe('Create Rollup Job, step 6: Review', () => { }); it('should have a "Summary", "Metrics" & "Request" tab if a histogram field was added', async () => { - mockHttpRequest(npStart.core.http, { + mockHttpRequest(startMock.http, { indxPatternVldtResp: { numericFields: ['a-field'], dateFields: ['b-field'], @@ -130,28 +137,28 @@ describe('Create Rollup Job, step 6: Review', () => { describe('without starting job after creation', () => { it('should call the "create" Api server endpoint', async () => { - mockHttpRequest(npStart.core.http, { + mockHttpRequest(startMock.http, { createdJob: first(JOBS.jobs), }); await goToStep(6); - expect(npStart.core.http.put).not.toHaveBeenCalledWith(jobCreateApiPath); // make sure it hasn't been called - expect(npStart.core.http.get).not.toHaveBeenCalledWith(jobStartApiPath); // make sure it hasn't been called + expect(startMock.http.put).not.toHaveBeenCalledWith(jobCreateApiPath); // make sure it hasn't been called + expect(startMock.http.get).not.toHaveBeenCalledWith(jobStartApiPath); // make sure it hasn't been called actions.clickSave(); - // Given the following anti-jitter sleep x-pack/legacy/plugins/rollup/public/crud_app/store/actions/create_job.js + // Given the following anti-jitter sleep x-pack/plugins/rollup/public/crud_app/store/actions/create_job.js // we add a longer sleep here :( await new Promise(res => setTimeout(res, 750)); - expect(npStart.core.http.put).toHaveBeenCalledWith(jobCreateApiPath, expect.anything()); // It has been called! - expect(npStart.core.http.get).not.toHaveBeenCalledWith(jobStartApiPath); // It has still not been called! + expect(startMock.http.put).toHaveBeenCalledWith(jobCreateApiPath, expect.anything()); // It has been called! + expect(startMock.http.get).not.toHaveBeenCalledWith(jobStartApiPath); // It has still not been called! }); }); describe('with starting job after creation', () => { it('should call the "create" and "start" Api server endpoints', async () => { - mockHttpRequest(npStart.core.http, { + mockHttpRequest(startMock.http, { createdJob: first(JOBS.jobs), }); @@ -161,14 +168,14 @@ describe('Create Rollup Job, step 6: Review', () => { target: { checked: true }, }); - expect(npStart.core.http.post).not.toHaveBeenCalledWith(jobStartApiPath); // make sure it hasn't been called + expect(startMock.http.post).not.toHaveBeenCalledWith(jobStartApiPath); // make sure it hasn't been called actions.clickSave(); - // Given the following anti-jitter sleep x-pack/legacy/plugins/rollup/public/crud_app/store/actions/create_job.js + // Given the following anti-jitter sleep x-pack/plugins/rollup/public/crud_app/store/actions/create_job.js // we add a longer sleep here :( await new Promise(res => setTimeout(res, 750)); - expect(npStart.core.http.post).toHaveBeenCalledWith(jobStartApiPath, expect.anything()); // It has been called! + expect(startMock.http.post).toHaveBeenCalledWith(jobStartApiPath, expect.anything()); // It has been called! }); }); }); diff --git a/x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_terms.test.js b/x-pack/plugins/rollup/public/test/client_integration/job_create_terms.test.js similarity index 93% rename from x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_terms.test.js rename to x-pack/plugins/rollup/public/test/client_integration/job_create_terms.test.js index f111a7df2c2501..61993f30928400 100644 --- a/x-pack/legacy/plugins/rollup/__jest__/client_integration/job_create_terms.test.js +++ b/x-pack/plugins/rollup/public/test/client_integration/job_create_terms.test.js @@ -4,10 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { setHttp } from '../../public/crud_app/services'; +import { setHttp } from '../../crud_app/services'; import { pageHelpers, mockHttpRequest } from './helpers'; - -jest.mock('ui/new_platform'); +import { coreMock } from '../../../../../../src/core/public/mocks'; jest.mock('lodash/function/debounce', () => fn => fn); @@ -20,22 +19,22 @@ describe('Create Rollup Job, step 3: Terms', () => { let getEuiStepsHorizontalActive; let goToStep; let table; - let npStart; + let startMock; beforeAll(() => { - npStart = require('ui/new_platform').npStart; // eslint-disable-line - setHttp(npStart.core.http); + startMock = coreMock.createStart(); + setHttp(startMock.http); }); beforeEach(() => { // Set "default" mock responses by not providing any arguments - mockHttpRequest(npStart.core.http); + mockHttpRequest(startMock.http); ({ find, exists, actions, getEuiStepsHorizontalActive, goToStep, table } = setup()); }); afterEach(() => { - npStart.core.http.get.mockClear(); + startMock.http.get.mockClear(); }); const numericFields = ['a-numericField', 'c-numericField']; @@ -109,7 +108,7 @@ describe('Create Rollup Job, step 3: Terms', () => { describe('when no terms are available', () => { it('should indicate it to the user', async () => { - mockHttpRequest(npStart.core.http, { + mockHttpRequest(startMock.http, { indxPatternVldtResp: { numericFields: [], keywordFields: [], @@ -125,7 +124,7 @@ describe('Create Rollup Job, step 3: Terms', () => { describe('when terms are available', () => { beforeEach(async () => { - mockHttpRequest(npStart.core.http, { + mockHttpRequest(startMock.http, { indxPatternVldtResp: { numericFields, keywordFields, @@ -171,7 +170,7 @@ describe('Create Rollup Job, step 3: Terms', () => { it('should have a delete button on each row to remove a term', async () => { // First let's add a term to the list - mockHttpRequest(npStart.core.http, { + mockHttpRequest(startMock.http, { indxPatternVldtResp: { numericFields, keywordFields, diff --git a/x-pack/legacy/plugins/rollup/__jest__/client_integration/job_list.test.js b/x-pack/plugins/rollup/public/test/client_integration/job_list.test.js similarity index 77% rename from x-pack/legacy/plugins/rollup/__jest__/client_integration/job_list.test.js rename to x-pack/plugins/rollup/public/test/client_integration/job_list.test.js index a9e474cf0b5598..c6988236d6b7c9 100644 --- a/x-pack/legacy/plugins/rollup/__jest__/client_integration/job_list.test.js +++ b/x-pack/plugins/rollup/public/test/client_integration/job_list.test.js @@ -4,20 +4,27 @@ * you may not use this file except in compliance with the Elastic License. */ -import { getRouter, setHttp } from '../../public/crud_app/services'; +import { getRouter, setHttp } from '../../crud_app/services'; import { mockHttpRequest, pageHelpers, nextTick } from './helpers'; import { JOBS } from './helpers/constants'; +import { coreMock } from '../../../../../../src/core/public/mocks'; -jest.mock('ui/new_platform'); - -jest.mock('../../public/crud_app/services', () => { - const services = require.requireActual('../../public/crud_app/services'); +jest.mock('../../crud_app/services', () => { + const services = require.requireActual('../../crud_app/services'); return { ...services, getRouterLinkProps: link => ({ href: link }), }; }); +jest.mock('../../kibana_services', () => { + const services = require.requireActual('../../kibana_services'); + return { + ...services, + getUiStatsReporter: jest.fn(() => () => {}), + }; +}); + const { setup } = pageHelpers.jobList; describe('', () => { @@ -25,15 +32,15 @@ describe('', () => { let component; let table; let exists; - let npStart; + let startMock; beforeAll(() => { - npStart = require('ui/new_platform').npStart; // eslint-disable-line - setHttp(npStart.core.http); + startMock = coreMock.createStart(); + setHttp(startMock.http); }); beforeEach(async () => { - mockHttpRequest(npStart.core.http, { jobs: JOBS }); + mockHttpRequest(startMock.http, { jobs: JOBS }); ({ component, exists, table } = setup()); @@ -42,7 +49,7 @@ describe('', () => { }); afterEach(() => { - npStart.core.http.get.mockClear(); + startMock.http.get.mockClear(); }); test('should open the detail panel when clicking on a job in the table', () => { diff --git a/x-pack/legacy/plugins/rollup/__jest__/client_integration/job_list_clone.test.js b/x-pack/plugins/rollup/public/test/client_integration/job_list_clone.test.js similarity index 74% rename from x-pack/legacy/plugins/rollup/__jest__/client_integration/job_list_clone.test.js rename to x-pack/plugins/rollup/public/test/client_integration/job_list_clone.test.js index 8a36af83def4c8..bdf57a555cdad6 100644 --- a/x-pack/legacy/plugins/rollup/__jest__/client_integration/job_list_clone.test.js +++ b/x-pack/plugins/rollup/public/test/client_integration/job_list_clone.test.js @@ -6,14 +6,21 @@ import { mockHttpRequest, pageHelpers, nextTick } from './helpers'; import { JOB_TO_CLONE, JOB_CLONE_INDEX_PATTERN_CHECK } from './helpers/constants'; -import { getRouter } from '../../public/crud_app/services/routing'; -import { setHttp } from '../../public/crud_app/services'; -import { CRUD_APP_BASE_PATH } from '../../public/crud_app/constants'; - -jest.mock('ui/new_platform'); +import { getRouter } from '../../crud_app/services/routing'; +import { setHttp } from '../../crud_app/services'; +import { CRUD_APP_BASE_PATH } from '../../crud_app/constants'; +import { coreMock } from '../../../../../../src/core/public/mocks'; jest.mock('lodash/function/debounce', () => fn => fn); +jest.mock('../../kibana_services', () => { + const services = require.requireActual('../../kibana_services'); + return { + ...services, + getUiStatsReporter: jest.fn(() => () => {}), + }; +}); + const { setup } = pageHelpers.jobList; describe('Smoke test cloning an existing rollup job from job list', () => { @@ -21,15 +28,15 @@ describe('Smoke test cloning an existing rollup job from job list', () => { let find; let component; let exists; - let npStart; + let startMock; beforeAll(() => { - npStart = require('ui/new_platform').npStart; // eslint-disable-line - setHttp(npStart.core.http); + startMock = coreMock.createStart(); + setHttp(startMock.http); }); beforeEach(async () => { - mockHttpRequest(npStart.core.http, { + mockHttpRequest(startMock.http, { jobs: JOB_TO_CLONE, indxPatternVldtResp: JOB_CLONE_INDEX_PATTERN_CHECK, }); @@ -41,7 +48,7 @@ describe('Smoke test cloning an existing rollup job from job list', () => { }); afterEach(() => { - npStart.core.http.get.mockClear(); + startMock.http.get.mockClear(); }); it('should navigate to create view with default values set', async () => { diff --git a/x-pack/legacy/plugins/rollup/public/visualize/agg_type_field_filter.js b/x-pack/plugins/rollup/public/visualize/agg_type_field_filter.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/visualize/agg_type_field_filter.js rename to x-pack/plugins/rollup/public/visualize/agg_type_field_filter.js diff --git a/x-pack/legacy/plugins/rollup/public/visualize/agg_type_filter.js b/x-pack/plugins/rollup/public/visualize/agg_type_filter.js similarity index 100% rename from x-pack/legacy/plugins/rollup/public/visualize/agg_type_filter.js rename to x-pack/plugins/rollup/public/visualize/agg_type_filter.js diff --git a/x-pack/plugins/rollup/server/plugin.ts b/x-pack/plugins/rollup/server/plugin.ts index fa05b8d1307d61..ea6d197e22029d 100644 --- a/x-pack/plugins/rollup/server/plugin.ts +++ b/x-pack/plugins/rollup/server/plugin.ts @@ -4,7 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Plugin, PluginInitializerContext } from 'src/core/server'; +import { CoreSetup, Plugin, PluginInitializerContext } from 'src/core/server'; +import { i18n } from '@kbn/i18n'; +import { schema } from '@kbn/config-schema'; +import { CONFIG_ROLLUPS } from '../common'; export class RollupPlugin implements Plugin { private readonly initContext: PluginInitializerContext; @@ -13,7 +16,23 @@ export class RollupPlugin implements Plugin { this.initContext = initContext; } - public setup() { + public setup(core: CoreSetup) { + core.uiSettings.register({ + [CONFIG_ROLLUPS]: { + name: i18n.translate('xpack.rollupJobs.rollupIndexPatternsTitle', { + defaultMessage: 'Enable rollup index patterns', + }), + value: true, + description: i18n.translate('xpack.rollupJobs.rollupIndexPatternsDescription', { + defaultMessage: `Enable the creation of index patterns which capture rollup indices, + which in turn enable visualizations based on rollup data. Refresh + the page to apply the changes.`, + }), + category: ['rollups'], + schema: schema.boolean(), + }, + }); + return { __legacy: { config: this.initContext.config, diff --git a/x-pack/plugins/siem/.gitattributes b/x-pack/plugins/siem/.gitattributes new file mode 100644 index 00000000000000..96ab5dadbda10d --- /dev/null +++ b/x-pack/plugins/siem/.gitattributes @@ -0,0 +1,4 @@ +# Auto-collapse generated files in GitHub +# https://help.github.com/en/articles/customizing-how-changed-files-appear-on-github +x-pack/plugins/siem/server/graphql/types.ts linguist-generated=true + diff --git a/x-pack/legacy/plugins/siem/common/constants.ts b/x-pack/plugins/siem/common/constants.ts similarity index 95% rename from x-pack/legacy/plugins/siem/common/constants.ts rename to x-pack/plugins/siem/common/constants.ts index e0acc7ecfe0363..edde5c6b8fa0d0 100644 --- a/x-pack/legacy/plugins/siem/common/constants.ts +++ b/x-pack/plugins/siem/common/constants.ts @@ -29,6 +29,16 @@ export const DEFAULT_INTERVAL_TYPE = 'manual'; export const DEFAULT_INTERVAL_VALUE = 300000; // ms export const DEFAULT_TIMEPICKER_QUICK_RANGES = 'timepicker:quickRanges'; +/** The comma-delimited list of Elasticsearch indices from which the SIEM app collects events */ +export const DEFAULT_INDEX_PATTERN = [ + 'apm-*-transaction*', + 'auditbeat-*', + 'endgame-*', + 'filebeat-*', + 'packetbeat-*', + 'winlogbeat-*', +]; + /** This Kibana Advanced Setting enables the `Security news` feed widget */ export const ENABLE_NEWS_FEED_SETTING = 'siem:enableNewsFeed'; diff --git a/x-pack/legacy/plugins/siem/default_index_pattern.ts b/x-pack/plugins/siem/common/default_index_pattern.ts similarity index 100% rename from x-pack/legacy/plugins/siem/default_index_pattern.ts rename to x-pack/plugins/siem/common/default_index_pattern.ts diff --git a/x-pack/legacy/plugins/siem/common/detection_engine/ml_helpers.test.ts b/x-pack/plugins/siem/common/detection_engine/ml_helpers.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/common/detection_engine/ml_helpers.test.ts rename to x-pack/plugins/siem/common/detection_engine/ml_helpers.test.ts diff --git a/x-pack/legacy/plugins/siem/common/detection_engine/ml_helpers.ts b/x-pack/plugins/siem/common/detection_engine/ml_helpers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/common/detection_engine/ml_helpers.ts rename to x-pack/plugins/siem/common/detection_engine/ml_helpers.ts diff --git a/x-pack/legacy/plugins/siem/common/detection_engine/transform_actions.test.ts b/x-pack/plugins/siem/common/detection_engine/transform_actions.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/common/detection_engine/transform_actions.test.ts rename to x-pack/plugins/siem/common/detection_engine/transform_actions.test.ts diff --git a/x-pack/legacy/plugins/siem/common/detection_engine/transform_actions.ts b/x-pack/plugins/siem/common/detection_engine/transform_actions.ts similarity index 90% rename from x-pack/legacy/plugins/siem/common/detection_engine/transform_actions.ts rename to x-pack/plugins/siem/common/detection_engine/transform_actions.ts index aeb4d53933022c..4ce38235758336 100644 --- a/x-pack/legacy/plugins/siem/common/detection_engine/transform_actions.ts +++ b/x-pack/plugins/siem/common/detection_engine/transform_actions.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AlertAction } from '../../../../../plugins/alerting/common'; +import { AlertAction } from '../../../alerting/common'; import { RuleAlertAction } from './types'; export const transformRuleToAlertAction = ({ diff --git a/x-pack/legacy/plugins/siem/common/detection_engine/types.ts b/x-pack/plugins/siem/common/detection_engine/types.ts similarity index 88% rename from x-pack/legacy/plugins/siem/common/detection_engine/types.ts rename to x-pack/plugins/siem/common/detection_engine/types.ts index 39012d0b4b6834..5a91cfd4809c6b 100644 --- a/x-pack/legacy/plugins/siem/common/detection_engine/types.ts +++ b/x-pack/plugins/siem/common/detection_engine/types.ts @@ -5,7 +5,7 @@ */ import * as t from 'io-ts'; -import { AlertAction } from '../../../../../plugins/alerting/common'; +import { AlertAction } from '../../../alerting/common'; export type RuleAlertAction = Omit & { action_type_id: string; diff --git a/x-pack/legacy/plugins/siem/common/graphql/root/index.ts b/x-pack/plugins/siem/common/graphql/root/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/common/graphql/root/index.ts rename to x-pack/plugins/siem/common/graphql/root/index.ts diff --git a/x-pack/legacy/plugins/siem/common/graphql/root/schema.gql.ts b/x-pack/plugins/siem/common/graphql/root/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/common/graphql/root/schema.gql.ts rename to x-pack/plugins/siem/common/graphql/root/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/common/graphql/shared/index.ts b/x-pack/plugins/siem/common/graphql/shared/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/common/graphql/shared/index.ts rename to x-pack/plugins/siem/common/graphql/shared/index.ts diff --git a/x-pack/legacy/plugins/siem/common/graphql/shared/schema.gql.ts b/x-pack/plugins/siem/common/graphql/shared/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/common/graphql/shared/schema.gql.ts rename to x-pack/plugins/siem/common/graphql/shared/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/common/typed_json.ts b/x-pack/plugins/siem/common/typed_json.ts similarity index 91% rename from x-pack/legacy/plugins/siem/common/typed_json.ts rename to x-pack/plugins/siem/common/typed_json.ts index dcd26d176d7468..62e7319e091cb7 100644 --- a/x-pack/legacy/plugins/siem/common/typed_json.ts +++ b/x-pack/plugins/siem/common/typed_json.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 { JsonObject } from '../../../../../src/plugins/kibana_utils/public'; +import { JsonObject } from '../../../../src/plugins/kibana_utils/public'; export type ESQuery = ESRangeQuery | ESQueryStringQuery | ESMatchQuery | ESTermQuery | JsonObject; diff --git a/x-pack/legacy/plugins/siem/common/utility_types.ts b/x-pack/plugins/siem/common/utility_types.ts similarity index 100% rename from x-pack/legacy/plugins/siem/common/utility_types.ts rename to x-pack/plugins/siem/common/utility_types.ts diff --git a/x-pack/legacy/plugins/siem/cypress/.eslintrc.json b/x-pack/plugins/siem/cypress/.eslintrc.json similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/.eslintrc.json rename to x-pack/plugins/siem/cypress/.eslintrc.json diff --git a/x-pack/legacy/plugins/siem/cypress/.gitignore b/x-pack/plugins/siem/cypress/.gitignore similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/.gitignore rename to x-pack/plugins/siem/cypress/.gitignore diff --git a/x-pack/legacy/plugins/siem/cypress/README.md b/x-pack/plugins/siem/cypress/README.md similarity index 93% rename from x-pack/legacy/plugins/siem/cypress/README.md rename to x-pack/plugins/siem/cypress/README.md index 89bafce9c9dc86..d84c66fec1c3a6 100644 --- a/x-pack/legacy/plugins/siem/cypress/README.md +++ b/x-pack/plugins/siem/cypress/README.md @@ -124,7 +124,7 @@ yarn kbn bootstrap 2. Launch Cypress command line test runner: ```sh -cd x-pack/legacy/plugins/siem +cd x-pack/plugins/siem yarn cypress:run-as-ci ``` @@ -193,15 +193,15 @@ We are using es_archiver in order to manage the data that our Cypress tests need 1. Setup if possible a clean instance of kibana and elasticsearch (if not, possible please try to clean the data that you are going to generate). 2. With the kibana and elasticsearch instance up and running, create the data that you need for your test. -3. When you are sure that you have all the data you need run the following command from: `x-pack/legacy/plugins/siem` +3. When you are sure that you have all the data you need run the following command from: `x-pack/plugins/siem` ```sh -node ../../../../scripts/es_archiver save --dir ../../../test/siem_cypress/es_archives --config ../../../../test/functional/config.js --es-url http://:@: +node ../../../scripts/es_archiver save --dir ../../test/siem_cypress/es_archives --config ../../../test/functional/config.js --es-url http://:@: ``` Example: ```sh -node ../../../../scripts/es_archiver save custom_rules ".kibana",".siem-signal*" --dir ../../../test/siem_cypress/es_archives --config ../../../../test/functional/config.js --es-url http://elastic:changeme@localhost:9220 +node ../../../scripts/es_archiver save custom_rules ".kibana",".siem-signal*" --dir ../../test/siem_cypress/es_archives --config ../../../test/functional/config.js --es-url http://elastic:changeme@localhost:9220 ``` Note that the command is going to create the folder if does not exist in the directory with the imported data. @@ -236,7 +236,7 @@ yarn start --no-base-path `baseUrl`, as configured in `plugins/siem/cypress.json`: ```sh -cd x-pack/legacy/plugins/siem +cd x-pack/plugins/siem yarn cypress:open ``` @@ -245,7 +245,7 @@ yarn cypress:open test runner, as shown in the following example: ```sh -cd x-pack/legacy/plugins/siem +cd x-pack/plugins/siem CYPRESS_baseUrl=http://localhost:5601 yarn cypress:open ``` @@ -253,7 +253,7 @@ CYPRESS_baseUrl=http://localhost:5601 yarn cypress:open running tests interactively: ```sh -cd x-pack/legacy/plugins/siem +cd x-pack/plugins/siem CYPRESS_baseUrl=http://localhost:5601 CYPRESS_ELASTICSEARCH_USERNAME=elastic CYPRESS_ELASTICSEARCH_PASSWORD= yarn cypress:open ``` @@ -285,7 +285,7 @@ yarn start --no-base-path `baseUrl`, as configured in `plugins/siem/cypress.json`: ```sh -cd x-pack/legacy/plugins/siem +cd x-pack/plugins/siem yarn cypress:run ``` @@ -294,7 +294,7 @@ yarn cypress:run the following example: ```sh -cd x-pack/legacy/plugins/siem +cd x-pack/plugins/siem CYPRESS_baseUrl=http://localhost:5601 yarn cypress:run ``` @@ -302,7 +302,7 @@ CYPRESS_baseUrl=http://localhost:5601 yarn cypress:run running via the command line: ```sh -cd x-pack/legacy/plugins/siem +cd x-pack/plugins/siem CYPRESS_baseUrl=http://localhost:5601 CYPRESS_ELASTICSEARCH_USERNAME=elastic CYPRESS_ELASTICSEARCH_PASSWORD= yarn cypress:run ``` diff --git a/x-pack/plugins/siem/cypress/cypress.json b/x-pack/plugins/siem/cypress/cypress.json new file mode 100644 index 00000000000000..7a4efba8c2d643 --- /dev/null +++ b/x-pack/plugins/siem/cypress/cypress.json @@ -0,0 +1,8 @@ +{ + "baseUrl": "http://localhost:5601", + "defaultCommandTimeout": 120000, + "screenshotsFolder": "../../../target/kibana-siem/cypress/screenshots", + "trashAssetsBeforeRuns": false, + "video": false, + "videosFolder": "../../../target/kibana-siem/cypress/videos" +} diff --git a/x-pack/legacy/plugins/siem/cypress/fixtures/overview.json b/x-pack/plugins/siem/cypress/fixtures/overview.json similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/fixtures/overview.json rename to x-pack/plugins/siem/cypress/fixtures/overview.json diff --git a/x-pack/legacy/plugins/siem/cypress/integration/detections.spec.ts b/x-pack/plugins/siem/cypress/integration/detections.spec.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/integration/detections.spec.ts rename to x-pack/plugins/siem/cypress/integration/detections.spec.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/detections_timeline.spec.ts b/x-pack/plugins/siem/cypress/integration/detections_timeline.spec.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/integration/detections_timeline.spec.ts rename to x-pack/plugins/siem/cypress/integration/detections_timeline.spec.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/events_viewer.spec.ts b/x-pack/plugins/siem/cypress/integration/events_viewer.spec.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/integration/events_viewer.spec.ts rename to x-pack/plugins/siem/cypress/integration/events_viewer.spec.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/fields_browser.spec.ts b/x-pack/plugins/siem/cypress/integration/fields_browser.spec.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/integration/fields_browser.spec.ts rename to x-pack/plugins/siem/cypress/integration/fields_browser.spec.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/inspect.spec.ts b/x-pack/plugins/siem/cypress/integration/inspect.spec.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/integration/inspect.spec.ts rename to x-pack/plugins/siem/cypress/integration/inspect.spec.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/ml_conditional_links.spec.ts b/x-pack/plugins/siem/cypress/integration/ml_conditional_links.spec.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/integration/ml_conditional_links.spec.ts rename to x-pack/plugins/siem/cypress/integration/ml_conditional_links.spec.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/navigation.spec.ts b/x-pack/plugins/siem/cypress/integration/navigation.spec.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/integration/navigation.spec.ts rename to x-pack/plugins/siem/cypress/integration/navigation.spec.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/overview.spec.ts b/x-pack/plugins/siem/cypress/integration/overview.spec.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/integration/overview.spec.ts rename to x-pack/plugins/siem/cypress/integration/overview.spec.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/pagination.spec.ts b/x-pack/plugins/siem/cypress/integration/pagination.spec.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/integration/pagination.spec.ts rename to x-pack/plugins/siem/cypress/integration/pagination.spec.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules.spec.ts b/x-pack/plugins/siem/cypress/integration/signal_detection_rules.spec.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules.spec.ts rename to x-pack/plugins/siem/cypress/integration/signal_detection_rules.spec.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules_custom.spec.ts b/x-pack/plugins/siem/cypress/integration/signal_detection_rules_custom.spec.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules_custom.spec.ts rename to x-pack/plugins/siem/cypress/integration/signal_detection_rules_custom.spec.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules_ml.spec.ts b/x-pack/plugins/siem/cypress/integration/signal_detection_rules_ml.spec.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules_ml.spec.ts rename to x-pack/plugins/siem/cypress/integration/signal_detection_rules_ml.spec.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules_prebuilt.spec.ts b/x-pack/plugins/siem/cypress/integration/signal_detection_rules_prebuilt.spec.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/integration/signal_detection_rules_prebuilt.spec.ts rename to x-pack/plugins/siem/cypress/integration/signal_detection_rules_prebuilt.spec.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/timeline_data_providers.spec.ts b/x-pack/plugins/siem/cypress/integration/timeline_data_providers.spec.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/integration/timeline_data_providers.spec.ts rename to x-pack/plugins/siem/cypress/integration/timeline_data_providers.spec.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/timeline_flyout_button.spec.ts b/x-pack/plugins/siem/cypress/integration/timeline_flyout_button.spec.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/integration/timeline_flyout_button.spec.ts rename to x-pack/plugins/siem/cypress/integration/timeline_flyout_button.spec.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/timeline_search_or_filter.spec.ts b/x-pack/plugins/siem/cypress/integration/timeline_search_or_filter.spec.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/integration/timeline_search_or_filter.spec.ts rename to x-pack/plugins/siem/cypress/integration/timeline_search_or_filter.spec.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/timeline_toggle_column.spec.ts b/x-pack/plugins/siem/cypress/integration/timeline_toggle_column.spec.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/integration/timeline_toggle_column.spec.ts rename to x-pack/plugins/siem/cypress/integration/timeline_toggle_column.spec.ts diff --git a/x-pack/legacy/plugins/siem/cypress/integration/url_state.spec.ts b/x-pack/plugins/siem/cypress/integration/url_state.spec.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/integration/url_state.spec.ts rename to x-pack/plugins/siem/cypress/integration/url_state.spec.ts diff --git a/x-pack/legacy/plugins/siem/cypress/objects/rule.ts b/x-pack/plugins/siem/cypress/objects/rule.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/objects/rule.ts rename to x-pack/plugins/siem/cypress/objects/rule.ts diff --git a/x-pack/legacy/plugins/siem/cypress/objects/timeline.ts b/x-pack/plugins/siem/cypress/objects/timeline.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/objects/timeline.ts rename to x-pack/plugins/siem/cypress/objects/timeline.ts diff --git a/x-pack/legacy/plugins/siem/cypress/plugins/index.js b/x-pack/plugins/siem/cypress/plugins/index.js similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/plugins/index.js rename to x-pack/plugins/siem/cypress/plugins/index.js diff --git a/x-pack/plugins/siem/cypress/reporter_config.json b/x-pack/plugins/siem/cypress/reporter_config.json new file mode 100644 index 00000000000000..e7e08eeae1dab2 --- /dev/null +++ b/x-pack/plugins/siem/cypress/reporter_config.json @@ -0,0 +1,10 @@ +{ + "reporterEnabled": "mochawesome, mocha-junit-reporter", + "reporterOptions": { + "html": false, + "json": true, + "mochaFile": "../../../target/kibana-siem/cypress/results/TEST-siem-cypress-[hash].xml", + "overwrite": false, + "reportDir": "../../../target/kibana-siem/cypress/results" + } +} diff --git a/x-pack/legacy/plugins/siem/cypress/screens/create_new_rule.ts b/x-pack/plugins/siem/cypress/screens/create_new_rule.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/create_new_rule.ts rename to x-pack/plugins/siem/cypress/screens/create_new_rule.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/date_picker.ts b/x-pack/plugins/siem/cypress/screens/date_picker.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/date_picker.ts rename to x-pack/plugins/siem/cypress/screens/date_picker.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/detections.ts b/x-pack/plugins/siem/cypress/screens/detections.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/detections.ts rename to x-pack/plugins/siem/cypress/screens/detections.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/fields_browser.ts b/x-pack/plugins/siem/cypress/screens/fields_browser.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/fields_browser.ts rename to x-pack/plugins/siem/cypress/screens/fields_browser.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/hosts/all_hosts.ts b/x-pack/plugins/siem/cypress/screens/hosts/all_hosts.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/hosts/all_hosts.ts rename to x-pack/plugins/siem/cypress/screens/hosts/all_hosts.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/hosts/authentications.ts b/x-pack/plugins/siem/cypress/screens/hosts/authentications.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/hosts/authentications.ts rename to x-pack/plugins/siem/cypress/screens/hosts/authentications.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/hosts/events.ts b/x-pack/plugins/siem/cypress/screens/hosts/events.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/hosts/events.ts rename to x-pack/plugins/siem/cypress/screens/hosts/events.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/hosts/main.ts b/x-pack/plugins/siem/cypress/screens/hosts/main.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/hosts/main.ts rename to x-pack/plugins/siem/cypress/screens/hosts/main.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/hosts/uncommon_processes.ts b/x-pack/plugins/siem/cypress/screens/hosts/uncommon_processes.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/hosts/uncommon_processes.ts rename to x-pack/plugins/siem/cypress/screens/hosts/uncommon_processes.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/inspect.ts b/x-pack/plugins/siem/cypress/screens/inspect.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/inspect.ts rename to x-pack/plugins/siem/cypress/screens/inspect.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/network/flows.ts b/x-pack/plugins/siem/cypress/screens/network/flows.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/network/flows.ts rename to x-pack/plugins/siem/cypress/screens/network/flows.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/overview.ts b/x-pack/plugins/siem/cypress/screens/overview.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/overview.ts rename to x-pack/plugins/siem/cypress/screens/overview.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/pagination.ts b/x-pack/plugins/siem/cypress/screens/pagination.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/pagination.ts rename to x-pack/plugins/siem/cypress/screens/pagination.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/rule_details.ts b/x-pack/plugins/siem/cypress/screens/rule_details.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/rule_details.ts rename to x-pack/plugins/siem/cypress/screens/rule_details.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/siem_header.ts b/x-pack/plugins/siem/cypress/screens/siem_header.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/siem_header.ts rename to x-pack/plugins/siem/cypress/screens/siem_header.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/siem_main.ts b/x-pack/plugins/siem/cypress/screens/siem_main.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/siem_main.ts rename to x-pack/plugins/siem/cypress/screens/siem_main.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/signal_detection_rules.ts b/x-pack/plugins/siem/cypress/screens/signal_detection_rules.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/signal_detection_rules.ts rename to x-pack/plugins/siem/cypress/screens/signal_detection_rules.ts diff --git a/x-pack/legacy/plugins/siem/cypress/screens/timeline.ts b/x-pack/plugins/siem/cypress/screens/timeline.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/screens/timeline.ts rename to x-pack/plugins/siem/cypress/screens/timeline.ts diff --git a/x-pack/legacy/plugins/siem/cypress/support/commands.js b/x-pack/plugins/siem/cypress/support/commands.js similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/support/commands.js rename to x-pack/plugins/siem/cypress/support/commands.js diff --git a/x-pack/legacy/plugins/siem/cypress/support/index.d.ts b/x-pack/plugins/siem/cypress/support/index.d.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/support/index.d.ts rename to x-pack/plugins/siem/cypress/support/index.d.ts diff --git a/x-pack/legacy/plugins/siem/cypress/support/index.js b/x-pack/plugins/siem/cypress/support/index.js similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/support/index.js rename to x-pack/plugins/siem/cypress/support/index.js diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/common.ts b/x-pack/plugins/siem/cypress/tasks/common.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/tasks/common.ts rename to x-pack/plugins/siem/cypress/tasks/common.ts diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/create_new_rule.ts b/x-pack/plugins/siem/cypress/tasks/create_new_rule.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/tasks/create_new_rule.ts rename to x-pack/plugins/siem/cypress/tasks/create_new_rule.ts diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/date_picker.ts b/x-pack/plugins/siem/cypress/tasks/date_picker.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/tasks/date_picker.ts rename to x-pack/plugins/siem/cypress/tasks/date_picker.ts diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/detections.ts b/x-pack/plugins/siem/cypress/tasks/detections.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/tasks/detections.ts rename to x-pack/plugins/siem/cypress/tasks/detections.ts diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/es_archiver.ts b/x-pack/plugins/siem/cypress/tasks/es_archiver.ts similarity index 53% rename from x-pack/legacy/plugins/siem/cypress/tasks/es_archiver.ts rename to x-pack/plugins/siem/cypress/tasks/es_archiver.ts index 6417a7d8722511..8a4ab8c8194575 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/es_archiver.ts +++ b/x-pack/plugins/siem/cypress/tasks/es_archiver.ts @@ -6,7 +6,7 @@ export const esArchiverLoadEmptyKibana = () => { cy.exec( - `node ../../../../scripts/es_archiver empty_kibana load empty--dir ../../../test/siem_cypress/es_archives --config ../../../../test/functional/config.js --es-url ${Cypress.env( + `node ../../../scripts/es_archiver empty_kibana load empty--dir ../../test/siem_cypress/es_archives --config ../../../test/functional/config.js --es-url ${Cypress.env( 'ELASTICSEARCH_URL' )} --kibana-url ${Cypress.config().baseUrl}` ); @@ -14,7 +14,7 @@ export const esArchiverLoadEmptyKibana = () => { export const esArchiverLoad = (folder: string) => { cy.exec( - `node ../../../../scripts/es_archiver load ${folder} --dir ../../../test/siem_cypress/es_archives --config ../../../../test/functional/config.js --es-url ${Cypress.env( + `node ../../../scripts/es_archiver load ${folder} --dir ../../test/siem_cypress/es_archives --config ../../../test/functional/config.js --es-url ${Cypress.env( 'ELASTICSEARCH_URL' )} --kibana-url ${Cypress.config().baseUrl}` ); @@ -22,7 +22,7 @@ export const esArchiverLoad = (folder: string) => { export const esArchiverUnload = (folder: string) => { cy.exec( - `node ../../../../scripts/es_archiver unload ${folder} --dir ../../../test/siem_cypress/es_archives --config ../../../../test/functional/config.js --es-url ${Cypress.env( + `node ../../../scripts/es_archiver unload ${folder} --dir ../../test/siem_cypress/es_archives --config ../../../test/functional/config.js --es-url ${Cypress.env( 'ELASTICSEARCH_URL' )} --kibana-url ${Cypress.config().baseUrl}` ); @@ -30,7 +30,7 @@ export const esArchiverUnload = (folder: string) => { export const esArchiverUnloadEmptyKibana = () => { cy.exec( - `node ../../../../scripts/es_archiver unload empty_kibana empty--dir ../../../test/siem_cypress/es_archives --config ../../../../test/functional/config.js --es-url ${Cypress.env( + `node ../../../scripts/es_archiver unload empty_kibana empty--dir ../../test/siem_cypress/es_archives --config ../../../test/functional/config.js --es-url ${Cypress.env( 'ELASTICSEARCH_URL' )} --kibana-url ${Cypress.config().baseUrl}` ); @@ -38,7 +38,7 @@ export const esArchiverUnloadEmptyKibana = () => { export const esArchiverResetKibana = () => { cy.exec( - `node ../../../../scripts/es_archiver empty-kibana-index --config ../../../../test/functional/config.js --es-url ${Cypress.env( + `node ../../../scripts/es_archiver empty-kibana-index --config ../../../test/functional/config.js --es-url ${Cypress.env( 'ELASTICSEARCH_URL' )} --kibana-url ${Cypress.config().baseUrl}` ); diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/fields_browser.ts b/x-pack/plugins/siem/cypress/tasks/fields_browser.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/tasks/fields_browser.ts rename to x-pack/plugins/siem/cypress/tasks/fields_browser.ts diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/all_hosts.ts b/x-pack/plugins/siem/cypress/tasks/hosts/all_hosts.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/tasks/hosts/all_hosts.ts rename to x-pack/plugins/siem/cypress/tasks/hosts/all_hosts.ts diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/authentications.ts b/x-pack/plugins/siem/cypress/tasks/hosts/authentications.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/tasks/hosts/authentications.ts rename to x-pack/plugins/siem/cypress/tasks/hosts/authentications.ts diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/events.ts b/x-pack/plugins/siem/cypress/tasks/hosts/events.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/tasks/hosts/events.ts rename to x-pack/plugins/siem/cypress/tasks/hosts/events.ts diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/main.ts b/x-pack/plugins/siem/cypress/tasks/hosts/main.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/tasks/hosts/main.ts rename to x-pack/plugins/siem/cypress/tasks/hosts/main.ts diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/hosts/uncommon_processes.ts b/x-pack/plugins/siem/cypress/tasks/hosts/uncommon_processes.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/tasks/hosts/uncommon_processes.ts rename to x-pack/plugins/siem/cypress/tasks/hosts/uncommon_processes.ts diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/inspect.ts b/x-pack/plugins/siem/cypress/tasks/inspect.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/tasks/inspect.ts rename to x-pack/plugins/siem/cypress/tasks/inspect.ts diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/login.ts b/x-pack/plugins/siem/cypress/tasks/login.ts similarity index 98% rename from x-pack/legacy/plugins/siem/cypress/tasks/login.ts rename to x-pack/plugins/siem/cypress/tasks/login.ts index c7788b080d06e0..1bbf41d05db007 100644 --- a/x-pack/legacy/plugins/siem/cypress/tasks/login.ts +++ b/x-pack/plugins/siem/cypress/tasks/login.ts @@ -10,7 +10,7 @@ import * as yaml from 'js-yaml'; * Credentials in the `kibana.dev.yml` config file will be used to authenticate * with Kibana when credentials are not provided via environment variables */ -const KIBANA_DEV_YML_PATH = '../../../../config/kibana.dev.yml'; +const KIBANA_DEV_YML_PATH = '../../../config/kibana.dev.yml'; /** * The configuration path in `kibana.dev.yml` to the username to be used when diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/network/flows.ts b/x-pack/plugins/siem/cypress/tasks/network/flows.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/tasks/network/flows.ts rename to x-pack/plugins/siem/cypress/tasks/network/flows.ts diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/overview.ts b/x-pack/plugins/siem/cypress/tasks/overview.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/tasks/overview.ts rename to x-pack/plugins/siem/cypress/tasks/overview.ts diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/pagination.ts b/x-pack/plugins/siem/cypress/tasks/pagination.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/tasks/pagination.ts rename to x-pack/plugins/siem/cypress/tasks/pagination.ts diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/siem_header.ts b/x-pack/plugins/siem/cypress/tasks/siem_header.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/tasks/siem_header.ts rename to x-pack/plugins/siem/cypress/tasks/siem_header.ts diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/siem_main.ts b/x-pack/plugins/siem/cypress/tasks/siem_main.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/tasks/siem_main.ts rename to x-pack/plugins/siem/cypress/tasks/siem_main.ts diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/signal_detection_rules.ts b/x-pack/plugins/siem/cypress/tasks/signal_detection_rules.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/tasks/signal_detection_rules.ts rename to x-pack/plugins/siem/cypress/tasks/signal_detection_rules.ts diff --git a/x-pack/legacy/plugins/siem/cypress/tasks/timeline.ts b/x-pack/plugins/siem/cypress/tasks/timeline.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/tasks/timeline.ts rename to x-pack/plugins/siem/cypress/tasks/timeline.ts diff --git a/x-pack/legacy/plugins/siem/cypress/tsconfig.json b/x-pack/plugins/siem/cypress/tsconfig.json similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/tsconfig.json rename to x-pack/plugins/siem/cypress/tsconfig.json diff --git a/x-pack/legacy/plugins/siem/cypress/urls/ml_conditional_links.ts b/x-pack/plugins/siem/cypress/urls/ml_conditional_links.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/urls/ml_conditional_links.ts rename to x-pack/plugins/siem/cypress/urls/ml_conditional_links.ts diff --git a/x-pack/legacy/plugins/siem/cypress/urls/navigation.ts b/x-pack/plugins/siem/cypress/urls/navigation.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/urls/navigation.ts rename to x-pack/plugins/siem/cypress/urls/navigation.ts diff --git a/x-pack/legacy/plugins/siem/cypress/urls/state.ts b/x-pack/plugins/siem/cypress/urls/state.ts similarity index 100% rename from x-pack/legacy/plugins/siem/cypress/urls/state.ts rename to x-pack/plugins/siem/cypress/urls/state.ts diff --git a/x-pack/plugins/siem/kibana.json b/x-pack/plugins/siem/kibana.json index 2bc33b87a1b438..1eb1a7dbde8761 100644 --- a/x-pack/plugins/siem/kibana.json +++ b/x-pack/plugins/siem/kibana.json @@ -3,6 +3,8 @@ "version": "8.0.0", "kibanaVersion": "kibana", "configPath": ["xpack", "siem"], + "requiredPlugins": ["actions", "alerting", "features", "licensing"], + "optionalPlugins": ["encryptedSavedObjects", "ml", "security", "spaces"], "server": true, "ui": false } diff --git a/x-pack/plugins/siem/package.json b/x-pack/plugins/siem/package.json new file mode 100644 index 00000000000000..1fcef46243628c --- /dev/null +++ b/x-pack/plugins/siem/package.json @@ -0,0 +1,20 @@ +{ + "author": "Elastic", + "name": "siem", + "version": "8.0.0", + "private": true, + "license": "Elastic-License", + "scripts": { + "extract-mitre-attacks": "node scripts/extract_tactics_techniques_mitre.js & node ../../../scripts/eslint ../../legacy/plugins/siem/public/pages/detection_engine/mitre/mitre_tactics_techniques.ts --fix", + "build-graphql-types": "node scripts/generate_types_from_graphql.js", + "cypress:open": "cypress open --config-file ./cypress/cypress.json", + "cypress:run": "cypress run --spec ./cypress/integration/**/*.spec.ts --config-file ./cypress/cypress.json --reporter ../../node_modules/cypress-multi-reporters --reporter-options configFile=./cypress/reporter_config.json; status=$?; ../../node_modules/.bin/mochawesome-merge --reportDir ../../../target/kibana-siem/cypress/results > ../../../target/kibana-siem/cypress/results/output.json; ../../../node_modules/.bin/marge ../../../target/kibana-siem/cypress/results/output.json --reportDir ../../../target/kibana-siem/cypress/results; mkdir -p ../../../target/junit && cp ../../../target/kibana-siem/cypress/results/*.xml ../../../target/junit/ && exit $status;", + "cypress:run-as-ci": "node ../../../scripts/functional_tests --config ../../test/siem_cypress/config.ts" + }, + "devDependencies": { + "@types/lodash": "^4.14.110" + }, + "dependencies": { + "lodash": "^4.17.15" + } +} diff --git a/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/schema.gql.ts b/x-pack/plugins/siem/scripts/check_circular_deps.js similarity index 69% rename from x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/schema.gql.ts rename to x-pack/plugins/siem/scripts/check_circular_deps.js index 6af2c8bc8827ff..4ba7020d134651 100644 --- a/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/schema.gql.ts +++ b/x-pack/plugins/siem/scripts/check_circular_deps.js @@ -4,8 +4,5 @@ * you may not use this file except in compliance with the Elastic License. */ -import gql from 'graphql-tag'; - -export const unsignedIntegerSchema = gql` - scalar UnsignedInteger -`; +require('../../../../src/setup_node_env'); +require('./check_circular_deps/run_check_circular_deps_cli'); diff --git a/x-pack/legacy/plugins/siem/dev_tools/circular_deps/run_check_circular_deps_cli.js b/x-pack/plugins/siem/scripts/check_circular_deps/run_check_circular_deps_cli.js similarity index 88% rename from x-pack/legacy/plugins/siem/dev_tools/circular_deps/run_check_circular_deps_cli.js rename to x-pack/plugins/siem/scripts/check_circular_deps/run_check_circular_deps_cli.js index f3a97f5b9c9b6f..0b5e5d6cf13b5b 100644 --- a/x-pack/legacy/plugins/siem/dev_tools/circular_deps/run_check_circular_deps_cli.js +++ b/x-pack/plugins/siem/scripts/check_circular_deps/run_check_circular_deps_cli.js @@ -11,10 +11,13 @@ import madge from 'madge'; /* eslint-disable-next-line import/no-extraneous-dependencies */ import { run, createFailError } from '@kbn/dev-utils'; +const legacyPluginPath = '../../../../legacy/plugins/siem'; +const pluginPath = '../..'; + run( async ({ log }) => { const result = await madge( - [resolve(__dirname, '../../public'), resolve(__dirname, '../../common')], + [resolve(__dirname, legacyPluginPath, 'public'), resolve(__dirname, pluginPath, 'common')], { fileExtensions: ['ts', 'js', 'tsx'], excludeRegExp: [ diff --git a/x-pack/legacy/plugins/siem/scripts/combined_schema.ts b/x-pack/plugins/siem/scripts/combined_schema.ts similarity index 91% rename from x-pack/legacy/plugins/siem/scripts/combined_schema.ts rename to x-pack/plugins/siem/scripts/combined_schema.ts index 625eb3a4a47551..48215548650fe0 100644 --- a/x-pack/legacy/plugins/siem/scripts/combined_schema.ts +++ b/x-pack/plugins/siem/scripts/combined_schema.ts @@ -6,6 +6,7 @@ import { buildSchemaFromTypeDefinitions } from 'graphql-tools'; +// eslint-disable-next-line @kbn/eslint/no-restricted-paths import { schemas as serverSchemas } from '../server/graphql'; export const schemas = [...serverSchemas]; diff --git a/x-pack/legacy/plugins/siem/scripts/convert_saved_search_to_rules.js b/x-pack/plugins/siem/scripts/convert_saved_search_to_rules.js similarity index 99% rename from x-pack/legacy/plugins/siem/scripts/convert_saved_search_to_rules.js rename to x-pack/plugins/siem/scripts/convert_saved_search_to_rules.js index 233d4dd7de721e..65da56dd09bcab 100644 --- a/x-pack/legacy/plugins/siem/scripts/convert_saved_search_to_rules.js +++ b/x-pack/plugins/siem/scripts/convert_saved_search_to_rules.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -require('../../../../../src/setup_node_env'); +require('../../../../src/setup_node_env'); const fs = require('fs'); const path = require('path'); diff --git a/x-pack/legacy/plugins/siem/scripts/extract_tactics_techniques_mitre.js b/x-pack/plugins/siem/scripts/extract_tactics_techniques_mitre.js similarity index 95% rename from x-pack/legacy/plugins/siem/scripts/extract_tactics_techniques_mitre.js rename to x-pack/plugins/siem/scripts/extract_tactics_techniques_mitre.js index 6cb2a400496317..478463b1a80640 100644 --- a/x-pack/legacy/plugins/siem/scripts/extract_tactics_techniques_mitre.js +++ b/x-pack/plugins/siem/scripts/extract_tactics_techniques_mitre.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -require('../../../../../src/setup_node_env'); +require('../../../../src/setup_node_env'); const fs = require('fs'); // eslint-disable-next-line import/no-extraneous-dependencies @@ -12,7 +12,13 @@ const fetch = require('node-fetch'); const { camelCase } = require('lodash'); const { resolve } = require('path'); -const OUTPUT_DIRECTORY = resolve('public', 'pages', 'detection_engine', 'mitre'); +const OUTPUT_DIRECTORY = resolve( + '../../legacy/plugins/siem', + 'public', + 'pages', + 'detection_engine', + 'mitre' +); const MITRE_ENTREPRISE_ATTACK_URL = 'https://raw.githubusercontent.com/mitre/cti/master/enterprise-attack/enterprise-attack.json'; diff --git a/x-pack/legacy/plugins/siem/scripts/generate_types_from_graphql.js b/x-pack/plugins/siem/scripts/generate_types_from_graphql.js similarity index 91% rename from x-pack/legacy/plugins/siem/scripts/generate_types_from_graphql.js rename to x-pack/plugins/siem/scripts/generate_types_from_graphql.js index 36674fec73e097..bded8832aba5a9 100644 --- a/x-pack/legacy/plugins/siem/scripts/generate_types_from_graphql.js +++ b/x-pack/plugins/siem/scripts/generate_types_from_graphql.js @@ -4,18 +4,25 @@ * you may not use this file except in compliance with the Elastic License. */ -require('../../../../../src/setup_node_env'); +require('../../../../src/setup_node_env'); const { join, resolve } = require('path'); // eslint-disable-next-line import/no-extraneous-dependencies, import/no-unresolved const { generate } = require('graphql-code-generator'); +const legacyPluginPath = '../../legacy/plugins/siem'; + const GRAPHQL_GLOBS = [ - join('public', 'containers', '**', '*.gql_query.ts{,x}'), + join(legacyPluginPath, 'public', 'containers', '**', '*.gql_query.ts{,x}'), join('common', 'graphql', '**', '*.gql_query.ts{,x}'), ]; -const OUTPUT_INTROSPECTION_PATH = resolve('public', 'graphql', 'introspection.json'); -const OUTPUT_CLIENT_TYPES_PATH = resolve('public', 'graphql', 'types.ts'); +const OUTPUT_INTROSPECTION_PATH = resolve( + legacyPluginPath, + 'public', + 'graphql', + 'introspection.json' +); +const OUTPUT_CLIENT_TYPES_PATH = resolve(legacyPluginPath, 'public', 'graphql', 'types.ts'); const OUTPUT_SERVER_TYPES_PATH = resolve('server', 'graphql', 'types.ts'); const SCHEMA_PATH = resolve(__dirname, 'combined_schema.ts'); diff --git a/x-pack/legacy/plugins/siem/scripts/loop_cypress_tests.js b/x-pack/plugins/siem/scripts/loop_cypress_tests.js similarity index 100% rename from x-pack/legacy/plugins/siem/scripts/loop_cypress_tests.js rename to x-pack/plugins/siem/scripts/loop_cypress_tests.js diff --git a/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig.js b/x-pack/plugins/siem/scripts/optimize_tsconfig.js similarity index 100% rename from x-pack/legacy/plugins/siem/scripts/optimize_tsconfig.js rename to x-pack/plugins/siem/scripts/optimize_tsconfig.js diff --git a/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/README.md b/x-pack/plugins/siem/scripts/optimize_tsconfig/README.md similarity index 86% rename from x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/README.md rename to x-pack/plugins/siem/scripts/optimize_tsconfig/README.md index d3615d2870ef97..2b402367c1db3a 100644 --- a/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/README.md +++ b/x-pack/plugins/siem/scripts/optimize_tsconfig/README.md @@ -8,9 +8,9 @@ Kibana and X-Pack are very large TypeScript projects, and it comes at a cost. Ed To run the optimization: -`$ node x-pack/legacy/plugins/siem/scripts/optimize_tsconfig` +`$ node x-pack/plugins/siem/scripts/optimize_tsconfig` To undo the optimization: -`$ node x-pack/legacy/plugins/siem/scripts/unoptimize_tsconfig` +`$ node x-pack/plugins/siem/scripts/unoptimize_tsconfig` diff --git a/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/optimize.js b/x-pack/plugins/siem/scripts/optimize_tsconfig/optimize.js similarity index 100% rename from x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/optimize.js rename to x-pack/plugins/siem/scripts/optimize_tsconfig/optimize.js diff --git a/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/paths.js b/x-pack/plugins/siem/scripts/optimize_tsconfig/paths.js similarity index 90% rename from x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/paths.js rename to x-pack/plugins/siem/scripts/optimize_tsconfig/paths.js index ca26203e17d2e8..c75e16f74b9325 100644 --- a/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/paths.js +++ b/x-pack/plugins/siem/scripts/optimize_tsconfig/paths.js @@ -5,7 +5,7 @@ */ const path = require('path'); -const xpackRoot = path.resolve(__dirname, '../../../../..'); +const xpackRoot = path.resolve(__dirname, '../../../..'); const kibanaRoot = path.resolve(xpackRoot, '..'); const tsconfigTpl = path.resolve(__dirname, './tsconfig.json'); diff --git a/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/tsconfig.json b/x-pack/plugins/siem/scripts/optimize_tsconfig/tsconfig.json similarity index 88% rename from x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/tsconfig.json rename to x-pack/plugins/siem/scripts/optimize_tsconfig/tsconfig.json index c4705c8b8c16aa..42d26c4c27ed66 100644 --- a/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/tsconfig.json +++ b/x-pack/plugins/siem/scripts/optimize_tsconfig/tsconfig.json @@ -10,7 +10,7 @@ "exclude": [ "test/**/*", "**/__fixtures__/**/*", - "legacy/plugins/siem/cypress/**/*", + "plugins/siem/cypress/**/*", "**/typespec_tests.ts" ] } diff --git a/x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/unoptimize.js b/x-pack/plugins/siem/scripts/optimize_tsconfig/unoptimize.js similarity index 100% rename from x-pack/legacy/plugins/siem/scripts/optimize_tsconfig/unoptimize.js rename to x-pack/plugins/siem/scripts/optimize_tsconfig/unoptimize.js diff --git a/x-pack/legacy/plugins/siem/scripts/storybook.js b/x-pack/plugins/siem/scripts/storybook.js similarity index 100% rename from x-pack/legacy/plugins/siem/scripts/storybook.js rename to x-pack/plugins/siem/scripts/storybook.js diff --git a/x-pack/legacy/plugins/siem/scripts/unoptimize_tsconfig.js b/x-pack/plugins/siem/scripts/unoptimize_tsconfig.js similarity index 100% rename from x-pack/legacy/plugins/siem/scripts/unoptimize_tsconfig.js rename to x-pack/plugins/siem/scripts/unoptimize_tsconfig.js diff --git a/x-pack/legacy/plugins/siem/server/client/client.test.ts b/x-pack/plugins/siem/server/client/client.test.ts similarity index 79% rename from x-pack/legacy/plugins/siem/server/client/client.test.ts rename to x-pack/plugins/siem/server/client/client.test.ts index bfe7b97f430035..94ff2149b8c64d 100644 --- a/x-pack/legacy/plugins/siem/server/client/client.test.ts +++ b/x-pack/plugins/siem/server/client/client.test.ts @@ -4,17 +4,17 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SiemClient } from './client'; +import { SIGNALS_INDEX_KEY } from '../../common/constants'; import { createMockConfig } from '../lib/detection_engine/routes/__mocks__'; +import { SiemClient } from './client'; describe('SiemClient', () => { describe('#signalsIndex', () => { it('returns the index scoped to the specified spaceId', () => { - let mockConfig = createMockConfig(); - mockConfig = () => ({ - get: jest.fn(() => 'mockSignalsIndex'), - has: jest.fn(), - }); + const mockConfig = { + ...createMockConfig(), + [SIGNALS_INDEX_KEY]: 'mockSignalsIndex', + }; const spaceId = 'fooSpace'; const client = new SiemClient(spaceId, mockConfig); diff --git a/x-pack/legacy/plugins/siem/server/client/client.ts b/x-pack/plugins/siem/server/client/client.ts similarity index 56% rename from x-pack/legacy/plugins/siem/server/client/client.ts rename to x-pack/plugins/siem/server/client/client.ts index 245b81d0be97a5..6cb0d4cfade77e 100644 --- a/x-pack/legacy/plugins/siem/server/client/client.ts +++ b/x-pack/plugins/siem/server/client/client.ts @@ -4,17 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Legacy } from 'kibana'; - -import { APP_ID, SIGNALS_INDEX_KEY } from '../../common/constants'; +import { ConfigType } from '..'; export class SiemClient { public readonly signalsIndex: string; - constructor(private spaceId: string, private config: Legacy.Server['config']) { - const configuredSignalsIndex = this.config().get( - `xpack.${APP_ID}.${SIGNALS_INDEX_KEY}` - ); + constructor(private spaceId: string, private config: ConfigType) { + const configuredSignalsIndex = this.config.signalsIndex; this.signalsIndex = `${configuredSignalsIndex}-${this.spaceId}`; } diff --git a/x-pack/legacy/plugins/siem/server/client/factory.test.ts b/x-pack/plugins/siem/server/client/factory.test.ts similarity index 82% rename from x-pack/legacy/plugins/siem/server/client/factory.test.ts rename to x-pack/plugins/siem/server/client/factory.test.ts index c166b6b838be2a..f0cddc5f09747b 100644 --- a/x-pack/legacy/plugins/siem/server/client/factory.test.ts +++ b/x-pack/plugins/siem/server/client/factory.test.ts @@ -4,7 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { httpServerMock } from '../../../../../../src/core/server/mocks'; +import { httpServerMock } from '../../../../../src/core/server/mocks'; +import { createMockConfig } from '../lib/detection_engine/routes/__mocks__'; import { SiemClientFactory } from './factory'; import { SiemClient } from './client'; @@ -16,7 +17,7 @@ describe('SiemClientFactory', () => { it('constructs a client with the current spaceId', () => { const factory = new SiemClientFactory(); const mockRequest = httpServerMock.createKibanaRequest(); - factory.setup({ getSpaceId: () => 'mockSpace', config: jest.fn() }); + factory.setup({ getSpaceId: () => 'mockSpace', config: createMockConfig() }); factory.create(mockRequest); expect(mockClient).toHaveBeenCalledWith('mockSpace', expect.anything()); @@ -25,7 +26,7 @@ describe('SiemClientFactory', () => { it('constructs a client with the default spaceId if spaces are disabled', () => { const factory = new SiemClientFactory(); const mockRequest = httpServerMock.createKibanaRequest(); - factory.setup({ getSpaceId: undefined, config: jest.fn() }); + factory.setup({ getSpaceId: undefined, config: createMockConfig() }); factory.create(mockRequest); expect(mockClient).toHaveBeenCalledWith('default', expect.anything()); diff --git a/x-pack/legacy/plugins/siem/server/client/factory.ts b/x-pack/plugins/siem/server/client/factory.ts similarity index 87% rename from x-pack/legacy/plugins/siem/server/client/factory.ts rename to x-pack/plugins/siem/server/client/factory.ts index d31920bdf2c771..d3d6b84e5b090a 100644 --- a/x-pack/legacy/plugins/siem/server/client/factory.ts +++ b/x-pack/plugins/siem/server/client/factory.ts @@ -4,14 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Legacy } from 'kibana'; - -import { KibanaRequest } from '../../../../../../src/core/server'; +import { KibanaRequest } from '../../../../../src/core/server'; import { SiemClient } from './client'; +import { ConfigType } from '..'; interface SetupDependencies { getSpaceId?: (request: KibanaRequest) => string | undefined; - config: Legacy.Server['config']; + config: ConfigType; } export class SiemClientFactory { diff --git a/x-pack/legacy/plugins/siem/server/client/index.ts b/x-pack/plugins/siem/server/client/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/client/index.ts rename to x-pack/plugins/siem/server/client/index.ts diff --git a/x-pack/plugins/siem/server/config.ts b/x-pack/plugins/siem/server/config.ts index 224043c0c6fe5d..4b0e8d34ef1a0a 100644 --- a/x-pack/plugins/siem/server/config.ts +++ b/x-pack/plugins/siem/server/config.ts @@ -7,13 +7,14 @@ import { Observable } from 'rxjs'; import { schema, TypeOf } from '@kbn/config-schema'; import { PluginInitializerContext } from '../../../../src/core/server'; -import { - SIGNALS_INDEX_KEY, - DEFAULT_SIGNALS_INDEX, -} from '../../../legacy/plugins/siem/common/constants'; +import { SIGNALS_INDEX_KEY, DEFAULT_SIGNALS_INDEX } from '../common/constants'; export const configSchema = schema.object({ enabled: schema.boolean({ defaultValue: true }), + maxRuleImportExportSize: schema.number({ defaultValue: 10000 }), + maxRuleImportPayloadBytes: schema.number({ defaultValue: 10485760 }), + maxTimelineImportExportSize: schema.number({ defaultValue: 10000 }), + maxTimelineImportPayloadBytes: schema.number({ defaultValue: 10485760 }), [SIGNALS_INDEX_KEY]: schema.string({ defaultValue: DEFAULT_SIGNALS_INDEX }), }); diff --git a/x-pack/legacy/plugins/siem/server/graphql/authentications/index.ts b/x-pack/plugins/siem/server/graphql/authentications/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/authentications/index.ts rename to x-pack/plugins/siem/server/graphql/authentications/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/authentications/resolvers.ts b/x-pack/plugins/siem/server/graphql/authentications/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/authentications/resolvers.ts rename to x-pack/plugins/siem/server/graphql/authentications/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/authentications/schema.gql.ts b/x-pack/plugins/siem/server/graphql/authentications/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/authentications/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/authentications/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/ecs/index.ts b/x-pack/plugins/siem/server/graphql/ecs/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/ecs/index.ts rename to x-pack/plugins/siem/server/graphql/ecs/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/ecs/resolvers.ts b/x-pack/plugins/siem/server/graphql/ecs/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/ecs/resolvers.ts rename to x-pack/plugins/siem/server/graphql/ecs/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/ecs/schema.gql.ts b/x-pack/plugins/siem/server/graphql/ecs/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/ecs/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/ecs/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/events/index.ts b/x-pack/plugins/siem/server/graphql/events/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/events/index.ts rename to x-pack/plugins/siem/server/graphql/events/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/events/resolvers.ts b/x-pack/plugins/siem/server/graphql/events/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/events/resolvers.ts rename to x-pack/plugins/siem/server/graphql/events/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/events/schema.gql.ts b/x-pack/plugins/siem/server/graphql/events/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/events/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/events/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/hosts/index.ts b/x-pack/plugins/siem/server/graphql/hosts/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/hosts/index.ts rename to x-pack/plugins/siem/server/graphql/hosts/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/hosts/resolvers.ts b/x-pack/plugins/siem/server/graphql/hosts/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/hosts/resolvers.ts rename to x-pack/plugins/siem/server/graphql/hosts/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/hosts/schema.gql.ts b/x-pack/plugins/siem/server/graphql/hosts/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/hosts/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/hosts/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/index.ts b/x-pack/plugins/siem/server/graphql/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/index.ts rename to x-pack/plugins/siem/server/graphql/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/ip_details/index.ts b/x-pack/plugins/siem/server/graphql/ip_details/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/ip_details/index.ts rename to x-pack/plugins/siem/server/graphql/ip_details/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/ip_details/resolvers.ts b/x-pack/plugins/siem/server/graphql/ip_details/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/ip_details/resolvers.ts rename to x-pack/plugins/siem/server/graphql/ip_details/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/ip_details/schema.gql.ts b/x-pack/plugins/siem/server/graphql/ip_details/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/ip_details/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/ip_details/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/kpi_hosts/index.ts b/x-pack/plugins/siem/server/graphql/kpi_hosts/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/kpi_hosts/index.ts rename to x-pack/plugins/siem/server/graphql/kpi_hosts/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/kpi_hosts/resolvers.ts b/x-pack/plugins/siem/server/graphql/kpi_hosts/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/kpi_hosts/resolvers.ts rename to x-pack/plugins/siem/server/graphql/kpi_hosts/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/kpi_hosts/schema.gql.ts b/x-pack/plugins/siem/server/graphql/kpi_hosts/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/kpi_hosts/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/kpi_hosts/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/kpi_network/index.ts b/x-pack/plugins/siem/server/graphql/kpi_network/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/kpi_network/index.ts rename to x-pack/plugins/siem/server/graphql/kpi_network/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/kpi_network/resolvers.ts b/x-pack/plugins/siem/server/graphql/kpi_network/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/kpi_network/resolvers.ts rename to x-pack/plugins/siem/server/graphql/kpi_network/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/kpi_network/schema.gql.ts b/x-pack/plugins/siem/server/graphql/kpi_network/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/kpi_network/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/kpi_network/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/matrix_histogram/index.ts b/x-pack/plugins/siem/server/graphql/matrix_histogram/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/matrix_histogram/index.ts rename to x-pack/plugins/siem/server/graphql/matrix_histogram/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/matrix_histogram/resolvers.ts b/x-pack/plugins/siem/server/graphql/matrix_histogram/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/matrix_histogram/resolvers.ts rename to x-pack/plugins/siem/server/graphql/matrix_histogram/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/matrix_histogram/schema.gql.ts b/x-pack/plugins/siem/server/graphql/matrix_histogram/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/matrix_histogram/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/matrix_histogram/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/network/index.ts b/x-pack/plugins/siem/server/graphql/network/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/network/index.ts rename to x-pack/plugins/siem/server/graphql/network/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/network/resolvers.ts b/x-pack/plugins/siem/server/graphql/network/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/network/resolvers.ts rename to x-pack/plugins/siem/server/graphql/network/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/network/schema.gql.ts b/x-pack/plugins/siem/server/graphql/network/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/network/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/network/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/note/index.ts b/x-pack/plugins/siem/server/graphql/note/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/note/index.ts rename to x-pack/plugins/siem/server/graphql/note/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/note/resolvers.ts b/x-pack/plugins/siem/server/graphql/note/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/note/resolvers.ts rename to x-pack/plugins/siem/server/graphql/note/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/note/schema.gql.ts b/x-pack/plugins/siem/server/graphql/note/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/note/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/note/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/overview/index.ts b/x-pack/plugins/siem/server/graphql/overview/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/overview/index.ts rename to x-pack/plugins/siem/server/graphql/overview/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/overview/resolvers.ts b/x-pack/plugins/siem/server/graphql/overview/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/overview/resolvers.ts rename to x-pack/plugins/siem/server/graphql/overview/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/overview/schema.gql.ts b/x-pack/plugins/siem/server/graphql/overview/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/overview/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/overview/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/pinned_event/index.ts b/x-pack/plugins/siem/server/graphql/pinned_event/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/pinned_event/index.ts rename to x-pack/plugins/siem/server/graphql/pinned_event/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/pinned_event/resolvers.ts b/x-pack/plugins/siem/server/graphql/pinned_event/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/pinned_event/resolvers.ts rename to x-pack/plugins/siem/server/graphql/pinned_event/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/pinned_event/schema.gql.ts b/x-pack/plugins/siem/server/graphql/pinned_event/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/pinned_event/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/pinned_event/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/scalar_date/index.ts b/x-pack/plugins/siem/server/graphql/scalar_date/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/scalar_date/index.ts rename to x-pack/plugins/siem/server/graphql/scalar_date/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/scalar_date/resolvers.test.ts b/x-pack/plugins/siem/server/graphql/scalar_date/resolvers.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/scalar_date/resolvers.test.ts rename to x-pack/plugins/siem/server/graphql/scalar_date/resolvers.test.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/scalar_date/resolvers.ts b/x-pack/plugins/siem/server/graphql/scalar_date/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/scalar_date/resolvers.ts rename to x-pack/plugins/siem/server/graphql/scalar_date/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/scalar_date/schema.gql.ts b/x-pack/plugins/siem/server/graphql/scalar_date/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/scalar_date/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/scalar_date/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/scalar_to_any/index.ts b/x-pack/plugins/siem/server/graphql/scalar_to_any/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/scalar_to_any/index.ts rename to x-pack/plugins/siem/server/graphql/scalar_to_any/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/scalar_to_any/resolvers.ts b/x-pack/plugins/siem/server/graphql/scalar_to_any/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/scalar_to_any/resolvers.ts rename to x-pack/plugins/siem/server/graphql/scalar_to_any/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/scalar_to_any/schema.gql.ts b/x-pack/plugins/siem/server/graphql/scalar_to_any/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/scalar_to_any/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/scalar_to_any/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/scalar_to_boolean_array/index.ts b/x-pack/plugins/siem/server/graphql/scalar_to_boolean_array/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/scalar_to_boolean_array/index.ts rename to x-pack/plugins/siem/server/graphql/scalar_to_boolean_array/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/scalar_to_boolean_array/resolvers.test.ts b/x-pack/plugins/siem/server/graphql/scalar_to_boolean_array/resolvers.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/scalar_to_boolean_array/resolvers.test.ts rename to x-pack/plugins/siem/server/graphql/scalar_to_boolean_array/resolvers.test.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/scalar_to_boolean_array/resolvers.ts b/x-pack/plugins/siem/server/graphql/scalar_to_boolean_array/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/scalar_to_boolean_array/resolvers.ts rename to x-pack/plugins/siem/server/graphql/scalar_to_boolean_array/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/scalar_to_boolean_array/schema.gql.ts b/x-pack/plugins/siem/server/graphql/scalar_to_boolean_array/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/scalar_to_boolean_array/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/scalar_to_boolean_array/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/scalar_to_date_array/index.ts b/x-pack/plugins/siem/server/graphql/scalar_to_date_array/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/scalar_to_date_array/index.ts rename to x-pack/plugins/siem/server/graphql/scalar_to_date_array/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/scalar_to_date_array/resolvers.test.ts b/x-pack/plugins/siem/server/graphql/scalar_to_date_array/resolvers.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/scalar_to_date_array/resolvers.test.ts rename to x-pack/plugins/siem/server/graphql/scalar_to_date_array/resolvers.test.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/scalar_to_date_array/resolvers.ts b/x-pack/plugins/siem/server/graphql/scalar_to_date_array/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/scalar_to_date_array/resolvers.ts rename to x-pack/plugins/siem/server/graphql/scalar_to_date_array/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/scalar_to_date_array/schema.gql.ts b/x-pack/plugins/siem/server/graphql/scalar_to_date_array/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/scalar_to_date_array/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/scalar_to_date_array/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/scalar_to_number_array/index.ts b/x-pack/plugins/siem/server/graphql/scalar_to_number_array/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/scalar_to_number_array/index.ts rename to x-pack/plugins/siem/server/graphql/scalar_to_number_array/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/scalar_to_number_array/resolvers.test.ts b/x-pack/plugins/siem/server/graphql/scalar_to_number_array/resolvers.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/scalar_to_number_array/resolvers.test.ts rename to x-pack/plugins/siem/server/graphql/scalar_to_number_array/resolvers.test.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/scalar_to_number_array/resolvers.ts b/x-pack/plugins/siem/server/graphql/scalar_to_number_array/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/scalar_to_number_array/resolvers.ts rename to x-pack/plugins/siem/server/graphql/scalar_to_number_array/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/scalar_to_number_array/schema.gql.ts b/x-pack/plugins/siem/server/graphql/scalar_to_number_array/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/scalar_to_number_array/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/scalar_to_number_array/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/source_status/index.ts b/x-pack/plugins/siem/server/graphql/source_status/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/source_status/index.ts rename to x-pack/plugins/siem/server/graphql/source_status/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/source_status/resolvers.ts b/x-pack/plugins/siem/server/graphql/source_status/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/source_status/resolvers.ts rename to x-pack/plugins/siem/server/graphql/source_status/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/source_status/schema.gql.ts b/x-pack/plugins/siem/server/graphql/source_status/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/source_status/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/source_status/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/sources/index.ts b/x-pack/plugins/siem/server/graphql/sources/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/sources/index.ts rename to x-pack/plugins/siem/server/graphql/sources/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/sources/resolvers.ts b/x-pack/plugins/siem/server/graphql/sources/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/sources/resolvers.ts rename to x-pack/plugins/siem/server/graphql/sources/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/sources/schema.gql.ts b/x-pack/plugins/siem/server/graphql/sources/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/sources/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/sources/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/timeline/index.ts b/x-pack/plugins/siem/server/graphql/timeline/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/timeline/index.ts rename to x-pack/plugins/siem/server/graphql/timeline/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/timeline/resolvers.ts b/x-pack/plugins/siem/server/graphql/timeline/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/timeline/resolvers.ts rename to x-pack/plugins/siem/server/graphql/timeline/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/timeline/schema.gql.ts b/x-pack/plugins/siem/server/graphql/timeline/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/timeline/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/timeline/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/tls/index.ts b/x-pack/plugins/siem/server/graphql/tls/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/tls/index.ts rename to x-pack/plugins/siem/server/graphql/tls/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/tls/resolvers.ts b/x-pack/plugins/siem/server/graphql/tls/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/tls/resolvers.ts rename to x-pack/plugins/siem/server/graphql/tls/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/tls/schema.gql.ts b/x-pack/plugins/siem/server/graphql/tls/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/tls/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/tls/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/types.ts b/x-pack/plugins/siem/server/graphql/types.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/types.ts rename to x-pack/plugins/siem/server/graphql/types.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/uncommon_processes/index.ts b/x-pack/plugins/siem/server/graphql/uncommon_processes/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/uncommon_processes/index.ts rename to x-pack/plugins/siem/server/graphql/uncommon_processes/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/uncommon_processes/resolvers.ts b/x-pack/plugins/siem/server/graphql/uncommon_processes/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/uncommon_processes/resolvers.ts rename to x-pack/plugins/siem/server/graphql/uncommon_processes/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/uncommon_processes/schema.gql.ts b/x-pack/plugins/siem/server/graphql/uncommon_processes/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/uncommon_processes/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/uncommon_processes/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/who_am_i/index.ts b/x-pack/plugins/siem/server/graphql/who_am_i/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/who_am_i/index.ts rename to x-pack/plugins/siem/server/graphql/who_am_i/index.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/who_am_i/resolvers.ts b/x-pack/plugins/siem/server/graphql/who_am_i/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/who_am_i/resolvers.ts rename to x-pack/plugins/siem/server/graphql/who_am_i/resolvers.ts diff --git a/x-pack/legacy/plugins/siem/server/graphql/who_am_i/schema.gql.ts b/x-pack/plugins/siem/server/graphql/who_am_i/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/graphql/who_am_i/schema.gql.ts rename to x-pack/plugins/siem/server/graphql/who_am_i/schema.gql.ts diff --git a/x-pack/legacy/plugins/siem/server/init_server.ts b/x-pack/plugins/siem/server/init_server.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/init_server.ts rename to x-pack/plugins/siem/server/init_server.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/authentications/elasticsearch_adapter.test.ts b/x-pack/plugins/siem/server/lib/authentications/elasticsearch_adapter.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/authentications/elasticsearch_adapter.test.ts rename to x-pack/plugins/siem/server/lib/authentications/elasticsearch_adapter.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/authentications/elasticsearch_adapter.ts b/x-pack/plugins/siem/server/lib/authentications/elasticsearch_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/authentications/elasticsearch_adapter.ts rename to x-pack/plugins/siem/server/lib/authentications/elasticsearch_adapter.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/authentications/index.ts b/x-pack/plugins/siem/server/lib/authentications/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/authentications/index.ts rename to x-pack/plugins/siem/server/lib/authentications/index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/authentications/query.dsl.ts b/x-pack/plugins/siem/server/lib/authentications/query.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/authentications/query.dsl.ts rename to x-pack/plugins/siem/server/lib/authentications/query.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/authentications/types.ts b/x-pack/plugins/siem/server/lib/authentications/types.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/authentications/types.ts rename to x-pack/plugins/siem/server/lib/authentications/types.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/compose/kibana.ts b/x-pack/plugins/siem/server/lib/compose/kibana.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/compose/kibana.ts rename to x-pack/plugins/siem/server/lib/compose/kibana.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/configuration/adapter_types.ts b/x-pack/plugins/siem/server/lib/configuration/adapter_types.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/configuration/adapter_types.ts rename to x-pack/plugins/siem/server/lib/configuration/adapter_types.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/configuration/index.ts b/x-pack/plugins/siem/server/lib/configuration/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/configuration/index.ts rename to x-pack/plugins/siem/server/lib/configuration/index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/configuration/inmemory_configuration_adapter.ts b/x-pack/plugins/siem/server/lib/configuration/inmemory_configuration_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/configuration/inmemory_configuration_adapter.ts rename to x-pack/plugins/siem/server/lib/configuration/inmemory_configuration_adapter.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/README.md b/x-pack/plugins/siem/server/lib/detection_engine/README.md similarity index 96% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/README.md rename to x-pack/plugins/siem/server/lib/detection_engine/README.md index 1e8e3d5e3dd754..610e82fd5f6eea 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/README.md +++ b/x-pack/plugins/siem/server/lib/detection_engine/README.md @@ -46,7 +46,7 @@ server log [22:05:22.277] [info][status][plugin:alerting@8.0.0] Status changed f server log [22:05:22.270] [info][status][plugin:actions@8.0.0] Status changed from uninitialized to green - Ready ``` -Go to the scripts folder `cd kibana/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts` and run: +Go to the scripts folder `cd kibana/x-pack/plugins/siem/server/lib/detection_engine/scripts` and run: ```sh ./hard_reset.sh @@ -159,7 +159,7 @@ https://github.com/elastic/kibana/tree/master/x-pack/plugins/actions To update the status of a signal or group of signals, the following scripts provide an example of how to go about doing so. -`cd x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts` +`cd x-pack/plugins/siem/server/lib/detection_engine/scripts` `./signals/put_signal_doc.sh` will post a sample signal doc into the signals index to play with `./signals/set_status_with_id.sh closed` will update the status of the sample signal to closed `./signals/set_status_with_id.sh open` will update the status of the sample signal to open diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/errors/bad_request_error.ts b/x-pack/plugins/siem/server/lib/detection_engine/errors/bad_request_error.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/errors/bad_request_error.ts rename to x-pack/plugins/siem/server/lib/detection_engine/errors/bad_request_error.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/feature_flags.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/feature_flags.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/feature_flags.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/feature_flags.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/feature_flags.ts b/x-pack/plugins/siem/server/lib/detection_engine/feature_flags.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/feature_flags.ts rename to x-pack/plugins/siem/server/lib/detection_engine/feature_flags.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/index/create_bootstrap_index.ts b/x-pack/plugins/siem/server/lib/detection_engine/index/create_bootstrap_index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/index/create_bootstrap_index.ts rename to x-pack/plugins/siem/server/lib/detection_engine/index/create_bootstrap_index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/index/delete_all_index.ts b/x-pack/plugins/siem/server/lib/detection_engine/index/delete_all_index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/index/delete_all_index.ts rename to x-pack/plugins/siem/server/lib/detection_engine/index/delete_all_index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/index/delete_policy.ts b/x-pack/plugins/siem/server/lib/detection_engine/index/delete_policy.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/index/delete_policy.ts rename to x-pack/plugins/siem/server/lib/detection_engine/index/delete_policy.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/index/delete_template.ts b/x-pack/plugins/siem/server/lib/detection_engine/index/delete_template.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/index/delete_template.ts rename to x-pack/plugins/siem/server/lib/detection_engine/index/delete_template.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/index/get_index_exists.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/index/get_index_exists.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/index/get_index_exists.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/index/get_index_exists.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/index/get_index_exists.ts b/x-pack/plugins/siem/server/lib/detection_engine/index/get_index_exists.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/index/get_index_exists.ts rename to x-pack/plugins/siem/server/lib/detection_engine/index/get_index_exists.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/index/get_policy_exists.ts b/x-pack/plugins/siem/server/lib/detection_engine/index/get_policy_exists.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/index/get_policy_exists.ts rename to x-pack/plugins/siem/server/lib/detection_engine/index/get_policy_exists.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/index/get_template_exists.ts b/x-pack/plugins/siem/server/lib/detection_engine/index/get_template_exists.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/index/get_template_exists.ts rename to x-pack/plugins/siem/server/lib/detection_engine/index/get_template_exists.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/index/read_index.ts b/x-pack/plugins/siem/server/lib/detection_engine/index/read_index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/index/read_index.ts rename to x-pack/plugins/siem/server/lib/detection_engine/index/read_index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/index/set_policy.ts b/x-pack/plugins/siem/server/lib/detection_engine/index/set_policy.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/index/set_policy.ts rename to x-pack/plugins/siem/server/lib/detection_engine/index/set_policy.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/index/set_template.ts b/x-pack/plugins/siem/server/lib/detection_engine/index/set_template.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/index/set_template.ts rename to x-pack/plugins/siem/server/lib/detection_engine/index/set_template.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/add_tags.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/add_tags.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/add_tags.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/add_tags.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/add_tags.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/add_tags.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/add_tags.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/add_tags.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/build_signals_query.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/build_signals_query.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/build_signals_query.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/build_signals_query.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/build_signals_query.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/build_signals_query.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/build_signals_query.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/build_signals_query.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/create_notifications.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/create_notifications.test.ts similarity index 95% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/create_notifications.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/create_notifications.test.ts index 3878f5dae88898..e0414f842ceb3c 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/create_notifications.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/notifications/create_notifications.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { alertsClientMock } from '../../../../../../../plugins/alerting/server/mocks'; +import { alertsClientMock } from '../../../../../alerting/server/mocks'; import { createNotifications } from './create_notifications'; describe('createNotifications', () => { diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/create_notifications.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/create_notifications.ts similarity index 93% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/create_notifications.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/create_notifications.ts index ccd7576255d83d..35a737177ad49d 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/create_notifications.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/notifications/create_notifications.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Alert } from '../../../../../../../plugins/alerting/common'; +import { Alert } from '../../../../../alerting/common'; import { APP_ID, NOTIFICATIONS_ID } from '../../../../common/constants'; import { CreateNotificationParams } from './types'; import { addTags } from './add_tags'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/delete_notifications.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/delete_notifications.test.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/delete_notifications.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/delete_notifications.test.ts index 7e5c0eaf6286e6..089822f486aeb1 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/delete_notifications.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/notifications/delete_notifications.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { alertsClientMock } from '../../../../../../../plugins/alerting/server/mocks'; +import { alertsClientMock } from '../../../../../alerting/server/mocks'; import { deleteNotifications } from './delete_notifications'; import { readNotifications } from './read_notifications'; jest.mock('./read_notifications'); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/delete_notifications.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/delete_notifications.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/delete_notifications.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/delete_notifications.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/find_notifications.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/find_notifications.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/find_notifications.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/find_notifications.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/find_notifications.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/find_notifications.ts similarity index 92% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/find_notifications.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/find_notifications.ts index fcdeda608fe4e2..b47ea348bd4d6c 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/find_notifications.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/notifications/find_notifications.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { FindResult } from '../../../../../../../plugins/alerting/server'; +import { FindResult } from '../../../../../alerting/server'; import { NOTIFICATIONS_ID } from '../../../../common/constants'; import { FindNotificationParams } from './types'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/get_signals_count.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/get_signals_count.ts similarity index 92% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/get_signals_count.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/get_signals_count.ts index 7ff6a4e5164bd7..69f37da1e225b8 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/get_signals_count.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/notifications/get_signals_count.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AlertServices } from '../../../../../../../plugins/alerting/server'; +import { AlertServices } from '../../../../../alerting/server'; import { buildSignalsSearchQuery } from './build_signals_query'; interface GetSignalsCount { diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/read_notifications.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/read_notifications.test.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/read_notifications.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/read_notifications.test.ts index 834ad2460959c1..961aac15c484d3 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/read_notifications.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/notifications/read_notifications.test.ts @@ -5,7 +5,7 @@ */ import { readNotifications } from './read_notifications'; -import { alertsClientMock } from '../../../../../../../plugins/alerting/server/mocks'; +import { alertsClientMock } from '../../../../../alerting/server/mocks'; import { getNotificationResult, getFindNotificationsResultWithSingleHit, diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/read_notifications.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/read_notifications.ts similarity index 94% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/read_notifications.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/read_notifications.ts index 87bdd6f3f40e18..c585c474556a18 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/read_notifications.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/notifications/read_notifications.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SanitizedAlert } from '../../../../../../../plugins/alerting/common'; +import { SanitizedAlert } from '../../../../../alerting/common'; import { ReadNotificationParams, isAlertType } from './types'; import { findNotifications } from './find_notifications'; import { INTERNAL_RULE_ALERT_ID_KEY } from '../../../../common/constants'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/rules_notification_alert_type.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/rules_notification_alert_type.test.ts similarity index 99% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/rules_notification_alert_type.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/rules_notification_alert_type.test.ts index f537b22bac1eb1..6244a4cc64e683 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/rules_notification_alert_type.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/notifications/rules_notification_alert_type.test.ts @@ -8,7 +8,7 @@ import { loggerMock } from 'src/core/server/logging/logger.mock'; import { getResult } from '../routes/__mocks__/request_responses'; import { rulesNotificationAlertType } from './rules_notification_alert_type'; import { buildSignalsSearchQuery } from './build_signals_query'; -import { alertsMock, AlertServicesMock } from '../../../../../../../plugins/alerting/server/mocks'; +import { alertsMock, AlertServicesMock } from '../../../../../../plugins/alerting/server/mocks'; import { NotificationExecutorOptions } from './types'; jest.mock('./build_signals_query'); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/rules_notification_alert_type.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/rules_notification_alert_type.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/rules_notification_alert_type.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/rules_notification_alert_type.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/schedule_notification_actions.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/schedule_notification_actions.ts similarity index 92% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/schedule_notification_actions.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/schedule_notification_actions.ts index 9f145af79ca90f..a0bd5e092c6eab 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/schedule_notification_actions.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/notifications/schedule_notification_actions.ts @@ -5,7 +5,7 @@ */ import { mapKeys, snakeCase } from 'lodash/fp'; -import { AlertInstance } from '../../../../../../../plugins/alerting/server'; +import { AlertInstance } from '../../../../../alerting/server'; import { RuleTypeParams } from '../types'; export type NotificationRuleTypeParams = RuleTypeParams & { diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/types.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/types.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/types.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/types.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/types.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/types.ts similarity index 95% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/types.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/types.ts index 32a8737adc7c9c..d740b79cb3b940 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/types.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/notifications/types.ts @@ -10,8 +10,8 @@ import { AlertType, State, AlertExecutorOptions, -} from '../../../../../../../plugins/alerting/server'; -import { Alert } from '../../../../../../../plugins/alerting/common'; +} from '../../../../../alerting/server'; +import { Alert } from '../../../../../alerting/common'; import { NOTIFICATIONS_ID } from '../../../../common/constants'; import { RuleAlertAction } from '../../../../common/detection_engine/types'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/update_notifications.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/update_notifications.test.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/update_notifications.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/update_notifications.test.ts index e1f7526438c31a..b9dc42b96696d2 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/update_notifications.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/notifications/update_notifications.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { alertsClientMock } from '../../../../../../../plugins/alerting/server/mocks'; +import { alertsClientMock } from '../../../../../alerting/server/mocks'; import { updateNotifications } from './update_notifications'; import { readNotifications } from './read_notifications'; import { createNotifications } from './create_notifications'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/update_notifications.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/update_notifications.ts similarity index 95% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/update_notifications.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/update_notifications.ts index ac0de406aceb29..5889b0e4dcfb89 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/update_notifications.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/notifications/update_notifications.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { PartialAlert } from '../../../../../../../plugins/alerting/server'; +import { PartialAlert } from '../../../../../alerting/server'; import { readNotifications } from './read_notifications'; import { UpdateNotificationParams } from './types'; import { addTags } from './add_tags'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/utils.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/utils.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/utils.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/utils.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/utils.ts b/x-pack/plugins/siem/server/lib/detection_engine/notifications/utils.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/notifications/utils.ts rename to x-pack/plugins/siem/server/lib/detection_engine/notifications/utils.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/privileges/read_privileges.ts b/x-pack/plugins/siem/server/lib/detection_engine/privileges/read_privileges.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/privileges/read_privileges.ts rename to x-pack/plugins/siem/server/lib/detection_engine/privileges/read_privileges.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/index.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/index.ts similarity index 59% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/index.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/index.ts index 1ccd43c06aacc7..a28eb6ba3ccaa9 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/index.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/index.ts @@ -4,6 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ +import { DEFAULT_SIGNALS_INDEX, SIGNALS_INDEX_KEY } from '../../../../../common/constants'; import { requestContextMock } from './request_context'; import { serverMock } from './server'; import { requestMock } from './request'; @@ -11,7 +12,11 @@ import { responseMock } from './response_factory'; export { requestMock, requestContextMock, responseMock, serverMock }; -export const createMockConfig = () => () => ({ - get: jest.fn(), - has: jest.fn(), +export const createMockConfig = () => ({ + enabled: true, + [SIGNALS_INDEX_KEY]: DEFAULT_SIGNALS_INDEX, + maxRuleImportExportSize: 10000, + maxRuleImportPayloadBytes: 10485760, + maxTimelineImportExportSize: 10000, + maxTimelineImportPayloadBytes: 10485760, }); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/request.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/request.ts similarity index 79% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/request.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/request.ts index 8856a3463aab3c..5f9246db7dfd5d 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/request.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/request.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { httpServerMock } from '../../../../../../../../../src/core/server/mocks'; +import { httpServerMock } from '../../../../../../../../src/core/server/mocks'; export const requestMock = { create: httpServerMock.createKibanaRequest, diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/request_context.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/request_context.ts similarity index 79% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/request_context.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/request_context.ts index 2e5c29bc0221ae..10efdb518f7b7e 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/request_context.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/request_context.ts @@ -4,15 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ -import { RequestHandlerContext } from '../../../../../../../../../src/core/server'; +import { RequestHandlerContext } from '../../../../../../../../src/core/server'; import { coreMock, elasticsearchServiceMock, savedObjectsClientMock, -} from '../../../../../../../../../src/core/server/mocks'; -import { alertsClientMock } from '../../../../../../../../plugins/alerting/server/mocks'; -import { actionsClientMock } from '../../../../../../../../plugins/actions/server/mocks'; -import { licensingMock } from '../../../../../../../../plugins/licensing/server/mocks'; +} from '../../../../../../../../src/core/server/mocks'; +import { alertsClientMock } from '../../../../../../alerting/server/mocks'; +import { actionsClientMock } from '../../../../../../actions/server/mocks'; +import { licensingMock } from '../../../../../../licensing/server/mocks'; const createMockClients = () => ({ actionsClient: actionsClientMock.create(), diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/request_responses.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/request_responses.ts similarity index 99% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/request_responses.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/request_responses.ts index 94097df48949f0..8c97d4436a561f 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/request_responses.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/request_responses.ts @@ -5,7 +5,7 @@ */ import { SavedObjectsFindResponse } from 'kibana/server'; -import { ActionResult } from '../../../../../../../../plugins/actions/server'; +import { ActionResult } from '../../../../../../actions/server'; import { SignalsStatusRestParams, SignalsQueryRestParams, @@ -448,7 +448,7 @@ export const getResult = (): RuleAlertType => ({ references: ['http://www.example.com', 'https://ww.example.com'], note: '# Investigative notes', version: 1, - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/response_factory.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/response_factory.ts similarity index 79% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/response_factory.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/response_factory.ts index 3e0eda9961403c..e6c03d382d9dba 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/response_factory.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/response_factory.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { httpServerMock } from '../../../../../../../../../src/core/server/mocks'; +import { httpServerMock } from '../../../../../../../../src/core/server/mocks'; export const responseMock = { create: httpServerMock.createResponseFactory, diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/server.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/server.ts similarity index 95% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/server.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/server.ts index 824d1f2bec3346..c08e626adb3230 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/server.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/server.ts @@ -9,8 +9,8 @@ import { RouteConfig, KibanaRequest, RequestHandlerContext, -} from '../../../../../../../../../src/core/server'; -import { httpServiceMock } from '../../../../../../../../../src/core/server/mocks'; +} from '../../../../../../../../src/core/server'; +import { httpServiceMock } from '../../../../../../../../src/core/server/mocks'; import { requestContextMock } from './request_context'; import { responseMock as responseFactoryMock } from './response_factory'; import { requestMock } from '.'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/test_adapters.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/test_adapters.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/test_adapters.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/test_adapters.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/utils.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/utils.ts similarity index 99% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/utils.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/utils.ts index c929b0718207d6..6f628170271f31 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/__mocks__/utils.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/__mocks__/utils.ts @@ -138,7 +138,7 @@ export const getOutputRuleAlertForRest = (): Omit< ], }, ], - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/index/create_index_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/index/create_index_route.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/index/create_index_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/index/create_index_route.ts index 3195483013c19d..cb48e352288586 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/index/create_index_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/index/create_index_route.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_INDEX_URL } from '../../../../../common/constants'; import { transformError, buildSiemResponse } from '../utils'; import { getIndexExists } from '../../index/get_index_exists'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/index/delete_index_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/index/delete_index_route.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/index/delete_index_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/index/delete_index_route.ts index c667e7ae9c4635..5eff38b778492e 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/index/delete_index_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/index/delete_index_route.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_INDEX_URL } from '../../../../../common/constants'; import { transformError, buildSiemResponse } from '../utils'; import { getIndexExists } from '../../index/get_index_exists'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/index/ecs_mapping.json b/x-pack/plugins/siem/server/lib/detection_engine/routes/index/ecs_mapping.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/index/ecs_mapping.json rename to x-pack/plugins/siem/server/lib/detection_engine/routes/index/ecs_mapping.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/index/get_signals_template.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/index/get_signals_template.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/index/get_signals_template.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/index/get_signals_template.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/index/get_signals_template.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/index/get_signals_template.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/index/get_signals_template.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/index/get_signals_template.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/index/read_index_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/index/read_index_route.ts similarity index 95% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/index/read_index_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/index/read_index_route.ts index 047176f1556116..8ff8d7461ecd11 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/index/read_index_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/index/read_index_route.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_INDEX_URL } from '../../../../../common/constants'; import { transformError, buildSiemResponse } from '../utils'; import { getIndexExists } from '../../index/get_index_exists'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/index/signals_mapping.json b/x-pack/plugins/siem/server/lib/detection_engine/routes/index/signals_mapping.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/index/signals_mapping.json rename to x-pack/plugins/siem/server/lib/detection_engine/routes/index/signals_mapping.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/index/signals_policy.json b/x-pack/plugins/siem/server/lib/detection_engine/routes/index/signals_policy.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/index/signals_policy.json rename to x-pack/plugins/siem/server/lib/detection_engine/routes/index/signals_policy.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.test.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.test.ts index 3209f5ce9f5198..ce44f71ef72177 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { securityMock } from '../../../../../../../../plugins/security/server/mocks'; +import { securityMock } from '../../../../../../security/server/mocks'; import { readPrivilegesRoute } from './read_privileges_route'; import { serverMock, requestContextMock } from '../__mocks__'; import { getPrivilegeRequest, getMockPrivilegesResult } from '../__mocks__/request_responses'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.ts similarity index 96% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.ts index d86880de653865..7dbbe837e656d9 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/privileges/read_privileges_route.ts @@ -6,7 +6,7 @@ import { merge } from 'lodash/fp'; -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_PRIVILEGES_URL } from '../../../../../common/constants'; import { SetupPlugins } from '../../../../plugin'; import { buildSiemResponse, transformError } from '../utils'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.ts index 3eba04debb21f1..bfc8c9c54b2c04 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/add_prepackaged_rules_route.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_PREPACKAGED_URL } from '../../../../../common/constants'; import { getIndexExists } from '../../index/get_index_exists'; import { transformError, buildSiemResponse } from '../utils'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_bulk_route.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_bulk_route.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_bulk_route.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_bulk_route.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_bulk_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_bulk_route.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_bulk_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_bulk_route.ts index 5377e9039785e8..2d7ddb79e5af55 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_bulk_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_bulk_route.ts @@ -6,7 +6,7 @@ import uuid from 'uuid'; -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; import { createRules } from '../../rules/create_rules'; import { RuleAlertParamsRest } from '../../types'; @@ -86,7 +86,7 @@ export const createRulesBulkRoute = (router: IRouter) => { timeline_id: timelineId, timeline_title: timelineTitle, version, - lists, + exceptions_list, } = payloadRule; const ruleIdOrUuid = ruleId ?? uuid.v4(); try { @@ -143,7 +143,7 @@ export const createRulesBulkRoute = (router: IRouter) => { references, note, version, - lists, + exceptions_list, actions: throttle === 'rule' ? actions : [], // Only enable actions if throttle is set to rule, otherwise we are a notification and should not enable it, }); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_route.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_route.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_route.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_route.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_route.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_route.ts index 9a329b78b8f129..1f0896686aca05 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/create_rules_route.ts @@ -6,7 +6,7 @@ import uuid from 'uuid'; -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; import { createRules } from '../../rules/create_rules'; import { IRuleSavedAttributesSavedObjectAttributes } from '../../rules/types'; @@ -66,7 +66,7 @@ export const createRulesRoute = (router: IRouter): void => { type, references, note, - lists, + exceptions_list, } = request.body; const siemResponse = buildSiemResponse(response); @@ -131,7 +131,7 @@ export const createRulesRoute = (router: IRouter): void => { references, note, version: 1, - lists, + exceptions_list, actions: throttle === 'rule' ? actions : [], // Only enable actions if throttle is rule, otherwise we are a notification and should not enable it, }); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_bulk_route.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_bulk_route.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_bulk_route.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_bulk_route.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_bulk_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_bulk_route.ts similarity index 99% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_bulk_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_bulk_route.ts index 0c5ad2e060924e..38748e287ab451 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_bulk_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_bulk_route.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter, RouteConfig, RequestHandler } from '../../../../../../../../../src/core/server'; +import { IRouter, RouteConfig, RequestHandler } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; import { queryRulesBulkSchema } from '../schemas/query_rules_bulk_schema'; import { rulesBulkSchema } from '../schemas/response/rules_bulk_schema'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_route.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_route.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_route.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_route.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_route.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_route.ts index 71724e3ba9b58c..098d556741fed5 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/delete_rules_route.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; import { deleteRules } from '../../rules/delete_rules'; import { queryRulesSchema } from '../schemas/query_rules_schema'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/export_rules_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/export_rules_route.ts similarity index 90% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/export_rules_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/export_rules_route.ts index 50eafe163c2658..8433b74adf3100 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/export_rules_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/export_rules_route.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; -import { LegacyServices } from '../../../../types'; +import { ConfigType } from '../../../..'; import { ExportRulesRequestParams } from '../../rules/types'; import { getNonPackagedRulesCount } from '../../rules/get_existing_prepackaged_rules'; import { exportRulesSchema, exportRulesQuerySchema } from '../schemas/export_rules_schema'; @@ -14,7 +14,7 @@ import { getExportByObjectIds } from '../../rules/get_export_by_object_ids'; import { getExportAll } from '../../rules/get_export_all'; import { transformError, buildRouteValidation, buildSiemResponse } from '../utils'; -export const exportRulesRoute = (router: IRouter, config: LegacyServices['config']) => { +export const exportRulesRoute = (router: IRouter, config: ConfigType) => { router.post( { path: `${DETECTION_ENGINE_RULES_URL}/_export`, @@ -35,7 +35,7 @@ export const exportRulesRoute = (router: IRouter, config: LegacyServices['config } try { - const exportSizeLimit = config().get('savedObjects.maxImportExportSize'); + const exportSizeLimit = config.maxRuleImportExportSize; if (request.body?.objects != null && request.body.objects.length > exportSizeLimit) { return siemResponse.error({ statusCode: 400, diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_route.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_route.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_route.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_route.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_route.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_route.ts index 85555c1a57084e..9661fac81497cb 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_route.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; import { findRules } from '../../rules/find_rules'; import { diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_status_route.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_status_route.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_status_route.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_status_route.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_status_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_status_route.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_status_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_status_route.ts index 8eed1465377185..6b54a25a1b1c47 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_status_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/find_rules_status_route.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; import { findRulesStatusesSchema } from '../schemas/find_rules_statuses_schema'; import { diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/get_prepackaged_rules_status_route.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/get_prepackaged_rules_status_route.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/get_prepackaged_rules_status_route.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/get_prepackaged_rules_status_route.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/get_prepackaged_rules_status_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/get_prepackaged_rules_status_route.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/get_prepackaged_rules_status_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/get_prepackaged_rules_status_route.ts index 7f0bf4bf811796..67a54f3ba492a5 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/get_prepackaged_rules_status_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/get_prepackaged_rules_status_route.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_PREPACKAGED_URL } from '../../../../../common/constants'; import { transformError, buildSiemResponse } from '../utils'; import { getPrepackagedRules } from '../../rules/get_prepackaged_rules'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/import_rules_route.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/import_rules_route.test.ts similarity index 95% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/import_rules_route.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/import_rules_route.test.ts index 61f5e6faf1bdb0..8c052cfdf4024b 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/import_rules_route.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/import_rules_route.test.ts @@ -23,7 +23,6 @@ import { } from '../__mocks__/request_responses'; import { createMockConfig, requestContextMock, serverMock, requestMock } from '../__mocks__'; import { importRulesRoute } from './import_rules_route'; -import { DEFAULT_SIGNALS_INDEX } from '../../../../../common/constants'; import * as createRulesStreamFromNdJson from '../../rules/create_rules_stream_from_ndjson'; import { setFeatureFlagsForTestsOnly, unSetFeatureFlagsForTestsOnly } from '../../feature_flags'; @@ -36,7 +35,7 @@ describe('import_rules_route', () => { unSetFeatureFlagsForTestsOnly(); }); - let config = createMockConfig(); + let config: ReturnType; let server: ReturnType; let request: ReturnType; let { clients, context } = requestContextMock.createTools(); @@ -51,30 +50,10 @@ describe('import_rules_route', () => { server = serverMock.create(); ({ clients, context } = requestContextMock.createTools()); + config = createMockConfig(); const hapiStream = buildHapiStream(ruleIdsToNdJsonString(['rule-1'])); request = getImportRulesRequest(hapiStream); - config = () => ({ - get: jest.fn(value => { - switch (value) { - case 'savedObjects.maxImportPayloadBytes': { - return 10000; - } - case 'savedObjects.maxImportExportSize': { - return 10000; - } - case 'xpack.siem.signalsIndex': { - return DEFAULT_SIGNALS_INDEX; - } - default: { - const dummyMock = jest.fn(); - return dummyMock(); - } - } - }), - has: jest.fn(), - }); - clients.clusterClient.callAsCurrentUser.mockResolvedValue(getNonEmptyIndex()); // index exists clients.alertsClient.find.mockResolvedValue(getEmptyFindResult()); // no extant rules diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/import_rules_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/import_rules_route.ts similarity index 95% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/import_rules_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/import_rules_route.ts index 57ccc7a7806ac0..527fab786910fc 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/import_rules_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/import_rules_route.ts @@ -7,10 +7,10 @@ import { chunk } from 'lodash/fp'; import { extname } from 'path'; -import { IRouter } from '../../../../../../../../../src/core/server'; -import { createPromiseFromStreams } from '../../../../../../../../../src/legacy/utils/streams'; +import { IRouter } from '../../../../../../../../src/core/server'; +import { createPromiseFromStreams } from '../../../../../../../../src/legacy/utils/streams'; import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; -import { LegacyServices } from '../../../../types'; +import { ConfigType } from '../../../..'; import { createRules } from '../../rules/create_rules'; import { ImportRulesRequestParams } from '../../rules/types'; import { readRules } from '../../rules/read_rules'; @@ -38,7 +38,7 @@ type PromiseFromStreams = ImportRuleAlertRest | Error; const CHUNK_PARSED_OBJECT_SIZE = 10; -export const importRulesRoute = (router: IRouter, config: LegacyServices['config']) => { +export const importRulesRoute = (router: IRouter, config: ConfigType) => { router.post( { path: `${DETECTION_ENGINE_RULES_URL}/_import`, @@ -49,7 +49,7 @@ export const importRulesRoute = (router: IRouter, config: LegacyServices['config options: { tags: ['access:siem'], body: { - maxBytes: config().get('savedObjects.maxImportPayloadBytes'), + maxBytes: config.maxRuleImportPayloadBytes, output: 'stream', }, }, @@ -77,7 +77,7 @@ export const importRulesRoute = (router: IRouter, config: LegacyServices['config }); } - const objectLimit = config().get('savedObjects.maxImportExportSize'); + const objectLimit = config.maxRuleImportExportSize; const readStream = createRulesStreamFromNdJson(objectLimit); const parsedObjects = await createPromiseFromStreams([ request.body.file, @@ -138,7 +138,7 @@ export const importRulesRoute = (router: IRouter, config: LegacyServices['config timeline_id: timelineId, timeline_title: timelineTitle, version, - lists, + exceptions_list, } = parsedRule; try { @@ -195,7 +195,7 @@ export const importRulesRoute = (router: IRouter, config: LegacyServices['config references, note, version, - lists, + exceptions_list, actions: [], // Actions are not imported nor exported at this time }); resolve({ rule_id: ruleId, status_code: 200 }); @@ -232,7 +232,7 @@ export const importRulesRoute = (router: IRouter, config: LegacyServices['config references, note, version, - lists, + exceptions_list, anomalyThreshold, machineLearningJobId, }); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.ts index 8c0fceb7a5f295..e4236f4632dcd0 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_bulk_route.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; import { IRuleSavedAttributesSavedObjectAttributes, diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_route.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_route.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_route.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_route.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_route.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_route.ts index 9c5000d70e5fe8..23469144e11f8b 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/patch_rules_route.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; import { patchRules } from '../../rules/patch_rules'; import { diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/read_rules_route.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/read_rules_route.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/read_rules_route.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/read_rules_route.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/read_rules_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/read_rules_route.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/read_rules_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/read_rules_route.ts index 77747448e94fdc..4d23e0217f2e8b 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/read_rules_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/read_rules_route.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; import { getIdError } from './utils'; import { transformValidate } from './validate'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_bulk_route.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_bulk_route.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_bulk_route.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_bulk_route.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_bulk_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_bulk_route.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_bulk_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_bulk_route.ts index 36e15780f5cb3f..6db91d74294fc6 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_bulk_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_bulk_route.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; import { IRuleSavedAttributesSavedObjectAttributes, @@ -81,7 +81,7 @@ export const updateRulesBulkRoute = (router: IRouter) => { references, note, version, - lists, + exceptions_list, } = payloadRule; const finalIndex = outputIndex ?? siemClient.signalsIndex; const idOrRuleIdOrUnknown = id ?? ruleId ?? '(unknown id)'; @@ -121,7 +121,7 @@ export const updateRulesBulkRoute = (router: IRouter) => { references, note, version, - lists, + exceptions_list, actions, }); if (rule != null) { diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_route.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_route.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_route.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_route.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_route.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_route.ts index 0444c757a9b316..7dbbe5a22ab46a 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/update_rules_route.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_RULES_URL } from '../../../../../common/constants'; import { UpdateRuleAlertParamsRest, @@ -67,7 +67,7 @@ export const updateRulesRoute = (router: IRouter) => { references, note, version, - lists, + exceptions_list, } = request.body; const siemResponse = buildSiemResponse(response); @@ -117,7 +117,7 @@ export const updateRulesRoute = (router: IRouter) => { references, note, version, - lists, + exceptions_list, actions: throttle === 'rule' ? actions : [], // Only enable actions if throttle is rule, otherwise we are a notification and should not enable it }); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/utils.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/utils.test.ts similarity index 99% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/utils.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/utils.test.ts index 8b1b0cab3b2f2f..ec9e84d4fa6bbb 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/utils.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/utils.test.ts @@ -22,12 +22,12 @@ import { INTERNAL_IDENTIFIER } from '../../../../../common/constants'; import { ImportRuleAlertRest, RuleAlertParamsRest, RuleTypeParams } from '../../types'; import { BulkError, ImportSuccessError } from '../utils'; import { getSimpleRule, getOutputRuleAlertForRest } from '../__mocks__/utils'; -import { createPromiseFromStreams } from '../../../../../../../../../src/legacy/utils/streams'; -import { PartialAlert } from '../../../../../../../../plugins/alerting/server'; -import { SanitizedAlert } from '../../../../../../../../plugins/alerting/server/types'; +import { createPromiseFromStreams } from '../../../../../../../../src/legacy/utils/streams'; +import { PartialAlert } from '../../../../../../alerting/server'; +import { SanitizedAlert } from '../../../../../../alerting/server/types'; +import { createRulesStreamFromNdJson } from '../../rules/create_rules_stream_from_ndjson'; import { RuleAlertType } from '../../rules/types'; import { setFeatureFlagsForTestsOnly, unSetFeatureFlagsForTestsOnly } from '../../feature_flags'; -import { createRulesStreamFromNdJson } from '../../rules/create_rules_stream_from_ndjson'; type PromiseFromStreams = ImportRuleAlertRest | Error; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/utils.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/utils.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/utils.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/utils.ts index 790603fa8cfc1c..67b0c4462655c2 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/utils.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/utils.ts @@ -8,7 +8,7 @@ import { pickBy, countBy } from 'lodash/fp'; import { SavedObject, SavedObjectsFindResponse } from 'kibana/server'; import uuid from 'uuid'; -import { PartialAlert, FindResult } from '../../../../../../../../plugins/alerting/server'; +import { PartialAlert, FindResult } from '../../../../../../alerting/server'; import { INTERNAL_IDENTIFIER } from '../../../../../common/constants'; import { RuleAlertType, @@ -148,7 +148,7 @@ export const transformAlertToRule = ( last_failure_message: ruleStatus?.attributes.lastFailureMessage, last_success_message: ruleStatus?.attributes.lastSuccessMessage, // TODO: (LIST-FEATURE) Remove hasListsFeature() check once we have lists available for a release - lists: hasListsFeature() ? alert.params.lists : null, + exceptions_list: hasListsFeature() ? alert.params.exceptions_list : null, }); }; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/validate.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/validate.test.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/validate.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/validate.test.ts index 7537401e5a3667..9069202d4d3aa5 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/validate.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/validate.test.ts @@ -13,7 +13,7 @@ import { transformValidateBulkError, } from './validate'; import { getResult } from '../__mocks__/request_responses'; -import { FindResult } from '../../../../../../../../plugins/alerting/server'; +import { FindResult } from '../../../../../../alerting/server'; import { RulesSchema } from '../schemas/response/rules_schema'; import { BulkError } from '../utils'; import { setFeatureFlagsForTestsOnly, unSetFeatureFlagsForTestsOnly } from '../../feature_flags'; @@ -71,7 +71,7 @@ export const ruleOutput: RulesSchema = { }, }, ], - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/validate.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/validate.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/validate.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/rules/validate.ts index 1f3d1ec8566848..c207d075331b6e 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/rules/validate.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/rules/validate.ts @@ -9,7 +9,7 @@ import { fold } from 'fp-ts/lib/Either'; import { pipe } from 'fp-ts/lib/pipeable'; import * as t from 'io-ts'; -import { PartialAlert, FindResult } from '../../../../../../../../plugins/alerting/server'; +import { PartialAlert, FindResult } from '../../../../../../alerting/server'; import { formatErrors } from '../schemas/response/utils'; import { isAlertType, diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/add_prepackaged_rules_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/add_prepackaged_rules_schema.test.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/add_prepackaged_rules_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/add_prepackaged_rules_schema.test.ts index 8c741c937bf159..226dea7c20344b 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/add_prepackaged_rules_schema.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/add_prepackaged_rules_schema.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AlertAction } from '../../../../../../../../plugins/alerting/common'; +import { AlertAction } from '../../../../../../alerting/common'; import { RuleAlertAction } from '../../../../../common/detection_engine/types'; import { ThreatParams, PrepackagedRules } from '../../types'; import { addPrepackagedRulesSchema } from './add_prepackaged_rules_schema'; @@ -1542,8 +1542,8 @@ describe('add prepackaged rules schema', () => { // on demand. Since they are per module, we have a an issue where the ENV variables do not take effect. It is better we change all the // schema's to be function calls to avoid global side effects or just wait until the feature is available. If you want to test this early, // you can remove the .skip and set your env variable of export ELASTIC_XPACK_SIEM_LISTS_FEATURE=true locally - describe.skip('lists', () => { - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and lists] does validate', () => { + describe.skip('exceptions_list', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and exceptions_list] does validate', () => { expect( addPrepackagedRulesSchema.validate>({ rule_id: 'rule-1', @@ -1558,7 +1558,7 @@ describe('add prepackaged rules schema', () => { risk_score: 50, note: '# some markdown', version: 1, - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', @@ -1594,7 +1594,7 @@ describe('add prepackaged rules schema', () => { ).toBeFalsy(); }); - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and empty lists] does validate', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and empty exceptions_list] does validate', () => { expect( addPrepackagedRulesSchema.validate>({ rule_id: 'rule-1', @@ -1608,15 +1608,15 @@ describe('add prepackaged rules schema', () => { type: 'query', risk_score: 50, note: '# some markdown', - lists: [], + exceptions_list: [], version: 1, }).error ).toBeFalsy(); }); - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and invalid lists] does NOT validate', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and invalid exceptions_list] does NOT validate', () => { expect( - addPrepackagedRulesSchema.validate>>({ + addPrepackagedRulesSchema.validate>>({ rule_id: 'rule-1', description: 'some description', from: 'now-5m', @@ -1628,17 +1628,17 @@ describe('add prepackaged rules schema', () => { type: 'query', risk_score: 50, note: '# some markdown', - lists: [{ invalid_value: 'invalid value' }], + exceptions_list: [{ invalid_value: 'invalid value' }], version: 1, }).error.message ).toEqual( - 'child "lists" fails because ["lists" at position 0 fails because [child "field" fails because ["field" is required]]]' + 'child "exceptions_list" fails because ["exceptions_list" at position 0 fails because [child "field" fails because ["field" is required]]]' ); }); - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and non-existent lists] does validate with empty lists', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and non-existent exceptions_list] does validate with empty exceptions_list', () => { expect( - addPrepackagedRulesSchema.validate>>({ + addPrepackagedRulesSchema.validate>>({ rule_id: 'rule-1', description: 'some description', from: 'now-5m', @@ -1651,7 +1651,7 @@ describe('add prepackaged rules schema', () => { risk_score: 50, note: '# some markdown', version: 1, - }).value.lists + }).value.exceptions_list ).toEqual([]); }); }); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/add_prepackaged_rules_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/add_prepackaged_rules_schema.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/add_prepackaged_rules_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/add_prepackaged_rules_schema.ts index 006fc81e3ee87a..0e82a9b979c7b9 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/add_prepackaged_rules_schema.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/add_prepackaged_rules_schema.ts @@ -114,5 +114,5 @@ export const addPrepackagedRulesSchema = Joi.object({ version: version.required(), // TODO: (LIST-FEATURE) Remove the hasListsFeatures once this is ready for release - lists: hasListsFeature() ? lists.default([]) : lists.forbidden().default([]), + exceptions_list: hasListsFeature() ? lists.default([]) : lists.forbidden().default([]), }); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_bulk_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_bulk_schema.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_bulk_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_bulk_schema.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_bulk_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_bulk_schema.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_bulk_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_bulk_schema.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_schema.test.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_schema.test.ts index e56e8e5fe34d31..1e2941015b7355 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_schema.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_schema.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AlertAction } from '../../../../../../../../plugins/alerting/common'; +import { AlertAction } from '../../../../../../alerting/common'; import { createRulesSchema } from './create_rules_schema'; import { PatchRuleAlertParamsRest } from '../../rules/types'; import { RuleAlertAction } from '../../../../../common/detection_engine/types'; @@ -556,7 +556,9 @@ describe('create rules schema', () => { test('language does not validate with something made up', () => { expect( - createRulesSchema.validate>({ + createRulesSchema.validate< + Partial & { language: string }> + >({ rule_id: 'rule-1', output_index: '.siem-signals', risk_score: 50, @@ -1508,8 +1510,8 @@ describe('create rules schema', () => { // on demand. Since they are per module, we have a an issue where the ENV variables do not take effect. It is better we change all the // schema's to be function calls to avoid global side effects or just wait until the feature is available. If you want to test this early, // you can remove the .skip and set your env variable of export ELASTIC_XPACK_SIEM_LISTS_FEATURE=true locally - describe.skip('lists', () => { - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and lists] does validate', () => { + describe.skip('exceptions_list', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and exceptions_list] does validate', () => { expect( createRulesSchema.validate>({ rule_id: 'rule-1', @@ -1523,7 +1525,7 @@ describe('create rules schema', () => { type: 'query', risk_score: 50, note: '# some markdown', - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', @@ -1559,7 +1561,7 @@ describe('create rules schema', () => { ).toBeFalsy(); }); - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and empty lists] does validate', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and empty exceptions_list] does validate', () => { expect( createRulesSchema.validate>({ rule_id: 'rule-1', @@ -1573,14 +1575,14 @@ describe('create rules schema', () => { type: 'query', risk_score: 50, note: '# some markdown', - lists: [], + exceptions_list: [], }).error ).toBeFalsy(); }); - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and invalid lists] does NOT validate', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and invalid exceptions_list] does NOT validate', () => { expect( - createRulesSchema.validate>>({ + createRulesSchema.validate>>({ rule_id: 'rule-1', description: 'some description', from: 'now-5m', @@ -1592,16 +1594,16 @@ describe('create rules schema', () => { type: 'query', risk_score: 50, note: '# some markdown', - lists: [{ invalid_value: 'invalid value' }], + exceptions_list: [{ invalid_value: 'invalid value' }], }).error.message ).toEqual( - 'child "lists" fails because ["lists" at position 0 fails because [child "field" fails because ["field" is required]]]' + 'child "exceptions_list" fails because ["exceptions_list" at position 0 fails because [child "field" fails because ["field" is required]]]' ); }); - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and non-existent lists] does validate with empty lists', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and non-existent exceptions_list] does validate with empty exceptions_list', () => { expect( - createRulesSchema.validate>>({ + createRulesSchema.validate>>({ rule_id: 'rule-1', description: 'some description', from: 'now-5m', @@ -1613,7 +1615,7 @@ describe('create rules schema', () => { type: 'query', risk_score: 50, note: '# some markdown', - }).value.lists + }).value.exceptions_list ).toEqual([]); }); }); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_schema.ts similarity index 96% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_schema.ts index 5213f3faaf4865..dec8b5ccbc790e 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_schema.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/create_rules_schema.ts @@ -98,5 +98,5 @@ export const createRulesSchema = Joi.object({ version: version.default(1), // TODO: (LIST-FEATURE) Remove the hasListsFeatures once this is ready for release - lists: hasListsFeature() ? lists.default([]) : lists.forbidden().default([]), + exceptions_list: hasListsFeature() ? lists.default([]) : lists.forbidden().default([]), }); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/export_rules_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/export_rules_schema.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/export_rules_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/export_rules_schema.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/export_rules_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/export_rules_schema.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/export_rules_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/export_rules_schema.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/find_rules_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/find_rules_schema.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/find_rules_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/find_rules_schema.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/find_rules_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/find_rules_schema.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/find_rules_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/find_rules_schema.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/find_rules_statuses_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/find_rules_statuses_schema.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/find_rules_statuses_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/find_rules_statuses_schema.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/import_rules_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/import_rules_schema.test.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/import_rules_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/import_rules_schema.test.ts index 40f7b19ea12b3e..d28530ffb789e3 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/import_rules_schema.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/import_rules_schema.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AlertAction } from '../../../../../../../../plugins/alerting/common'; +import { AlertAction } from '../../../../../../alerting/common'; import { importRulesSchema, importRulesQuerySchema, @@ -1729,8 +1729,8 @@ describe('import rules schema', () => { // on demand. Since they are per module, we have a an issue where the ENV variables do not take effect. It is better we change all the // schema's to be function calls to avoid global side effects or just wait until the feature is available. If you want to test this early, // you can remove the .skip and set your env variable of export ELASTIC_XPACK_SIEM_LISTS_FEATURE=true locally - describe.skip('lists', () => { - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and lists] does validate', () => { + describe.skip('exceptions_list', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and exceptions_list] does validate', () => { expect( importRulesSchema.validate>({ rule_id: 'rule-1', @@ -1744,7 +1744,7 @@ describe('import rules schema', () => { type: 'query', risk_score: 50, note: '# some markdown', - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', @@ -1780,7 +1780,7 @@ describe('import rules schema', () => { ).toBeFalsy(); }); - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and empty lists] does validate', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and empty exceptions_list] does validate', () => { expect( importRulesSchema.validate>({ rule_id: 'rule-1', @@ -1794,14 +1794,14 @@ describe('import rules schema', () => { type: 'query', risk_score: 50, note: '# some markdown', - lists: [], + exceptions_list: [], }).error ).toBeFalsy(); }); - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and invalid lists] does NOT validate and lists is empty', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and invalid exceptions_list] does NOT validate and exceptions_list is empty', () => { expect( - importRulesSchema.validate>>({ + importRulesSchema.validate>>({ rule_id: 'rule-1', description: 'some description', from: 'now-5m', @@ -1813,16 +1813,16 @@ describe('import rules schema', () => { type: 'query', risk_score: 50, note: '# some markdown', - lists: [{ invalid_value: 'invalid value' }], + exceptions_list: [{ invalid_value: 'invalid value' }], }).error.message ).toEqual( - 'child "lists" fails because ["lists" at position 0 fails because [child "field" fails because ["field" is required]]]' + 'child "exceptions_list" fails because ["exceptions_list" at position 0 fails because [child "field" fails because ["field" is required]]]' ); }); - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and non-existent lists] does validate', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and non-existent exceptions_list] does validate', () => { expect( - importRulesSchema.validate>>({ + importRulesSchema.validate>>({ rule_id: 'rule-1', description: 'some description', from: 'now-5m', @@ -1834,7 +1834,7 @@ describe('import rules schema', () => { type: 'query', risk_score: 50, note: '# some markdown', - }).value.lists + }).value.exceptions_list ).toEqual([]); }); }); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/import_rules_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/import_rules_schema.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/import_rules_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/import_rules_schema.ts index 56aa45659fda7e..d3c728ebac1a9d 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/import_rules_schema.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/import_rules_schema.ts @@ -119,7 +119,7 @@ export const importRulesSchema = Joi.object({ updated_by, // TODO: (LIST-FEATURE) Remove the hasListsFeatures once this is ready for release - lists: hasListsFeature() ? lists.default([]) : lists.forbidden().default([]), + exceptions_list: hasListsFeature() ? lists.default([]) : lists.forbidden().default([]), }); export const importRulesQuerySchema = Joi.object({ diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_bulk_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_bulk_schema.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_bulk_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_bulk_schema.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_bulk_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_bulk_schema.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_bulk_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_bulk_schema.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_schema.test.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_schema.test.ts index e01a8f40fcea4a..755c0b2ccaa3f9 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_schema.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_schema.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AlertAction } from '../../../../../../../../plugins/alerting/common'; +import { AlertAction } from '../../../../../../alerting/common'; import { patchRulesSchema } from './patch_rules_schema'; import { PatchRuleAlertParamsRest } from '../../rules/types'; import { RuleAlertAction } from '../../../../../common/detection_engine/types'; @@ -572,7 +572,9 @@ describe('patch rules schema', () => { test('language does not validate with something made up', () => { expect( - patchRulesSchema.validate>({ + patchRulesSchema.validate< + Partial & { language: string }> + >({ id: 'rule-1', description: 'some description', from: 'now-5m', @@ -1211,8 +1213,8 @@ describe('patch rules schema', () => { // on demand. Since they are per module, we have a an issue where the ENV variables do not take effect. It is better we change all the // schema's to be function calls to avoid global side effects or just wait until the feature is available. If you want to test this early, // you can remove the .skip and set your env variable of export ELASTIC_XPACK_SIEM_LISTS_FEATURE=true locally - describe.skip('lists', () => { - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and lists] does validate', () => { + describe.skip('exceptions_list', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and exceptions_list] does validate', () => { expect( patchRulesSchema.validate>({ rule_id: 'rule-1', @@ -1226,7 +1228,7 @@ describe('patch rules schema', () => { type: 'query', risk_score: 50, note: '# some markdown', - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', @@ -1262,11 +1264,11 @@ describe('patch rules schema', () => { ).toBeFalsy(); }); - test('lists can be patched', () => { + test('exceptions_list can be patched', () => { expect( patchRulesSchema.validate>({ rule_id: 'some id', - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', @@ -1299,7 +1301,7 @@ describe('patch rules schema', () => { ).toBeFalsy(); }); - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and empty lists] does validate', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and empty exceptions_list] does validate', () => { expect( patchRulesSchema.validate>({ rule_id: 'rule-1', @@ -1313,14 +1315,14 @@ describe('patch rules schema', () => { type: 'query', risk_score: 50, note: '# some markdown', - lists: [], + exceptions_list: [], }).error ).toBeFalsy(); }); - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and invalid lists] does NOT validate', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and invalid exceptions_list] does NOT validate', () => { expect( - patchRulesSchema.validate>>({ + patchRulesSchema.validate>>({ rule_id: 'rule-1', description: 'some description', from: 'now-5m', @@ -1332,16 +1334,16 @@ describe('patch rules schema', () => { type: 'query', risk_score: 50, note: '# some markdown', - lists: [{ invalid_value: 'invalid value' }], + exceptions_list: [{ invalid_value: 'invalid value' }], }).error.message ).toEqual( - 'child "lists" fails because ["lists" at position 0 fails because [child "field" fails because ["field" is required]]]' + 'child "exceptions_list" fails because ["exceptions_list" at position 0 fails because [child "field" fails because ["field" is required]]]' ); }); - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and non-existent lists] does validate with empty lists', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and non-existent exceptions_list] does validate with empty exceptions_list', () => { expect( - patchRulesSchema.validate>>({ + patchRulesSchema.validate>>({ rule_id: 'rule-1', description: 'some description', from: 'now-5m', @@ -1353,7 +1355,7 @@ describe('patch rules schema', () => { type: 'query', risk_score: 50, note: '# some markdown', - }).value.lists + }).value.exceptions_list ).toEqual([]); }); }); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_schema.ts similarity index 93% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_schema.ts index 52aefa29884c3d..503bc64df237c8 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_schema.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/patch_rules_schema.ts @@ -78,5 +78,5 @@ export const patchRulesSchema = Joi.object({ version, // TODO: (LIST-FEATURE) Remove the hasListsFeatures once this is ready for release - lists: hasListsFeature() ? lists.default([]) : lists.forbidden().default([]), + exceptions_list: hasListsFeature() ? lists.default([]) : lists.forbidden().default([]), }).xor('id', 'rule_id'); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/query_rules_bulk_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/query_rules_bulk_schema.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/query_rules_bulk_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/query_rules_bulk_schema.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/query_rules_bulk_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/query_rules_bulk_schema.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/query_rules_bulk_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/query_rules_bulk_schema.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/query_rules_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/query_rules_schema.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/query_rules_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/query_rules_schema.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/query_rules_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/query_rules_schema.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/query_rules_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/query_rules_schema.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/query_signals_index_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/query_signals_index_schema.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/query_signals_index_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/query_signals_index_schema.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/query_signals_index_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/query_signals_index_schema.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/query_signals_index_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/query_signals_index_schema.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/__mocks__/utils.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/__mocks__/utils.ts similarity index 99% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/__mocks__/utils.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/__mocks__/utils.ts index d5ea950d163f57..21f18f9db55fba 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/__mocks__/utils.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/__mocks__/utils.ts @@ -63,7 +63,7 @@ export const getBaseResponsePayload = (anchorDate: string = ANCHOR_DATE): RulesS language: 'kuery', rule_id: 'query-rule-id', interval: '5m', - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/check_type_dependents.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/check_type_dependents.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/check_type_dependents.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/check_type_dependents.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/check_type_dependents.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/check_type_dependents.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/check_type_dependents.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/check_type_dependents.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/error_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/error_schema.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/error_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/error_schema.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/error_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/error_schema.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/error_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/error_schema.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/exact_check.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/exact_check.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/exact_check.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/exact_check.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/exact_check.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/exact_check.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/exact_check.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/exact_check.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/find_rules_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/find_rules_schema.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/find_rules_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/find_rules_schema.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/find_rules_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/find_rules_schema.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/find_rules_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/find_rules_schema.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/import_rules_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/import_rules_schema.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/import_rules_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/import_rules_schema.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/import_rules_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/import_rules_schema.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/import_rules_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/import_rules_schema.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/prepackaged_rules_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/prepackaged_rules_schema.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/prepackaged_rules_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/prepackaged_rules_schema.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/prepackaged_rules_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/prepackaged_rules_schema.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/prepackaged_rules_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/prepackaged_rules_schema.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/prepackaged_rules_status_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/prepackaged_rules_status_schema.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/prepackaged_rules_status_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/prepackaged_rules_status_schema.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/prepackaged_rules_status_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/prepackaged_rules_status_schema.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/prepackaged_rules_status_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/prepackaged_rules_status_schema.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_bulk_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_bulk_schema.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_bulk_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_bulk_schema.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_bulk_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_bulk_schema.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_bulk_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_bulk_schema.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_schema.test.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_schema.test.ts index fb9ff2c28dc44e..4bfc51c1a66aab 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_schema.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_schema.test.ts @@ -207,7 +207,7 @@ describe('rules_schema', () => { }); // TODO: (LIST-FEATURE) Remove this test once the feature flag is deployed - test('it should remove lists when we need it to be removed because the feature is off but there exists a list in the data', () => { + test('it should remove exceptions_list when we need it to be removed because the feature is off but there exists a list in the data', () => { const payload = getBaseResponsePayload(); const decoded = rulesSchema.decode(payload); const listRemoved = removeList(decoded); @@ -246,9 +246,9 @@ describe('rules_schema', () => { }); }); - test('it should work with lists that are not there and not cause invalidation or errors', () => { + test('it should work with exceptions_list that are not there and not cause invalidation or errors', () => { const payload = getBaseResponsePayload(); - const { lists, ...payloadWithoutLists } = payload; + const { exceptions_list, ...payloadWithoutLists } = payload; const decoded = rulesSchema.decode(payloadWithoutLists); const listRemoved = removeList(decoded); const message = pipe(listRemoved, foldLeftRight); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_schema.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_schema.ts index 1574e8f5aa6e1c..fb1ee8e670e312 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_schema.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/rules_schema.ts @@ -87,7 +87,7 @@ export const requiredRulesSchema = t.type({ updated_at, created_by, version, - lists: ListsDefaultArray, + exceptions_list: ListsDefaultArray, }); export type RequiredRulesSchema = t.TypeOf; @@ -172,7 +172,7 @@ export const removeList = ( ): Either => { const onLeft = (errors: t.Errors): Either => left(errors); const onRight = (decodedValue: RequiredRulesSchema): Either => { - delete decodedValue.lists; + delete decodedValue.exceptions_list; return right(decodedValue); }; const folded = fold(onLeft, onRight); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/schemas.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/schemas.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/schemas.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/schemas.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/type_timeline_only_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/type_timeline_only_schema.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/type_timeline_only_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/type_timeline_only_schema.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/type_timeline_only_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/type_timeline_only_schema.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/type_timeline_only_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/type_timeline_only_schema.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/utils.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/utils.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/utils.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/utils.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/utils.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/utils.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/response/utils.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/response/utils.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/schemas.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/schemas.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/schemas.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/schemas.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/set_signal_status_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/set_signal_status_schema.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/set_signal_status_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/set_signal_status_schema.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/set_signal_status_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/set_signal_status_schema.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/set_signal_status_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/set_signal_status_schema.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/iso_date_string.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/iso_date_string.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/iso_date_string.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/iso_date_string.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/iso_date_string.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/iso_date_string.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/iso_date_string.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/iso_date_string.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/lists_default_array.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/lists_default_array.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/lists_default_array.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/lists_default_array.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/lists_default_array.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/lists_default_array.ts similarity index 74% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/lists_default_array.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/lists_default_array.ts index 85a38e296494a1..743914ad070a2e 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/lists_default_array.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/lists_default_array.ts @@ -7,10 +7,16 @@ import * as t from 'io-ts'; import { Either } from 'fp-ts/lib/Either'; -import { list_and as listAnd } from '../response/schemas'; +import { + list_and as listAnd, + list_values as listValues, + list_values_operator as listOperator, +} from '../response/schemas'; export type ListsDefaultArrayC = t.Type; -type List = t.TypeOf; +export type List = t.TypeOf; +export type ListValues = t.TypeOf; +export type ListOperator = t.TypeOf; /** * Types the ListsDefaultArray as: diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/positive_integer.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/positive_integer.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/positive_integer.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/positive_integer.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/positive_integer_greater_than_zero.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/positive_integer_greater_than_zero.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/positive_integer_greater_than_zero.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/positive_integer_greater_than_zero.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/positive_integer_greater_than_zero.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/positive_integer_greater_than_zero.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/positive_integer_greater_than_zero.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/positive_integer_greater_than_zero.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/postive_integer.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/postive_integer.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/postive_integer.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/postive_integer.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/references_default_array.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/references_default_array.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/references_default_array.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/references_default_array.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/references_default_array.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/references_default_array.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/references_default_array.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/references_default_array.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/risk_score.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/risk_score.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/risk_score.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/risk_score.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/risk_score.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/risk_score.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/risk_score.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/risk_score.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/uuid.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/uuid.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/uuid.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/uuid.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/uuid.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/uuid.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/types/uuid.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/types/uuid.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_bulk_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_bulk_schema.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_bulk_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_bulk_schema.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_bulk_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_bulk_schema.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_bulk_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_bulk_schema.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_schema.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_schema.test.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_schema.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_schema.test.ts index e8f9aad620ca01..b89df0fc0f3ab2 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_schema.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_schema.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AlertAction } from '../../../../../../../../plugins/alerting/common'; +import { AlertAction } from '../../../../../../alerting/common'; import { updateRulesSchema } from './update_rules_schema'; import { PatchRuleAlertParamsRest } from '../../rules/types'; import { RuleAlertAction } from '../../../../../common/detection_engine/types'; @@ -575,7 +575,9 @@ describe('create rules schema', () => { test('language does not validate with something made up', () => { expect( - updateRulesSchema.validate>({ + updateRulesSchema.validate< + Partial & { language: string }> + >({ rule_id: 'rule-1', output_index: '.siem-signals', risk_score: 50, @@ -1534,8 +1536,8 @@ describe('create rules schema', () => { // on demand. Since they are per module, we have a an issue where the ENV variables do not take effect. It is better we change all the // schema's to be function calls to avoid global side effects or just wait until the feature is available. If you want to test this early, // you can remove the .skip and set your env variable of export ELASTIC_XPACK_SIEM_LISTS_FEATURE=true locally - describe.skip('lists', () => { - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and lists] does validate', () => { + describe.skip('exceptions_list', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and exceptions_list] does validate', () => { expect( updateRulesSchema.validate>({ rule_id: 'rule-1', @@ -1549,7 +1551,7 @@ describe('create rules schema', () => { type: 'query', risk_score: 50, note: '# some markdown', - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', @@ -1582,7 +1584,7 @@ describe('create rules schema', () => { ).toBeFalsy(); }); - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and empty lists] does validate', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and empty exceptions_list] does validate', () => { expect( updateRulesSchema.validate>({ rule_id: 'rule-1', @@ -1596,14 +1598,14 @@ describe('create rules schema', () => { type: 'query', risk_score: 50, note: '# some markdown', - lists: [], + exceptions_list: [], }).error ).toBeFalsy(); }); - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and invalid lists] does NOT validate', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and invalid exceptions_list] does NOT validate', () => { expect( - updateRulesSchema.validate>>({ + updateRulesSchema.validate>>({ rule_id: 'rule-1', description: 'some description', from: 'now-5m', @@ -1615,16 +1617,16 @@ describe('create rules schema', () => { type: 'query', risk_score: 50, note: '# some markdown', - lists: [{ invalid_value: 'invalid value' }], + exceptions_list: [{ invalid_value: 'invalid value' }], }).error.message ).toEqual( - 'child "lists" fails because ["lists" at position 0 fails because [child "field" fails because ["field" is required]]]' + 'child "exceptions_list" fails because ["exceptions_list" at position 0 fails because [child "field" fails because ["field" is required]]]' ); }); - test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and non-existent lists] does validate with empty lists', () => { + test('[rule_id, description, from, to, index, name, severity, interval, type, filter, risk_score, note, and non-existent exceptions_list] does validate with empty exceptions_list', () => { expect( - updateRulesSchema.validate>>({ + updateRulesSchema.validate>>({ rule_id: 'rule-1', description: 'some description', from: 'now-5m', @@ -1636,7 +1638,7 @@ describe('create rules schema', () => { type: 'query', risk_score: 50, note: '# some markdown', - }).value.lists + }).value.exceptions_list ).toEqual([]); }); }); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_schema.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_schema.ts index f842c14f41ae6b..b1b37801b644f5 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_schema.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/schemas/update_rules_schema.ts @@ -107,5 +107,5 @@ export const updateRulesSchema = Joi.object({ version, // TODO: (LIST-FEATURE) Remove the hasListsFeatures once this is ready for release - lists: hasListsFeature() ? lists.default([]) : lists.forbidden().default([]), + exceptions_list: hasListsFeature() ? lists.default([]) : lists.forbidden().default([]), }).xor('id', 'rule_id'); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/signals/open_close_signals.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/signals/open_close_signals.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/signals/open_close_signals.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/signals/open_close_signals.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/signals/open_close_signals_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/signals/open_close_signals_route.ts similarity index 96% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/signals/open_close_signals_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/signals/open_close_signals_route.ts index 2daf63c468593e..c71761fcc39dbd 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/signals/open_close_signals_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/signals/open_close_signals_route.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_SIGNALS_STATUS_URL } from '../../../../../common/constants'; import { SignalsStatusRestParams } from '../../signals/types'; import { setSignalsStatusSchema } from '../schemas/set_signal_status_schema'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/signals/query_signals_route.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/signals/query_signals_route.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/signals/query_signals_route.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/signals/query_signals_route.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/signals/query_signals_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/signals/query_signals_route.ts similarity index 96% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/signals/query_signals_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/signals/query_signals_route.ts index f05f494619b9c0..fd02b3371ed38e 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/signals/query_signals_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/signals/query_signals_route.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_QUERY_SIGNALS_URL } from '../../../../../common/constants'; import { SignalsQueryRestParams } from '../../signals/types'; import { querySignalsSchema } from '../schemas/query_signals_index_schema'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/tags/read_tags_route.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/tags/read_tags_route.ts similarity index 94% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/tags/read_tags_route.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/tags/read_tags_route.ts index adabc62a9456f4..2b885385521dd4 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/tags/read_tags_route.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/tags/read_tags_route.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from '../../../../../../../../../src/core/server'; +import { IRouter } from '../../../../../../../../src/core/server'; import { DETECTION_ENGINE_TAGS_URL } from '../../../../../common/constants'; import { transformError, buildSiemResponse } from '../utils'; import { readTags } from '../../tags/read_tags'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/utils.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/utils.test.ts similarity index 99% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/utils.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/utils.test.ts index 9efe4e491968be..8af5df60569135 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/utils.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/utils.test.ts @@ -23,7 +23,7 @@ import { } from './utils'; import { responseMock } from './__mocks__'; import { setFeatureFlagsForTestsOnly, unSetFeatureFlagsForTestsOnly } from '../feature_flags'; -import { licensingMock } from '../../../../../../../plugins/licensing/server/mocks'; +import { licensingMock } from '../../../../../licensing/server/mocks'; describe('utils', () => { beforeAll(() => { diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/utils.ts b/x-pack/plugins/siem/server/lib/detection_engine/routes/utils.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/utils.ts rename to x-pack/plugins/siem/server/lib/detection_engine/routes/utils.ts index e4015ad8bafa4d..52493a9be9b8fb 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/routes/utils.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/routes/utils.ts @@ -13,8 +13,8 @@ import { RouteValidationFunction, KibanaResponseFactory, CustomHttpResponseOptions, -} from '../../../../../../../../src/core/server'; -import { ILicense } from '../../../../../../../plugins/licensing/server'; +} from '../../../../../../../src/core/server'; +import { ILicense } from '../../../../../licensing/server'; import { MINIMUM_ML_LICENSE } from '../../../../common/constants'; import { RuleType } from '../../../../common/detection_engine/types'; import { isMlRule } from '../../../../common/detection_engine/ml_helpers'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/create_rule_actions_saved_object.ts b/x-pack/plugins/siem/server/lib/detection_engine/rule_actions/create_rule_actions_saved_object.ts similarity index 94% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/create_rule_actions_saved_object.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rule_actions/create_rule_actions_saved_object.ts index 991690d901d8ae..26c3b29ff2c511 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/create_rule_actions_saved_object.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rule_actions/create_rule_actions_saved_object.ts @@ -5,7 +5,7 @@ */ import { RuleAlertAction } from '../../../../common/detection_engine/types'; -import { AlertServices } from '../../../../../../../plugins/alerting/server'; +import { AlertServices } from '../../../../../alerting/server'; import { ruleActionsSavedObjectType } from './saved_object_mappings'; import { IRuleActionsAttributesSavedObjectAttributes } from './types'; import { getThrottleOptions, getRuleActionsFromSavedObject } from './utils'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/delete_rule_actions_saved_object.ts b/x-pack/plugins/siem/server/lib/detection_engine/rule_actions/delete_rule_actions_saved_object.ts similarity index 92% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/delete_rule_actions_saved_object.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rule_actions/delete_rule_actions_saved_object.ts index 91489334940bd1..251f9155f9331c 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/delete_rule_actions_saved_object.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rule_actions/delete_rule_actions_saved_object.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AlertServices } from '../../../../../../../plugins/alerting/server'; +import { AlertServices } from '../../../../../alerting/server'; import { ruleActionsSavedObjectType } from './saved_object_mappings'; import { getRuleActionsSavedObject } from './get_rule_actions_saved_object'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/get_rule_actions_saved_object.ts b/x-pack/plugins/siem/server/lib/detection_engine/rule_actions/get_rule_actions_saved_object.ts similarity index 94% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/get_rule_actions_saved_object.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rule_actions/get_rule_actions_saved_object.ts index dad35f6cb1f96e..83cd59f0a1cde9 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/get_rule_actions_saved_object.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rule_actions/get_rule_actions_saved_object.ts @@ -5,7 +5,7 @@ */ import { RuleAlertAction } from '../../../../common/detection_engine/types'; -import { AlertServices } from '../../../../../../../plugins/alerting/server'; +import { AlertServices } from '../../../../../alerting/server'; import { ruleActionsSavedObjectType } from './saved_object_mappings'; import { IRuleActionsAttributesSavedObjectAttributes } from './types'; import { getRuleActionsFromSavedObject } from './utils'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/saved_object_mappings.ts b/x-pack/plugins/siem/server/lib/detection_engine/rule_actions/saved_object_mappings.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/saved_object_mappings.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rule_actions/saved_object_mappings.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/types.ts b/x-pack/plugins/siem/server/lib/detection_engine/rule_actions/types.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/types.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rule_actions/types.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/update_or_create_rule_actions_saved_object.ts b/x-pack/plugins/siem/server/lib/detection_engine/rule_actions/update_or_create_rule_actions_saved_object.ts similarity index 94% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/update_or_create_rule_actions_saved_object.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rule_actions/update_or_create_rule_actions_saved_object.ts index d79c61f6200e3d..3364827d397d2c 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/update_or_create_rule_actions_saved_object.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rule_actions/update_or_create_rule_actions_saved_object.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AlertServices } from '../../../../../../../plugins/alerting/server'; +import { AlertServices } from '../../../../../alerting/server'; import { RuleAlertAction } from '../../../../common/detection_engine/types'; import { getRuleActionsSavedObject } from './get_rule_actions_saved_object'; import { createRuleActionsSavedObject } from './create_rule_actions_saved_object'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/update_rule_actions_saved_object.ts b/x-pack/plugins/siem/server/lib/detection_engine/rule_actions/update_rule_actions_saved_object.ts similarity index 95% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/update_rule_actions_saved_object.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rule_actions/update_rule_actions_saved_object.ts index 2a2c84838ed93c..c8a3b1bbc38ad5 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/update_rule_actions_saved_object.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rule_actions/update_rule_actions_saved_object.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AlertServices } from '../../../../../../../plugins/alerting/server'; +import { AlertServices } from '../../../../../alerting/server'; import { ruleActionsSavedObjectType } from './saved_object_mappings'; import { RulesActionsSavedObject } from './get_rule_actions_saved_object'; import { RuleAlertAction } from '../../../../common/detection_engine/types'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/utils.ts b/x-pack/plugins/siem/server/lib/detection_engine/rule_actions/utils.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rule_actions/utils.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rule_actions/utils.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/add_tags.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/add_tags.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/add_tags.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/add_tags.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/add_tags.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/add_tags.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/add_tags.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/add_tags.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/create_rules.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/create_rules.test.ts similarity index 88% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/create_rules.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/create_rules.test.ts index a60f1d41779782..6710bf02aeb2bf 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/create_rules.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/create_rules.test.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { alertsClientMock } from '../../../../../../../plugins/alerting/server/mocks'; -import { actionsClientMock } from '../../../../../../../plugins/actions/server/mocks'; +import { alertsClientMock } from '../../../../../alerting/server/mocks'; +import { actionsClientMock } from '../../../../../actions/server/mocks'; import { getMlResult } from '../routes/__mocks__/request_responses'; import { createRules } from './create_rules'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/create_rules.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/create_rules.ts similarity index 86% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/create_rules.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/create_rules.ts index 91effb4741b8b0..a007fe35b407ed 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/create_rules.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/create_rules.ts @@ -5,7 +5,7 @@ */ import { transformRuleToAlertAction } from '../../../../common/detection_engine/transform_actions'; -import { Alert } from '../../../../../../../plugins/alerting/common'; +import { Alert } from '../../../../../alerting/common'; import { APP_ID, SIGNALS_ID } from '../../../../common/constants'; import { CreateRuleParams } from './types'; import { addTags } from './add_tags'; @@ -42,11 +42,11 @@ export const createRules = async ({ references, note, version, - lists, + exceptions_list, actions, }: CreateRuleParams): Promise => { - // TODO: Remove this and use regular lists once the feature is stable for a release - const listsParam = hasListsFeature() ? { lists } : {}; + // TODO: Remove this and use regular exceptions_list once the feature is stable for a release + const exceptionsListParam = hasListsFeature() ? { exceptions_list } : {}; return alertsClient.create({ data: { name, @@ -79,7 +79,7 @@ export const createRules = async ({ references, note, version, - ...listsParam, + ...exceptionsListParam, }, schedule: { interval }, enabled, diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/create_rules_stream_from_ndjson.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/create_rules_stream_from_ndjson.test.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/create_rules_stream_from_ndjson.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/create_rules_stream_from_ndjson.test.ts index 695057ccc2f70c..8044692ab90b15 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/create_rules_stream_from_ndjson.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/create_rules_stream_from_ndjson.test.ts @@ -66,7 +66,7 @@ describe('create_rules_stream_from_ndjson', () => { immutable: false, query: '', language: 'kuery', - lists: [], + exceptions_list: [], max_signals: 100, tags: [], threat: [], @@ -92,7 +92,7 @@ describe('create_rules_stream_from_ndjson', () => { immutable: false, query: '', language: 'kuery', - lists: [], + exceptions_list: [], max_signals: 100, tags: [], threat: [], @@ -158,7 +158,7 @@ describe('create_rules_stream_from_ndjson', () => { language: 'kuery', max_signals: 100, tags: [], - lists: [], + exceptions_list: [], threat: [], throttle: null, references: [], @@ -183,7 +183,7 @@ describe('create_rules_stream_from_ndjson', () => { query: '', language: 'kuery', max_signals: 100, - lists: [], + exceptions_list: [], tags: [], threat: [], throttle: null, @@ -230,7 +230,7 @@ describe('create_rules_stream_from_ndjson', () => { query: '', language: 'kuery', max_signals: 100, - lists: [], + exceptions_list: [], tags: [], threat: [], throttle: null, @@ -256,7 +256,7 @@ describe('create_rules_stream_from_ndjson', () => { query: '', language: 'kuery', max_signals: 100, - lists: [], + exceptions_list: [], tags: [], threat: [], throttle: null, @@ -303,7 +303,7 @@ describe('create_rules_stream_from_ndjson', () => { query: '', language: 'kuery', max_signals: 100, - lists: [], + exceptions_list: [], tags: [], threat: [], throttle: null, @@ -330,7 +330,7 @@ describe('create_rules_stream_from_ndjson', () => { query: '', language: 'kuery', max_signals: 100, - lists: [], + exceptions_list: [], tags: [], threat: [], throttle: null, @@ -376,7 +376,7 @@ describe('create_rules_stream_from_ndjson', () => { query: '', language: 'kuery', max_signals: 100, - lists: [], + exceptions_list: [], tags: [], threat: [], throttle: null, @@ -405,7 +405,7 @@ describe('create_rules_stream_from_ndjson', () => { query: '', language: 'kuery', max_signals: 100, - lists: [], + exceptions_list: [], tags: [], threat: [], throttle: null, diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/create_rules_stream_from_ndjson.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/create_rules_stream_from_ndjson.ts similarity index 96% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/create_rules_stream_from_ndjson.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/create_rules_stream_from_ndjson.ts index 27008d17d21921..034813b8d100da 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/create_rules_stream_from_ndjson.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/create_rules_stream_from_ndjson.ts @@ -9,7 +9,7 @@ import { createSplitStream, createMapStream, createConcatStream, -} from '../../../../../../../../src/legacy/utils/streams'; +} from '../../../../../../../src/legacy/utils/streams'; import { importRulesSchema } from '../routes/schemas/import_rules_schema'; import { BadRequestError } from '../errors/bad_request_error'; import { diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/delete_rules.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/delete_rules.test.ts similarity index 95% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/delete_rules.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/delete_rules.test.ts index 38fc1dc5d19302..68d01356a333a4 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/delete_rules.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/delete_rules.test.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { actionsClientMock } from '../../../../../../../plugins/actions/server/mocks'; -import { alertsClientMock } from '../../../../../../../plugins/alerting/server/mocks'; +import { actionsClientMock } from '../../../../../actions/server/mocks'; +import { alertsClientMock } from '../../../../../alerting/server/mocks'; import { deleteRules } from './delete_rules'; import { readRules } from './read_rules'; jest.mock('./read_rules'); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/delete_rules.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/delete_rules.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/delete_rules.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/delete_rules.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/find_rules.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/find_rules.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/find_rules.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/find_rules.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/find_rules.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/find_rules.ts similarity index 92% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/find_rules.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/find_rules.ts index f333a7c3407058..ac600b0b5b2186 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/find_rules.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/find_rules.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { FindResult } from '../../../../../../../plugins/alerting/server'; +import { FindResult } from '../../../../../alerting/server'; import { SIGNALS_ID } from '../../../../common/constants'; import { FindRuleParams } from './types'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_existing_prepackaged_rules.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_existing_prepackaged_rules.test.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_existing_prepackaged_rules.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/get_existing_prepackaged_rules.test.ts index 9774d10a37d6f9..d79b428a2f76db 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_existing_prepackaged_rules.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_existing_prepackaged_rules.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { alertsClientMock } from '../../../../../../../plugins/alerting/server/mocks'; +import { alertsClientMock } from '../../../../../alerting/server/mocks'; import { getResult, getFindResultWithSingleHit, diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_existing_prepackaged_rules.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_existing_prepackaged_rules.ts similarity index 96% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_existing_prepackaged_rules.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/get_existing_prepackaged_rules.ts index b5e826ed42723b..512164fc3d2e10 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_existing_prepackaged_rules.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_existing_prepackaged_rules.ts @@ -5,7 +5,7 @@ */ import { INTERNAL_IMMUTABLE_KEY } from '../../../../common/constants'; -import { AlertsClient } from '../../../../../../../plugins/alerting/server'; +import { AlertsClient } from '../../../../../alerting/server'; import { RuleAlertType, isAlertTypes } from './types'; import { findRules } from './find_rules'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_export_all.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_export_all.test.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_export_all.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/get_export_all.test.ts index dd004e3685b1d7..6df250f1cf513f 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_export_all.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_export_all.test.ts @@ -9,7 +9,7 @@ import { getFindResultWithSingleHit, FindHit, } from '../routes/__mocks__/request_responses'; -import { alertsClientMock } from '../../../../../../../plugins/alerting/server/mocks'; +import { alertsClientMock } from '../../../../../alerting/server/mocks'; import { getExportAll } from './get_export_all'; import { unSetFeatureFlagsForTestsOnly, setFeatureFlagsForTestsOnly } from '../feature_flags'; @@ -79,7 +79,7 @@ describe('getExportAll', () => { throttle: 'no_actions', note: '# Investigative notes', version: 1, - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_export_all.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_export_all.ts similarity index 92% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_export_all.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/get_export_all.ts index 40c07f28ea848a..06e70f0bad184f 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_export_all.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_export_all.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AlertsClient } from '../../../../../../../plugins/alerting/server'; +import { AlertsClient } from '../../../../../alerting/server'; import { getNonPackagedRules } from './get_existing_prepackaged_rules'; import { getExportDetailsNdjson } from './get_export_details_ndjson'; import { transformAlertsToRules } from '../routes/rules/utils'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_export_by_object_ids.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_export_by_object_ids.test.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_export_by_object_ids.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/get_export_by_object_ids.test.ts index 715cb23e8444a9..092a9a8faf395b 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_export_by_object_ids.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_export_by_object_ids.test.ts @@ -11,7 +11,7 @@ import { FindHit, } from '../routes/__mocks__/request_responses'; import * as readRules from './read_rules'; -import { alertsClientMock } from '../../../../../../../plugins/alerting/server/mocks'; +import { alertsClientMock } from '../../../../../alerting/server/mocks'; import { setFeatureFlagsForTestsOnly, unSetFeatureFlagsForTestsOnly } from '../feature_flags'; describe('get_export_by_object_ids', () => { @@ -87,7 +87,7 @@ describe('get_export_by_object_ids', () => { throttle: 'no_actions', note: '# Investigative notes', version: 1, - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', @@ -215,7 +215,7 @@ describe('get_export_by_object_ids', () => { throttle: 'no_actions', note: '# Investigative notes', version: 1, - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_export_by_object_ids.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_export_by_object_ids.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_export_by_object_ids.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/get_export_by_object_ids.ts index 048f09e95b062a..02039b9de3c7a1 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_export_by_object_ids.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_export_by_object_ids.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AlertsClient } from '../../../../../../../plugins/alerting/server'; +import { AlertsClient } from '../../../../../alerting/server'; import { getExportDetailsNdjson } from './get_export_details_ndjson'; import { isAlertType } from '../rules/types'; import { readRules } from './read_rules'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_export_details_ndjson.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_export_details_ndjson.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_export_details_ndjson.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/get_export_details_ndjson.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_export_details_ndjson.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_export_details_ndjson.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_export_details_ndjson.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/get_export_details_ndjson.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_prepackaged_rules.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_prepackaged_rules.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_prepackaged_rules.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/get_prepackaged_rules.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_prepackaged_rules.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_prepackaged_rules.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_prepackaged_rules.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/get_prepackaged_rules.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_rules_to_install.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_rules_to_install.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_rules_to_install.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/get_rules_to_install.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_rules_to_install.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_rules_to_install.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_rules_to_install.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/get_rules_to_install.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_rules_to_update.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_rules_to_update.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_rules_to_update.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/get_rules_to_update.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_rules_to_update.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/get_rules_to_update.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/get_rules_to_update.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/get_rules_to_update.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/install_prepacked_rules.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/install_prepacked_rules.ts similarity index 88% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/install_prepacked_rules.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/install_prepacked_rules.ts index 6d4bacb9cc243c..3d3ed52b2feb2f 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/install_prepacked_rules.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/install_prepacked_rules.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Alert } from '../../../../../../../plugins/alerting/common'; -import { ActionsClient } from '../../../../../../../plugins/actions/server'; -import { AlertsClient } from '../../../../../../../plugins/alerting/server'; +import { Alert } from '../../../../../alerting/common'; +import { ActionsClient } from '../../../../../actions/server'; +import { AlertsClient } from '../../../../../alerting/server'; import { createRules } from './create_rules'; import { PrepackagedRules } from '../types'; @@ -46,7 +46,7 @@ export const installPrepackagedRules = ( references, note, version, - lists, + exceptions_list, } = rule; return [ ...acc, @@ -82,7 +82,7 @@ export const installPrepackagedRules = ( references, note, version, - lists, + exceptions_list, actions: [], // At this time there is no pre-packaged actions }), ]; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/patch_rules.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/patch_rules.test.ts similarity index 91% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/patch_rules.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/patch_rules.test.ts index 3108fc5f3b7187..f93b0aceb5e6ef 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/patch_rules.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/patch_rules.test.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { savedObjectsClientMock } from '../../../../../../../../src/core/server/mocks'; -import { alertsClientMock } from '../../../../../../../plugins/alerting/server/mocks'; -import { actionsClientMock } from '../../../../../../../plugins/actions/server/mocks'; +import { savedObjectsClientMock } from '../../../../../../../src/core/server/mocks'; +import { alertsClientMock } from '../../../../../alerting/server/mocks'; +import { actionsClientMock } from '../../../../../actions/server/mocks'; import { getResult, getMlResult } from '../routes/__mocks__/request_responses'; import { patchRules } from './patch_rules'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/patch_rules.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/patch_rules.ts similarity index 96% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/patch_rules.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/patch_rules.ts index 5c4889ec5fd683..c23f539b581606 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/patch_rules.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/patch_rules.ts @@ -5,7 +5,7 @@ */ import { defaults } from 'lodash/fp'; -import { PartialAlert } from '../../../../../../../plugins/alerting/server'; +import { PartialAlert } from '../../../../../alerting/server'; import { readRules } from './read_rules'; import { PatchRuleParams, IRuleSavedAttributesSavedObjectAttributes } from './types'; import { addTags } from './add_tags'; @@ -44,7 +44,7 @@ export const patchRules = async ({ references, note, version, - lists, + exceptions_list, anomalyThreshold, machineLearningJobId, }: PatchRuleParams): Promise => { @@ -78,7 +78,7 @@ export const patchRules = async ({ references, version, note, - lists, + exceptions_list, anomalyThreshold, machineLearningJobId, }); @@ -110,7 +110,7 @@ export const patchRules = async ({ references, note, version: calculatedVersion, - lists, + exceptions_list, anomalyThreshold, machineLearningJobId, } diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/403_response_to_a_post.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/403_response_to_a_post.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/403_response_to_a_post.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/403_response_to_a_post.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/405_response_method_not_allowed.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/405_response_method_not_allowed.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/405_response_method_not_allowed.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/405_response_method_not_allowed.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_adversary_behavior_detected.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_adversary_behavior_detected.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_adversary_behavior_detected.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_adversary_behavior_detected.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_dumping_detected.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_dumping_detected.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_dumping_detected.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_dumping_detected.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_dumping_prevented.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_dumping_prevented.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_dumping_prevented.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_dumping_prevented.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_manipulation_detected.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_manipulation_detected.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_manipulation_detected.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_manipulation_detected.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_manipulation_prevented.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_manipulation_prevented.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_manipulation_prevented.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_cred_manipulation_prevented.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_exploit_detected.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_exploit_detected.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_exploit_detected.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_exploit_detected.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_exploit_prevented.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_exploit_prevented.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_exploit_prevented.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_exploit_prevented.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_malware_detected.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_malware_detected.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_malware_detected.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_malware_detected.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_malware_prevented.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_malware_prevented.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_malware_prevented.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_malware_prevented.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_permission_theft_detected.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_permission_theft_detected.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_permission_theft_detected.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_permission_theft_detected.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_permission_theft_prevented.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_permission_theft_prevented.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_permission_theft_prevented.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_permission_theft_prevented.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_process_injection_detected.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_process_injection_detected.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_process_injection_detected.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_process_injection_detected.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_process_injection_prevented.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_process_injection_prevented.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_process_injection_prevented.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_process_injection_prevented.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_ransomware_detected.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_ransomware_detected.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_ransomware_detected.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_ransomware_detected.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_ransomware_prevented.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_ransomware_prevented.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_ransomware_prevented.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/elastic_endpoint_security_ransomware_prevented.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_adding_the_hidden_file_attribute_with_via_attribexe.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_adding_the_hidden_file_attribute_with_via_attribexe.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_adding_the_hidden_file_attribute_with_via_attribexe.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_adding_the_hidden_file_attribute_with_via_attribexe.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_adobe_hijack_persistence.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_adobe_hijack_persistence.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_adobe_hijack_persistence.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_adobe_hijack_persistence.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_clearing_windows_event_logs.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_clearing_windows_event_logs.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_clearing_windows_event_logs.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_clearing_windows_event_logs.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_delete_volume_usn_journal_with_fsutil.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_delete_volume_usn_journal_with_fsutil.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_delete_volume_usn_journal_with_fsutil.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_delete_volume_usn_journal_with_fsutil.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_deleting_backup_catalogs_with_wbadmin.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_deleting_backup_catalogs_with_wbadmin.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_deleting_backup_catalogs_with_wbadmin.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_deleting_backup_catalogs_with_wbadmin.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_direct_outbound_smb_connection.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_direct_outbound_smb_connection.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_direct_outbound_smb_connection.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_direct_outbound_smb_connection.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_disable_windows_firewall_rules_with_netsh.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_disable_windows_firewall_rules_with_netsh.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_disable_windows_firewall_rules_with_netsh.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_disable_windows_firewall_rules_with_netsh.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_encoding_or_decoding_files_via_certutil.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_encoding_or_decoding_files_via_certutil.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_encoding_or_decoding_files_via_certutil.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_encoding_or_decoding_files_via_certutil.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_local_scheduled_task_commands.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_local_scheduled_task_commands.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_local_scheduled_task_commands.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_local_scheduled_task_commands.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_local_service_commands.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_local_service_commands.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_local_service_commands.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_local_service_commands.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_msbuild_making_network_connections.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_msbuild_making_network_connections.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_msbuild_making_network_connections.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_msbuild_making_network_connections.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_mshta_making_network_connections.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_mshta_making_network_connections.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_mshta_making_network_connections.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_mshta_making_network_connections.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_psexec_lateral_movement_command.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_psexec_lateral_movement_command.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_psexec_lateral_movement_command.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_psexec_lateral_movement_command.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_suspicious_ms_office_child_process.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_suspicious_ms_office_child_process.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_suspicious_ms_office_child_process.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_suspicious_ms_office_child_process.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_suspicious_ms_outlook_child_process.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_suspicious_ms_outlook_child_process.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_suspicious_ms_outlook_child_process.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_suspicious_ms_outlook_child_process.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_system_shells_via_services.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_system_shells_via_services.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_system_shells_via_services.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_system_shells_via_services.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_network_connection_via_rundll32.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_network_connection_via_rundll32.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_network_connection_via_rundll32.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_network_connection_via_rundll32.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_parentchild_relationship.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_parentchild_relationship.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_parentchild_relationship.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_parentchild_relationship.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_process_network_connection.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_process_network_connection.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_process_network_connection.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_unusual_process_network_connection.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_user_account_creation.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_user_account_creation.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_user_account_creation.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_user_account_creation.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_volume_shadow_copy_deletion_via_vssadmin.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_volume_shadow_copy_deletion_via_vssadmin.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_volume_shadow_copy_deletion_via_vssadmin.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_volume_shadow_copy_deletion_via_vssadmin.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_volume_shadow_copy_deletion_via_wmic.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_volume_shadow_copy_deletion_via_wmic.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_volume_shadow_copy_deletion_via_wmic.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_volume_shadow_copy_deletion_via_wmic.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_windows_script_executing_powershell.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_windows_script_executing_powershell.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_windows_script_executing_powershell.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/eql_windows_script_executing_powershell.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/index.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/index.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_port_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_port_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_port_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_port_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_service.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_service.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_service.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_service.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_url_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_url_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_url_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_network_url_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_process_all_hosts.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_process_all_hosts.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_process_all_hosts.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_process_all_hosts.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_user_name.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_user_name.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_user_name.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_anomalous_user_name.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_hping_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_hping_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_hping_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_hping_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_iodine_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_iodine_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_iodine_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_iodine_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_kernel_module_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_kernel_module_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_kernel_module_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_kernel_module_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_mknod_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_mknod_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_mknod_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_mknod_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_netcat_network_connection.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_netcat_network_connection.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_netcat_network_connection.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_netcat_network_connection.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_nmap_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_nmap_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_nmap_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_nmap_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_nping_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_nping_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_nping_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_nping_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_process_started_in_temp_directory.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_process_started_in_temp_directory.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_process_started_in_temp_directory.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_process_started_in_temp_directory.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_shell_activity_by_web_server.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_shell_activity_by_web_server.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_shell_activity_by_web_server.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_shell_activity_by_web_server.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_socat_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_socat_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_socat_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_socat_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_strace_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_strace_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_strace_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_strace_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_tcpdump_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_tcpdump_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_tcpdump_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_tcpdump_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_whoami_commmand.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_whoami_commmand.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_whoami_commmand.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/linux_whoami_commmand.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_dns_directly_to_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_dns_directly_to_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_dns_directly_to_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_dns_directly_to_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ftp_file_transfer_protocol_activity_to_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ftp_file_transfer_protocol_activity_to_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ftp_file_transfer_protocol_activity_to_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ftp_file_transfer_protocol_activity_to_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_irc_internet_relay_chat_protocol_activity_to_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_irc_internet_relay_chat_protocol_activity_to_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_irc_internet_relay_chat_protocol_activity_to_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_irc_internet_relay_chat_protocol_activity_to_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_nat_traversal_port_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_nat_traversal_port_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_nat_traversal_port_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_nat_traversal_port_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_port_26_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_port_26_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_port_26_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_port_26_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_port_8000_activity_to_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_port_8000_activity_to_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_port_8000_activity_to_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_port_8000_activity_to_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_pptp_point_to_point_tunneling_protocol_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_pptp_point_to_point_tunneling_protocol_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_pptp_point_to_point_tunneling_protocol_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_pptp_point_to_point_tunneling_protocol_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_proxy_port_activity_to_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_proxy_port_activity_to_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_proxy_port_activity_to_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_proxy_port_activity_to_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rdp_remote_desktop_protocol_from_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rdp_remote_desktop_protocol_from_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rdp_remote_desktop_protocol_from_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rdp_remote_desktop_protocol_from_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rdp_remote_desktop_protocol_to_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rdp_remote_desktop_protocol_to_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rdp_remote_desktop_protocol_to_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rdp_remote_desktop_protocol_to_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rpc_remote_procedure_call_from_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rpc_remote_procedure_call_from_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rpc_remote_procedure_call_from_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rpc_remote_procedure_call_from_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rpc_remote_procedure_call_to_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rpc_remote_procedure_call_to_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rpc_remote_procedure_call_to_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_rpc_remote_procedure_call_to_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_smb_windows_file_sharing_activity_to_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_smb_windows_file_sharing_activity_to_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_smb_windows_file_sharing_activity_to_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_smb_windows_file_sharing_activity_to_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_smtp_to_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_smtp_to_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_smtp_to_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_smtp_to_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_sql_server_port_activity_to_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_sql_server_port_activity_to_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_sql_server_port_activity_to_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_sql_server_port_activity_to_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ssh_secure_shell_from_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ssh_secure_shell_from_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ssh_secure_shell_from_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ssh_secure_shell_from_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ssh_secure_shell_to_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ssh_secure_shell_to_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ssh_secure_shell_to_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_ssh_secure_shell_to_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_telnet_port_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_telnet_port_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_telnet_port_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_telnet_port_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_tor_activity_to_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_tor_activity_to_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_tor_activity_to_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_tor_activity_to_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_vnc_virtual_network_computing_from_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_vnc_virtual_network_computing_from_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_vnc_virtual_network_computing_from_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_vnc_virtual_network_computing_from_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_vnc_virtual_network_computing_to_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_vnc_virtual_network_computing_to_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_vnc_virtual_network_computing_to_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/network_vnc_virtual_network_computing_to_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/notice.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/notice.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/notice.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/notice.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/null_user_agent.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/null_user_agent.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/null_user_agent.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/null_user_agent.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_dns_tunneling.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_dns_tunneling.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_dns_tunneling.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_dns_tunneling.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_dns_question.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_dns_question.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_dns_question.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_dns_question.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_server_domain.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_server_domain.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_server_domain.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_server_domain.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_urls.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_urls.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_urls.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_urls.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_user_agent.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_user_agent.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_user_agent.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/packetbeat_rare_user_agent.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/rare_process_by_host_linux.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/rare_process_by_host_linux.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/rare_process_by_host_linux.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/rare_process_by_host_linux.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/rare_process_by_host_windows.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/rare_process_by_host_windows.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/rare_process_by_host_windows.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/rare_process_by_host_windows.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/sqlmap_user_agent.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/sqlmap_user_agent.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/sqlmap_user_agent.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/sqlmap_user_agent.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/suspicious_login_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/suspicious_login_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/suspicious_login_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/suspicious_login_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_network_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_network_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_network_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_network_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_path_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_path_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_path_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_path_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_process_all_hosts.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_process_all_hosts.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_process_all_hosts.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_process_all_hosts.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_process_creation.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_process_creation.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_process_creation.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_process_creation.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_script.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_script.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_script.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_script.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_service.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_service.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_service.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_service.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_user_name.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_user_name.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_user_name.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_anomalous_user_name.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_certutil_network_connection.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_certutil_network_connection.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_certutil_network_connection.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_certutil_network_connection.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_prompt_connecting_to_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_prompt_connecting_to_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_prompt_connecting_to_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_prompt_connecting_to_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_shell_started_by_powershell.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_shell_started_by_powershell.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_shell_started_by_powershell.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_shell_started_by_powershell.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_shell_started_by_svchost.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_shell_started_by_svchost.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_shell_started_by_svchost.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_command_shell_started_by_svchost.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_credential_dumping_msbuild.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_credential_dumping_msbuild.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_credential_dumping_msbuild.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_credential_dumping_msbuild.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_cve_2020_0601.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_cve_2020_0601.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_cve_2020_0601.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_cve_2020_0601.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_defense_evasion_via_filter_manager.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_defense_evasion_via_filter_manager.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_defense_evasion_via_filter_manager.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_defense_evasion_via_filter_manager.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_office_app.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_office_app.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_office_app.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_office_app.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_script.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_script.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_script.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_script.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_system_process.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_system_process.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_system_process.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_by_system_process.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_renamed.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_renamed.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_renamed.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_renamed.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_unusal_process.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_unusal_process.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_unusal_process.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_msbuild_started_unusal_process.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_compiled_html_file.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_compiled_html_file.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_compiled_html_file.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_compiled_html_file.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_net_com_assemblies.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_net_com_assemblies.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_net_com_assemblies.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_net_com_assemblies.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_regsvr32.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_regsvr32.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_regsvr32.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_regsvr32.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_trusted_developer_utilities.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_trusted_developer_utilities.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_trusted_developer_utilities.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_execution_via_trusted_developer_utilities.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_html_help_executable_program_connecting_to_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_html_help_executable_program_connecting_to_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_html_help_executable_program_connecting_to_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_html_help_executable_program_connecting_to_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_injection_msbuild.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_injection_msbuild.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_injection_msbuild.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_injection_msbuild.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_misc_lolbin_connecting_to_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_misc_lolbin_connecting_to_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_misc_lolbin_connecting_to_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_misc_lolbin_connecting_to_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_modification_of_boot_config.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_modification_of_boot_config.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_modification_of_boot_config.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_modification_of_boot_config.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_msxsl_network.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_msxsl_network.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_msxsl_network.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_msxsl_network.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_net_command_system_account.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_net_command_system_account.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_net_command_system_account.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_net_command_system_account.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_persistence_via_application_shimming.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_persistence_via_application_shimming.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_persistence_via_application_shimming.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_persistence_via_application_shimming.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_priv_escalation_via_accessibility_features.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_priv_escalation_via_accessibility_features.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_priv_escalation_via_accessibility_features.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_priv_escalation_via_accessibility_features.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_process_discovery_via_tasklist_command.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_process_discovery_via_tasklist_command.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_process_discovery_via_tasklist_command.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_process_discovery_via_tasklist_command.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_rare_user_runas_event.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_rare_user_runas_event.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_rare_user_runas_event.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_rare_user_runas_event.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_rare_user_type10_remote_login.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_rare_user_type10_remote_login.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_rare_user_type10_remote_login.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_rare_user_type10_remote_login.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_register_server_program_connecting_to_the_internet.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_register_server_program_connecting_to_the_internet.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_register_server_program_connecting_to_the_internet.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_register_server_program_connecting_to_the_internet.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_signed_binary_proxy_execution.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_signed_binary_proxy_execution.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_signed_binary_proxy_execution.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_signed_binary_proxy_execution.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_suspicious_pdf_reader.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_suspicious_pdf_reader.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_suspicious_pdf_reader.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_suspicious_pdf_reader.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_suspicious_process_started_by_a_script.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_suspicious_process_started_by_a_script.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_suspicious_process_started_by_a_script.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_suspicious_process_started_by_a_script.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_uac_bypass_event_viewer.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_uac_bypass_event_viewer.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_uac_bypass_event_viewer.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_uac_bypass_event_viewer.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_whoami_command_activity.json b/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_whoami_command_activity.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_whoami_command_activity.json rename to x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules/windows_whoami_command_activity.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/read_rules.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/read_rules.test.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/read_rules.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/read_rules.test.ts index 38a883329318ba..600848948be0c4 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/read_rules.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/read_rules.test.ts @@ -5,7 +5,7 @@ */ import { readRules } from './read_rules'; -import { alertsClientMock } from '../../../../../../../plugins/alerting/server/mocks'; +import { alertsClientMock } from '../../../../../alerting/server/mocks'; import { getResult, getFindResultWithSingleHit } from '../routes/__mocks__/request_responses'; export class TestError extends Error { diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/read_rules.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/read_rules.ts similarity index 95% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/read_rules.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/read_rules.ts index 94e4e6357a4a0b..9e0d5b3d05b3fc 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/read_rules.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/read_rules.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SanitizedAlert } from '../../../../../../../plugins/alerting/common'; +import { SanitizedAlert } from '../../../../../alerting/common'; import { INTERNAL_RULE_ID_KEY } from '../../../../common/constants'; import { findRules } from './find_rules'; import { ReadRuleParams, isAlertType } from './types'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/saved_object_mappings.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/saved_object_mappings.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/saved_object_mappings.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/saved_object_mappings.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/types.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/types.ts similarity index 95% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/types.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/types.ts index b1bed5d7161556..6fde199e0ba7df 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/types.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/types.ts @@ -13,10 +13,10 @@ import { SavedObjectsFindResponse, SavedObjectsClientContract, } from 'kibana/server'; -import { AlertsClient, PartialAlert } from '../../../../../../../plugins/alerting/server'; -import { Alert } from '../../../../../../../plugins/alerting/common'; +import { AlertsClient, PartialAlert } from '../../../../../alerting/server'; +import { Alert } from '../../../../../alerting/common'; import { SIGNALS_ID } from '../../../../common/constants'; -import { ActionsClient } from '../../../../../../../plugins/actions/server'; +import { ActionsClient } from '../../../../../actions/server'; import { RuleAlertParams, RuleTypeParams, RuleAlertParamsRest } from '../types'; export type PatchRuleAlertParamsRest = Partial & { diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/update_prepacked_rules.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/update_prepacked_rules.test.ts similarity index 86% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/update_prepacked_rules.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/update_prepacked_rules.test.ts index 7a3f233475117f..a9bbf75883d1f3 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/update_prepacked_rules.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/update_prepacked_rules.test.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { savedObjectsClientMock } from '../../../../../../../../src/core/server/mocks'; -import { alertsClientMock } from '../../../../../../../plugins/alerting/server/mocks'; -import { actionsClientMock } from '../../../../../../../plugins/actions/server/mocks'; +import { savedObjectsClientMock } from '../../../../../../../src/core/server/mocks'; +import { alertsClientMock } from '../../../../../alerting/server/mocks'; +import { actionsClientMock } from '../../../../../actions/server/mocks'; import { mockPrepackagedRule } from '../routes/__mocks__/request_responses'; import { updatePrepackagedRules } from './update_prepacked_rules'; import { patchRules } from './patch_rules'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/update_prepacked_rules.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/update_prepacked_rules.ts similarity index 92% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/update_prepacked_rules.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/update_prepacked_rules.ts index 7eb0d8d1399be4..b72b232c27f031 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/update_prepacked_rules.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/update_prepacked_rules.ts @@ -5,8 +5,8 @@ */ import { SavedObjectsClientContract } from 'kibana/server'; -import { ActionsClient } from '../../../../../../../plugins/actions/server'; -import { AlertsClient } from '../../../../../../../plugins/alerting/server'; +import { ActionsClient } from '../../../../../actions/server'; +import { AlertsClient } from '../../../../../alerting/server'; import { patchRules } from './patch_rules'; import { PrepackagedRules } from '../types'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/update_rules.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/update_rules.test.ts similarity index 91% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/update_rules.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/update_rules.test.ts index 72f4cbcbe68e80..2565d269db4786 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/update_rules.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/update_rules.test.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { savedObjectsClientMock } from '../../../../../../../../src/core/server/mocks'; -import { alertsClientMock } from '../../../../../../../plugins/alerting/server/mocks'; -import { actionsClientMock } from '../../../../../../../plugins/actions/server/mocks'; +import { savedObjectsClientMock } from '../../../../../../../src/core/server/mocks'; +import { alertsClientMock } from '../../../../../alerting/server/mocks'; +import { actionsClientMock } from '../../../../../actions/server/mocks'; import { getResult, getMlResult } from '../routes/__mocks__/request_responses'; import { updateRules } from './update_rules'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/update_rules.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/update_rules.ts similarity index 92% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/update_rules.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/update_rules.ts index 99326768ed33b9..7ddbbd76b06618 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/update_rules.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/update_rules.ts @@ -5,7 +5,7 @@ */ import { transformRuleToAlertAction } from '../../../../common/detection_engine/transform_actions'; -import { PartialAlert } from '../../../../../../../plugins/alerting/server'; +import { PartialAlert } from '../../../../../alerting/server'; import { readRules } from './read_rules'; import { IRuleSavedAttributesSavedObjectAttributes, UpdateRuleParams } from './types'; import { addTags } from './add_tags'; @@ -44,7 +44,7 @@ export const updateRules = async ({ references, version, note, - lists, + exceptions_list, anomalyThreshold, machineLearningJobId, actions, @@ -83,8 +83,8 @@ export const updateRules = async ({ machineLearningJobId, }); - // TODO: Remove this and use regular lists once the feature is stable for a release - const listsParam = hasListsFeature() ? { lists } : {}; + // TODO: Remove this and use regular exceptions_list once the feature is stable for a release + const exceptionsListParam = hasListsFeature() ? { exceptions_list } : {}; const update = await alertsClient.update({ id: rule.id, @@ -120,7 +120,7 @@ export const updateRules = async ({ version: calculatedVersion, anomalyThreshold, machineLearningJobId, - ...listsParam, + ...exceptionsListParam, }, }, }); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/update_rules_notifications.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/update_rules_notifications.ts similarity index 93% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/update_rules_notifications.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/update_rules_notifications.ts index 994a54048b71a3..ddcd34b18cae92 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/update_rules_notifications.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/rules/update_rules_notifications.ts @@ -5,7 +5,7 @@ */ import { RuleAlertAction } from '../../../../common/detection_engine/types'; -import { AlertsClient, AlertServices } from '../../../../../../../plugins/alerting/server'; +import { AlertsClient, AlertServices } from '../../../../../alerting/server'; import { updateOrCreateRuleActionsSavedObject } from '../rule_actions/update_or_create_rule_actions_saved_object'; import { updateNotifications } from '../notifications/update_notifications'; import { RuleActions } from '../rule_actions/types'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/utils.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/utils.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/utils.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/utils.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/utils.ts b/x-pack/plugins/siem/server/lib/detection_engine/rules/utils.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/utils.ts rename to x-pack/plugins/siem/server/lib/detection_engine/rules/utils.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/add_prepackaged_rules.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/add_prepackaged_rules.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/add_prepackaged_rules.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/add_prepackaged_rules.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/check_env_variables.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/check_env_variables.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/check_env_variables.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/check_env_variables.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/convert_saved_search_to_rules.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/convert_saved_search_to_rules.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/convert_saved_search_to_rules.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/convert_saved_search_to_rules.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_all_actions.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/delete_all_actions.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_all_actions.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/delete_all_actions.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_all_alert_tasks.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/delete_all_alert_tasks.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_all_alert_tasks.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/delete_all_alert_tasks.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_all_alerts.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/delete_all_alerts.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_all_alerts.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/delete_all_alerts.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_all_api_keys.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/delete_all_api_keys.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_all_api_keys.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/delete_all_api_keys.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_all_statuses.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/delete_all_statuses.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_all_statuses.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/delete_all_statuses.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_bulk.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/delete_bulk.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_bulk.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/delete_bulk.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_rule_by_id.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/delete_rule_by_id.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_rule_by_id.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/delete_rule_by_id.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_rule_by_rule_id.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/delete_rule_by_rule_id.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_rule_by_rule_id.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/delete_rule_by_rule_id.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_signal_index.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/delete_signal_index.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/delete_signal_index.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/delete_signal_index.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/export_rules.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/export_rules.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/export_rules.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/export_rules.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/export_rules_by_rule_id.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/export_rules_by_rule_id.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/export_rules_by_rule_id.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/export_rules_by_rule_id.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/export_rules_by_rule_id_to_file.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/export_rules_by_rule_id_to_file.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/export_rules_by_rule_id_to_file.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/export_rules_by_rule_id_to_file.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/export_rules_to_file.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/export_rules_to_file.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/export_rules_to_file.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/export_rules_to_file.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/find_rule_by_filter.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/find_rule_by_filter.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/find_rule_by_filter.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/find_rule_by_filter.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/find_rules.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/find_rules.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/find_rules.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/find_rules.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/find_rules_sort.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/find_rules_sort.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/find_rules_sort.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/find_rules_sort.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/find_rules_statuses_by_ids.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/find_rules_statuses_by_ids.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/find_rules_statuses_by_ids.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/find_rules_statuses_by_ids.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/find_saved_object.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/find_saved_object.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/find_saved_object.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/find_saved_object.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_action_instances.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/get_action_instances.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_action_instances.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/get_action_instances.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_action_types.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/get_action_types.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_action_types.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/get_action_types.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_alert_instances.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/get_alert_instances.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_alert_instances.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/get_alert_instances.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_alert_tasks.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/get_alert_tasks.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_alert_tasks.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/get_alert_tasks.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_alert_types.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/get_alert_types.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_alert_types.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/get_alert_types.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_prepackaged_rules_status.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/get_prepackaged_rules_status.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_prepackaged_rules_status.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/get_prepackaged_rules_status.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_privileges.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/get_privileges.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_privileges.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/get_privileges.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_rule_by_id.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/get_rule_by_id.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_rule_by_id.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/get_rule_by_id.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_rule_by_rule_id.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/get_rule_by_rule_id.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_rule_by_rule_id.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/get_rule_by_rule_id.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_saved_objects.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/get_saved_objects.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_saved_objects.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/get_saved_objects.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_signal_index.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/get_signal_index.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_signal_index.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/get_signal_index.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_tags.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/get_tags.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/get_tags.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/get_tags.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/hard_reset.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/hard_reset.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/hard_reset.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/hard_reset.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/import_rules.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/import_rules.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/import_rules.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/import_rules.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/import_rules_no_overwrite.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/import_rules_no_overwrite.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/import_rules_no_overwrite.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/import_rules_no_overwrite.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/patch_rule.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/patch_rule.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/patch_rule.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/patch_rule.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/patch_rule_bulk.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/patch_rule_bulk.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/patch_rule_bulk.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/patch_rule_bulk.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/post_rule.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/post_rule.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/post_rule.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/post_rule.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/post_rule_bulk.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/post_rule_bulk.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/post_rule_bulk.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/post_rule_bulk.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/post_signal_index.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/post_signal_index.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/post_signal_index.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/post_signal_index.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/post_x_rules.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/post_x_rules.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/post_x_rules.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/post_x_rules.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/regen_prepackge_rules_index.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/regen_prepackge_rules_index.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/regen_prepackge_rules_index.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/regen_prepackge_rules_index.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/bulk/delete_by_rule_id.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/bulk/delete_by_rule_id.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/bulk/delete_by_rule_id.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/bulk/delete_by_rule_id.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/bulk/multiple_ruleid_queries.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/bulk/multiple_ruleid_queries.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/bulk/multiple_ruleid_queries.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/bulk/multiple_ruleid_queries.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/bulk/multiple_simplest_queries.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/bulk/multiple_simplest_queries.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/bulk/multiple_simplest_queries.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/bulk/multiple_simplest_queries.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/bulk/patch_names.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/bulk/patch_names.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/bulk/patch_names.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/bulk/patch_names.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/export/ruleid_queries.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/export/ruleid_queries.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/export/ruleid_queries.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/export/ruleid_queries.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/import/multiple_ruleid_queries.ndjson b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/import/multiple_ruleid_queries.ndjson similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/import/multiple_ruleid_queries.ndjson rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/import/multiple_ruleid_queries.ndjson diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/README.md b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/README.md similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/README.md rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/README.md diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/disable_rule.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/disable_rule.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/disable_rule.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/disable_rule.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/enabled_rule.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/enabled_rule.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/enabled_rule.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/enabled_rule.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/simplest_update_risk_score_by_id.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/simplest_update_risk_score_by_id.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/simplest_update_risk_score_by_id.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/simplest_update_risk_score_by_id.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/simplest_update_risk_score_by_rule_id.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/simplest_update_risk_score_by_rule_id.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/simplest_update_risk_score_by_rule_id.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/simplest_update_risk_score_by_rule_id.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/simplest_updated_name.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/simplest_updated_name.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/simplest_updated_name.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/simplest_updated_name.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_interval.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_interval.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_interval.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_interval.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_list.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_list.json similarity index 96% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_list.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_list.json index 4db8724db4e13d..8d831f3a961d8d 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_list.json +++ b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_list.json @@ -1,6 +1,6 @@ { "rule_id": "query-with-list", - "lists": [ + "exceptions_list": [ { "field": "source.ip", "values_operator": "excluded", diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_machine_learning.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_machine_learning.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_machine_learning.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_machine_learning.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_note.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_note.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_note.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_note.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_query_everything.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_query_everything.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_query_everything.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_query_everything.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_tags.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_tags.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_tags.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_tags.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_timelineid.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_timelineid.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_timelineid.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_timelineid.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_version.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_version.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_version.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/patches/update_version.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/README.md b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/README.md similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/README.md rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/README.md diff --git a/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_and.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_and.json new file mode 100644 index 00000000000000..1575a712e2cbaa --- /dev/null +++ b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_and.json @@ -0,0 +1,35 @@ +{ + "name": "List - and", + "description": "Query with a list that includes and. This rule should only produce signals when host.name exists and when both event.module is endgame and event.category is anything other than file", + "rule_id": "query-with-list-and", + "risk_score": 1, + "severity": "high", + "type": "query", + "query": "host.name: *", + "interval": "30s", + "language": "kuery", + "exceptions_list": [ + { + "field": "event.module", + "values_operator": "excluded", + "values_type": "match", + "values": [ + { + "name": "endgame" + } + ], + "and": [ + { + "field": "event.category", + "values_operator": "included", + "values_type": "match", + "values": [ + { + "name": "file" + } + ] + } + ] + } + ] +} diff --git a/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_excluded.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_excluded.json new file mode 100644 index 00000000000000..4e6d9403a276f4 --- /dev/null +++ b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_excluded.json @@ -0,0 +1,23 @@ +{ + "name": "List - excluded", + "description": "Query with a list of values_operator excluded. This rule should only produce signals when host.name exists and event.module is suricata", + "rule_id": "query-with-list-excluded", + "risk_score": 1, + "severity": "high", + "type": "query", + "query": "host.name: *", + "interval": "30s", + "language": "kuery", + "exceptions_list": [ + { + "field": "event.module", + "values_operator": "excluded", + "values_type": "match", + "values": [ + { + "name": "suricata" + } + ] + } + ] +} diff --git a/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_exists.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_exists.json new file mode 100644 index 00000000000000..97beace37633fd --- /dev/null +++ b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_exists.json @@ -0,0 +1,18 @@ +{ + "name": "List - exists", + "description": "Query with a list that includes exists. This rule should only produce signals when host.name exists and event.action does not exist", + "rule_id": "query-with-list-exists", + "risk_score": 1, + "severity": "high", + "type": "query", + "query": "host.name: *", + "interval": "30s", + "language": "kuery", + "exceptions_list": [ + { + "field": "event.action", + "values_operator": "included", + "values_type": "exists" + } + ] +} diff --git a/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_list.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_list.json new file mode 100644 index 00000000000000..ad0585b5a2ec50 --- /dev/null +++ b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_list.json @@ -0,0 +1,54 @@ +{ + "name": "Query with a list", + "description": "Query with a list. This rule should only produce signals when either host.name exists and event.module is system and user.name is zeek or gdm OR when host.name exists and event.module is not endgame or zeek or system.", + "rule_id": "query-with-list", + "risk_score": 2, + "severity": "high", + "type": "query", + "query": "host.name: *", + "interval": "30s", + "language": "kuery", + "exceptions_list": [ + { + "field": "event.module", + "values_operator": "excluded", + "values_type": "match", + "values": [ + { + "name": "system" + } + ], + "and": [ + { + "field": "user.name", + "values_operator": "excluded", + "values_type": "match_all", + "values": [ + { + "name": "zeek" + }, + { + "name": "gdm" + } + ] + } + ] + }, + { + "field": "event.module", + "values_operator": "included", + "values_type": "match_all", + "values": [ + { + "name": "endgame" + }, + { + "name": "zeek" + }, + { + "name": "system" + } + ] + } + ] +} diff --git a/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_match.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_match.json new file mode 100644 index 00000000000000..6e6880cc28f24a --- /dev/null +++ b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_match.json @@ -0,0 +1,23 @@ +{ + "name": "List - match", + "description": "Query with a list that includes match. This rule should only produce signals when host.name exists and event.module is not suricata", + "rule_id": "query-with-list-match", + "risk_score": 1, + "severity": "high", + "type": "query", + "query": "host.name: *", + "interval": "30s", + "language": "kuery", + "exceptions_list": [ + { + "field": "event.module", + "values_operator": "included", + "values_type": "match", + "values": [ + { + "name": "suricata" + } + ] + } + ] +} diff --git a/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_match_all.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_match_all.json new file mode 100644 index 00000000000000..44cc26ac3315e4 --- /dev/null +++ b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_match_all.json @@ -0,0 +1,26 @@ +{ + "name": "List - match_all", + "description": "Query with a list that includes match_all. This rule should only produce signals when host.name exists and event.module is not suricata or auditd", + "rule_id": "query-with-list-match-all", + "risk_score": 1, + "severity": "high", + "type": "query", + "query": "host.name: *", + "interval": "30s", + "language": "kuery", + "exceptions_list": [ + { + "field": "event.module", + "values_operator": "included", + "values_type": "match_all", + "values": [ + { + "name": "suricata" + }, + { + "name": "auditd" + } + ] + } + ] +} diff --git a/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_or.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_or.json new file mode 100644 index 00000000000000..9c4eda559d5bc0 --- /dev/null +++ b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/lists/query_with_or.json @@ -0,0 +1,32 @@ +{ + "name": "List - or", + "description": "Query with a list that includes or. This rule should only produce signals when host.name exists and event.module is suricata OR when host.name exists and event.category is file", + "rule_id": "query-with-list-or", + "risk_score": 1, + "severity": "high", + "type": "query", + "query": "host.name: *", + "interval": "30s", + "exceptions_list": [ + { + "field": "event.module", + "values_operator": "excluded", + "values_type": "match", + "values": [ + { + "name": "suricata" + } + ] + }, + { + "field": "event.category", + "values_operator": "excluded", + "values_type": "match", + "values": [ + { + "name": "file" + } + ] + } + ] +} diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_disabled.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_disabled.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_disabled.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_disabled.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_lucene.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_lucene.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_lucene.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_lucene.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_mitre_attack.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_mitre_attack.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_mitre_attack.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_mitre_attack.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_timelineid.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_timelineid.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_timelineid.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_timelineid.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_everything.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_everything.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_everything.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_everything.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_filter.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_filter.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_filter.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_filter.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_machine_learning.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_machine_learning.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_machine_learning.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_machine_learning.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_meta_data.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_meta_data.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_meta_data.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_meta_data.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_note.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_note.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_note.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_note.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_rule_id.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_rule_id.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_rule_id.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_rule_id.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_tags.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_tags.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_tags.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/query_with_tags.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/simplest_filters.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/simplest_filters.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/simplest_filters.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/simplest_filters.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/simplest_query.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/simplest_query.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/queries/simplest_query.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/queries/simplest_query.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/README.md b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/README.md similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/README.md rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/README.md diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_by_rule_id.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_by_rule_id.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_by_rule_id.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_by_rule_id.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_everything.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_everything.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_everything.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_everything.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_filters.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_filters.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_filters.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_filters.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_query.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_query.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_query.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_query.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_query_filter.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_query_filter.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_query_filter.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/saved_query_with_query_filter.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/simplest_saved_query.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/simplest_saved_query.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/simplest_saved_query.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/saved_queries/simplest_saved_query.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/README.md b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/README.md similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/README.md rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/README.md diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/imports/multiple_ruleid_queries_corrupted.ndjson b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/imports/multiple_ruleid_queries_corrupted.ndjson similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/imports/multiple_ruleid_queries_corrupted.ndjson rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/imports/multiple_ruleid_queries_corrupted.ndjson diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/filter_with_empty_query.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/filter_with_empty_query.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/filter_with_empty_query.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/filter_with_empty_query.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/filter_without_query.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/filter_without_query.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/filter_without_query.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/filter_without_query.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/query_filter_ui_meatadata_lucene.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/query_filter_ui_meatadata_lucene.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/query_filter_ui_meatadata_lucene.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/query_filter_ui_meatadata_lucene.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/query_filter_ui_metadata.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/query_filter_ui_metadata.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/query_filter_ui_metadata.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/query_filter_ui_metadata.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/query_with_errors.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/query_with_errors.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/query_with_errors.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/query_with_errors.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/saved_query_ui_meta_empty_query.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/saved_query_ui_meta_empty_query.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/saved_query_ui_meta_empty_query.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/queries/saved_query_ui_meta_empty_query.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/README.md b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/README.md similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/README.md rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/README.md diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/query_single_id.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/query_single_id.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/query_single_id.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/query_single_id.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/signal_on_signal_depth_1.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/signal_on_signal_depth_1.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/signal_on_signal_depth_1.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/signal_on_signal_depth_1.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/signal_on_signal_depth_2.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/signal_on_signal_depth_2.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/signal_on_signal_depth_2.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/depth_test/signal_on_signal_depth_2.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/README.md b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/README.md similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/README.md rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/README.md diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/query_single_id.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/query_single_id.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/query_single_id.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/query_single_id.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/signal_on_signal.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/signal_on_signal.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/signal_on_signal.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/test_cases/signals_on_signals/halting_test/signal_on_signal.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/README.md b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/README.md similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/README.md rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/README.md diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/disable_rule.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/disable_rule.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/disable_rule.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/disable_rule.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/enabled_rule.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/enabled_rule.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/enabled_rule.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/enabled_rule.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/simplest_update_risk_score_by_id.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/simplest_update_risk_score_by_id.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/simplest_update_risk_score_by_id.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/simplest_update_risk_score_by_id.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/simplest_update_risk_score_by_rule_id.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/simplest_update_risk_score_by_rule_id.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/simplest_update_risk_score_by_rule_id.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/simplest_update_risk_score_by_rule_id.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/simplest_updated_name.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/simplest_updated_name.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/simplest_updated_name.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/simplest_updated_name.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_interval.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_interval.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_interval.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_interval.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_list.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_list.json similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_list.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_list.json index 66b198974f5743..df22dff5c046e9 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_list.json +++ b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_list.json @@ -6,7 +6,7 @@ "severity": "high", "type": "query", "query": "user.name: root or user.name: admin", - "lists": [ + "exceptions_list": [ { "field": "source.ip", "values_operator": "excluded", diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_machine_learning.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_machine_learning.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_machine_learning.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_machine_learning.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_note.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_note.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_note.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_note.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_query_everything.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_query_everything.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_query_everything.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_query_everything.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_tags.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_tags.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_tags.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_tags.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_timelineid.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_timelineid.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_timelineid.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_timelineid.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_version.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_version.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_version.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/rules/updates/update_version.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signal_index_exists.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/signal_index_exists.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signal_index_exists.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/signal_index_exists.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/aggs_signals.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/signals/aggs_signals.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/aggs_signals.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/signals/aggs_signals.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/put_signal_doc.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/signals/put_signal_doc.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/put_signal_doc.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/signals/put_signal_doc.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/query_signals.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/signals/query_signals.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/query_signals.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/signals/query_signals.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/sample_signal.json b/x-pack/plugins/siem/server/lib/detection_engine/scripts/signals/sample_signal.json similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/sample_signal.json rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/signals/sample_signal.json diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/set_status_with_id.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/signals/set_status_with_id.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/set_status_with_id.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/signals/set_status_with_id.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/set_status_with_query.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/signals/set_status_with_query.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/signals/set_status_with_query.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/signals/set_status_with_query.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/update_rule.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/update_rule.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/update_rule.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/update_rule.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/update_rule_bulk.sh b/x-pack/plugins/siem/server/lib/detection_engine/scripts/update_rule_bulk.sh similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/scripts/update_rule_bulk.sh rename to x-pack/plugins/siem/server/lib/detection_engine/scripts/update_rule_bulk.sh diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/__mocks__/es_results.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/__mocks__/es_results.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/__mocks__/es_results.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/__mocks__/es_results.ts index 3bdcc3f92f44cb..8a5da8e8597216 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/__mocks__/es_results.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/__mocks__/es_results.ts @@ -9,8 +9,8 @@ import { Logger, SavedObject, SavedObjectsFindResponse, -} from '../../../../../../../../../src/core/server'; -import { loggingServiceMock } from '../../../../../../../../../src/core/server/mocks'; +} from '../../../../../../../../src/core/server'; +import { loggingServiceMock } from '../../../../../../../../src/core/server/mocks'; import { RuleTypeParams, OutputRuleAlertRest } from '../../types'; import { IRuleStatusAttributes } from '../../rules/types'; import { ruleStatusSavedObjectType } from '../../../../saved_objects'; @@ -44,7 +44,7 @@ export const sampleRuleAlertParams = ( meta: undefined, threat: undefined, version: 1, - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/__mocks__/rule_status_saved_objects_client.mock.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/__mocks__/rule_status_saved_objects_client.mock.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/__mocks__/rule_status_saved_objects_client.mock.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/__mocks__/rule_status_saved_objects_client.mock.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_bulk_body.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/build_bulk_body.test.ts similarity index 99% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_bulk_body.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/build_bulk_body.test.ts index f1729e35ce1f07..bbd01cfaafc624 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_bulk_body.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/build_bulk_body.test.ts @@ -90,7 +90,7 @@ describe('buildBulkBody', () => { version: 1, created_at: fakeSignalSourceHit.signal.rule?.created_at, updated_at: fakeSignalSourceHit.signal.rule?.updated_at, - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', @@ -216,7 +216,7 @@ describe('buildBulkBody', () => { created_at: fakeSignalSourceHit.signal.rule?.created_at, updated_at: fakeSignalSourceHit.signal.rule?.updated_at, throttle: 'no_actions', - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', @@ -340,7 +340,7 @@ describe('buildBulkBody', () => { created_at: fakeSignalSourceHit.signal.rule?.created_at, updated_at: fakeSignalSourceHit.signal.rule?.updated_at, throttle: 'no_actions', - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', @@ -457,7 +457,7 @@ describe('buildBulkBody', () => { updated_at: fakeSignalSourceHit.signal.rule?.updated_at, created_at: fakeSignalSourceHit.signal.rule?.created_at, throttle: 'no_actions', - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_bulk_body.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/build_bulk_body.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_bulk_body.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/build_bulk_body.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_event_type_signal.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/build_event_type_signal.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_event_type_signal.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/build_event_type_signal.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_event_type_signal.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/build_event_type_signal.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_event_type_signal.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/build_event_type_signal.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_events_query.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/build_events_query.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_events_query.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/build_events_query.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_events_query.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/build_events_query.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_events_query.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/build_events_query.ts diff --git a/x-pack/plugins/siem/server/lib/detection_engine/signals/build_exceptions_query.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/build_exceptions_query.test.ts new file mode 100644 index 00000000000000..ec8db77dac725d --- /dev/null +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/build_exceptions_query.test.ts @@ -0,0 +1,1318 @@ +/* + * 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 { + buildQueryExceptions, + buildExceptions, + operatorBuilder, + buildExists, + buildMatch, + buildMatchAll, + evaluateValues, + formatQuery, + getLanguageBooleanOperator, +} from './build_exceptions_query'; +import { List } from '../routes/schemas/types/lists_default_array'; + +describe('build_exceptions_query', () => { + describe('getLanguageBooleanOperator', () => { + test('it returns value as uppercase if language is "lucene"', () => { + const result = getLanguageBooleanOperator({ language: 'lucene', value: 'not' }); + + expect(result).toEqual('NOT'); + }); + + test('it returns value as is if language is "kuery"', () => { + const result = getLanguageBooleanOperator({ language: 'kuery', value: 'not' }); + + expect(result).toEqual('not'); + }); + }); + + describe('operatorBuilder', () => { + describe('kuery', () => { + test('it returns "not " when operator is "excluded"', () => { + const operator = operatorBuilder({ operator: 'excluded', language: 'kuery' }); + + expect(operator).toEqual(' and '); + }); + + test('it returns empty string when operator is "included"', () => { + const operator = operatorBuilder({ operator: 'included', language: 'kuery' }); + + expect(operator).toEqual(' and not '); + }); + }); + + describe('lucene', () => { + test('it returns "NOT " when operator is "excluded"', () => { + const operator = operatorBuilder({ operator: 'excluded', language: 'lucene' }); + + expect(operator).toEqual(' AND '); + }); + + test('it returns empty string when operator is "included"', () => { + const operator = operatorBuilder({ operator: 'included', language: 'lucene' }); + + expect(operator).toEqual(' AND NOT '); + }); + }); + }); + + describe('buildExists', () => { + describe('kuery', () => { + test('it returns formatted wildcard string when operator is "excluded"', () => { + const query = buildExists({ operator: 'excluded', field: 'host.name', language: 'kuery' }); + + expect(query).toEqual(' and host.name:*'); + }); + + test('it returns formatted wildcard string when operator is "included"', () => { + const query = buildExists({ operator: 'included', field: 'host.name', language: 'kuery' }); + + expect(query).toEqual(' and not host.name:*'); + }); + }); + + describe('lucene', () => { + test('it returns formatted wildcard string when operator is "excluded"', () => { + const query = buildExists({ operator: 'excluded', field: 'host.name', language: 'lucene' }); + + expect(query).toEqual(' AND _exists_host.name'); + }); + + test('it returns formatted wildcard string when operator is "included"', () => { + const query = buildExists({ operator: 'included', field: 'host.name', language: 'lucene' }); + + expect(query).toEqual(' AND NOT _exists_host.name'); + }); + }); + }); + + describe('buildMatch', () => { + describe('kuery', () => { + test('it returns empty string if no items in "values"', () => { + const query = buildMatch({ + operator: 'included', + field: 'host.name', + values: [], + language: 'kuery', + }); + + expect(query).toEqual(''); + }); + + test('it returns formatted string when operator is "included"', () => { + const values = [ + { + name: 'suricata', + }, + ]; + const query = buildMatch({ + operator: 'included', + field: 'host.name', + values, + language: 'kuery', + }); + + expect(query).toEqual(' and not host.name:suricata'); + }); + + test('it returns formatted string when operator is "excluded"', () => { + const values = [ + { + name: 'suricata', + }, + ]; + const query = buildMatch({ + operator: 'excluded', + field: 'host.name', + values, + language: 'kuery', + }); + + expect(query).toEqual(' and host.name:suricata'); + }); + + // TODO: need to clean up types and maybe restrict values to one if type is 'match' + test('it returns formatted string when "values" includes more than one item', () => { + const values = [ + { + name: 'suricata', + }, + { + name: 'auditd', + }, + ]; + const query = buildMatch({ + operator: 'included', + field: 'host.name', + values, + language: 'kuery', + }); + + expect(query).toEqual(' and not host.name:suricata'); + }); + }); + + describe('lucene', () => { + test('it returns formatted string when operator is "included"', () => { + const values = [ + { + name: 'suricata', + }, + ]; + const query = buildMatch({ + operator: 'included', + field: 'host.name', + values, + language: 'lucene', + }); + + expect(query).toEqual(' AND NOT host.name:suricata'); + }); + + test('it returns formatted string when operator is "excluded"', () => { + const values = [ + { + name: 'suricata', + }, + ]; + const query = buildMatch({ + operator: 'excluded', + field: 'host.name', + values, + language: 'lucene', + }); + + expect(query).toEqual(' AND host.name:suricata'); + }); + + // TODO: need to clean up types and maybe restrict values to one if type is 'match' + test('it returns formatted string when "values" includes more than one item', () => { + const values = [ + { + name: 'suricata', + }, + { + name: 'auditd', + }, + ]; + const query = buildMatch({ + operator: 'included', + field: 'host.name', + values, + language: 'lucene', + }); + + expect(query).toEqual(' AND NOT host.name:suricata'); + }); + }); + }); + + describe('buildMatchAll', () => { + describe('kuery', () => { + test('it returns empty string if given an empty array for "values"', () => { + const exceptionSegment = buildMatchAll({ + operator: 'included', + field: 'host.name', + values: [], + language: 'kuery', + }); + + expect(exceptionSegment).toEqual(''); + }); + + test('it returns formatted string when "values" includes only one item', () => { + const values = [ + { + name: 'suricata', + }, + ]; + const exceptionSegment = buildMatchAll({ + operator: 'included', + field: 'host.name', + values, + language: 'kuery', + }); + + expect(exceptionSegment).toEqual(' and not host.name:suricata'); + }); + + test('it returns formatted string when operator is "included"', () => { + const values = [ + { + name: 'suricata', + }, + { + name: 'auditd', + }, + ]; + const exceptionSegment = buildMatchAll({ + operator: 'included', + field: 'host.name', + values, + language: 'kuery', + }); + + expect(exceptionSegment).toEqual(' and not host.name:(suricata or auditd)'); + }); + + test('it returns formatted string when operator is "excluded"', () => { + const values = [ + { + name: 'suricata', + }, + { + name: 'auditd', + }, + ]; + const exceptionSegment = buildMatchAll({ + operator: 'excluded', + field: 'host.name', + values, + language: 'kuery', + }); + + expect(exceptionSegment).toEqual(' and host.name:(suricata or auditd)'); + }); + }); + + describe('lucene', () => { + test('it returns formatted string when operator is "included"', () => { + const values = [ + { + name: 'suricata', + }, + { + name: 'auditd', + }, + ]; + const exceptionSegment = buildMatchAll({ + operator: 'included', + field: 'host.name', + values, + language: 'lucene', + }); + + expect(exceptionSegment).toEqual(' AND NOT host.name:(suricata OR auditd)'); + }); + + test('it returns formatted string when operator is "excluded"', () => { + const values = [ + { + name: 'suricata', + }, + { + name: 'auditd', + }, + ]; + const exceptionSegment = buildMatchAll({ + operator: 'excluded', + field: 'host.name', + values, + language: 'lucene', + }); + + expect(exceptionSegment).toEqual(' AND host.name:(suricata OR auditd)'); + }); + + test('it returns formatted string when "values" includes only one item', () => { + const values = [ + { + name: 'suricata', + }, + ]; + const exceptionSegment = buildMatchAll({ + operator: 'included', + field: 'host.name', + values, + language: 'lucene', + }); + + expect(exceptionSegment).toEqual(' AND NOT host.name:suricata'); + }); + }); + }); + + describe('evaluateValues', () => { + describe('kuery', () => { + test('it returns formatted wildcard string when "type" is "exists"', () => { + const list: List = { + values_operator: 'included', + values_type: 'exists', + field: 'host.name', + }; + const result = evaluateValues({ + list, + language: 'kuery', + }); + + expect(result).toEqual(' and not host.name:*'); + }); + + test('it returns formatted string when "type" is "match"', () => { + const list: List = { + values_operator: 'included', + values_type: 'match', + field: 'host.name', + values: [{ name: 'suricata' }], + }; + const result = evaluateValues({ + list, + language: 'kuery', + }); + + expect(result).toEqual(' and not host.name:suricata'); + }); + + test('it returns formatted string when "type" is "match_all"', () => { + const list: List = { + values_operator: 'included', + values_type: 'match_all', + field: 'host.name', + values: [ + { + name: 'suricata', + }, + { + name: 'auditd', + }, + ], + }; + + const result = evaluateValues({ + list, + language: 'kuery', + }); + + expect(result).toEqual(' and not host.name:(suricata or auditd)'); + }); + }); + + describe('lucene', () => { + describe('kuery', () => { + test('it returns formatted wildcard string when "type" is "exists"', () => { + const list: List = { + values_operator: 'included', + values_type: 'exists', + field: 'host.name', + }; + const result = evaluateValues({ + list, + language: 'lucene', + }); + + expect(result).toEqual(' AND NOT _exists_host.name'); + }); + + test('it returns formatted string when "type" is "match"', () => { + const list: List = { + values_operator: 'included', + values_type: 'match', + field: 'host.name', + values: [{ name: 'suricata' }], + }; + const result = evaluateValues({ + list, + language: 'lucene', + }); + + expect(result).toEqual(' AND NOT host.name:suricata'); + }); + + test('it returns formatted string when "type" is "match_all"', () => { + const list: List = { + values_operator: 'included', + values_type: 'match_all', + field: 'host.name', + values: [ + { + name: 'suricata', + }, + { + name: 'auditd', + }, + ], + }; + + const result = evaluateValues({ + list, + language: 'lucene', + }); + + expect(result).toEqual(' AND NOT host.name:(suricata OR auditd)'); + }); + }); + }); + }); + + describe('formatQuery', () => { + test('it returns query if "exceptions" is empty array', () => { + const formattedQuery = formatQuery({ exceptions: [], query: 'a:*', language: 'kuery' }); + + expect(formattedQuery).toEqual('a:*'); + }); + + test('it returns expected query string when single exception in array', () => { + const formattedQuery = formatQuery({ + exceptions: [' and b:(value-1 or value-2) and not c:*'], + query: 'a:*', + language: 'kuery', + }); + + expect(formattedQuery).toEqual('(a:* and b:(value-1 or value-2) and not c:*)'); + }); + + test('it returns expected query string when multiple exceptions in array', () => { + const formattedQuery = formatQuery({ + exceptions: [' and b:(value-1 or value-2) and not c:*', ' and not d:*'], + query: 'a:*', + language: 'kuery', + }); + + expect(formattedQuery).toEqual( + '(a:* and b:(value-1 or value-2) and not c:*) or (a:* and not d:*)' + ); + }); + }); + + describe('buildExceptions', () => { + test('it returns empty array if empty lists array passed in', () => { + const query = buildExceptions({ + query: 'a:*', + language: 'kuery', + lists: [], + }); + + expect(query).toEqual([]); + }); + + test('it returns expected query when more than one item in list', () => { + // Equal to query && !(b && !c) -> (query AND NOT b) OR (query AND c) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'included', + values_type: 'match_all', + values: [ + { + name: 'value-1', + }, + { + name: 'value-2', + }, + ], + }, + { + field: 'c', + values_operator: 'excluded', + values_type: 'match', + values: [ + { + name: 'value-3', + }, + ], + }, + ]; + const query = buildExceptions({ + query: 'a:*', + language: 'kuery', + lists, + }); + const expectedQuery = [' and not b:(value-1 or value-2)', ' and c:value-3']; + + expect(query).toEqual(expectedQuery); + }); + + test('it returns expected query when list item includes nested "and" value', () => { + // Equal to query && !(b || !c) -> (query AND NOT b AND c) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'included', + values_type: 'match_all', + values: [ + { + name: 'value-1', + }, + { + name: 'value-2', + }, + ], + and: [ + { + field: 'c', + values_operator: 'excluded', + values_type: 'match', + values: [ + { + name: 'value-3', + }, + ], + }, + ], + }, + ]; + const query = buildExceptions({ + query: 'a:*', + language: 'kuery', + lists, + }); + const expectedQuery = [' and not b:(value-1 or value-2) and c:value-3']; + + expect(query).toEqual(expectedQuery); + }); + + test('it returns expected query when list item includes nested "and" value of empty array', () => { + // Equal to query && !(b || !c) -> (query AND NOT b AND c) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'included', + values_type: 'match_all', + values: [ + { + name: 'value-1', + }, + { + name: 'value-2', + }, + ], + and: [], + }, + ]; + const query = buildExceptions({ + query: 'a:*', + language: 'kuery', + lists, + }); + const expectedQuery = [' and not b:(value-1 or value-2)']; + + expect(query).toEqual(expectedQuery); + }); + + test('it returns expected query when list item includes nested "and" value of null', () => { + // Equal to query && !(b || !c) -> (query AND NOT b AND c) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'included', + values_type: 'match_all', + values: [ + { + name: 'value-1', + }, + { + name: 'value-2', + }, + ], + and: undefined, + }, + ]; + const query = buildExceptions({ + query: 'a:*', + language: 'kuery', + lists, + }); + const expectedQuery = [' and not b:(value-1 or value-2)']; + + expect(query).toEqual(expectedQuery); + }); + + test('it returns expected query when list includes multiple items and nested "and" values', () => { + // Equal to query && !((b || !c) && d) -> (query AND NOT b AND c) OR (query AND NOT d) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'included', + values_type: 'match_all', + values: [ + { + name: 'value-1', + }, + { + name: 'value-2', + }, + ], + and: [ + { + field: 'c', + values_operator: 'excluded', + values_type: 'match', + values: [ + { + name: 'value-3', + }, + ], + }, + ], + }, + { + field: 'd', + values_operator: 'included', + values_type: 'exists', + }, + ]; + const query = buildExceptions({ + query: 'a:*', + language: 'kuery', + lists, + }); + const expectedQuery = [' and not b:(value-1 or value-2) and c:value-3', ' and not d:*']; + + expect(query).toEqual(expectedQuery); + }); + + test('it returns expected query when language is "lucene"', () => { + // Equal to query && !((b || !c) && !d) -> (query AND NOT b AND c) OR (query AND d) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'included', + values_type: 'match_all', + values: [ + { + name: 'value-1', + }, + { + name: 'value-2', + }, + ], + and: [ + { + field: 'c', + values_operator: 'excluded', + values_type: 'match', + values: [ + { + name: 'value-3', + }, + ], + }, + ], + }, + { + field: 'e', + values_operator: 'excluded', + values_type: 'exists', + }, + ]; + const query = buildExceptions({ + query: 'a:*', + language: 'lucene', + lists, + }); + const expectedQuery = [' AND NOT b:(value-1 OR value-2) AND c:value-3', ' AND _exists_e']; + + expect(query).toEqual(expectedQuery); + }); + + describe('exists', () => { + test('it returns expected query when list includes single list item with values_operator of "included"', () => { + // Equal to query && !(b) -> (query AND NOT b) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'included', + values_type: 'exists', + }, + ]; + const query = buildExceptions({ + query: 'a:*', + language: 'kuery', + lists, + }); + const expectedQuery = [' and not b:*']; + + expect(query).toEqual(expectedQuery); + }); + + test('it returns expected query when list includes single list item with values_operator of "excluded"', () => { + // Equal to query && !(!b) -> (query AND b) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'excluded', + values_type: 'exists', + }, + ]; + const query = buildExceptions({ + query: 'a:*', + language: 'kuery', + lists, + }); + const expectedQuery = [' and b:*']; + + expect(query).toEqual(expectedQuery); + }); + + test('it returns expected query when list includes list item with "and" values', () => { + // Equal to query && !(!b || !c) -> (query AND b AND c) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'excluded', + values_type: 'exists', + and: [ + { + field: 'c', + values_operator: 'excluded', + values_type: 'exists', + }, + ], + }, + ]; + const query = buildExceptions({ + query: 'a:*', + language: 'kuery', + lists, + }); + const expectedQuery = [' and b:* and c:*']; + + expect(query).toEqual(expectedQuery); + }); + + test('it returns expected query when list includes multiple items', () => { + // Equal to query && !((b || !c || d) && e) -> (query AND NOT b AND c AND NOT d) OR (query AND NOT e) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'included', + values_type: 'exists', + and: [ + { + field: 'c', + values_operator: 'excluded', + values_type: 'exists', + }, + { + field: 'd', + values_operator: 'included', + values_type: 'exists', + }, + ], + }, + { + field: 'e', + values_operator: 'included', + values_type: 'exists', + }, + ]; + const query = buildExceptions({ + query: 'a:*', + language: 'kuery', + lists, + }); + const expectedQuery = [' and not b:* and c:* and not d:*', ' and not e:*']; + + expect(query).toEqual(expectedQuery); + }); + }); + + describe('match', () => { + test('it returns expected query when list includes single list item with values_operator of "included"', () => { + // Equal to query && !(b) -> (query AND NOT b) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'included', + values_type: 'match', + values: [ + { + name: 'value', + }, + ], + }, + ]; + const query = buildExceptions({ + query: 'a:*', + language: 'kuery', + lists, + }); + const expectedQuery = [' and not b:value']; + + expect(query).toEqual(expectedQuery); + }); + + test('it returns expected query when list includes single list item with values_operator of "excluded"', () => { + // Equal to query && !(!b) -> (query AND b) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'excluded', + values_type: 'match', + values: [ + { + name: 'value', + }, + ], + }, + ]; + const query = buildExceptions({ + query: 'a:*', + language: 'kuery', + lists, + }); + const expectedQuery = [' and b:value']; + + expect(query).toEqual(expectedQuery); + }); + + test('it returns expected query when list includes list item with "and" values', () => { + // Equal to query && !(!b || !c) -> (query AND b AND c) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'excluded', + values_type: 'match', + values: [ + { + name: 'value', + }, + ], + and: [ + { + field: 'c', + values_operator: 'excluded', + values_type: 'match', + values: [ + { + name: 'valueC', + }, + ], + }, + ], + }, + ]; + const query = buildExceptions({ + query: 'a:*', + language: 'kuery', + lists, + }); + const expectedQuery = [' and b:value and c:valueC']; + + expect(query).toEqual(expectedQuery); + }); + + test('it returns expected query when list includes multiple items', () => { + // Equal to query && !((b || !c || d) && e) -> (query AND NOT b AND c AND NOT d) OR (query AND NOT e) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'included', + values_type: 'match', + values: [ + { + name: 'value', + }, + ], + and: [ + { + field: 'c', + values_operator: 'excluded', + values_type: 'match', + values: [ + { + name: 'valueC', + }, + ], + }, + { + field: 'd', + values_operator: 'included', + values_type: 'match', + values: [ + { + name: 'valueC', + }, + ], + }, + ], + }, + { + field: 'e', + values_operator: 'included', + values_type: 'match', + values: [ + { + name: 'valueC', + }, + ], + }, + ]; + const query = buildExceptions({ + query: 'a:*', + language: 'kuery', + lists, + }); + const expectedQuery = [ + ' and not b:value and c:valueC and not d:valueC', + ' and not e:valueC', + ]; + + expect(query).toEqual(expectedQuery); + }); + }); + + describe('match_all', () => { + test('it returns expected query when list includes single list item with values_operator of "included"', () => { + // Equal to query && !(b) -> (query AND NOT b) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'included', + values_type: 'match_all', + values: [ + { + name: 'value', + }, + { + name: 'value-1', + }, + ], + }, + ]; + const query = buildExceptions({ + query: 'a:*', + language: 'kuery', + lists, + }); + const expectedQuery = [' and not b:(value or value-1)']; + + expect(query).toEqual(expectedQuery); + }); + + test('it returns expected query when list includes single list item with values_operator of "excluded"', () => { + // Equal to query && !(!b) -> (query AND b) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'excluded', + values_type: 'match_all', + values: [ + { + name: 'value', + }, + { + name: 'value-1', + }, + ], + }, + ]; + const query = buildExceptions({ + query: 'a:*', + language: 'kuery', + lists, + }); + const expectedQuery = [' and b:(value or value-1)']; + + expect(query).toEqual(expectedQuery); + }); + + test('it returns expected query when list includes list item with "and" values', () => { + // Equal to query && !(!b || c) -> (query AND b AND NOT c) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'excluded', + values_type: 'match_all', + values: [ + { + name: 'value', + }, + { + name: 'value-1', + }, + ], + and: [ + { + field: 'c', + values_operator: 'included', + values_type: 'match_all', + values: [ + { + name: 'valueC', + }, + { + name: 'value-2', + }, + ], + }, + ], + }, + ]; + const query = buildExceptions({ + query: 'a:*', + language: 'kuery', + lists, + }); + const expectedQuery = [' and b:(value or value-1) and not c:(valueC or value-2)']; + + expect(query).toEqual(expectedQuery); + }); + + test('it returns expected query when list includes multiple items', () => { + // Equal to query && !((b || !c || d) && e) -> ((query AND NOT b AND c AND NOT d) OR (query AND NOT e) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'included', + values_type: 'match_all', + values: [ + { + name: 'value', + }, + { + name: 'value-1', + }, + ], + and: [ + { + field: 'c', + values_operator: 'excluded', + values_type: 'match_all', + values: [ + { + name: 'valueC', + }, + { + name: 'value-2', + }, + ], + }, + { + field: 'd', + values_operator: 'included', + values_type: 'match_all', + values: [ + { + name: 'valueD', + }, + { + name: 'value-3', + }, + ], + }, + ], + }, + { + field: 'e', + values_operator: 'included', + values_type: 'match_all', + values: [ + { + name: 'valueE', + }, + { + name: 'value-4', + }, + ], + }, + ]; + const query = buildExceptions({ + query: 'a:*', + language: 'kuery', + lists, + }); + const expectedQuery = [ + ' and not b:(value or value-1) and c:(valueC or value-2) and not d:(valueD or value-3)', + ' and not e:(valueE or value-4)', + ]; + + expect(query).toEqual(expectedQuery); + }); + }); + }); + + describe('buildQueryExceptions', () => { + test('it returns original query if no lists exist', () => { + const query = buildQueryExceptions({ + query: 'host.name: *', + language: 'kuery', + lists: undefined, + }); + const expectedQuery = 'host.name: *'; + + expect(query).toEqual([{ query: expectedQuery, language: 'kuery' }]); + }); + + test('it returns original query if lists is empty array', () => { + const query = buildQueryExceptions({ query: 'host.name: *', language: 'kuery', lists: [] }); + const expectedQuery = 'host.name: *'; + + expect(query).toEqual([{ query: expectedQuery, language: 'kuery' }]); + }); + + test('it returns original query if lists is null', () => { + const query = buildQueryExceptions({ query: 'host.name: *', language: 'kuery', lists: null }); + const expectedQuery = 'host.name: *'; + + expect(query).toEqual([{ query: expectedQuery, language: 'kuery' }]); + }); + + test('it returns original query if lists is undefined', () => { + const query = buildQueryExceptions({ + query: 'host.name: *', + language: 'kuery', + lists: undefined, + }); + const expectedQuery = 'host.name: *'; + + expect(query).toEqual([{ query: expectedQuery, language: 'kuery' }]); + }); + + test('it returns expected query when lists exist and language is "kuery"', () => { + // Equal to query && !((b || !c || d) && e) -> ((query AND NOT b AND c AND NOT d) OR (query AND NOT e) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'included', + values_type: 'match_all', + values: [ + { + name: 'value', + }, + { + name: 'value-1', + }, + ], + and: [ + { + field: 'c', + values_operator: 'excluded', + values_type: 'match_all', + values: [ + { + name: 'valueC', + }, + { + name: 'value-2', + }, + ], + }, + { + field: 'd', + values_operator: 'included', + values_type: 'match_all', + values: [ + { + name: 'valueD', + }, + { + name: 'value-3', + }, + ], + }, + ], + }, + { + field: 'e', + values_operator: 'included', + values_type: 'match_all', + values: [ + { + name: 'valueE', + }, + { + name: 'value-4', + }, + ], + }, + ]; + const query = buildQueryExceptions({ query: 'a:*', language: 'kuery', lists }); + const expectedQuery = + '(a:* and not b:(value or value-1) and c:(valueC or value-2) and not d:(valueD or value-3)) or (a:* and not e:(valueE or value-4))'; + + expect(query).toEqual([{ query: expectedQuery, language: 'kuery' }]); + }); + + test('it returns expected query when lists exist and language is "lucene"', () => { + // Equal to query && !((b || !c || d) && e) -> ((query AND NOT b AND c AND NOT d) OR (query AND NOT e) + // https://www.dcode.fr/boolean-expressions-calculator + const lists: List[] = [ + { + field: 'b', + values_operator: 'included', + values_type: 'match_all', + values: [ + { + name: 'value', + }, + { + name: 'value-1', + }, + ], + and: [ + { + field: 'c', + values_operator: 'excluded', + values_type: 'match_all', + values: [ + { + name: 'valueC', + }, + { + name: 'value-2', + }, + ], + }, + { + field: 'd', + values_operator: 'included', + values_type: 'match_all', + values: [ + { + name: 'valueD', + }, + { + name: 'value-3', + }, + ], + }, + ], + }, + { + field: 'e', + values_operator: 'included', + values_type: 'match_all', + values: [ + { + name: 'valueE', + }, + { + name: 'value-4', + }, + ], + }, + ]; + const query = buildQueryExceptions({ query: 'a:*', language: 'lucene', lists }); + const expectedQuery = + '(a:* AND NOT b:(value OR value-1) AND c:(valueC OR value-2) AND NOT d:(valueD OR value-3)) OR (a:* AND NOT e:(valueE OR value-4))'; + + expect(query).toEqual([{ query: expectedQuery, language: 'lucene' }]); + }); + }); +}); diff --git a/x-pack/plugins/siem/server/lib/detection_engine/signals/build_exceptions_query.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/build_exceptions_query.ts new file mode 100644 index 00000000000000..7a1564bb695467 --- /dev/null +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/build_exceptions_query.ts @@ -0,0 +1,203 @@ +/* + * 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 { Query } from '../../../../../../../src/plugins/data/server'; +import { List, ListOperator, ListValues } from '../routes/schemas/types/lists_default_array'; +import { RuleAlertParams, Language } from '../types'; + +type Operators = 'and' | 'or' | 'not'; +type LuceneOperators = 'AND' | 'OR' | 'NOT'; + +export const getLanguageBooleanOperator = ({ + language, + value, +}: { + language: Language; + value: Operators; +}): Operators | LuceneOperators => { + switch (language) { + case 'lucene': + const luceneValues: Record = { and: 'AND', or: 'OR', not: 'NOT' }; + + return luceneValues[value]; + case 'kuery': + return value; + default: + return value; + } +}; + +export const operatorBuilder = ({ + operator, + language, +}: { + operator: ListOperator; + language: Language; +}): string => { + const and = getLanguageBooleanOperator({ + language, + value: 'and', + }); + const or = getLanguageBooleanOperator({ + language, + value: 'not', + }); + + switch (operator) { + case 'excluded': + return ` ${and} `; + case 'included': + return ` ${and} ${or} `; + default: + return ''; + } +}; + +export const buildExists = ({ + operator, + field, + language, +}: { + operator: ListOperator; + field: string; + language: Language; +}): string => { + const exceptionOperator = operatorBuilder({ operator, language }); + + switch (language) { + case 'kuery': + return `${exceptionOperator}${field}:*`; + case 'lucene': + return `${exceptionOperator}_exists_${field}`; + default: + return ''; + } +}; + +export const buildMatch = ({ + operator, + field, + values, + language, +}: { + operator: ListOperator; + field: string; + values: ListValues[]; + language: Language; +}): string => { + if (values.length > 0) { + const exceptionOperator = operatorBuilder({ operator, language }); + const [exception] = values; + + return `${exceptionOperator}${field}:${exception.name}`; + } else { + return ''; + } +}; + +export const buildMatchAll = ({ + operator, + field, + values, + language, +}: { + operator: ListOperator; + field: string; + values: ListValues[]; + language: Language; +}): string => { + switch (values.length) { + case 0: + return ''; + case 1: + return buildMatch({ operator, field, values, language }); + default: + const or = getLanguageBooleanOperator({ language, value: 'or' }); + const exceptionOperator = operatorBuilder({ operator, language }); + const matchAllValues = values.map(value => { + return value.name; + }); + + return `${exceptionOperator}${field}:(${matchAllValues.join(` ${or} `)})`; + } +}; + +export const evaluateValues = ({ list, language }: { list: List; language: Language }): string => { + const { values_operator: operator, values_type: type, field, values } = list; + switch (type) { + case 'exists': + return buildExists({ operator, field, language }); + case 'match': + return buildMatch({ operator, field, values: values ?? [], language }); + case 'match_all': + return buildMatchAll({ operator, field, values: values ?? [], language }); + default: + return ''; + } +}; + +export const formatQuery = ({ + exceptions, + query, + language, +}: { + exceptions: string[]; + query: string; + language: Language; +}): string => { + if (exceptions.length > 0) { + const or = getLanguageBooleanOperator({ language, value: 'or' }); + const formattedExceptions = exceptions.map(exception => { + return `(${query}${exception})`; + }); + + return formattedExceptions.join(` ${or} `); + } else { + return query; + } +}; + +export const buildExceptions = ({ + query, + lists, + language, +}: { + query: string; + lists: List[]; + language: Language; +}): string[] => { + return lists.reduce((accum, listItem) => { + const { and, ...exceptionDetails } = { ...listItem }; + const andExceptionsSegments = and ? buildExceptions({ query, lists: and, language }) : []; + const exceptionSegment = evaluateValues({ list: exceptionDetails, language }); + const exception = [...exceptionSegment, ...andExceptionsSegments]; + + return [...accum, exception.join('')]; + }, []); +}; + +export const buildQueryExceptions = ({ + query, + language, + lists, +}: { + query: string; + language: Language; + lists: RuleAlertParams['exceptions_list']; +}): Query[] => { + if (lists && lists !== null) { + const exceptions = buildExceptions({ lists, language, query }); + const formattedQuery = formatQuery({ exceptions, language, query }); + + return [ + { + query: formattedQuery, + language, + }, + ]; + } else { + return [{ query, language }]; + } +}; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_rule.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/build_rule.test.ts similarity index 99% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_rule.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/build_rule.test.ts index e5183ed4df7bd9..b3586c884d0c7f 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_rule.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/build_rule.test.ts @@ -79,7 +79,7 @@ describe('buildRule', () => { query: 'host.name: Braden', }, ], - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', @@ -162,7 +162,7 @@ describe('buildRule', () => { updated_at: rule.updated_at, created_at: rule.created_at, throttle: 'no_actions', - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', @@ -244,7 +244,7 @@ describe('buildRule', () => { updated_at: rule.updated_at, created_at: rule.created_at, throttle: 'no_actions', - lists: [ + exceptions_list: [ { field: 'source.ip', values_operator: 'included', diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_rule.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/build_rule.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_rule.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/build_rule.ts index 9c375d7d45d5e7..93d4e5e7719b22 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_rule.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/build_rule.ts @@ -72,7 +72,7 @@ export const buildRule = ({ version: ruleParams.version, created_at: createdAt, updated_at: updatedAt, - lists: ruleParams.lists, + exceptions_list: ruleParams.exceptions_list, machine_learning_job_id: ruleParams.machineLearningJobId, anomaly_threshold: ruleParams.anomalyThreshold, }); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_signal.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/build_signal.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_signal.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/build_signal.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_signal.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/build_signal.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/build_signal.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/build_signal.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/bulk_create_ml_signals.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/bulk_create_ml_signals.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/bulk_create_ml_signals.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/bulk_create_ml_signals.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/bulk_create_ml_signals.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/bulk_create_ml_signals.ts similarity index 94% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/bulk_create_ml_signals.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/bulk_create_ml_signals.ts index ba8938f116fc6b..d298f1cc7cbc66 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/bulk_create_ml_signals.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/bulk_create_ml_signals.ts @@ -7,8 +7,8 @@ import { flow, set, omit } from 'lodash/fp'; import { SearchResponse } from 'elasticsearch'; -import { Logger } from '../../../../../../../../src/core/server'; -import { AlertServices } from '../../../../../../../plugins/alerting/server'; +import { Logger } from '../../../../../../../src/core/server'; +import { AlertServices } from '../../../../../alerting/server'; import { RuleAlertAction } from '../../../../common/detection_engine/types'; import { RuleTypeParams, RefreshTypes } from '../types'; import { singleBulkCreate, SingleBulkCreateResponse } from './single_bulk_create'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/find_ml_signals.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/find_ml_signals.ts similarity index 91% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/find_ml_signals.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/find_ml_signals.ts index b7f752e6ba5e0e..8ac5a6cde39cc4 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/find_ml_signals.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/find_ml_signals.ts @@ -6,7 +6,7 @@ import dateMath from '@elastic/datemath'; -import { AlertServices } from '../../../../../../../plugins/alerting/server'; +import { AlertServices } from '../../../../../alerting/server'; import { getAnomalies } from '../../machine_learning'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/get_filter.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/get_filter.test.ts similarity index 78% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/get_filter.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/get_filter.test.ts index 510667b211d25c..35ec1950cedaab 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/get_filter.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/get_filter.test.ts @@ -6,7 +6,7 @@ import { getQueryFilter, getFilter } from './get_filter'; import { PartialFilter } from '../types'; -import { alertsMock, AlertServicesMock } from '../../../../../../../plugins/alerting/server/mocks'; +import { alertsMock, AlertServicesMock } from '../../../../../alerting/server/mocks'; describe('get_filter', () => { let servicesMock: AlertServicesMock; @@ -35,7 +35,7 @@ describe('get_filter', () => { describe('getQueryFilter', () => { test('it should work with an empty filter as kuery', () => { - const esQuery = getQueryFilter('host.name: linux', 'kuery', [], ['auditbeat-*']); + const esQuery = getQueryFilter('host.name: linux', 'kuery', [], ['auditbeat-*'], []); expect(esQuery).toEqual({ bool: { must: [], @@ -60,7 +60,7 @@ describe('get_filter', () => { }); test('it should work with an empty filter as lucene', () => { - const esQuery = getQueryFilter('host.name: linux', 'lucene', [], ['auditbeat-*']); + const esQuery = getQueryFilter('host.name: linux', 'lucene', [], ['auditbeat-*'], []); expect(esQuery).toEqual({ bool: { must: [ @@ -102,7 +102,8 @@ describe('get_filter', () => { }, }, ], - ['auditbeat-*'] + ['auditbeat-*'], + [] ); expect(esQuery).toEqual({ bool: { @@ -145,7 +146,8 @@ describe('get_filter', () => { }, }, ], - ['auditbeat-*'] + ['auditbeat-*'], + [] ); expect(esQuery).toEqual({ bool: { @@ -194,7 +196,8 @@ describe('get_filter', () => { 'host.name: windows', 'kuery', [query, exists], - ['auditbeat-*'] + ['auditbeat-*'], + [] ); expect(esQuery).toEqual({ bool: { @@ -252,7 +255,8 @@ describe('get_filter', () => { }, }, ], - ['auditbeat-*'] + ['auditbeat-*'], + [] ); expect(esQuery).toEqual({ bool: { @@ -300,7 +304,8 @@ describe('get_filter', () => { }, }, ], - ['auditbeat-*'] + ['auditbeat-*'], + [] ); expect(esQuery).toEqual({ bool: { @@ -349,7 +354,8 @@ describe('get_filter', () => { }, }, ], - ['auditbeat-*'] + ['auditbeat-*'], + [] ); expect(esQuery).toEqual({ bool: { @@ -368,6 +374,108 @@ describe('get_filter', () => { }, }); }); + + test('it should work with a list', () => { + const esQuery = getQueryFilter( + 'host.name: linux', + 'kuery', + [], + ['auditbeat-*'], + [ + { + field: 'event.module', + values_operator: 'excluded', + values_type: 'match', + values: [ + { + name: 'suricata', + }, + ], + }, + ] + ); + expect(esQuery).toEqual({ + bool: { + filter: [ + { + bool: { + filter: [ + { + bool: { + minimum_should_match: 1, + should: [ + { + match: { + 'host.name': 'linux', + }, + }, + ], + }, + }, + { + bool: { + minimum_should_match: 1, + should: [ + { + match: { + 'event.module': 'suricata', + }, + }, + ], + }, + }, + ], + }, + }, + ], + must: [], + must_not: [], + should: [], + }, + }); + }); + + test('it should work with an empty list', () => { + const esQuery = getQueryFilter('host.name: linux', 'kuery', [], ['auditbeat-*'], []); + expect(esQuery).toEqual({ + bool: { + filter: [ + { bool: { minimum_should_match: 1, should: [{ match: { 'host.name': 'linux' } }] } }, + ], + must: [], + must_not: [], + should: [], + }, + }); + }); + + test('it should work when lists has value null', () => { + const esQuery = getQueryFilter('host.name: linux', 'kuery', [], ['auditbeat-*'], null); + expect(esQuery).toEqual({ + bool: { + filter: [ + { bool: { minimum_should_match: 1, should: [{ match: { 'host.name': 'linux' } }] } }, + ], + must: [], + must_not: [], + should: [], + }, + }); + }); + + test('it should work when lists has value undefined', () => { + const esQuery = getQueryFilter('host.name: linux', 'kuery', [], ['auditbeat-*'], undefined); + expect(esQuery).toEqual({ + bool: { + filter: [ + { bool: { minimum_should_match: 1, should: [{ match: { 'host.name': 'linux' } }] } }, + ], + must: [], + must_not: [], + should: [], + }, + }); + }); }); describe('getFilter', () => { @@ -380,6 +488,7 @@ describe('get_filter', () => { savedId: undefined, services: servicesMock, index: ['auditbeat-*'], + lists: undefined, }); expect(filter).toEqual({ bool: { @@ -414,6 +523,7 @@ describe('get_filter', () => { savedId: undefined, services: servicesMock, index: ['auditbeat-*'], + lists: undefined, }) ).rejects.toThrow('query, filters, and index parameter should be defined'); }); @@ -428,6 +538,7 @@ describe('get_filter', () => { savedId: undefined, services: servicesMock, index: ['auditbeat-*'], + lists: undefined, }) ).rejects.toThrow('query, filters, and index parameter should be defined'); }); @@ -442,6 +553,7 @@ describe('get_filter', () => { savedId: undefined, services: servicesMock, index: undefined, + lists: undefined, }) ).rejects.toThrow('query, filters, and index parameter should be defined'); }); @@ -455,6 +567,7 @@ describe('get_filter', () => { savedId: 'some-id', services: servicesMock, index: ['auditbeat-*'], + lists: undefined, }); expect(filter).toEqual({ bool: { @@ -478,6 +591,7 @@ describe('get_filter', () => { savedId: undefined, services: servicesMock, index: ['auditbeat-*'], + lists: undefined, }) ).rejects.toThrow('savedId parameter should be defined'); }); @@ -492,6 +606,7 @@ describe('get_filter', () => { savedId: 'some-id', services: servicesMock, index: undefined, + lists: undefined, }) ).rejects.toThrow('savedId parameter should be defined'); }); @@ -506,6 +621,7 @@ describe('get_filter', () => { savedId: 'some-id', services: servicesMock, index: undefined, + lists: undefined, }) ).rejects.toThrow('Unsupported Rule of type "machine_learning" supplied to getFilter'); }); @@ -515,7 +631,8 @@ describe('get_filter', () => { '(event.module:suricata and event.kind:alert) and suricata.eve.alert.signature_id: (2610182 or 2610183 or 2610184 or 2610185 or 2610186 or 2610187)', 'kuery', [], - ['my custom index'] + ['my custom index'], + [] ); expect(esQuery).toEqual({ bool: { @@ -644,5 +761,68 @@ describe('get_filter', () => { }, }); }); + + test('returns a query when given a list', async () => { + const filter = await getFilter({ + type: 'query', + filters: undefined, + language: 'kuery', + query: 'host.name: siem', + savedId: undefined, + services: servicesMock, + index: ['auditbeat-*'], + lists: [ + { + field: 'event.module', + values_operator: 'excluded', + values_type: 'match', + values: [ + { + name: 'suricata', + }, + ], + }, + ], + }); + expect(filter).toEqual({ + bool: { + filter: [ + { + bool: { + filter: [ + { + bool: { + minimum_should_match: 1, + should: [ + { + match: { + 'host.name': 'siem', + }, + }, + ], + }, + }, + { + bool: { + minimum_should_match: 1, + should: [ + { + match: { + 'event.module': 'suricata', + }, + }, + ], + }, + }, + ], + }, + }, + ], + must: [], + must_not: [], + should: [], + }, + }); + }); }); }); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/get_filter.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/get_filter.ts similarity index 83% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/get_filter.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/get_filter.ts index 82a50222dc3514..d8fdab55bddebc 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/get_filter.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/get_filter.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AlertServices } from '../../../../../../../plugins/alerting/server'; +import { AlertServices } from '../../../../../alerting/server'; import { assertUnreachable } from '../../../utils/build_query'; import { Filter, @@ -12,22 +12,25 @@ import { esQuery, esFilters, IIndexPattern, -} from '../../../../../../../../src/plugins/data/server'; -import { PartialFilter, RuleAlertParams } from '../types'; +} from '../../../../../../../src/plugins/data/server'; +import { PartialFilter, RuleAlertParams, Language } from '../types'; import { BadRequestError } from '../errors/bad_request_error'; +import { buildQueryExceptions } from './build_exceptions_query'; export const getQueryFilter = ( query: string, - language: string, + language: Language, filters: PartialFilter[], - index: string[] + index: string[], + lists: RuleAlertParams['exceptions_list'] ) => { const indexPattern = { fields: [], title: index.join(), } as IIndexPattern; - const queries: Query[] = [{ query, language }]; + const queries: Query[] = buildQueryExceptions({ query, language, lists }); + const config = { allowLeadingWildcards: true, queryStringOptions: { analyze_wildcard: true }, @@ -45,18 +48,19 @@ export const getQueryFilter = ( interface GetFilterArgs { type: RuleAlertParams['type']; filters: PartialFilter[] | undefined | null; - language: string | undefined | null; + language: Language | undefined | null; query: string | undefined | null; savedId: string | undefined | null; services: AlertServices; index: string[] | undefined | null; + lists: RuleAlertParams['exceptions_list']; } interface QueryAttributes { // NOTE: doesn't match Query interface query: { query: string; - language: string; + language: Language; }; filters: PartialFilter[]; } @@ -69,11 +73,12 @@ export const getFilter = async ({ services, type, query, + lists, }: GetFilterArgs): Promise => { switch (type) { case 'query': { if (query != null && language != null && index != null) { - return getQueryFilter(query, language, filters || [], index); + return getQueryFilter(query, language, filters || [], index, lists); } else { throw new BadRequestError('query, filters, and index parameter should be defined'); } @@ -90,13 +95,14 @@ export const getFilter = async ({ savedObject.attributes.query.query, savedObject.attributes.query.language, savedObject.attributes.filters, - index + index, + lists ); } catch (err) { // saved object does not exist, so try and fall back if the user pushed // any additional language, query, filters, etc... if (query != null && language != null && index != null) { - return getQueryFilter(query, language, filters || [], index); + return getQueryFilter(query, language, filters || [], index, lists); } else { // user did not give any additional fall back mechanism for generating a rule // rethrow error for activity monitoring diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/get_input_output_index.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/get_input_output_index.test.ts similarity index 89% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/get_input_output_index.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/get_input_output_index.test.ts index ccd882228d4de3..6fc99ada16ece0 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/get_input_output_index.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/get_input_output_index.test.ts @@ -4,10 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { DEFAULT_INDEX_KEY } from '../../../../common/constants'; +import { alertsMock, AlertServicesMock } from '../../../../../alerting/server/mocks'; +import { DEFAULT_INDEX_KEY, DEFAULT_INDEX_PATTERN } from '../../../../common/constants'; import { getInputIndex } from './get_input_output_index'; -import { defaultIndexPattern } from '../../../../default_index_pattern'; -import { alertsMock, AlertServicesMock } from '../../../../../../../plugins/alerting/server/mocks'; describe('get_input_output_index', () => { let servicesMock: AlertServicesMock; @@ -78,7 +77,7 @@ describe('get_input_output_index', () => { }, })); const inputIndex = await getInputIndex(servicesMock, '8.0.0', null); - expect(inputIndex).toEqual(defaultIndexPattern); + expect(inputIndex).toEqual(DEFAULT_INDEX_PATTERN); }); test('Returns a saved object inputIndex default from constants if inputIndex passed in is undefined and the key is also null', async () => { @@ -91,17 +90,17 @@ describe('get_input_output_index', () => { }, })); const inputIndex = await getInputIndex(servicesMock, '8.0.0', undefined); - expect(inputIndex).toEqual(defaultIndexPattern); + expect(inputIndex).toEqual(DEFAULT_INDEX_PATTERN); }); test('Returns a saved object inputIndex default from constants if both passed in inputIndex and configuration attributes are missing and the index is undefined', async () => { const inputIndex = await getInputIndex(servicesMock, '8.0.0', undefined); - expect(inputIndex).toEqual(defaultIndexPattern); + expect(inputIndex).toEqual(DEFAULT_INDEX_PATTERN); }); test('Returns a saved object inputIndex default from constants if both passed in inputIndex and configuration attributes are missing and the index is null', async () => { const inputIndex = await getInputIndex(servicesMock, '8.0.0', null); - expect(inputIndex).toEqual(defaultIndexPattern); + expect(inputIndex).toEqual(DEFAULT_INDEX_PATTERN); }); }); }); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/get_input_output_index.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/get_input_output_index.ts similarity index 75% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/get_input_output_index.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/get_input_output_index.ts index c93990e25b52be..85e3eeac476e41 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/get_input_output_index.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/get_input_output_index.ts @@ -4,9 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AlertServices } from '../../../../../../../plugins/alerting/server'; -import { defaultIndexPattern } from '../../../../default_index_pattern'; -import { DEFAULT_INDEX_KEY } from '../../../../common/constants'; +import { DEFAULT_INDEX_KEY, DEFAULT_INDEX_PATTERN } from '../../../../common/constants'; +import { AlertServices } from '../../../../../alerting/server'; export const getInputIndex = async ( services: AlertServices, @@ -22,7 +21,7 @@ export const getInputIndex = async ( if (configuration.attributes != null && configuration.attributes[DEFAULT_INDEX_KEY] != null) { return configuration.attributes[DEFAULT_INDEX_KEY]; } else { - return defaultIndexPattern; + return DEFAULT_INDEX_PATTERN; } } }; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/get_or_create_rule_statuses.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/get_or_create_rule_statuses.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/get_or_create_rule_statuses.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/get_or_create_rule_statuses.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/get_rule_status_saved_objects.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/get_rule_status_saved_objects.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/get_rule_status_saved_objects.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/get_rule_status_saved_objects.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/rule_messages.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/rule_messages.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/rule_messages.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/rule_messages.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/rule_messages.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/rule_messages.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/rule_messages.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/rule_messages.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/rule_status_saved_objects_client.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/rule_status_saved_objects_client.ts similarity index 96% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/rule_status_saved_objects_client.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/rule_status_saved_objects_client.ts index 11cbf673044091..5f76889f238a11 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/rule_status_saved_objects_client.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/rule_status_saved_objects_client.ts @@ -10,7 +10,7 @@ import { SavedObjectsUpdateResponse, SavedObjectsFindOptions, SavedObjectsFindResponse, -} from '../../../../../../../../src/core/server'; +} from '../../../../../../../src/core/server'; import { ruleStatusSavedObjectType } from '../rules/saved_object_mappings'; import { IRuleStatusAttributes } from '../rules/types'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/rule_status_service.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/rule_status_service.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/rule_status_service.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/rule_status_service.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/rule_status_service.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/rule_status_service.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/rule_status_service.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/rule_status_service.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/search_after_bulk_create.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/search_after_bulk_create.test.ts similarity index 99% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/search_after_bulk_create.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/search_after_bulk_create.test.ts index 9e2f36fe2653af..cec011ae8c4455 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/search_after_bulk_create.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/search_after_bulk_create.test.ts @@ -16,7 +16,7 @@ import { } from './__mocks__/es_results'; import { searchAfterAndBulkCreate } from './search_after_bulk_create'; import { DEFAULT_SIGNALS_INDEX } from '../../../../common/constants'; -import { alertsMock, AlertServicesMock } from '../../../../../../../plugins/alerting/server/mocks'; +import { alertsMock, AlertServicesMock } from '../../../../../alerting/server/mocks'; import uuid from 'uuid'; describe('searchAfterAndBulkCreate', () => { diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/search_after_bulk_create.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/search_after_bulk_create.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/search_after_bulk_create.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/search_after_bulk_create.ts index 3a964cb91fbdb7..e287e33295c896 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/search_after_bulk_create.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/search_after_bulk_create.ts @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AlertServices } from '../../../../../../../plugins/alerting/server'; +import { AlertServices } from '../../../../../alerting/server'; import { RuleAlertAction } from '../../../../common/detection_engine/types'; import { RuleTypeParams, RefreshTypes } from '../types'; -import { Logger } from '../../../../../../../../src/core/server'; +import { Logger } from '../../../../../../../src/core/server'; import { singleSearchAfter } from './single_search_after'; import { singleBulkCreate } from './single_bulk_create'; import { SignalSearchResponse } from './types'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/siem_rule_action_groups.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/siem_rule_action_groups.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/siem_rule_action_groups.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/siem_rule_action_groups.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_params_schema.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/signal_params_schema.ts similarity index 95% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_params_schema.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/signal_params_schema.ts index 58dd53b6447c51..81a6ce9b08f02d 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_params_schema.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/signal_params_schema.ts @@ -39,5 +39,5 @@ export const signalParamsSchema = () => type: schema.string(), references: schema.arrayOf(schema.string(), { defaultValue: [] }), version: schema.number({ defaultValue: 1 }), - lists: schema.maybe(schema.arrayOf(schema.object({}, { unknowns: 'allow' }))), + exceptions_list: schema.maybe(schema.arrayOf(schema.object({}, { unknowns: 'allow' }))), }); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.test.ts similarity index 99% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.test.ts index 31b407da111eaa..7eecc5cb9bad03 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.test.ts @@ -8,7 +8,7 @@ import moment from 'moment'; import { loggerMock } from 'src/core/server/logging/logger.mock'; import { getResult, getMlResult } from '../routes/__mocks__/request_responses'; import { signalRulesAlertType } from './signal_rule_alert_type'; -import { alertsMock, AlertServicesMock } from '../../../../../../../plugins/alerting/server/mocks'; +import { alertsMock, AlertServicesMock } from '../../../../../alerting/server/mocks'; import { ruleStatusServiceFactory } from './rule_status_service'; import { getGapBetweenRuns } from './utils'; import { RuleExecutorOptions } from './types'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.ts similarity index 99% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.ts index 0357f906f8035a..137603741dc8f2 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/signal_rule_alert_type.ts @@ -66,6 +66,7 @@ export const signalRulesAlertType = ({ query, to, type, + exceptions_list, } = params; const searchAfterSize = Math.min(maxSignals, DEFAULT_SEARCH_AFTER_PAGE_SIZE); let hasError: boolean = false; @@ -200,6 +201,7 @@ export const signalRulesAlertType = ({ savedId, services, index: inputIndex, + lists: exceptions_list, }); const noReIndex = buildEventsSearchQuery({ diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/single_bulk_create.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/single_bulk_create.test.ts similarity index 99% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/single_bulk_create.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/single_bulk_create.test.ts index 3401d7417ec624..51cc0f449b17a2 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/single_bulk_create.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/single_bulk_create.test.ts @@ -18,7 +18,7 @@ import { } from './__mocks__/es_results'; import { DEFAULT_SIGNALS_INDEX } from '../../../../common/constants'; import { singleBulkCreate, filterDuplicateRules } from './single_bulk_create'; -import { alertsMock, AlertServicesMock } from '../../../../../../../plugins/alerting/server/mocks'; +import { alertsMock, AlertServicesMock } from '../../../../../alerting/server/mocks'; describe('singleBulkCreate', () => { const mockService: AlertServicesMock = alertsMock.createAlertServices(); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/single_bulk_create.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/single_bulk_create.ts similarity index 96% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/single_bulk_create.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/single_bulk_create.ts index 4373a35cac0c5a..c098a4b68450de 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/single_bulk_create.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/single_bulk_create.ts @@ -6,13 +6,13 @@ import { countBy, isEmpty } from 'lodash'; import { performance } from 'perf_hooks'; -import { AlertServices } from '../../../../../../../plugins/alerting/server'; +import { AlertServices } from '../../../../../alerting/server'; import { SignalSearchResponse, BulkResponse } from './types'; import { RuleAlertAction } from '../../../../common/detection_engine/types'; import { RuleTypeParams, RefreshTypes } from '../types'; import { generateId, makeFloatString, errorAggregator } from './utils'; import { buildBulkBody } from './build_bulk_body'; -import { Logger } from '../../../../../../../../src/core/server'; +import { Logger } from '../../../../../../../src/core/server'; interface SingleBulkCreateParams { someResult: SignalSearchResponse; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/single_search_after.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/single_search_after.test.ts similarity index 95% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/single_search_after.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/single_search_after.test.ts index dbeab70595e4f1..580080966457e7 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/single_search_after.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/single_search_after.test.ts @@ -10,7 +10,7 @@ import { sampleDocSearchResultsWithSortId, } from './__mocks__/es_results'; import { singleSearchAfter } from './single_search_after'; -import { alertsMock, AlertServicesMock } from '../../../../../../../plugins/alerting/server/mocks'; +import { alertsMock, AlertServicesMock } from '../../../../../alerting/server/mocks'; describe('singleSearchAfter', () => { const mockService: AlertServicesMock = alertsMock.createAlertServices(); diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/single_search_after.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/single_search_after.ts similarity index 91% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/single_search_after.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/single_search_after.ts index 6fc8fe4bd24d94..8071c18713c19a 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/single_search_after.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/single_search_after.ts @@ -5,8 +5,8 @@ */ import { performance } from 'perf_hooks'; -import { AlertServices } from '../../../../../../../plugins/alerting/server'; -import { Logger } from '../../../../../../../../src/core/server'; +import { AlertServices } from '../../../../../alerting/server'; +import { Logger } from '../../../../../../../src/core/server'; import { SignalSearchResponse } from './types'; import { buildEventsSearchQuery } from './build_events_query'; import { makeFloatString } from './utils'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/types.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/types.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/types.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/types.ts index a7556d992d20ad..b493bab8b4610a 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/types.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/types.ts @@ -4,14 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ +import { AlertType, State, AlertExecutorOptions } from '../../../../../alerting/server'; import { RuleAlertAction } from '../../../../common/detection_engine/types'; import { RuleAlertParams, OutputRuleAlertRest } from '../types'; import { SearchResponse } from '../../types'; -import { - AlertType, - State, - AlertExecutorOptions, -} from '../../../../../../../plugins/alerting/server'; export interface SignalsParams { signalIds: string[] | undefined | null; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/utils.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/utils.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/utils.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/utils.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/utils.ts b/x-pack/plugins/siem/server/lib/detection_engine/signals/utils.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/utils.ts rename to x-pack/plugins/siem/server/lib/detection_engine/signals/utils.ts index 077d3a9279c5e9..f06c765073d78d 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/signals/utils.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/signals/utils.ts @@ -6,7 +6,8 @@ import { createHash } from 'crypto'; import moment from 'moment'; import dateMath from '@elastic/datemath'; -import { parseDuration } from '../../../../../../../plugins/alerting/server'; + +import { parseDuration } from '../../../../../alerting/server'; import { BulkResponse, BulkResponseErrorAggregation } from './types'; export const generateId = ( diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/tags/read_tags.test.ts b/x-pack/plugins/siem/server/lib/detection_engine/tags/read_tags.test.ts similarity index 99% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/tags/read_tags.test.ts rename to x-pack/plugins/siem/server/lib/detection_engine/tags/read_tags.test.ts index 80c107c991bb75..d29d885f9797ad 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/tags/read_tags.test.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/tags/read_tags.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { alertsClientMock } from '../../../../../../../plugins/alerting/server/mocks'; +import { alertsClientMock } from '../../../../../alerting/server/mocks'; import { getResult, getFindResultWithMultiHits } from '../routes/__mocks__/request_responses'; import { INTERNAL_RULE_ID_KEY, INTERNAL_IDENTIFIER } from '../../../../common/constants'; import { readRawTags, readTags, convertTagsToSet, convertToTags, isTags } from './read_tags'; diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/tags/read_tags.ts b/x-pack/plugins/siem/server/lib/detection_engine/tags/read_tags.ts similarity index 96% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/tags/read_tags.ts rename to x-pack/plugins/siem/server/lib/detection_engine/tags/read_tags.ts index d343bca8c97bb1..addd3737128501 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/tags/read_tags.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/tags/read_tags.ts @@ -6,7 +6,7 @@ import { has } from 'lodash/fp'; import { INTERNAL_IDENTIFIER } from '../../../../common/constants'; -import { AlertsClient } from '../../../../../../../plugins/alerting/server'; +import { AlertsClient } from '../../../../../alerting/server'; import { findRules } from '../rules/find_rules'; export interface TagType { diff --git a/x-pack/legacy/plugins/siem/server/lib/detection_engine/types.ts b/x-pack/plugins/siem/server/lib/detection_engine/types.ts similarity index 91% rename from x-pack/legacy/plugins/siem/server/lib/detection_engine/types.ts rename to x-pack/plugins/siem/server/lib/detection_engine/types.ts index 035f1b10ff8b2c..f2026804da51ab 100644 --- a/x-pack/legacy/plugins/siem/server/lib/detection_engine/types.ts +++ b/x-pack/plugins/siem/server/lib/detection_engine/types.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CallAPIOptions } from '../../../../../../../src/core/server'; -import { Filter } from '../../../../../../../src/plugins/data/server'; +import { CallAPIOptions } from '../../../../../../src/core/server'; +import { Filter } from '../../../../../../src/plugins/data/server'; import { IRuleStatusAttributes } from './rules/types'; import { ListsDefaultArraySchema } from './routes/schemas/types/lists_default_array'; import { RuleAlertAction, RuleType } from '../../../common/detection_engine/types'; @@ -24,7 +24,7 @@ export interface ThreatParams { technique: IMitreAttack[]; } -// Notice below we are using lists: ListsDefaultArraySchema[]; which is coming directly from the response output section. +// Notice below we are using lists: ListsAndArraySchema[]; which is coming directly from the response output section. // TODO: Eventually this whole RuleAlertParams will be replaced with io-ts. For now we can slowly strangle it out and reduce duplicate types // We don't have the input types defined through io-ts just yet but as we being introducing types from there we will more and more remove // types and share them between input and output schema but have an input Rule Schema and an output Rule Schema. @@ -34,6 +34,8 @@ export interface Meta { kibana_siem_app_url?: string | undefined; } +export type Language = 'kuery' | 'lucene'; + export interface RuleAlertParams { actions: RuleAlertAction[]; anomalyThreshold: number | undefined; @@ -47,7 +49,7 @@ export interface RuleAlertParams { index: string[] | undefined | null; interval: string; ruleId: string | undefined | null; - language: string | undefined | null; + language: Language | undefined | null; maxSignals: number; machineLearningJobId: string | undefined; riskScore: number; @@ -66,7 +68,7 @@ export interface RuleAlertParams { type: RuleType; version: number; throttle: string | undefined | null; - lists: ListsDefaultArraySchema | null | undefined; + exceptions_list: ListsDefaultArraySchema | null | undefined; } export type RuleTypeParams = Omit< diff --git a/x-pack/legacy/plugins/siem/server/lib/ecs_fields/extend_map.test.ts b/x-pack/plugins/siem/server/lib/ecs_fields/extend_map.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/ecs_fields/extend_map.test.ts rename to x-pack/plugins/siem/server/lib/ecs_fields/extend_map.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/ecs_fields/extend_map.ts b/x-pack/plugins/siem/server/lib/ecs_fields/extend_map.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/ecs_fields/extend_map.ts rename to x-pack/plugins/siem/server/lib/ecs_fields/extend_map.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/ecs_fields/index.ts b/x-pack/plugins/siem/server/lib/ecs_fields/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/ecs_fields/index.ts rename to x-pack/plugins/siem/server/lib/ecs_fields/index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/events/elasticsearch_adapter.test.ts b/x-pack/plugins/siem/server/lib/events/elasticsearch_adapter.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/events/elasticsearch_adapter.test.ts rename to x-pack/plugins/siem/server/lib/events/elasticsearch_adapter.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/events/elasticsearch_adapter.ts b/x-pack/plugins/siem/server/lib/events/elasticsearch_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/events/elasticsearch_adapter.ts rename to x-pack/plugins/siem/server/lib/events/elasticsearch_adapter.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/events/index.ts b/x-pack/plugins/siem/server/lib/events/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/events/index.ts rename to x-pack/plugins/siem/server/lib/events/index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/events/mock.ts b/x-pack/plugins/siem/server/lib/events/mock.ts similarity index 99% rename from x-pack/legacy/plugins/siem/server/lib/events/mock.ts rename to x-pack/plugins/siem/server/lib/events/mock.ts index 3eb841cbad411d..f5fb2f481ca776 100644 --- a/x-pack/legacy/plugins/siem/server/lib/events/mock.ts +++ b/x-pack/plugins/siem/server/lib/events/mock.ts @@ -5,7 +5,7 @@ */ import { cloneDeep } from 'lodash/fp'; -import { defaultIndexPattern } from '../../../default_index_pattern'; +import { DEFAULT_INDEX_PATTERN } from '../../../common/constants'; import { RequestDetailsOptions } from './types'; export const mockResponseSearchTimelineDetails = { @@ -185,7 +185,7 @@ export const mockResponseSearchTimelineDetails = { export const mockOptions: RequestDetailsOptions = { indexName: 'auditbeat-8.0.0-2019.03.29-000003', eventId: 'TUfUymkBCQofM5eXGBYL', - defaultIndex: defaultIndexPattern, + defaultIndex: DEFAULT_INDEX_PATTERN, }; export const mockRequest = { diff --git a/x-pack/legacy/plugins/siem/server/lib/events/query.dsl.ts b/x-pack/plugins/siem/server/lib/events/query.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/events/query.dsl.ts rename to x-pack/plugins/siem/server/lib/events/query.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/events/query.last_event_time.dsl.ts b/x-pack/plugins/siem/server/lib/events/query.last_event_time.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/events/query.last_event_time.dsl.ts rename to x-pack/plugins/siem/server/lib/events/query.last_event_time.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/events/types.ts b/x-pack/plugins/siem/server/lib/events/types.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/events/types.ts rename to x-pack/plugins/siem/server/lib/events/types.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/framework/index.ts b/x-pack/plugins/siem/server/lib/framework/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/framework/index.ts rename to x-pack/plugins/siem/server/lib/framework/index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/framework/kibana_framework_adapter.ts b/x-pack/plugins/siem/server/lib/framework/kibana_framework_adapter.ts similarity index 95% rename from x-pack/legacy/plugins/siem/server/lib/framework/kibana_framework_adapter.ts rename to x-pack/plugins/siem/server/lib/framework/kibana_framework_adapter.ts index 6b41426e047cac..762416149c0fbb 100644 --- a/x-pack/legacy/plugins/siem/server/lib/framework/kibana_framework_adapter.ts +++ b/x-pack/plugins/siem/server/lib/framework/kibana_framework_adapter.ts @@ -13,9 +13,9 @@ import { KibanaResponseFactory, RequestHandlerContext, KibanaRequest, -} from '../../../../../../../src/core/server'; -import { IndexPatternsFetcher } from '../../../../../../../src/plugins/data/server'; -import { AuthenticatedUser } from '../../../../../../plugins/security/common/model'; +} from '../../../../../../src/core/server'; +import { IndexPatternsFetcher } from '../../../../../../src/plugins/data/server'; +import { AuthenticatedUser } from '../../../../security/common/model'; import { CoreSetup, SetupPlugins } from '../../plugin'; import { diff --git a/x-pack/legacy/plugins/siem/server/lib/framework/types.ts b/x-pack/plugins/siem/server/lib/framework/types.ts similarity index 96% rename from x-pack/legacy/plugins/siem/server/lib/framework/types.ts rename to x-pack/plugins/siem/server/lib/framework/types.ts index 7d049d1dcd1954..abe572df87063f 100644 --- a/x-pack/legacy/plugins/siem/server/lib/framework/types.ts +++ b/x-pack/plugins/siem/server/lib/framework/types.ts @@ -7,8 +7,8 @@ import { IndicesGetMappingParams } from 'elasticsearch'; import { GraphQLSchema } from 'graphql'; -import { RequestHandlerContext, KibanaRequest } from '../../../../../../../src/core/server'; -import { AuthenticatedUser } from '../../../../../../plugins/security/common/model'; +import { RequestHandlerContext, KibanaRequest } from '../../../../../../src/core/server'; +import { AuthenticatedUser } from '../../../../security/common/model'; import { ESQuery } from '../../../common/typed_json'; import { PaginationInput, diff --git a/x-pack/legacy/plugins/siem/server/lib/hosts/elasticsearch_adapter.test.ts b/x-pack/plugins/siem/server/lib/hosts/elasticsearch_adapter.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/hosts/elasticsearch_adapter.test.ts rename to x-pack/plugins/siem/server/lib/hosts/elasticsearch_adapter.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/hosts/elasticsearch_adapter.ts b/x-pack/plugins/siem/server/lib/hosts/elasticsearch_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/hosts/elasticsearch_adapter.ts rename to x-pack/plugins/siem/server/lib/hosts/elasticsearch_adapter.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/hosts/helpers.test.ts b/x-pack/plugins/siem/server/lib/hosts/helpers.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/hosts/helpers.test.ts rename to x-pack/plugins/siem/server/lib/hosts/helpers.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/hosts/helpers.ts b/x-pack/plugins/siem/server/lib/hosts/helpers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/hosts/helpers.ts rename to x-pack/plugins/siem/server/lib/hosts/helpers.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/hosts/index.ts b/x-pack/plugins/siem/server/lib/hosts/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/hosts/index.ts rename to x-pack/plugins/siem/server/lib/hosts/index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/hosts/mock.ts b/x-pack/plugins/siem/server/lib/hosts/mock.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/hosts/mock.ts rename to x-pack/plugins/siem/server/lib/hosts/mock.ts index 6b72c4a5a28434..30082990b55f96 100644 --- a/x-pack/legacy/plugins/siem/server/lib/hosts/mock.ts +++ b/x-pack/plugins/siem/server/lib/hosts/mock.ts @@ -4,9 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +import { DEFAULT_INDEX_PATTERN } from '../../../common/constants'; import { Direction, HostsFields } from '../../graphql/types'; -import { defaultIndexPattern } from '../../../default_index_pattern'; - import { HostOverviewRequestOptions, HostLastFirstSeenRequestOptions, @@ -14,7 +13,7 @@ import { } from '.'; export const mockGetHostsOptions: HostsRequestOptions = { - defaultIndex: defaultIndexPattern, + defaultIndex: DEFAULT_INDEX_PATTERN, sourceConfiguration: { fields: { container: 'docker.container.name', @@ -297,7 +296,7 @@ export const mockGetHostOverviewOptions: HostOverviewRequestOptions = { }, }, timerange: { interval: '12h', to: 1554824274610, from: 1554737874610 }, - defaultIndex: defaultIndexPattern, + defaultIndex: DEFAULT_INDEX_PATTERN, fields: [ '_id', 'host.architecture', @@ -501,7 +500,7 @@ export const mockGetHostOverviewResult = { }; export const mockGetHostLastFirstSeenOptions: HostLastFirstSeenRequestOptions = { - defaultIndex: defaultIndexPattern, + defaultIndex: DEFAULT_INDEX_PATTERN, sourceConfiguration: { fields: { container: 'docker.container.name', diff --git a/x-pack/legacy/plugins/siem/server/lib/hosts/query.detail_host.dsl.ts b/x-pack/plugins/siem/server/lib/hosts/query.detail_host.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/hosts/query.detail_host.dsl.ts rename to x-pack/plugins/siem/server/lib/hosts/query.detail_host.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/hosts/query.hosts.dsl.ts b/x-pack/plugins/siem/server/lib/hosts/query.hosts.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/hosts/query.hosts.dsl.ts rename to x-pack/plugins/siem/server/lib/hosts/query.hosts.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/hosts/query.last_first_seen_host.dsl.ts b/x-pack/plugins/siem/server/lib/hosts/query.last_first_seen_host.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/hosts/query.last_first_seen_host.dsl.ts rename to x-pack/plugins/siem/server/lib/hosts/query.last_first_seen_host.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/hosts/types.ts b/x-pack/plugins/siem/server/lib/hosts/types.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/hosts/types.ts rename to x-pack/plugins/siem/server/lib/hosts/types.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/index_fields/elasticsearch_adapter.test.ts b/x-pack/plugins/siem/server/lib/index_fields/elasticsearch_adapter.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/index_fields/elasticsearch_adapter.test.ts rename to x-pack/plugins/siem/server/lib/index_fields/elasticsearch_adapter.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/index_fields/elasticsearch_adapter.ts b/x-pack/plugins/siem/server/lib/index_fields/elasticsearch_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/index_fields/elasticsearch_adapter.ts rename to x-pack/plugins/siem/server/lib/index_fields/elasticsearch_adapter.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/index_fields/index.ts b/x-pack/plugins/siem/server/lib/index_fields/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/index_fields/index.ts rename to x-pack/plugins/siem/server/lib/index_fields/index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/index_fields/mock.ts b/x-pack/plugins/siem/server/lib/index_fields/mock.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/index_fields/mock.ts rename to x-pack/plugins/siem/server/lib/index_fields/mock.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/index_fields/types.ts b/x-pack/plugins/siem/server/lib/index_fields/types.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/index_fields/types.ts rename to x-pack/plugins/siem/server/lib/index_fields/types.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/ip_details/elasticsearch_adapter.test.ts b/x-pack/plugins/siem/server/lib/ip_details/elasticsearch_adapter.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/ip_details/elasticsearch_adapter.test.ts rename to x-pack/plugins/siem/server/lib/ip_details/elasticsearch_adapter.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/ip_details/elasticsearch_adapter.ts b/x-pack/plugins/siem/server/lib/ip_details/elasticsearch_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/ip_details/elasticsearch_adapter.ts rename to x-pack/plugins/siem/server/lib/ip_details/elasticsearch_adapter.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/ip_details/index.ts b/x-pack/plugins/siem/server/lib/ip_details/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/ip_details/index.ts rename to x-pack/plugins/siem/server/lib/ip_details/index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/ip_details/mock.ts b/x-pack/plugins/siem/server/lib/ip_details/mock.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/ip_details/mock.ts rename to x-pack/plugins/siem/server/lib/ip_details/mock.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/ip_details/query_overview.dsl.ts b/x-pack/plugins/siem/server/lib/ip_details/query_overview.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/ip_details/query_overview.dsl.ts rename to x-pack/plugins/siem/server/lib/ip_details/query_overview.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/ip_details/query_users.dsl.ts b/x-pack/plugins/siem/server/lib/ip_details/query_users.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/ip_details/query_users.dsl.ts rename to x-pack/plugins/siem/server/lib/ip_details/query_users.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/ip_details/types.ts b/x-pack/plugins/siem/server/lib/ip_details/types.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/ip_details/types.ts rename to x-pack/plugins/siem/server/lib/ip_details/types.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_hosts/elasticsearch_adapter.test.ts b/x-pack/plugins/siem/server/lib/kpi_hosts/elasticsearch_adapter.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_hosts/elasticsearch_adapter.test.ts rename to x-pack/plugins/siem/server/lib/kpi_hosts/elasticsearch_adapter.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_hosts/elasticsearch_adapter.ts b/x-pack/plugins/siem/server/lib/kpi_hosts/elasticsearch_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_hosts/elasticsearch_adapter.ts rename to x-pack/plugins/siem/server/lib/kpi_hosts/elasticsearch_adapter.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_hosts/helpers.test.ts b/x-pack/plugins/siem/server/lib/kpi_hosts/helpers.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_hosts/helpers.test.ts rename to x-pack/plugins/siem/server/lib/kpi_hosts/helpers.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_hosts/helpers.ts b/x-pack/plugins/siem/server/lib/kpi_hosts/helpers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_hosts/helpers.ts rename to x-pack/plugins/siem/server/lib/kpi_hosts/helpers.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_hosts/index.ts b/x-pack/plugins/siem/server/lib/kpi_hosts/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_hosts/index.ts rename to x-pack/plugins/siem/server/lib/kpi_hosts/index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_hosts/mock.ts b/x-pack/plugins/siem/server/lib/kpi_hosts/mock.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/kpi_hosts/mock.ts rename to x-pack/plugins/siem/server/lib/kpi_hosts/mock.ts index ed9fbf0ba06466..a5affea2842a6c 100644 --- a/x-pack/legacy/plugins/siem/server/lib/kpi_hosts/mock.ts +++ b/x-pack/plugins/siem/server/lib/kpi_hosts/mock.ts @@ -4,14 +4,14 @@ * you may not use this file except in compliance with the Elastic License. */ -import { defaultIndexPattern } from '../../../default_index_pattern'; +import { DEFAULT_INDEX_PATTERN } from '../../../common/constants'; import { RequestBasicOptions } from '../framework/types'; const FROM = new Date('2019-05-03T13:24:00.660Z').valueOf(); const TO = new Date('2019-05-04T13:24:00.660Z').valueOf(); export const mockKpiHostsOptions: RequestBasicOptions = { - defaultIndex: defaultIndexPattern, + defaultIndex: DEFAULT_INDEX_PATTERN, sourceConfiguration: { fields: { container: 'docker.container.name', @@ -27,7 +27,7 @@ export const mockKpiHostsOptions: RequestBasicOptions = { }; export const mockKpiHostDetailsOptions: RequestBasicOptions = { - defaultIndex: defaultIndexPattern, + defaultIndex: DEFAULT_INDEX_PATTERN, sourceConfiguration: { fields: { container: 'docker.container.name', @@ -290,7 +290,7 @@ export const mockKpiHostsResponse = { export const mockKpiHostsResponseNodata = { responses: [null, null, null] }; const mockMsearchHeader = { - index: defaultIndexPattern, + index: DEFAULT_INDEX_PATTERN, allowNoIndices: true, ignoreUnavailable: true, }; diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_hosts/query_authentication.dsl.test.ts b/x-pack/plugins/siem/server/lib/kpi_hosts/query_authentication.dsl.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_hosts/query_authentication.dsl.test.ts rename to x-pack/plugins/siem/server/lib/kpi_hosts/query_authentication.dsl.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_hosts/query_authentication.dsl.ts b/x-pack/plugins/siem/server/lib/kpi_hosts/query_authentication.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_hosts/query_authentication.dsl.ts rename to x-pack/plugins/siem/server/lib/kpi_hosts/query_authentication.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_hosts/query_hosts.dsl.ts b/x-pack/plugins/siem/server/lib/kpi_hosts/query_hosts.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_hosts/query_hosts.dsl.ts rename to x-pack/plugins/siem/server/lib/kpi_hosts/query_hosts.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_hosts/query_unique_ips.dsl.test.ts b/x-pack/plugins/siem/server/lib/kpi_hosts/query_unique_ips.dsl.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_hosts/query_unique_ips.dsl.test.ts rename to x-pack/plugins/siem/server/lib/kpi_hosts/query_unique_ips.dsl.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_hosts/query_unique_ips.dsl.ts b/x-pack/plugins/siem/server/lib/kpi_hosts/query_unique_ips.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_hosts/query_unique_ips.dsl.ts rename to x-pack/plugins/siem/server/lib/kpi_hosts/query_unique_ips.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_hosts/types.ts b/x-pack/plugins/siem/server/lib/kpi_hosts/types.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_hosts/types.ts rename to x-pack/plugins/siem/server/lib/kpi_hosts/types.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_network/elastic_adapter.test.ts b/x-pack/plugins/siem/server/lib/kpi_network/elastic_adapter.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_network/elastic_adapter.test.ts rename to x-pack/plugins/siem/server/lib/kpi_network/elastic_adapter.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_network/elasticsearch_adapter.ts b/x-pack/plugins/siem/server/lib/kpi_network/elasticsearch_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_network/elasticsearch_adapter.ts rename to x-pack/plugins/siem/server/lib/kpi_network/elasticsearch_adapter.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_network/helpers.ts b/x-pack/plugins/siem/server/lib/kpi_network/helpers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_network/helpers.ts rename to x-pack/plugins/siem/server/lib/kpi_network/helpers.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_network/index.ts b/x-pack/plugins/siem/server/lib/kpi_network/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_network/index.ts rename to x-pack/plugins/siem/server/lib/kpi_network/index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_network/mock.ts b/x-pack/plugins/siem/server/lib/kpi_network/mock.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/kpi_network/mock.ts rename to x-pack/plugins/siem/server/lib/kpi_network/mock.ts index 7d86769de09f1b..cc0849ccdf1d24 100644 --- a/x-pack/legacy/plugins/siem/server/lib/kpi_network/mock.ts +++ b/x-pack/plugins/siem/server/lib/kpi_network/mock.ts @@ -4,11 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -import { defaultIndexPattern } from '../../../default_index_pattern'; +import { DEFAULT_INDEX_PATTERN } from '../../../common/constants'; import { RequestBasicOptions } from '../framework/types'; export const mockOptions: RequestBasicOptions = { - defaultIndex: defaultIndexPattern, + defaultIndex: DEFAULT_INDEX_PATTERN, sourceConfiguration: { fields: { container: 'docker.container.name', diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_network/query_dns.dsl.ts b/x-pack/plugins/siem/server/lib/kpi_network/query_dns.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_network/query_dns.dsl.ts rename to x-pack/plugins/siem/server/lib/kpi_network/query_dns.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_network/query_network_events.ts b/x-pack/plugins/siem/server/lib/kpi_network/query_network_events.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_network/query_network_events.ts rename to x-pack/plugins/siem/server/lib/kpi_network/query_network_events.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_network/query_tls_handshakes.dsl.ts b/x-pack/plugins/siem/server/lib/kpi_network/query_tls_handshakes.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_network/query_tls_handshakes.dsl.ts rename to x-pack/plugins/siem/server/lib/kpi_network/query_tls_handshakes.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_network/query_unique_flow.ts b/x-pack/plugins/siem/server/lib/kpi_network/query_unique_flow.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_network/query_unique_flow.ts rename to x-pack/plugins/siem/server/lib/kpi_network/query_unique_flow.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_network/query_unique_private_ips.dsl.ts b/x-pack/plugins/siem/server/lib/kpi_network/query_unique_private_ips.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_network/query_unique_private_ips.dsl.ts rename to x-pack/plugins/siem/server/lib/kpi_network/query_unique_private_ips.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/kpi_network/types.ts b/x-pack/plugins/siem/server/lib/kpi_network/types.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/kpi_network/types.ts rename to x-pack/plugins/siem/server/lib/kpi_network/types.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/machine_learning/index.ts b/x-pack/plugins/siem/server/lib/machine_learning/index.ts similarity index 92% rename from x-pack/legacy/plugins/siem/server/lib/machine_learning/index.ts rename to x-pack/plugins/siem/server/lib/machine_learning/index.ts index aa83df15f68d48..35789b5e202e2b 100644 --- a/x-pack/legacy/plugins/siem/server/lib/machine_learning/index.ts +++ b/x-pack/plugins/siem/server/lib/machine_learning/index.ts @@ -6,8 +6,8 @@ import { SearchResponse } from 'elasticsearch'; -import { AlertServices } from '../../../../../../plugins/alerting/server'; -import { AnomalyRecordDoc as Anomaly } from '../../../../../../plugins/ml/common/types/anomalies'; +import { AlertServices } from '../../../../alerting/server'; +import { AnomalyRecordDoc as Anomaly } from '../../../../ml/common/types/anomalies'; export { Anomaly }; export type AnomalyResults = SearchResponse; diff --git a/x-pack/legacy/plugins/siem/server/lib/matrix_histogram/elasticsearch_adapter.ts b/x-pack/plugins/siem/server/lib/matrix_histogram/elasticsearch_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/matrix_histogram/elasticsearch_adapter.ts rename to x-pack/plugins/siem/server/lib/matrix_histogram/elasticsearch_adapter.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/matrix_histogram/elasticseatch_adapter.test.ts b/x-pack/plugins/siem/server/lib/matrix_histogram/elasticseatch_adapter.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/matrix_histogram/elasticseatch_adapter.test.ts rename to x-pack/plugins/siem/server/lib/matrix_histogram/elasticseatch_adapter.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/matrix_histogram/index.ts b/x-pack/plugins/siem/server/lib/matrix_histogram/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/matrix_histogram/index.ts rename to x-pack/plugins/siem/server/lib/matrix_histogram/index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/matrix_histogram/mock.ts b/x-pack/plugins/siem/server/lib/matrix_histogram/mock.ts similarity index 96% rename from x-pack/legacy/plugins/siem/server/lib/matrix_histogram/mock.ts rename to x-pack/plugins/siem/server/lib/matrix_histogram/mock.ts index 3e51e926bea875..1d1ebfff936d20 100644 --- a/x-pack/legacy/plugins/siem/server/lib/matrix_histogram/mock.ts +++ b/x-pack/plugins/siem/server/lib/matrix_histogram/mock.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { defaultIndexPattern } from '../../../default_index_pattern'; +import { DEFAULT_INDEX_PATTERN } from '../../../common/constants'; import { HistogramType } from '../../graphql/types'; export const mockAlertsHistogramDataResponse = { @@ -111,7 +111,7 @@ export const mockOptions = { to: 9999, from: 1234, }, - defaultIndex: defaultIndexPattern, + defaultIndex: DEFAULT_INDEX_PATTERN, filterQuery: '', stackByField: 'event.module', histogramType: HistogramType.alerts, diff --git a/x-pack/legacy/plugins/siem/server/lib/matrix_histogram/query.anomalies_over_time.dsl.ts b/x-pack/plugins/siem/server/lib/matrix_histogram/query.anomalies_over_time.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/matrix_histogram/query.anomalies_over_time.dsl.ts rename to x-pack/plugins/siem/server/lib/matrix_histogram/query.anomalies_over_time.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/matrix_histogram/query.authentications_over_time.dsl.ts b/x-pack/plugins/siem/server/lib/matrix_histogram/query.authentications_over_time.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/matrix_histogram/query.authentications_over_time.dsl.ts rename to x-pack/plugins/siem/server/lib/matrix_histogram/query.authentications_over_time.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/matrix_histogram/query.events_over_time.dsl.ts b/x-pack/plugins/siem/server/lib/matrix_histogram/query.events_over_time.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/matrix_histogram/query.events_over_time.dsl.ts rename to x-pack/plugins/siem/server/lib/matrix_histogram/query.events_over_time.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/matrix_histogram/query_alerts.dsl.ts b/x-pack/plugins/siem/server/lib/matrix_histogram/query_alerts.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/matrix_histogram/query_alerts.dsl.ts rename to x-pack/plugins/siem/server/lib/matrix_histogram/query_alerts.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/matrix_histogram/query_dns_histogram.dsl.ts b/x-pack/plugins/siem/server/lib/matrix_histogram/query_dns_histogram.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/matrix_histogram/query_dns_histogram.dsl.ts rename to x-pack/plugins/siem/server/lib/matrix_histogram/query_dns_histogram.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/matrix_histogram/translations.ts b/x-pack/plugins/siem/server/lib/matrix_histogram/translations.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/matrix_histogram/translations.ts rename to x-pack/plugins/siem/server/lib/matrix_histogram/translations.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/matrix_histogram/types.ts b/x-pack/plugins/siem/server/lib/matrix_histogram/types.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/matrix_histogram/types.ts rename to x-pack/plugins/siem/server/lib/matrix_histogram/types.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/matrix_histogram/utils.ts b/x-pack/plugins/siem/server/lib/matrix_histogram/utils.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/matrix_histogram/utils.ts rename to x-pack/plugins/siem/server/lib/matrix_histogram/utils.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/network/__snapshots__/elastic_adapter.test.ts.snap b/x-pack/plugins/siem/server/lib/network/__snapshots__/elastic_adapter.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/network/__snapshots__/elastic_adapter.test.ts.snap rename to x-pack/plugins/siem/server/lib/network/__snapshots__/elastic_adapter.test.ts.snap diff --git a/x-pack/legacy/plugins/siem/server/lib/network/elastic_adapter.test.ts b/x-pack/plugins/siem/server/lib/network/elastic_adapter.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/network/elastic_adapter.test.ts rename to x-pack/plugins/siem/server/lib/network/elastic_adapter.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/network/elasticsearch_adapter.ts b/x-pack/plugins/siem/server/lib/network/elasticsearch_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/network/elasticsearch_adapter.ts rename to x-pack/plugins/siem/server/lib/network/elasticsearch_adapter.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/network/index.ts b/x-pack/plugins/siem/server/lib/network/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/network/index.ts rename to x-pack/plugins/siem/server/lib/network/index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/network/mock.ts b/x-pack/plugins/siem/server/lib/network/mock.ts similarity index 99% rename from x-pack/legacy/plugins/siem/server/lib/network/mock.ts rename to x-pack/plugins/siem/server/lib/network/mock.ts index 7ea692f27ef04d..38e82a4f19dca9 100644 --- a/x-pack/legacy/plugins/siem/server/lib/network/mock.ts +++ b/x-pack/plugins/siem/server/lib/network/mock.ts @@ -4,13 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import { defaultIndexPattern } from '../../../default_index_pattern'; +import { DEFAULT_INDEX_PATTERN } from '../../../common/constants'; import { Direction, FlowTargetSourceDest, NetworkTopTablesFields } from '../../graphql/types'; import { NetworkTopNFlowRequestOptions } from '.'; export const mockOptions: NetworkTopNFlowRequestOptions = { - defaultIndex: defaultIndexPattern, + defaultIndex: DEFAULT_INDEX_PATTERN, sourceConfiguration: { fields: { container: 'docker.container.name', diff --git a/x-pack/legacy/plugins/siem/server/lib/network/query_dns.dsl.ts b/x-pack/plugins/siem/server/lib/network/query_dns.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/network/query_dns.dsl.ts rename to x-pack/plugins/siem/server/lib/network/query_dns.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/network/query_http.dsl.ts b/x-pack/plugins/siem/server/lib/network/query_http.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/network/query_http.dsl.ts rename to x-pack/plugins/siem/server/lib/network/query_http.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/network/query_top_countries.dsl.ts b/x-pack/plugins/siem/server/lib/network/query_top_countries.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/network/query_top_countries.dsl.ts rename to x-pack/plugins/siem/server/lib/network/query_top_countries.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/network/query_top_n_flow.dsl.ts b/x-pack/plugins/siem/server/lib/network/query_top_n_flow.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/network/query_top_n_flow.dsl.ts rename to x-pack/plugins/siem/server/lib/network/query_top_n_flow.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/network/types.ts b/x-pack/plugins/siem/server/lib/network/types.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/network/types.ts rename to x-pack/plugins/siem/server/lib/network/types.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/note/saved_object.ts b/x-pack/plugins/siem/server/lib/note/saved_object.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/note/saved_object.ts rename to x-pack/plugins/siem/server/lib/note/saved_object.ts index 23162f38bffbaf..2b94fd4516786e 100644 --- a/x-pack/legacy/plugins/siem/server/lib/note/saved_object.ts +++ b/x-pack/plugins/siem/server/lib/note/saved_object.ts @@ -12,8 +12,8 @@ import { pipe } from 'fp-ts/lib/pipeable'; import { map, fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; -import { SavedObjectsFindOptions } from '../../../../../../../src/core/server'; -import { AuthenticatedUser } from '../../../../../../plugins/security/common/model'; +import { SavedObjectsFindOptions } from '../../../../../../src/core/server'; +import { AuthenticatedUser } from '../../../../security/common/model'; import { UNAUTHENTICATED_USER } from '../../../common/constants'; import { PageInfoNote, diff --git a/x-pack/legacy/plugins/siem/server/lib/note/saved_object_mappings.ts b/x-pack/plugins/siem/server/lib/note/saved_object_mappings.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/note/saved_object_mappings.ts rename to x-pack/plugins/siem/server/lib/note/saved_object_mappings.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/note/types.ts b/x-pack/plugins/siem/server/lib/note/types.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/note/types.ts rename to x-pack/plugins/siem/server/lib/note/types.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/overview/elastic_adapter.test.ts b/x-pack/plugins/siem/server/lib/overview/elastic_adapter.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/overview/elastic_adapter.test.ts rename to x-pack/plugins/siem/server/lib/overview/elastic_adapter.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/overview/elasticsearch_adapter.ts b/x-pack/plugins/siem/server/lib/overview/elasticsearch_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/overview/elasticsearch_adapter.ts rename to x-pack/plugins/siem/server/lib/overview/elasticsearch_adapter.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/overview/index.ts b/x-pack/plugins/siem/server/lib/overview/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/overview/index.ts rename to x-pack/plugins/siem/server/lib/overview/index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/overview/mock.ts b/x-pack/plugins/siem/server/lib/overview/mock.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/overview/mock.ts rename to x-pack/plugins/siem/server/lib/overview/mock.ts index 410b4d90b1e784..51d8a258569a8b 100644 --- a/x-pack/legacy/plugins/siem/server/lib/overview/mock.ts +++ b/x-pack/plugins/siem/server/lib/overview/mock.ts @@ -4,11 +4,11 @@ * you may not use this file except in compliance with the Elastic License. */ -import { defaultIndexPattern } from '../../../default_index_pattern'; +import { DEFAULT_INDEX_PATTERN } from '../../../common/constants'; import { RequestBasicOptions } from '../framework/types'; export const mockOptionsNetwork: RequestBasicOptions = { - defaultIndex: defaultIndexPattern, + defaultIndex: DEFAULT_INDEX_PATTERN, sourceConfiguration: { fields: { container: 'docker.container.name', @@ -79,7 +79,7 @@ export const mockResultNetwork = { }; export const mockOptionsHost: RequestBasicOptions = { - defaultIndex: defaultIndexPattern, + defaultIndex: DEFAULT_INDEX_PATTERN, sourceConfiguration: { fields: { container: 'docker.container.name', diff --git a/x-pack/legacy/plugins/siem/server/lib/overview/query.dsl.ts b/x-pack/plugins/siem/server/lib/overview/query.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/overview/query.dsl.ts rename to x-pack/plugins/siem/server/lib/overview/query.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/overview/types.ts b/x-pack/plugins/siem/server/lib/overview/types.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/overview/types.ts rename to x-pack/plugins/siem/server/lib/overview/types.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/pinned_event/saved_object.ts b/x-pack/plugins/siem/server/lib/pinned_event/saved_object.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/pinned_event/saved_object.ts rename to x-pack/plugins/siem/server/lib/pinned_event/saved_object.ts index a95c1da197f57d..7fc23d86d82186 100644 --- a/x-pack/legacy/plugins/siem/server/lib/pinned_event/saved_object.ts +++ b/x-pack/plugins/siem/server/lib/pinned_event/saved_object.ts @@ -10,8 +10,8 @@ import { pipe } from 'fp-ts/lib/pipeable'; import { map, fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; -import { SavedObjectsFindOptions } from '../../../../../../../src/core/server'; -import { AuthenticatedUser } from '../../../../../../plugins/security/common/model'; +import { SavedObjectsFindOptions } from '../../../../../../src/core/server'; +import { AuthenticatedUser } from '../../../../security/common/model'; import { UNAUTHENTICATED_USER } from '../../../common/constants'; import { FrameworkRequest } from '../framework'; import { diff --git a/x-pack/legacy/plugins/siem/server/lib/pinned_event/saved_object_mappings.ts b/x-pack/plugins/siem/server/lib/pinned_event/saved_object_mappings.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/pinned_event/saved_object_mappings.ts rename to x-pack/plugins/siem/server/lib/pinned_event/saved_object_mappings.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/pinned_event/types.ts b/x-pack/plugins/siem/server/lib/pinned_event/types.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/pinned_event/types.ts rename to x-pack/plugins/siem/server/lib/pinned_event/types.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/source_status/elasticsearch_adapter.ts b/x-pack/plugins/siem/server/lib/source_status/elasticsearch_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/source_status/elasticsearch_adapter.ts rename to x-pack/plugins/siem/server/lib/source_status/elasticsearch_adapter.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/source_status/index.ts b/x-pack/plugins/siem/server/lib/source_status/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/source_status/index.ts rename to x-pack/plugins/siem/server/lib/source_status/index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/source_status/query.dsl.ts b/x-pack/plugins/siem/server/lib/source_status/query.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/source_status/query.dsl.ts rename to x-pack/plugins/siem/server/lib/source_status/query.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/source_status/types.ts b/x-pack/plugins/siem/server/lib/source_status/types.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/source_status/types.ts rename to x-pack/plugins/siem/server/lib/source_status/types.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/sources/configuration.test.ts b/x-pack/plugins/siem/server/lib/sources/configuration.test.ts similarity index 96% rename from x-pack/legacy/plugins/siem/server/lib/sources/configuration.test.ts rename to x-pack/plugins/siem/server/lib/sources/configuration.test.ts index b1b149d17a9f57..00fca7b77de492 100644 --- a/x-pack/legacy/plugins/siem/server/lib/sources/configuration.test.ts +++ b/x-pack/plugins/siem/server/lib/sources/configuration.test.ts @@ -4,9 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +import { DEFAULT_INDEX_PATTERN } from '../../../common/constants'; import { InmemoryConfigurationAdapter } from '../configuration/inmemory_configuration_adapter'; -import { defaultIndexPattern } from '../../../default_index_pattern'; - import { ConfigurationSourcesAdapter } from './configuration'; import { PartialSourceConfiguration } from './types'; @@ -76,7 +75,7 @@ describe('the ConfigurationSourcesAdapter', () => { new InmemoryConfigurationAdapter({ sources: { sourceOne: { - defaultIndex: defaultIndexPattern, + defaultIndex: DEFAULT_INDEX_PATTERN, fields: { container: 'DIFFERENT_CONTAINER_FIELD', }, diff --git a/x-pack/legacy/plugins/siem/server/lib/sources/configuration.ts b/x-pack/plugins/siem/server/lib/sources/configuration.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/sources/configuration.ts rename to x-pack/plugins/siem/server/lib/sources/configuration.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/sources/index.ts b/x-pack/plugins/siem/server/lib/sources/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/sources/index.ts rename to x-pack/plugins/siem/server/lib/sources/index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/sources/types.ts b/x-pack/plugins/siem/server/lib/sources/types.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/sources/types.ts rename to x-pack/plugins/siem/server/lib/sources/types.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/timeline/convert_saved_object_to_savedtimeline.ts b/x-pack/plugins/siem/server/lib/timeline/convert_saved_object_to_savedtimeline.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/timeline/convert_saved_object_to_savedtimeline.ts rename to x-pack/plugins/siem/server/lib/timeline/convert_saved_object_to_savedtimeline.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/timeline/create_timelines_stream_from_ndjson.ts b/x-pack/plugins/siem/server/lib/timeline/create_timelines_stream_from_ndjson.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/timeline/create_timelines_stream_from_ndjson.ts rename to x-pack/plugins/siem/server/lib/timeline/create_timelines_stream_from_ndjson.ts index 16654b2863ee52..abe8de9bf5b94b 100644 --- a/x-pack/legacy/plugins/siem/server/lib/timeline/create_timelines_stream_from_ndjson.ts +++ b/x-pack/plugins/siem/server/lib/timeline/create_timelines_stream_from_ndjson.ts @@ -13,7 +13,7 @@ import { createConcatStream, createSplitStream, createMapStream, -} from '../../../../../../../src/legacy/utils'; +} from '../../../../../../src/legacy/utils'; import { parseNdjsonStrings, filterExportedCounts, diff --git a/x-pack/legacy/plugins/siem/server/lib/timeline/pick_saved_timeline.ts b/x-pack/plugins/siem/server/lib/timeline/pick_saved_timeline.ts similarity index 92% rename from x-pack/legacy/plugins/siem/server/lib/timeline/pick_saved_timeline.ts rename to x-pack/plugins/siem/server/lib/timeline/pick_saved_timeline.ts index 5b60086ae81b65..19adb7ac1045a0 100644 --- a/x-pack/legacy/plugins/siem/server/lib/timeline/pick_saved_timeline.ts +++ b/x-pack/plugins/siem/server/lib/timeline/pick_saved_timeline.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AuthenticatedUser } from '../../../../../../plugins/security/common/model'; +import { AuthenticatedUser } from '../../../../security/common/model'; import { UNAUTHENTICATED_USER } from '../../../common/constants'; import { SavedTimeline } from './types'; diff --git a/x-pack/legacy/plugins/siem/server/lib/timeline/routes/__mocks__/import_timelines.ts b/x-pack/plugins/siem/server/lib/timeline/routes/__mocks__/import_timelines.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/lib/timeline/routes/__mocks__/import_timelines.ts rename to x-pack/plugins/siem/server/lib/timeline/routes/__mocks__/import_timelines.ts index 74d3744e29299e..686f2b491cf881 100644 --- a/x-pack/legacy/plugins/siem/server/lib/timeline/routes/__mocks__/import_timelines.ts +++ b/x-pack/plugins/siem/server/lib/timeline/routes/__mocks__/import_timelines.ts @@ -163,13 +163,6 @@ export const mockParsedTimelineObject = omit( mockUniqueParsedObjects[0] ); -export const mockConfig = { - get: () => { - return 100000000; - }, - has: jest.fn(), -}; - export const mockGetCurrentUser = { user: { username: 'mockUser', diff --git a/x-pack/legacy/plugins/siem/server/lib/timeline/routes/__mocks__/request_responses.ts b/x-pack/plugins/siem/server/lib/timeline/routes/__mocks__/request_responses.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/timeline/routes/__mocks__/request_responses.ts rename to x-pack/plugins/siem/server/lib/timeline/routes/__mocks__/request_responses.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/timeline/routes/export_timelines_route.test.ts b/x-pack/plugins/siem/server/lib/timeline/routes/export_timelines_route.test.ts similarity index 95% rename from x-pack/legacy/plugins/siem/server/lib/timeline/routes/export_timelines_route.test.ts rename to x-pack/plugins/siem/server/lib/timeline/routes/export_timelines_route.test.ts index 4eadede40f5d9d..47ca25e16bd50d 100644 --- a/x-pack/legacy/plugins/siem/server/lib/timeline/routes/export_timelines_route.test.ts +++ b/x-pack/plugins/siem/server/lib/timeline/routes/export_timelines_route.test.ts @@ -16,6 +16,7 @@ import { serverMock, requestContextMock, requestMock, + createMockConfig, } from '../../detection_engine/routes/__mocks__'; import { TIMELINE_EXPORT_URL } from '../../../../common/constants'; import { convertSavedObjectToSavedNote } from '../../note/saved_object'; @@ -41,14 +42,6 @@ jest.mock('../../pinned_event/saved_object', () => { describe('export timelines', () => { let server: ReturnType; let { clients, context } = requestContextMock.createTools(); - const config = jest.fn().mockImplementation(() => { - return { - get: () => { - return 100; - }, - has: jest.fn(), - }; - }); beforeEach(() => { server = serverMock.create(); @@ -61,7 +54,7 @@ describe('export timelines', () => { ((convertSavedObjectToSavedPinnedEvent as unknown) as jest.Mock).mockReturnValue( mockPinnedEvents() ); - exportTimelinesRoute(server.router, config); + exportTimelinesRoute(server.router, createMockConfig()); }); describe('status codes', () => { diff --git a/x-pack/legacy/plugins/siem/server/lib/timeline/routes/export_timelines_route.ts b/x-pack/plugins/siem/server/lib/timeline/routes/export_timelines_route.ts similarity index 87% rename from x-pack/legacy/plugins/siem/server/lib/timeline/routes/export_timelines_route.ts rename to x-pack/plugins/siem/server/lib/timeline/routes/export_timelines_route.ts index fa849c1c325a9a..c59f6eb6ce3daa 100644 --- a/x-pack/legacy/plugins/siem/server/lib/timeline/routes/export_timelines_route.ts +++ b/x-pack/plugins/siem/server/lib/timeline/routes/export_timelines_route.ts @@ -5,11 +5,11 @@ */ import { set as _set } from 'lodash/fp'; -import { IRouter } from '../../../../../../../../src/core/server'; -import { LegacyServices } from '../../../types'; -import { transformError, buildSiemResponse } from '../../detection_engine/routes/utils'; import { TIMELINE_EXPORT_URL } from '../../../../common/constants'; +import { IRouter } from '../../../../../../../src/core/server'; +import { ConfigType } from '../../..'; +import { transformError, buildSiemResponse } from '../../detection_engine/routes/utils'; import { getExportTimelineByObjectIds } from './utils/export_timelines'; import { @@ -18,7 +18,7 @@ import { } from './schemas/export_timelines_schema'; import { buildRouteValidation } from '../../../utils/build_validation/route_validation'; -export const exportTimelinesRoute = (router: IRouter, config: LegacyServices['config']) => { +export const exportTimelinesRoute = (router: IRouter, config: ConfigType) => { router.post( { path: TIMELINE_EXPORT_URL, @@ -34,7 +34,7 @@ export const exportTimelinesRoute = (router: IRouter, config: LegacyServices['co try { const siemResponse = buildSiemResponse(response); const savedObjectsClient = context.core.savedObjects.client; - const exportSizeLimit = config().get('savedObjects.maxImportExportSize'); + const exportSizeLimit = config.maxTimelineImportExportSize; if (request.body?.ids != null && request.body.ids.length > exportSizeLimit) { return siemResponse.error({ diff --git a/x-pack/legacy/plugins/siem/server/lib/timeline/routes/import_timelines_route.test.ts b/x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.test.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/lib/timeline/routes/import_timelines_route.test.ts rename to x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.test.ts index 352f8f0a355fc4..3931bf0e5bea51 100644 --- a/x-pack/legacy/plugins/siem/server/lib/timeline/routes/import_timelines_route.test.ts +++ b/x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.test.ts @@ -6,15 +6,15 @@ import { getImportTimelinesRequest } from './__mocks__/request_responses'; import { + createMockConfig, serverMock, requestContextMock, requestMock, } from '../../detection_engine/routes/__mocks__'; import { TIMELINE_EXPORT_URL } from '../../../../common/constants'; -import { SecurityPluginSetup } from '../../../../../../../plugins/security/server'; +import { SecurityPluginSetup } from '../../../../../security/server'; import { - mockConfig, mockUniqueParsedObjects, mockParsedObjects, mockDuplicateIdErrors, @@ -24,7 +24,7 @@ import { } from './__mocks__/import_timelines'; describe('import timelines', () => { - let config: jest.Mock; + let config: ReturnType; let server: ReturnType; let request: ReturnType; let securitySetup: SecurityPluginSetup; @@ -43,9 +43,7 @@ describe('import timelines', () => { server = serverMock.create(); context = requestContextMock.createTools().context; - config = jest.fn().mockImplementation(() => { - return mockConfig; - }); + config = createMockConfig(); securitySetup = ({ authc: { @@ -65,7 +63,7 @@ describe('import timelines', () => { }; }); - jest.doMock('../../../../../../../../src/legacy/utils', () => { + jest.doMock('../../../../../../../src/legacy/utils', () => { return { createPromiseFromStreams: jest.fn().mockReturnValue(mockParsedObjects), }; diff --git a/x-pack/legacy/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts b/x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts similarity index 95% rename from x-pack/legacy/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts rename to x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts index ad7ee28d8ad515..258ef9faf671bd 100644 --- a/x-pack/legacy/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts +++ b/x-pack/plugins/siem/server/lib/timeline/routes/import_timelines_route.ts @@ -7,6 +7,7 @@ import { extname } from 'path'; import { chunk, omit, set } from 'lodash/fp'; +import { TIMELINE_IMPORT_URL } from '../../../../common/constants'; import { buildSiemResponse, createBulkErrorObject, @@ -15,7 +16,7 @@ import { } from '../../detection_engine/routes/utils'; import { createTimelinesStreamFromNdJson } from '../create_timelines_stream_from_ndjson'; -import { createPromiseFromStreams } from '../../../../../../../../src/legacy/utils'; +import { createPromiseFromStreams } from '../../../../../../../src/legacy/utils'; import { createTimelines, @@ -27,12 +28,11 @@ import { PromiseFromStreams, } from './utils/import_timelines'; -import { IRouter } from '../../../../../../../../src/core/server'; -import { TIMELINE_IMPORT_URL } from '../../../../common/constants'; +import { IRouter } from '../../../../../../../src/core/server'; import { SetupPlugins } from '../../../plugin'; import { ImportTimelinesPayloadSchemaRt } from './schemas/import_timelines_schema'; import { importRulesSchema } from '../../detection_engine/routes/schemas/response/import_rules_schema'; -import { LegacyServices } from '../../../types'; +import { ConfigType } from '../../..'; import { Timeline } from '../saved_object'; import { validate } from '../../detection_engine/routes/rules/validate'; @@ -44,7 +44,7 @@ const timelineLib = new Timeline(); export const importTimelinesRoute = ( router: IRouter, - config: LegacyServices['config'], + config: ConfigType, security: SetupPlugins['security'] ) => { router.post( @@ -56,7 +56,7 @@ export const importTimelinesRoute = ( options: { tags: ['access:siem'], body: { - maxBytes: config().get('savedObjects.maxImportPayloadBytes'), + maxBytes: config.maxTimelineImportPayloadBytes, output: 'stream', }, }, @@ -81,7 +81,7 @@ export const importTimelinesRoute = ( }); } - const objectLimit = config().get('savedObjects.maxImportExportSize'); + const objectLimit = config.maxTimelineImportExportSize; const readStream = createTimelinesStreamFromNdJson(objectLimit); const parsedObjects = await createPromiseFromStreams([ diff --git a/x-pack/legacy/plugins/siem/server/lib/timeline/routes/schemas/export_timelines_schema.ts b/x-pack/plugins/siem/server/lib/timeline/routes/schemas/export_timelines_schema.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/timeline/routes/schemas/export_timelines_schema.ts rename to x-pack/plugins/siem/server/lib/timeline/routes/schemas/export_timelines_schema.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/timeline/routes/schemas/import_timelines_schema.ts b/x-pack/plugins/siem/server/lib/timeline/routes/schemas/import_timelines_schema.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/timeline/routes/schemas/import_timelines_schema.ts rename to x-pack/plugins/siem/server/lib/timeline/routes/schemas/import_timelines_schema.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/timeline/routes/schemas/schemas.ts b/x-pack/plugins/siem/server/lib/timeline/routes/schemas/schemas.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/timeline/routes/schemas/schemas.ts rename to x-pack/plugins/siem/server/lib/timeline/routes/schemas/schemas.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/timeline/routes/utils/export_timelines.ts b/x-pack/plugins/siem/server/lib/timeline/routes/utils/export_timelines.ts similarity index 99% rename from x-pack/legacy/plugins/siem/server/lib/timeline/routes/utils/export_timelines.ts rename to x-pack/plugins/siem/server/lib/timeline/routes/utils/export_timelines.ts index 52ee2a891c9bbc..edd4abe0d76b5f 100644 --- a/x-pack/legacy/plugins/siem/server/lib/timeline/routes/utils/export_timelines.ts +++ b/x-pack/plugins/siem/server/lib/timeline/routes/utils/export_timelines.ts @@ -21,7 +21,7 @@ import { SavedObjectsClient, SavedObjectsFindOptions, SavedObjectsFindResponse, -} from '../../../../../../../../../src/core/server'; +} from '../../../../../../../../src/core/server'; import { ExportedTimelines, diff --git a/x-pack/legacy/plugins/siem/server/lib/timeline/routes/utils/import_timelines.ts b/x-pack/plugins/siem/server/lib/timeline/routes/utils/import_timelines.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/timeline/routes/utils/import_timelines.ts rename to x-pack/plugins/siem/server/lib/timeline/routes/utils/import_timelines.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/timeline/saved_object.test.ts b/x-pack/plugins/siem/server/lib/timeline/saved_object.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/timeline/saved_object.test.ts rename to x-pack/plugins/siem/server/lib/timeline/saved_object.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/timeline/saved_object.ts b/x-pack/plugins/siem/server/lib/timeline/saved_object.ts similarity index 99% rename from x-pack/legacy/plugins/siem/server/lib/timeline/saved_object.ts rename to x-pack/plugins/siem/server/lib/timeline/saved_object.ts index bc6975331ad9b4..e8cd27947589fc 100644 --- a/x-pack/legacy/plugins/siem/server/lib/timeline/saved_object.ts +++ b/x-pack/plugins/siem/server/lib/timeline/saved_object.ts @@ -6,7 +6,7 @@ import { getOr } from 'lodash/fp'; -import { SavedObjectsFindOptions } from '../../../../../../../src/core/server'; +import { SavedObjectsFindOptions } from '../../../../../../src/core/server'; import { UNAUTHENTICATED_USER } from '../../../common/constants'; import { ResponseTimeline, diff --git a/x-pack/legacy/plugins/siem/server/lib/timeline/saved_object_mappings.ts b/x-pack/plugins/siem/server/lib/timeline/saved_object_mappings.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/timeline/saved_object_mappings.ts rename to x-pack/plugins/siem/server/lib/timeline/saved_object_mappings.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/timeline/types.ts b/x-pack/plugins/siem/server/lib/timeline/types.ts similarity index 99% rename from x-pack/legacy/plugins/siem/server/lib/timeline/types.ts rename to x-pack/plugins/siem/server/lib/timeline/types.ts index 523221192eca4e..0bce3300591c2d 100644 --- a/x-pack/legacy/plugins/siem/server/lib/timeline/types.ts +++ b/x-pack/plugins/siem/server/lib/timeline/types.ts @@ -14,7 +14,7 @@ import { PinnedEventToReturnSavedObjectRuntimeType, PinnedEventSavedObject, } from '../pinned_event/types'; -import { SavedObjectsClient } from '../../../../../../../src/core/server'; +import { SavedObjectsClient } from '../../../../../../src/core/server'; /* * ColumnHeader Types diff --git a/x-pack/legacy/plugins/siem/server/lib/tls/elasticsearch_adapter.test.ts b/x-pack/plugins/siem/server/lib/tls/elasticsearch_adapter.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/tls/elasticsearch_adapter.test.ts rename to x-pack/plugins/siem/server/lib/tls/elasticsearch_adapter.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/tls/elasticsearch_adapter.ts b/x-pack/plugins/siem/server/lib/tls/elasticsearch_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/tls/elasticsearch_adapter.ts rename to x-pack/plugins/siem/server/lib/tls/elasticsearch_adapter.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/tls/index.ts b/x-pack/plugins/siem/server/lib/tls/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/tls/index.ts rename to x-pack/plugins/siem/server/lib/tls/index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/tls/mock.ts b/x-pack/plugins/siem/server/lib/tls/mock.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/tls/mock.ts rename to x-pack/plugins/siem/server/lib/tls/mock.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/tls/query_tls.dsl.ts b/x-pack/plugins/siem/server/lib/tls/query_tls.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/tls/query_tls.dsl.ts rename to x-pack/plugins/siem/server/lib/tls/query_tls.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/tls/types.ts b/x-pack/plugins/siem/server/lib/tls/types.ts similarity index 94% rename from x-pack/legacy/plugins/siem/server/lib/tls/types.ts rename to x-pack/plugins/siem/server/lib/tls/types.ts index 1fbb31ba3e0f31..f18ddc04e14a05 100644 --- a/x-pack/legacy/plugins/siem/server/lib/tls/types.ts +++ b/x-pack/plugins/siem/server/lib/tls/types.ts @@ -5,7 +5,7 @@ */ import { FrameworkRequest, RequestBasicOptions } from '../framework'; -import { TlsData } from '../../../public/graphql/types'; +import { TlsData } from '../../graphql/types'; export interface TlsAdapter { getTls(request: FrameworkRequest, options: RequestBasicOptions): Promise; diff --git a/x-pack/legacy/plugins/siem/server/lib/types.ts b/x-pack/plugins/siem/server/lib/types.ts similarity index 94% rename from x-pack/legacy/plugins/siem/server/lib/types.ts rename to x-pack/plugins/siem/server/lib/types.ts index 323ced734d24ba..a74fe8f778ba94 100644 --- a/x-pack/legacy/plugins/siem/server/lib/types.ts +++ b/x-pack/plugins/siem/server/lib/types.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AuthenticatedUser } from '../../../../../plugins/security/public'; -import { RequestHandlerContext } from '../../../../../../src/core/server'; -export { ConfigType as Configuration } from '../../../../../plugins/siem/server'; +import { AuthenticatedUser } from '../../../security/public'; +import { RequestHandlerContext } from '../../../../../src/core/server'; +export { ConfigType as Configuration } from '../'; import { Authentications } from './authentications'; import { Events } from './events'; diff --git a/x-pack/legacy/plugins/siem/server/lib/uncommon_processes/elasticsearch_adapter.test.ts b/x-pack/plugins/siem/server/lib/uncommon_processes/elasticsearch_adapter.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/uncommon_processes/elasticsearch_adapter.test.ts rename to x-pack/plugins/siem/server/lib/uncommon_processes/elasticsearch_adapter.test.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/uncommon_processes/elasticsearch_adapter.ts b/x-pack/plugins/siem/server/lib/uncommon_processes/elasticsearch_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/uncommon_processes/elasticsearch_adapter.ts rename to x-pack/plugins/siem/server/lib/uncommon_processes/elasticsearch_adapter.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/uncommon_processes/index.ts b/x-pack/plugins/siem/server/lib/uncommon_processes/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/uncommon_processes/index.ts rename to x-pack/plugins/siem/server/lib/uncommon_processes/index.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/uncommon_processes/query.dsl.ts b/x-pack/plugins/siem/server/lib/uncommon_processes/query.dsl.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/uncommon_processes/query.dsl.ts rename to x-pack/plugins/siem/server/lib/uncommon_processes/query.dsl.ts diff --git a/x-pack/legacy/plugins/siem/server/lib/uncommon_processes/types.ts b/x-pack/plugins/siem/server/lib/uncommon_processes/types.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/lib/uncommon_processes/types.ts rename to x-pack/plugins/siem/server/lib/uncommon_processes/types.ts diff --git a/x-pack/plugins/siem/server/plugin.ts b/x-pack/plugins/siem/server/plugin.ts index ccc6aef1452b23..b9ec1c2e92438b 100644 --- a/x-pack/plugins/siem/server/plugin.ts +++ b/x-pack/plugins/siem/server/plugin.ts @@ -5,33 +5,203 @@ */ import { Observable } from 'rxjs'; +import { first } from 'rxjs/operators'; +import { i18n } from '@kbn/i18n'; -import { CoreSetup, PluginInitializerContext, Logger } from '../../../../src/core/server'; +import { + CoreSetup, + CoreStart, + PluginInitializerContext, + Logger, +} from '../../../../src/core/server'; +import { + PluginStartContract as AlertingStart, + PluginSetupContract as AlertingSetup, +} from '../../alerting/server'; +import { SecurityPluginSetup as SecuritySetup } from '../../security/server'; +import { PluginSetupContract as FeaturesSetup } from '../../features/server'; +import { MlPluginSetup as MlSetup } from '../../ml/server'; +import { EncryptedSavedObjectsPluginSetup as EncryptedSavedObjectsSetup } from '../../encrypted_saved_objects/server'; +import { SpacesPluginSetup as SpacesSetup } from '../../spaces/server'; +import { PluginStartContract as ActionsStart } from '../../actions/server'; +import { LicensingPluginSetup } from '../../licensing/server'; +import { initServer } from './init_server'; +import { compose } from './lib/compose/kibana'; +import { initRoutes } from './routes'; +import { isAlertExecutor } from './lib/detection_engine/signals/types'; +import { signalRulesAlertType } from './lib/detection_engine/signals/signal_rule_alert_type'; +import { rulesNotificationAlertType } from './lib/detection_engine/notifications/rules_notification_alert_type'; +import { isNotificationAlertExecutor } from './lib/detection_engine/notifications/types'; +import { hasListsFeature, listsEnvFeatureFlagName } from './lib/detection_engine/feature_flags'; +import { + noteSavedObjectType, + pinnedEventSavedObjectType, + timelineSavedObjectType, + ruleStatusSavedObjectType, + ruleActionsSavedObjectType, +} from './saved_objects'; +import { SiemClientFactory } from './client'; import { createConfig$, ConfigType } from './config'; +export { CoreSetup, CoreStart }; + +export interface SetupPlugins { + alerting: AlertingSetup; + encryptedSavedObjects?: EncryptedSavedObjectsSetup; + features: FeaturesSetup; + licensing: LicensingPluginSetup; + security?: SecuritySetup; + spaces?: SpacesSetup; + ml?: MlSetup; +} + +export interface StartPlugins { + actions: ActionsStart; + alerting: AlertingStart; +} + export class Plugin { readonly name = 'siem'; private readonly logger: Logger; - // @ts-ignore-next-line TODO(rylnd): use it or lose it private readonly config$: Observable; + private context: PluginInitializerContext; + private siemClientFactory: SiemClientFactory; constructor(context: PluginInitializerContext) { - const { logger } = context; - this.logger = logger.get(); - this.logger.debug('plugin initialized'); - + this.context = context; + this.logger = context.logger.get('plugins', this.name); this.config$ = createConfig$(context); + this.siemClientFactory = new SiemClientFactory(); + + this.logger.debug('plugin initialized'); } - public setup(core: CoreSetup, plugins: {}) { + public async setup(core: CoreSetup, plugins: SetupPlugins) { this.logger.debug('plugin setup'); - } - public start() { - this.logger.debug('plugin started'); - } + if (hasListsFeature()) { + // TODO: Remove this once we have the lists feature supported + this.logger.error( + `You have activated the lists feature flag which is NOT currently supported for SIEM! You should turn this feature flag off immediately by un-setting the environment variable: ${listsEnvFeatureFlagName} and restarting Kibana` + ); + } + + const router = core.http.createRouter(); + core.http.registerRouteHandlerContext(this.name, (context, request, response) => ({ + getSiemClient: () => this.siemClientFactory.create(request), + })); + + const config = await this.config$.pipe(first()).toPromise(); + + this.siemClientFactory.setup({ + getSpaceId: plugins.spaces?.spacesService?.getSpaceId, + config, + }); + + initRoutes( + router, + config, + plugins.encryptedSavedObjects?.usingEphemeralEncryptionKey ?? false, + plugins.security + ); - public stop() { - this.logger.debug('plugin stopped'); + plugins.features.registerFeature({ + id: this.name, + name: i18n.translate('xpack.siem.featureRegistry.linkSiemTitle', { + defaultMessage: 'SIEM', + }), + order: 1100, + icon: 'securityAnalyticsApp', + navLinkId: 'siem', + app: ['siem', 'kibana'], + catalogue: ['siem'], + privileges: { + all: { + app: ['siem', 'kibana'], + catalogue: ['siem'], + api: ['siem', 'actions-read', 'actions-all', 'alerting-read', 'alerting-all'], + savedObject: { + all: [ + 'alert', + 'action', + 'action_task_params', + noteSavedObjectType, + pinnedEventSavedObjectType, + timelineSavedObjectType, + ruleStatusSavedObjectType, + ruleActionsSavedObjectType, + 'cases', + 'cases-comments', + 'cases-configure', + 'cases-user-actions', + ], + read: ['config'], + }, + ui: [ + 'show', + 'crud', + 'alerting:show', + 'actions:show', + 'alerting:save', + 'actions:save', + 'alerting:delete', + 'actions:delete', + ], + }, + read: { + app: ['siem', 'kibana'], + catalogue: ['siem'], + api: ['siem', 'actions-read', 'actions-all', 'alerting-read', 'alerting-all'], + savedObject: { + all: ['alert', 'action', 'action_task_params'], + read: [ + 'config', + noteSavedObjectType, + pinnedEventSavedObjectType, + timelineSavedObjectType, + ruleStatusSavedObjectType, + ruleActionsSavedObjectType, + 'cases', + 'cases-comments', + 'cases-configure', + 'cases-user-actions', + ], + }, + ui: [ + 'show', + 'alerting:show', + 'actions:show', + 'alerting:save', + 'actions:save', + 'alerting:delete', + 'actions:delete', + ], + }, + }, + }); + + if (plugins.alerting != null) { + const signalRuleType = signalRulesAlertType({ + logger: this.logger, + version: this.context.env.packageInfo.version, + ml: plugins.ml, + }); + const ruleNotificationType = rulesNotificationAlertType({ + logger: this.logger, + }); + + if (isAlertExecutor(signalRuleType)) { + plugins.alerting.registerType(signalRuleType); + } + + if (isNotificationAlertExecutor(ruleNotificationType)) { + plugins.alerting.registerType(ruleNotificationType); + } + } + + const libs = compose(core, plugins, this.context.env.mode.prod); + initServer(libs); } + + public start(core: CoreStart, plugins: StartPlugins) {} } diff --git a/x-pack/legacy/plugins/siem/server/routes/index.ts b/x-pack/plugins/siem/server/routes/index.ts similarity index 96% rename from x-pack/legacy/plugins/siem/server/routes/index.ts rename to x-pack/plugins/siem/server/routes/index.ts index 8c9f92890c26a5..64b232a2686b87 100644 --- a/x-pack/legacy/plugins/siem/server/routes/index.ts +++ b/x-pack/plugins/siem/server/routes/index.ts @@ -4,8 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IRouter } from '../../../../../../src/core/server'; -import { LegacyServices } from '../types'; +import { IRouter } from '../../../../../src/core/server'; import { createRulesRoute } from '../lib/detection_engine/routes/rules/create_rules_route'; import { createIndexRoute } from '../lib/detection_engine/routes/index/create_index_route'; @@ -32,10 +31,11 @@ import { getPrepackagedRulesStatusRoute } from '../lib/detection_engine/routes/r import { importTimelinesRoute } from '../lib/timeline/routes/import_timelines_route'; import { exportTimelinesRoute } from '../lib/timeline/routes/export_timelines_route'; import { SetupPlugins } from '../plugin'; +import { ConfigType } from '..'; export const initRoutes = ( router: IRouter, - config: LegacyServices['config'], + config: ConfigType, usingEphemeralEncryptionKey: boolean, security: SetupPlugins['security'] ) => { diff --git a/x-pack/legacy/plugins/siem/server/saved_objects.ts b/x-pack/plugins/siem/server/saved_objects.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/saved_objects.ts rename to x-pack/plugins/siem/server/saved_objects.ts diff --git a/x-pack/legacy/plugins/siem/server/types.ts b/x-pack/plugins/siem/server/types.ts similarity index 82% rename from x-pack/legacy/plugins/siem/server/types.ts rename to x-pack/plugins/siem/server/types.ts index a52322f5f830c8..3a5c6cf94c6526 100644 --- a/x-pack/legacy/plugins/siem/server/types.ts +++ b/x-pack/plugins/siem/server/types.ts @@ -4,13 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Legacy } from 'kibana'; import { SiemClient } from './client'; -export interface LegacyServices { - config: Legacy.Server['config']; -} - export { SiemClient }; export interface SiemRequestContext { diff --git a/x-pack/legacy/plugins/siem/server/utils/beat_schema/8.0.0/auditbeat.ts b/x-pack/plugins/siem/server/utils/beat_schema/8.0.0/auditbeat.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/beat_schema/8.0.0/auditbeat.ts rename to x-pack/plugins/siem/server/utils/beat_schema/8.0.0/auditbeat.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/beat_schema/8.0.0/ecs.ts b/x-pack/plugins/siem/server/utils/beat_schema/8.0.0/ecs.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/beat_schema/8.0.0/ecs.ts rename to x-pack/plugins/siem/server/utils/beat_schema/8.0.0/ecs.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/beat_schema/8.0.0/filebeat.ts b/x-pack/plugins/siem/server/utils/beat_schema/8.0.0/filebeat.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/beat_schema/8.0.0/filebeat.ts rename to x-pack/plugins/siem/server/utils/beat_schema/8.0.0/filebeat.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/beat_schema/8.0.0/index.ts b/x-pack/plugins/siem/server/utils/beat_schema/8.0.0/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/beat_schema/8.0.0/index.ts rename to x-pack/plugins/siem/server/utils/beat_schema/8.0.0/index.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/beat_schema/8.0.0/packetbeat.ts b/x-pack/plugins/siem/server/utils/beat_schema/8.0.0/packetbeat.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/beat_schema/8.0.0/packetbeat.ts rename to x-pack/plugins/siem/server/utils/beat_schema/8.0.0/packetbeat.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/beat_schema/8.0.0/winlogbeat.ts b/x-pack/plugins/siem/server/utils/beat_schema/8.0.0/winlogbeat.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/beat_schema/8.0.0/winlogbeat.ts rename to x-pack/plugins/siem/server/utils/beat_schema/8.0.0/winlogbeat.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/beat_schema/index.test.ts b/x-pack/plugins/siem/server/utils/beat_schema/index.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/beat_schema/index.test.ts rename to x-pack/plugins/siem/server/utils/beat_schema/index.test.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/beat_schema/index.ts b/x-pack/plugins/siem/server/utils/beat_schema/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/beat_schema/index.ts rename to x-pack/plugins/siem/server/utils/beat_schema/index.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/beat_schema/type.ts b/x-pack/plugins/siem/server/utils/beat_schema/type.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/beat_schema/type.ts rename to x-pack/plugins/siem/server/utils/beat_schema/type.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/build_query/calculate_timeseries_interval.ts b/x-pack/plugins/siem/server/utils/build_query/calculate_timeseries_interval.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/build_query/calculate_timeseries_interval.ts rename to x-pack/plugins/siem/server/utils/build_query/calculate_timeseries_interval.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/build_query/create_options.test.ts b/x-pack/plugins/siem/server/utils/build_query/create_options.test.ts similarity index 93% rename from x-pack/legacy/plugins/siem/server/utils/build_query/create_options.test.ts rename to x-pack/plugins/siem/server/utils/build_query/create_options.test.ts index 8262b5b670d30f..5ca67ad6ae51f7 100644 --- a/x-pack/legacy/plugins/siem/server/utils/build_query/create_options.test.ts +++ b/x-pack/plugins/siem/server/utils/build_query/create_options.test.ts @@ -6,7 +6,7 @@ import { omit } from 'lodash/fp'; -import { defaultIndexPattern } from '../../../default_index_pattern'; +import { DEFAULT_INDEX_PATTERN } from '../../../common/constants'; import { Direction } from '../../graphql/types'; import { RequestOptions } from '../../lib/framework'; @@ -30,7 +30,7 @@ describe('createOptions', () => { }, }; args = { - defaultIndex: defaultIndexPattern, + defaultIndex: DEFAULT_INDEX_PATTERN, pagination: { limit: 5, }, @@ -57,7 +57,7 @@ describe('createOptions', () => { test('should create options given all input including sort field', () => { const options = createOptions(source, args, info); const expected: RequestOptions = { - defaultIndex: defaultIndexPattern, + defaultIndex: DEFAULT_INDEX_PATTERN, sourceConfiguration: { fields: { host: 'host-1', @@ -87,7 +87,7 @@ describe('createOptions', () => { const argsWithoutSort: Args = omit('sortField', args); const options = createOptions(source, argsWithoutSort, info); const expected: RequestOptions = { - defaultIndex: defaultIndexPattern, + defaultIndex: DEFAULT_INDEX_PATTERN, sourceConfiguration: { fields: { host: 'host-1', diff --git a/x-pack/legacy/plugins/siem/server/utils/build_query/create_options.ts b/x-pack/plugins/siem/server/utils/build_query/create_options.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/build_query/create_options.ts rename to x-pack/plugins/siem/server/utils/build_query/create_options.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/build_query/field.mock.ts b/x-pack/plugins/siem/server/utils/build_query/field.mock.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/build_query/field.mock.ts rename to x-pack/plugins/siem/server/utils/build_query/field.mock.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/build_query/fields.test.ts b/x-pack/plugins/siem/server/utils/build_query/fields.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/build_query/fields.test.ts rename to x-pack/plugins/siem/server/utils/build_query/fields.test.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/build_query/fields.ts b/x-pack/plugins/siem/server/utils/build_query/fields.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/build_query/fields.ts rename to x-pack/plugins/siem/server/utils/build_query/fields.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/build_query/filters.ts b/x-pack/plugins/siem/server/utils/build_query/filters.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/build_query/filters.ts rename to x-pack/plugins/siem/server/utils/build_query/filters.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/build_query/index.ts b/x-pack/plugins/siem/server/utils/build_query/index.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/build_query/index.ts rename to x-pack/plugins/siem/server/utils/build_query/index.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/build_query/merge_fields_with_hits.test.ts b/x-pack/plugins/siem/server/utils/build_query/merge_fields_with_hits.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/build_query/merge_fields_with_hits.test.ts rename to x-pack/plugins/siem/server/utils/build_query/merge_fields_with_hits.test.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/build_query/merge_fields_with_hits.ts b/x-pack/plugins/siem/server/utils/build_query/merge_fields_with_hits.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/build_query/merge_fields_with_hits.ts rename to x-pack/plugins/siem/server/utils/build_query/merge_fields_with_hits.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/build_query/reduce_fields.test.ts b/x-pack/plugins/siem/server/utils/build_query/reduce_fields.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/build_query/reduce_fields.test.ts rename to x-pack/plugins/siem/server/utils/build_query/reduce_fields.test.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/build_query/reduce_fields.ts b/x-pack/plugins/siem/server/utils/build_query/reduce_fields.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/build_query/reduce_fields.ts rename to x-pack/plugins/siem/server/utils/build_query/reduce_fields.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/build_validation/route_validation.test.ts b/x-pack/plugins/siem/server/utils/build_validation/route_validation.test.ts similarity index 97% rename from x-pack/legacy/plugins/siem/server/utils/build_validation/route_validation.test.ts rename to x-pack/plugins/siem/server/utils/build_validation/route_validation.test.ts index 888cd5dfe5390b..d17a8457ff81be 100644 --- a/x-pack/legacy/plugins/siem/server/utils/build_validation/route_validation.test.ts +++ b/x-pack/plugins/siem/server/utils/build_validation/route_validation.test.ts @@ -6,7 +6,7 @@ import { buildRouteValidation } from './route_validation'; import * as rt from 'io-ts'; -import { RouteValidationResultFactory } from '../../../../../../../src/core/server/http'; +import { RouteValidationResultFactory } from '../../../../../../src/core/server/http'; describe('buildRouteValidation', () => { const schema = rt.type({ diff --git a/x-pack/legacy/plugins/siem/server/utils/build_validation/route_validation.ts b/x-pack/plugins/siem/server/utils/build_validation/route_validation.ts similarity index 95% rename from x-pack/legacy/plugins/siem/server/utils/build_validation/route_validation.ts rename to x-pack/plugins/siem/server/utils/build_validation/route_validation.ts index 1281c23cbc89a2..bfcd0998fe6900 100644 --- a/x-pack/legacy/plugins/siem/server/utils/build_validation/route_validation.ts +++ b/x-pack/plugins/siem/server/utils/build_validation/route_validation.ts @@ -12,7 +12,7 @@ import { RouteValidationFunction, RouteValidationResultFactory, RouteValidationError, -} from '../../../../../../../src/core/server'; +} from '../../../../../../src/core/server'; type RequestValidationResult = | { diff --git a/x-pack/legacy/plugins/siem/server/utils/read_stream/create_stream_from_ndjson.test.ts b/x-pack/plugins/siem/server/utils/read_stream/create_stream_from_ndjson.test.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/read_stream/create_stream_from_ndjson.test.ts rename to x-pack/plugins/siem/server/utils/read_stream/create_stream_from_ndjson.test.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/read_stream/create_stream_from_ndjson.ts b/x-pack/plugins/siem/server/utils/read_stream/create_stream_from_ndjson.ts similarity index 98% rename from x-pack/legacy/plugins/siem/server/utils/read_stream/create_stream_from_ndjson.ts rename to x-pack/plugins/siem/server/utils/read_stream/create_stream_from_ndjson.ts index 0b7966926b5dd1..2d630d0b92c68a 100644 --- a/x-pack/legacy/plugins/siem/server/utils/read_stream/create_stream_from_ndjson.ts +++ b/x-pack/plugins/siem/server/utils/read_stream/create_stream_from_ndjson.ts @@ -6,7 +6,7 @@ import { Transform } from 'stream'; import { has, isString } from 'lodash/fp'; import { ImportRuleAlertRest } from '../../lib/detection_engine/types'; -import { createMapStream, createFilterStream } from '../../../../../../../src/legacy/utils/streams'; +import { createMapStream, createFilterStream } from '../../../../../../src/legacy/utils/streams'; import { importRulesSchema } from '../../lib/detection_engine/routes/schemas/import_rules_schema'; import { BadRequestError } from '../../lib/detection_engine/errors/bad_request_error'; diff --git a/x-pack/legacy/plugins/siem/server/utils/serialized_query.ts b/x-pack/plugins/siem/server/utils/serialized_query.ts similarity index 92% rename from x-pack/legacy/plugins/siem/server/utils/serialized_query.ts rename to x-pack/plugins/siem/server/utils/serialized_query.ts index 1ba6eb8b9f9a60..09b227d8c5a325 100644 --- a/x-pack/legacy/plugins/siem/server/utils/serialized_query.ts +++ b/x-pack/plugins/siem/server/utils/serialized_query.ts @@ -7,7 +7,7 @@ import { UserInputError } from 'apollo-server-errors'; import { isEmpty, isPlainObject, isString } from 'lodash/fp'; -import { JsonObject } from '../../../../../../src/plugins/kibana_utils/public'; +import { JsonObject } from '../../../../../src/plugins/kibana_utils/public'; export const parseFilterQuery = (filterQuery: string): JsonObject => { try { diff --git a/x-pack/legacy/plugins/siem/server/utils/typed_elasticsearch_mappings.ts b/x-pack/plugins/siem/server/utils/typed_elasticsearch_mappings.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/typed_elasticsearch_mappings.ts rename to x-pack/plugins/siem/server/utils/typed_elasticsearch_mappings.ts diff --git a/x-pack/legacy/plugins/siem/server/utils/typed_resolvers.ts b/x-pack/plugins/siem/server/utils/typed_resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/siem/server/utils/typed_resolvers.ts rename to x-pack/plugins/siem/server/utils/typed_resolvers.ts diff --git a/x-pack/plugins/siem/yarn.lock b/x-pack/plugins/siem/yarn.lock new file mode 120000 index 00000000000000..6e09764ec763b0 --- /dev/null +++ b/x-pack/plugins/siem/yarn.lock @@ -0,0 +1 @@ +../../../yarn.lock \ No newline at end of file diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 72b55121bbec01..1170d270e42acb 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -847,8 +847,6 @@ "data.search.searchSource.indexPatternIdDescription": "{kibanaIndexPattern} インデックス内の ID です。", "data.search.searchSource.indexPatternIdLabel": "インデックスパターン ID", "data.search.searchSource.indexPatternLabel": "インデックスパターン", - "data.search.searchSource.noSearchStrategyRegisteredErrorMessageDescription": "検索リクエストの検索方法が見つかりませんでした", - "data.search.searchSource.noSearchStrategyRegisteredErrorMessageTitle": "検索方法が登録されていません", "data.search.searchSource.queryTimeDescription": "クエリの処理の所要時間です。リクエストの送信やブラウザでのパースの時間は含まれません。", "data.search.searchSource.queryTimeLabel": "クエリ時間", "data.search.searchSource.queryTimeValue": "{queryTime}ms", @@ -2464,13 +2462,13 @@ "management.breadcrumb": "管理", "management.connectDataDisplayName": "データに接続", "management.displayName": "管理", + "management.nav.label": "管理", + "management.nav.menu": "管理メニュー", + "management.stackManagement.managementDescription": "Elastic Stack の管理を行うセンターコンソールです。", "indexPatternManagement.editIndexPattern.createIndex.defaultButtonDescription": "すべてのデータに完全集約を実行", "indexPatternManagement.editIndexPattern.createIndex.defaultButtonText": "標準インデックスパターン", "indexPatternManagement.editIndexPattern.createIndex.defaultTypeName": "インデックスパターン", "indexPatternManagement.editIndexPattern.list.defaultIndexPatternListName": "デフォルト", - "management.nav.label": "管理", - "management.nav.menu": "管理メニュー", - "management.stackManagement.managementDescription": "Elastic Stack の管理を行うセンターコンソールです。", "newsfeed.emptyPrompt.noNewsText": "Kibanaインスタンスがインターネットにアクセスできない場合、管理者にこの機能を無効にするように依頼してください。そうでない場合は、ニュースを取り込み続けます。", "newsfeed.emptyPrompt.noNewsTitle": "ニュースがない場合", "newsfeed.flyoutList.closeButtonLabel": "閉じる", @@ -15960,7 +15958,7 @@ "xpack.triggersActionsUI.sections.alertAdd.saveButtonLabel": "保存", "xpack.triggersActionsUI.sections.alertAdd.saveErrorNotificationText": "アラートを作成できません。", "xpack.triggersActionsUI.sections.alertAdd.saveSuccessNotificationText": "「{alertName}」 を保存しました", - "xpack.triggersActionsUI.sections.alertAdd.selectIndex": "インデックスを選択してください。", + "xpack.triggersActionsUI.sections.alertAdd.selectIndex": "インデックスを選択してください", "xpack.triggersActionsUI.sections.alertAdd.threshold.closeIndexPopoverLabel": "閉じる", "xpack.triggersActionsUI.sections.alertAdd.threshold.fixErrorInExpressionBelowValidationMessage": "下の表現のエラーを修正してください。", "xpack.triggersActionsUI.sections.alertAdd.threshold.howToBroadenSearchQueryDescription": "* で検索クエリの範囲を広げます。", @@ -16044,7 +16042,6 @@ "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.muteAllTitle": "ミュート", "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.unmuteAllTitle": "ミュート解除", "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.deleteTitle": "削除", - "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.enableTitle": "有効にする", "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.muteTitle": "ミュート", "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.popoverButtonTitle": "アクション", "xpack.triggersActionsUI.components.emptyPrompt.emptyButton": "アラートの作成", @@ -16232,16 +16229,10 @@ "xpack.uptime.components.embeddables.embeddedMap.embeddablePanelTitle": "オブザーバー位置情報マップを監視", "xpack.uptime.durationChart.emptyPrompt.description": "このモニターは選択された時間範囲で一度も {emphasizedText} していません。", "xpack.uptime.durationChart.emptyPrompt.title": "利用可能な期間データがありません", - "xpack.uptime.emptyState.configureHeartbeatLinkText": "Heartbeat を構成", - "xpack.uptime.emptyState.configureHeartbeatToGetStartedMessage": "アップタイムデータの収集を開始するには {configureHeartbeatLink}。", "xpack.uptime.emptyState.loadingMessage": "読み込み中…", - "xpack.uptime.emptyState.noDataMessage": "アップタイムデータが見つかりませんでした", - "xpack.uptime.emptyState.noDataTitle": "利用可能なアップタイムデータがありません", - "xpack.uptime.emptyState.noIndexTitle": "アップタイムインデックスが見つかりません", "xpack.uptime.emptyStateError.notAuthorized": "アップタイムデータの表示が承認されていません。システム管理者にお問い合わせください。", "xpack.uptime.emptyStateError.notFoundPage": "ページが見つかりません", "xpack.uptime.emptyStateError.title": "エラー", - "xpack.uptime.errorMessage": "エラー: {message}", "xpack.uptime.featureCatalogueDescription": "エンドポイントヘルスチェックとアップタイム監視を行います。", "xpack.uptime.featureRegistry.uptimeFeatureName": "アップタイム", "xpack.uptime.filterBar.ariaLabel": "概要ページのインプットフィルター基準", @@ -16758,4 +16749,4 @@ "xpack.watcher.watchEdit.thresholdWatchExpression.aggType.fieldIsRequiredValidationMessage": "フィールドを選択してください。", "xpack.watcher.watcherDescription": "アラートの作成、管理、監視によりデータへの変更を検知します。" } -} +} \ No newline at end of file diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index c1b4663da91e7d..f86e03b6c10e15 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -848,8 +848,6 @@ "data.search.searchSource.indexPatternIdDescription": "{kibanaIndexPattern} 索引中的 ID。", "data.search.searchSource.indexPatternIdLabel": "索引模式 ID", "data.search.searchSource.indexPatternLabel": "索引模式", - "data.search.searchSource.noSearchStrategyRegisteredErrorMessageDescription": "无法为该搜索请求找到搜索策略", - "data.search.searchSource.noSearchStrategyRegisteredErrorMessageTitle": "未注册任何搜索策略", "data.search.searchSource.queryTimeDescription": "处理查询所花费的时间。不包括发送请求或在浏览器中解析它的时间。", "data.search.searchSource.queryTimeLabel": "查询时间", "data.search.searchSource.queryTimeValue": "{queryTime}ms", @@ -2465,13 +2463,13 @@ "management.breadcrumb": "管理", "management.connectDataDisplayName": "连接数据", "management.displayName": "管理", + "management.nav.label": "管理", + "management.nav.menu": "管理菜单", + "management.stackManagement.managementDescription": "您用于管理 Elastic Stack 的中心控制台。", "indexPatternManagement.editIndexPattern.createIndex.defaultButtonDescription": "对任何数据执行完全聚合", "indexPatternManagement.editIndexPattern.createIndex.defaultButtonText": "标准索引模式", "indexPatternManagement.editIndexPattern.createIndex.defaultTypeName": "索引模式", "indexPatternManagement.editIndexPattern.list.defaultIndexPatternListName": "默认值", - "management.nav.label": "管理", - "management.nav.menu": "管理菜单", - "management.stackManagement.managementDescription": "您用于管理 Elastic Stack 的中心控制台。", "newsfeed.emptyPrompt.noNewsText": "如果您的 Kibana 实例没有 Internet 连接,请让您的管理员禁用此功能。否则,我们将不断尝试获取新闻。", "newsfeed.emptyPrompt.noNewsTitle": "无新闻?", "newsfeed.flyoutList.closeButtonLabel": "鍏抽棴", @@ -15957,7 +15955,7 @@ "xpack.triggersActionsUI.sections.addModalConnectorForm.updateSuccessNotificationText": "已创建“{connectorName}”", "xpack.triggersActionsUI.sections.alertAdd.betaBadgeTooltipContent": "{pluginName} 为公测版,可能会进行更改。设计和代码相对于正式发行版功能还不够成熟,将按原样提供,且不提供任何保证。公测版功能不受正式发行版功能支持 SLA 的约束。", "xpack.triggersActionsUI.sections.alertAdd.cancelButtonLabel": "取消", - "xpack.triggersActionsUI.sections.alertAdd.conditionPrompt": "定义条件。", + "xpack.triggersActionsUI.sections.alertAdd.conditionPrompt": "定义条件", "xpack.triggersActionsUI.sections.alertAdd.errorLoadingAlertVisualizationTitle": "无法加载告警可视化", "xpack.triggersActionsUI.sections.alertAdd.flyoutTitle": "创建告警", "xpack.triggersActionsUI.sections.alertAdd.loadingAlertVisualizationDescription": "正在加载告警可视化……", @@ -15965,7 +15963,7 @@ "xpack.triggersActionsUI.sections.alertAdd.saveButtonLabel": "保存", "xpack.triggersActionsUI.sections.alertAdd.saveErrorNotificationText": "无法创建告警。", "xpack.triggersActionsUI.sections.alertAdd.saveSuccessNotificationText": "已保存“{alertName}”", - "xpack.triggersActionsUI.sections.alertAdd.selectIndex": "选择索引。", + "xpack.triggersActionsUI.sections.alertAdd.selectIndex": "选择索引", "xpack.triggersActionsUI.sections.alertAdd.threshold.closeIndexPopoverLabel": "关闭", "xpack.triggersActionsUI.sections.alertAdd.threshold.fixErrorInExpressionBelowValidationMessage": "表达式包含错误。", "xpack.triggersActionsUI.sections.alertAdd.threshold.howToBroadenSearchQueryDescription": "使用 * 可扩大您的查询范围。", @@ -16049,7 +16047,6 @@ "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.muteAllTitle": "静音", "xpack.triggersActionsUI.sections.alertsList.bulkActionPopover.unmuteAllTitle": "取消静音", "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.deleteTitle": "删除", - "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.enableTitle": "启用", "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.muteTitle": "静音", "xpack.triggersActionsUI.sections.alertsList.collapsedItemActons.popoverButtonTitle": "操作", "xpack.triggersActionsUI.components.emptyPrompt.emptyButton": "创建告警", @@ -16237,16 +16234,10 @@ "xpack.uptime.components.embeddables.embeddedMap.embeddablePanelTitle": "监测观察者位置地图", "xpack.uptime.durationChart.emptyPrompt.description": "在选定时间范围内此监测从未{emphasizedText}。", "xpack.uptime.durationChart.emptyPrompt.title": "没有持续时间数据", - "xpack.uptime.emptyState.configureHeartbeatLinkText": "配置 Heartbeat", - "xpack.uptime.emptyState.configureHeartbeatToGetStartedMessage": "{configureHeartbeatLink}以开始收集运行时间数据。", "xpack.uptime.emptyState.loadingMessage": "正在加载……", - "xpack.uptime.emptyState.noDataMessage": "未找到任何运行时间数据", - "xpack.uptime.emptyState.noDataTitle": "没有可用的运行时间数据", - "xpack.uptime.emptyState.noIndexTitle": "找不到运行时间索引", "xpack.uptime.emptyStateError.notAuthorized": "您无权查看 Uptime 数据,请联系系统管理员。", "xpack.uptime.emptyStateError.notFoundPage": "未找到页面", "xpack.uptime.emptyStateError.title": "错误", - "xpack.uptime.errorMessage": "错误:{message}", "xpack.uptime.featureCatalogueDescription": "执行终端节点运行状况检查和运行时间监测。", "xpack.uptime.featureRegistry.uptimeFeatureName": "运行时间", "xpack.uptime.filterBar.ariaLabel": "概览页面的输入筛选条件", @@ -16763,4 +16754,4 @@ "xpack.watcher.watchEdit.thresholdWatchExpression.aggType.fieldIsRequiredValidationMessage": "此字段必填。", "xpack.watcher.watcherDescription": "通过创建、管理和监测警报来检测数据中的更改。" } -} +} \ No newline at end of file diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_alert_types/threshold/expression.scss b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_alert_types/threshold/expression.scss index d0a7039ae24e17..3734cf5d5218bf 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_alert_types/threshold/expression.scss +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_alert_types/threshold/expression.scss @@ -1,3 +1,13 @@ .actAlertVisualization__chart { - height: $euiSize * 15; + height: $euiSize * 14; +} + +.actAddAlertSteps { + .euiStep__titleWrapper { + align-items: center; + } + + .euiStep__title { + @include euiTitle('xs'); + } } diff --git a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_alert_types/threshold/expression.tsx b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_alert_types/threshold/expression.tsx index 7557b17f5b67dd..43955db97f2957 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_alert_types/threshold/expression.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/components/builtin_alert_types/threshold/expression.tsx @@ -283,7 +283,7 @@ export const IndexThresholdAlertTypeExpression: React.FunctionComponent @@ -396,7 +396,7 @@ export const IndexThresholdAlertTypeExpression: React.FunctionComponent @@ -445,12 +445,10 @@ export const IndexThresholdAlertTypeExpression: React.FunctionComponent ) : null} - - +
{canShowVizualization ? ( - void }) => ( data-test-subj="createFirstAlertButton" key="create-action" fill - iconType="plusInCircle" - iconSide="left" onClick={onCTAClicked} > { Object { "id": "test2", "key": "test2", - "label": "Test connector 2 (pre-configured)", + "label": "Test connector 2 (preconfigured)", }, ] `); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx index 3f964cc167c257..4199cfb7b4b7fb 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx @@ -25,6 +25,8 @@ import { EuiIconTip, EuiLink, EuiCallOut, + EuiHorizontalRule, + EuiText, } from '@elastic/eui'; import { HttpSetup, ToastsApi } from 'kibana/public'; import { loadActionTypes, loadAllActions } from '../../lib/action_connector_api'; @@ -150,7 +152,7 @@ export const ActionForm = ({ const preconfiguredMessage = i18n.translate( 'xpack.triggersActionsUI.sections.actionForm.preconfiguredTitleMessage', { - defaultMessage: '(pre-configured)', + defaultMessage: '(preconfigured)', } ); const getSelectedOptions = (actionItemId: string) => { @@ -256,81 +258,87 @@ export const ActionForm = ({ ); return ( - - - - - - -
- - - - - - {checkEnabledResult.isEnabled === false && ( - - - - )} - - -
-
-
- - } - extraAction={ - { - const updatedActions = actions.filter((_item: AlertAction, i: number) => i !== index); - setAlertProperty(updatedActions); - setIsAddActionPanelOpen( - updatedActions.filter((item: AlertAction) => item.id !== actionItem.id).length === 0 - ); - setActiveActionItem(undefined); - }} - /> - } - paddingSize="l" - > - {accordionContent} -
+ + + + + + + +

+ + + + + + {checkEnabledResult.isEnabled === false && ( + + + + )} + + +

+
+
+ + } + extraAction={ + { + const updatedActions = actions.filter( + (_item: AlertAction, i: number) => i !== index + ); + setAlertProperty(updatedActions); + setIsAddActionPanelOpen( + updatedActions.filter((item: AlertAction) => item.id !== actionItem.id).length === + 0 + ); + setActiveActionItem(undefined); + }} + /> + } + paddingSize="l" + > + {accordionContent} +
+ +
); }; @@ -341,96 +349,103 @@ export const ActionForm = ({ const actionTypeRegistered = actionTypeRegistry.get(actionItem.actionTypeId); if (!actionTypeRegistered || actionItem.group !== defaultActionGroupId) return null; return ( - - - - - - -
- -
-
-
- - } - extraAction={ - { - const updatedActions = actions.filter((_item: AlertAction, i: number) => i !== index); - setAlertProperty(updatedActions); - setIsAddActionPanelOpen( - updatedActions.filter((item: AlertAction) => item.id !== actionItem.id).length === 0 - ); - setActiveActionItem(undefined); - }} - /> - } - paddingSize="l" - > - actionItem.id === emptyId) ? ( - - ) : ( - - ) + + + + + + + +

+ +

+
+
+ } - actions={[ - { - setActiveActionItem({ actionTypeId: actionItem.actionTypeId, index }); - setAddModalVisibility(true); + const updatedActions = actions.filter( + (_item: AlertAction, i: number) => i !== index + ); + setAlertProperty(updatedActions); + setIsAddActionPanelOpen( + updatedActions.filter((item: AlertAction) => item.id !== actionItem.id).length === + 0 + ); + setActiveActionItem(undefined); }} - > - - , - ]} - /> -
+ /> + } + paddingSize="l" + > + actionItem.id === emptyId) ? ( + + ) : ( + + ) + } + actions={[ + { + setActiveActionItem({ actionTypeId: actionItem.actionTypeId, index }); + setAddModalVisibility(true); + }} + > + + , + ]} + /> +
+ +
); }; @@ -537,19 +552,34 @@ export const ActionForm = ({ ) : ( - {alertActionsList} - - {isAddActionPanelOpen === false ? ( - setIsAddActionPanelOpen(true)} - > + +

- +

+
+ + {alertActionsList} + {isAddActionPanelOpen === false ? ( +
+ + + + setIsAddActionPanelOpen(true)} + > + + + + +
) : null} {isAddActionPanelOpen ? ( @@ -558,7 +588,7 @@ export const ActionForm = ({
@@ -571,6 +601,7 @@ export const ActionForm = ({ - + {isLoadingActionTypes ? ( { expect(connectorNameField.first().prop('value')).toBe('action-connector'); }); - test('if pre-configured connector rendered correct in the edit form', () => { + test('if preconfigured connector rendered correct in the edit form', () => { const connector = { secrets: {}, id: 'test', actionTypeId: 'test-action-type-id', actionType: 'test-action-type-name', - name: 'pre-configured-connector', + name: 'preconfigured-connector', isPreconfigured: true, referencedByCount: 0, config: {}, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_edit_flyout.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_edit_flyout.tsx index a81d6c285f460b..690a64ef4f1f3e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_edit_flyout.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connector_edit_flyout.tsx @@ -104,7 +104,7 @@ export const ConnectorEditFlyout = ({ />  
diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.tsx index 043a644489d82c..566a6030d72bec 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/actions_connectors_list/components/actions_connectors_list.tsx @@ -215,7 +215,7 @@ export const ActionsConnectorsList: React.FunctionComponent = () => { label={i18n.translate( 'xpack.triggersActionsUI.sections.alertForm.preconfiguredTitleMessage', { - defaultMessage: 'Pre-configured', + defaultMessage: 'Preconfigured', } )} tooltipContent="This connector can't be deleted." @@ -338,8 +338,6 @@ export const ActionsConnectorsList: React.FunctionComponent = () => { data-test-subj="createActionButton" key="create-action" fill - iconType="plusInCircle" - iconSide="left" onClick={() => setAddFlyoutVisibility(true)} > { key="create-alert" data-test-subj="createAlertButton" fill - iconType="plusInCircle" - iconSide="left" onClick={() => setAlertFlyoutVisibility(true)} > = ({ isOpen={isPopoverOpen} closePopover={() => setIsPopoverOpen(false)} ownFocus + panelPaddingSize="none" data-test-subj="collapsedItemActions" > - - { - if (item.enabled) { - await disableAlert(item); - } else { - await enableAlert(item); + +
+ { + if (item.enabled) { + await disableAlert(item); + } else { + await enableAlert(item); + } + onAlertChanged(); + }} + label={ + } - onAlertChanged(); - }} - label={ + /> + + - } - /> - - - { - if (item.muteAll) { - await unmuteAlert(item); - } else { - await muteAlert(item); + +
+
+ { + if (item.muteAll) { + await unmuteAlert(item); + } else { + await muteAlert(item); + } + onAlertChanged(); + }} + label={ + } - onAlertChanged(); - }} - label={ + /> + + - } - /> - - - - setAlertsToDelete([item.id])} - > - - - - + +
+ + setAlertsToDelete([item.id])} + > +
+
+ +
+
+ +

+ +

+
+
+
+
+
); }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/alert_quick_edit_buttons.scss b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/alert_quick_edit_buttons.scss new file mode 100644 index 00000000000000..a5b4cc258c1b59 --- /dev/null +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/alert_quick_edit_buttons.scss @@ -0,0 +1,5 @@ +.actBulkActionPopover__deleteAll { + .euiButtonEmpty__text { + padding-top: $euiSizeXS; + } +} diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/alert_quick_edit_buttons.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/alert_quick_edit_buttons.tsx index eeae0cf54f1a19..26bc8b869a06bd 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/alert_quick_edit_buttons.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/alert_quick_edit_buttons.tsx @@ -5,9 +5,9 @@ */ import { i18n } from '@kbn/i18n'; -import React, { useState, Fragment } from 'react'; +import React, { useState } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiButtonEmpty } from '@elastic/eui'; +import { EuiButtonEmpty, EuiFlexItem, EuiFlexGroup } from '@elastic/eui'; import { Alert } from '../../../../types'; import { useAppDependencies } from '../../../app_context'; @@ -15,6 +15,7 @@ import { withBulkAlertOperations, ComponentOpts as BulkOperationsComponentOpts, } from './with_bulk_alert_api_operations'; +import './alert_quick_edit_buttons.scss'; export type ComponentOpts = { selectedItems: Alert[]; @@ -147,72 +148,84 @@ export const AlertQuickEditButtons: React.FunctionComponent = ({ } return ( - + {!allAlertsMuted && ( - - - + + + + + )} {allAlertsMuted && ( - - - + + + + + )} {allAlertsDisabled && ( - - - + + + + + )} {!allAlertsDisabled && ( + + + + + + )} + - )} - - - - - + + ); }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/bulk_operation_popover.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/bulk_operation_popover.tsx index d0fd0e17928183..935b0bd8985ca8 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/bulk_operation_popover.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/common/components/bulk_operation_popover.tsx @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { useState } from 'react'; +import React, { useState, Fragment } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiButton, EuiFormRow, EuiPopover } from '@elastic/eui'; +import { EuiButton, EuiPopover } from '@elastic/eui'; export const BulkOperationPopover: React.FunctionComponent = ({ children }) => { const [isPopoverOpen, setIsPopoverOpen] = useState(false); @@ -16,6 +16,7 @@ export const BulkOperationPopover: React.FunctionComponent = ({ children }) => { isOpen={isPopoverOpen} closePopover={() => setIsPopoverOpen(false)} data-test-subj="bulkAction" + panelPaddingSize="s" button={ { > {children && React.Children.map(children, child => - React.isValidElement(child) ? ( - {React.cloneElement(child, {})} - ) : ( - child - ) + React.isValidElement(child) ? {React.cloneElement(child, {})} : child )} ); diff --git a/x-pack/plugins/uptime/server/graphql/constants.ts b/x-pack/plugins/uptime/server/graphql/constants.ts deleted file mode 100644 index aba58f5c6c4a54..00000000000000 --- a/x-pack/plugins/uptime/server/graphql/constants.ts +++ /dev/null @@ -1,7 +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. - */ - -export const DEFAULT_GRAPHQL_PATH = '/api/uptime/graphql'; diff --git a/x-pack/plugins/uptime/server/graphql/index.ts b/x-pack/plugins/uptime/server/graphql/index.ts deleted file mode 100644 index a88afd7ac769c8..00000000000000 --- a/x-pack/plugins/uptime/server/graphql/index.ts +++ /dev/null @@ -1,17 +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 { createMonitorStatesResolvers, monitorStatesSchema } from './monitor_states'; -import { pingsSchema } from './pings'; -import { CreateUMGraphQLResolvers } from './types'; -import { unsignedIntegerResolverFunctions, unsignedIntegerSchema } from './unsigned_int_scalar'; - -export { DEFAULT_GRAPHQL_PATH } from './constants'; -export const resolvers: CreateUMGraphQLResolvers[] = [ - createMonitorStatesResolvers, - unsignedIntegerResolverFunctions, -]; -export const typeDefs: any[] = [pingsSchema, unsignedIntegerSchema, monitorStatesSchema]; diff --git a/x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts b/x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts deleted file mode 100644 index 479c06234ca66a..00000000000000 --- a/x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts +++ /dev/null @@ -1,76 +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 { CreateUMGraphQLResolvers, UMContext } from '../types'; -import { UMServerLibs } from '../../lib/lib'; -import { UMResolver } from '../../../../../legacy/plugins/uptime/common/graphql/resolver_types'; -import { - GetMonitorStatesQueryArgs, - MonitorSummaryResult, -} from '../../../../../legacy/plugins/uptime/common/graphql/types'; -import { CONTEXT_DEFAULTS } from '../../../../../legacy/plugins/uptime/common/constants'; -import { savedObjectsAdapter } from '../../lib/saved_objects'; - -export type UMGetMonitorStatesResolver = UMResolver< - MonitorSummaryResult | Promise, - any, - GetMonitorStatesQueryArgs, - UMContext ->; - -export const createMonitorStatesResolvers: CreateUMGraphQLResolvers = ( - libs: UMServerLibs -): { - Query: { - getMonitorStates: UMGetMonitorStatesResolver; - }; -} => { - return { - Query: { - async getMonitorStates( - _resolver, - { dateRangeStart, dateRangeEnd, filters, pagination, statusFilter, pageSize }, - { APICaller, savedObjectsClient } - ): Promise { - const dynamicSettings = await savedObjectsAdapter.getUptimeDynamicSettings( - savedObjectsClient - ); - - const decodedPagination = pagination - ? JSON.parse(decodeURIComponent(pagination)) - : CONTEXT_DEFAULTS.CURSOR_PAGINATION; - const [ - indexStatus, - { summaries, nextPagePagination, prevPagePagination }, - ] = await Promise.all([ - libs.requests.getIndexStatus({ callES: APICaller, dynamicSettings }), - libs.requests.getMonitorStates({ - callES: APICaller, - dynamicSettings, - dateRangeStart, - dateRangeEnd, - pagination: decodedPagination, - pageSize, - filters, - // this is added to make typescript happy, - // this sort of reassignment used to be further downstream but I've moved it here - // because this code is going to be decomissioned soon - statusFilter: statusFilter || undefined, - }), - ]); - - const totalSummaryCount = indexStatus?.docCount ?? 0; - - return { - summaries, - nextPagePagination, - prevPagePagination, - totalSummaryCount, - }; - }, - }, - }; -}; diff --git a/x-pack/plugins/uptime/server/graphql/monitor_states/schema.gql.ts b/x-pack/plugins/uptime/server/graphql/monitor_states/schema.gql.ts deleted file mode 100644 index 040ad99ac0c640..00000000000000 --- a/x-pack/plugins/uptime/server/graphql/monitor_states/schema.gql.ts +++ /dev/null @@ -1,183 +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 gql from 'graphql-tag'; - -export const monitorStatesSchema = gql` - "Represents a monitor's statuses for a period of time." - type SummaryHistogramPoint { - "The time at which these data were collected." - timestamp: UnsignedInteger! - "The number of _up_ documents." - up: Int! - "The number of _down_ documents." - down: Int! - } - - "Monitor status data over time." - type SummaryHistogram { - "The number of documents used to assemble the histogram." - count: Int! - "The individual histogram data points." - points: [SummaryHistogramPoint!]! - } - - type Agent { - id: String! - } - - type Check { - agent: Agent - container: StateContainer - kubernetes: StateKubernetes - monitor: CheckMonitor! - observer: CheckObserver - timestamp: String! - } - - type StateContainer { - id: String - } - - type StateKubernetes { - pod: StatePod - } - - type StatePod { - uid: String - } - - type CheckMonitor { - ip: String - name: String - status: String! - } - - type Location { - lat: Float - lon: Float - } - - type CheckGeo { - name: String - location: Location - } - - type CheckObserver { - geo: CheckGeo - } - - type StateGeo { - name: [String] - location: Location - } - - type StateObserver { - geo: StateGeo - } - - type MonitorState { - status: String - name: String - id: String - type: String - } - - type Summary { - up: Int - down: Int - geo: CheckGeo - } - - type MonitorSummaryUrl { - domain: String - fragment: String - full: String - original: String - password: String - path: String - port: Int - query: String - scheme: String - username: String - } - - type StateUrl { - domain: String - full: String - path: String - port: Int - scheme: String - } - - "Contains monitor transmission encryption information." - type StateTLS { - "The date and time after which the certificate is invalid." - certificate_not_valid_after: String - certificate_not_valid_before: String - certificates: String - rtt: RTT - } - - "Unifies the subsequent data for an uptime monitor." - type State { - "The agent processing the monitor." - agent: Agent - "There is a check object for each instance of the monitoring agent." - checks: [Check!] - geo: StateGeo - observer: StateObserver - monitor: MonitorState - summary: Summary! - timestamp: UnsignedInteger! - "Transport encryption information." - tls: [StateTLS] - url: StateUrl - } - - "Represents the current state and associated data for an Uptime monitor." - type MonitorSummary { - "The ID assigned by the config or generated by the user." - monitor_id: String! - "The state of the monitor and its associated details." - state: State! - histogram: SummaryHistogram - } - - "The primary object returned for monitor states." - type MonitorSummaryResult { - "Used to go to the next page of results" - prevPagePagination: String - "Used to go to the previous page of results" - nextPagePagination: String - "The objects representing the state of a series of heartbeat monitors." - summaries: [MonitorSummary!] - "The number of summaries." - totalSummaryCount: Int! - } - - enum CursorDirection { - AFTER - BEFORE - } - - enum SortOrder { - ASC - DESC - } - - type Query { - "Fetches the current state of Uptime monitors for the given parameters." - getMonitorStates( - dateRangeStart: String! - dateRangeEnd: String! - pagination: String - filters: String - statusFilter: String - pageSize: Int - ): MonitorSummaryResult - } -`; diff --git a/x-pack/plugins/uptime/server/graphql/pings/schema.gql.ts b/x-pack/plugins/uptime/server/graphql/pings/schema.gql.ts deleted file mode 100644 index 179bca53db1617..00000000000000 --- a/x-pack/plugins/uptime/server/graphql/pings/schema.gql.ts +++ /dev/null @@ -1,264 +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 gql from 'graphql-tag'; - -export const pingsSchema = gql` - type PingResults { - "Total number of matching pings" - total: UnsignedInteger! - "Unique list of all locations the query matched" - locations: [String!]! - "List of pings " - pings: [Ping!]! - } - - type ContainerImage { - name: String - tag: String - } - - type Container { - id: String - image: ContainerImage - name: String - runtime: String - } - - type DocCount { - count: UnsignedInteger! - } - - "The monitor's status for a ping" - type Duration { - us: UnsignedInteger - } - - "An agent for recording a beat" - type Beat { - hostname: String - name: String - timezone: String - type: String - } - - type Docker { - id: String - image: String - name: String - } - - type ECS { - version: String - } - - type Error { - code: Int - message: String - type: String - } - - type OS { - family: String - kernel: String - platform: String - version: String - name: String - build: String - } - - "Geolocation data added via processors to enrich events." - type Geo { - "Name of the city in which the agent is running." - city_name: String - "The name of the continent on which the agent is running." - continent_name: String - "ISO designation for the agent's country." - country_iso_code: String - "The name of the agent's country." - country_name: String - "The lat/long of the agent." - location: String - "A name for the host's location, e.g. 'us-east-1' or 'LAX'." - name: String - "ISO designation of the agent's region." - region_iso_code: String - "Name of the region hosting the agent." - region_name: String - } - - type Host { - architecture: String - id: String - hostname: String - ip: String - mac: String - name: String - os: OS - } - - type HttpRTT { - content: Duration - response_header: Duration - total: Duration - validate: Duration - validate_body: Duration - write_request: Duration - } - - type HTTPBody { - "Size of HTTP response body in bytes" - bytes: UnsignedInteger - "Hash of the HTTP response body" - hash: String - "Response body of the HTTP Response. May be truncated based on client settings." - content: String - "Byte length of the content string, taking into account multibyte chars." - content_bytes: UnsignedInteger - } - - type HTTPResponse { - status_code: UnsignedInteger - body: HTTPBody - } - - type HTTP { - response: HTTPResponse - rtt: HttpRTT - url: String - } - - type ICMP { - requests: Int - rtt: Int - } - - type KubernetesContainer { - image: String - name: String - } - - type KubernetesNode { - name: String - } - - type KubernetesPod { - name: String - uid: String - } - - type Kubernetes { - container: KubernetesContainer - namespace: String - node: KubernetesNode - pod: KubernetesPod - } - - type MetaCloud { - availability_zone: String - instance_id: String - instance_name: String - machine_type: String - project_id: String - provider: String - region: String - } - - type Meta { - cloud: MetaCloud - } - - type Monitor { - duration: Duration - host: String - "The id of the monitor" - id: String - "The IP pinged by the monitor" - ip: String - "The name of the protocol being monitored" - name: String - "The protocol scheme of the monitored host" - scheme: String - "The status of the monitored host" - status: String - "The type of host being monitored" - type: String - check_group: String - } - - "Metadata added by a proccessor, which is specified in its configuration." - type Observer { - "Geolocation data for the agent." - geo: Geo - } - - type Resolve { - host: String - ip: String - rtt: Duration - } - - type RTT { - connect: Duration - handshake: Duration - validate: Duration - } - - type Socks5 { - rtt: RTT - } - - type TCP { - port: Int - rtt: RTT - } - - "Contains monitor transmission encryption information." - type PingTLS { - "The date and time after which the certificate is invalid." - certificate_not_valid_after: String - certificate_not_valid_before: String - certificates: String - rtt: RTT - } - - type URL { - full: String - scheme: String - domain: String - port: Int - path: String - query: String - } - - "A request sent from a monitor to a host" - type Ping { - "unique ID for this ping" - id: String! - "The timestamp of the ping's creation" - timestamp: String! - "The agent that recorded the ping" - beat: Beat - container: Container - docker: Docker - ecs: ECS - error: Error - host: Host - http: HTTP - icmp: ICMP - kubernetes: Kubernetes - meta: Meta - monitor: Monitor - observer: Observer - resolve: Resolve - socks5: Socks5 - summary: Summary - tags: String - tcp: TCP - tls: PingTLS - url: URL - } -`; diff --git a/x-pack/plugins/uptime/server/graphql/types.ts b/x-pack/plugins/uptime/server/graphql/types.ts deleted file mode 100644 index 5f0a6749eb5999..00000000000000 --- a/x-pack/plugins/uptime/server/graphql/types.ts +++ /dev/null @@ -1,23 +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 { RequestHandlerContext, CallAPIOptions, SavedObjectsClient } from 'src/core/server'; -import { UMServerLibs } from '../lib/lib'; - -export type UMContext = RequestHandlerContext & { - APICaller: ( - endpoint: string, - clientParams?: Record, - options?: CallAPIOptions | undefined - ) => Promise; - savedObjectsClient: SavedObjectsClient; -}; - -export interface UMGraphQLResolver { - Query?: any; -} - -export type CreateUMGraphQLResolvers = (libs: UMServerLibs) => any; diff --git a/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_literal.test.ts b/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_literal.test.ts deleted file mode 100644 index 7c357abcf8e1d1..00000000000000 --- a/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_literal.test.ts +++ /dev/null @@ -1,42 +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 { parseLiteral } from '../resolvers'; - -describe('parseLiteral', () => { - it('parses string literal of type IntValue', () => { - const result = parseLiteral({ - kind: 'IntValue', - value: '1562605032000', - }); - expect(result).toBe(1562605032000); - }); - - it('parses string literal of type FloatValue', () => { - const result = parseLiteral({ - kind: 'FloatValue', - value: '1562605032000.0', - }); - expect(result).toBe(1562605032000); - }); - - it('parses string literal of type String', () => { - const result = parseLiteral({ - kind: 'StringValue', - value: '1562605032000', - }); - expect(result).toBe(1562605032000); - }); - - it('returns `null` for unsupported types', () => { - expect( - parseLiteral({ - kind: 'EnumValue', - value: 'false', - }) - ).toBeNull(); - }); -}); diff --git a/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_value.test.ts b/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_value.test.ts deleted file mode 100644 index cb8958918c6dc4..00000000000000 --- a/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_value.test.ts +++ /dev/null @@ -1,19 +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 { parseValue } from '../resolvers'; - -describe('parseValue', () => { - it(`parses a number value and returns it if its > 0`, () => { - const result = parseValue('1562605032000'); - expect(result).toBe(1562605032000); - }); - - it(`parses a number and returns null if its value is < 0`, () => { - const result = parseValue('-1562605032000'); - expect(result).toBeNull(); - }); -}); diff --git a/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/serialize.test.ts b/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/serialize.test.ts deleted file mode 100644 index 2271d12ee7e13c..00000000000000 --- a/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/serialize.test.ts +++ /dev/null @@ -1,24 +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 { serialize } from '../resolvers'; - -describe('serialize', () => { - it('serializes date strings correctly', () => { - const result = serialize('2019-07-08T16:59:09.796Z'); - expect(result).toBe(1562605149796); - }); - - it('serializes timestamp strings correctly', () => { - const result = serialize('1562605032000'); - expect(result).toBe(1562605032000); - }); - - it('serializes non-date and non-numeric values to NaN', () => { - const result = serialize('foo'); - expect(result).toBeNaN(); - }); -}); diff --git a/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/index.ts b/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/index.ts deleted file mode 100644 index a8819f543a8517..00000000000000 --- a/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/index.ts +++ /dev/null @@ -1,8 +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. - */ - -export { unsignedIntegerResolverFunctions } from './resolvers'; -export { unsignedIntegerSchema } from './schema.gql'; diff --git a/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/resolvers.ts b/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/resolvers.ts deleted file mode 100644 index 9b8fe145e7ff5f..00000000000000 --- a/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/resolvers.ts +++ /dev/null @@ -1,51 +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 { GraphQLScalarType, Kind, ValueNode } from 'graphql'; -import { UMServerLibs } from '../../lib/lib'; -import { CreateUMGraphQLResolvers } from '../types'; - -export const serialize = (value: any): number => { - // `parseInt` will yield `2019` for a value such as "2019-07-08T16:59:09.796Z" - if (isNaN(Number(value))) { - return Date.parse(value); - } - return parseInt(value, 10); -}; - -export const parseValue = (value: any) => { - const parsed = parseInt(value, 10); - if (parsed < 0) { - return null; - } - return parsed; -}; - -export const parseLiteral = (ast: ValueNode) => { - switch (ast.kind) { - case Kind.INT: - case Kind.FLOAT: - case Kind.STRING: - return parseInt(ast.value, 10); - } - return null; -}; - -const unsignedIntegerScalar = new GraphQLScalarType({ - name: 'UnsignedInteger', - description: 'Represents an unsigned 32-bit integer', - serialize, - parseValue, - parseLiteral, -}); - -/** - * This scalar resolver will parse an integer string of > 32 bits and return a value of type `number`. - * This assumes that the code is running in an environment that supports big ints. - */ -export const unsignedIntegerResolverFunctions: CreateUMGraphQLResolvers = (libs: UMServerLibs) => ({ - UnsignedInteger: unsignedIntegerScalar, -}); diff --git a/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts b/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts index 47fe5f2af42637..98c6be5aa3c8e8 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts @@ -4,7 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import { GraphQLSchema } from 'graphql'; import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; import { IRouter, @@ -44,5 +43,4 @@ export interface UptimeCorePlugins { export interface UMBackendFrameworkAdapter { registerRoute(route: UMKibanaRoute): void; - registerGraphQLEndpoint(routePath: string, schema: GraphQLSchema): void; } diff --git a/x-pack/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts index 1f92c8212b393f..0176471aec1be2 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts @@ -4,9 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import { GraphQLSchema } from 'graphql'; -import { schema as kbnSchema } from '@kbn/config-schema'; -import { runHttpQuery } from 'apollo-server-core'; import { UptimeCoreSetup } from './adapter_types'; import { UMBackendFrameworkAdapter } from './adapter_types'; import { UMKibanaRoute } from '../../../rest_api'; @@ -33,71 +30,4 @@ export class UMKibanaBackendFrameworkAdapter implements UMBackendFrameworkAdapte throw new Error(`Handler for method ${method} is not defined`); } } - - public registerGraphQLEndpoint(routePath: string, schema: GraphQLSchema): void { - this.server.route.post( - { - path: routePath, - validate: { - body: kbnSchema.object({ - operationName: kbnSchema.nullable(kbnSchema.string()), - query: kbnSchema.string(), - variables: kbnSchema.recordOf(kbnSchema.string(), kbnSchema.any()), - }), - }, - options: { - tags: ['access:uptime-read'], - }, - }, - async (context, request, resp): Promise => { - const { - core: { - elasticsearch: { - dataClient: { callAsCurrentUser }, - }, - }, - } = context; - const options = { - graphQLOptions: (_req: any) => { - return { - context: { - ...context, - APICaller: callAsCurrentUser, - savedObjectsClient: context.core.savedObjects.client, - }, - schema, - }; - }, - path: routePath, - route: { - tags: ['access:uptime-read'], - }, - }; - try { - const query = request.body as Record; - - const graphQLResponse = await runHttpQuery([request], { - method: 'POST', - options: options.graphQLOptions, - query, - }); - - return resp.ok({ - body: graphQLResponse, - headers: { - 'content-type': 'application/json', - }, - }); - } catch (error) { - if (error.isGraphQLError === true) { - return resp.internalError({ - body: { message: error.message }, - headers: { 'content-type': 'application/json' }, - }); - } - return resp.internalError(); - } - } - ); - } } diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_certs.test.ts b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_certs.test.ts new file mode 100644 index 00000000000000..539344dfca791f --- /dev/null +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_certs.test.ts @@ -0,0 +1,208 @@ +/* + * 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 { getCerts } from '../get_certs'; + +describe('getCerts', () => { + let mockHits: any; + let mockCallES: jest.Mock; + + beforeEach(() => { + mockHits = [ + { + _index: 'heartbeat-8.0.0-2020.04.16-000001', + _id: 'DJwmhHEBnyP8RKDrEYVK', + _score: 0, + _source: { + tls: { + certificate_not_valid_before: '2019-08-16T01:40:25.000Z', + server: { + x509: { + subject: { + common_name: 'r2.shared.global.fastly.net', + }, + issuer: { + common_name: 'GlobalSign CloudSSL CA - SHA256 - G3', + }, + }, + hash: { + sha1: 'b7b4b89ef0d0caf39d223736f0fdbb03c7b426f1', + sha256: '12b00d04db0db8caa302bfde043e88f95baceb91e86ac143e93830b4bbec726d', + }, + }, + certificate_not_valid_after: '2020-07-16T03:15:39.000Z', + }, + monitor: { + name: 'Real World Test', + id: 'real-world-test', + }, + }, + fields: { + 'tls.server.hash.sha256': [ + '12b00d04db0db8caa302bfde043e88f95baceb91e86ac143e93830b4bbec726d', + ], + }, + inner_hits: { + monitors: { + hits: { + total: { + value: 32, + relation: 'eq', + }, + max_score: null, + hits: [ + { + _index: 'heartbeat-8.0.0-2020.04.16-000001', + _id: 'DJwmhHEBnyP8RKDrEYVK', + _score: null, + _source: { + monitor: { + name: 'Real World Test', + id: 'real-world-test', + }, + }, + fields: { + 'monitor.id': ['real-world-test'], + }, + sort: ['real-world-test'], + }, + ], + }, + }, + }, + }, + ]; + mockCallES = jest.fn(); + mockCallES.mockImplementation(() => ({ + hits: { + hits: mockHits, + }, + })); + }); + + it('parses query result and returns expected values', async () => { + const result = await getCerts({ + callES: mockCallES, + dynamicSettings: { heartbeatIndices: 'heartbeat*' }, + index: 1, + from: 'now-2d', + to: 'now+1h', + search: 'my_common_name', + size: 30, + }); + expect(result).toMatchInlineSnapshot(` + Array [ + Object { + "certificate_not_valid_after": "2020-07-16T03:15:39.000Z", + "certificate_not_valid_before": "2019-08-16T01:40:25.000Z", + "common_name": "r2.shared.global.fastly.net", + "issuer": "GlobalSign CloudSSL CA - SHA256 - G3", + "monitors": Array [ + Object { + "id": "real-world-test", + "name": "Real World Test", + }, + ], + "sha1": "b7b4b89ef0d0caf39d223736f0fdbb03c7b426f1", + "sha256": "12b00d04db0db8caa302bfde043e88f95baceb91e86ac143e93830b4bbec726d", + }, + ] + `); + expect(mockCallES.mock.calls).toMatchInlineSnapshot(` + Array [ + Array [ + "search", + Object { + "body": Object { + "_source": Array [ + "monitor.id", + "monitor.name", + "tls.server.x509.issuer.common_name", + "tls.server.x509.subject.common_name", + "tls.server.hash.sha1", + "tls.server.hash.sha256", + "tls.certificate_not_valid_before", + "tls.certificate_not_valid_after", + ], + "collapse": Object { + "field": "tls.server.hash.sha256", + "inner_hits": Object { + "_source": Object { + "includes": Array [ + "monitor.id", + "monitor.name", + ], + }, + "collapse": Object { + "field": "monitor.id", + }, + "name": "monitors", + "sort": Array [ + Object { + "monitor.id": "asc", + }, + ], + }, + }, + "from": 1, + "query": Object { + "bool": Object { + "filter": Array [ + Object { + "exists": Object { + "field": "tls", + }, + }, + Object { + "range": Object { + "@timestamp": Object { + "gte": "now-2d", + "lte": "now+1h", + }, + }, + }, + ], + "should": Array [ + Object { + "wildcard": Object { + "tls.server.issuer": Object { + "value": "*my_common_name*", + }, + }, + }, + Object { + "wildcard": Object { + "tls.common_name": Object { + "value": "*my_common_name*", + }, + }, + }, + Object { + "wildcard": Object { + "monitor.id": Object { + "value": "*my_common_name*", + }, + }, + }, + Object { + "wildcard": Object { + "monitor.name": Object { + "value": "*my_common_name*", + }, + }, + }, + ], + }, + }, + "size": 30, + }, + "index": "heartbeat*", + }, + ], + ] + `); + }); +}); diff --git a/x-pack/plugins/uptime/server/lib/requests/get_certs.ts b/x-pack/plugins/uptime/server/lib/requests/get_certs.ts new file mode 100644 index 00000000000000..4f99fbe94d54c7 --- /dev/null +++ b/x-pack/plugins/uptime/server/lib/requests/get_certs.ts @@ -0,0 +1,135 @@ +/* + * 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 { UMElasticsearchQueryFn } from '../adapters'; +import { Cert, GetCertsParams } from '../../../../../legacy/plugins/uptime/common/runtime_types'; + +export const getCerts: UMElasticsearchQueryFn = async ({ + callES, + dynamicSettings, + index, + from, + to, + search, + size, +}) => { + const searchWrapper = `*${search}*`; + const params: any = { + index: dynamicSettings.heartbeatIndices, + body: { + from: index, + size, + query: { + bool: { + filter: [ + { + exists: { + field: 'tls', + }, + }, + { + range: { + '@timestamp': { + gte: from, + lte: to, + }, + }, + }, + ], + }, + }, + _source: [ + 'monitor.id', + 'monitor.name', + 'tls.server.x509.issuer.common_name', + 'tls.server.x509.subject.common_name', + 'tls.server.hash.sha1', + 'tls.server.hash.sha256', + 'tls.certificate_not_valid_before', + 'tls.certificate_not_valid_after', + ], + collapse: { + field: 'tls.server.hash.sha256', + inner_hits: { + _source: { + includes: ['monitor.id', 'monitor.name'], + }, + collapse: { + field: 'monitor.id', + }, + name: 'monitors', + sort: [{ 'monitor.id': 'asc' }], + }, + }, + }, + }; + + if (search) { + params.body.query.bool.should = [ + { + wildcard: { + 'tls.server.issuer': { + value: searchWrapper, + }, + }, + }, + { + wildcard: { + 'tls.common_name': { + value: searchWrapper, + }, + }, + }, + { + wildcard: { + 'monitor.id': { + value: searchWrapper, + }, + }, + }, + { + wildcard: { + 'monitor.name': { + value: searchWrapper, + }, + }, + }, + ]; + } + + const result = await callES('search', params); + const formatted = (result?.hits?.hits ?? []).map((hit: any) => { + const { + _source: { + tls: { + server: { + x509: { + issuer: { common_name: issuer }, + subject: { common_name }, + }, + hash: { sha1, sha256 }, + }, + certificate_not_valid_after, + certificate_not_valid_before, + }, + }, + } = hit; + const monitors = hit.inner_hits.monitors.hits.hits.map((monitor: any) => ({ + name: monitor._source?.monitor.name, + id: monitor._source?.monitor.id, + })); + return { + monitors, + certificate_not_valid_after, + certificate_not_valid_before, + issuer, + sha1, + sha256, + common_name, + }; + }); + return formatted; +}; diff --git a/x-pack/plugins/uptime/server/lib/requests/get_monitor_details.ts b/x-pack/plugins/uptime/server/lib/requests/get_monitor_details.ts index 8393370e1516b0..4ce7176b57b199 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_monitor_details.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_monitor_details.ts @@ -68,11 +68,11 @@ export const getMonitorDetails: UMElasticsearchQueryFn< const data = result.hits.hits[0]?._source; const monitorError: MonitorError | undefined = data?.error; - const errorTimeStamp: string | undefined = data?.['@timestamp']; + const errorTimestamp: string | undefined = data?.['@timestamp']; return { monitorId, error: monitorError, - timestamp: errorTimeStamp, + timestamp: errorTimestamp, }; }; diff --git a/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts b/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts index d7842d1a0b4aa8..4b40943a857051 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts @@ -8,10 +8,11 @@ import { CONTEXT_DEFAULTS } from '../../../../../legacy/plugins/uptime/common/co import { fetchPage } from './search'; import { UMElasticsearchQueryFn } from '../adapters'; import { - MonitorSummary, SortOrder, CursorDirection, -} from '../../../../../legacy/plugins/uptime/common/graphql/types'; + MonitorSummary, +} from '../../../../../legacy/plugins/uptime/common/runtime_types'; + import { QueryContext } from './search'; export interface CursorPagination { diff --git a/x-pack/plugins/uptime/server/lib/requests/index.ts b/x-pack/plugins/uptime/server/lib/requests/index.ts index 6317f665d377f4..243bb089cc7b46 100644 --- a/x-pack/plugins/uptime/server/lib/requests/index.ts +++ b/x-pack/plugins/uptime/server/lib/requests/index.ts @@ -4,6 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ +export { getCerts } from './get_certs'; export { getFilterBar, GetFilterBarParams } from './get_filter_bar'; export { getUptimeIndexPattern as getIndexPattern } from './get_index_pattern'; export { getLatestMonitor, GetLatestMonitorParams } from './get_latest_monitor'; diff --git a/x-pack/plugins/uptime/server/lib/requests/search/__tests__/fetch_page.test.ts b/x-pack/plugins/uptime/server/lib/requests/search/__tests__/fetch_page.test.ts index f542773f32796e..2a8f681ab34536 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/__tests__/fetch_page.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/__tests__/fetch_page.test.ts @@ -12,7 +12,7 @@ import { MonitorGroupsPage, } from '../fetch_page'; import { QueryContext } from '../query_context'; -import { MonitorSummary } from '../../../../../../../legacy/plugins/uptime/common/graphql/types'; +import { MonitorSummary } from '../../../../../../../legacy/plugins/uptime/common/runtime_types'; import { nextPagination, prevPagination, simpleQueryContext } from './test_helpers'; const simpleFixture: MonitorGroups[] = [ @@ -53,12 +53,16 @@ const simpleFetcher = (monitorGroups: MonitorGroups[]): MonitorGroupsFetcher => }; const simpleEnricher = (monitorGroups: MonitorGroups[]): MonitorEnricher => { - return async (queryContext: QueryContext, checkGroups: string[]): Promise => { + return async (_queryContext: QueryContext, checkGroups: string[]): Promise => { return checkGroups.map(cg => { const monitorGroup = monitorGroups.find(mg => mg.groups.some(g => g.checkGroup === cg))!; return { monitor_id: monitorGroup.id, - state: { summary: {}, timestamp: new Date(Date.parse('1999-12-31')).toISOString() }, + state: { + summary: {}, + timestamp: new Date(Date.parse('1999-12-31')).valueOf().toString(), + url: {}, + }, }; }); }; @@ -71,16 +75,37 @@ describe('fetching a page', () => { simpleFetcher(simpleFixture), simpleEnricher(simpleFixture) ); - expect(res).toEqual({ - items: [ - { - monitor_id: 'foo', - state: { summary: {}, timestamp: '1999-12-31T00:00:00.000Z' }, + expect(res).toMatchInlineSnapshot(` + Object { + "items": Array [ + Object { + "monitor_id": "foo", + "state": Object { + "summary": Object {}, + "timestamp": "946598400000", + "url": Object {}, + }, + }, + Object { + "monitor_id": "bar", + "state": Object { + "summary": Object {}, + "timestamp": "946598400000", + "url": Object {}, + }, + }, + ], + "nextPagePagination": Object { + "cursorDirection": "AFTER", + "cursorKey": "bar", + "sortOrder": "ASC", }, - { monitor_id: 'bar', state: { summary: {}, timestamp: '1999-12-31T00:00:00.000Z' } }, - ], - nextPagePagination: { cursorDirection: 'AFTER', sortOrder: 'ASC', cursorKey: 'bar' }, - prevPagePagination: { cursorDirection: 'BEFORE', sortOrder: 'ASC', cursorKey: 'foo' }, - }); + "prevPagePagination": Object { + "cursorDirection": "BEFORE", + "cursorKey": "foo", + "sortOrder": "ASC", + }, + } + `); }); }); diff --git a/x-pack/plugins/uptime/server/lib/requests/search/__tests__/query_context.test.ts b/x-pack/plugins/uptime/server/lib/requests/search/__tests__/query_context.test.ts index a6c98541fba1d7..84774cdeed8567 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/__tests__/query_context.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/__tests__/query_context.test.ts @@ -9,7 +9,7 @@ import { CursorPagination } from '../types'; import { CursorDirection, SortOrder, -} from '../../../../../../../legacy/plugins/uptime/common/graphql/types'; +} from '../../../../../../../legacy/plugins/uptime/common/runtime_types'; describe(QueryContext, () => { // 10 minute range diff --git a/x-pack/plugins/uptime/server/lib/requests/search/__tests__/test_helpers.ts b/x-pack/plugins/uptime/server/lib/requests/search/__tests__/test_helpers.ts index d1212daf5304fd..47034c21301164 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/__tests__/test_helpers.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/__tests__/test_helpers.ts @@ -8,7 +8,7 @@ import { CursorPagination } from '../types'; import { CursorDirection, SortOrder, -} from '../../../../../../../legacy/plugins/uptime/common/graphql/types'; +} from '../../../../../../../legacy/plugins/uptime/common/runtime_types'; import { QueryContext } from '../query_context'; export const prevPagination = (key: any): CursorPagination => { 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 1798550875276f..4739c804d24e75 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 @@ -8,12 +8,12 @@ import { get, sortBy } from 'lodash'; import { QueryContext } from './query_context'; import { QUERY, STATES } from '../../../../../../legacy/plugins/uptime/common/constants'; import { - MonitorSummary, - SummaryHistogram, Check, + Histogram, + MonitorSummary, CursorDirection, SortOrder, -} from '../../../../../../legacy/plugins/uptime/common/graphql/types'; +} from '../../../../../../legacy/plugins/uptime/common/runtime_types'; import { MonitorEnricher } from './fetch_page'; export const enrichMonitorGroups: MonitorEnricher = async ( @@ -250,11 +250,8 @@ export const enrichMonitorGroups: MonitorEnricher = async ( const summaries: MonitorSummary[] = monitorBuckets.map((monitor: any) => { const monitorId = get(monitor, 'key.monitor_id'); monitorIds.push(monitorId); - let state = get(monitor, 'state.value'); - state = { - ...state, - timestamp: state['@timestamp'], - }; + const state: any = monitor.state?.value; + state.timestamp = state['@timestamp']; const { checks } = state; if (checks) { state.checks = sortBy(checks, checksSortBy); @@ -289,7 +286,7 @@ export const enrichMonitorGroups: MonitorEnricher = async ( const getHistogramForMonitors = async ( queryContext: QueryContext, monitorIds: string[] -): Promise<{ [key: string]: SummaryHistogram }> => { +): Promise<{ [key: string]: Histogram }> => { const params = { index: queryContext.heartbeatIndices, body: { diff --git a/x-pack/plugins/uptime/server/lib/requests/search/fetch_page.ts b/x-pack/plugins/uptime/server/lib/requests/search/fetch_page.ts index 62144dacbd3777..84167840d5d9ba 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/fetch_page.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/fetch_page.ts @@ -12,7 +12,7 @@ import { CursorDirection, MonitorSummary, SortOrder, -} from '../../../../../../legacy/plugins/uptime/common/graphql/types'; +} from '../../../../../../legacy/plugins/uptime/common/runtime_types'; import { enrichMonitorGroups } from './enrich_monitor_groups'; import { MonitorGroupIterator } from './monitor_group_iterator'; diff --git a/x-pack/plugins/uptime/server/lib/requests/search/find_potential_matches.ts b/x-pack/plugins/uptime/server/lib/requests/search/find_potential_matches.ts index 424c097853ad3c..3449febfa5b053 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/find_potential_matches.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/find_potential_matches.ts @@ -5,7 +5,7 @@ */ import { get, set } from 'lodash'; -import { CursorDirection } from '../../../../../../legacy/plugins/uptime/common/graphql/types'; +import { CursorDirection } from '../../../../../../legacy/plugins/uptime/common/runtime_types'; import { QueryContext } from './query_context'; // This is the first phase of the query. In it, we find the most recent check groups that matched the given query. diff --git a/x-pack/plugins/uptime/server/lib/requests/search/monitor_group_iterator.ts b/x-pack/plugins/uptime/server/lib/requests/search/monitor_group_iterator.ts index 267551907c5e8f..31d9166eb1e73b 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/monitor_group_iterator.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/monitor_group_iterator.ts @@ -6,7 +6,7 @@ import { QueryContext } from './query_context'; import { fetchChunk } from './fetch_chunk'; -import { CursorDirection } from '../../../../../../legacy/plugins/uptime/common/graphql/types'; +import { CursorDirection } from '../../../../../../legacy/plugins/uptime/common/runtime_types'; import { MonitorGroups } from './fetch_page'; import { CursorPagination } from './types'; diff --git a/x-pack/plugins/uptime/server/lib/requests/search/refine_potential_matches.ts b/x-pack/plugins/uptime/server/lib/requests/search/refine_potential_matches.ts index 218eb2f121a81d..43fc54fb258089 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/refine_potential_matches.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/refine_potential_matches.ts @@ -5,7 +5,7 @@ */ import { QueryContext } from './query_context'; -import { CursorDirection } from '../../../../../../legacy/plugins/uptime/common/graphql/types'; +import { CursorDirection } from '../../../../../../legacy/plugins/uptime/common/runtime_types'; import { MonitorGroups, MonitorLocCheckGroup } from './fetch_page'; /** diff --git a/x-pack/plugins/uptime/server/lib/requests/search/types.ts b/x-pack/plugins/uptime/server/lib/requests/search/types.ts index 42c98ace6e8f5e..2ec52d400b5972 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/types.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/types.ts @@ -7,7 +7,7 @@ import { CursorDirection, SortOrder, -} from '../../../../../../legacy/plugins/uptime/common/graphql/types'; +} from '../../../../../../legacy/plugins/uptime/common/runtime_types'; export interface CursorPagination { cursorKey?: any; diff --git a/x-pack/plugins/uptime/server/lib/requests/uptime_requests.ts b/x-pack/plugins/uptime/server/lib/requests/uptime_requests.ts index e9a7aa94dd3aa8..84154429b91888 100644 --- a/x-pack/plugins/uptime/server/lib/requests/uptime_requests.ts +++ b/x-pack/plugins/uptime/server/lib/requests/uptime_requests.ts @@ -9,6 +9,7 @@ import { HistogramResult, Ping, PingsResponse as PingResults, + GetCertsParams, GetPingsParams, } from '../../../../../legacy/plugins/uptime/common/runtime_types'; import { @@ -28,6 +29,7 @@ import { MonitorLocations, Snapshot, StatesIndexStatus, + Cert, } from '../../../../../legacy/plugins/uptime/common/runtime_types'; import { GetMonitorStatesResult } from './get_monitor_states'; import { GetSnapshotCountParams } from './get_snapshot_counts'; @@ -36,6 +38,7 @@ import { MonitorDurationResult } from '../../../../../legacy/plugins/uptime/comm type ESQ = UMElasticsearchQueryFn; export interface UptimeRequests { + getCerts: ESQ; getFilterBar: ESQ; getIndexPattern: ESQ<{}, {}>; getLatestMonitor: ESQ; diff --git a/x-pack/plugins/uptime/server/rest_api/certs.ts b/x-pack/plugins/uptime/server/rest_api/certs.ts new file mode 100644 index 00000000000000..31fb3f4ab96a78 --- /dev/null +++ b/x-pack/plugins/uptime/server/rest_api/certs.ts @@ -0,0 +1,54 @@ +/* + * 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 { schema } from '@kbn/config-schema'; +import { UMServerLibs } from '../lib/lib'; +import { UMRestApiRouteFactory } from '.'; +import { API_URLS } from '../../../../legacy/plugins/uptime/common/constants/rest_api'; + +const DEFAULT_INDEX = 0; +const DEFAULT_SIZE = 25; +const DEFAULT_FROM = 'now-1d'; +const DEFAULT_TO = 'now'; + +export const createGetCertsRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ + method: 'GET', + path: API_URLS.CERTS, + validate: { + query: schema.object({ + from: schema.maybe(schema.string()), + to: schema.maybe(schema.string()), + search: schema.maybe(schema.string()), + index: schema.maybe(schema.number()), + size: schema.maybe(schema.number()), + }), + }, + writeAccess: false, + options: { + tags: ['access:uptime-read'], + }, + handler: async ({ callES, dynamicSettings }, _context, request, response): Promise => { + const index = request.query?.index ?? DEFAULT_INDEX; + const size = request.query?.size ?? DEFAULT_SIZE; + const from = request.query?.from ?? DEFAULT_FROM; + const to = request.query?.to ?? DEFAULT_TO; + const { search } = request.query; + + return response.ok({ + body: { + certs: await libs.requests.getCerts({ + callES, + dynamicSettings, + index, + search, + size, + from, + to, + }), + }, + }); + }, +}); diff --git a/x-pack/plugins/uptime/server/rest_api/index.ts b/x-pack/plugins/uptime/server/rest_api/index.ts index c0412e588fa93a..a7a63342d11d46 100644 --- a/x-pack/plugins/uptime/server/rest_api/index.ts +++ b/x-pack/plugins/uptime/server/rest_api/index.ts @@ -4,6 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ +import { createGetCertsRoute } from './certs'; import { createGetOverviewFilters } from './overview_filters'; import { createGetPingHistogramRoute, createGetPingsRoute } from './pings'; import { createGetDynamicSettingsRoute, createPostDynamicSettingsRoute } from './dynamic_settings'; @@ -12,6 +13,7 @@ import { createGetSnapshotCount } from './snapshot'; import { UMRestApiRouteFactory } from './types'; import { createGetMonitorDetailsRoute, + createMonitorListRoute, createGetMonitorLocationsRoute, createGetStatusBarRoute, } from './monitors'; @@ -22,6 +24,7 @@ export { createRouteWithAuth } from './create_route_with_auth'; export { uptimeRouteWrapper } from './uptime_route_wrapper'; export const restApiRoutes: UMRestApiRouteFactory[] = [ + createGetCertsRoute, createGetOverviewFilters, createGetPingsRoute, createGetIndexPatternRoute, @@ -30,6 +33,7 @@ export const restApiRoutes: UMRestApiRouteFactory[] = [ createPostDynamicSettingsRoute, createGetMonitorDetailsRoute, createGetMonitorLocationsRoute, + createMonitorListRoute, createGetStatusBarRoute, createGetSnapshotCount, createLogPageViewRoute, diff --git a/x-pack/plugins/uptime/server/rest_api/monitors/index.ts b/x-pack/plugins/uptime/server/rest_api/monitors/index.ts index 51b39037049b58..256f885d550edc 100644 --- a/x-pack/plugins/uptime/server/rest_api/monitors/index.ts +++ b/x-pack/plugins/uptime/server/rest_api/monitors/index.ts @@ -5,5 +5,6 @@ */ export { createGetMonitorDetailsRoute } from './monitors_details'; +export { createMonitorListRoute } from './monitor_list'; export { createGetMonitorLocationsRoute } from './monitor_locations'; export { createGetStatusBarRoute } from './monitor_status'; diff --git a/x-pack/plugins/uptime/server/rest_api/monitors/monitor_list.ts b/x-pack/plugins/uptime/server/rest_api/monitors/monitor_list.ts new file mode 100644 index 00000000000000..5cb4e8a6241b74 --- /dev/null +++ b/x-pack/plugins/uptime/server/rest_api/monitors/monitor_list.ts @@ -0,0 +1,69 @@ +/* + * 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 { schema } from '@kbn/config-schema'; +import { UMRestApiRouteFactory } from '../types'; +import { CONTEXT_DEFAULTS } from '../../../../../legacy/plugins/uptime/common/constants'; +import { API_URLS } from '../../../../../legacy/plugins/uptime/common/constants/rest_api'; + +export const createMonitorListRoute: UMRestApiRouteFactory = libs => ({ + method: 'GET', + path: API_URLS.MONITOR_LIST, + validate: { + query: schema.object({ + dateRangeStart: schema.string(), + dateRangeEnd: schema.string(), + filters: schema.maybe(schema.string()), + pagination: schema.maybe(schema.string()), + statusFilter: schema.maybe(schema.string()), + pageSize: schema.number(), + }), + }, + options: { + tags: ['access:uptime-read'], + }, + handler: async ({ callES, dynamicSettings }, _context, request, response): Promise => { + const { + dateRangeStart, + dateRangeEnd, + filters, + pagination, + statusFilter, + pageSize, + } = request.query; + + const decodedPagination = pagination + ? JSON.parse(decodeURIComponent(pagination)) + : CONTEXT_DEFAULTS.CURSOR_PAGINATION; + const [indexStatus, { summaries, nextPagePagination, prevPagePagination }] = await Promise.all([ + libs.requests.getIndexStatus({ callES, dynamicSettings }), + libs.requests.getMonitorStates({ + callES, + dynamicSettings, + dateRangeStart, + dateRangeEnd, + pagination: decodedPagination, + pageSize, + filters, + // this is added to make typescript happy, + // this sort of reassignment used to be further downstream but I've moved it here + // because this code is going to be decomissioned soon + statusFilter: statusFilter || undefined, + }), + ]); + + const totalSummaryCount = indexStatus?.docCount ?? 0; + + return response.ok({ + body: { + summaries, + nextPagePagination, + prevPagePagination, + totalSummaryCount, + }, + }); + }, +}); diff --git a/x-pack/plugins/uptime/server/uptime_server.ts b/x-pack/plugins/uptime/server/uptime_server.ts index d4b38b8ad27a0f..cc6fe85b80cb24 100644 --- a/x-pack/plugins/uptime/server/uptime_server.ts +++ b/x-pack/plugins/uptime/server/uptime_server.ts @@ -4,8 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import { makeExecutableSchema } from 'graphql-tools'; -import { DEFAULT_GRAPHQL_PATH, resolvers, typeDefs } from './graphql'; import { UMServerLibs } from './lib/lib'; import { createRouteWithAuth, restApiRoutes, uptimeRouteWrapper } from './rest_api'; import { UptimeCoreSetup, UptimeCorePlugins } from './lib/adapters'; @@ -23,10 +21,4 @@ export const initUptimeServer = ( uptimeAlertTypeFactories.forEach(alertTypeFactory => plugins.alerting.registerType(alertTypeFactory(server, libs)) ); - - const graphQLSchema = makeExecutableSchema({ - resolvers: resolvers.map(createResolversFn => createResolversFn(libs)), - typeDefs, - }); - libs.framework.registerGraphQLEndpoint(DEFAULT_GRAPHQL_PATH, graphQLSchema); }; diff --git a/x-pack/test/api_integration/apis/management/cross_cluster_replication/follower_indices.helpers.js b/x-pack/test/api_integration/apis/management/cross_cluster_replication/follower_indices.helpers.js index dbcb6bf819749e..294db29f6dce44 100644 --- a/x-pack/test/api_integration/apis/management/cross_cluster_replication/follower_indices.helpers.js +++ b/x-pack/test/api_integration/apis/management/cross_cluster_replication/follower_indices.helpers.js @@ -13,7 +13,45 @@ export const registerHelpers = supertest => { const loadFollowerIndices = () => supertest.get(`${API_BASE_PATH}/follower_indices`); - const getFollowerIndex = name => supertest.get(`${API_BASE_PATH}/follower_indices/${name}`); + const getFollowerIndex = (name, waitUntilIsActive = false) => { + const maxRetries = 10; + const delayBetweenRetries = 500; + let retryCount = 0; + + const proceed = async () => { + const response = await supertest.get(`${API_BASE_PATH}/follower_indices/${name}`); + + if (waitUntilIsActive && response.body.status !== 'active') { + retryCount += 1; + + if (retryCount > maxRetries) { + throw new Error('Error waiting for follower index to be active.'); + } + + return new Promise(resolve => setTimeout(resolve, delayBetweenRetries)).then(proceed); + } + + return response; + }; + + return { + expect: status => + new Promise((resolve, reject) => + proceed() + .then(response => { + if (status !== response.status) { + reject(new Error(`Expected status ${status} but got ${response.status}`)); + } + return resolve(response); + }) + .catch(reject) + ), + then: (resolve, reject) => + proceed() + .then(resolve) + .catch(reject), + }; + }; const createFollowerIndex = (name = getRandomString(), payload = getFollowerIndexPayload()) => { followerIndicesCreated.push(name); @@ -24,6 +62,13 @@ export const registerHelpers = supertest => { .send({ ...payload, name }); }; + const updateFollowerIndex = (name, payload) => { + return supertest + .put(`${API_BASE_PATH}/follower_indices/${name}`) + .set('kbn-xsrf', 'xxx') + .send(payload); + }; + const unfollowLeaderIndex = followerIndex => { const followerIndices = Array.isArray(followerIndex) ? followerIndex : [followerIndex]; const followerIndicesToEncodedString = followerIndices @@ -51,6 +96,7 @@ export const registerHelpers = supertest => { loadFollowerIndices, getFollowerIndex, createFollowerIndex, + updateFollowerIndex, unfollowAll, }; }; diff --git a/x-pack/test/api_integration/apis/management/cross_cluster_replication/follower_indices.js b/x-pack/test/api_integration/apis/management/cross_cluster_replication/follower_indices.js index 5f9ebbd2a0a3fe..eabf474120f2b4 100644 --- a/x-pack/test/api_integration/apis/management/cross_cluster_replication/follower_indices.js +++ b/x-pack/test/api_integration/apis/management/cross_cluster_replication/follower_indices.js @@ -21,6 +21,7 @@ export default function({ getService }) { loadFollowerIndices, getFollowerIndex, createFollowerIndex, + updateFollowerIndex, unfollowAll, } = registerFollowerIndicesnHelpers(supertest); @@ -92,6 +93,31 @@ export default function({ getService }) { }); }); + describe('update()', () => { + it('should update a follower index advanced settings', async () => { + // Create a follower index + const leaderIndex = await createIndex(); + const followerIndex = getRandomString(); + const initialValue = 1234; + const payload = getFollowerIndexPayload(leaderIndex, undefined, { + maxReadRequestOperationCount: initialValue, + }); + await createFollowerIndex(followerIndex, payload); + + // Verify that its advanced settings are correctly set + const { body } = await getFollowerIndex(followerIndex, true); + expect(body.maxReadRequestOperationCount).to.be(initialValue); + + // Update the follower index + const updatedValue = 7777; + await updateFollowerIndex(followerIndex, { maxReadRequestOperationCount: updatedValue }); + + // Verify that the advanced settings are updated + const { body: updatedBody } = await getFollowerIndex(followerIndex, true); + expect(updatedBody.maxReadRequestOperationCount).to.be(updatedValue); + }); + }); + describe('Advanced settings', () => { it('hard-coded values should match Elasticsearch default values', async () => { /** diff --git a/x-pack/test/api_integration/apis/ml/bucket_span_estimator.ts b/x-pack/test/api_integration/apis/ml/bucket_span_estimator.ts index 3f56fb927d1318..bc0dc3019d7c99 100644 --- a/x-pack/test/api_integration/apis/ml/bucket_span_estimator.ts +++ b/x-pack/test/api_integration/apis/ml/bucket_span_estimator.ts @@ -28,7 +28,7 @@ export default ({ getService }: FtrProviderContext) => { aggTypes: ['avg'], duration: { start: 1560297859000, end: 1562975136000 }, fields: ['taxless_total_price'], - index: 'ecommerce', + index: 'ft_ecommerce', query: { bool: { must: [{ match_all: {} }] } }, timeField: 'order_date', }, @@ -44,7 +44,7 @@ export default ({ getService }: FtrProviderContext) => { aggTypes: ['avg', 'sum'], duration: { start: 1560297859000, end: 1562975136000 }, fields: ['products.base_price', 'products.base_unit_price'], - index: 'ecommerce', + index: 'ft_ecommerce', query: { bool: { must: [{ match_all: {} }] } }, timeField: 'order_date', }, @@ -60,7 +60,7 @@ export default ({ getService }: FtrProviderContext) => { aggTypes: ['avg'], duration: { start: 1560297859000, end: 1562975136000 }, fields: ['taxless_total_price'], - index: 'ecommerce', + index: 'ft_ecommerce', query: { bool: { must: [{ match_all: {} }] } }, splitField: 'customer_first_name.keyword', timeField: 'order_date', @@ -78,7 +78,7 @@ export default ({ getService }: FtrProviderContext) => { duration: { start: 1560297859000, end: 1562975136000 }, fields: ['taxless_total_price'], filters: [], - index: 'ecommerce', + index: 'ft_ecommerce', query: { bool: { must: [{ match_all: {} }] } }, timeField: 'order_date', }, @@ -91,11 +91,8 @@ export default ({ getService }: FtrProviderContext) => { describe('bucket span estimator', function() { before(async () => { - await esArchiver.load('ml/ecommerce'); - }); - - after(async () => { - await esArchiver.unload('ml/ecommerce'); + await esArchiver.loadIfNeeded('ml/ecommerce'); + await ml.testResources.setKibanaTimeZoneToUTC(); }); describe('with default settings', function() { diff --git a/x-pack/test/api_integration/apis/ml/calculate_model_memory_limit.ts b/x-pack/test/api_integration/apis/ml/calculate_model_memory_limit.ts index 975a10c2aed2a1..59e3dfcca00f9c 100644 --- a/x-pack/test/api_integration/apis/ml/calculate_model_memory_limit.ts +++ b/x-pack/test/api_integration/apis/ml/calculate_model_memory_limit.ts @@ -22,7 +22,7 @@ export default ({ getService }: FtrProviderContext) => { testTitleSuffix: 'when no partition field is provided with regular function', user: USER.ML_POWERUSER, requestBody: { - indexPattern: 'ecommerce', + indexPattern: 'ft_ecommerce', analysisConfig: { bucket_span: '15m', detectors: [ @@ -51,7 +51,7 @@ export default ({ getService }: FtrProviderContext) => { testTitleSuffix: 'with 1 metric and 1 influencer same as split field', user: USER.ML_POWERUSER, requestBody: { - indexPattern: 'ecommerce', + indexPattern: 'ft_ecommerce', analysisConfig: { bucket_span: '15m', detectors: [ @@ -77,7 +77,7 @@ export default ({ getService }: FtrProviderContext) => { testTitleSuffix: 'with 3 influencers, split by city', user: USER.ML_POWERUSER, requestBody: { - indexPattern: 'ecommerce', + indexPattern: 'ft_ecommerce', analysisConfig: { bucket_span: '15m', detectors: [ @@ -104,7 +104,7 @@ export default ({ getService }: FtrProviderContext) => { '2 detectors split by city and manufacturer, 4 influencers, filtering by country code', user: USER.ML_POWERUSER, requestBody: { - indexPattern: 'ecommerce', + indexPattern: 'ft_ecommerce', analysisConfig: { bucket_span: '2d', detectors: [ @@ -148,11 +148,8 @@ export default ({ getService }: FtrProviderContext) => { describe('calculate model memory limit', function() { before(async () => { - await esArchiver.load('ml/ecommerce'); - }); - - after(async () => { - await esArchiver.unload('ml/ecommerce'); + await esArchiver.loadIfNeeded('ml/ecommerce'); + await ml.testResources.setKibanaTimeZoneToUTC(); }); for (const testData of testDataList) { diff --git a/x-pack/test/api_integration/apis/ml/categorization_field_examples.ts b/x-pack/test/api_integration/apis/ml/categorization_field_examples.ts index b8ee2e7f6562cb..df0153f9659421 100644 --- a/x-pack/test/api_integration/apis/ml/categorization_field_examples.ts +++ b/x-pack/test/api_integration/apis/ml/categorization_field_examples.ts @@ -66,7 +66,7 @@ const analyzer = { ], }; const defaultRequestBody = { - indexPatternTitle: 'categorization_functional_test', + indexPatternTitle: 'ft_categorization', query: { bool: { must: [{ match_all: {} }] } }, size: 5, timeField: '@timestamp', @@ -289,11 +289,8 @@ export default ({ getService }: FtrProviderContext) => { describe('Categorization example endpoint - ', function() { before(async () => { - await esArchiver.load('ml/categorization'); - }); - - after(async () => { - await esArchiver.unload('ml/categorization'); + await esArchiver.loadIfNeeded('ml/categorization'); + await ml.testResources.setKibanaTimeZoneToUTC(); }); for (const testData of testDataList) { diff --git a/x-pack/test/api_integration/apis/ml/get_module.ts b/x-pack/test/api_integration/apis/ml/get_module.ts index 6dcd9594fc9aac..a50d3c0abe4300 100644 --- a/x-pack/test/api_integration/apis/ml/get_module.ts +++ b/x-pack/test/api_integration/apis/ml/get_module.ts @@ -50,6 +50,10 @@ export default ({ getService }: FtrProviderContext) => { } describe('get_module', function() { + before(async () => { + await ml.testResources.setKibanaTimeZoneToUTC(); + }); + it('lists all modules', async () => { const rspBody = await executeGetModuleRequest('', USER.ML_POWERUSER, 200); expect(rspBody).to.be.an(Array); diff --git a/x-pack/test/api_integration/apis/ml/index.ts b/x-pack/test/api_integration/apis/ml/index.ts index 4e21faa610bfe2..f012883c46ca3a 100644 --- a/x-pack/test/api_integration/apis/ml/index.ts +++ b/x-pack/test/api_integration/apis/ml/index.ts @@ -7,6 +7,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function({ getService, loadTestFile }: FtrProviderContext) { + const esArchiver = getService('esArchiver'); const ml = getService('ml'); describe('Machine Learning', function() { @@ -20,6 +21,14 @@ export default function({ getService, loadTestFile }: FtrProviderContext) { after(async () => { await ml.securityCommon.cleanMlUsers(); await ml.securityCommon.cleanMlRoles(); + + await ml.testResources.deleteIndexPattern('kibana_sample_data_logs'); + + await esArchiver.unload('ml/ecommerce'); + await esArchiver.unload('ml/categorization'); + await esArchiver.unload('ml/sample_logs'); + + await ml.testResources.resetKibanaTimeZone(); }); loadTestFile(require.resolve('./bucket_span_estimator')); diff --git a/x-pack/test/api_integration/apis/ml/recognize_module.ts b/x-pack/test/api_integration/apis/ml/recognize_module.ts index 2110bded7394cc..8e360579c1459f 100644 --- a/x-pack/test/api_integration/apis/ml/recognize_module.ts +++ b/x-pack/test/api_integration/apis/ml/recognize_module.ts @@ -32,7 +32,6 @@ export default ({ getService }: FtrProviderContext) => { }, { testTitleSuffix: 'for non existent index pattern', - sourceDataArchive: 'empty_kibana', indexPattern: 'non-existent-index-pattern', user: USER.ML_POWERUSER, expected: { @@ -53,14 +52,16 @@ export default ({ getService }: FtrProviderContext) => { } describe('module recognizer', function() { + before(async () => { + await ml.testResources.setKibanaTimeZoneToUTC(); + }); + for (const testData of testDataList) { describe('lists matching modules', function() { before(async () => { - await esArchiver.load(testData.sourceDataArchive); - }); - - after(async () => { - await esArchiver.unload(testData.sourceDataArchive); + if (testData.hasOwnProperty('sourceDataArchive')) { + await esArchiver.loadIfNeeded(testData.sourceDataArchive!); + } }); it(testData.testTitleSuffix, async () => { diff --git a/x-pack/test/api_integration/apis/ml/setup_module.ts b/x-pack/test/api_integration/apis/ml/setup_module.ts index 71f3910cd4e937..e603782b25717a 100644 --- a/x-pack/test/api_integration/apis/ml/setup_module.ts +++ b/x-pack/test/api_integration/apis/ml/setup_module.ts @@ -25,6 +25,7 @@ export default ({ getService }: FtrProviderContext) => { { testTitleSuffix: 'for sample logs dataset with prefix and startDatafeed false', sourceDataArchive: 'ml/sample_logs', + indexPattern: { name: 'kibana_sample_data_logs', timeField: '@timestamp' }, module: 'sample_data_weblogs', user: USER.ML_POWERUSER, requestBody: { @@ -58,7 +59,6 @@ export default ({ getService }: FtrProviderContext) => { const testDataListNegative = [ { testTitleSuffix: 'for non existent index pattern', - sourceDataArchive: 'empty_kibana', module: 'sample_data_weblogs', user: USER.ML_POWERUSER, requestBody: { @@ -75,6 +75,7 @@ export default ({ getService }: FtrProviderContext) => { { testTitleSuffix: 'for unauthorized user', sourceDataArchive: 'ml/sample_logs', + indexPattern: { name: 'kibana_sample_data_logs', timeField: '@timestamp' }, module: 'sample_data_weblogs', user: USER.ML_UNAUTHORIZED, requestBody: { @@ -118,14 +119,21 @@ export default ({ getService }: FtrProviderContext) => { } describe('module setup', function() { + before(async () => { + await ml.testResources.setKibanaTimeZoneToUTC(); + }); + for (const testData of testDataListPositive) { describe('sets up module data', function() { before(async () => { - await esArchiver.load(testData.sourceDataArchive); + await esArchiver.loadIfNeeded(testData.sourceDataArchive); + await ml.testResources.createIndexPatternIfNeeded( + testData.indexPattern.name, + testData.indexPattern.timeField + ); }); after(async () => { - await esArchiver.unload(testData.sourceDataArchive); await ml.api.cleanMlIndices(); }); @@ -199,11 +207,18 @@ export default ({ getService }: FtrProviderContext) => { for (const testData of testDataListNegative) { describe('rejects request', function() { before(async () => { - await esArchiver.load(testData.sourceDataArchive); + if (testData.hasOwnProperty('sourceDataArchive')) { + await esArchiver.loadIfNeeded(testData.sourceDataArchive!); + } + if (testData.hasOwnProperty('indexPattern')) { + await ml.testResources.createIndexPatternIfNeeded( + testData.indexPattern!.name as string, + testData.indexPattern!.timeField as string + ); + } }); after(async () => { - await esArchiver.unload(testData.sourceDataArchive); await ml.api.cleanMlIndices(); }); diff --git a/x-pack/test/api_integration/apis/siem/overview_host.ts b/x-pack/test/api_integration/apis/siem/overview_host.ts index d32eeaec884fa9..7e5cbd7673af7f 100644 --- a/x-pack/test/api_integration/apis/siem/overview_host.ts +++ b/x-pack/test/api_integration/apis/siem/overview_host.ts @@ -5,10 +5,11 @@ */ import expect from '@kbn/expect'; + +import { DEFAULT_INDEX_PATTERN } from '../../../../plugins/siem/common/constants'; import { overviewHostQuery } from '../../../../legacy/plugins/siem/public/containers/overview/overview_host/index.gql_query'; import { GetOverviewHostQuery } from '../../../../legacy/plugins/siem/public/graphql/types'; import { FtrProviderContext } from '../../ftr_provider_context'; -import { defaultIndexPattern } from '../../../../legacy/plugins/siem/default_index_pattern'; export default function({ getService }: FtrProviderContext) { const esArchiver = getService('esArchiver'); @@ -51,7 +52,7 @@ export default function({ getService }: FtrProviderContext) { to: TO, from: FROM, }, - defaultIndex: defaultIndexPattern, + defaultIndex: DEFAULT_INDEX_PATTERN, inspect: false, }, }) diff --git a/x-pack/test/api_integration/apis/uptime/feature_controls.ts b/x-pack/test/api_integration/apis/uptime/feature_controls.ts index 8b82735fc38b05..6d125807e169d1 100644 --- a/x-pack/test/api_integration/apis/uptime/feature_controls.ts +++ b/x-pack/test/api_integration/apis/uptime/feature_controls.ts @@ -26,17 +26,6 @@ export default function featureControlsTests({ getService }: FtrProviderContext) expect(result.response).to.have.property('statusCode', 200); }; - const executeRESTAPIQuery = async (username: string, password: string, spaceId?: string) => { - const basePath = spaceId ? `/s/${spaceId}` : ''; - - return await supertest - .get(basePath + API_URLS.INDEX_STATUS) - .auth(username, password) - .set('kbn-xsrf', 'foo') - .then((response: any) => ({ error: undefined, response })) - .catch((error: any) => ({ error, response: undefined })); - }; - const executePingsRequest = async (username: string, password: string, spaceId?: string) => { const basePath = spaceId ? `/s/${spaceId}` : ''; @@ -72,9 +61,6 @@ export default function featureControlsTests({ getService }: FtrProviderContext) full_name: 'a kibana user', }); - const graphQLResult = await executeRESTAPIQuery(username, password); - expect404(graphQLResult); - const pingsResult = await executePingsRequest(username, password); expect404(pingsResult); } finally { @@ -111,9 +97,6 @@ export default function featureControlsTests({ getService }: FtrProviderContext) full_name: 'a kibana user', }); - const graphQLResult = await executeRESTAPIQuery(username, password); - expectResponse(graphQLResult); - const pingsResult = await executePingsRequest(username, password); expectResponse(pingsResult); } finally { @@ -153,9 +136,6 @@ export default function featureControlsTests({ getService }: FtrProviderContext) full_name: 'a kibana user', }); - const graphQLResult = await executeRESTAPIQuery(username, password); - expect404(graphQLResult); - const pingsResult = await executePingsRequest(username, password); expect404(pingsResult); } finally { @@ -222,17 +202,11 @@ export default function featureControlsTests({ getService }: FtrProviderContext) }); it('user_1 can access APIs in space_1', async () => { - const graphQLResult = await executeRESTAPIQuery(username, password, space1Id); - expectResponse(graphQLResult); - const pingsResult = await executePingsRequest(username, password, space1Id); expectResponse(pingsResult); }); it(`user_1 can't access APIs in space_2`, async () => { - const graphQLResult = await executeRESTAPIQuery(username, password); - expect404(graphQLResult); - const pingsResult = await executePingsRequest(username, password); expect404(pingsResult); }); 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 deleted file mode 100644 index a748225dda7cff..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": null, - "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0009-up\"}}", - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0000-intermittent", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x5,500x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0001-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0002-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0003-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0004-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0005-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0006-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0007-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0008-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0009-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - } - ] - } -} \ 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 deleted file mode 100644 index 44644be5a0724a..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_id_filtered.json +++ /dev/null @@ -1,169 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": null, - "nextPagePagination": null, - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0002-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - } - ] - } -} \ 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 deleted file mode 100644 index a748225dda7cff..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_1.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": null, - "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0009-up\"}}", - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0000-intermittent", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x5,500x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0001-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0002-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0003-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0004-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0005-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0006-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0007-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0008-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0009-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - } - ] - } -} \ 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 deleted file mode 100644 index fbd0776fade62e..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_10.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0090-intermittent\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", - "nextPagePagination": null, - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0090-intermittent", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234374" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x5,500x1", - "domain": "localhost" - }, - "timestamp": 1568173234374 - } - }, - { - "monitor_id": "0091-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234374" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234374 - } - }, - { - "monitor_id": "0092-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234375" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234375 - } - }, - { - "monitor_id": "0093-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234375" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234375 - } - }, - { - "monitor_id": "0094-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234375" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234375 - } - }, - { - "monitor_id": "0095-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234375" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234375 - } - }, - { - "monitor_id": "0096-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234376" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234376 - } - }, - { - "monitor_id": "0097-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234405" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234405 - } - }, - { - "monitor_id": "0098-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234406" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234406 - } - }, - { - "monitor_id": "0099-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234406" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234406 - } - } - ] - } -} \ 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 deleted file mode 100644 index e630e227f473b9..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_10_previous.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0080-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", - "nextPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0089-up\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"AFTER\"}", - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0080-down", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172694000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172724000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172754000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172784000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172814000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172844000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172874000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172904000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172934000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172964000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172994000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173024000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173054000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173084000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173114000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173144000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173174000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173204000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173234000, - "up": 0, - "down": 1 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "down" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "down", - "type": null - }, - "summary": { - "up": 0, - "down": 1, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=400x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0081-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0082-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0083-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0084-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0085-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0086-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0087-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0088-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0089-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - } - ] - } -} \ 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 deleted file mode 100644 index 26b4b1a195567b..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_2.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0010-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", - "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0019-up\"}}", - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0010-down", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172694000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172724000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172754000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172784000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172814000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172844000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172874000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172904000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172934000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172964000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172994000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173024000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173054000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173084000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173114000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173144000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173174000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173204000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173234000, - "up": 0, - "down": 1 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "down" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "down", - "type": null - }, - "summary": { - "up": 0, - "down": 1, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=400x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0011-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0012-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0013-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0014-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0015-intermittent", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x5,500x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0016-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0017-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0018-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0019-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - } - ] - } -} \ 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 deleted file mode 100644 index 0b93e66f50246b..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_2_previous.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": null, - "nextPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0009-up\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"AFTER\"}", - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0000-intermittent", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x5,500x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0001-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0002-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0003-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0004-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0005-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0006-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0007-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0008-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0009-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - } - ] - } -} \ 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 deleted file mode 100644 index 7b47742f8859a6..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_3.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0020-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", - "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0029-up\"}}", - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0020-down", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172694000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172724000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172754000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172784000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172814000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172844000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172874000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172904000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172934000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172964000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172994000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173024000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173054000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173084000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173114000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173144000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173174000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173204000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173234000, - "up": 0, - "down": 1 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "down" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "down", - "type": null - }, - "summary": { - "up": 0, - "down": 1, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=400x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0021-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0022-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0023-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0024-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0025-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0026-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0027-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0028-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0029-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - } - ] - } -} \ 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 deleted file mode 100644 index 0d5a76059d004a..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_3_previous.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0010-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", - "nextPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0019-up\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"AFTER\"}", - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0010-down", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172694000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172724000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172754000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172784000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172814000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172844000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172874000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172904000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172934000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172964000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172994000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173024000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173054000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173084000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173114000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173144000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173174000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173204000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173234000, - "up": 0, - "down": 1 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "down" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "down", - "type": null - }, - "summary": { - "up": 0, - "down": 1, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=400x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0011-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0012-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0013-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0014-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0015-intermittent", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x5,500x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0016-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0017-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0018-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0019-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - } - ] - } -} \ 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 deleted file mode 100644 index 4caff800ac96e2..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_4.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0030-intermittent\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", - "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0039-up\"}}", - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0030-intermittent", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173084000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 0, - "down": 1 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "down" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "down", - "type": null - }, - "summary": { - "up": 0, - "down": 1, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x5,500x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0031-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234374" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234374 - } - }, - { - "monitor_id": "0032-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234375" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234375 - } - }, - { - "monitor_id": "0033-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0034-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0035-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0036-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0037-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0038-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0039-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - } - ] - } -} \ 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 deleted file mode 100644 index 02bd149b502470..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_4_previous.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0020-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", - "nextPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0029-up\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"AFTER\"}", - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0020-down", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172694000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172724000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172754000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172784000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172814000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172844000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172874000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172904000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172934000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172964000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172994000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173024000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173054000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173084000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173114000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173144000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173174000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173204000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173234000, - "up": 0, - "down": 1 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "down" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "down", - "type": null - }, - "summary": { - "up": 0, - "down": 1, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=400x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0021-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0022-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0023-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0024-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0025-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0026-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0027-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0028-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0029-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - } - ] - } -} \ 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 deleted file mode 100644 index 11e880f1ec3291..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_5.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0040-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", - "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0049-up\"}}", - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0040-down", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172694000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172724000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172754000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172784000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172814000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172844000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172874000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172904000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172934000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172964000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172994000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173024000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173054000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173084000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173114000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173144000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173174000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173204000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173234000, - "up": 0, - "down": 1 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "down" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "down", - "type": null - }, - "summary": { - "up": 0, - "down": 1, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=400x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0041-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0042-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0043-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0044-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0045-intermittent", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172814000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x5,500x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0046-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234374" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234374 - } - }, - { - "monitor_id": "0047-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234390" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234390 - } - }, - { - "monitor_id": "0048-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234386" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234386 - } - }, - { - "monitor_id": "0049-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234405" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234405 - } - } - ] - } -} \ 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 deleted file mode 100644 index 26cfa7c7162e83..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_5_previous.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0030-intermittent\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", - "nextPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0039-up\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"AFTER\"}", - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0030-intermittent", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173084000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 0, - "down": 1 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "down" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "down", - "type": null - }, - "summary": { - "up": 0, - "down": 1, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x5,500x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0031-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234374" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234374 - } - }, - { - "monitor_id": "0032-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234375" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234375 - } - }, - { - "monitor_id": "0033-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0034-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0035-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0036-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0037-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0038-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0039-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - } - ] - } -} \ 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 deleted file mode 100644 index 8f4b5d4c52e719..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_6.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0050-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", - "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0059-up\"}}", - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0050-down", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172694000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172724000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172754000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172784000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172814000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172844000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172874000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172904000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172934000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172964000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172994000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173024000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173054000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173084000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173114000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173144000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173174000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173204000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173234000, - "up": 0, - "down": 1 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "down" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234386" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "down", - "type": null - }, - "summary": { - "up": 0, - "down": 1, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=400x1", - "domain": "localhost" - }, - "timestamp": 1568173234386 - } - }, - { - "monitor_id": "0051-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0052-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0053-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0054-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0055-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0056-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0057-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0058-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0059-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - } - ] - } -} \ 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 deleted file mode 100644 index 50f8f61b13d68c..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_6_previous.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0040-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", - "nextPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0049-up\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"AFTER\"}", - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0040-down", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172694000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172724000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172754000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172784000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172814000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172844000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172874000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172904000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172934000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172964000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172994000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173024000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173054000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173084000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173114000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173144000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173174000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173204000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173234000, - "up": 0, - "down": 1 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "down" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "down", - "type": null - }, - "summary": { - "up": 0, - "down": 1, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=400x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0041-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0042-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0043-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0044-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0045-intermittent", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172814000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x5,500x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0046-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234374" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234374 - } - }, - { - "monitor_id": "0047-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234390" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234390 - } - }, - { - "monitor_id": "0048-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234386" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234386 - } - }, - { - "monitor_id": "0049-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234405" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234405 - } - } - ] - } -} \ 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 deleted file mode 100644 index 18ab2c6fdf3368..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_7.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0060-intermittent\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", - "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0069-up\"}}", - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0060-intermittent", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172874000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x5,500x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0061-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0062-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0063-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0064-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0065-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0066-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234374" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234374 - } - }, - { - "monitor_id": "0067-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234374" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234374 - } - }, - { - "monitor_id": "0068-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234374" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234374 - } - }, - { - "monitor_id": "0069-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234375" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234375 - } - } - ] - } -} \ 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 deleted file mode 100644 index 825d6365e3a9d7..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_7_previous.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0050-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", - "nextPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0059-up\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"AFTER\"}", - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0050-down", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172694000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172724000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172754000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172784000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172814000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172844000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172874000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172904000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172934000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172964000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172994000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173024000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173054000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173084000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173114000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173144000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173174000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173204000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173234000, - "up": 0, - "down": 1 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "down" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234386" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "down", - "type": null - }, - "summary": { - "up": 0, - "down": 1, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=400x1", - "domain": "localhost" - }, - "timestamp": 1568173234386 - } - }, - { - "monitor_id": "0051-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0052-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0053-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0054-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0055-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0056-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0057-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0058-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0059-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - } - ] - } -} \ 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 deleted file mode 100644 index abb9bcdd804ed0..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_8.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0070-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", - "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0079-up\"}}", - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0070-down", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172694000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172724000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172754000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172784000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172814000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172844000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172874000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172904000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172934000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172964000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172994000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173024000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173054000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173084000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173114000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173144000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173174000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173204000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173234000, - "up": 0, - "down": 1 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "down" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234375" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "down", - "type": null - }, - "summary": { - "up": 0, - "down": 1, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=400x1", - "domain": "localhost" - }, - "timestamp": 1568173234375 - } - }, - { - "monitor_id": "0071-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234375" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234375 - } - }, - { - "monitor_id": "0072-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234376" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234376 - } - }, - { - "monitor_id": "0073-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234406" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234406 - } - }, - { - "monitor_id": "0074-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234410" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234410 - } - }, - { - "monitor_id": "0075-intermittent", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234406" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x5,500x1", - "domain": "localhost" - }, - "timestamp": 1568173234406 - } - }, - { - "monitor_id": "0076-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234387" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234387 - } - }, - { - "monitor_id": "0077-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234389" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234389 - } - }, - { - "monitor_id": "0078-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0079-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - } - ] - } -} \ 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 deleted file mode 100644 index 46a5f195e6a828..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_8_previous.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0060-intermittent\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", - "nextPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0069-up\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"AFTER\"}", - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0060-intermittent", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172874000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x5,500x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0061-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0062-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0063-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0064-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0065-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0066-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234374" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234374 - } - }, - { - "monitor_id": "0067-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234374" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234374 - } - }, - { - "monitor_id": "0068-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234374" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234374 - } - }, - { - "monitor_id": "0069-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234375" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234375 - } - } - ] - } -} \ 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 deleted file mode 100644 index 035baf0ab5b5e0..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_9.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0080-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", - "nextPagePagination": "{\"cursorDirection\":\"AFTER\",\"sortOrder\":\"ASC\",\"cursorKey\":{\"monitor_id\":\"0089-up\"}}", - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0080-down", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172694000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172724000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172754000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172784000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172814000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172844000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172874000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172904000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172934000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172964000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172994000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173024000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173054000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173084000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173114000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173144000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173174000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173204000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173234000, - "up": 0, - "down": 1 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "down" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "down", - "type": null - }, - "summary": { - "up": 0, - "down": 1, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=400x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0081-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0082-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234372" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234372 - } - }, - { - "monitor_id": "0083-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0084-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0085-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0086-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0087-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0088-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - }, - { - "monitor_id": "0089-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234373" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234373 - } - } - ] - } -} \ 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 deleted file mode 100644 index a6d274056eec65..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_states_page_9_previous.json +++ /dev/null @@ -1,1609 +0,0 @@ -{ - "monitorStates": { - "prevPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0070-down\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"BEFORE\"}", - "nextPagePagination": "{\"cursorKey\":{\"monitor_id\":\"0079-up\"},\"sortOrder\":\"ASC\",\"cursorDirection\":\"AFTER\"}", - "totalSummaryCount": 2000, - "summaries": [ - { - "monitor_id": "0070-down", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172694000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172724000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172754000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172784000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172814000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172844000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172874000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172904000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172934000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172964000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172994000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173024000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173054000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173084000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173114000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173144000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173174000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173204000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173234000, - "up": 0, - "down": 1 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "down" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234375" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "down", - "type": null - }, - "summary": { - "up": 0, - "down": 1, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=400x1", - "domain": "localhost" - }, - "timestamp": 1568173234375 - } - }, - { - "monitor_id": "0071-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234375" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234375 - } - }, - { - "monitor_id": "0072-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234376" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234376 - } - }, - { - "monitor_id": "0073-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234406" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234406 - } - }, - { - "monitor_id": "0074-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234410" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234410 - } - }, - { - "monitor_id": "0075-intermittent", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 0, - "down": 1 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234406" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x5,500x1", - "domain": "localhost" - }, - "timestamp": 1568173234406 - } - }, - { - "monitor_id": "0076-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234387" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234387 - } - }, - { - "monitor_id": "0077-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234389" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234389 - } - }, - { - "monitor_id": "0078-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - }, - { - "monitor_id": "0079-up", - "histogram": { - "count": 20, - "points": [ - { - "timestamp": 1568172664000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172694000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172724000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172754000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172784000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172814000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172844000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172874000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172904000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172934000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172964000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568172994000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173024000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173054000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173084000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173114000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173144000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173174000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173204000, - "up": 1, - "down": 0 - }, - { - "timestamp": 1568173234000, - "up": 1, - "down": 0 - } - ] - }, - "state": { - "agent": null, - "checks": [ - { - "agent": { - "id": "04e1d082-65bc-4929-8d65-d0768a2621c4" - }, - "container": null, - "kubernetes": null, - "monitor": { - "ip": "127.0.0.1", - "name": "", - "status": "up" - }, - "observer": { - "geo": { - "name": "mpls", - "location": { - "lat": 37.926867976784706, - "lon": -78.02490200847387 - } - } - }, - "timestamp": "1568173234371" - } - ], - "geo": null, - "observer": { - "geo": { - "name": [ - "mpls" - ], - "location": null - } - }, - "monitor": { - "id": null, - "name": null, - "status": "up", - "type": null - }, - "summary": { - "up": 1, - "down": 0, - "geo": null - }, - "url": { - "full": "http://localhost:5678/pattern?r=200x1", - "domain": "localhost" - }, - "timestamp": 1568173234371 - } - } - ] - } -} \ No newline at end of file diff --git a/x-pack/test/api_integration/apis/uptime/graphql/index.ts b/x-pack/test/api_integration/apis/uptime/graphql/index.ts deleted file mode 100644 index 862cce47f257a5..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/index.ts +++ /dev/null @@ -1,17 +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 { FtrProviderContext } from '../../../ftr_provider_context'; - -export default function({ loadTestFile }: FtrProviderContext) { - describe('graphql', () => { - // each of these test files imports a GQL query from - // the uptime app and runs it against the live HTTP server, - // verifying the pre-loaded documents are returned in a way that - // matches the snapshots contained in './fixtures' - loadTestFile(require.resolve('./monitor_states')); - }); -} diff --git a/x-pack/test/api_integration/apis/uptime/graphql/monitor_states.ts b/x-pack/test/api_integration/apis/uptime/graphql/monitor_states.ts deleted file mode 100644 index 216560583249c5..00000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/monitor_states.ts +++ /dev/null @@ -1,245 +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 { expectFixtureEql } from './helpers/expect_fixture_eql'; -import { FtrProviderContext } from '../../../ftr_provider_context'; -import { makeChecksWithStatus } from './helpers/make_checks'; -import { monitorStatesQueryString } from '../../../../../legacy/plugins/uptime/public/queries/monitor_states_query'; -import { MonitorSummary } from '../../../../../legacy/plugins/uptime/common/graphql/types'; - -export default function({ getService }: FtrProviderContext) { - const supertest = getService('supertest'); - let dateRangeStart: string; - let dateRangeEnd: string; - - const getMonitorStates = async (variables: { [key: string]: any } = {}) => { - const query = { - operationName: 'MonitorStates', - query: monitorStatesQueryString, - variables: { - dateRangeStart, - dateRangeEnd, - pageSize: 10, - ...variables, - }, - }; - - const { - body: { data }, - } = await supertest - .post('/api/uptime/graphql') - .set('kbn-xsrf', 'foo') - .send({ ...query }); - - return data; - }; - - describe('monitor states', async () => { - describe('with real world data', () => { - before('load heartbeat data', () => getService('esArchiver').load('uptime/full_heartbeat')); - after('unload heartbeat index', () => - getService('esArchiver').unload('uptime/full_heartbeat') - ); - - before('set start/end', () => { - dateRangeStart = '2019-09-11T03:31:04.380Z'; - dateRangeEnd = '2019-09-11T03:40:34.410Z'; - }); - - it('will fetch monitor state data for the given filters and range', async () => { - const data: any = await getMonitorStates({ - statusFilter: 'up', - filters: - '{"bool":{"must":[{"match":{"monitor.id":{"query":"0002-up","operator":"and"}}}]}}', - }); - // await new Promise(r => setTimeout(r, 90000)); - expectFixtureEql(data, 'monitor_states_id_filtered'); - }); - - it('will fetch monitor state data for the given date range', async () => { - expectFixtureEql(await getMonitorStates(), 'monitor_states'); - }); - - it('can navigate forward and backward using pagination', async () => { - const expectedResultsCount = 100; - const expectedPageCount = expectedResultsCount / 10; - - let pagination: string | null = null; - for (let page = 1; page <= expectedPageCount; page++) { - const data: any = await getMonitorStates({ pagination }); - pagination = data.monitorStates.nextPagePagination; - expectFixtureEql(data, `monitor_states_page_${page}`); - - // Test to see if the previous page pagination works on every page (other than the first) - if (page > 1) { - const prevData = await getMonitorStates({ - pagination: data.monitorStates.prevPagePagination, - }); - expectFixtureEql(prevData, `monitor_states_page_${page}_previous`); - } - } - }); - }); - - describe('monitor state scoping', async () => { - const numIps = 4; // Must be > 2 for IP uniqueness checks - - before('load heartbeat data', () => getService('esArchiver').load('uptime/blank')); - after('unload heartbeat index', () => getService('esArchiver').unload('uptime/blank')); - - describe('query document scoping with mismatched check statuses', async () => { - let checks: any[] = []; - let nonSummaryIp: string | null = null; - const testMonitorId = 'scope-test-id'; - const makeApiParams = (monitorId: string, filterClauses: any[] = []): any => { - return { - filters: JSON.stringify({ - bool: { - filter: [{ match: { 'monitor.id': monitorId } }, ...filterClauses], - }, - }), - }; - }; - - before(async () => { - const es = getService('legacyEs'); - dateRangeStart = new Date().toISOString(); - checks = await makeChecksWithStatus(es, testMonitorId, 1, numIps, 1, {}, 'up', d => { - // turn an all up status into having at least one down - if (d.summary) { - d.monitor.status = 'down'; - d.summary.up--; - d.summary.down++; - } - return d; - }); - - dateRangeEnd = new Date().toISOString(); - nonSummaryIp = checks[0][0].monitor.ip; - }); - - it('should return all IPs', async () => { - const res = await getMonitorStates(makeApiParams(testMonitorId)); - - const uniqueIps = new Set(); - res.monitorStates.summaries[0].state.checks.forEach((c: any) => - uniqueIps.add(c.monitor.ip) - ); - - expect(uniqueIps.size).to.eql(4); - }); - - it('should match non summary documents without a status filter', async () => { - const params = makeApiParams(testMonitorId, [{ match: { 'monitor.ip': nonSummaryIp } }]); - - const nonSummaryRes = await getMonitorStates(params); - expect(nonSummaryRes.monitorStates.summaries.length).to.eql(1); - }); - - it('should not match non summary documents if the check status does not match the document status', async () => { - const params = makeApiParams(testMonitorId, [{ match: { 'monitor.ip': nonSummaryIp } }]); - params.statusFilter = 'down'; - - const nonSummaryRes = await getMonitorStates(params); - expect(nonSummaryRes.monitorStates.summaries.length).to.eql(0); - }); - - it('should not non match non summary documents if the check status does not match', async () => { - const params = makeApiParams(testMonitorId, [{ match: { 'monitor.ip': nonSummaryIp } }]); - params.statusFilter = 'up'; - - const nonSummaryRes = await getMonitorStates(params); - expect(nonSummaryRes.monitorStates.summaries.length).to.eql(0); - }); - - describe('matching outside of the date range', async () => { - before('set date range to future', () => { - const futureDate = new Date(); - - // Set dateRangeStart to one day from now - futureDate.setDate(futureDate.getDate() + 1); - dateRangeStart = futureDate.toISOString(); - - // Set dateRangeStart to two days from now - futureDate.setDate(futureDate.getDate() + 1); - dateRangeEnd = futureDate.toISOString(); - }); - - it('should not match any documents', async () => { - const params = makeApiParams(testMonitorId); - params.statusFilter = 'up'; - - const nonSummaryRes = await getMonitorStates(params); - expect(nonSummaryRes.monitorStates.summaries.length).to.eql(0); - }); - }); - }); - }); - - describe(' test status filter', async () => { - const upMonitorId = 'up-test-id'; - const downMonitorId = 'down-test-id'; - const mixMonitorId = 'mix-test-id'; - before('generate three monitors with up, down, mix state', async () => { - await getService('esArchiver').load('uptime/blank'); - - const es = getService('legacyEs'); - - const observer = { - geo: { - name: 'US-East', - location: '40.7128, -74.0060', - }, - }; - - // Generating three monitors each with two geo locations, - // One in a down state , - // One in an up state, - // One in a mix state - - dateRangeStart = new Date().toISOString(); - - await makeChecksWithStatus(es, upMonitorId, 1, 4, 1, {}, 'up'); - await makeChecksWithStatus(es, upMonitorId, 1, 4, 1, { observer }, 'up'); - - await makeChecksWithStatus(es, downMonitorId, 1, 4, 1, {}, 'down'); - await makeChecksWithStatus(es, downMonitorId, 1, 4, 1, { observer }, 'down'); - - await makeChecksWithStatus(es, mixMonitorId, 1, 4, 1, {}, 'up'); - await makeChecksWithStatus(es, mixMonitorId, 1, 4, 1, { observer }, 'down'); - - dateRangeEnd = new Date().toISOString(); - }); - - after('unload heartbeat index', () => getService('esArchiver').unload('uptime/blank')); - - it('should return all monitor when no status filter', async () => { - const { monitorStates } = await getMonitorStates({}); - expect(monitorStates.summaries.length).to.eql(3); - // Summaries are by default sorted by monitor names - expect( - monitorStates.summaries.map((summary: MonitorSummary) => summary.monitor_id) - ).to.eql([downMonitorId, mixMonitorId, upMonitorId]); - }); - - it('should return a monitor with mix state if check status filter is down', async () => { - const { monitorStates } = await getMonitorStates({ statusFilter: 'down' }); - expect(monitorStates.summaries.length).to.eql(2); - monitorStates.summaries.forEach((summary: MonitorSummary) => { - expect(summary.monitor_id).to.not.eql(upMonitorId); - }); - }); - - it('should not return a monitor with mix state if check status filter is up', async () => { - const { monitorStates } = await getMonitorStates({ statusFilter: 'up' }); - - expect(monitorStates.summaries.length).to.eql(1); - expect(monitorStates.summaries[0].monitor_id).to.eql(upMonitorId); - }); - }); - }); -} diff --git a/x-pack/test/api_integration/apis/uptime/index.ts b/x-pack/test/api_integration/apis/uptime/index.ts index 8def64b71a110d..13af60196f00d3 100644 --- a/x-pack/test/api_integration/apis/uptime/index.ts +++ b/x-pack/test/api_integration/apis/uptime/index.ts @@ -20,7 +20,6 @@ export default function({ getService, loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./feature_controls')); loadTestFile(require.resolve('./get_all_pings')); - loadTestFile(require.resolve('./graphql')); loadTestFile(require.resolve('./rest')); }); } diff --git a/x-pack/test/api_integration/apis/uptime/rest/certs.ts b/x-pack/test/api_integration/apis/uptime/rest/certs.ts new file mode 100644 index 00000000000000..7510ea3f34d282 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/rest/certs.ts @@ -0,0 +1,89 @@ +/* + * 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 moment from 'moment'; +import { isRight } from 'fp-ts/lib/Either'; +import { FtrProviderContext } from '../../../ftr_provider_context'; +import { API_URLS } from '../../../../../legacy/plugins/uptime/common/constants'; +import { CertType } from '../../../../../legacy/plugins/uptime/common/runtime_types'; +import { makeChecksWithStatus } from './helper/make_checks'; + +export default function({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + const legacyEsService = getService('legacyEs'); + const esArchiver = getService('esArchiver'); + + describe('certs api', () => { + describe('empty index', async () => { + it('returns empty array for no data', async () => { + const apiResponse = await supertest.get(API_URLS.CERTS); + expect(JSON.stringify(apiResponse.body)).to.eql('{"certs":[]}'); + }); + }); + + describe('when data is present', async () => { + const now = moment(); + const cnva = now.add(6, 'months').toISOString(); + const cnvb = now.subtract(23, 'weeks').toISOString(); + const monitorId = 'monitor1'; + before(async () => { + makeChecksWithStatus( + legacyEsService, + monitorId, + 3, + 1, + 10000, + { + tls: { + certificate_not_valid_after: cnva, + certificate_not_valid_before: cnvb, + server: { + x509: { + issuer: { + common_name: 'issuer-common-name', + }, + subject: { + common_name: 'subject-common-name', + }, + }, + hash: { + sha1: 'fewjio23r3', + sha256: 'few9023fijoefw', + }, + }, + }, + }, + 'up', + (d: any) => d + ); + }); + after('unload test docs', () => { + esArchiver.unload('uptime/blank'); + }); + + it('retrieves expected cert data', async () => { + const apiResponse = await supertest.get(API_URLS.CERTS); + const { body } = apiResponse; + + expect(body.certs).not.to.be(undefined); + expect(Array.isArray(body.certs)).to.be(true); + expect(body.certs).to.have.length(1); + + const decoded = CertType.decode(body.certs[0]); + expect(isRight(decoded)).to.be(true); + + const cert = body.certs[0]; + expect(Array.isArray(cert.monitors)).to.be(true); + expect(cert.monitors[0]).to.eql({ id: monitorId }); + expect(cert.certificate_not_valid_after).to.eql(cnva); + expect(cert.certificate_not_valid_before).to.eql(cnvb); + expect(cert.common_name).to.eql('subject-common-name'); + expect(cert.issuer).to.eql('issuer-common-name'); + }); + }); + }); +} diff --git a/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts b/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts index 3f42511dd165c8..5258426cf193c1 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { FtrProviderContext } from '../../../ftr_provider_context'; -import { expectFixtureEql } from '../graphql/helpers/expect_fixture_eql'; +import { expectFixtureEql } from './helper/expect_fixture_eql'; import { API_URLS } from '../../../../../legacy/plugins/uptime/common/constants'; export default function({ getService }: FtrProviderContext) { diff --git a/x-pack/test/api_integration/apis/uptime/rest/filters.ts b/x-pack/test/api_integration/apis/uptime/rest/filters.ts index 6cec6143a6d7c6..35bf32a1d404d4 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/filters.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/filters.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { expectFixtureEql } from '../graphql/helpers/expect_fixture_eql'; +import { expectFixtureEql } from './helper/expect_fixture_eql'; import { FtrProviderContext } from '../../../ftr_provider_context'; const getApiPath = (dateRangeStart: string, dateRangeEnd: string, filters?: string) => diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/filters.json b/x-pack/test/api_integration/apis/uptime/rest/fixtures/filters.json similarity index 100% rename from x-pack/test/api_integration/apis/uptime/graphql/fixtures/filters.json rename to x-pack/test/api_integration/apis/uptime/rest/fixtures/filters.json diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_status.json b/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_status.json similarity index 100% rename from x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_status.json rename to x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_status.json diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_status_all.json b/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_status_all.json similarity index 100% rename from x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitor_status_all.json rename to x-pack/test/api_integration/apis/uptime/rest/fixtures/monitor_status_all.json diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitors_with_location.json b/x-pack/test/api_integration/apis/uptime/rest/fixtures/monitors_with_location.json similarity index 100% rename from x-pack/test/api_integration/apis/uptime/graphql/fixtures/monitors_with_location.json rename to x-pack/test/api_integration/apis/uptime/rest/fixtures/monitors_with_location.json diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot.json b/x-pack/test/api_integration/apis/uptime/rest/fixtures/snapshot.json similarity index 100% rename from x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot.json rename to x-pack/test/api_integration/apis/uptime/rest/fixtures/snapshot.json diff --git a/x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_empty.json b/x-pack/test/api_integration/apis/uptime/rest/fixtures/snapshot_empty.json similarity index 100% rename from x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_empty.json rename to x-pack/test/api_integration/apis/uptime/rest/fixtures/snapshot_empty.json 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/rest/fixtures/snapshot_filtered_by_down.json similarity index 100% rename from x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_filtered_by_down.json rename to x-pack/test/api_integration/apis/uptime/rest/fixtures/snapshot_filtered_by_down.json 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/rest/fixtures/snapshot_filtered_by_up.json similarity index 100% rename from x-pack/test/api_integration/apis/uptime/graphql/fixtures/snapshot_filtered_by_up.json rename to x-pack/test/api_integration/apis/uptime/rest/fixtures/snapshot_filtered_by_up.json diff --git a/x-pack/test/api_integration/apis/uptime/graphql/helpers/expect_fixture_eql.ts b/x-pack/test/api_integration/apis/uptime/rest/helper/expect_fixture_eql.ts similarity index 87% rename from x-pack/test/api_integration/apis/uptime/graphql/helpers/expect_fixture_eql.ts rename to x-pack/test/api_integration/apis/uptime/rest/helper/expect_fixture_eql.ts index d5a4f3976e0798..abf5ec6f697b03 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/helpers/expect_fixture_eql.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/helper/expect_fixture_eql.ts @@ -10,7 +10,6 @@ import { join } from 'path'; import { cloneDeep, isEqual } from 'lodash'; const fixturesDir = join(__dirname, '..', 'fixtures'); -const restFixturesDir = join(__dirname, '../../rest/', 'fixtures'); const excludeFieldsFrom = (from: any, excluder?: (d: any) => any): any => { const clone = cloneDeep(from); @@ -24,10 +23,7 @@ export const expectFixtureEql = (data: T, fixtureName: string, excluder?: (d: expect(data).not.to.eql(null); expect(data).not.to.eql(undefined); - let fixturePath = join(fixturesDir, `${fixtureName}.json`); - if (!fs.existsSync(fixturePath)) { - fixturePath = join(restFixturesDir, `${fixtureName}.json`); - } + const fixturePath = join(fixturesDir, `${fixtureName}.json`); excluder = excluder || (d => d); const dataExcluded = excludeFieldsFrom(data, excluder); diff --git a/x-pack/test/api_integration/apis/uptime/graphql/helpers/make_checks.ts b/x-pack/test/api_integration/apis/uptime/rest/helper/make_checks.ts similarity index 100% rename from x-pack/test/api_integration/apis/uptime/graphql/helpers/make_checks.ts rename to x-pack/test/api_integration/apis/uptime/rest/helper/make_checks.ts diff --git a/x-pack/test/api_integration/apis/uptime/rest/index.ts b/x-pack/test/api_integration/apis/uptime/rest/index.ts index 3f8df81856f5c9..f77c14e960ab23 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/index.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/index.ts @@ -37,11 +37,13 @@ export default function({ getService, loadTestFile }: FtrProviderContext) { }); describe('with generated data', () => { - before('load heartbeat data', async () => await esArchiver.load('uptime/blank')); + beforeEach('load heartbeat data', async () => await esArchiver.loadIfNeeded('uptime/blank')); after('unload', async () => await esArchiver.unload('uptime/blank')); - loadTestFile(require.resolve('./snapshot')); + loadTestFile(require.resolve('./certs')); loadTestFile(require.resolve('./dynamic_settings')); + loadTestFile(require.resolve('./snapshot')); + loadTestFile(require.resolve('./monitor_states_generated')); loadTestFile(require.resolve('./telemetry_collectors')); }); describe('with real-world data', () => { @@ -52,6 +54,7 @@ export default function({ getService, loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./ping_list')); loadTestFile(require.resolve('./monitor_duration')); loadTestFile(require.resolve('./doc_count')); + loadTestFile(require.resolve('./monitor_states_real_data')); }); }); } diff --git a/x-pack/test/api_integration/apis/uptime/rest/monitor_duration.ts b/x-pack/test/api_integration/apis/uptime/rest/monitor_duration.ts index acc50e9b8f3d67..7e93f9cfff8a1d 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/monitor_duration.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/monitor_duration.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { expectFixtureEql } from '../graphql/helpers/expect_fixture_eql'; +import { expectFixtureEql } from './helper/expect_fixture_eql'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function({ getService }: FtrProviderContext) { diff --git a/x-pack/test/api_integration/apis/uptime/rest/monitor_latest_status.ts b/x-pack/test/api_integration/apis/uptime/rest/monitor_latest_status.ts index 749b304c87ee3a..6547816bb7c162 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/monitor_latest_status.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/monitor_latest_status.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { expectFixtureEql } from '../graphql/helpers/expect_fixture_eql'; +import { expectFixtureEql } from './helper/expect_fixture_eql'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function({ getService }: FtrProviderContext) { diff --git a/x-pack/test/api_integration/apis/uptime/rest/monitor_states_generated.ts b/x-pack/test/api_integration/apis/uptime/rest/monitor_states_generated.ts new file mode 100644 index 00000000000000..3c17370532f915 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/rest/monitor_states_generated.ts @@ -0,0 +1,193 @@ +/* + * 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 { FtrProviderContext } from '../../../ftr_provider_context'; +import { makeChecksWithStatus } from './helper/make_checks'; +import { API_URLS } from '../../../../../legacy/plugins/uptime/common/constants'; +import { MonitorSummary } from '../../../../../legacy/plugins/uptime/common/runtime_types'; + +export default function({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + describe('monitor state scoping', async () => { + const numIps = 4; // Must be > 2 for IP uniqueness checks + + let dateRangeStart: string; + let dateRangeEnd: string; + + const getBaseUrl = (from: string, to: string) => + `${API_URLS.MONITOR_LIST}?dateRangeStart=${from}&dateRangeEnd=${to}&pageSize=10`; + + before('load heartbeat data', () => getService('esArchiver').load('uptime/blank')); + after('unload heartbeat index', () => getService('esArchiver').unload('uptime/blank')); + + describe('query document scoping with mismatched check statuses', async () => { + let checks: any[] = []; + let nonSummaryIp: string | null = null; + const testMonitorId = 'scope-test-id'; + const makeApiParams = (monitorId: string, filterClauses: any[] = []): any => { + return JSON.stringify({ + bool: { + filter: [{ match: { 'monitor.id': monitorId } }, ...filterClauses], + }, + }); + }; + + before(async () => { + const es = getService('legacyEs'); + dateRangeStart = new Date().toISOString(); + checks = await makeChecksWithStatus(es, testMonitorId, 1, numIps, 1, {}, 'up', d => { + // turn an all up status into having at least one down + if (d.summary) { + d.monitor.status = 'down'; + d.summary.up--; + d.summary.down++; + } + return d; + }); + + dateRangeEnd = new Date().toISOString(); + nonSummaryIp = checks[0][0].monitor.ip; + }); + + it('should return all IPs', async () => { + const filters = makeApiParams(testMonitorId); + const url = getBaseUrl(dateRangeStart, dateRangeEnd) + `&filters=${filters}`; + const apiResponse = await supertest.get(url); + const res = apiResponse.body; + + const uniqueIps = new Set(); + res.summaries[0].state.checks.forEach((c: any) => uniqueIps.add(c.monitor.ip)); + + expect(uniqueIps.size).to.eql(4); + }); + + it('should match non summary documents without a status filter', async () => { + const filters = makeApiParams(testMonitorId, [{ match: { 'monitor.ip': nonSummaryIp } }]); + + const url = getBaseUrl(dateRangeStart, dateRangeEnd) + `&filters=${filters}`; + const apiResponse = await supertest.get(url); + const nonSummaryRes = apiResponse.body; + expect(nonSummaryRes.summaries.length).to.eql(1); + }); + + it('should not match non summary documents if the check status does not match the document status', async () => { + const filters = makeApiParams(testMonitorId, [{ match: { 'monitor.ip': nonSummaryIp } }]); + const url = + getBaseUrl(dateRangeStart, dateRangeEnd) + `&filters=${filters}&statusFilter=down`; + + const apiResponse = await supertest.get(url); + const nonSummaryRes = apiResponse.body; + expect(nonSummaryRes.summaries.length).to.eql(0); + }); + + it('should not non match non summary documents if the check status does not match', async () => { + const filters = makeApiParams(testMonitorId, [{ match: { 'monitor.ip': nonSummaryIp } }]); + const url = + getBaseUrl(dateRangeStart, dateRangeEnd) + `&filters=${filters}&statusFilter=up`; + + const apiResponse = await supertest.get(url); + const nonSummaryRes = apiResponse.body; + expect(nonSummaryRes.summaries.length).to.eql(0); + }); + + describe('matching outside of the date range', async () => { + before('set date range to future', () => { + const futureDate = new Date(); + + // Set dateRangeStart to one day from now + futureDate.setDate(futureDate.getDate() + 1); + dateRangeStart = futureDate.toISOString(); + + // Set dateRangeStart to two days from now + futureDate.setDate(futureDate.getDate() + 1); + dateRangeEnd = futureDate.toISOString(); + }); + + it('should not match any documents', async () => { + const filters = makeApiParams(testMonitorId); + const url = + getBaseUrl(dateRangeStart, dateRangeEnd) + `&filters=${filters}&statusFilter=up`; + + const apiResponse = await supertest.get(url); + const nonSummaryRes = apiResponse.body; + expect(nonSummaryRes.summaries.length).to.eql(0); + }); + }); + }); + + describe('test status filter', async () => { + const upMonitorId = 'up-test-id'; + const downMonitorId = 'down-test-id'; + const mixMonitorId = 'mix-test-id'; + before('generate three monitors with up, down, mix state', async () => { + await getService('esArchiver').load('uptime/blank'); + + const es = getService('legacyEs'); + + const observer = { + geo: { + name: 'US-East', + location: '40.7128, -74.0060', + }, + }; + + // Generating three monitors each with two geo locations, + // One in a down state , + // One in an up state, + // One in a mix state + + dateRangeStart = new Date().toISOString(); + + await makeChecksWithStatus(es, upMonitorId, 1, 4, 1, {}, 'up'); + await makeChecksWithStatus(es, upMonitorId, 1, 4, 1, { observer }, 'up'); + + await makeChecksWithStatus(es, downMonitorId, 1, 4, 1, {}, 'down'); + await makeChecksWithStatus(es, downMonitorId, 1, 4, 1, { observer }, 'down'); + + await makeChecksWithStatus(es, mixMonitorId, 1, 4, 1, {}, 'up'); + await makeChecksWithStatus(es, mixMonitorId, 1, 4, 1, { observer }, 'down'); + + dateRangeEnd = new Date().toISOString(); + }); + + after('unload heartbeat index', () => getService('esArchiver').unload('uptime/blank')); + + it('should return all monitor when no status filter', async () => { + const apiResponse = await supertest.get(getBaseUrl(dateRangeStart, dateRangeEnd)); + const { summaries } = apiResponse.body; + expect(summaries.length).to.eql(3); + // Summaries are by default sorted by monitor names + expect(summaries.map((summary: MonitorSummary) => summary.monitor_id)).to.eql([ + downMonitorId, + mixMonitorId, + upMonitorId, + ]); + }); + + it('should return a monitor with mix state if check status filter is down', async () => { + const apiResponse = await supertest.get( + getBaseUrl(dateRangeStart, dateRangeEnd) + '&statusFilter=down' + ); + const { summaries } = apiResponse.body; + expect(summaries.length).to.eql(2); + summaries.forEach((summary: MonitorSummary) => { + expect(summary.monitor_id).to.not.eql(upMonitorId); + }); + }); + + it('should not return a monitor with mix state if check status filter is up', async () => { + const apiResponse = await supertest.get( + getBaseUrl(dateRangeStart, dateRangeEnd) + '&statusFilter=up' + ); + const { summaries } = apiResponse.body; + + expect(summaries.length).to.eql(1); + expect(summaries[0].monitor_id).to.eql(upMonitorId); + }); + }); + }); +} diff --git a/x-pack/test/api_integration/apis/uptime/rest/monitor_states_real_data.ts b/x-pack/test/api_integration/apis/uptime/rest/monitor_states_real_data.ts new file mode 100644 index 00000000000000..f1e37bff405fd3 --- /dev/null +++ b/x-pack/test/api_integration/apis/uptime/rest/monitor_states_real_data.ts @@ -0,0 +1,525 @@ +/* + * 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 { isRight } from 'fp-ts/lib/Either'; +import { FtrProviderContext } from '../../../ftr_provider_context'; +import { API_URLS } from '../../../../../legacy/plugins/uptime/common/constants'; +import { MonitorSummaryResultType } from '../../../../../legacy/plugins/uptime/common/runtime_types'; + +interface ExpectedMonitorStatesPage { + response: any; + statesIds: string[]; + statuses: string[]; + absFrom: number; + absTo: number; + size: number; + totalCount: number; + prevPagination: null | string; + nextPagination: null | string; +} + +type PendingExpectedMonitorStatesPage = Pick< + ExpectedMonitorStatesPage, + 'statesIds' | 'statuses' | 'prevPagination' | 'nextPagination' +>; + +const checkMonitorStatesResponse = ({ + response, + statesIds, + statuses, + absFrom, + absTo, + size, + totalCount, + prevPagination, + nextPagination, +}: ExpectedMonitorStatesPage) => { + const decoded = MonitorSummaryResultType.decode(response); + expect(isRight(decoded)).to.be.ok(); + if (isRight(decoded)) { + const { summaries, prevPagePagination, nextPagePagination, totalSummaryCount } = decoded.right; + expect(summaries).to.have.length(size); + expect(summaries?.map(s => s.monitor_id)).to.eql(statesIds); + expect( + summaries?.map(s => (s.state.summary?.up && !s.state.summary?.down ? 'up' : 'down')) + ).to.eql(statuses); + (summaries ?? []).forEach(s => { + expect(s.state.url.full).to.be.ok(); + expect(s.histogram?.count).to.be(20); + (s.histogram?.points ?? []).forEach(point => { + expect(point.timestamp).to.be.greaterThan(absFrom); + expect(point.timestamp).to.be.lessThan(absTo); + }); + }); + expect(totalSummaryCount).to.be(totalCount); + expect(prevPagePagination).to.be(prevPagination); + expect(nextPagePagination).to.eql(nextPagination); + } +}; + +export default function({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + describe('monitor states endpoint', () => { + const from = '2019-09-11T03:30:04.380Z'; + const to = '2019-09-11T03:40:34.410Z'; + const absFrom = new Date(from).valueOf(); + const absTo = new Date(to).valueOf(); + + it('will fetch monitor state data for the given filters and range', async () => { + const statusFilter = 'up'; + const size = 10; + const filters = + '{"bool":{"must":[{"match":{"monitor.id":{"query":"0002-up","operator":"and"}}}]}}'; + const apiResponse = await supertest.get( + `${API_URLS.MONITOR_LIST}?dateRangeStart=${from}&dateRangeEnd=${to}&statusFilter=${statusFilter}&filters=${filters}&pageSize=${size}` + ); + checkMonitorStatesResponse({ + response: apiResponse.body, + statesIds: ['0002-up'], + statuses: ['up'], + absFrom, + absTo, + size: 1, + totalCount: 2000, + prevPagination: null, + nextPagination: null, + }); + }); + + it('can navigate forward and backward using pagination', async () => { + const expectedResultsCount = 100; + const size = 10; + const expectedPageCount = expectedResultsCount / size; + const expectedNextResults: PendingExpectedMonitorStatesPage[] = [ + { + statesIds: [ + '0000-intermittent', + '0001-up', + '0002-up', + '0003-up', + '0004-up', + '0005-up', + '0006-up', + '0007-up', + '0008-up', + '0009-up', + ], + statuses: ['up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + nextPagination: + '{"cursorDirection":"AFTER","sortOrder":"ASC","cursorKey":{"monitor_id":"0009-up"}}', + prevPagination: null, + }, + { + statesIds: [ + '0010-down', + '0011-up', + '0012-up', + '0013-up', + '0014-up', + '0015-intermittent', + '0016-up', + '0017-up', + '0018-up', + '0019-up', + ], + statuses: ['down', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + nextPagination: + '{"cursorDirection":"AFTER","sortOrder":"ASC","cursorKey":{"monitor_id":"0019-up"}}', + prevPagination: + '{"cursorKey":{"monitor_id":"0010-down"},"sortOrder":"ASC","cursorDirection":"BEFORE"}', + }, + { + statesIds: [ + '0020-down', + '0021-up', + '0022-up', + '0023-up', + '0024-up', + '0025-up', + '0026-up', + '0027-up', + '0028-up', + '0029-up', + ], + statuses: ['down', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + nextPagination: + '{"cursorDirection":"AFTER","sortOrder":"ASC","cursorKey":{"monitor_id":"0029-up"}}', + prevPagination: + '{"cursorKey":{"monitor_id":"0020-down"},"sortOrder":"ASC","cursorDirection":"BEFORE"}', + }, + { + statesIds: [ + '0030-intermittent', + '0031-up', + '0032-up', + '0033-up', + '0034-up', + '0035-up', + '0036-up', + '0037-up', + '0038-up', + '0039-up', + ], + statuses: ['down', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + nextPagination: + '{"cursorDirection":"AFTER","sortOrder":"ASC","cursorKey":{"monitor_id":"0039-up"}}', + prevPagination: + '{"cursorKey":{"monitor_id":"0030-intermittent"},"sortOrder":"ASC","cursorDirection":"BEFORE"}', + }, + { + statesIds: [ + '0040-down', + '0041-up', + '0042-up', + '0043-up', + '0044-up', + '0045-intermittent', + '0046-up', + '0047-up', + '0048-up', + '0049-up', + ], + statuses: ['down', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + nextPagination: + '{"cursorDirection":"AFTER","sortOrder":"ASC","cursorKey":{"monitor_id":"0049-up"}}', + prevPagination: + '{"cursorKey":{"monitor_id":"0040-down"},"sortOrder":"ASC","cursorDirection":"BEFORE"}', + }, + { + statesIds: [ + '0050-down', + '0051-up', + '0052-up', + '0053-up', + '0054-up', + '0055-up', + '0056-up', + '0057-up', + '0058-up', + '0059-up', + ], + statuses: ['down', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + nextPagination: + '{"cursorDirection":"AFTER","sortOrder":"ASC","cursorKey":{"monitor_id":"0059-up"}}', + prevPagination: + '{"cursorKey":{"monitor_id":"0050-down"},"sortOrder":"ASC","cursorDirection":"BEFORE"}', + }, + { + statesIds: [ + '0060-intermittent', + '0061-up', + '0062-up', + '0063-up', + '0064-up', + '0065-up', + '0066-up', + '0067-up', + '0068-up', + '0069-up', + ], + statuses: ['up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + nextPagination: + '{"cursorDirection":"AFTER","sortOrder":"ASC","cursorKey":{"monitor_id":"0069-up"}}', + prevPagination: + '{"cursorKey":{"monitor_id":"0060-intermittent"},"sortOrder":"ASC","cursorDirection":"BEFORE"}', + }, + { + statesIds: [ + '0070-down', + '0071-up', + '0072-up', + '0073-up', + '0074-up', + '0075-intermittent', + '0076-up', + '0077-up', + '0078-up', + '0079-up', + ], + statuses: ['down', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + nextPagination: + '{"cursorDirection":"AFTER","sortOrder":"ASC","cursorKey":{"monitor_id":"0079-up"}}', + prevPagination: + '{"cursorKey":{"monitor_id":"0070-down"},"sortOrder":"ASC","cursorDirection":"BEFORE"}', + }, + { + statesIds: [ + '0080-down', + '0081-up', + '0082-up', + '0083-up', + '0084-up', + '0085-up', + '0086-up', + '0087-up', + '0088-up', + '0089-up', + ], + statuses: ['down', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + nextPagination: + '{"cursorDirection":"AFTER","sortOrder":"ASC","cursorKey":{"monitor_id":"0089-up"}}', + prevPagination: + '{"cursorKey":{"monitor_id":"0080-down"},"sortOrder":"ASC","cursorDirection":"BEFORE"}', + }, + { + statesIds: [ + '0090-intermittent', + '0091-up', + '0092-up', + '0093-up', + '0094-up', + '0095-up', + '0096-up', + '0097-up', + '0098-up', + '0099-up', + ], + statuses: ['up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + nextPagination: null, + prevPagination: + '{"cursorKey":{"monitor_id":"0090-intermittent"},"sortOrder":"ASC","cursorDirection":"BEFORE"}', + }, + ]; + + const expectedPrevResults: PendingExpectedMonitorStatesPage[] = [ + { + statesIds: [ + '0000-intermittent', + '0001-up', + '0002-up', + '0003-up', + '0004-up', + '0005-up', + '0006-up', + '0007-up', + '0008-up', + '0009-up', + ], + statuses: ['up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + nextPagination: + '{"cursorKey":{"monitor_id":"0009-up"},"sortOrder":"ASC","cursorDirection":"AFTER"}', + prevPagination: null, + }, + { + statesIds: [ + '0010-down', + '0011-up', + '0012-up', + '0013-up', + '0014-up', + '0015-intermittent', + '0016-up', + '0017-up', + '0018-up', + '0019-up', + ], + statuses: ['down', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + nextPagination: + '{"cursorKey":{"monitor_id":"0019-up"},"sortOrder":"ASC","cursorDirection":"AFTER"}', + prevPagination: + '{"cursorKey":{"monitor_id":"0010-down"},"sortOrder":"ASC","cursorDirection":"BEFORE"}', + }, + { + statesIds: [ + '0020-down', + '0021-up', + '0022-up', + '0023-up', + '0024-up', + '0025-up', + '0026-up', + '0027-up', + '0028-up', + '0029-up', + ], + statuses: ['down', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + nextPagination: + '{"cursorKey":{"monitor_id":"0029-up"},"sortOrder":"ASC","cursorDirection":"AFTER"}', + prevPagination: + '{"cursorKey":{"monitor_id":"0020-down"},"sortOrder":"ASC","cursorDirection":"BEFORE"}', + }, + { + statesIds: [ + '0030-intermittent', + '0031-up', + '0032-up', + '0033-up', + '0034-up', + '0035-up', + '0036-up', + '0037-up', + '0038-up', + '0039-up', + ], + statuses: ['down', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + nextPagination: + '{"cursorKey":{"monitor_id":"0039-up"},"sortOrder":"ASC","cursorDirection":"AFTER"}', + prevPagination: + '{"cursorKey":{"monitor_id":"0030-intermittent"},"sortOrder":"ASC","cursorDirection":"BEFORE"}', + }, + { + statesIds: [ + '0040-down', + '0041-up', + '0042-up', + '0043-up', + '0044-up', + '0045-intermittent', + '0046-up', + '0047-up', + '0048-up', + '0049-up', + ], + statuses: ['down', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + nextPagination: + '{"cursorKey":{"monitor_id":"0049-up"},"sortOrder":"ASC","cursorDirection":"AFTER"}', + prevPagination: + '{"cursorKey":{"monitor_id":"0040-down"},"sortOrder":"ASC","cursorDirection":"BEFORE"}', + }, + { + statesIds: [ + '0050-down', + '0051-up', + '0052-up', + '0053-up', + '0054-up', + '0055-up', + '0056-up', + '0057-up', + '0058-up', + '0059-up', + ], + statuses: ['down', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + nextPagination: + '{"cursorKey":{"monitor_id":"0059-up"},"sortOrder":"ASC","cursorDirection":"AFTER"}', + prevPagination: + '{"cursorKey":{"monitor_id":"0050-down"},"sortOrder":"ASC","cursorDirection":"BEFORE"}', + }, + { + statesIds: [ + '0060-intermittent', + '0061-up', + '0062-up', + '0063-up', + '0064-up', + '0065-up', + '0066-up', + '0067-up', + '0068-up', + '0069-up', + ], + statuses: ['up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + nextPagination: + '{"cursorKey":{"monitor_id":"0069-up"},"sortOrder":"ASC","cursorDirection":"AFTER"}', + prevPagination: + '{"cursorKey":{"monitor_id":"0060-intermittent"},"sortOrder":"ASC","cursorDirection":"BEFORE"}', + }, + { + statesIds: [ + '0070-down', + '0071-up', + '0072-up', + '0073-up', + '0074-up', + '0075-intermittent', + '0076-up', + '0077-up', + '0078-up', + '0079-up', + ], + statuses: ['down', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + nextPagination: + '{"cursorKey":{"monitor_id":"0079-up"},"sortOrder":"ASC","cursorDirection":"AFTER"}', + prevPagination: + '{"cursorKey":{"monitor_id":"0070-down"},"sortOrder":"ASC","cursorDirection":"BEFORE"}', + }, + { + statesIds: [ + '0080-down', + '0081-up', + '0082-up', + '0083-up', + '0084-up', + '0085-up', + '0086-up', + '0087-up', + '0088-up', + '0089-up', + ], + statuses: ['down', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + nextPagination: + '{"cursorKey":{"monitor_id":"0089-up"},"sortOrder":"ASC","cursorDirection":"AFTER"}', + prevPagination: + '{"cursorKey":{"monitor_id":"0080-down"},"sortOrder":"ASC","cursorDirection":"BEFORE"}', + }, + ]; + + const totalCount = 2000; + let pagination: string | null = null; + for (let page = 1; page <= expectedPageCount; page++) { + const baseUrl = `${API_URLS.MONITOR_LIST}?dateRangeStart=${from}&dateRangeEnd=${to}&pageSize=${size}`; + const nextUrl: string = baseUrl + `&pagination=${pagination ?? ''}`; + const nextApiResponse = await supertest.get(nextUrl); + const nextData = nextApiResponse.body; + pagination = nextData.nextPagePagination; + checkMonitorStatesResponse({ + response: nextData, + ...expectedNextResults[page - 1], + absFrom, + absTo, + size, + totalCount, + }); + + // Test to see if the previous page pagination works on every page (other than the first) + if (page > 1) { + const prevUrl: string = baseUrl + `&pagination=${nextData.prevPagePagination}`; + const prevApiResponse = await supertest.get(prevUrl); + const prevData = prevApiResponse.body; + checkMonitorStatesResponse({ + response: prevData, + ...expectedPrevResults[page - 2], + absFrom, + absTo, + size, + totalCount, + }); + } + } + }); + + it('will fetch monitor state data for the given date range', async () => { + const LENGTH = 10; + const { body } = await supertest.get( + `${API_URLS.MONITOR_LIST}?dateRangeStart=${from}&dateRangeEnd=${to}&pageSize=${LENGTH}` + ); + checkMonitorStatesResponse({ + response: body, + statesIds: [ + '0000-intermittent', + '0001-up', + '0002-up', + '0003-up', + '0004-up', + '0005-up', + '0006-up', + '0007-up', + '0008-up', + '0009-up', + ], + statuses: ['up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up', 'up'], + absFrom, + absTo, + size: LENGTH, + totalCount: 2000, + prevPagination: null, + nextPagination: + '{"cursorDirection":"AFTER","sortOrder":"ASC","cursorKey":{"monitor_id":"0009-up"}}', + }); + }); + }); +} diff --git a/x-pack/test/api_integration/apis/uptime/rest/ping_histogram.ts b/x-pack/test/api_integration/apis/uptime/rest/ping_histogram.ts index 0982d5fef7cb44..b1afe4c8e0d7d3 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/ping_histogram.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/ping_histogram.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { expectFixtureEql } from '../graphql/helpers/expect_fixture_eql'; +import { expectFixtureEql } from './helper/expect_fixture_eql'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { assertCloseTo } from '../../../../../plugins/uptime/server/lib/helper'; diff --git a/x-pack/test/api_integration/apis/uptime/rest/snapshot.ts b/x-pack/test/api_integration/apis/uptime/rest/snapshot.ts index 20fe59d149ae8f..9a8951741948e3 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/snapshot.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/snapshot.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { expectFixtureEql } from '../graphql/helpers/expect_fixture_eql'; +import { expectFixtureEql } from './helper/expect_fixture_eql'; import { FtrProviderContext } from '../../../ftr_provider_context'; -import { makeChecksWithStatus, getChecksDateRange } from '../graphql/helpers/make_checks'; +import { makeChecksWithStatus, getChecksDateRange } from './helper/make_checks'; export default function({ getService }: FtrProviderContext) { const supertest = getService('supertest'); diff --git a/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts b/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts index b2ec96be0f2887..017ef02afe5ea7 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { API_URLS } from '../../../../../legacy/plugins/uptime/common/constants'; -import { makeChecksWithStatus } from '../graphql/helpers/make_checks'; +import { makeChecksWithStatus } from './helper/make_checks'; export default function({ getService }: FtrProviderContext) { const supertest = getService('supertest'); diff --git a/x-pack/test/api_integration/services/ml.ts b/x-pack/test/api_integration/services/ml.ts index 841b200b870801..c295af7dc73ab4 100644 --- a/x-pack/test/api_integration/services/ml.ts +++ b/x-pack/test/api_integration/services/ml.ts @@ -9,14 +9,17 @@ import { FtrProviderContext } from '../../functional/ftr_provider_context'; import { MachineLearningAPIProvider, MachineLearningSecurityCommonProvider, + MachineLearningTestResourcesProvider, } from '../../functional/services/machine_learning'; export function MachineLearningProvider(context: FtrProviderContext) { const api = MachineLearningAPIProvider(context); const securityCommon = MachineLearningSecurityCommonProvider(context); + const testResources = MachineLearningTestResourcesProvider(context); return { api, securityCommon, + testResources, }; } diff --git a/x-pack/test/detection_engine_api_integration/common/config.ts b/x-pack/test/detection_engine_api_integration/common/config.ts index 89ebd902834b95..e89352118990a1 100644 --- a/x-pack/test/detection_engine_api_integration/common/config.ts +++ b/x-pack/test/detection_engine_api_integration/common/config.ts @@ -8,7 +8,7 @@ import path from 'path'; import { CA_CERT_PATH } from '@kbn/dev-utils'; import { FtrConfigProviderContext } from '@kbn/test/types/ftr'; import { services } from './services'; -import { listsEnvFeatureFlagName } from '../../../legacy/plugins/siem/server/lib/detection_engine/feature_flags'; +import { listsEnvFeatureFlagName } from '../../../plugins/siem/server/lib/detection_engine/feature_flags'; interface CreateTestConfigOptions { license: string; diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/add_prepackaged_rules.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/add_prepackaged_rules.ts index 6ee65d5d28aa47..e787a3594dfe62 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/add_prepackaged_rules.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/add_prepackaged_rules.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; -import { DETECTION_ENGINE_PREPACKAGED_URL } from '../../../../legacy/plugins/siem/common/constants'; +import { DETECTION_ENGINE_PREPACKAGED_URL } from '../../../../plugins/siem/common/constants'; import { FtrProviderContext } from '../../common/ftr_provider_context'; import { createSignalsIndex, deleteAllAlerts, deleteSignalsIndex } from './utils'; diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/create_rules.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/create_rules.ts index 91088acb7a51ce..46645a9b5a9448 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/create_rules.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/create_rules.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; -import { DETECTION_ENGINE_RULES_URL } from '../../../../legacy/plugins/siem/common/constants'; +import { DETECTION_ENGINE_RULES_URL } from '../../../../plugins/siem/common/constants'; import { FtrProviderContext } from '../../common/ftr_provider_context'; import { createSignalsIndex, diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/create_rules_bulk.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/create_rules_bulk.ts index 8e951a31b525c0..117300be417d50 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/create_rules_bulk.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/create_rules_bulk.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; -import { DETECTION_ENGINE_RULES_URL } from '../../../../legacy/plugins/siem/common/constants'; +import { DETECTION_ENGINE_RULES_URL } from '../../../../plugins/siem/common/constants'; import { FtrProviderContext } from '../../common/ftr_provider_context'; import { createSignalsIndex, diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/delete_rules.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/delete_rules.ts index a886a5fb07a6c7..fb701681419d8b 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/delete_rules.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/delete_rules.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; -import { DETECTION_ENGINE_RULES_URL } from '../../../../legacy/plugins/siem/common/constants'; +import { DETECTION_ENGINE_RULES_URL } from '../../../../plugins/siem/common/constants'; import { FtrProviderContext } from '../../common/ftr_provider_context'; import { createSignalsIndex, diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/delete_rules_bulk.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/delete_rules_bulk.ts index 9e9071b82884f9..ac58ba4c77e4e5 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/delete_rules_bulk.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/delete_rules_bulk.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; -import { DETECTION_ENGINE_RULES_URL } from '../../../../legacy/plugins/siem/common/constants'; +import { DETECTION_ENGINE_RULES_URL } from '../../../../plugins/siem/common/constants'; import { FtrProviderContext } from '../../common/ftr_provider_context'; import { createSignalsIndex, diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/export_rules.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/export_rules.ts index a8f841db94bbcb..51bdb9e45dc0c3 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/export_rules.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/export_rules.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; -import { DETECTION_ENGINE_RULES_URL } from '../../../../legacy/plugins/siem/common/constants'; +import { DETECTION_ENGINE_RULES_URL } from '../../../../plugins/siem/common/constants'; import { FtrProviderContext } from '../../common/ftr_provider_context'; import { binaryToString, diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/find_rules.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/find_rules.ts index abbc8f77e00778..feb4ecd125f7eb 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/find_rules.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/find_rules.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; -import { DETECTION_ENGINE_RULES_URL } from '../../../../legacy/plugins/siem/common/constants'; +import { DETECTION_ENGINE_RULES_URL } from '../../../../plugins/siem/common/constants'; import { FtrProviderContext } from '../../common/ftr_provider_context'; import { createSignalsIndex, diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/find_statuses.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/find_statuses.ts index 45805f03f8c0cd..44847d5c8146c4 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/find_statuses.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/find_statuses.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; -import { DETECTION_ENGINE_RULES_URL } from '../../../../legacy/plugins/siem/common/constants'; +import { DETECTION_ENGINE_RULES_URL } from '../../../../plugins/siem/common/constants'; import { FtrProviderContext } from '../../common/ftr_provider_context'; import { createSignalsIndex, @@ -50,17 +50,18 @@ export default ({ getService }: FtrProviderContext): void => { .send(getSimpleRule()) .expect(200); - await new Promise(resolve => setTimeout(resolve, 1000)).then(async () => { - // query the single rule from _find - const { body } = await supertest - .post(`${DETECTION_ENGINE_RULES_URL}/_find_statuses`) - .set('kbn-xsrf', 'true') - .send({ ids: [resBody.id] }) - .expect(200); + // wait for Task Manager to execute the rule and update status + await new Promise(resolve => setTimeout(resolve, 5000)); - // expected result for status should be 'going to run' or 'succeeded - expect(['succeeded', 'going to run']).to.contain(body[resBody.id].current_status.status); - }); + // query the single rule from _find + const { body } = await supertest + .post(`${DETECTION_ENGINE_RULES_URL}/_find_statuses`) + .set('kbn-xsrf', 'true') + .send({ ids: [resBody.id] }) + .expect(200); + + // expected result for status should be 'going to run' or 'succeeded + expect(['succeeded', 'going to run']).to.contain(body[resBody.id].current_status.status); }); }); }; diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/get_prepackaged_rules_status.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/get_prepackaged_rules_status.ts index 49cf150126fda2..e2dce77c1d70a1 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/get_prepackaged_rules_status.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/get_prepackaged_rules_status.ts @@ -9,7 +9,7 @@ import expect from '@kbn/expect'; import { DETECTION_ENGINE_PREPACKAGED_URL, DETECTION_ENGINE_RULES_URL, -} from '../../../../legacy/plugins/siem/common/constants'; +} from '../../../../plugins/siem/common/constants'; import { FtrProviderContext } from '../../common/ftr_provider_context'; import { createSignalsIndex, deleteAllAlerts, deleteSignalsIndex, getSimpleRule } from './utils'; diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/import_rules.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/import_rules.ts index ae4589e32ec113..4def508fabbc31 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/import_rules.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/import_rules.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; -import { DETECTION_ENGINE_RULES_URL } from '../../../../legacy/plugins/siem/common/constants'; +import { DETECTION_ENGINE_RULES_URL } from '../../../../plugins/siem/common/constants'; import { FtrProviderContext } from '../../common/ftr_provider_context'; import { createSignalsIndex, diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/open_close_signals.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/open_close_signals.ts index e9e3e4299d108c..3c8c20646885ae 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/open_close_signals.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/open_close_signals.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; -import { DETECTION_ENGINE_SIGNALS_STATUS_URL } from '../../../../legacy/plugins/siem/common/constants'; +import { DETECTION_ENGINE_SIGNALS_STATUS_URL } from '../../../../plugins/siem/common/constants'; import { FtrProviderContext } from '../../common/ftr_provider_context'; import { createSignalsIndex, diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/patch_rules.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/patch_rules.ts index 53a3d15690efcf..c3ecf79e58955c 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/patch_rules.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/patch_rules.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; -import { DETECTION_ENGINE_RULES_URL } from '../../../../legacy/plugins/siem/common/constants'; +import { DETECTION_ENGINE_RULES_URL } from '../../../../plugins/siem/common/constants'; import { FtrProviderContext } from '../../common/ftr_provider_context'; import { createSignalsIndex, diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/patch_rules_bulk.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/patch_rules_bulk.ts index c13e8909dacf90..8515d1cf404ea0 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/patch_rules_bulk.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/patch_rules_bulk.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; -import { DETECTION_ENGINE_RULES_URL } from '../../../../legacy/plugins/siem/common/constants'; +import { DETECTION_ENGINE_RULES_URL } from '../../../../plugins/siem/common/constants'; import { FtrProviderContext } from '../../common/ftr_provider_context'; import { createSignalsIndex, diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/query_signals.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/query_signals.ts index 6fa62412ed4676..7c8bd8981db10a 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/query_signals.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/query_signals.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; -import { DETECTION_ENGINE_QUERY_SIGNALS_URL } from '../../../../legacy/plugins/siem/common/constants'; +import { DETECTION_ENGINE_QUERY_SIGNALS_URL } from '../../../../plugins/siem/common/constants'; import { FtrProviderContext } from '../../common/ftr_provider_context'; import { getSignalStatus, createSignalsIndex, deleteSignalsIndex } from './utils'; diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/read_rules.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/read_rules.ts index 2ea62b0756f73d..4d7449dae2dbd2 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/read_rules.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/read_rules.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; -import { DETECTION_ENGINE_RULES_URL } from '../../../../legacy/plugins/siem/common/constants'; +import { DETECTION_ENGINE_RULES_URL } from '../../../../plugins/siem/common/constants'; import { FtrProviderContext } from '../../common/ftr_provider_context'; import { createSignalsIndex, diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/update_rules.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/update_rules.ts index 92c78be72bf019..4b81b7d4304b28 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/update_rules.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/update_rules.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; -import { DETECTION_ENGINE_RULES_URL } from '../../../../legacy/plugins/siem/common/constants'; +import { DETECTION_ENGINE_RULES_URL } from '../../../../plugins/siem/common/constants'; import { FtrProviderContext } from '../../common/ftr_provider_context'; import { createSignalsIndex, diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/update_rules_bulk.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/update_rules_bulk.ts index 220a4af4c5c5e4..760e17ae1752e4 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/update_rules_bulk.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/update_rules_bulk.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; -import { DETECTION_ENGINE_RULES_URL } from '../../../../legacy/plugins/siem/common/constants'; +import { DETECTION_ENGINE_RULES_URL } from '../../../../plugins/siem/common/constants'; import { FtrProviderContext } from '../../common/ftr_provider_context'; import { createSignalsIndex, diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/utils.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/utils.ts index 0a5b2def3eb18e..e508cf1aaa2e03 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/utils.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/utils.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { OutputRuleAlertRest } from '../../../../legacy/plugins/siem/server/lib/detection_engine/types'; -import { DETECTION_ENGINE_INDEX_URL } from '../../../../legacy/plugins/siem/common/constants'; +import { OutputRuleAlertRest } from '../../../../plugins/siem/server/lib/detection_engine/types'; +import { DETECTION_ENGINE_INDEX_URL } from '../../../../plugins/siem/common/constants'; /** * This will remove server generated properties such as date times, etc... @@ -154,7 +154,7 @@ export const getSimpleRuleOutput = (ruleId = 'rule-1'): Partial { - await esArchiver.load('ml/ecommerce'); - await ml.api.createCalendar('wizard-test-calendar'); + await esArchiver.loadIfNeeded('ml/ecommerce'); + await ml.testResources.createIndexPatternIfNeeded('ft_ecommerce', 'order_date'); + await ml.testResources.setKibanaTimeZoneToUTC(); + + await ml.api.createCalendar(calendarId); await ml.securityUI.loginAsMlPowerUser(); }); after(async () => { - await esArchiver.unload('ml/ecommerce'); await ml.api.cleanMlIndices(); }); @@ -475,7 +479,7 @@ export default function({ getService }: FtrProviderContext) { }); it('job creation assigns calendars', async () => { - await ml.jobWizardCommon.addCalendar('wizard-test-calendar'); + await ml.jobWizardCommon.addCalendar(calendarId); }); it('job creation displays the model plot switch', async () => { @@ -734,7 +738,7 @@ export default function({ getService }: FtrProviderContext) { }); it('job cloning persists assigned calendars', async () => { - await ml.jobWizardCommon.assertCalendarsSelection(['wizard-test-calendar']); + await ml.jobWizardCommon.assertCalendarsSelection([calendarId]); }); it('job cloning pre-fills the model plot switch', async () => { diff --git a/x-pack/test/functional/apps/machine_learning/anomaly_detection/anomaly_explorer.ts b/x-pack/test/functional/apps/machine_learning/anomaly_detection/anomaly_explorer.ts index 83e9c01a463197..8827559a5f4709 100644 --- a/x-pack/test/functional/apps/machine_learning/anomaly_detection/anomaly_explorer.ts +++ b/x-pack/test/functional/apps/machine_learning/anomaly_detection/anomaly_explorer.ts @@ -29,7 +29,7 @@ const JOB_CONFIG: Job = { const DATAFEED_CONFIG: Datafeed = { datafeed_id: 'datafeed-fq_multi_1_se', - indices: ['farequote'], + indices: ['ft_farequote'], job_id: 'fq_multi_1_ae', query: { bool: { must: [{ match_all: {} }] } }, }; @@ -59,12 +59,11 @@ export default function({ getService }: FtrProviderContext) { describe('anomaly explorer', function() { this.tags(['smoke', 'mlqa']); before(async () => { - await esArchiver.load('ml/farequote'); - await ml.securityUI.loginAsMlPowerUser(); - }); + await esArchiver.loadIfNeeded('ml/farequote'); + await ml.testResources.createIndexPatternIfNeeded('ft_farequote', '@timestamp'); + await ml.testResources.setKibanaTimeZoneToUTC(); - after(async () => { - await esArchiver.unload('ml/farequote'); + await ml.securityUI.loginAsMlPowerUser(); }); for (const testData of testDataList) { diff --git a/x-pack/test/functional/apps/machine_learning/anomaly_detection/categorization_job.ts b/x-pack/test/functional/apps/machine_learning/anomaly_detection/categorization_job.ts index 6408c6de1f9280..9b5ae171d41159 100644 --- a/x-pack/test/functional/apps/machine_learning/anomaly_detection/categorization_job.ts +++ b/x-pack/test/functional/apps/machine_learning/anomaly_detection/categorization_job.ts @@ -16,7 +16,7 @@ export default function({ getService }: FtrProviderContext) { const jobId = `categorization_${Date.now()}`; const jobIdClone = `${jobId}_clone`; const jobDescription = - 'Create categorization job based on the categorization_functional_test dataset with a count rare'; + 'Create categorization job based on the ft_categorization dataset with a count rare'; const jobGroups = ['automated', 'categorization']; const jobGroupsClone = [...jobGroups, 'clone']; const detectorTypeIdentifier = 'Rare'; @@ -74,16 +74,20 @@ export default function({ getService }: FtrProviderContext) { }; } + const calendarId = `wizard-test-calendar_${Date.now()}`; + describe('categorization', function() { this.tags(['smoke', 'mlqa']); before(async () => { - await esArchiver.load('ml/categorization'); - await ml.api.createCalendar('wizard-test-calendar'); + await esArchiver.loadIfNeeded('ml/categorization'); + await ml.testResources.createIndexPatternIfNeeded('ft_categorization', '@timestamp'); + await ml.testResources.setKibanaTimeZoneToUTC(); + + await ml.api.createCalendar(calendarId); await ml.securityUI.loginAsMlPowerUser(); }); after(async () => { - await esArchiver.unload('ml/categorization'); await ml.api.cleanMlIndices(); }); @@ -97,9 +101,7 @@ export default function({ getService }: FtrProviderContext) { }); it('job creation loads the job type selection page', async () => { - await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob( - 'categorization_functional_test' - ); + await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob('ft_categorization'); }); it('job creation loads the categorization job wizard page', async () => { @@ -178,7 +180,7 @@ export default function({ getService }: FtrProviderContext) { }); it('job creation assigns calendars', async () => { - await ml.jobWizardCommon.addCalendar('wizard-test-calendar'); + await ml.jobWizardCommon.addCalendar(calendarId); }); it('job creation opens the advanced section', async () => { @@ -310,7 +312,7 @@ export default function({ getService }: FtrProviderContext) { }); it('job cloning persists assigned calendars', async () => { - await ml.jobWizardCommon.assertCalendarsSelection(['wizard-test-calendar']); + await ml.jobWizardCommon.assertCalendarsSelection([calendarId]); }); it('job cloning opens the advanced section', async () => { diff --git a/x-pack/test/functional/apps/machine_learning/anomaly_detection/date_nanos_job.ts b/x-pack/test/functional/apps/machine_learning/anomaly_detection/date_nanos_job.ts index 2a9824f46778da..570deee01c6843 100644 --- a/x-pack/test/functional/apps/machine_learning/anomaly_detection/date_nanos_job.ts +++ b/x-pack/test/functional/apps/machine_learning/anomaly_detection/date_nanos_job.ts @@ -104,7 +104,7 @@ export default function({ getService }: FtrProviderContext) { const testDataList = [ { suiteTitle: 'with count detector and model plot disabled', - jobSource: 'event_rate_gen_trend_nanos', + jobSource: 'ft_event_rate_gen_trend_nanos', jobId: `event_rate_nanos_count_1_${Date.now()}`, jobDescription: 'Create advanced job based on the event rate dataset with a date_nanos time field, 30m bucketspan and count', @@ -168,12 +168,18 @@ export default function({ getService }: FtrProviderContext) { describe('job on data set with date_nanos time field', function() { this.tags(['smoke', 'mlqa']); before(async () => { - await esArchiver.load('ml/event_rate_nanos'); + await esArchiver.loadIfNeeded('ml/event_rate_nanos'); + await ml.testResources.createIndexPatternIfNeeded( + 'ft_event_rate_gen_trend_nanos', + '@timestamp' + ); + await ml.testResources.setKibanaTimeZoneToUTC(); + + await esArchiver.loadIfNeeded('ml/event_rate_nanos'); await ml.securityUI.loginAsMlPowerUser(); }); after(async () => { - await esArchiver.unload('ml/event_rate_nanos'); await ml.api.cleanMlIndices(); }); diff --git a/x-pack/test/functional/apps/machine_learning/anomaly_detection/multi_metric_job.ts b/x-pack/test/functional/apps/machine_learning/anomaly_detection/multi_metric_job.ts index 08175b79462597..4739f987541d6b 100644 --- a/x-pack/test/functional/apps/machine_learning/anomaly_detection/multi_metric_job.ts +++ b/x-pack/test/functional/apps/machine_learning/anomaly_detection/multi_metric_job.ts @@ -71,16 +71,20 @@ export default function({ getService }: FtrProviderContext) { }; } + const calendarId = `wizard-test-calendar_${Date.now()}`; + describe('multi metric', function() { this.tags(['smoke', 'mlqa']); before(async () => { - await esArchiver.load('ml/farequote'); - await ml.api.createCalendar('wizard-test-calendar'); + await esArchiver.loadIfNeeded('ml/farequote'); + await ml.testResources.createIndexPatternIfNeeded('ft_farequote', '@timestamp'); + await ml.testResources.setKibanaTimeZoneToUTC(); + + await ml.api.createCalendar(calendarId); await ml.securityUI.loginAsMlPowerUser(); }); after(async () => { - await esArchiver.unload('ml/farequote'); await ml.api.cleanMlIndices(); }); @@ -94,7 +98,7 @@ export default function({ getService }: FtrProviderContext) { }); it('job creation loads the job type selection page', async () => { - await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob('farequote'); + await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob('ft_farequote'); }); it('job creation loads the multi metric job wizard page', async () => { @@ -181,7 +185,7 @@ export default function({ getService }: FtrProviderContext) { }); it('job creation assigns calendars', async () => { - await ml.jobWizardCommon.addCalendar('wizard-test-calendar'); + await ml.jobWizardCommon.addCalendar(calendarId); }); it('job creation opens the advanced section', async () => { @@ -329,7 +333,7 @@ export default function({ getService }: FtrProviderContext) { }); it('job cloning persists assigned calendars', async () => { - await ml.jobWizardCommon.assertCalendarsSelection(['wizard-test-calendar']); + await ml.jobWizardCommon.assertCalendarsSelection([calendarId]); }); it('job cloning opens the advanced section', async () => { diff --git a/x-pack/test/functional/apps/machine_learning/anomaly_detection/population_job.ts b/x-pack/test/functional/apps/machine_learning/anomaly_detection/population_job.ts index 512d13307ea052..0279c70bb73a92 100644 --- a/x-pack/test/functional/apps/machine_learning/anomaly_detection/population_job.ts +++ b/x-pack/test/functional/apps/machine_learning/anomaly_detection/population_job.ts @@ -85,16 +85,20 @@ export default function({ getService }: FtrProviderContext) { }; } + const calendarId = `wizard-test-calendar_${Date.now()}`; + describe('population', function() { this.tags(['smoke', 'mlqa']); before(async () => { - await esArchiver.load('ml/ecommerce'); - await ml.api.createCalendar('wizard-test-calendar'); + await esArchiver.loadIfNeeded('ml/ecommerce'); + await ml.testResources.createIndexPatternIfNeeded('ft_ecommerce', 'order_date'); + await ml.testResources.setKibanaTimeZoneToUTC(); + + await ml.api.createCalendar(calendarId); await ml.securityUI.loginAsMlPowerUser(); }); after(async () => { - await esArchiver.unload('ml/farequote'); await ml.api.cleanMlIndices(); }); @@ -108,7 +112,7 @@ export default function({ getService }: FtrProviderContext) { }); it('job creation loads the job type selection page', async () => { - await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob('ecommerce'); + await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob('ft_ecommerce'); }); it('job creation loads the population job wizard page', async () => { @@ -208,7 +212,7 @@ export default function({ getService }: FtrProviderContext) { }); it('job creation assigns calendars', async () => { - await ml.jobWizardCommon.addCalendar('wizard-test-calendar'); + await ml.jobWizardCommon.addCalendar(calendarId); }); it('job creation opens the advanced section', async () => { @@ -367,7 +371,7 @@ export default function({ getService }: FtrProviderContext) { }); it('job cloning persists assigned calendars', async () => { - await ml.jobWizardCommon.assertCalendarsSelection(['wizard-test-calendar']); + await ml.jobWizardCommon.assertCalendarsSelection([calendarId]); }); it('job cloning opens the advanced section', async () => { diff --git a/x-pack/test/functional/apps/machine_learning/anomaly_detection/saved_search_job.ts b/x-pack/test/functional/apps/machine_learning/anomaly_detection/saved_search_job.ts index a13cf3d61128e7..a5652d76358eb4 100644 --- a/x-pack/test/functional/apps/machine_learning/anomaly_detection/saved_search_job.ts +++ b/x-pack/test/functional/apps/machine_learning/anomaly_detection/saved_search_job.ts @@ -15,7 +15,7 @@ export default function({ getService }: FtrProviderContext) { const testDataList = [ { suiteTitle: 'with filter', - jobSource: 'farequote_filter', + jobSource: 'ft_farequote_filter', jobId: `fq_saved_search_1_${Date.now()}`, jobDescription: 'Create multi metric job based on a saved search with filter', jobGroups: ['automated', 'farequote', 'multi-metric', 'saved-search'], @@ -66,7 +66,7 @@ export default function({ getService }: FtrProviderContext) { }, { suiteTitle: 'with lucene query', - jobSource: 'farequote_lucene', + jobSource: 'ft_farequote_lucene', jobId: `fq_saved_search_2_${Date.now()}`, jobDescription: 'Create multi metric job based on a saved search with lucene query', jobGroups: ['automated', 'farequote', 'multi-metric', 'saved-search'], @@ -117,7 +117,7 @@ export default function({ getService }: FtrProviderContext) { }, { suiteTitle: 'with kuery query', - jobSource: 'farequote_kuery', + jobSource: 'ft_farequote_kuery', jobId: `fq_saved_search_3_${Date.now()}`, jobDescription: 'Create multi metric job based on a saved search with kuery query', jobGroups: ['automated', 'farequote', 'multi-metric', 'saved-search'], @@ -168,7 +168,7 @@ export default function({ getService }: FtrProviderContext) { }, { suiteTitle: 'with filter and lucene query', - jobSource: 'farequote_filter_and_lucene', + jobSource: 'ft_farequote_filter_and_lucene', jobId: `fq_saved_search_4_${Date.now()}`, jobDescription: 'Create multi metric job based on a saved search with filter and lucene query', @@ -220,7 +220,7 @@ export default function({ getService }: FtrProviderContext) { }, { suiteTitle: 'with filter and kuery query', - jobSource: 'farequote_filter_and_kuery', + jobSource: 'ft_farequote_filter_and_kuery', jobId: `fq_saved_search_5_${Date.now()}`, jobDescription: 'Create multi metric job based on a saved search with filter and kuery query', jobGroups: ['automated', 'farequote', 'multi-metric', 'saved-search'], @@ -274,12 +274,19 @@ export default function({ getService }: FtrProviderContext) { describe('saved search', function() { this.tags(['smoke', 'mlqa']); before(async () => { - await esArchiver.load('ml/farequote'); + await esArchiver.loadIfNeeded('ml/farequote'); + await ml.testResources.createIndexPatternIfNeeded('ft_farequote', '@timestamp'); + await ml.testResources.createSavedSearchFarequoteFilterIfNeeded(); + await ml.testResources.createSavedSearchFarequoteLuceneIfNeeded(); + await ml.testResources.createSavedSearchFarequoteKueryIfNeeded(); + await ml.testResources.createSavedSearchFarequoteFilterAndLuceneIfNeeded(); + await ml.testResources.createSavedSearchFarequoteFilterAndKueryIfNeeded(); + await ml.testResources.setKibanaTimeZoneToUTC(); + await ml.securityUI.loginAsMlPowerUser(); }); after(async () => { - await esArchiver.unload('ml/farequote'); await ml.api.cleanMlIndices(); }); diff --git a/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_job.ts b/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_job.ts index 4e6d480c12d82a..43053decb39247 100644 --- a/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_job.ts +++ b/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_job.ts @@ -70,16 +70,20 @@ export default function({ getService }: FtrProviderContext) { }; } + const calendarId = `wizard-test-calendar_${Date.now()}`; + describe('single metric', function() { this.tags(['smoke', 'mlqa']); before(async () => { - await esArchiver.load('ml/farequote'); - await ml.api.createCalendar('wizard-test-calendar'); + await esArchiver.loadIfNeeded('ml/farequote'); + await ml.testResources.createIndexPatternIfNeeded('ft_farequote', '@timestamp'); + await ml.testResources.setKibanaTimeZoneToUTC(); + + await ml.api.createCalendar(calendarId); await ml.securityUI.loginAsMlPowerUser(); }); after(async () => { - await esArchiver.unload('ml/farequote'); await ml.api.cleanMlIndices(); }); @@ -93,7 +97,7 @@ export default function({ getService }: FtrProviderContext) { }); it('job creation loads the job type selection page', async () => { - await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob('farequote'); + await ml.jobSourceSelection.selectSourceForAnomalyDetectionJob('ft_farequote'); }); it('job creation loads the single metric job wizard page', async () => { @@ -162,7 +166,7 @@ export default function({ getService }: FtrProviderContext) { }); it('job creation assigns calendars', async () => { - await ml.jobWizardCommon.addCalendar('wizard-test-calendar'); + await ml.jobWizardCommon.addCalendar(calendarId); }); it('job creation opens the advanced section', async () => { @@ -294,7 +298,7 @@ export default function({ getService }: FtrProviderContext) { }); it('job cloning persists assigned calendars', async () => { - await ml.jobWizardCommon.assertCalendarsSelection(['wizard-test-calendar']); + await ml.jobWizardCommon.assertCalendarsSelection([calendarId]); }); it('job cloning opens the advanced section', async () => { diff --git a/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_viewer.ts b/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_viewer.ts index 62b801daa3479b..cc7c9828ce87d7 100644 --- a/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_viewer.ts +++ b/x-pack/test/functional/apps/machine_learning/anomaly_detection/single_metric_viewer.ts @@ -29,7 +29,7 @@ const JOB_CONFIG: Job = { const DATAFEED_CONFIG: Datafeed = { datafeed_id: 'datafeed-fq_single_1_smv', - indices: ['farequote'], + indices: ['ft_farequote'], job_id: 'fq_single_1_smv', query: { bool: { must: [{ match_all: {} }] } }, }; @@ -42,13 +42,15 @@ export default function({ getService }: FtrProviderContext) { describe('single metric viewer', function() { this.tags(['smoke', 'mlqa']); before(async () => { - await esArchiver.load('ml/farequote'); + await esArchiver.loadIfNeeded('ml/farequote'); + await ml.testResources.createIndexPatternIfNeeded('ft_farequote', '@timestamp'); + await ml.testResources.setKibanaTimeZoneToUTC(); + await ml.api.createAndRunAnomalyDetectionLookbackJob(JOB_CONFIG, DATAFEED_CONFIG); await ml.securityUI.loginAsMlPowerUser(); }); after(async () => { - await esArchiver.unload('ml/farequote'); await ml.api.cleanMlIndices(); }); diff --git a/x-pack/test/functional/apps/machine_learning/data_frame_analytics/classification_creation.ts b/x-pack/test/functional/apps/machine_learning/data_frame_analytics/classification_creation.ts index a7c92cac2072f8..8a6741bd88daac 100644 --- a/x-pack/test/functional/apps/machine_learning/data_frame_analytics/classification_creation.ts +++ b/x-pack/test/functional/apps/machine_learning/data_frame_analytics/classification_creation.ts @@ -14,13 +14,15 @@ export default function({ getService }: FtrProviderContext) { describe('classification creation', function() { this.tags(['smoke']); before(async () => { - await esArchiver.load('ml/bm_classification'); + await esArchiver.loadIfNeeded('ml/bm_classification'); + await ml.testResources.createIndexPatternIfNeeded('ft_bank_marketing', '@timestamp'); + await ml.testResources.setKibanaTimeZoneToUTC(); + await ml.securityUI.loginAsMlPowerUser(); }); after(async () => { await ml.api.cleanMlIndices(); - await esArchiver.unload('ml/bm_classification'); }); const testDataList = [ @@ -29,8 +31,8 @@ export default function({ getService }: FtrProviderContext) { jobType: 'classification', jobId: `bm_1_${Date.now()}`, jobDescription: - "Classification job based on 'bank-marketing' dataset with dependentVariable 'y' and trainingPercent '20'", - source: 'bank-marketing*', + "Classification job based on 'ft_bank_marketing' dataset with dependentVariable 'y' and trainingPercent '20'", + source: 'ft_bank_marketing', get destinationIndex(): string { return `user-${this.jobId}`; }, @@ -51,6 +53,7 @@ export default function({ getService }: FtrProviderContext) { describe(`${testData.suiteTitle}`, function() { after(async () => { await ml.api.deleteIndices(testData.destinationIndex); + await ml.testResources.deleteIndexPattern(testData.destinationIndex); }); it('loads the data frame analytics page', async () => { diff --git a/x-pack/test/functional/apps/machine_learning/data_frame_analytics/cloning.ts b/x-pack/test/functional/apps/machine_learning/data_frame_analytics/cloning.ts index caf382b532273c..d98d8feaaf4fed 100644 --- a/x-pack/test/functional/apps/machine_learning/data_frame_analytics/cloning.ts +++ b/x-pack/test/functional/apps/machine_learning/data_frame_analytics/cloning.ts @@ -19,6 +19,7 @@ export default function({ getService }: FtrProviderContext) { const testDataList: Array<{ suiteTitle: string; archive: string; + indexPattern: { name: string; timeField: string }; job: DeepPartial; }> = (() => { const timestamp = Date.now(); @@ -27,12 +28,13 @@ export default function({ getService }: FtrProviderContext) { { suiteTitle: 'classification job supported by the form', archive: 'ml/bm_classification', + indexPattern: { name: 'ft_bank_marketing', timeField: '@timestamp' }, job: { id: `bm_1_${timestamp}`, description: - "Classification job based on 'bank-marketing' dataset with dependentVariable 'y' and trainingPercent '20'", + "Classification job based on 'ft_bank_marketing' dataset with dependentVariable 'y' and trainingPercent '20'", source: { - index: ['bank-marketing*'], + index: ['ft_bank_marketing'], query: { match_all: {}, }, @@ -60,11 +62,12 @@ export default function({ getService }: FtrProviderContext) { { suiteTitle: 'outlier detection job supported by the form', archive: 'ml/ihp_outlier', + indexPattern: { name: 'ft_ihp_outlier', timeField: '@timestamp' }, job: { id: `ihp_1_${timestamp}`, description: 'This is the job description', source: { - index: ['ihp_outlier'], + index: ['ft_ihp_outlier'], query: { match_all: {}, }, @@ -88,11 +91,12 @@ export default function({ getService }: FtrProviderContext) { { suiteTitle: 'regression job supported by the form', archive: 'ml/egs_regression', + indexPattern: { name: 'ft_egs_regression', timeField: '@timestamp' }, job: { id: `egs_1_${timestamp}`, description: 'This is the job description', source: { - index: ['egs_regression'], + index: ['ft_egs_regression'], query: { match_all: {}, }, @@ -120,6 +124,7 @@ export default function({ getService }: FtrProviderContext) { })(); before(async () => { + await ml.testResources.setKibanaTimeZoneToUTC(); await ml.securityUI.loginAsMlPowerUser(); }); @@ -133,7 +138,11 @@ export default function({ getService }: FtrProviderContext) { const cloneDestIndex = `${testData.job!.dest!.index}_clone`; before(async () => { - await esArchiver.load(testData.archive); + await esArchiver.loadIfNeeded(testData.archive); + await ml.testResources.createIndexPatternIfNeeded( + testData.indexPattern.name, + testData.indexPattern.timeField + ); await ml.api.createDataFrameAnalyticsJob(testData.job as DataFrameAnalyticsConfig); await ml.navigation.navigateToMl(); @@ -146,7 +155,7 @@ export default function({ getService }: FtrProviderContext) { after(async () => { await ml.api.deleteIndices(cloneDestIndex); await ml.api.deleteIndices(testData.job.dest!.index as string); - await esArchiver.unload(testData.archive); + await ml.testResources.deleteIndexPattern(testData.job.dest!.index as string); }); it('should open the flyout with a proper header', async () => { diff --git a/x-pack/test/functional/apps/machine_learning/data_frame_analytics/outlier_detection_creation.ts b/x-pack/test/functional/apps/machine_learning/data_frame_analytics/outlier_detection_creation.ts index 5481977351d8b8..8dfe058cf6885e 100644 --- a/x-pack/test/functional/apps/machine_learning/data_frame_analytics/outlier_detection_creation.ts +++ b/x-pack/test/functional/apps/machine_learning/data_frame_analytics/outlier_detection_creation.ts @@ -14,13 +14,15 @@ export default function({ getService }: FtrProviderContext) { describe('outlier detection creation', function() { this.tags(['smoke']); before(async () => { - await esArchiver.load('ml/ihp_outlier'); + await esArchiver.loadIfNeeded('ml/ihp_outlier'); + await ml.testResources.createIndexPatternIfNeeded('ft_ihp_outlier', '@timestamp'); + await ml.testResources.setKibanaTimeZoneToUTC(); + await ml.securityUI.loginAsMlPowerUser(); }); after(async () => { await ml.api.cleanMlIndices(); - await esArchiver.unload('ml/ihp_outlier'); }); const testDataList = [ @@ -29,7 +31,7 @@ export default function({ getService }: FtrProviderContext) { jobType: 'outlier_detection', jobId: `ihp_1_${Date.now()}`, jobDescription: 'This is the job description', - source: 'ihp_outlier', + source: 'ft_ihp_outlier', get destinationIndex(): string { return `user-${this.jobId}`; }, @@ -49,6 +51,7 @@ export default function({ getService }: FtrProviderContext) { describe(`${testData.suiteTitle}`, function() { after(async () => { await ml.api.deleteIndices(testData.destinationIndex); + await ml.testResources.deleteIndexPattern(testData.destinationIndex); }); it('loads the data frame analytics page', async () => { diff --git a/x-pack/test/functional/apps/machine_learning/data_frame_analytics/regression_creation.ts b/x-pack/test/functional/apps/machine_learning/data_frame_analytics/regression_creation.ts index aa1a133c81187a..271f3e2018dad8 100644 --- a/x-pack/test/functional/apps/machine_learning/data_frame_analytics/regression_creation.ts +++ b/x-pack/test/functional/apps/machine_learning/data_frame_analytics/regression_creation.ts @@ -14,13 +14,15 @@ export default function({ getService }: FtrProviderContext) { describe('regression creation', function() { this.tags(['smoke']); before(async () => { - await esArchiver.load('ml/egs_regression'); + await esArchiver.loadIfNeeded('ml/egs_regression'); + await ml.testResources.createIndexPatternIfNeeded('ft_egs_regression', '@timestamp'); + await ml.testResources.setKibanaTimeZoneToUTC(); + await ml.securityUI.loginAsMlPowerUser(); }); after(async () => { await ml.api.cleanMlIndices(); - await esArchiver.unload('ml/egs_regression'); }); const testDataList = [ @@ -29,7 +31,7 @@ export default function({ getService }: FtrProviderContext) { jobType: 'regression', jobId: `egs_1_${Date.now()}`, jobDescription: 'This is the job description', - source: 'egs_regression', + source: 'ft_egs_regression', get destinationIndex(): string { return `user-${this.jobId}`; }, @@ -51,6 +53,7 @@ export default function({ getService }: FtrProviderContext) { describe(`${testData.suiteTitle}`, function() { after(async () => { await ml.api.deleteIndices(testData.destinationIndex); + await ml.testResources.deleteIndexPattern(testData.destinationIndex); }); it('loads the data frame analytics page', async () => { diff --git a/x-pack/test/functional/apps/machine_learning/data_visualizer/file_data_visualizer.ts b/x-pack/test/functional/apps/machine_learning/data_visualizer/file_data_visualizer.ts index 94b28e5035edfe..ae958ad7f570fc 100644 --- a/x-pack/test/functional/apps/machine_learning/data_visualizer/file_data_visualizer.ts +++ b/x-pack/test/functional/apps/machine_learning/data_visualizer/file_data_visualizer.ts @@ -36,6 +36,8 @@ export default function({ getService }: FtrProviderContext) { describe('file based', function() { this.tags(['smoke', 'mlqa']); before(async () => { + await ml.testResources.setKibanaTimeZoneToUTC(); + await ml.securityUI.loginAsMlPowerUser(); await ml.navigation.navigateToMl(); }); diff --git a/x-pack/test/functional/apps/machine_learning/data_visualizer/index_data_visualizer.ts b/x-pack/test/functional/apps/machine_learning/data_visualizer/index_data_visualizer.ts index 1ee74368c72fa3..e71b57a4562e77 100644 --- a/x-pack/test/functional/apps/machine_learning/data_visualizer/index_data_visualizer.ts +++ b/x-pack/test/functional/apps/machine_learning/data_visualizer/index_data_visualizer.ts @@ -45,7 +45,7 @@ export default function({ getService }: FtrProviderContext) { const farequoteIndexPatternTestData: TestData = { suiteTitle: 'index pattern', - sourceIndexOrSavedSearch: 'farequote', + sourceIndexOrSavedSearch: 'ft_farequote', advancedJobWizardDatafeedQuery: `{ "bool": { "must": [ @@ -128,7 +128,7 @@ export default function({ getService }: FtrProviderContext) { const farequoteKQLSearchTestData: TestData = { suiteTitle: 'KQL saved search', - sourceIndexOrSavedSearch: 'farequote_kuery', + sourceIndexOrSavedSearch: 'ft_farequote_kuery', advancedJobWizardDatafeedQuery: `{ "bool": { "must": [ @@ -211,7 +211,7 @@ export default function({ getService }: FtrProviderContext) { const farequoteLuceneSearchTestData: TestData = { suiteTitle: 'lucene saved search', - sourceIndexOrSavedSearch: 'farequote_lucene', + sourceIndexOrSavedSearch: 'ft_farequote_lucene', advancedJobWizardDatafeedQuery: `{ "bool": { "must": [ @@ -378,12 +378,13 @@ export default function({ getService }: FtrProviderContext) { describe('index based', function() { this.tags(['smoke', 'mlqa']); before(async () => { - await esArchiver.load('ml/farequote'); - await ml.securityUI.loginAsMlPowerUser(); - }); + await esArchiver.loadIfNeeded('ml/farequote'); + await ml.testResources.createIndexPatternIfNeeded('ft_farequote', '@timestamp'); + await ml.testResources.createSavedSearchFarequoteLuceneIfNeeded(); + await ml.testResources.createSavedSearchFarequoteKueryIfNeeded(); + await ml.testResources.setKibanaTimeZoneToUTC(); - after(async () => { - await esArchiver.unload('ml/farequote'); + await ml.securityUI.loginAsMlPowerUser(); }); // TODO - add tests for diff --git a/x-pack/test/functional/apps/machine_learning/feature_controls/ml_security.ts b/x-pack/test/functional/apps/machine_learning/feature_controls/ml_security.ts index f3731f46a5bcee..ec4b708152a4c1 100644 --- a/x-pack/test/functional/apps/machine_learning/feature_controls/ml_security.ts +++ b/x-pack/test/functional/apps/machine_learning/feature_controls/ml_security.ts @@ -7,15 +7,12 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function({ getPageObjects, getService }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); const security = getService('security'); const appsMenu = getService('appsMenu'); const PageObjects = getPageObjects(['common', 'security']); describe('security', function() { before(async () => { - await esArchiver.load('empty_kibana'); - await security.role.create('global_all_role', { elasticsearch: { indices: [{ names: ['logstash-*'], privileges: ['read', 'view_index_metadata'] }], @@ -33,7 +30,6 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { }); after(async () => { - await esArchiver.unload('empty_kibana'); await security.role.delete('global_all_role'); // logout, so the other tests don't accidentally run as the custom users we're testing below diff --git a/x-pack/test/functional/apps/machine_learning/feature_controls/ml_spaces.ts b/x-pack/test/functional/apps/machine_learning/feature_controls/ml_spaces.ts index fc94688e98811b..828d7bcc0ae2f3 100644 --- a/x-pack/test/functional/apps/machine_learning/feature_controls/ml_spaces.ts +++ b/x-pack/test/functional/apps/machine_learning/feature_controls/ml_spaces.ts @@ -7,21 +7,12 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function({ getPageObjects, getService }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); const spacesService = getService('spaces'); const PageObjects = getPageObjects(['common', 'dashboard', 'security', 'error']); const appsMenu = getService('appsMenu'); const testSubjects = getService('testSubjects'); describe('spaces', () => { - before(async () => { - await esArchiver.load('empty_kibana'); - }); - - after(async () => { - await esArchiver.unload('empty_kibana'); - }); - describe('space with no features disabled', () => { before(async () => { await spacesService.create({ diff --git a/x-pack/test/functional/apps/machine_learning/index.ts b/x-pack/test/functional/apps/machine_learning/index.ts index 47c699e3094916..3e1991120d2d27 100644 --- a/x-pack/test/functional/apps/machine_learning/index.ts +++ b/x-pack/test/functional/apps/machine_learning/index.ts @@ -6,6 +6,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function({ getService, loadTestFile }: FtrProviderContext) { + const esArchiver = getService('esArchiver'); const ml = getService('ml'); describe('machine learning', function() { @@ -19,6 +20,26 @@ export default function({ getService, loadTestFile }: FtrProviderContext) { after(async () => { await ml.securityCommon.cleanMlUsers(); await ml.securityCommon.cleanMlRoles(); + + await ml.testResources.deleteSavedSearches(); + + await ml.testResources.deleteIndexPattern('ft_farequote'); + await ml.testResources.deleteIndexPattern('ft_ecommerce'); + await ml.testResources.deleteIndexPattern('ft_categorization'); + await ml.testResources.deleteIndexPattern('ft_event_rate_gen_trend_nanos'); + await ml.testResources.deleteIndexPattern('ft_bank_marketing'); + await ml.testResources.deleteIndexPattern('ft_ihp_outlier'); + await ml.testResources.deleteIndexPattern('ft_egs_regression'); + + await esArchiver.unload('ml/farequote'); + await esArchiver.unload('ml/ecommerce'); + await esArchiver.unload('ml/categorization'); + await esArchiver.unload('ml/event_rate_nanos'); + await esArchiver.unload('ml/bm_classification'); + await esArchiver.unload('ml/ihp_outlier'); + await esArchiver.unload('ml/egs_regression'); + + await ml.testResources.resetKibanaTimeZone(); }); loadTestFile(require.resolve('./feature_controls')); diff --git a/x-pack/test/functional/apps/machine_learning/pages.ts b/x-pack/test/functional/apps/machine_learning/pages.ts index 78c6ec4f1b2fff..95930f18061fab 100644 --- a/x-pack/test/functional/apps/machine_learning/pages.ts +++ b/x-pack/test/functional/apps/machine_learning/pages.ts @@ -7,20 +7,15 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function({ getService }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); const ml = getService('ml'); describe('page navigation', function() { this.tags(['smoke', 'mlqa']); before(async () => { - await esArchiver.load('empty_kibana'); + await ml.api.cleanMlIndices(); await ml.securityUI.loginAsMlPowerUser(); }); - after(async () => { - await esArchiver.unload('empty_kibana'); - }); - it('loads the home page', async () => { await ml.navigation.navigateToMl(); }); diff --git a/x-pack/test/functional/apps/maps/embeddable/dashboard.js b/x-pack/test/functional/apps/maps/embeddable/dashboard.js index 43d5cccb209058..9027bb5309ff83 100644 --- a/x-pack/test/functional/apps/maps/embeddable/dashboard.js +++ b/x-pack/test/functional/apps/maps/embeddable/dashboard.js @@ -13,6 +13,7 @@ export default function({ getPageObjects, getService }) { const dashboardPanelActions = getService('dashboardPanelActions'); const inspector = getService('inspector'); const testSubjects = getService('testSubjects'); + const browser = getService('browser'); describe('embed in dashboard', () => { before(async () => { @@ -111,5 +112,15 @@ export default function({ getPageObjects, getService }) { const afterRefreshTimerTimestamp = await getRequestTimestamp(); expect(beforeRefreshTimerTimestamp).not.to.equal(afterRefreshTimerTimestamp); }); + + // see https://github.com/elastic/kibana/issues/61596 on why it is specific to maps + it("dashboard's back button should navigate to previous page", async () => { + await PageObjects.common.navigateToApp('dashboard'); + await PageObjects.dashboard.preserveCrossAppState(); + await PageObjects.dashboard.loadSavedDashboard('map embeddable example'); + await PageObjects.dashboard.waitForRenderComplete(); + await browser.goBack(); + expect(await PageObjects.dashboard.onDashboardLandingPage()).to.be(true); + }); }); } diff --git a/x-pack/test/functional/apps/transform/cloning.ts b/x-pack/test/functional/apps/transform/cloning.ts index 5f05fdb093d101..e6e12f60f0bcca 100644 --- a/x-pack/test/functional/apps/transform/cloning.ts +++ b/x-pack/test/functional/apps/transform/cloning.ts @@ -11,7 +11,7 @@ function getTransformConfig(): TransformPivotConfig { const date = Date.now(); return { id: `ec_2_${date}`, - source: { index: ['ecommerce'] }, + source: { index: ['ft_ecommerce'] }, pivot: { group_by: { category: { terms: { field: 'category.keyword' } } }, aggregations: { 'products.base_price.avg': { avg: { field: 'products.base_price' } } }, @@ -31,13 +31,16 @@ export default function({ getService }: FtrProviderContext) { const transformConfig = getTransformConfig(); before(async () => { - await esArchiver.load('ml/ecommerce'); + await esArchiver.loadIfNeeded('ml/ecommerce'); + await transform.testResources.createIndexPatternIfNeeded('ft_ecommerce', 'order_date'); await transform.api.createAndRunTransform(transformConfig); + await transform.testResources.setKibanaTimeZoneToUTC(); + await transform.securityUI.loginAsTransformPowerUser(); }); after(async () => { - await esArchiver.unload('ml/ecommerce'); + await transform.testResources.deleteIndexPattern(transformConfig.dest.index); await transform.api.deleteIndices(transformConfig.dest.index); await transform.api.cleanTransformIndices(); }); diff --git a/x-pack/test/functional/apps/transform/creation_index_pattern.ts b/x-pack/test/functional/apps/transform/creation_index_pattern.ts index f3cc4ab8d76011..bea6b814ee8a3a 100644 --- a/x-pack/test/functional/apps/transform/creation_index_pattern.ts +++ b/x-pack/test/functional/apps/transform/creation_index_pattern.ts @@ -20,19 +20,21 @@ export default function({ getService }: FtrProviderContext) { describe('creation_index_pattern', function() { this.tags(['smoke']); before(async () => { - await esArchiver.load('ml/ecommerce'); + await esArchiver.loadIfNeeded('ml/ecommerce'); + await transform.testResources.createIndexPatternIfNeeded('ft_ecommerce', 'order_date'); + await transform.testResources.setKibanaTimeZoneToUTC(); + await transform.securityUI.loginAsTransformPowerUser(); }); after(async () => { - await esArchiver.unload('ml/ecommerce'); await transform.api.cleanTransformIndices(); }); const testDataList = [ { suiteTitle: 'batch transform with terms+date_histogram groups and avg agg', - source: 'ecommerce', + source: 'ft_ecommerce', groupByEntries: [ { identifier: 'terms(category.keyword)', @@ -96,7 +98,7 @@ export default function({ getService }: FtrProviderContext) { }, { suiteTitle: 'batch transform with terms group and percentiles agg', - source: 'ecommerce', + source: 'ft_ecommerce', groupByEntries: [ { identifier: 'terms(geoip.country_iso_code)', @@ -154,6 +156,7 @@ export default function({ getService }: FtrProviderContext) { describe(`${testData.suiteTitle}`, function() { after(async () => { await transform.api.deleteIndices(testData.destinationIndex); + await transform.testResources.deleteIndexPattern(testData.destinationIndex); }); it('loads the home page', async () => { diff --git a/x-pack/test/functional/apps/transform/creation_saved_search.ts b/x-pack/test/functional/apps/transform/creation_saved_search.ts index bf501c65bc79b4..993bd3a79abbc1 100644 --- a/x-pack/test/functional/apps/transform/creation_saved_search.ts +++ b/x-pack/test/functional/apps/transform/creation_saved_search.ts @@ -20,19 +20,22 @@ export default function({ getService }: FtrProviderContext) { describe('creation_saved_search', function() { this.tags(['smoke']); before(async () => { - await esArchiver.load('ml/farequote'); + await esArchiver.loadIfNeeded('ml/farequote'); + await transform.testResources.createIndexPatternIfNeeded('ft_farequote', '@timestamp'); + await transform.testResources.createSavedSearchFarequoteFilterIfNeeded(); + await transform.testResources.setKibanaTimeZoneToUTC(); + await transform.securityUI.loginAsTransformPowerUser(); }); after(async () => { - await esArchiver.unload('ml/farequote'); await transform.api.cleanTransformIndices(); }); const testDataList = [ { suiteTitle: 'batch transform with terms groups and avg agg with saved search filter', - source: 'farequote_filter', + source: 'ft_farequote_filter', groupByEntries: [ { identifier: 'terms(airline)', @@ -61,7 +64,7 @@ export default function({ getService }: FtrProviderContext) { mode: 'batch', progress: '100', }, - sourceIndex: 'farequote', + sourceIndex: 'ft_farequote', sourcePreview: { column: 2, values: ['ASA'], @@ -74,6 +77,7 @@ export default function({ getService }: FtrProviderContext) { describe(`${testData.suiteTitle}`, function() { after(async () => { await transform.api.deleteIndices(testData.destinationIndex); + await transform.testResources.deleteIndexPattern(testData.destinationIndex); }); it('loads the home page', async () => { diff --git a/x-pack/test/functional/apps/transform/index.ts b/x-pack/test/functional/apps/transform/index.ts index 60b72f122f1131..bf720ce85d8242 100644 --- a/x-pack/test/functional/apps/transform/index.ts +++ b/x-pack/test/functional/apps/transform/index.ts @@ -6,6 +6,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function({ getService, loadTestFile }: FtrProviderContext) { + const esArchiver = getService('esArchiver'); const transform = getService('transform'); describe('transform', function() { @@ -19,6 +20,16 @@ export default function({ getService, loadTestFile }: FtrProviderContext) { after(async () => { await transform.securityCommon.cleanTransformUsers(); await transform.securityCommon.cleanTransformRoles(); + + await transform.testResources.deleteSavedSearches(); + + await transform.testResources.deleteIndexPattern('ft_farequote'); + await transform.testResources.deleteIndexPattern('ft_ecommerce'); + + await esArchiver.unload('ml/farequote'); + await esArchiver.unload('ml/ecommerce'); + + await transform.testResources.resetKibanaTimeZone(); }); loadTestFile(require.resolve('./creation_index_pattern')); diff --git a/x-pack/test/functional/apps/uptime/locations.ts b/x-pack/test/functional/apps/uptime/locations.ts index bbf50344f34934..e266594e6a762d 100644 --- a/x-pack/test/functional/apps/uptime/locations.ts +++ b/x-pack/test/functional/apps/uptime/locations.ts @@ -5,7 +5,7 @@ */ import moment from 'moment'; -import { makeChecksWithStatus } from '../../../api_integration/apis/uptime/graphql/helpers/make_checks'; +import { makeChecksWithStatus } from '../../../api_integration/apis/uptime/rest/helper/make_checks'; import { FtrProviderContext } from '../../ftr_provider_context'; export default ({ getPageObjects, getService }: FtrProviderContext) => { diff --git a/x-pack/test/functional/apps/uptime/settings.ts b/x-pack/test/functional/apps/uptime/settings.ts index 64cfee50ac9825..e81bbc5ae42f92 100644 --- a/x-pack/test/functional/apps/uptime/settings.ts +++ b/x-pack/test/functional/apps/uptime/settings.ts @@ -10,7 +10,7 @@ import { defaultDynamicSettings, DynamicSettings, } from '../../../../legacy/plugins/uptime/common/runtime_types'; -import { makeChecks } from '../../../api_integration/apis/uptime/graphql/helpers/make_checks'; +import { makeChecks } from '../../../api_integration/apis/uptime/rest/helper/make_checks'; export default ({ getPageObjects, getService }: FtrProviderContext) => { const { uptime: uptimePage } = getPageObjects(['uptime']); diff --git a/x-pack/test/functional/es_archives/ml/bm_classification/data.json.gz b/x-pack/test/functional/es_archives/ml/bm_classification/data.json.gz index 12ccf6ae605124..8c0dc38d3dedbf 100644 Binary files a/x-pack/test/functional/es_archives/ml/bm_classification/data.json.gz and b/x-pack/test/functional/es_archives/ml/bm_classification/data.json.gz differ diff --git a/x-pack/test/functional/es_archives/ml/bm_classification/mappings.json b/x-pack/test/functional/es_archives/ml/bm_classification/mappings.json index 9d2cca22bf3006..380a0d8fa4d159 100644 --- a/x-pack/test/functional/es_archives/ml/bm_classification/mappings.json +++ b/x-pack/test/functional/es_archives/ml/bm_classification/mappings.json @@ -3,7 +3,7 @@ "value": { "aliases": { }, - "index": "bank-marketing", + "index": "ft_bank_marketing", "mappings": { "properties": { "age": { @@ -94,1455 +94,3 @@ } } } - -{ - "type": "index", - "value": { - "aliases": { - ".kibana": { - } - }, - "index": ".kibana_1", - "mappings": { - "_meta": { - "migrationMappingPropertyHashes": { - "action": "c0c235fba02ebd2a2412bcda79009b58", - "action_task_params": "a9d49f184ee89641044be0ca2950fa3a", - "alert": "e588043a01d3d43477e7cad7efa0f5d8", - "apm-indices": "9bb9b2bf1fa636ed8619cbab5ce6a1dd", - "apm-services-telemetry": "07ee1939fa4302c62ddc052ec03fed90", - "canvas-element": "7390014e1091044523666d97247392fc", - "canvas-workpad": "b0a1706d356228dbdcb4a17e6b9eb231", - "config": "87aca8fdb053154f11383fce3dbf3edf", - "dashboard": "d00f614b29a80360e1190193fd333bab", - "file-upload-telemetry": "0ed4d3e1983d1217a30982630897092e", - "graph-workspace": "cd7ba1330e6682e9cc00b78850874be1", - "index-pattern": "66eccb05066c5a89924f48a9e9736499", - "infrastructure-ui-source": "ddc0ecb18383f6b26101a2fadb2dab0c", - "inventory-view": "84b320fd67209906333ffce261128462", - "kql-telemetry": "d12a98a6f19a2d273696597547e064ee", - "lens": "21c3ea0763beb1ecb0162529706b88c5", - "lens-ui-telemetry": "509bfa5978586998e05f9e303c07a327", - "map": "23d7aa4a720d4938ccde3983f87bd58d", - "maps-telemetry": "268da3a48066123fc5baf35abaa55014", - "metrics-explorer-view": "53c5365793677328df0ccb6138bf3cdd", - "migrationVersion": "4a1746014a75ade3a714e1db5763276f", - "ml-telemetry": "257fd1d4b4fdbb9cb4b8a3b27da201e9", - "namespace": "2f4316de49999235636386fe51dc06c1", - "query": "11aaeb7f5f7fa5bb43f25e18ce26e7d9", - "references": "7997cf5a56cc02bdc9c93361bde732b0", - "sample-data-telemetry": "7d3cfeb915303c9641c59681967ffeb4", - "search": "181661168bbadd1eff5902361e2a0d5c", - "server": "ec97f1c5da1a19609a60874e5af1100c", - "siem-detection-engine-rule-status": "0367e4d775814b56a4bee29384f9aafe", - "siem-ui-timeline": "ac8020190f5950dd3250b6499144e7fb", - "siem-ui-timeline-note": "8874706eedc49059d4cf0f5094559084", - "siem-ui-timeline-pinned-event": "20638091112f0e14f0e443d512301c29", - "space": "c5ca8acafa0beaa4d08d014a97b6bc6b", - "telemetry": "358ffaa88ba34a97d55af0933a117de4", - "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", - "tsvb-validation-telemetry": "3a37ef6c8700ae6fc97d5c7da00e9215", - "type": "2f4316de49999235636386fe51dc06c1", - "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", - "updated_at": "00da57df13e94e9d98437d13ace4bfe0", - "upgrade-assistant-reindex-operation": "a53a20fe086b72c9a86da3cc12dad8a6", - "upgrade-assistant-telemetry": "56702cec857e0a9dacfb696655b4ff7b", - "url": "c7f66a0df8b1b52f17c28c4adb111105", - "visualization": "52d7a13ad68a150c4525b292d23e12cc" - } - }, - "dynamic": "strict", - "properties": { - "action": { - "properties": { - "actionTypeId": { - "type": "keyword" - }, - "config": { - "enabled": false, - "type": "object" - }, - "name": { - "type": "text" - }, - "secrets": { - "type": "binary" - } - } - }, - "action_task_params": { - "properties": { - "actionId": { - "type": "keyword" - }, - "apiKey": { - "type": "binary" - }, - "params": { - "enabled": false, - "type": "object" - } - } - }, - "alert": { - "properties": { - "actions": { - "properties": { - "actionRef": { - "type": "keyword" - }, - "actionTypeId": { - "type": "keyword" - }, - "group": { - "type": "keyword" - }, - "params": { - "enabled": false, - "type": "object" - } - }, - "type": "nested" - }, - "alertTypeId": { - "type": "keyword" - }, - "apiKey": { - "type": "binary" - }, - "apiKeyOwner": { - "type": "keyword" - }, - "consumer": { - "type": "keyword" - }, - "createdAt": { - "type": "date" - }, - "createdBy": { - "type": "keyword" - }, - "enabled": { - "type": "boolean" - }, - "muteAll": { - "type": "boolean" - }, - "mutedInstanceIds": { - "type": "keyword" - }, - "name": { - "type": "text" - }, - "params": { - "enabled": false, - "type": "object" - }, - "schedule": { - "properties": { - "interval": { - "type": "keyword" - } - } - }, - "scheduledTaskId": { - "type": "keyword" - }, - "tags": { - "type": "keyword" - }, - "throttle": { - "type": "keyword" - }, - "updatedBy": { - "type": "keyword" - } - } - }, - "apm-indices": { - "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } - } - } - }, - "apm-services-telemetry": { - "properties": { - "has_any_services": { - "type": "boolean" - }, - "services_per_agent": { - "properties": { - "dotnet": { - "null_value": 0, - "type": "long" - }, - "go": { - "null_value": 0, - "type": "long" - }, - "java": { - "null_value": 0, - "type": "long" - }, - "js-base": { - "null_value": 0, - "type": "long" - }, - "nodejs": { - "null_value": 0, - "type": "long" - }, - "python": { - "null_value": 0, - "type": "long" - }, - "ruby": { - "null_value": 0, - "type": "long" - }, - "rum-js": { - "null_value": 0, - "type": "long" - } - } - } - } - }, - "canvas-element": { - "dynamic": "false", - "properties": { - "@created": { - "type": "date" - }, - "@timestamp": { - "type": "date" - }, - "content": { - "type": "text" - }, - "help": { - "type": "text" - }, - "image": { - "type": "text" - }, - "name": { - "fields": { - "keyword": { - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "canvas-workpad": { - "dynamic": "false", - "properties": { - "@created": { - "type": "date" - }, - "@timestamp": { - "type": "date" - }, - "name": { - "fields": { - "keyword": { - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - }, - "dateFormat:tz": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "defaultIndex": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "dashboard": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } - } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "file-upload-telemetry": { - "properties": { - "filesUploadedTotalCount": { - "type": "long" - } - } - }, - "graph-workspace": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "numLinks": { - "type": "integer" - }, - "numVertices": { - "type": "integer" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "wsState": { - "type": "text" - } - } - }, - "index-pattern": { - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "type": { - "type": "keyword" - }, - "typeMeta": { - "type": "keyword" - } - } - }, - "infrastructure-ui-source": { - "properties": { - "description": { - "type": "text" - }, - "fields": { - "properties": { - "container": { - "type": "keyword" - }, - "host": { - "type": "keyword" - }, - "pod": { - "type": "keyword" - }, - "tiebreaker": { - "type": "keyword" - }, - "timestamp": { - "type": "keyword" - } - } - }, - "logAlias": { - "type": "keyword" - }, - "logColumns": { - "properties": { - "fieldColumn": { - "properties": { - "field": { - "type": "keyword" - }, - "id": { - "type": "keyword" - } - } - }, - "messageColumn": { - "properties": { - "id": { - "type": "keyword" - } - } - }, - "timestampColumn": { - "properties": { - "id": { - "type": "keyword" - } - } - } - }, - "type": "nested" - }, - "metricAlias": { - "type": "keyword" - }, - "name": { - "type": "text" - } - } - }, - "inventory-view": { - "properties": { - "autoBounds": { - "type": "boolean" - }, - "autoReload": { - "type": "boolean" - }, - "boundsOverride": { - "properties": { - "max": { - "type": "integer" - }, - "min": { - "type": "integer" - } - } - }, - "customOptions": { - "properties": { - "field": { - "type": "keyword" - }, - "text": { - "type": "keyword" - } - }, - "type": "nested" - }, - "filterQuery": { - "properties": { - "expression": { - "type": "keyword" - }, - "kind": { - "type": "keyword" - } - } - }, - "groupBy": { - "properties": { - "field": { - "type": "keyword" - }, - "label": { - "type": "keyword" - } - }, - "type": "nested" - }, - "metric": { - "properties": { - "type": { - "type": "keyword" - } - } - }, - "name": { - "type": "keyword" - }, - "nodeType": { - "type": "keyword" - }, - "time": { - "type": "integer" - }, - "view": { - "type": "keyword" - } - } - }, - "kql-telemetry": { - "properties": { - "optInCount": { - "type": "long" - }, - "optOutCount": { - "type": "long" - } - } - }, - "lens": { - "properties": { - "expression": { - "index": false, - "type": "keyword" - }, - "state": { - "type": "flattened" - }, - "title": { - "type": "text" - }, - "visualizationType": { - "type": "keyword" - } - } - }, - "lens-ui-telemetry": { - "properties": { - "count": { - "type": "integer" - }, - "date": { - "type": "date" - }, - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - } - } - }, - "map": { - "properties": { - "bounds": { - "type": "geo_shape" - }, - "description": { - "type": "text" - }, - "layerListJSON": { - "type": "text" - }, - "mapStateJSON": { - "type": "text" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "maps-telemetry": { - "properties": { - "attributesPerMap": { - "properties": { - "dataSourcesCount": { - "properties": { - "avg": { - "type": "long" - }, - "max": { - "type": "long" - }, - "min": { - "type": "long" - } - } - }, - "emsVectorLayersCount": { - "dynamic": "true", - "type": "object" - }, - "layerTypesCount": { - "dynamic": "true", - "type": "object" - }, - "layersCount": { - "properties": { - "avg": { - "type": "long" - }, - "max": { - "type": "long" - }, - "min": { - "type": "long" - } - } - } - } - }, - "indexPatternsWithGeoFieldCount": { - "type": "long" - }, - "mapsTotalCount": { - "type": "long" - }, - "settings": { - "properties": { - "showMapVisualizationTypes": { - "type": "boolean" - } - } - }, - "timeCaptured": { - "type": "date" - } - } - }, - "metrics-explorer-view": { - "properties": { - "chartOptions": { - "properties": { - "stack": { - "type": "boolean" - }, - "type": { - "type": "keyword" - }, - "yAxisMode": { - "type": "keyword" - } - } - }, - "currentTimerange": { - "properties": { - "from": { - "type": "keyword" - }, - "interval": { - "type": "keyword" - }, - "to": { - "type": "keyword" - } - } - }, - "name": { - "type": "keyword" - }, - "options": { - "properties": { - "aggregation": { - "type": "keyword" - }, - "filterQuery": { - "type": "keyword" - }, - "groupBy": { - "type": "keyword" - }, - "limit": { - "type": "integer" - }, - "metrics": { - "properties": { - "aggregation": { - "type": "keyword" - }, - "color": { - "type": "keyword" - }, - "field": { - "type": "keyword" - }, - "label": { - "type": "keyword" - } - }, - "type": "nested" - } - } - } - } - }, - "migrationVersion": { - "dynamic": "true", - "properties": { - "index-pattern": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "space": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "ml-telemetry": { - "properties": { - "file_data_visualizer": { - "properties": { - "index_creation_count": { - "type": "long" - } - } - } - } - }, - "namespace": { - "type": "keyword" - }, - "query": { - "properties": { - "description": { - "type": "text" - }, - "filters": { - "enabled": false, - "type": "object" - }, - "query": { - "properties": { - "language": { - "type": "keyword" - }, - "query": { - "index": false, - "type": "keyword" - } - } - }, - "timefilter": { - "enabled": false, - "type": "object" - }, - "title": { - "type": "text" - } - } - }, - "references": { - "properties": { - "id": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - } - }, - "type": "nested" - }, - "sample-data-telemetry": { - "properties": { - "installCount": { - "type": "long" - }, - "unInstallCount": { - "type": "long" - } - } - }, - "search": { - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "server": { - "properties": { - "uuid": { - "type": "keyword" - } - } - }, - "siem-detection-engine-rule-status": { - "properties": { - "alertId": { - "type": "keyword" - }, - "lastFailureAt": { - "type": "date" - }, - "lastFailureMessage": { - "type": "text" - }, - "lastSuccessAt": { - "type": "date" - }, - "lastSuccessMessage": { - "type": "text" - }, - "status": { - "type": "keyword" - }, - "statusDate": { - "type": "date" - } - } - }, - "siem-ui-timeline": { - "properties": { - "columns": { - "properties": { - "aggregatable": { - "type": "boolean" - }, - "category": { - "type": "keyword" - }, - "columnHeaderType": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "example": { - "type": "text" - }, - "id": { - "type": "keyword" - }, - "indexes": { - "type": "keyword" - }, - "name": { - "type": "text" - }, - "placeholder": { - "type": "text" - }, - "searchable": { - "type": "boolean" - }, - "type": { - "type": "keyword" - } - } - }, - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "dataProviders": { - "properties": { - "and": { - "properties": { - "enabled": { - "type": "boolean" - }, - "excluded": { - "type": "boolean" - }, - "id": { - "type": "keyword" - }, - "kqlQuery": { - "type": "text" - }, - "name": { - "type": "text" - }, - "queryMatch": { - "properties": { - "displayField": { - "type": "text" - }, - "displayValue": { - "type": "text" - }, - "field": { - "type": "text" - }, - "operator": { - "type": "text" - }, - "value": { - "type": "text" - } - } - } - } - }, - "enabled": { - "type": "boolean" - }, - "excluded": { - "type": "boolean" - }, - "id": { - "type": "keyword" - }, - "kqlQuery": { - "type": "text" - }, - "name": { - "type": "text" - }, - "queryMatch": { - "properties": { - "displayField": { - "type": "text" - }, - "displayValue": { - "type": "text" - }, - "field": { - "type": "text" - }, - "operator": { - "type": "text" - }, - "value": { - "type": "text" - } - } - } - } - }, - "dateRange": { - "properties": { - "end": { - "type": "date" - }, - "start": { - "type": "date" - } - } - }, - "description": { - "type": "text" - }, - "eventType": { - "type": "keyword" - }, - "favorite": { - "properties": { - "favoriteDate": { - "type": "date" - }, - "fullName": { - "type": "text" - }, - "keySearch": { - "type": "text" - }, - "userName": { - "type": "text" - } - } - }, - "filters": { - "properties": { - "exists": { - "type": "text" - }, - "match_all": { - "type": "text" - }, - "meta": { - "properties": { - "alias": { - "type": "text" - }, - "controlledBy": { - "type": "text" - }, - "disabled": { - "type": "boolean" - }, - "field": { - "type": "text" - }, - "formattedValue": { - "type": "text" - }, - "index": { - "type": "keyword" - }, - "key": { - "type": "keyword" - }, - "negate": { - "type": "boolean" - }, - "params": { - "type": "text" - }, - "type": { - "type": "keyword" - }, - "value": { - "type": "text" - } - } - }, - "missing": { - "type": "text" - }, - "query": { - "type": "text" - }, - "range": { - "type": "text" - }, - "script": { - "type": "text" - } - } - }, - "kqlMode": { - "type": "keyword" - }, - "kqlQuery": { - "properties": { - "filterQuery": { - "properties": { - "kuery": { - "properties": { - "expression": { - "type": "text" - }, - "kind": { - "type": "keyword" - } - } - }, - "serializedQuery": { - "type": "text" - } - } - } - } - }, - "savedQueryId": { - "type": "keyword" - }, - "sort": { - "properties": { - "columnId": { - "type": "keyword" - }, - "sortDirection": { - "type": "keyword" - } - } - }, - "title": { - "type": "text" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "siem-ui-timeline-note": { - "properties": { - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "eventId": { - "type": "keyword" - }, - "note": { - "type": "text" - }, - "timelineId": { - "type": "keyword" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "siem-ui-timeline-pinned-event": { - "properties": { - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "eventId": { - "type": "keyword" - }, - "timelineId": { - "type": "keyword" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "space": { - "properties": { - "_reserved": { - "type": "boolean" - }, - "color": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "disabledFeatures": { - "type": "keyword" - }, - "imageUrl": { - "index": false, - "type": "text" - }, - "initials": { - "type": "keyword" - }, - "name": { - "fields": { - "keyword": { - "ignore_above": 2048, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "telemetry": { - "properties": { - "enabled": { - "type": "boolean" - }, - "lastReported": { - "type": "date" - }, - "lastVersionChecked": { - "ignore_above": 256, - "type": "keyword" - }, - "sendUsageFrom": { - "ignore_above": 256, - "type": "keyword" - }, - "userHasSeenNotice": { - "type": "boolean" - } - } - }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "tsvb-validation-telemetry": { - "properties": { - "failedRequests": { - "type": "long" - } - } - }, - "type": { - "type": "keyword" - }, - "ui-metric": { - "properties": { - "count": { - "type": "integer" - } - } - }, - "updated_at": { - "type": "date" - }, - "upgrade-assistant-reindex-operation": { - "dynamic": "true", - "properties": { - "indexName": { - "type": "keyword" - }, - "status": { - "type": "integer" - } - } - }, - "upgrade-assistant-telemetry": { - "properties": { - "features": { - "properties": { - "deprecation_logging": { - "properties": { - "enabled": { - "null_value": true, - "type": "boolean" - } - } - } - } - }, - "ui_open": { - "properties": { - "cluster": { - "null_value": 0, - "type": "long" - }, - "indices": { - "null_value": 0, - "type": "long" - }, - "overview": { - "null_value": 0, - "type": "long" - } - } - }, - "ui_reindex": { - "properties": { - "close": { - "null_value": 0, - "type": "long" - }, - "open": { - "null_value": 0, - "type": "long" - }, - "start": { - "null_value": 0, - "type": "long" - }, - "stop": { - "null_value": 0, - "type": "long" - } - } - } - } - }, - "url": { - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "fields": { - "keyword": { - "ignore_above": 2048, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "visualization": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "savedSearchRefName": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" - } - } - } - } - }, - "settings": { - "index": { - "auto_expand_replicas": "0-1", - "number_of_replicas": "0", - "number_of_shards": "1" - } - } - } -} \ No newline at end of file diff --git a/x-pack/test/functional/es_archives/ml/categorization/data.json.gz b/x-pack/test/functional/es_archives/ml/categorization/data.json.gz index a66b68d8159437..30b25cf944db8c 100644 Binary files a/x-pack/test/functional/es_archives/ml/categorization/data.json.gz and b/x-pack/test/functional/es_archives/ml/categorization/data.json.gz differ diff --git a/x-pack/test/functional/es_archives/ml/categorization/mappings.json b/x-pack/test/functional/es_archives/ml/categorization/mappings.json index 5c97427b6fb0a6..56280dbdf0d574 100644 --- a/x-pack/test/functional/es_archives/ml/categorization/mappings.json +++ b/x-pack/test/functional/es_archives/ml/categorization/mappings.json @@ -2,7 +2,7 @@ "type": "index", "value": { "aliases": {}, - "index": "categorization_functional_test", + "index": "ft_categorization", "mappings": { "properties": { "@timestamp": { @@ -39,835 +39,3 @@ } } } - -{ - "type": "index", - "value": { - "aliases": { - ".kibana": {} - }, - "index": ".kibana_1", - "mappings": { - "_meta": { - "migrationMappingPropertyHashes": { - "action": "c0c235fba02ebd2a2412bcda79009b58", - "action_task_params": "a9d49f184ee89641044be0ca2950fa3a", - "alert": "e588043a01d3d43477e7cad7efa0f5d8", - "apm-indices": "9bb9b2bf1fa636ed8619cbab5ce6a1dd", - "apm-services-telemetry": "07ee1939fa4302c62ddc052ec03fed90", - "config": "87aca8fdb053154f11383fce3dbf3edf", - "dashboard": "d00f614b29a80360e1190193fd333bab", - "file-upload-telemetry": "0ed4d3e1983d1217a30982630897092e", - "index-pattern": "66eccb05066c5a89924f48a9e9736499", - "kql-telemetry": "d12a98a6f19a2d273696597547e064ee", - "lens": "21c3ea0763beb1ecb0162529706b88c5", - "lens-ui-telemetry": "509bfa5978586998e05f9e303c07a327", - "map": "23d7aa4a720d4938ccde3983f87bd58d", - "maps-telemetry": "268da3a48066123fc5baf35abaa55014", - "migrationVersion": "4a1746014a75ade3a714e1db5763276f", - "ml-telemetry": "257fd1d4b4fdbb9cb4b8a3b27da201e9", - "namespace": "2f4316de49999235636386fe51dc06c1", - "query": "11aaeb7f5f7fa5bb43f25e18ce26e7d9", - "references": "7997cf5a56cc02bdc9c93361bde732b0", - "sample-data-telemetry": "7d3cfeb915303c9641c59681967ffeb4", - "search": "181661168bbadd1eff5902361e2a0d5c", - "server": "ec97f1c5da1a19609a60874e5af1100c", - "space": "c5ca8acafa0beaa4d08d014a97b6bc6b", - "telemetry": "358ffaa88ba34a97d55af0933a117de4", - "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", - "tsvb-validation-telemetry": "3a37ef6c8700ae6fc97d5c7da00e9215", - "type": "2f4316de49999235636386fe51dc06c1", - "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", - "updated_at": "00da57df13e94e9d98437d13ace4bfe0", - "upgrade-assistant-reindex-operation": "a53a20fe086b72c9a86da3cc12dad8a6", - "upgrade-assistant-telemetry": "56702cec857e0a9dacfb696655b4ff7b", - "url": "c7f66a0df8b1b52f17c28c4adb111105", - "visualization": "52d7a13ad68a150c4525b292d23e12cc" - } - }, - "dynamic": "strict", - "properties": { - "action": { - "properties": { - "actionTypeId": { - "type": "keyword" - }, - "config": { - "enabled": false, - "type": "object" - }, - "name": { - "type": "text" - }, - "secrets": { - "type": "binary" - } - } - }, - "action_task_params": { - "properties": { - "actionId": { - "type": "keyword" - }, - "apiKey": { - "type": "binary" - }, - "params": { - "enabled": false, - "type": "object" - } - } - }, - "alert": { - "properties": { - "actions": { - "properties": { - "actionRef": { - "type": "keyword" - }, - "actionTypeId": { - "type": "keyword" - }, - "group": { - "type": "keyword" - }, - "params": { - "enabled": false, - "type": "object" - } - }, - "type": "nested" - }, - "alertTypeId": { - "type": "keyword" - }, - "apiKey": { - "type": "binary" - }, - "apiKeyOwner": { - "type": "keyword" - }, - "consumer": { - "type": "keyword" - }, - "createdAt": { - "type": "date" - }, - "createdBy": { - "type": "keyword" - }, - "enabled": { - "type": "boolean" - }, - "muteAll": { - "type": "boolean" - }, - "mutedInstanceIds": { - "type": "keyword" - }, - "name": { - "type": "text" - }, - "params": { - "enabled": false, - "type": "object" - }, - "schedule": { - "properties": { - "interval": { - "type": "keyword" - } - } - }, - "scheduledTaskId": { - "type": "keyword" - }, - "tags": { - "type": "keyword" - }, - "throttle": { - "type": "keyword" - }, - "updatedBy": { - "type": "keyword" - } - } - }, - "apm-indices": { - "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } - } - } - }, - "apm-services-telemetry": { - "properties": { - "has_any_services": { - "type": "boolean" - }, - "services_per_agent": { - "properties": { - "dotnet": { - "null_value": 0, - "type": "long" - }, - "go": { - "null_value": 0, - "type": "long" - }, - "java": { - "null_value": 0, - "type": "long" - }, - "js-base": { - "null_value": 0, - "type": "long" - }, - "nodejs": { - "null_value": 0, - "type": "long" - }, - "python": { - "null_value": 0, - "type": "long" - }, - "ruby": { - "null_value": 0, - "type": "long" - }, - "rum-js": { - "null_value": 0, - "type": "long" - } - } - } - } - }, - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - }, - "dateFormat:tz": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "defaultIndex": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "dashboard": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } - } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "file-upload-telemetry": { - "properties": { - "filesUploadedTotalCount": { - "type": "long" - } - } - }, - "index-pattern": { - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "type": { - "type": "keyword" - }, - "typeMeta": { - "type": "keyword" - } - } - }, - "kql-telemetry": { - "properties": { - "optInCount": { - "type": "long" - }, - "optOutCount": { - "type": "long" - } - } - }, - "lens": { - "properties": { - "expression": { - "index": false, - "type": "keyword" - }, - "state": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "visualizationType": { - "type": "keyword" - } - } - }, - "lens-ui-telemetry": { - "properties": { - "count": { - "type": "integer" - }, - "date": { - "type": "date" - }, - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - } - } - }, - "map": { - "properties": { - "bounds": { - "type": "geo_shape" - }, - "description": { - "type": "text" - }, - "layerListJSON": { - "type": "text" - }, - "mapStateJSON": { - "type": "text" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "maps-telemetry": { - "properties": { - "attributesPerMap": { - "properties": { - "dataSourcesCount": { - "properties": { - "avg": { - "type": "long" - }, - "max": { - "type": "long" - }, - "min": { - "type": "long" - } - } - }, - "emsVectorLayersCount": { - "dynamic": "true", - "type": "object" - }, - "layerTypesCount": { - "dynamic": "true", - "type": "object" - }, - "layersCount": { - "properties": { - "avg": { - "type": "long" - }, - "max": { - "type": "long" - }, - "min": { - "type": "long" - } - } - } - } - }, - "indexPatternsWithGeoFieldCount": { - "type": "long" - }, - "mapsTotalCount": { - "type": "long" - }, - "settings": { - "properties": { - "showMapVisualizationTypes": { - "type": "boolean" - } - } - }, - "timeCaptured": { - "type": "date" - } - } - }, - "migrationVersion": { - "dynamic": "true", - "properties": { - "index-pattern": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "space": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "ml-telemetry": { - "properties": { - "file_data_visualizer": { - "properties": { - "index_creation_count": { - "type": "long" - } - } - } - } - }, - "namespace": { - "type": "keyword" - }, - "query": { - "properties": { - "description": { - "type": "text" - }, - "filters": { - "enabled": false, - "type": "object" - }, - "query": { - "properties": { - "language": { - "type": "keyword" - }, - "query": { - "index": false, - "type": "keyword" - } - } - }, - "timefilter": { - "enabled": false, - "type": "object" - }, - "title": { - "type": "text" - } - } - }, - "references": { - "properties": { - "id": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - } - }, - "type": "nested" - }, - "sample-data-telemetry": { - "properties": { - "installCount": { - "type": "long" - }, - "unInstallCount": { - "type": "long" - } - } - }, - "search": { - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "server": { - "properties": { - "uuid": { - "type": "keyword" - } - } - }, - "space": { - "properties": { - "_reserved": { - "type": "boolean" - }, - "color": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "disabledFeatures": { - "type": "keyword" - }, - "imageUrl": { - "index": false, - "type": "text" - }, - "initials": { - "type": "keyword" - }, - "name": { - "fields": { - "keyword": { - "ignore_above": 2048, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "telemetry": { - "properties": { - "enabled": { - "type": "boolean" - }, - "lastReported": { - "type": "date" - }, - "lastVersionChecked": { - "ignore_above": 256, - "type": "keyword" - }, - "sendUsageFrom": { - "ignore_above": 256, - "type": "keyword" - }, - "userHasSeenNotice": { - "type": "boolean" - } - } - }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "tsvb-validation-telemetry": { - "properties": { - "failedRequests": { - "type": "long" - } - } - }, - "type": { - "type": "keyword" - }, - "ui-metric": { - "properties": { - "count": { - "type": "integer" - } - } - }, - "updated_at": { - "type": "date" - }, - "upgrade-assistant-reindex-operation": { - "dynamic": "true", - "properties": { - "indexName": { - "type": "keyword" - }, - "status": { - "type": "integer" - } - } - }, - "upgrade-assistant-telemetry": { - "properties": { - "features": { - "properties": { - "deprecation_logging": { - "properties": { - "enabled": { - "null_value": true, - "type": "boolean" - } - } - } - } - }, - "ui_open": { - "properties": { - "cluster": { - "null_value": 0, - "type": "long" - }, - "indices": { - "null_value": 0, - "type": "long" - }, - "overview": { - "null_value": 0, - "type": "long" - } - } - }, - "ui_reindex": { - "properties": { - "close": { - "null_value": 0, - "type": "long" - }, - "open": { - "null_value": 0, - "type": "long" - }, - "start": { - "null_value": 0, - "type": "long" - }, - "stop": { - "null_value": 0, - "type": "long" - } - } - } - } - }, - "url": { - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "fields": { - "keyword": { - "ignore_above": 2048, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "visualization": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "savedSearchRefName": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" - } - } - } - } - }, - "settings": { - "index": { - "auto_expand_replicas": "0-1", - "number_of_replicas": "0", - "number_of_shards": "1" - } - } - } -} diff --git a/x-pack/test/functional/es_archives/ml/ecommerce/data.json.gz b/x-pack/test/functional/es_archives/ml/ecommerce/data.json.gz index b38981c03417e2..75fbf6fcdb845b 100644 Binary files a/x-pack/test/functional/es_archives/ml/ecommerce/data.json.gz and b/x-pack/test/functional/es_archives/ml/ecommerce/data.json.gz differ diff --git a/x-pack/test/functional/es_archives/ml/ecommerce/mappings.json b/x-pack/test/functional/es_archives/ml/ecommerce/mappings.json index 9e3275bd40bfe7..2910c4639162ba 100644 --- a/x-pack/test/functional/es_archives/ml/ecommerce/mappings.json +++ b/x-pack/test/functional/es_archives/ml/ecommerce/mappings.json @@ -3,7 +3,7 @@ "value": { "aliases": { }, - "index": "ecommerce", + "index": "ft_ecommerce", "mappings": { "properties": { "category": { @@ -209,1018 +209,3 @@ } } } - -{ - "type": "index", - "value": { - "aliases": { - ".kibana": { - } - }, - "index": ".kibana_1", - "mappings": { - "_meta": { - "migrationMappingPropertyHashes": { - "apm-telemetry": "07ee1939fa4302c62ddc052ec03fed90", - "canvas-element": "7390014e1091044523666d97247392fc", - "canvas-workpad": "b0a1706d356228dbdcb4a17e6b9eb231", - "config": "87aca8fdb053154f11383fce3dbf3edf", - "dashboard": "d00f614b29a80360e1190193fd333bab", - "file-upload-telemetry": "0ed4d3e1983d1217a30982630897092e", - "graph-workspace": "cd7ba1330e6682e9cc00b78850874be1", - "index-pattern": "66eccb05066c5a89924f48a9e9736499", - "infrastructure-ui-source": "ddc0ecb18383f6b26101a2fadb2dab0c", - "kql-telemetry": "d12a98a6f19a2d273696597547e064ee", - "map": "23d7aa4a720d4938ccde3983f87bd58d", - "maps-telemetry": "a4229f8b16a6820c6d724b7e0c1f729d", - "migrationVersion": "4a1746014a75ade3a714e1db5763276f", - "ml-telemetry": "257fd1d4b4fdbb9cb4b8a3b27da201e9", - "namespace": "2f4316de49999235636386fe51dc06c1", - "query": "11aaeb7f5f7fa5bb43f25e18ce26e7d9", - "references": "7997cf5a56cc02bdc9c93361bde732b0", - "sample-data-telemetry": "7d3cfeb915303c9641c59681967ffeb4", - "search": "181661168bbadd1eff5902361e2a0d5c", - "server": "ec97f1c5da1a19609a60874e5af1100c", - "siem-ui-timeline": "1f6f0860ad7bc0dba3e42467ca40470d", - "siem-ui-timeline-note": "8874706eedc49059d4cf0f5094559084", - "siem-ui-timeline-pinned-event": "20638091112f0e14f0e443d512301c29", - "space": "25de8c2deec044392922989cfcf24c54", - "telemetry": "e1c8bc94e443aefd9458932cc0697a4d", - "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", - "type": "2f4316de49999235636386fe51dc06c1", - "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", - "updated_at": "00da57df13e94e9d98437d13ace4bfe0", - "upgrade-assistant-reindex-operation": "a53a20fe086b72c9a86da3cc12dad8a6", - "upgrade-assistant-telemetry": "56702cec857e0a9dacfb696655b4ff7b", - "url": "c7f66a0df8b1b52f17c28c4adb111105", - "visualization": "52d7a13ad68a150c4525b292d23e12cc" - } - }, - "dynamic": "strict", - "properties": { - "apm-telemetry": { - "properties": { - "has_any_services": { - "type": "boolean" - }, - "services_per_agent": { - "properties": { - "dotnet": { - "null_value": 0, - "type": "long" - }, - "go": { - "null_value": 0, - "type": "long" - }, - "java": { - "null_value": 0, - "type": "long" - }, - "js-base": { - "null_value": 0, - "type": "long" - }, - "nodejs": { - "null_value": 0, - "type": "long" - }, - "python": { - "null_value": 0, - "type": "long" - }, - "ruby": { - "null_value": 0, - "type": "long" - }, - "rum-js": { - "null_value": 0, - "type": "long" - } - } - } - } - }, - "canvas-element": { - "dynamic": "false", - "properties": { - "@created": { - "type": "date" - }, - "@timestamp": { - "type": "date" - }, - "content": { - "type": "text" - }, - "help": { - "type": "text" - }, - "image": { - "type": "text" - }, - "name": { - "fields": { - "keyword": { - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "canvas-workpad": { - "dynamic": "false", - "properties": { - "@created": { - "type": "date" - }, - "@timestamp": { - "type": "date" - }, - "name": { - "fields": { - "keyword": { - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - }, - "dateFormat:tz": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "defaultIndex": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "dashboard": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } - } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "file-upload-telemetry": { - "properties": { - "filesUploadedTotalCount": { - "type": "long" - } - } - }, - "graph-workspace": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "numLinks": { - "type": "integer" - }, - "numVertices": { - "type": "integer" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "wsState": { - "type": "text" - } - } - }, - "index-pattern": { - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "type": { - "type": "keyword" - }, - "typeMeta": { - "type": "keyword" - } - } - }, - "infrastructure-ui-source": { - "properties": { - "description": { - "type": "text" - }, - "fields": { - "properties": { - "container": { - "type": "keyword" - }, - "host": { - "type": "keyword" - }, - "pod": { - "type": "keyword" - }, - "tiebreaker": { - "type": "keyword" - }, - "timestamp": { - "type": "keyword" - } - } - }, - "logAlias": { - "type": "keyword" - }, - "logColumns": { - "properties": { - "fieldColumn": { - "properties": { - "field": { - "type": "keyword" - }, - "id": { - "type": "keyword" - } - } - }, - "messageColumn": { - "properties": { - "id": { - "type": "keyword" - } - } - }, - "timestampColumn": { - "properties": { - "id": { - "type": "keyword" - } - } - } - }, - "type": "nested" - }, - "metricAlias": { - "type": "keyword" - }, - "name": { - "type": "text" - } - } - }, - "kql-telemetry": { - "properties": { - "optInCount": { - "type": "long" - }, - "optOutCount": { - "type": "long" - } - } - }, - "map": { - "properties": { - "bounds": { - "type": "geo_shape" - }, - "description": { - "type": "text" - }, - "layerListJSON": { - "type": "text" - }, - "mapStateJSON": { - "type": "text" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "maps-telemetry": { - "properties": { - "attributesPerMap": { - "properties": { - "dataSourcesCount": { - "properties": { - "avg": { - "type": "long" - }, - "max": { - "type": "long" - }, - "min": { - "type": "long" - } - } - }, - "emsVectorLayersCount": { - "dynamic": "true", - "type": "object" - }, - "layerTypesCount": { - "dynamic": "true", - "type": "object" - }, - "layersCount": { - "properties": { - "avg": { - "type": "long" - }, - "max": { - "type": "long" - }, - "min": { - "type": "long" - } - } - } - } - }, - "mapsTotalCount": { - "type": "long" - }, - "timeCaptured": { - "type": "date" - } - } - }, - "migrationVersion": { - "dynamic": "true", - "properties": { - "index-pattern": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "space": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "ml-telemetry": { - "properties": { - "file_data_visualizer": { - "properties": { - "index_creation_count": { - "type": "long" - } - } - } - } - }, - "namespace": { - "type": "keyword" - }, - "query": { - "properties": { - "description": { - "type": "text" - }, - "filters": { - "enabled": false, - "type": "object" - }, - "query": { - "properties": { - "language": { - "type": "keyword" - }, - "query": { - "index": false, - "type": "keyword" - } - } - }, - "timefilter": { - "enabled": false, - "type": "object" - }, - "title": { - "type": "text" - } - } - }, - "references": { - "properties": { - "id": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - } - }, - "type": "nested" - }, - "sample-data-telemetry": { - "properties": { - "installCount": { - "type": "long" - }, - "unInstallCount": { - "type": "long" - } - } - }, - "search": { - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "server": { - "properties": { - "uuid": { - "type": "keyword" - } - } - }, - "siem-ui-timeline": { - "properties": { - "columns": { - "properties": { - "aggregatable": { - "type": "boolean" - }, - "category": { - "type": "keyword" - }, - "columnHeaderType": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "example": { - "type": "text" - }, - "id": { - "type": "keyword" - }, - "indexes": { - "type": "keyword" - }, - "name": { - "type": "text" - }, - "placeholder": { - "type": "text" - }, - "searchable": { - "type": "boolean" - }, - "type": { - "type": "keyword" - } - } - }, - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "dataProviders": { - "properties": { - "and": { - "properties": { - "enabled": { - "type": "boolean" - }, - "excluded": { - "type": "boolean" - }, - "id": { - "type": "keyword" - }, - "kqlQuery": { - "type": "text" - }, - "name": { - "type": "text" - }, - "queryMatch": { - "properties": { - "displayField": { - "type": "text" - }, - "displayValue": { - "type": "text" - }, - "field": { - "type": "text" - }, - "operator": { - "type": "text" - }, - "value": { - "type": "text" - } - } - } - } - }, - "enabled": { - "type": "boolean" - }, - "excluded": { - "type": "boolean" - }, - "id": { - "type": "keyword" - }, - "kqlQuery": { - "type": "text" - }, - "name": { - "type": "text" - }, - "queryMatch": { - "properties": { - "displayField": { - "type": "text" - }, - "displayValue": { - "type": "text" - }, - "field": { - "type": "text" - }, - "operator": { - "type": "text" - }, - "value": { - "type": "text" - } - } - } - } - }, - "dateRange": { - "properties": { - "end": { - "type": "date" - }, - "start": { - "type": "date" - } - } - }, - "description": { - "type": "text" - }, - "favorite": { - "properties": { - "favoriteDate": { - "type": "date" - }, - "fullName": { - "type": "text" - }, - "keySearch": { - "type": "text" - }, - "userName": { - "type": "text" - } - } - }, - "kqlMode": { - "type": "keyword" - }, - "kqlQuery": { - "properties": { - "filterQuery": { - "properties": { - "kuery": { - "properties": { - "expression": { - "type": "text" - }, - "kind": { - "type": "keyword" - } - } - }, - "serializedQuery": { - "type": "text" - } - } - } - } - }, - "sort": { - "properties": { - "columnId": { - "type": "keyword" - }, - "sortDirection": { - "type": "keyword" - } - } - }, - "title": { - "type": "text" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "siem-ui-timeline-note": { - "properties": { - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "eventId": { - "type": "keyword" - }, - "note": { - "type": "text" - }, - "timelineId": { - "type": "keyword" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "siem-ui-timeline-pinned-event": { - "properties": { - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "eventId": { - "type": "keyword" - }, - "timelineId": { - "type": "keyword" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "space": { - "properties": { - "_reserved": { - "type": "boolean" - }, - "color": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "disabledFeatures": { - "type": "keyword" - }, - "initials": { - "type": "keyword" - }, - "name": { - "fields": { - "keyword": { - "ignore_above": 2048, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "telemetry": { - "properties": { - "enabled": { - "type": "boolean" - } - } - }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "type": { - "type": "keyword" - }, - "ui-metric": { - "properties": { - "count": { - "type": "integer" - } - } - }, - "updated_at": { - "type": "date" - }, - "upgrade-assistant-reindex-operation": { - "dynamic": "true", - "properties": { - "indexName": { - "type": "keyword" - }, - "status": { - "type": "integer" - } - } - }, - "upgrade-assistant-telemetry": { - "properties": { - "features": { - "properties": { - "deprecation_logging": { - "properties": { - "enabled": { - "null_value": true, - "type": "boolean" - } - } - } - } - }, - "ui_open": { - "properties": { - "cluster": { - "null_value": 0, - "type": "long" - }, - "indices": { - "null_value": 0, - "type": "long" - }, - "overview": { - "null_value": 0, - "type": "long" - } - } - }, - "ui_reindex": { - "properties": { - "close": { - "null_value": 0, - "type": "long" - }, - "open": { - "null_value": 0, - "type": "long" - }, - "start": { - "null_value": 0, - "type": "long" - }, - "stop": { - "null_value": 0, - "type": "long" - } - } - } - } - }, - "url": { - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "fields": { - "keyword": { - "ignore_above": 2048, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "visualization": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "savedSearchRefName": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" - } - } - } - } - }, - "settings": { - "index": { - "auto_expand_replicas": "0-1", - "number_of_replicas": "0", - "number_of_shards": "1" - } - } - } -} \ No newline at end of file diff --git a/x-pack/test/functional/es_archives/ml/egs_regression/data.json.gz b/x-pack/test/functional/es_archives/ml/egs_regression/data.json.gz index 78a8b65b4a124a..477c2e638ee0fa 100644 Binary files a/x-pack/test/functional/es_archives/ml/egs_regression/data.json.gz and b/x-pack/test/functional/es_archives/ml/egs_regression/data.json.gz differ diff --git a/x-pack/test/functional/es_archives/ml/egs_regression/mappings.json b/x-pack/test/functional/es_archives/ml/egs_regression/mappings.json index bfaecc6820469e..72a411819b0acb 100644 --- a/x-pack/test/functional/es_archives/ml/egs_regression/mappings.json +++ b/x-pack/test/functional/es_archives/ml/egs_regression/mappings.json @@ -3,7 +3,7 @@ "value": { "aliases": { }, - "index": "egs_regression", + "index": "ft_egs_regression", "mappings": { "properties": { "g1": { @@ -58,1395 +58,3 @@ } } } - -{ - "type": "index", - "value": { - "aliases": { - ".kibana": { - } - }, - "index": ".kibana_1", - "mappings": { - "_meta": { - "migrationMappingPropertyHashes": { - "action": "ecc01e367a369542bc2b15dae1fb1773", - "action_task_params": "a9d49f184ee89641044be0ca2950fa3a", - "alert": "3cdf52bff6f482e53b825b45686604db", - "apm-indices": "9bb9b2bf1fa636ed8619cbab5ce6a1dd", - "apm-services-telemetry": "07ee1939fa4302c62ddc052ec03fed90", - "canvas-element": "7390014e1091044523666d97247392fc", - "canvas-workpad": "b0a1706d356228dbdcb4a17e6b9eb231", - "config": "87aca8fdb053154f11383fce3dbf3edf", - "dashboard": "d00f614b29a80360e1190193fd333bab", - "file-upload-telemetry": "0ed4d3e1983d1217a30982630897092e", - "graph-workspace": "cd7ba1330e6682e9cc00b78850874be1", - "index-pattern": "66eccb05066c5a89924f48a9e9736499", - "infrastructure-ui-source": "ddc0ecb18383f6b26101a2fadb2dab0c", - "inventory-view": "84b320fd67209906333ffce261128462", - "kql-telemetry": "d12a98a6f19a2d273696597547e064ee", - "lens": "21c3ea0763beb1ecb0162529706b88c5", - "lens-ui-telemetry": "509bfa5978586998e05f9e303c07a327", - "map": "23d7aa4a720d4938ccde3983f87bd58d", - "maps-telemetry": "a4229f8b16a6820c6d724b7e0c1f729d", - "metrics-explorer-view": "53c5365793677328df0ccb6138bf3cdd", - "migrationVersion": "4a1746014a75ade3a714e1db5763276f", - "ml-telemetry": "257fd1d4b4fdbb9cb4b8a3b27da201e9", - "namespace": "2f4316de49999235636386fe51dc06c1", - "query": "11aaeb7f5f7fa5bb43f25e18ce26e7d9", - "references": "7997cf5a56cc02bdc9c93361bde732b0", - "sample-data-telemetry": "7d3cfeb915303c9641c59681967ffeb4", - "search": "181661168bbadd1eff5902361e2a0d5c", - "server": "ec97f1c5da1a19609a60874e5af1100c", - "siem-ui-timeline": "6485ab095be8d15246667b98a1a34295", - "siem-ui-timeline-note": "8874706eedc49059d4cf0f5094559084", - "siem-ui-timeline-pinned-event": "20638091112f0e14f0e443d512301c29", - "space": "c5ca8acafa0beaa4d08d014a97b6bc6b", - "telemetry": "358ffaa88ba34a97d55af0933a117de4", - "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", - "type": "2f4316de49999235636386fe51dc06c1", - "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", - "updated_at": "00da57df13e94e9d98437d13ace4bfe0", - "upgrade-assistant-reindex-operation": "a53a20fe086b72c9a86da3cc12dad8a6", - "upgrade-assistant-telemetry": "56702cec857e0a9dacfb696655b4ff7b", - "url": "c7f66a0df8b1b52f17c28c4adb111105", - "visualization": "52d7a13ad68a150c4525b292d23e12cc" - } - }, - "dynamic": "strict", - "properties": { - "action": { - "properties": { - "actionTypeId": { - "type": "keyword" - }, - "config": { - "enabled": false, - "type": "object" - }, - "description": { - "type": "text" - }, - "secrets": { - "type": "binary" - } - } - }, - "action_task_params": { - "properties": { - "actionId": { - "type": "keyword" - }, - "apiKey": { - "type": "binary" - }, - "params": { - "enabled": false, - "type": "object" - } - } - }, - "alert": { - "properties": { - "actions": { - "properties": { - "actionRef": { - "type": "keyword" - }, - "group": { - "type": "keyword" - }, - "params": { - "enabled": false, - "type": "object" - } - }, - "type": "nested" - }, - "alertTypeId": { - "type": "keyword" - }, - "apiKey": { - "type": "binary" - }, - "apiKeyOwner": { - "type": "keyword" - }, - "createdBy": { - "type": "keyword" - }, - "enabled": { - "type": "boolean" - }, - "interval": { - "type": "keyword" - }, - "muteAll": { - "type": "boolean" - }, - "mutedInstanceIds": { - "type": "keyword" - }, - "name": { - "type": "text" - }, - "params": { - "enabled": false, - "type": "object" - }, - "scheduledTaskId": { - "type": "keyword" - }, - "tags": { - "type": "keyword" - }, - "throttle": { - "type": "keyword" - }, - "updatedBy": { - "type": "keyword" - } - } - }, - "apm-indices": { - "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } - } - } - }, - "apm-services-telemetry": { - "properties": { - "has_any_services": { - "type": "boolean" - }, - "services_per_agent": { - "properties": { - "dotnet": { - "null_value": 0, - "type": "long" - }, - "go": { - "null_value": 0, - "type": "long" - }, - "java": { - "null_value": 0, - "type": "long" - }, - "js-base": { - "null_value": 0, - "type": "long" - }, - "nodejs": { - "null_value": 0, - "type": "long" - }, - "python": { - "null_value": 0, - "type": "long" - }, - "ruby": { - "null_value": 0, - "type": "long" - }, - "rum-js": { - "null_value": 0, - "type": "long" - } - } - } - } - }, - "canvas-element": { - "dynamic": "false", - "properties": { - "@created": { - "type": "date" - }, - "@timestamp": { - "type": "date" - }, - "content": { - "type": "text" - }, - "help": { - "type": "text" - }, - "image": { - "type": "text" - }, - "name": { - "fields": { - "keyword": { - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "canvas-workpad": { - "dynamic": "false", - "properties": { - "@created": { - "type": "date" - }, - "@timestamp": { - "type": "date" - }, - "name": { - "fields": { - "keyword": { - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - }, - "dateFormat:tz": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "defaultIndex": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "dashboard": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } - } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "file-upload-telemetry": { - "properties": { - "filesUploadedTotalCount": { - "type": "long" - } - } - }, - "graph-workspace": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "numLinks": { - "type": "integer" - }, - "numVertices": { - "type": "integer" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "wsState": { - "type": "text" - } - } - }, - "index-pattern": { - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "type": { - "type": "keyword" - }, - "typeMeta": { - "type": "keyword" - } - } - }, - "infrastructure-ui-source": { - "properties": { - "description": { - "type": "text" - }, - "fields": { - "properties": { - "container": { - "type": "keyword" - }, - "host": { - "type": "keyword" - }, - "pod": { - "type": "keyword" - }, - "tiebreaker": { - "type": "keyword" - }, - "timestamp": { - "type": "keyword" - } - } - }, - "logAlias": { - "type": "keyword" - }, - "logColumns": { - "properties": { - "fieldColumn": { - "properties": { - "field": { - "type": "keyword" - }, - "id": { - "type": "keyword" - } - } - }, - "messageColumn": { - "properties": { - "id": { - "type": "keyword" - } - } - }, - "timestampColumn": { - "properties": { - "id": { - "type": "keyword" - } - } - } - }, - "type": "nested" - }, - "metricAlias": { - "type": "keyword" - }, - "name": { - "type": "text" - } - } - }, - "inventory-view": { - "properties": { - "autoBounds": { - "type": "boolean" - }, - "autoReload": { - "type": "boolean" - }, - "boundsOverride": { - "properties": { - "max": { - "type": "integer" - }, - "min": { - "type": "integer" - } - } - }, - "customOptions": { - "properties": { - "field": { - "type": "keyword" - }, - "text": { - "type": "keyword" - } - }, - "type": "nested" - }, - "filterQuery": { - "properties": { - "expression": { - "type": "keyword" - }, - "kind": { - "type": "keyword" - } - } - }, - "groupBy": { - "properties": { - "field": { - "type": "keyword" - }, - "label": { - "type": "keyword" - } - }, - "type": "nested" - }, - "metric": { - "properties": { - "type": { - "type": "keyword" - } - } - }, - "name": { - "type": "keyword" - }, - "nodeType": { - "type": "keyword" - }, - "time": { - "type": "integer" - }, - "view": { - "type": "keyword" - } - } - }, - "kql-telemetry": { - "properties": { - "optInCount": { - "type": "long" - }, - "optOutCount": { - "type": "long" - } - } - }, - "lens": { - "properties": { - "expression": { - "index": false, - "type": "keyword" - }, - "state": { - "type": "flattened" - }, - "title": { - "type": "text" - }, - "visualizationType": { - "type": "keyword" - } - } - }, - "lens-ui-telemetry": { - "properties": { - "count": { - "type": "integer" - }, - "date": { - "type": "date" - }, - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - } - } - }, - "map": { - "properties": { - "bounds": { - "type": "geo_shape" - }, - "description": { - "type": "text" - }, - "layerListJSON": { - "type": "text" - }, - "mapStateJSON": { - "type": "text" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "maps-telemetry": { - "properties": { - "attributesPerMap": { - "properties": { - "dataSourcesCount": { - "properties": { - "avg": { - "type": "long" - }, - "max": { - "type": "long" - }, - "min": { - "type": "long" - } - } - }, - "emsVectorLayersCount": { - "dynamic": "true", - "type": "object" - }, - "layerTypesCount": { - "dynamic": "true", - "type": "object" - }, - "layersCount": { - "properties": { - "avg": { - "type": "long" - }, - "max": { - "type": "long" - }, - "min": { - "type": "long" - } - } - } - } - }, - "mapsTotalCount": { - "type": "long" - }, - "timeCaptured": { - "type": "date" - } - } - }, - "metrics-explorer-view": { - "properties": { - "chartOptions": { - "properties": { - "stack": { - "type": "boolean" - }, - "type": { - "type": "keyword" - }, - "yAxisMode": { - "type": "keyword" - } - } - }, - "currentTimerange": { - "properties": { - "from": { - "type": "keyword" - }, - "interval": { - "type": "keyword" - }, - "to": { - "type": "keyword" - } - } - }, - "name": { - "type": "keyword" - }, - "options": { - "properties": { - "aggregation": { - "type": "keyword" - }, - "filterQuery": { - "type": "keyword" - }, - "groupBy": { - "type": "keyword" - }, - "limit": { - "type": "integer" - }, - "metrics": { - "properties": { - "aggregation": { - "type": "keyword" - }, - "color": { - "type": "keyword" - }, - "field": { - "type": "keyword" - }, - "label": { - "type": "keyword" - } - }, - "type": "nested" - } - } - } - } - }, - "migrationVersion": { - "dynamic": "true", - "properties": { - "index-pattern": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "space": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "ml-telemetry": { - "properties": { - "file_data_visualizer": { - "properties": { - "index_creation_count": { - "type": "long" - } - } - } - } - }, - "namespace": { - "type": "keyword" - }, - "query": { - "properties": { - "description": { - "type": "text" - }, - "filters": { - "enabled": false, - "type": "object" - }, - "query": { - "properties": { - "language": { - "type": "keyword" - }, - "query": { - "index": false, - "type": "keyword" - } - } - }, - "timefilter": { - "enabled": false, - "type": "object" - }, - "title": { - "type": "text" - } - } - }, - "references": { - "properties": { - "id": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - } - }, - "type": "nested" - }, - "sample-data-telemetry": { - "properties": { - "installCount": { - "type": "long" - }, - "unInstallCount": { - "type": "long" - } - } - }, - "search": { - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "server": { - "properties": { - "uuid": { - "type": "keyword" - } - } - }, - "siem-ui-timeline": { - "properties": { - "columns": { - "properties": { - "aggregatable": { - "type": "boolean" - }, - "category": { - "type": "keyword" - }, - "columnHeaderType": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "example": { - "type": "text" - }, - "id": { - "type": "keyword" - }, - "indexes": { - "type": "keyword" - }, - "name": { - "type": "text" - }, - "placeholder": { - "type": "text" - }, - "searchable": { - "type": "boolean" - }, - "type": { - "type": "keyword" - } - } - }, - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "dataProviders": { - "properties": { - "and": { - "properties": { - "enabled": { - "type": "boolean" - }, - "excluded": { - "type": "boolean" - }, - "id": { - "type": "keyword" - }, - "kqlQuery": { - "type": "text" - }, - "name": { - "type": "text" - }, - "queryMatch": { - "properties": { - "displayField": { - "type": "text" - }, - "displayValue": { - "type": "text" - }, - "field": { - "type": "text" - }, - "operator": { - "type": "text" - }, - "value": { - "type": "text" - } - } - } - } - }, - "enabled": { - "type": "boolean" - }, - "excluded": { - "type": "boolean" - }, - "id": { - "type": "keyword" - }, - "kqlQuery": { - "type": "text" - }, - "name": { - "type": "text" - }, - "queryMatch": { - "properties": { - "displayField": { - "type": "text" - }, - "displayValue": { - "type": "text" - }, - "field": { - "type": "text" - }, - "operator": { - "type": "text" - }, - "value": { - "type": "text" - } - } - } - } - }, - "dateRange": { - "properties": { - "end": { - "type": "date" - }, - "start": { - "type": "date" - } - } - }, - "description": { - "type": "text" - }, - "favorite": { - "properties": { - "favoriteDate": { - "type": "date" - }, - "fullName": { - "type": "text" - }, - "keySearch": { - "type": "text" - }, - "userName": { - "type": "text" - } - } - }, - "filters": { - "properties": { - "exists": { - "type": "text" - }, - "match_all": { - "type": "text" - }, - "meta": { - "properties": { - "alias": { - "type": "text" - }, - "controlledBy": { - "type": "text" - }, - "disabled": { - "type": "boolean" - }, - "field": { - "type": "text" - }, - "formattedValue": { - "type": "text" - }, - "index": { - "type": "keyword" - }, - "key": { - "type": "keyword" - }, - "negate": { - "type": "boolean" - }, - "params": { - "type": "text" - }, - "type": { - "type": "keyword" - }, - "value": { - "type": "text" - } - } - }, - "missing": { - "type": "text" - }, - "query": { - "type": "text" - }, - "range": { - "type": "text" - }, - "script": { - "type": "text" - } - } - }, - "kqlMode": { - "type": "keyword" - }, - "kqlQuery": { - "properties": { - "filterQuery": { - "properties": { - "kuery": { - "properties": { - "expression": { - "type": "text" - }, - "kind": { - "type": "keyword" - } - } - }, - "serializedQuery": { - "type": "text" - } - } - } - } - }, - "savedQueryId": { - "type": "keyword" - }, - "sort": { - "properties": { - "columnId": { - "type": "keyword" - }, - "sortDirection": { - "type": "keyword" - } - } - }, - "title": { - "type": "text" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "siem-ui-timeline-note": { - "properties": { - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "eventId": { - "type": "keyword" - }, - "note": { - "type": "text" - }, - "timelineId": { - "type": "keyword" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "siem-ui-timeline-pinned-event": { - "properties": { - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "eventId": { - "type": "keyword" - }, - "timelineId": { - "type": "keyword" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "space": { - "properties": { - "_reserved": { - "type": "boolean" - }, - "color": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "disabledFeatures": { - "type": "keyword" - }, - "imageUrl": { - "index": false, - "type": "text" - }, - "initials": { - "type": "keyword" - }, - "name": { - "fields": { - "keyword": { - "ignore_above": 2048, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "telemetry": { - "properties": { - "enabled": { - "type": "boolean" - }, - "lastReported": { - "type": "date" - }, - "lastVersionChecked": { - "ignore_above": 256, - "type": "keyword" - }, - "sendUsageFrom": { - "ignore_above": 256, - "type": "keyword" - }, - "userHasSeenNotice": { - "type": "boolean" - } - } - }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "type": { - "type": "keyword" - }, - "ui-metric": { - "properties": { - "count": { - "type": "integer" - } - } - }, - "updated_at": { - "type": "date" - }, - "upgrade-assistant-reindex-operation": { - "dynamic": "true", - "properties": { - "indexName": { - "type": "keyword" - }, - "status": { - "type": "integer" - } - } - }, - "upgrade-assistant-telemetry": { - "properties": { - "features": { - "properties": { - "deprecation_logging": { - "properties": { - "enabled": { - "null_value": true, - "type": "boolean" - } - } - } - } - }, - "ui_open": { - "properties": { - "cluster": { - "null_value": 0, - "type": "long" - }, - "indices": { - "null_value": 0, - "type": "long" - }, - "overview": { - "null_value": 0, - "type": "long" - } - } - }, - "ui_reindex": { - "properties": { - "close": { - "null_value": 0, - "type": "long" - }, - "open": { - "null_value": 0, - "type": "long" - }, - "start": { - "null_value": 0, - "type": "long" - }, - "stop": { - "null_value": 0, - "type": "long" - } - } - } - } - }, - "url": { - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "fields": { - "keyword": { - "ignore_above": 2048, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "visualization": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "savedSearchRefName": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" - } - } - } - } - }, - "settings": { - "index": { - "auto_expand_replicas": "0-1", - "number_of_replicas": "0", - "number_of_shards": "1" - } - } - } -} \ No newline at end of file diff --git a/x-pack/test/functional/es_archives/ml/event_rate_nanos/data.json.gz b/x-pack/test/functional/es_archives/ml/event_rate_nanos/data.json.gz index 838b8d1872c0aa..6170d9affd5a65 100644 Binary files a/x-pack/test/functional/es_archives/ml/event_rate_nanos/data.json.gz and b/x-pack/test/functional/es_archives/ml/event_rate_nanos/data.json.gz differ diff --git a/x-pack/test/functional/es_archives/ml/event_rate_nanos/mappings.json b/x-pack/test/functional/es_archives/ml/event_rate_nanos/mappings.json index 6897e05e75c2ec..dbed30f3f855ce 100644 --- a/x-pack/test/functional/es_archives/ml/event_rate_nanos/mappings.json +++ b/x-pack/test/functional/es_archives/ml/event_rate_nanos/mappings.json @@ -3,7 +3,7 @@ "value": { "aliases": { }, - "index": "event_rate_gen_trend_nanos", + "index": "ft_event_rate_gen_trend_nanos", "mappings": { "properties": { "@timestamp": { @@ -23,1455 +23,3 @@ } } } - -{ - "type": "index", - "value": { - "aliases": { - ".kibana": { - } - }, - "index": ".kibana_1", - "mappings": { - "_meta": { - "migrationMappingPropertyHashes": { - "action": "c0c235fba02ebd2a2412bcda79009b58", - "action_task_params": "a9d49f184ee89641044be0ca2950fa3a", - "alert": "e588043a01d3d43477e7cad7efa0f5d8", - "apm-indices": "9bb9b2bf1fa636ed8619cbab5ce6a1dd", - "apm-services-telemetry": "07ee1939fa4302c62ddc052ec03fed90", - "canvas-element": "7390014e1091044523666d97247392fc", - "canvas-workpad": "b0a1706d356228dbdcb4a17e6b9eb231", - "config": "87aca8fdb053154f11383fce3dbf3edf", - "dashboard": "d00f614b29a80360e1190193fd333bab", - "file-upload-telemetry": "0ed4d3e1983d1217a30982630897092e", - "graph-workspace": "cd7ba1330e6682e9cc00b78850874be1", - "index-pattern": "66eccb05066c5a89924f48a9e9736499", - "infrastructure-ui-source": "ddc0ecb18383f6b26101a2fadb2dab0c", - "inventory-view": "84b320fd67209906333ffce261128462", - "kql-telemetry": "d12a98a6f19a2d273696597547e064ee", - "lens": "21c3ea0763beb1ecb0162529706b88c5", - "lens-ui-telemetry": "509bfa5978586998e05f9e303c07a327", - "map": "23d7aa4a720d4938ccde3983f87bd58d", - "maps-telemetry": "268da3a48066123fc5baf35abaa55014", - "metrics-explorer-view": "53c5365793677328df0ccb6138bf3cdd", - "migrationVersion": "4a1746014a75ade3a714e1db5763276f", - "ml-telemetry": "257fd1d4b4fdbb9cb4b8a3b27da201e9", - "namespace": "2f4316de49999235636386fe51dc06c1", - "query": "11aaeb7f5f7fa5bb43f25e18ce26e7d9", - "references": "7997cf5a56cc02bdc9c93361bde732b0", - "sample-data-telemetry": "7d3cfeb915303c9641c59681967ffeb4", - "search": "181661168bbadd1eff5902361e2a0d5c", - "server": "ec97f1c5da1a19609a60874e5af1100c", - "siem-detection-engine-rule-status": "0367e4d775814b56a4bee29384f9aafe", - "siem-ui-timeline": "ac8020190f5950dd3250b6499144e7fb", - "siem-ui-timeline-note": "8874706eedc49059d4cf0f5094559084", - "siem-ui-timeline-pinned-event": "20638091112f0e14f0e443d512301c29", - "space": "c5ca8acafa0beaa4d08d014a97b6bc6b", - "telemetry": "358ffaa88ba34a97d55af0933a117de4", - "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", - "tsvb-validation-telemetry": "3a37ef6c8700ae6fc97d5c7da00e9215", - "type": "2f4316de49999235636386fe51dc06c1", - "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", - "updated_at": "00da57df13e94e9d98437d13ace4bfe0", - "upgrade-assistant-reindex-operation": "a53a20fe086b72c9a86da3cc12dad8a6", - "upgrade-assistant-telemetry": "56702cec857e0a9dacfb696655b4ff7b", - "url": "c7f66a0df8b1b52f17c28c4adb111105", - "visualization": "52d7a13ad68a150c4525b292d23e12cc" - } - }, - "dynamic": "strict", - "properties": { - "action": { - "properties": { - "actionTypeId": { - "type": "keyword" - }, - "config": { - "enabled": false, - "type": "object" - }, - "name": { - "type": "text" - }, - "secrets": { - "type": "binary" - } - } - }, - "action_task_params": { - "properties": { - "actionId": { - "type": "keyword" - }, - "apiKey": { - "type": "binary" - }, - "params": { - "enabled": false, - "type": "object" - } - } - }, - "alert": { - "properties": { - "actions": { - "properties": { - "actionRef": { - "type": "keyword" - }, - "actionTypeId": { - "type": "keyword" - }, - "group": { - "type": "keyword" - }, - "params": { - "enabled": false, - "type": "object" - } - }, - "type": "nested" - }, - "alertTypeId": { - "type": "keyword" - }, - "apiKey": { - "type": "binary" - }, - "apiKeyOwner": { - "type": "keyword" - }, - "consumer": { - "type": "keyword" - }, - "createdAt": { - "type": "date" - }, - "createdBy": { - "type": "keyword" - }, - "enabled": { - "type": "boolean" - }, - "muteAll": { - "type": "boolean" - }, - "mutedInstanceIds": { - "type": "keyword" - }, - "name": { - "type": "text" - }, - "params": { - "enabled": false, - "type": "object" - }, - "schedule": { - "properties": { - "interval": { - "type": "keyword" - } - } - }, - "scheduledTaskId": { - "type": "keyword" - }, - "tags": { - "type": "keyword" - }, - "throttle": { - "type": "keyword" - }, - "updatedBy": { - "type": "keyword" - } - } - }, - "apm-indices": { - "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } - } - } - }, - "apm-services-telemetry": { - "properties": { - "has_any_services": { - "type": "boolean" - }, - "services_per_agent": { - "properties": { - "dotnet": { - "null_value": 0, - "type": "long" - }, - "go": { - "null_value": 0, - "type": "long" - }, - "java": { - "null_value": 0, - "type": "long" - }, - "js-base": { - "null_value": 0, - "type": "long" - }, - "nodejs": { - "null_value": 0, - "type": "long" - }, - "python": { - "null_value": 0, - "type": "long" - }, - "ruby": { - "null_value": 0, - "type": "long" - }, - "rum-js": { - "null_value": 0, - "type": "long" - } - } - } - } - }, - "canvas-element": { - "dynamic": "false", - "properties": { - "@created": { - "type": "date" - }, - "@timestamp": { - "type": "date" - }, - "content": { - "type": "text" - }, - "help": { - "type": "text" - }, - "image": { - "type": "text" - }, - "name": { - "fields": { - "keyword": { - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "canvas-workpad": { - "dynamic": "false", - "properties": { - "@created": { - "type": "date" - }, - "@timestamp": { - "type": "date" - }, - "name": { - "fields": { - "keyword": { - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - }, - "dateFormat:tz": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "defaultIndex": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "dashboard": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } - } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "file-upload-telemetry": { - "properties": { - "filesUploadedTotalCount": { - "type": "long" - } - } - }, - "graph-workspace": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "numLinks": { - "type": "integer" - }, - "numVertices": { - "type": "integer" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "wsState": { - "type": "text" - } - } - }, - "index-pattern": { - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "type": { - "type": "keyword" - }, - "typeMeta": { - "type": "keyword" - } - } - }, - "infrastructure-ui-source": { - "properties": { - "description": { - "type": "text" - }, - "fields": { - "properties": { - "container": { - "type": "keyword" - }, - "host": { - "type": "keyword" - }, - "pod": { - "type": "keyword" - }, - "tiebreaker": { - "type": "keyword" - }, - "timestamp": { - "type": "keyword" - } - } - }, - "logAlias": { - "type": "keyword" - }, - "logColumns": { - "properties": { - "fieldColumn": { - "properties": { - "field": { - "type": "keyword" - }, - "id": { - "type": "keyword" - } - } - }, - "messageColumn": { - "properties": { - "id": { - "type": "keyword" - } - } - }, - "timestampColumn": { - "properties": { - "id": { - "type": "keyword" - } - } - } - }, - "type": "nested" - }, - "metricAlias": { - "type": "keyword" - }, - "name": { - "type": "text" - } - } - }, - "inventory-view": { - "properties": { - "autoBounds": { - "type": "boolean" - }, - "autoReload": { - "type": "boolean" - }, - "boundsOverride": { - "properties": { - "max": { - "type": "integer" - }, - "min": { - "type": "integer" - } - } - }, - "customOptions": { - "properties": { - "field": { - "type": "keyword" - }, - "text": { - "type": "keyword" - } - }, - "type": "nested" - }, - "filterQuery": { - "properties": { - "expression": { - "type": "keyword" - }, - "kind": { - "type": "keyword" - } - } - }, - "groupBy": { - "properties": { - "field": { - "type": "keyword" - }, - "label": { - "type": "keyword" - } - }, - "type": "nested" - }, - "metric": { - "properties": { - "type": { - "type": "keyword" - } - } - }, - "name": { - "type": "keyword" - }, - "nodeType": { - "type": "keyword" - }, - "time": { - "type": "integer" - }, - "view": { - "type": "keyword" - } - } - }, - "kql-telemetry": { - "properties": { - "optInCount": { - "type": "long" - }, - "optOutCount": { - "type": "long" - } - } - }, - "lens": { - "properties": { - "expression": { - "index": false, - "type": "keyword" - }, - "state": { - "type": "flattened" - }, - "title": { - "type": "text" - }, - "visualizationType": { - "type": "keyword" - } - } - }, - "lens-ui-telemetry": { - "properties": { - "count": { - "type": "integer" - }, - "date": { - "type": "date" - }, - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - } - } - }, - "map": { - "properties": { - "bounds": { - "type": "geo_shape" - }, - "description": { - "type": "text" - }, - "layerListJSON": { - "type": "text" - }, - "mapStateJSON": { - "type": "text" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "maps-telemetry": { - "properties": { - "attributesPerMap": { - "properties": { - "dataSourcesCount": { - "properties": { - "avg": { - "type": "long" - }, - "max": { - "type": "long" - }, - "min": { - "type": "long" - } - } - }, - "emsVectorLayersCount": { - "dynamic": "true", - "type": "object" - }, - "layerTypesCount": { - "dynamic": "true", - "type": "object" - }, - "layersCount": { - "properties": { - "avg": { - "type": "long" - }, - "max": { - "type": "long" - }, - "min": { - "type": "long" - } - } - } - } - }, - "indexPatternsWithGeoFieldCount": { - "type": "long" - }, - "mapsTotalCount": { - "type": "long" - }, - "settings": { - "properties": { - "showMapVisualizationTypes": { - "type": "boolean" - } - } - }, - "timeCaptured": { - "type": "date" - } - } - }, - "metrics-explorer-view": { - "properties": { - "chartOptions": { - "properties": { - "stack": { - "type": "boolean" - }, - "type": { - "type": "keyword" - }, - "yAxisMode": { - "type": "keyword" - } - } - }, - "currentTimerange": { - "properties": { - "from": { - "type": "keyword" - }, - "interval": { - "type": "keyword" - }, - "to": { - "type": "keyword" - } - } - }, - "name": { - "type": "keyword" - }, - "options": { - "properties": { - "aggregation": { - "type": "keyword" - }, - "filterQuery": { - "type": "keyword" - }, - "groupBy": { - "type": "keyword" - }, - "limit": { - "type": "integer" - }, - "metrics": { - "properties": { - "aggregation": { - "type": "keyword" - }, - "color": { - "type": "keyword" - }, - "field": { - "type": "keyword" - }, - "label": { - "type": "keyword" - } - }, - "type": "nested" - } - } - } - } - }, - "migrationVersion": { - "dynamic": "true", - "properties": { - "index-pattern": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "space": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "ml-telemetry": { - "properties": { - "file_data_visualizer": { - "properties": { - "index_creation_count": { - "type": "long" - } - } - } - } - }, - "namespace": { - "type": "keyword" - }, - "query": { - "properties": { - "description": { - "type": "text" - }, - "filters": { - "enabled": false, - "type": "object" - }, - "query": { - "properties": { - "language": { - "type": "keyword" - }, - "query": { - "index": false, - "type": "keyword" - } - } - }, - "timefilter": { - "enabled": false, - "type": "object" - }, - "title": { - "type": "text" - } - } - }, - "references": { - "properties": { - "id": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - } - }, - "type": "nested" - }, - "sample-data-telemetry": { - "properties": { - "installCount": { - "type": "long" - }, - "unInstallCount": { - "type": "long" - } - } - }, - "search": { - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "server": { - "properties": { - "uuid": { - "type": "keyword" - } - } - }, - "siem-detection-engine-rule-status": { - "properties": { - "alertId": { - "type": "keyword" - }, - "lastFailureAt": { - "type": "date" - }, - "lastFailureMessage": { - "type": "text" - }, - "lastSuccessAt": { - "type": "date" - }, - "lastSuccessMessage": { - "type": "text" - }, - "status": { - "type": "keyword" - }, - "statusDate": { - "type": "date" - } - } - }, - "siem-ui-timeline": { - "properties": { - "columns": { - "properties": { - "aggregatable": { - "type": "boolean" - }, - "category": { - "type": "keyword" - }, - "columnHeaderType": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "example": { - "type": "text" - }, - "id": { - "type": "keyword" - }, - "indexes": { - "type": "keyword" - }, - "name": { - "type": "text" - }, - "placeholder": { - "type": "text" - }, - "searchable": { - "type": "boolean" - }, - "type": { - "type": "keyword" - } - } - }, - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "dataProviders": { - "properties": { - "and": { - "properties": { - "enabled": { - "type": "boolean" - }, - "excluded": { - "type": "boolean" - }, - "id": { - "type": "keyword" - }, - "kqlQuery": { - "type": "text" - }, - "name": { - "type": "text" - }, - "queryMatch": { - "properties": { - "displayField": { - "type": "text" - }, - "displayValue": { - "type": "text" - }, - "field": { - "type": "text" - }, - "operator": { - "type": "text" - }, - "value": { - "type": "text" - } - } - } - } - }, - "enabled": { - "type": "boolean" - }, - "excluded": { - "type": "boolean" - }, - "id": { - "type": "keyword" - }, - "kqlQuery": { - "type": "text" - }, - "name": { - "type": "text" - }, - "queryMatch": { - "properties": { - "displayField": { - "type": "text" - }, - "displayValue": { - "type": "text" - }, - "field": { - "type": "text" - }, - "operator": { - "type": "text" - }, - "value": { - "type": "text" - } - } - } - } - }, - "dateRange": { - "properties": { - "end": { - "type": "date" - }, - "start": { - "type": "date" - } - } - }, - "description": { - "type": "text" - }, - "eventType": { - "type": "keyword" - }, - "favorite": { - "properties": { - "favoriteDate": { - "type": "date" - }, - "fullName": { - "type": "text" - }, - "keySearch": { - "type": "text" - }, - "userName": { - "type": "text" - } - } - }, - "filters": { - "properties": { - "exists": { - "type": "text" - }, - "match_all": { - "type": "text" - }, - "meta": { - "properties": { - "alias": { - "type": "text" - }, - "controlledBy": { - "type": "text" - }, - "disabled": { - "type": "boolean" - }, - "field": { - "type": "text" - }, - "formattedValue": { - "type": "text" - }, - "index": { - "type": "keyword" - }, - "key": { - "type": "keyword" - }, - "negate": { - "type": "boolean" - }, - "params": { - "type": "text" - }, - "type": { - "type": "keyword" - }, - "value": { - "type": "text" - } - } - }, - "missing": { - "type": "text" - }, - "query": { - "type": "text" - }, - "range": { - "type": "text" - }, - "script": { - "type": "text" - } - } - }, - "kqlMode": { - "type": "keyword" - }, - "kqlQuery": { - "properties": { - "filterQuery": { - "properties": { - "kuery": { - "properties": { - "expression": { - "type": "text" - }, - "kind": { - "type": "keyword" - } - } - }, - "serializedQuery": { - "type": "text" - } - } - } - } - }, - "savedQueryId": { - "type": "keyword" - }, - "sort": { - "properties": { - "columnId": { - "type": "keyword" - }, - "sortDirection": { - "type": "keyword" - } - } - }, - "title": { - "type": "text" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "siem-ui-timeline-note": { - "properties": { - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "eventId": { - "type": "keyword" - }, - "note": { - "type": "text" - }, - "timelineId": { - "type": "keyword" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "siem-ui-timeline-pinned-event": { - "properties": { - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "eventId": { - "type": "keyword" - }, - "timelineId": { - "type": "keyword" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "space": { - "properties": { - "_reserved": { - "type": "boolean" - }, - "color": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "disabledFeatures": { - "type": "keyword" - }, - "imageUrl": { - "index": false, - "type": "text" - }, - "initials": { - "type": "keyword" - }, - "name": { - "fields": { - "keyword": { - "ignore_above": 2048, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "telemetry": { - "properties": { - "enabled": { - "type": "boolean" - }, - "lastReported": { - "type": "date" - }, - "lastVersionChecked": { - "ignore_above": 256, - "type": "keyword" - }, - "sendUsageFrom": { - "ignore_above": 256, - "type": "keyword" - }, - "userHasSeenNotice": { - "type": "boolean" - } - } - }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "tsvb-validation-telemetry": { - "properties": { - "failedRequests": { - "type": "long" - } - } - }, - "type": { - "type": "keyword" - }, - "ui-metric": { - "properties": { - "count": { - "type": "integer" - } - } - }, - "updated_at": { - "type": "date" - }, - "upgrade-assistant-reindex-operation": { - "dynamic": "true", - "properties": { - "indexName": { - "type": "keyword" - }, - "status": { - "type": "integer" - } - } - }, - "upgrade-assistant-telemetry": { - "properties": { - "features": { - "properties": { - "deprecation_logging": { - "properties": { - "enabled": { - "null_value": true, - "type": "boolean" - } - } - } - } - }, - "ui_open": { - "properties": { - "cluster": { - "null_value": 0, - "type": "long" - }, - "indices": { - "null_value": 0, - "type": "long" - }, - "overview": { - "null_value": 0, - "type": "long" - } - } - }, - "ui_reindex": { - "properties": { - "close": { - "null_value": 0, - "type": "long" - }, - "open": { - "null_value": 0, - "type": "long" - }, - "start": { - "null_value": 0, - "type": "long" - }, - "stop": { - "null_value": 0, - "type": "long" - } - } - } - } - }, - "url": { - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "fields": { - "keyword": { - "ignore_above": 2048, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "visualization": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "savedSearchRefName": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" - } - } - } - } - }, - "settings": { - "index": { - "auto_expand_replicas": "0-1", - "number_of_replicas": "0", - "number_of_shards": "1" - } - } - } -} \ No newline at end of file diff --git a/x-pack/test/functional/es_archives/ml/farequote/data.json.gz b/x-pack/test/functional/es_archives/ml/farequote/data.json.gz index 17cf75a4624f7c..7b56c3de6954b1 100644 Binary files a/x-pack/test/functional/es_archives/ml/farequote/data.json.gz and b/x-pack/test/functional/es_archives/ml/farequote/data.json.gz differ diff --git a/x-pack/test/functional/es_archives/ml/farequote/mappings.json b/x-pack/test/functional/es_archives/ml/farequote/mappings.json index b00545c015a74b..1252967ac96796 100644 --- a/x-pack/test/functional/es_archives/ml/farequote/mappings.json +++ b/x-pack/test/functional/es_archives/ml/farequote/mappings.json @@ -3,7 +3,7 @@ "value": { "aliases": { }, - "index": "farequote", + "index": "ft_farequote", "mappings": { "properties": { "@timestamp": { @@ -46,1042 +46,3 @@ } } } - -{ - "type": "index", - "value": { - "aliases": { - ".kibana": { - } - }, - "index": ".kibana_1", - "mappings": { - "_meta": { - "migrationMappingPropertyHashes": { - "action": "ecc01e367a369542bc2b15dae1fb1773", - "alert": "66fb7d877c9f102755357c30c7b98e02", - "apm-telemetry": "07ee1939fa4302c62ddc052ec03fed90", - "canvas-element": "7390014e1091044523666d97247392fc", - "canvas-workpad": "b0a1706d356228dbdcb4a17e6b9eb231", - "config": "87aca8fdb053154f11383fce3dbf3edf", - "dashboard": "d00f614b29a80360e1190193fd333bab", - "file-upload-telemetry": "0ed4d3e1983d1217a30982630897092e", - "graph-workspace": "cd7ba1330e6682e9cc00b78850874be1", - "index-pattern": "66eccb05066c5a89924f48a9e9736499", - "infrastructure-ui-source": "ddc0ecb18383f6b26101a2fadb2dab0c", - "kql-telemetry": "d12a98a6f19a2d273696597547e064ee", - "map": "23d7aa4a720d4938ccde3983f87bd58d", - "maps-telemetry": "a4229f8b16a6820c6d724b7e0c1f729d", - "migrationVersion": "4a1746014a75ade3a714e1db5763276f", - "ml-telemetry": "257fd1d4b4fdbb9cb4b8a3b27da201e9", - "namespace": "2f4316de49999235636386fe51dc06c1", - "references": "7997cf5a56cc02bdc9c93361bde732b0", - "sample-data-telemetry": "7d3cfeb915303c9641c59681967ffeb4", - "search": "181661168bbadd1eff5902361e2a0d5c", - "server": "ec97f1c5da1a19609a60874e5af1100c", - "siem-ui-timeline": "1f6f0860ad7bc0dba3e42467ca40470d", - "siem-ui-timeline-note": "8874706eedc49059d4cf0f5094559084", - "siem-ui-timeline-pinned-event": "20638091112f0e14f0e443d512301c29", - "space": "25de8c2deec044392922989cfcf24c54", - "telemetry": "e1c8bc94e443aefd9458932cc0697a4d", - "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", - "type": "2f4316de49999235636386fe51dc06c1", - "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", - "updated_at": "00da57df13e94e9d98437d13ace4bfe0", - "upgrade-assistant-reindex-operation": "a53a20fe086b72c9a86da3cc12dad8a6", - "upgrade-assistant-telemetry": "56702cec857e0a9dacfb696655b4ff7b", - "url": "c7f66a0df8b1b52f17c28c4adb111105", - "visualization": "52d7a13ad68a150c4525b292d23e12cc" - } - }, - "dynamic": "strict", - "properties": { - "action": { - "properties": { - "actionTypeId": { - "type": "keyword" - }, - "config": { - "enabled": false, - "type": "object" - }, - "description": { - "type": "text" - }, - "secrets": { - "type": "binary" - } - } - }, - "alert": { - "properties": { - "actions": { - "properties": { - "actionRef": { - "type": "keyword" - }, - "group": { - "type": "keyword" - }, - "params": { - "enabled": false, - "type": "object" - } - }, - "type": "nested" - }, - "alertTypeId": { - "type": "keyword" - }, - "params": { - "enabled": false, - "type": "object" - }, - "enabled": { - "type": "boolean" - }, - "interval": { - "type": "keyword" - }, - "scheduledTaskId": { - "type": "keyword" - } - } - }, - "apm-telemetry": { - "properties": { - "has_any_services": { - "type": "boolean" - }, - "services_per_agent": { - "properties": { - "dotnet": { - "null_value": 0, - "type": "long" - }, - "go": { - "null_value": 0, - "type": "long" - }, - "java": { - "null_value": 0, - "type": "long" - }, - "js-base": { - "null_value": 0, - "type": "long" - }, - "nodejs": { - "null_value": 0, - "type": "long" - }, - "python": { - "null_value": 0, - "type": "long" - }, - "ruby": { - "null_value": 0, - "type": "long" - }, - "rum-js": { - "null_value": 0, - "type": "long" - } - } - } - } - }, - "canvas-element": { - "dynamic": "false", - "properties": { - "@created": { - "type": "date" - }, - "@timestamp": { - "type": "date" - }, - "content": { - "type": "text" - }, - "help": { - "type": "text" - }, - "image": { - "type": "text" - }, - "name": { - "fields": { - "keyword": { - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "canvas-workpad": { - "dynamic": "false", - "properties": { - "@created": { - "type": "date" - }, - "@timestamp": { - "type": "date" - }, - "name": { - "fields": { - "keyword": { - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - }, - "dateFormat:tz": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "defaultIndex": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "dashboard": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } - } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "file-upload-telemetry": { - "properties": { - "filesUploadedTotalCount": { - "type": "long" - } - } - }, - "graph-workspace": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "numLinks": { - "type": "integer" - }, - "numVertices": { - "type": "integer" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "wsState": { - "type": "text" - } - } - }, - "index-pattern": { - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "type": { - "type": "keyword" - }, - "typeMeta": { - "type": "keyword" - } - } - }, - "infrastructure-ui-source": { - "properties": { - "description": { - "type": "text" - }, - "fields": { - "properties": { - "container": { - "type": "keyword" - }, - "host": { - "type": "keyword" - }, - "pod": { - "type": "keyword" - }, - "tiebreaker": { - "type": "keyword" - }, - "timestamp": { - "type": "keyword" - } - } - }, - "logAlias": { - "type": "keyword" - }, - "logColumns": { - "properties": { - "fieldColumn": { - "properties": { - "field": { - "type": "keyword" - }, - "id": { - "type": "keyword" - } - } - }, - "messageColumn": { - "properties": { - "id": { - "type": "keyword" - } - } - }, - "timestampColumn": { - "properties": { - "id": { - "type": "keyword" - } - } - } - }, - "type": "nested" - }, - "metricAlias": { - "type": "keyword" - }, - "name": { - "type": "text" - } - } - }, - "kql-telemetry": { - "properties": { - "optInCount": { - "type": "long" - }, - "optOutCount": { - "type": "long" - } - } - }, - "map": { - "properties": { - "bounds": { - "type": "geo_shape" - }, - "description": { - "type": "text" - }, - "layerListJSON": { - "type": "text" - }, - "mapStateJSON": { - "type": "text" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "maps-telemetry": { - "properties": { - "attributesPerMap": { - "properties": { - "dataSourcesCount": { - "properties": { - "avg": { - "type": "long" - }, - "max": { - "type": "long" - }, - "min": { - "type": "long" - } - } - }, - "emsVectorLayersCount": { - "dynamic": "true", - "type": "object" - }, - "layerTypesCount": { - "dynamic": "true", - "type": "object" - }, - "layersCount": { - "properties": { - "avg": { - "type": "long" - }, - "max": { - "type": "long" - }, - "min": { - "type": "long" - } - } - } - } - }, - "mapsTotalCount": { - "type": "long" - }, - "timeCaptured": { - "type": "date" - } - } - }, - "migrationVersion": { - "dynamic": "true", - "properties": { - "index-pattern": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "space": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "ml-telemetry": { - "properties": { - "file_data_visualizer": { - "properties": { - "index_creation_count": { - "type": "long" - } - } - } - } - }, - "namespace": { - "type": "keyword" - }, - "references": { - "properties": { - "id": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - } - }, - "type": "nested" - }, - "sample-data-telemetry": { - "properties": { - "installCount": { - "type": "long" - }, - "unInstallCount": { - "type": "long" - } - } - }, - "search": { - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "server": { - "properties": { - "uuid": { - "type": "keyword" - } - } - }, - "siem-ui-timeline": { - "properties": { - "columns": { - "properties": { - "aggregatable": { - "type": "boolean" - }, - "category": { - "type": "keyword" - }, - "columnHeaderType": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "example": { - "type": "text" - }, - "id": { - "type": "keyword" - }, - "indexes": { - "type": "keyword" - }, - "name": { - "type": "text" - }, - "placeholder": { - "type": "text" - }, - "searchable": { - "type": "boolean" - }, - "type": { - "type": "keyword" - } - } - }, - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "dataProviders": { - "properties": { - "and": { - "properties": { - "enabled": { - "type": "boolean" - }, - "excluded": { - "type": "boolean" - }, - "id": { - "type": "keyword" - }, - "kqlQuery": { - "type": "text" - }, - "name": { - "type": "text" - }, - "queryMatch": { - "properties": { - "displayField": { - "type": "text" - }, - "displayValue": { - "type": "text" - }, - "field": { - "type": "text" - }, - "operator": { - "type": "text" - }, - "value": { - "type": "text" - } - } - } - } - }, - "enabled": { - "type": "boolean" - }, - "excluded": { - "type": "boolean" - }, - "id": { - "type": "keyword" - }, - "kqlQuery": { - "type": "text" - }, - "name": { - "type": "text" - }, - "queryMatch": { - "properties": { - "displayField": { - "type": "text" - }, - "displayValue": { - "type": "text" - }, - "field": { - "type": "text" - }, - "operator": { - "type": "text" - }, - "value": { - "type": "text" - } - } - } - } - }, - "dateRange": { - "properties": { - "end": { - "type": "date" - }, - "start": { - "type": "date" - } - } - }, - "description": { - "type": "text" - }, - "favorite": { - "properties": { - "favoriteDate": { - "type": "date" - }, - "fullName": { - "type": "text" - }, - "keySearch": { - "type": "text" - }, - "userName": { - "type": "text" - } - } - }, - "kqlMode": { - "type": "keyword" - }, - "kqlQuery": { - "properties": { - "filterQuery": { - "properties": { - "kuery": { - "properties": { - "expression": { - "type": "text" - }, - "kind": { - "type": "keyword" - } - } - }, - "serializedQuery": { - "type": "text" - } - } - } - } - }, - "sort": { - "properties": { - "columnId": { - "type": "keyword" - }, - "sortDirection": { - "type": "keyword" - } - } - }, - "title": { - "type": "text" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "siem-ui-timeline-note": { - "properties": { - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "eventId": { - "type": "keyword" - }, - "note": { - "type": "text" - }, - "timelineId": { - "type": "keyword" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "siem-ui-timeline-pinned-event": { - "properties": { - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "eventId": { - "type": "keyword" - }, - "timelineId": { - "type": "keyword" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "space": { - "properties": { - "_reserved": { - "type": "boolean" - }, - "color": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "disabledFeatures": { - "type": "keyword" - }, - "initials": { - "type": "keyword" - }, - "name": { - "fields": { - "keyword": { - "ignore_above": 2048, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "telemetry": { - "properties": { - "enabled": { - "type": "boolean" - } - } - }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "type": { - "type": "keyword" - }, - "ui-metric": { - "properties": { - "count": { - "type": "integer" - } - } - }, - "updated_at": { - "type": "date" - }, - "upgrade-assistant-reindex-operation": { - "dynamic": "true", - "properties": { - "indexName": { - "type": "keyword" - }, - "status": { - "type": "integer" - } - } - }, - "upgrade-assistant-telemetry": { - "properties": { - "features": { - "properties": { - "deprecation_logging": { - "properties": { - "enabled": { - "null_value": true, - "type": "boolean" - } - } - } - } - }, - "ui_open": { - "properties": { - "cluster": { - "null_value": 0, - "type": "long" - }, - "indices": { - "null_value": 0, - "type": "long" - }, - "overview": { - "null_value": 0, - "type": "long" - } - } - }, - "ui_reindex": { - "properties": { - "close": { - "null_value": 0, - "type": "long" - }, - "open": { - "null_value": 0, - "type": "long" - }, - "start": { - "null_value": 0, - "type": "long" - }, - "stop": { - "null_value": 0, - "type": "long" - } - } - } - } - }, - "url": { - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "fields": { - "keyword": { - "ignore_above": 2048, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "visualization": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "savedSearchRefName": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" - } - } - } - } - }, - "settings": { - "index": { - "auto_expand_replicas": "0-1", - "number_of_replicas": "0", - "number_of_shards": "1" - } - } - } -} diff --git a/x-pack/test/functional/es_archives/ml/ihp_outlier/data.json.gz b/x-pack/test/functional/es_archives/ml/ihp_outlier/data.json.gz index de0d2d6dd4ccc5..34637dfd812d1a 100644 Binary files a/x-pack/test/functional/es_archives/ml/ihp_outlier/data.json.gz and b/x-pack/test/functional/es_archives/ml/ihp_outlier/data.json.gz differ diff --git a/x-pack/test/functional/es_archives/ml/ihp_outlier/mappings.json b/x-pack/test/functional/es_archives/ml/ihp_outlier/mappings.json index f90c6e67daac43..a20b1de81010f4 100644 --- a/x-pack/test/functional/es_archives/ml/ihp_outlier/mappings.json +++ b/x-pack/test/functional/es_archives/ml/ihp_outlier/mappings.json @@ -3,7 +3,7 @@ "value": { "aliases": { }, - "index": "ihp_outlier", + "index": "ft_ihp_outlier", "mappings": { "properties": { "1stFlrSF": { @@ -109,1395 +109,3 @@ } } } - -{ - "type": "index", - "value": { - "aliases": { - ".kibana": { - } - }, - "index": ".kibana_1", - "mappings": { - "_meta": { - "migrationMappingPropertyHashes": { - "action": "ecc01e367a369542bc2b15dae1fb1773", - "action_task_params": "a9d49f184ee89641044be0ca2950fa3a", - "alert": "3cdf52bff6f482e53b825b45686604db", - "apm-indices": "9bb9b2bf1fa636ed8619cbab5ce6a1dd", - "apm-services-telemetry": "07ee1939fa4302c62ddc052ec03fed90", - "canvas-element": "7390014e1091044523666d97247392fc", - "canvas-workpad": "b0a1706d356228dbdcb4a17e6b9eb231", - "config": "87aca8fdb053154f11383fce3dbf3edf", - "dashboard": "d00f614b29a80360e1190193fd333bab", - "file-upload-telemetry": "0ed4d3e1983d1217a30982630897092e", - "graph-workspace": "cd7ba1330e6682e9cc00b78850874be1", - "index-pattern": "66eccb05066c5a89924f48a9e9736499", - "infrastructure-ui-source": "ddc0ecb18383f6b26101a2fadb2dab0c", - "inventory-view": "84b320fd67209906333ffce261128462", - "kql-telemetry": "d12a98a6f19a2d273696597547e064ee", - "lens": "21c3ea0763beb1ecb0162529706b88c5", - "lens-ui-telemetry": "509bfa5978586998e05f9e303c07a327", - "map": "23d7aa4a720d4938ccde3983f87bd58d", - "maps-telemetry": "a4229f8b16a6820c6d724b7e0c1f729d", - "metrics-explorer-view": "53c5365793677328df0ccb6138bf3cdd", - "migrationVersion": "4a1746014a75ade3a714e1db5763276f", - "ml-telemetry": "257fd1d4b4fdbb9cb4b8a3b27da201e9", - "namespace": "2f4316de49999235636386fe51dc06c1", - "query": "11aaeb7f5f7fa5bb43f25e18ce26e7d9", - "references": "7997cf5a56cc02bdc9c93361bde732b0", - "sample-data-telemetry": "7d3cfeb915303c9641c59681967ffeb4", - "search": "181661168bbadd1eff5902361e2a0d5c", - "server": "ec97f1c5da1a19609a60874e5af1100c", - "siem-ui-timeline": "6485ab095be8d15246667b98a1a34295", - "siem-ui-timeline-note": "8874706eedc49059d4cf0f5094559084", - "siem-ui-timeline-pinned-event": "20638091112f0e14f0e443d512301c29", - "space": "c5ca8acafa0beaa4d08d014a97b6bc6b", - "telemetry": "358ffaa88ba34a97d55af0933a117de4", - "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", - "type": "2f4316de49999235636386fe51dc06c1", - "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", - "updated_at": "00da57df13e94e9d98437d13ace4bfe0", - "upgrade-assistant-reindex-operation": "a53a20fe086b72c9a86da3cc12dad8a6", - "upgrade-assistant-telemetry": "56702cec857e0a9dacfb696655b4ff7b", - "url": "c7f66a0df8b1b52f17c28c4adb111105", - "visualization": "52d7a13ad68a150c4525b292d23e12cc" - } - }, - "dynamic": "strict", - "properties": { - "action": { - "properties": { - "actionTypeId": { - "type": "keyword" - }, - "config": { - "enabled": false, - "type": "object" - }, - "description": { - "type": "text" - }, - "secrets": { - "type": "binary" - } - } - }, - "action_task_params": { - "properties": { - "actionId": { - "type": "keyword" - }, - "apiKey": { - "type": "binary" - }, - "params": { - "enabled": false, - "type": "object" - } - } - }, - "alert": { - "properties": { - "actions": { - "properties": { - "actionRef": { - "type": "keyword" - }, - "group": { - "type": "keyword" - }, - "params": { - "enabled": false, - "type": "object" - } - }, - "type": "nested" - }, - "alertTypeId": { - "type": "keyword" - }, - "apiKey": { - "type": "binary" - }, - "apiKeyOwner": { - "type": "keyword" - }, - "createdBy": { - "type": "keyword" - }, - "enabled": { - "type": "boolean" - }, - "interval": { - "type": "keyword" - }, - "muteAll": { - "type": "boolean" - }, - "mutedInstanceIds": { - "type": "keyword" - }, - "name": { - "type": "text" - }, - "params": { - "enabled": false, - "type": "object" - }, - "scheduledTaskId": { - "type": "keyword" - }, - "tags": { - "type": "keyword" - }, - "throttle": { - "type": "keyword" - }, - "updatedBy": { - "type": "keyword" - } - } - }, - "apm-indices": { - "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } - } - } - }, - "apm-services-telemetry": { - "properties": { - "has_any_services": { - "type": "boolean" - }, - "services_per_agent": { - "properties": { - "dotnet": { - "null_value": 0, - "type": "long" - }, - "go": { - "null_value": 0, - "type": "long" - }, - "java": { - "null_value": 0, - "type": "long" - }, - "js-base": { - "null_value": 0, - "type": "long" - }, - "nodejs": { - "null_value": 0, - "type": "long" - }, - "python": { - "null_value": 0, - "type": "long" - }, - "ruby": { - "null_value": 0, - "type": "long" - }, - "rum-js": { - "null_value": 0, - "type": "long" - } - } - } - } - }, - "canvas-element": { - "dynamic": "false", - "properties": { - "@created": { - "type": "date" - }, - "@timestamp": { - "type": "date" - }, - "content": { - "type": "text" - }, - "help": { - "type": "text" - }, - "image": { - "type": "text" - }, - "name": { - "fields": { - "keyword": { - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "canvas-workpad": { - "dynamic": "false", - "properties": { - "@created": { - "type": "date" - }, - "@timestamp": { - "type": "date" - }, - "name": { - "fields": { - "keyword": { - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - }, - "dateFormat:tz": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "defaultIndex": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "dashboard": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } - } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "file-upload-telemetry": { - "properties": { - "filesUploadedTotalCount": { - "type": "long" - } - } - }, - "graph-workspace": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "numLinks": { - "type": "integer" - }, - "numVertices": { - "type": "integer" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "wsState": { - "type": "text" - } - } - }, - "index-pattern": { - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "type": { - "type": "keyword" - }, - "typeMeta": { - "type": "keyword" - } - } - }, - "infrastructure-ui-source": { - "properties": { - "description": { - "type": "text" - }, - "fields": { - "properties": { - "container": { - "type": "keyword" - }, - "host": { - "type": "keyword" - }, - "pod": { - "type": "keyword" - }, - "tiebreaker": { - "type": "keyword" - }, - "timestamp": { - "type": "keyword" - } - } - }, - "logAlias": { - "type": "keyword" - }, - "logColumns": { - "properties": { - "fieldColumn": { - "properties": { - "field": { - "type": "keyword" - }, - "id": { - "type": "keyword" - } - } - }, - "messageColumn": { - "properties": { - "id": { - "type": "keyword" - } - } - }, - "timestampColumn": { - "properties": { - "id": { - "type": "keyword" - } - } - } - }, - "type": "nested" - }, - "metricAlias": { - "type": "keyword" - }, - "name": { - "type": "text" - } - } - }, - "inventory-view": { - "properties": { - "autoBounds": { - "type": "boolean" - }, - "autoReload": { - "type": "boolean" - }, - "boundsOverride": { - "properties": { - "max": { - "type": "integer" - }, - "min": { - "type": "integer" - } - } - }, - "customOptions": { - "properties": { - "field": { - "type": "keyword" - }, - "text": { - "type": "keyword" - } - }, - "type": "nested" - }, - "filterQuery": { - "properties": { - "expression": { - "type": "keyword" - }, - "kind": { - "type": "keyword" - } - } - }, - "groupBy": { - "properties": { - "field": { - "type": "keyword" - }, - "label": { - "type": "keyword" - } - }, - "type": "nested" - }, - "metric": { - "properties": { - "type": { - "type": "keyword" - } - } - }, - "name": { - "type": "keyword" - }, - "nodeType": { - "type": "keyword" - }, - "time": { - "type": "integer" - }, - "view": { - "type": "keyword" - } - } - }, - "kql-telemetry": { - "properties": { - "optInCount": { - "type": "long" - }, - "optOutCount": { - "type": "long" - } - } - }, - "lens": { - "properties": { - "expression": { - "index": false, - "type": "keyword" - }, - "state": { - "type": "flattened" - }, - "title": { - "type": "text" - }, - "visualizationType": { - "type": "keyword" - } - } - }, - "lens-ui-telemetry": { - "properties": { - "count": { - "type": "integer" - }, - "date": { - "type": "date" - }, - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - } - } - }, - "map": { - "properties": { - "bounds": { - "type": "geo_shape" - }, - "description": { - "type": "text" - }, - "layerListJSON": { - "type": "text" - }, - "mapStateJSON": { - "type": "text" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "maps-telemetry": { - "properties": { - "attributesPerMap": { - "properties": { - "dataSourcesCount": { - "properties": { - "avg": { - "type": "long" - }, - "max": { - "type": "long" - }, - "min": { - "type": "long" - } - } - }, - "emsVectorLayersCount": { - "dynamic": "true", - "type": "object" - }, - "layerTypesCount": { - "dynamic": "true", - "type": "object" - }, - "layersCount": { - "properties": { - "avg": { - "type": "long" - }, - "max": { - "type": "long" - }, - "min": { - "type": "long" - } - } - } - } - }, - "mapsTotalCount": { - "type": "long" - }, - "timeCaptured": { - "type": "date" - } - } - }, - "metrics-explorer-view": { - "properties": { - "chartOptions": { - "properties": { - "stack": { - "type": "boolean" - }, - "type": { - "type": "keyword" - }, - "yAxisMode": { - "type": "keyword" - } - } - }, - "currentTimerange": { - "properties": { - "from": { - "type": "keyword" - }, - "interval": { - "type": "keyword" - }, - "to": { - "type": "keyword" - } - } - }, - "name": { - "type": "keyword" - }, - "options": { - "properties": { - "aggregation": { - "type": "keyword" - }, - "filterQuery": { - "type": "keyword" - }, - "groupBy": { - "type": "keyword" - }, - "limit": { - "type": "integer" - }, - "metrics": { - "properties": { - "aggregation": { - "type": "keyword" - }, - "color": { - "type": "keyword" - }, - "field": { - "type": "keyword" - }, - "label": { - "type": "keyword" - } - }, - "type": "nested" - } - } - } - } - }, - "migrationVersion": { - "dynamic": "true", - "properties": { - "index-pattern": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "space": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "ml-telemetry": { - "properties": { - "file_data_visualizer": { - "properties": { - "index_creation_count": { - "type": "long" - } - } - } - } - }, - "namespace": { - "type": "keyword" - }, - "query": { - "properties": { - "description": { - "type": "text" - }, - "filters": { - "enabled": false, - "type": "object" - }, - "query": { - "properties": { - "language": { - "type": "keyword" - }, - "query": { - "index": false, - "type": "keyword" - } - } - }, - "timefilter": { - "enabled": false, - "type": "object" - }, - "title": { - "type": "text" - } - } - }, - "references": { - "properties": { - "id": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - } - }, - "type": "nested" - }, - "sample-data-telemetry": { - "properties": { - "installCount": { - "type": "long" - }, - "unInstallCount": { - "type": "long" - } - } - }, - "search": { - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "server": { - "properties": { - "uuid": { - "type": "keyword" - } - } - }, - "siem-ui-timeline": { - "properties": { - "columns": { - "properties": { - "aggregatable": { - "type": "boolean" - }, - "category": { - "type": "keyword" - }, - "columnHeaderType": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "example": { - "type": "text" - }, - "id": { - "type": "keyword" - }, - "indexes": { - "type": "keyword" - }, - "name": { - "type": "text" - }, - "placeholder": { - "type": "text" - }, - "searchable": { - "type": "boolean" - }, - "type": { - "type": "keyword" - } - } - }, - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "dataProviders": { - "properties": { - "and": { - "properties": { - "enabled": { - "type": "boolean" - }, - "excluded": { - "type": "boolean" - }, - "id": { - "type": "keyword" - }, - "kqlQuery": { - "type": "text" - }, - "name": { - "type": "text" - }, - "queryMatch": { - "properties": { - "displayField": { - "type": "text" - }, - "displayValue": { - "type": "text" - }, - "field": { - "type": "text" - }, - "operator": { - "type": "text" - }, - "value": { - "type": "text" - } - } - } - } - }, - "enabled": { - "type": "boolean" - }, - "excluded": { - "type": "boolean" - }, - "id": { - "type": "keyword" - }, - "kqlQuery": { - "type": "text" - }, - "name": { - "type": "text" - }, - "queryMatch": { - "properties": { - "displayField": { - "type": "text" - }, - "displayValue": { - "type": "text" - }, - "field": { - "type": "text" - }, - "operator": { - "type": "text" - }, - "value": { - "type": "text" - } - } - } - } - }, - "dateRange": { - "properties": { - "end": { - "type": "date" - }, - "start": { - "type": "date" - } - } - }, - "description": { - "type": "text" - }, - "favorite": { - "properties": { - "favoriteDate": { - "type": "date" - }, - "fullName": { - "type": "text" - }, - "keySearch": { - "type": "text" - }, - "userName": { - "type": "text" - } - } - }, - "filters": { - "properties": { - "exists": { - "type": "text" - }, - "match_all": { - "type": "text" - }, - "meta": { - "properties": { - "alias": { - "type": "text" - }, - "controlledBy": { - "type": "text" - }, - "disabled": { - "type": "boolean" - }, - "field": { - "type": "text" - }, - "formattedValue": { - "type": "text" - }, - "index": { - "type": "keyword" - }, - "key": { - "type": "keyword" - }, - "negate": { - "type": "boolean" - }, - "params": { - "type": "text" - }, - "type": { - "type": "keyword" - }, - "value": { - "type": "text" - } - } - }, - "missing": { - "type": "text" - }, - "query": { - "type": "text" - }, - "range": { - "type": "text" - }, - "script": { - "type": "text" - } - } - }, - "kqlMode": { - "type": "keyword" - }, - "kqlQuery": { - "properties": { - "filterQuery": { - "properties": { - "kuery": { - "properties": { - "expression": { - "type": "text" - }, - "kind": { - "type": "keyword" - } - } - }, - "serializedQuery": { - "type": "text" - } - } - } - } - }, - "savedQueryId": { - "type": "keyword" - }, - "sort": { - "properties": { - "columnId": { - "type": "keyword" - }, - "sortDirection": { - "type": "keyword" - } - } - }, - "title": { - "type": "text" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "siem-ui-timeline-note": { - "properties": { - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "eventId": { - "type": "keyword" - }, - "note": { - "type": "text" - }, - "timelineId": { - "type": "keyword" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "siem-ui-timeline-pinned-event": { - "properties": { - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "eventId": { - "type": "keyword" - }, - "timelineId": { - "type": "keyword" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "space": { - "properties": { - "_reserved": { - "type": "boolean" - }, - "color": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "disabledFeatures": { - "type": "keyword" - }, - "imageUrl": { - "index": false, - "type": "text" - }, - "initials": { - "type": "keyword" - }, - "name": { - "fields": { - "keyword": { - "ignore_above": 2048, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "telemetry": { - "properties": { - "enabled": { - "type": "boolean" - }, - "lastReported": { - "type": "date" - }, - "lastVersionChecked": { - "ignore_above": 256, - "type": "keyword" - }, - "sendUsageFrom": { - "ignore_above": 256, - "type": "keyword" - }, - "userHasSeenNotice": { - "type": "boolean" - } - } - }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "type": { - "type": "keyword" - }, - "ui-metric": { - "properties": { - "count": { - "type": "integer" - } - } - }, - "updated_at": { - "type": "date" - }, - "upgrade-assistant-reindex-operation": { - "dynamic": "true", - "properties": { - "indexName": { - "type": "keyword" - }, - "status": { - "type": "integer" - } - } - }, - "upgrade-assistant-telemetry": { - "properties": { - "features": { - "properties": { - "deprecation_logging": { - "properties": { - "enabled": { - "null_value": true, - "type": "boolean" - } - } - } - } - }, - "ui_open": { - "properties": { - "cluster": { - "null_value": 0, - "type": "long" - }, - "indices": { - "null_value": 0, - "type": "long" - }, - "overview": { - "null_value": 0, - "type": "long" - } - } - }, - "ui_reindex": { - "properties": { - "close": { - "null_value": 0, - "type": "long" - }, - "open": { - "null_value": 0, - "type": "long" - }, - "start": { - "null_value": 0, - "type": "long" - }, - "stop": { - "null_value": 0, - "type": "long" - } - } - } - } - }, - "url": { - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "fields": { - "keyword": { - "ignore_above": 2048, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "visualization": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "savedSearchRefName": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" - } - } - } - } - }, - "settings": { - "index": { - "auto_expand_replicas": "0-1", - "number_of_replicas": "0", - "number_of_shards": "1" - } - } - } -} \ No newline at end of file diff --git a/x-pack/test/functional/es_archives/ml/sample_logs/data.json.gz b/x-pack/test/functional/es_archives/ml/sample_logs/data.json.gz index 03ceb319a6afed..88937d484d24e1 100644 Binary files a/x-pack/test/functional/es_archives/ml/sample_logs/data.json.gz and b/x-pack/test/functional/es_archives/ml/sample_logs/data.json.gz differ diff --git a/x-pack/test/functional/es_archives/ml/sample_logs/mappings.json b/x-pack/test/functional/es_archives/ml/sample_logs/mappings.json index 1c7490e139be55..62f69063695e7b 100644 --- a/x-pack/test/functional/es_archives/ml/sample_logs/mappings.json +++ b/x-pack/test/functional/es_archives/ml/sample_logs/mappings.json @@ -165,2998 +165,3 @@ } } } - -{ - "type": "index", - "value": { - "aliases": { - ".kibana": { - } - }, - "index": ".kibana_1", - "mappings": { - "_meta": { - "migrationMappingPropertyHashes": { - "action": "6e96ac5e648f57523879661ea72525b7", - "action_task_params": "a9d49f184ee89641044be0ca2950fa3a", - "agent_configs": "38abaf89513877745c359e7700c0c66a", - "agent_events": "3231653fafe4ef3196fe3b32ab774bf2", - "agents": "75c0f4a11560dbc38b65e5e1d98fc9da", - "alert": "7b44fba6773e37c806ce290ea9b7024e", - "apm-indices": "9bb9b2bf1fa636ed8619cbab5ce6a1dd", - "apm-telemetry": "e8619030e08b671291af04c4603b4944", - "application_usage_totals": "c897e4310c5f24b07caaff3db53ae2c1", - "application_usage_transactional": "965839e75f809fefe04f92dc4d99722a", - "canvas-element": "7390014e1091044523666d97247392fc", - "canvas-workpad": "b0a1706d356228dbdcb4a17e6b9eb231", - "cases": "08b8b110dbca273d37e8aef131ecab61", - "cases-comments": "c2061fb929f585df57425102fa928b4b", - "cases-configure": "42711cbb311976c0687853f4c1354572", - "cases-user-actions": "32277330ec6b721abe3b846cfd939a71", - "config": "ae24d22d5986d04124cc6568f771066f", - "dashboard": "d00f614b29a80360e1190193fd333bab", - "datasources": "d4bc0c252b2b5683ff21ea32d00acffc", - "enrollment_api_keys": "28b91e20b105b6f928e2012600085d8f", - "epm-package": "75d12cd13c867fd713d7dfb27366bc20", - "file-upload-telemetry": "0ed4d3e1983d1217a30982630897092e", - "graph-workspace": "cd7ba1330e6682e9cc00b78850874be1", - "index-pattern": "66eccb05066c5a89924f48a9e9736499", - "infrastructure-ui-source": "ddc0ecb18383f6b26101a2fadb2dab0c", - "inventory-view": "9ecce5b58867403613d82fe496470b34", - "kql-telemetry": "d12a98a6f19a2d273696597547e064ee", - "lens": "21c3ea0763beb1ecb0162529706b88c5", - "lens-ui-telemetry": "509bfa5978586998e05f9e303c07a327", - "map": "23d7aa4a720d4938ccde3983f87bd58d", - "maps-telemetry": "268da3a48066123fc5baf35abaa55014", - "metrics-explorer-view": "53c5365793677328df0ccb6138bf3cdd", - "migrationVersion": "4a1746014a75ade3a714e1db5763276f", - "ml-telemetry": "257fd1d4b4fdbb9cb4b8a3b27da201e9", - "namespace": "2f4316de49999235636386fe51dc06c1", - "outputs": "aee9782e0d500b867859650a36280165", - "query": "11aaeb7f5f7fa5bb43f25e18ce26e7d9", - "references": "7997cf5a56cc02bdc9c93361bde732b0", - "sample-data-telemetry": "7d3cfeb915303c9641c59681967ffeb4", - "search": "181661168bbadd1eff5902361e2a0d5c", - "server": "ec97f1c5da1a19609a60874e5af1100c", - "siem-detection-engine-rule-status": "ae783f41c6937db6b7a2ef5c93a9e9b0", - "siem-ui-timeline": "ac8020190f5950dd3250b6499144e7fb", - "siem-ui-timeline-note": "8874706eedc49059d4cf0f5094559084", - "siem-ui-timeline-pinned-event": "20638091112f0e14f0e443d512301c29", - "space": "c5ca8acafa0beaa4d08d014a97b6bc6b", - "telemetry": "36a616f7026dfa617d6655df850fe16d", - "timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf", - "tsvb-validation-telemetry": "3a37ef6c8700ae6fc97d5c7da00e9215", - "type": "2f4316de49999235636386fe51dc06c1", - "ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3", - "updated_at": "00da57df13e94e9d98437d13ace4bfe0", - "upgrade-assistant-reindex-operation": "a53a20fe086b72c9a86da3cc12dad8a6", - "upgrade-assistant-telemetry": "56702cec857e0a9dacfb696655b4ff7b", - "uptime-dynamic-settings": "b6289473c8985c79b6c47eebc19a0ca5", - "url": "c7f66a0df8b1b52f17c28c4adb111105", - "visualization": "52d7a13ad68a150c4525b292d23e12cc" - } - }, - "dynamic": "strict", - "properties": { - "action": { - "properties": { - "actionTypeId": { - "type": "keyword" - }, - "config": { - "enabled": false, - "type": "object" - }, - "name": { - "fields": { - "keyword": { - "type": "keyword" - } - }, - "type": "text" - }, - "secrets": { - "type": "binary" - } - } - }, - "action_task_params": { - "properties": { - "actionId": { - "type": "keyword" - }, - "apiKey": { - "type": "binary" - }, - "params": { - "enabled": false, - "type": "object" - } - } - }, - "agent_configs": { - "properties": { - "datasources": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "id": { - "type": "keyword" - }, - "is_default": { - "type": "boolean" - }, - "name": { - "type": "text" - }, - "namespace": { - "type": "keyword" - }, - "revision": { - "type": "integer" - }, - "status": { - "type": "keyword" - }, - "updated_by": { - "type": "keyword" - }, - "updated_on": { - "type": "keyword" - } - } - }, - "agent_events": { - "properties": { - "action_id": { - "type": "keyword" - }, - "agent_id": { - "type": "keyword" - }, - "config_id": { - "type": "keyword" - }, - "data": { - "type": "text" - }, - "message": { - "type": "text" - }, - "payload": { - "type": "text" - }, - "stream_id": { - "type": "keyword" - }, - "subtype": { - "type": "keyword" - }, - "timestamp": { - "type": "date" - }, - "type": { - "type": "keyword" - } - } - }, - "agents": { - "properties": { - "access_api_key_id": { - "type": "keyword" - }, - "actions": { - "properties": { - "created_at": { - "type": "date" - }, - "data": { - "type": "text" - }, - "id": { - "type": "keyword" - }, - "sent_at": { - "type": "date" - }, - "type": { - "type": "keyword" - } - }, - "type": "nested" - }, - "active": { - "type": "boolean" - }, - "config_id": { - "type": "keyword" - }, - "config_newest_revision": { - "type": "integer" - }, - "config_revision": { - "type": "integer" - }, - "current_error_events": { - "type": "text" - }, - "default_api_key": { - "type": "keyword" - }, - "enrolled_at": { - "type": "date" - }, - "last_checkin": { - "type": "date" - }, - "last_updated": { - "type": "date" - }, - "local_metadata": { - "type": "text" - }, - "shared_id": { - "type": "keyword" - }, - "type": { - "type": "keyword" - }, - "updated_at": { - "type": "date" - }, - "user_provided_metadata": { - "type": "text" - }, - "version": { - "type": "keyword" - } - } - }, - "alert": { - "properties": { - "actions": { - "properties": { - "actionRef": { - "type": "keyword" - }, - "actionTypeId": { - "type": "keyword" - }, - "group": { - "type": "keyword" - }, - "params": { - "enabled": false, - "type": "object" - } - }, - "type": "nested" - }, - "alertTypeId": { - "type": "keyword" - }, - "apiKey": { - "type": "binary" - }, - "apiKeyOwner": { - "type": "keyword" - }, - "consumer": { - "type": "keyword" - }, - "createdAt": { - "type": "date" - }, - "createdBy": { - "type": "keyword" - }, - "enabled": { - "type": "boolean" - }, - "muteAll": { - "type": "boolean" - }, - "mutedInstanceIds": { - "type": "keyword" - }, - "name": { - "fields": { - "keyword": { - "type": "keyword" - } - }, - "type": "text" - }, - "params": { - "enabled": false, - "type": "object" - }, - "schedule": { - "properties": { - "interval": { - "type": "keyword" - } - } - }, - "scheduledTaskId": { - "type": "keyword" - }, - "tags": { - "type": "keyword" - }, - "throttle": { - "type": "keyword" - }, - "updatedBy": { - "type": "keyword" - } - } - }, - "apm-indices": { - "properties": { - "apm_oss": { - "properties": { - "errorIndices": { - "type": "keyword" - }, - "metricsIndices": { - "type": "keyword" - }, - "onboardingIndices": { - "type": "keyword" - }, - "sourcemapIndices": { - "type": "keyword" - }, - "spanIndices": { - "type": "keyword" - }, - "transactionIndices": { - "type": "keyword" - } - } - } - } - }, - "apm-telemetry": { - "properties": { - "agents": { - "properties": { - "dotnet": { - "properties": { - "agent": { - "properties": { - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "service": { - "properties": { - "framework": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "language": { - "properties": { - "name": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "runtime": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - } - } - } - } - }, - "go": { - "properties": { - "agent": { - "properties": { - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "service": { - "properties": { - "framework": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "language": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "runtime": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - } - } - } - } - }, - "java": { - "properties": { - "agent": { - "properties": { - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "service": { - "properties": { - "framework": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "language": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "runtime": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - } - } - } - } - }, - "js-base": { - "properties": { - "agent": { - "properties": { - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "service": { - "properties": { - "framework": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "language": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "runtime": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - } - } - } - } - }, - "nodejs": { - "properties": { - "agent": { - "properties": { - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "service": { - "properties": { - "framework": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "language": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "runtime": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - } - } - } - } - }, - "python": { - "properties": { - "agent": { - "properties": { - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "service": { - "properties": { - "framework": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "language": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "runtime": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - } - } - } - } - }, - "ruby": { - "properties": { - "agent": { - "properties": { - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "service": { - "properties": { - "framework": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "language": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "runtime": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - } - } - } - } - }, - "rum-js": { - "properties": { - "agent": { - "properties": { - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "service": { - "properties": { - "framework": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "language": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - }, - "runtime": { - "properties": { - "composite": { - "ignore_above": 256, - "type": "keyword" - }, - "name": { - "ignore_above": 256, - "type": "keyword" - }, - "version": { - "ignore_above": 256, - "type": "keyword" - } - } - } - } - } - } - } - } - }, - "cardinality": { - "properties": { - "transaction": { - "properties": { - "name": { - "properties": { - "all_agents": { - "properties": { - "1d": { - "type": "long" - } - } - }, - "rum": { - "properties": { - "1d": { - "type": "long" - } - } - } - } - } - } - }, - "user_agent": { - "properties": { - "original": { - "properties": { - "all_agents": { - "properties": { - "1d": { - "type": "long" - } - } - }, - "rum": { - "properties": { - "1d": { - "type": "long" - } - } - } - } - } - } - } - } - }, - "counts": { - "properties": { - "agent_configuration": { - "properties": { - "all": { - "type": "long" - } - } - }, - "error": { - "properties": { - "1d": { - "type": "long" - }, - "all": { - "type": "long" - } - } - }, - "max_error_groups_per_service": { - "properties": { - "1d": { - "type": "long" - } - } - }, - "max_transaction_groups_per_service": { - "properties": { - "1d": { - "type": "long" - } - } - }, - "metric": { - "properties": { - "1d": { - "type": "long" - }, - "all": { - "type": "long" - } - } - }, - "onboarding": { - "properties": { - "1d": { - "type": "long" - }, - "all": { - "type": "long" - } - } - }, - "services": { - "properties": { - "1d": { - "type": "long" - } - } - }, - "sourcemap": { - "properties": { - "1d": { - "type": "long" - }, - "all": { - "type": "long" - } - } - }, - "span": { - "properties": { - "1d": { - "type": "long" - }, - "all": { - "type": "long" - } - } - }, - "traces": { - "properties": { - "1d": { - "type": "long" - } - } - }, - "transaction": { - "properties": { - "1d": { - "type": "long" - }, - "all": { - "type": "long" - } - } - } - } - }, - "has_any_services": { - "type": "boolean" - }, - "indices": { - "properties": { - "all": { - "properties": { - "total": { - "properties": { - "docs": { - "properties": { - "count": { - "type": "long" - } - } - }, - "store": { - "properties": { - "size_in_bytes": { - "type": "long" - } - } - } - } - } - } - }, - "shards": { - "properties": { - "total": { - "type": "long" - } - } - } - } - }, - "integrations": { - "properties": { - "ml": { - "properties": { - "all_jobs_count": { - "type": "long" - } - } - } - } - }, - "retainment": { - "properties": { - "error": { - "properties": { - "ms": { - "type": "long" - } - } - }, - "metric": { - "properties": { - "ms": { - "type": "long" - } - } - }, - "onboarding": { - "properties": { - "ms": { - "type": "long" - } - } - }, - "span": { - "properties": { - "ms": { - "type": "long" - } - } - }, - "transaction": { - "properties": { - "ms": { - "type": "long" - } - } - } - } - }, - "services_per_agent": { - "properties": { - "dotnet": { - "null_value": 0, - "type": "long" - }, - "go": { - "null_value": 0, - "type": "long" - }, - "java": { - "null_value": 0, - "type": "long" - }, - "js-base": { - "null_value": 0, - "type": "long" - }, - "nodejs": { - "null_value": 0, - "type": "long" - }, - "python": { - "null_value": 0, - "type": "long" - }, - "ruby": { - "null_value": 0, - "type": "long" - }, - "rum-js": { - "null_value": 0, - "type": "long" - } - } - }, - "tasks": { - "properties": { - "agent_configuration": { - "properties": { - "took": { - "properties": { - "ms": { - "type": "long" - } - } - } - } - }, - "agents": { - "properties": { - "took": { - "properties": { - "ms": { - "type": "long" - } - } - } - } - }, - "cardinality": { - "properties": { - "took": { - "properties": { - "ms": { - "type": "long" - } - } - } - } - }, - "groupings": { - "properties": { - "took": { - "properties": { - "ms": { - "type": "long" - } - } - } - } - }, - "indices_stats": { - "properties": { - "took": { - "properties": { - "ms": { - "type": "long" - } - } - } - } - }, - "integrations": { - "properties": { - "took": { - "properties": { - "ms": { - "type": "long" - } - } - } - } - }, - "processor_events": { - "properties": { - "took": { - "properties": { - "ms": { - "type": "long" - } - } - } - } - }, - "services": { - "properties": { - "took": { - "properties": { - "ms": { - "type": "long" - } - } - } - } - }, - "versions": { - "properties": { - "took": { - "properties": { - "ms": { - "type": "long" - } - } - } - } - } - } - }, - "version": { - "properties": { - "apm_server": { - "properties": { - "major": { - "type": "long" - }, - "minor": { - "type": "long" - }, - "patch": { - "type": "long" - } - } - } - } - } - } - }, - "application_usage_totals": { - "properties": { - "appId": { - "type": "keyword" - }, - "minutesOnScreen": { - "type": "float" - }, - "numberOfClicks": { - "type": "long" - } - } - }, - "application_usage_transactional": { - "properties": { - "appId": { - "type": "keyword" - }, - "minutesOnScreen": { - "type": "float" - }, - "numberOfClicks": { - "type": "long" - }, - "timestamp": { - "type": "date" - } - } - }, - "canvas-element": { - "dynamic": "false", - "properties": { - "@created": { - "type": "date" - }, - "@timestamp": { - "type": "date" - }, - "content": { - "type": "text" - }, - "help": { - "type": "text" - }, - "image": { - "type": "text" - }, - "name": { - "fields": { - "keyword": { - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "canvas-workpad": { - "dynamic": "false", - "properties": { - "@created": { - "type": "date" - }, - "@timestamp": { - "type": "date" - }, - "name": { - "fields": { - "keyword": { - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "cases": { - "properties": { - "closed_at": { - "type": "date" - }, - "closed_by": { - "properties": { - "email": { - "type": "keyword" - }, - "full_name": { - "type": "keyword" - }, - "username": { - "type": "keyword" - } - } - }, - "created_at": { - "type": "date" - }, - "created_by": { - "properties": { - "email": { - "type": "keyword" - }, - "full_name": { - "type": "keyword" - }, - "username": { - "type": "keyword" - } - } - }, - "description": { - "type": "text" - }, - "external_service": { - "properties": { - "connector_id": { - "type": "keyword" - }, - "connector_name": { - "type": "keyword" - }, - "external_id": { - "type": "keyword" - }, - "external_title": { - "type": "text" - }, - "external_url": { - "type": "text" - }, - "pushed_at": { - "type": "date" - }, - "pushed_by": { - "properties": { - "email": { - "type": "keyword" - }, - "full_name": { - "type": "keyword" - }, - "username": { - "type": "keyword" - } - } - } - } - }, - "status": { - "type": "keyword" - }, - "tags": { - "type": "keyword" - }, - "title": { - "type": "keyword" - }, - "updated_at": { - "type": "date" - }, - "updated_by": { - "properties": { - "email": { - "type": "keyword" - }, - "full_name": { - "type": "keyword" - }, - "username": { - "type": "keyword" - } - } - } - } - }, - "cases-comments": { - "properties": { - "comment": { - "type": "text" - }, - "created_at": { - "type": "date" - }, - "created_by": { - "properties": { - "email": { - "type": "keyword" - }, - "full_name": { - "type": "keyword" - }, - "username": { - "type": "keyword" - } - } - }, - "pushed_at": { - "type": "date" - }, - "pushed_by": { - "properties": { - "email": { - "type": "keyword" - }, - "full_name": { - "type": "keyword" - }, - "username": { - "type": "keyword" - } - } - }, - "updated_at": { - "type": "date" - }, - "updated_by": { - "properties": { - "email": { - "type": "keyword" - }, - "full_name": { - "type": "keyword" - }, - "username": { - "type": "keyword" - } - } - } - } - }, - "cases-configure": { - "properties": { - "closure_type": { - "type": "keyword" - }, - "connector_id": { - "type": "keyword" - }, - "connector_name": { - "type": "keyword" - }, - "created_at": { - "type": "date" - }, - "created_by": { - "properties": { - "email": { - "type": "keyword" - }, - "full_name": { - "type": "keyword" - }, - "username": { - "type": "keyword" - } - } - }, - "updated_at": { - "type": "date" - }, - "updated_by": { - "properties": { - "email": { - "type": "keyword" - }, - "full_name": { - "type": "keyword" - }, - "username": { - "type": "keyword" - } - } - } - } - }, - "cases-user-actions": { - "properties": { - "action": { - "type": "keyword" - }, - "action_at": { - "type": "date" - }, - "action_by": { - "properties": { - "email": { - "type": "keyword" - }, - "full_name": { - "type": "keyword" - }, - "username": { - "type": "keyword" - } - } - }, - "action_field": { - "type": "keyword" - }, - "new_value": { - "type": "text" - }, - "old_value": { - "type": "text" - } - } - }, - "config": { - "dynamic": "true", - "properties": { - "buildNum": { - "type": "keyword" - }, - "dateFormat:tz": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "defaultIndex": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "dashboard": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "optionsJSON": { - "type": "text" - }, - "panelsJSON": { - "type": "text" - }, - "refreshInterval": { - "properties": { - "display": { - "type": "keyword" - }, - "pause": { - "type": "boolean" - }, - "section": { - "type": "integer" - }, - "value": { - "type": "integer" - } - } - }, - "timeFrom": { - "type": "keyword" - }, - "timeRestore": { - "type": "boolean" - }, - "timeTo": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "datasources": { - "properties": { - "config_id": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "enabled": { - "type": "boolean" - }, - "inputs": { - "properties": { - "config": { - "type": "flattened" - }, - "enabled": { - "type": "boolean" - }, - "processors": { - "type": "keyword" - }, - "streams": { - "properties": { - "config": { - "type": "flattened" - }, - "dataset": { - "type": "keyword" - }, - "enabled": { - "type": "boolean" - }, - "id": { - "type": "keyword" - }, - "processors": { - "type": "keyword" - } - }, - "type": "nested" - }, - "type": { - "type": "keyword" - } - }, - "type": "nested" - }, - "name": { - "type": "keyword" - }, - "namespace": { - "type": "keyword" - }, - "output_id": { - "type": "keyword" - }, - "package": { - "properties": { - "name": { - "type": "keyword" - }, - "title": { - "type": "keyword" - }, - "version": { - "type": "keyword" - } - } - }, - "revision": { - "type": "integer" - } - } - }, - "enrollment_api_keys": { - "properties": { - "active": { - "type": "boolean" - }, - "api_key": { - "type": "binary" - }, - "api_key_id": { - "type": "keyword" - }, - "config_id": { - "type": "keyword" - }, - "created_at": { - "type": "date" - }, - "expire_at": { - "type": "date" - }, - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - }, - "updated_at": { - "type": "date" - } - } - }, - "epm-package": { - "properties": { - "installed": { - "properties": { - "id": { - "type": "keyword" - }, - "type": { - "type": "keyword" - } - }, - "type": "nested" - }, - "name": { - "type": "keyword" - }, - "version": { - "type": "keyword" - } - } - }, - "file-upload-telemetry": { - "properties": { - "filesUploadedTotalCount": { - "type": "long" - } - } - }, - "graph-workspace": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "numLinks": { - "type": "integer" - }, - "numVertices": { - "type": "integer" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "wsState": { - "type": "text" - } - } - }, - "index-pattern": { - "properties": { - "fieldFormatMap": { - "type": "text" - }, - "fields": { - "type": "text" - }, - "intervalName": { - "type": "keyword" - }, - "notExpandable": { - "type": "boolean" - }, - "sourceFilters": { - "type": "text" - }, - "timeFieldName": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "type": { - "type": "keyword" - }, - "typeMeta": { - "type": "keyword" - } - } - }, - "infrastructure-ui-source": { - "properties": { - "description": { - "type": "text" - }, - "fields": { - "properties": { - "container": { - "type": "keyword" - }, - "host": { - "type": "keyword" - }, - "pod": { - "type": "keyword" - }, - "tiebreaker": { - "type": "keyword" - }, - "timestamp": { - "type": "keyword" - } - } - }, - "logAlias": { - "type": "keyword" - }, - "logColumns": { - "properties": { - "fieldColumn": { - "properties": { - "field": { - "type": "keyword" - }, - "id": { - "type": "keyword" - } - } - }, - "messageColumn": { - "properties": { - "id": { - "type": "keyword" - } - } - }, - "timestampColumn": { - "properties": { - "id": { - "type": "keyword" - } - } - } - }, - "type": "nested" - }, - "metricAlias": { - "type": "keyword" - }, - "name": { - "type": "text" - } - } - }, - "inventory-view": { - "properties": { - "autoBounds": { - "type": "boolean" - }, - "autoReload": { - "type": "boolean" - }, - "boundsOverride": { - "properties": { - "max": { - "type": "integer" - }, - "min": { - "type": "integer" - } - } - }, - "customMetrics": { - "properties": { - "aggregation": { - "type": "keyword" - }, - "field": { - "type": "keyword" - }, - "id": { - "type": "keyword" - }, - "label": { - "type": "keyword" - }, - "type": { - "type": "keyword" - } - }, - "type": "nested" - }, - "customOptions": { - "properties": { - "field": { - "type": "keyword" - }, - "text": { - "type": "keyword" - } - }, - "type": "nested" - }, - "filterQuery": { - "properties": { - "expression": { - "type": "keyword" - }, - "kind": { - "type": "keyword" - } - } - }, - "groupBy": { - "properties": { - "field": { - "type": "keyword" - }, - "label": { - "type": "keyword" - } - }, - "type": "nested" - }, - "metric": { - "properties": { - "aggregation": { - "type": "keyword" - }, - "field": { - "type": "keyword" - }, - "id": { - "type": "keyword" - }, - "label": { - "type": "keyword" - }, - "type": { - "type": "keyword" - } - } - }, - "name": { - "type": "keyword" - }, - "nodeType": { - "type": "keyword" - }, - "time": { - "type": "integer" - }, - "view": { - "type": "keyword" - } - } - }, - "kql-telemetry": { - "properties": { - "optInCount": { - "type": "long" - }, - "optOutCount": { - "type": "long" - } - } - }, - "lens": { - "properties": { - "expression": { - "index": false, - "type": "keyword" - }, - "state": { - "type": "flattened" - }, - "title": { - "type": "text" - }, - "visualizationType": { - "type": "keyword" - } - } - }, - "lens-ui-telemetry": { - "properties": { - "count": { - "type": "integer" - }, - "date": { - "type": "date" - }, - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - } - } - }, - "map": { - "properties": { - "bounds": { - "type": "geo_shape" - }, - "description": { - "type": "text" - }, - "layerListJSON": { - "type": "text" - }, - "mapStateJSON": { - "type": "text" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "maps-telemetry": { - "properties": { - "attributesPerMap": { - "properties": { - "dataSourcesCount": { - "properties": { - "avg": { - "type": "long" - }, - "max": { - "type": "long" - }, - "min": { - "type": "long" - } - } - }, - "emsVectorLayersCount": { - "dynamic": "true", - "type": "object" - }, - "layerTypesCount": { - "dynamic": "true", - "type": "object" - }, - "layersCount": { - "properties": { - "avg": { - "type": "long" - }, - "max": { - "type": "long" - }, - "min": { - "type": "long" - } - } - } - } - }, - "indexPatternsWithGeoFieldCount": { - "type": "long" - }, - "mapsTotalCount": { - "type": "long" - }, - "settings": { - "properties": { - "showMapVisualizationTypes": { - "type": "boolean" - } - } - }, - "timeCaptured": { - "type": "date" - } - } - }, - "metrics-explorer-view": { - "properties": { - "chartOptions": { - "properties": { - "stack": { - "type": "boolean" - }, - "type": { - "type": "keyword" - }, - "yAxisMode": { - "type": "keyword" - } - } - }, - "currentTimerange": { - "properties": { - "from": { - "type": "keyword" - }, - "interval": { - "type": "keyword" - }, - "to": { - "type": "keyword" - } - } - }, - "name": { - "type": "keyword" - }, - "options": { - "properties": { - "aggregation": { - "type": "keyword" - }, - "filterQuery": { - "type": "keyword" - }, - "groupBy": { - "type": "keyword" - }, - "limit": { - "type": "integer" - }, - "metrics": { - "properties": { - "aggregation": { - "type": "keyword" - }, - "color": { - "type": "keyword" - }, - "field": { - "type": "keyword" - }, - "label": { - "type": "keyword" - } - }, - "type": "nested" - } - } - } - } - }, - "migrationVersion": { - "dynamic": "true", - "properties": { - "canvas-workpad": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "dashboard": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "graph-workspace": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "index-pattern": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "map": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "space": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - }, - "visualization": { - "fields": { - "keyword": { - "ignore_above": 256, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "ml-telemetry": { - "properties": { - "file_data_visualizer": { - "properties": { - "index_creation_count": { - "type": "long" - } - } - } - } - }, - "namespace": { - "type": "keyword" - }, - "outputs": { - "properties": { - "api_key": { - "type": "keyword" - }, - "ca_sha256": { - "type": "keyword" - }, - "config": { - "type": "flattened" - }, - "fleet_enroll_password": { - "type": "binary" - }, - "fleet_enroll_username": { - "type": "binary" - }, - "hosts": { - "type": "keyword" - }, - "is_default": { - "type": "boolean" - }, - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - } - } - }, - "query": { - "properties": { - "description": { - "type": "text" - }, - "filters": { - "enabled": false, - "type": "object" - }, - "query": { - "properties": { - "language": { - "type": "keyword" - }, - "query": { - "index": false, - "type": "keyword" - } - } - }, - "timefilter": { - "enabled": false, - "type": "object" - }, - "title": { - "type": "text" - } - } - }, - "references": { - "properties": { - "id": { - "type": "keyword" - }, - "name": { - "type": "keyword" - }, - "type": { - "type": "keyword" - } - }, - "type": "nested" - }, - "sample-data-telemetry": { - "properties": { - "installCount": { - "type": "long" - }, - "unInstallCount": { - "type": "long" - } - } - }, - "search": { - "properties": { - "columns": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "sort": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "server": { - "properties": { - "uuid": { - "type": "keyword" - } - } - }, - "siem-detection-engine-rule-status": { - "properties": { - "alertId": { - "type": "keyword" - }, - "bulkCreateTimeDurations": { - "type": "float" - }, - "gap": { - "type": "text" - }, - "lastFailureAt": { - "type": "date" - }, - "lastFailureMessage": { - "type": "text" - }, - "lastLookBackDate": { - "type": "date" - }, - "lastSuccessAt": { - "type": "date" - }, - "lastSuccessMessage": { - "type": "text" - }, - "searchAfterTimeDurations": { - "type": "float" - }, - "status": { - "type": "keyword" - }, - "statusDate": { - "type": "date" - } - } - }, - "siem-ui-timeline": { - "properties": { - "columns": { - "properties": { - "aggregatable": { - "type": "boolean" - }, - "category": { - "type": "keyword" - }, - "columnHeaderType": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "example": { - "type": "text" - }, - "id": { - "type": "keyword" - }, - "indexes": { - "type": "keyword" - }, - "name": { - "type": "text" - }, - "placeholder": { - "type": "text" - }, - "searchable": { - "type": "boolean" - }, - "type": { - "type": "keyword" - } - } - }, - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "dataProviders": { - "properties": { - "and": { - "properties": { - "enabled": { - "type": "boolean" - }, - "excluded": { - "type": "boolean" - }, - "id": { - "type": "keyword" - }, - "kqlQuery": { - "type": "text" - }, - "name": { - "type": "text" - }, - "queryMatch": { - "properties": { - "displayField": { - "type": "text" - }, - "displayValue": { - "type": "text" - }, - "field": { - "type": "text" - }, - "operator": { - "type": "text" - }, - "value": { - "type": "text" - } - } - } - } - }, - "enabled": { - "type": "boolean" - }, - "excluded": { - "type": "boolean" - }, - "id": { - "type": "keyword" - }, - "kqlQuery": { - "type": "text" - }, - "name": { - "type": "text" - }, - "queryMatch": { - "properties": { - "displayField": { - "type": "text" - }, - "displayValue": { - "type": "text" - }, - "field": { - "type": "text" - }, - "operator": { - "type": "text" - }, - "value": { - "type": "text" - } - } - } - } - }, - "dateRange": { - "properties": { - "end": { - "type": "date" - }, - "start": { - "type": "date" - } - } - }, - "description": { - "type": "text" - }, - "eventType": { - "type": "keyword" - }, - "favorite": { - "properties": { - "favoriteDate": { - "type": "date" - }, - "fullName": { - "type": "text" - }, - "keySearch": { - "type": "text" - }, - "userName": { - "type": "text" - } - } - }, - "filters": { - "properties": { - "exists": { - "type": "text" - }, - "match_all": { - "type": "text" - }, - "meta": { - "properties": { - "alias": { - "type": "text" - }, - "controlledBy": { - "type": "text" - }, - "disabled": { - "type": "boolean" - }, - "field": { - "type": "text" - }, - "formattedValue": { - "type": "text" - }, - "index": { - "type": "keyword" - }, - "key": { - "type": "keyword" - }, - "negate": { - "type": "boolean" - }, - "params": { - "type": "text" - }, - "type": { - "type": "keyword" - }, - "value": { - "type": "text" - } - } - }, - "missing": { - "type": "text" - }, - "query": { - "type": "text" - }, - "range": { - "type": "text" - }, - "script": { - "type": "text" - } - } - }, - "kqlMode": { - "type": "keyword" - }, - "kqlQuery": { - "properties": { - "filterQuery": { - "properties": { - "kuery": { - "properties": { - "expression": { - "type": "text" - }, - "kind": { - "type": "keyword" - } - } - }, - "serializedQuery": { - "type": "text" - } - } - } - } - }, - "savedQueryId": { - "type": "keyword" - }, - "sort": { - "properties": { - "columnId": { - "type": "keyword" - }, - "sortDirection": { - "type": "keyword" - } - } - }, - "title": { - "type": "text" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "siem-ui-timeline-note": { - "properties": { - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "eventId": { - "type": "keyword" - }, - "note": { - "type": "text" - }, - "timelineId": { - "type": "keyword" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "siem-ui-timeline-pinned-event": { - "properties": { - "created": { - "type": "date" - }, - "createdBy": { - "type": "text" - }, - "eventId": { - "type": "keyword" - }, - "timelineId": { - "type": "keyword" - }, - "updated": { - "type": "date" - }, - "updatedBy": { - "type": "text" - } - } - }, - "space": { - "properties": { - "_reserved": { - "type": "boolean" - }, - "color": { - "type": "keyword" - }, - "description": { - "type": "text" - }, - "disabledFeatures": { - "type": "keyword" - }, - "imageUrl": { - "index": false, - "type": "text" - }, - "initials": { - "type": "keyword" - }, - "name": { - "fields": { - "keyword": { - "ignore_above": 2048, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "telemetry": { - "properties": { - "allowChangingOptInStatus": { - "type": "boolean" - }, - "enabled": { - "type": "boolean" - }, - "lastReported": { - "type": "date" - }, - "lastVersionChecked": { - "type": "keyword" - }, - "reportFailureCount": { - "type": "integer" - }, - "reportFailureVersion": { - "type": "keyword" - }, - "sendUsageFrom": { - "type": "keyword" - }, - "userHasSeenNotice": { - "type": "boolean" - } - } - }, - "timelion-sheet": { - "properties": { - "description": { - "type": "text" - }, - "hits": { - "type": "integer" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "timelion_chart_height": { - "type": "integer" - }, - "timelion_columns": { - "type": "integer" - }, - "timelion_interval": { - "type": "keyword" - }, - "timelion_other_interval": { - "type": "keyword" - }, - "timelion_rows": { - "type": "integer" - }, - "timelion_sheet": { - "type": "text" - }, - "title": { - "type": "text" - }, - "version": { - "type": "integer" - } - } - }, - "tsvb-validation-telemetry": { - "properties": { - "failedRequests": { - "type": "long" - } - } - }, - "type": { - "type": "keyword" - }, - "ui-metric": { - "properties": { - "count": { - "type": "integer" - } - } - }, - "updated_at": { - "type": "date" - }, - "upgrade-assistant-reindex-operation": { - "dynamic": "true", - "properties": { - "indexName": { - "type": "keyword" - }, - "status": { - "type": "integer" - } - } - }, - "upgrade-assistant-telemetry": { - "properties": { - "features": { - "properties": { - "deprecation_logging": { - "properties": { - "enabled": { - "null_value": true, - "type": "boolean" - } - } - } - } - }, - "ui_open": { - "properties": { - "cluster": { - "null_value": 0, - "type": "long" - }, - "indices": { - "null_value": 0, - "type": "long" - }, - "overview": { - "null_value": 0, - "type": "long" - } - } - }, - "ui_reindex": { - "properties": { - "close": { - "null_value": 0, - "type": "long" - }, - "open": { - "null_value": 0, - "type": "long" - }, - "start": { - "null_value": 0, - "type": "long" - }, - "stop": { - "null_value": 0, - "type": "long" - } - } - } - } - }, - "uptime-dynamic-settings": { - "properties": { - "heartbeatIndices": { - "type": "keyword" - } - } - }, - "url": { - "properties": { - "accessCount": { - "type": "long" - }, - "accessDate": { - "type": "date" - }, - "createDate": { - "type": "date" - }, - "url": { - "fields": { - "keyword": { - "ignore_above": 2048, - "type": "keyword" - } - }, - "type": "text" - } - } - }, - "visualization": { - "properties": { - "description": { - "type": "text" - }, - "kibanaSavedObjectMeta": { - "properties": { - "searchSourceJSON": { - "type": "text" - } - } - }, - "savedSearchRefName": { - "type": "keyword" - }, - "title": { - "type": "text" - }, - "uiStateJSON": { - "type": "text" - }, - "version": { - "type": "integer" - }, - "visState": { - "type": "text" - } - } - } - } - }, - "settings": { - "index": { - "auto_expand_replicas": "0-1", - "number_of_replicas": "0", - "number_of_shards": "1" - } - } - } -} \ No newline at end of file diff --git a/x-pack/test/functional/es_archives/uptime/blank/mappings.json b/x-pack/test/functional/es_archives/uptime/blank/mappings.json index 7879c82612a966..fff4ef47bce0cf 100644 --- a/x-pack/test/functional/es_archives/uptime/blank/mappings.json +++ b/x-pack/test/functional/es_archives/uptime/blank/mappings.json @@ -12,79 +12,115 @@ "beat": "heartbeat", "version": "8.0.0" }, - "date_detection": false, "dynamic_templates": [ { "labels": { + "path_match": "labels.*", + "match_mapping_type": "string", "mapping": { "type": "keyword" - }, - "match_mapping_type": "string", - "path_match": "labels.*" + } } }, { "container.labels": { + "path_match": "container.labels.*", + "match_mapping_type": "string", "mapping": { "type": "keyword" - }, - "match_mapping_type": "string", - "path_match": "container.labels.*" + } } }, { "dns.answers": { + "path_match": "dns.answers.*", + "match_mapping_type": "string", "mapping": { "type": "keyword" - }, + } + } + }, + { + "log.syslog": { + "path_match": "log.syslog.*", "match_mapping_type": "string", - "path_match": "dns.answers.*" + "mapping": { + "type": "keyword" + } } }, { - "fields": { + "network.inner": { + "path_match": "network.inner.*", + "match_mapping_type": "string", "mapping": { "type": "keyword" - }, + } + } + }, + { + "observer.egress": { + "path_match": "observer.egress.*", "match_mapping_type": "string", - "path_match": "fields.*" + "mapping": { + "type": "keyword" + } } }, { - "docker.container.labels": { + "observer.ingress": { + "path_match": "observer.ingress.*", + "match_mapping_type": "string", "mapping": { "type": "keyword" - }, + } + } + }, + { + "fields": { + "path_match": "fields.*", + "match_mapping_type": "string", + "mapping": { + "type": "keyword" + } + } + }, + { + "docker.container.labels": { + "path_match": "docker.container.labels.*", "match_mapping_type": "string", - "path_match": "docker.container.labels.*" + "mapping": { + "type": "keyword" + } } }, { "kubernetes.labels.*": { + "path_match": "kubernetes.labels.*", "mapping": { "type": "keyword" - }, - "path_match": "kubernetes.labels.*" + } } }, { "kubernetes.annotations.*": { + "path_match": "kubernetes.annotations.*", "mapping": { "type": "keyword" - }, - "path_match": "kubernetes.annotations.*" + } } }, { "strings_as_keyword": { + "match_mapping_type": "string", "mapping": { "ignore_above": 1024, "type": "keyword" - }, - "match_mapping_type": "string" + } } } ], + "date_detection": false, "properties": { "@timestamp": { "type": "date" @@ -92,28 +128,28 @@ "agent": { "properties": { "ephemeral_id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "hostname": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "type": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "version": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, @@ -125,8 +161,14 @@ "organization": { "properties": { "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 } } } @@ -135,8 +177,8 @@ "client": { "properties": { "address": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "as": { "properties": { @@ -146,8 +188,14 @@ "organization": { "properties": { "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 } } } @@ -157,41 +205,41 @@ "type": "long" }, "domain": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "geo": { "properties": { "city_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "continent_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "country_iso_code": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "country_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "location": { "type": "geo_point" }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "region_iso_code": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "region_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, @@ -199,8 +247,8 @@ "type": "ip" }, "mac": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "nat": { "properties": { @@ -218,43 +266,67 @@ "port": { "type": "long" }, + "registered_domain": { + "type": "keyword", + "ignore_above": 1024 + }, + "top_level_domain": { + "type": "keyword", + "ignore_above": 1024 + }, "user": { "properties": { "domain": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "email": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "full_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "group": { "properties": { + "domain": { + "type": "keyword", + "ignore_above": 1024 + }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "hash": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 } } } @@ -265,76 +337,97 @@ "account": { "properties": { "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "availability_zone": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "image": { "properties": { "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "instance": { "properties": { "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "machine": { "properties": { "type": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "project": { "properties": { "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "provider": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "region": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "code_signature": { + "properties": { + "exists": { + "type": "boolean" + }, + "status": { + "type": "keyword", + "ignore_above": 1024 + }, + "subject_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "trusted": { + "type": "boolean" + }, + "valid": { + "type": "boolean" } } }, "container": { "properties": { "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "image": { "properties": { "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "tag": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, @@ -342,20 +435,20 @@ "type": "object" }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "runtime": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "destination": { "properties": { "address": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "as": { "properties": { @@ -365,8 +458,14 @@ "organization": { "properties": { "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 } } } @@ -376,41 +475,41 @@ "type": "long" }, "domain": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "geo": { "properties": { "city_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "continent_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "country_iso_code": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "country_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "location": { "type": "geo_point" }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "region_iso_code": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "region_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, @@ -418,8 +517,8 @@ "type": "ip" }, "mac": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "nat": { "properties": { @@ -437,43 +536,144 @@ "port": { "type": "long" }, + "registered_domain": { + "type": "keyword", + "ignore_above": 1024 + }, + "top_level_domain": { + "type": "keyword", + "ignore_above": 1024 + }, "user": { "properties": { "domain": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "email": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "full_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "group": { "properties": { + "domain": { + "type": "keyword", + "ignore_above": 1024 + }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "hash": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + } + } + } + } + }, + "dll": { + "properties": { + "code_signature": { + "properties": { + "exists": { + "type": "boolean" + }, + "status": { + "type": "keyword", + "ignore_above": 1024 + }, + "subject_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "trusted": { + "type": "boolean" + }, + "valid": { + "type": "boolean" + } + } + }, + "hash": { + "properties": { + "md5": { + "type": "keyword", + "ignore_above": 1024 + }, + "sha1": { + "type": "keyword", + "ignore_above": 1024 + }, + "sha256": { + "type": "keyword", + "ignore_above": 1024 + }, + "sha512": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + }, + "path": { + "type": "keyword", + "ignore_above": 1024 + }, + "pe": { + "properties": { + "company": { + "type": "keyword", + "ignore_above": 1024 + }, + "description": { + "type": "keyword", + "ignore_above": 1024 + }, + "file_version": { + "type": "keyword", + "ignore_above": 1024 + }, + "original_file_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "product": { + "type": "keyword", + "ignore_above": 1024 } } } @@ -484,55 +684,63 @@ "answers": { "properties": { "class": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "data": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "ttl": { "type": "long" }, "type": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "header_flags": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "op_code": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "question": { "properties": { "class": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "registered_domain": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 + }, + "subdomain": { + "type": "keyword", + "ignore_above": 1024 + }, + "top_level_domain": { + "type": "keyword", + "ignore_above": 1024 }, "type": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, @@ -540,12 +748,12 @@ "type": "ip" }, "response_code": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "type": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, @@ -563,51 +771,61 @@ "ecs": { "properties": { "version": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "error": { "properties": { "code": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "message": { - "norms": false, - "type": "text" + "type": "text", + "norms": false + }, + "stack_trace": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "type": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "event": { "properties": { "action": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "category": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "code": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "created": { "type": "date" }, "dataset": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "duration": { "type": "long" @@ -616,32 +834,39 @@ "type": "date" }, "hash": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 + }, + "ingested": { + "type": "date" }, "kind": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "module": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "original": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "outcome": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "provider": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 + }, + "reference": { + "type": "keyword", + "ignore_above": 1024 }, "risk_score": { "type": "float" @@ -659,12 +884,16 @@ "type": "date" }, "timezone": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "type": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 + }, + "url": { + "type": "keyword", + "ignore_above": 1024 } } }, @@ -676,6 +905,31 @@ "accessed": { "type": "date" }, + "attributes": { + "type": "keyword", + "ignore_above": 1024 + }, + "code_signature": { + "properties": { + "exists": { + "type": "boolean" + }, + "status": { + "type": "keyword", + "ignore_above": 1024 + }, + "subject_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "trusted": { + "type": "boolean" + }, + "valid": { + "type": "boolean" + } + } + }, "created": { "type": "date" }, @@ -683,254 +937,318 @@ "type": "date" }, "device": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "directory": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 + }, + "drive_letter": { + "type": "keyword", + "ignore_above": 1 }, "extension": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "gid": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "group": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "hash": { "properties": { "md5": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "sha1": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "sha256": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "sha512": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "inode": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 + }, + "mime_type": { + "type": "keyword", + "ignore_above": 1024 }, "mode": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "mtime": { "type": "date" }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "owner": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "path": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "pe": { + "properties": { + "company": { + "type": "keyword", + "ignore_above": 1024 + }, + "description": { + "type": "keyword", + "ignore_above": 1024 + }, + "file_version": { + "type": "keyword", + "ignore_above": 1024 + }, + "original_file_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "product": { + "type": "keyword", + "ignore_above": 1024 + } + } }, "size": { "type": "long" }, "target_path": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "type": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "uid": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "geo": { "properties": { "city_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "continent_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "country_iso_code": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "country_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "location": { "type": "geo_point" }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "region_iso_code": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "region_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "group": { "properties": { + "domain": { + "type": "keyword", + "ignore_above": 1024 + }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "hash": { "properties": { "md5": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "sha1": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "sha256": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "sha512": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "host": { "properties": { "architecture": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "containerized": { "type": "boolean" }, + "domain": { + "type": "keyword", + "ignore_above": 1024 + }, "geo": { "properties": { "city_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "continent_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "country_iso_code": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "country_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "location": { "type": "geo_point" }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "region_iso_code": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "region_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "hostname": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "ip": { "type": "ip" }, "mac": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "os": { "properties": { "build": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "codename": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "family": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "full": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "kernel": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "platform": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "version": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "type": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "uptime": { "type": "long" @@ -938,40 +1256,56 @@ "user": { "properties": { "domain": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "email": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "full_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "group": { "properties": { + "domain": { + "type": "keyword", + "ignore_above": 1024 + }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "hash": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 } } } @@ -987,8 +1321,14 @@ "type": "long" }, "content": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 } } }, @@ -996,12 +1336,12 @@ "type": "long" }, "method": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "referrer": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, @@ -1013,18 +1353,28 @@ "type": "long" }, "content": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "hash": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "bytes": { "type": "long" }, + "redirects": { + "type": "keyword", + "ignore_above": 1024 + }, "status_code": { "type": "long" } @@ -1077,8 +1427,8 @@ } }, "version": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, @@ -1096,17 +1446,33 @@ } } }, + "interface": { + "properties": { + "alias": { + "type": "keyword", + "ignore_above": 1024 + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, "jolokia": { "properties": { "agent": { "properties": { "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "version": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, @@ -1116,22 +1482,22 @@ "server": { "properties": { "product": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "vendor": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "version": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "url": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, @@ -1147,20 +1513,20 @@ "container": { "properties": { "image": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "deployment": { "properties": { "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, @@ -1172,42 +1538,42 @@ } }, "namespace": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "node": { "properties": { "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "pod": { "properties": { "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "uid": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "replicaset": { "properties": { "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "statefulset": { "properties": { "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } } @@ -1219,28 +1585,76 @@ "log": { "properties": { "level": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "logger": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 + }, + "origin": { + "properties": { + "file": { + "properties": { + "line": { + "type": "long" + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "function": { + "type": "keyword", + "ignore_above": 1024 + } + } }, "original": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 + }, + "syslog": { + "properties": { + "facility": { + "properties": { + "code": { + "type": "long" + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "priority": { + "type": "long" + }, + "severity": { + "properties": { + "code": { + "type": "long" + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + } + } } } }, "message": { - "norms": false, - "type": "text" + "type": "text", + "norms": false }, "monitor": { "properties": { "check_group": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "duration": { "properties": { @@ -1250,282 +1664,766 @@ } }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "ip": { "type": "ip" }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "status": { - "ignore_above": 1024, - "type": "keyword" - }, - "type": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "timespan": { "type": "date_range" + }, + "type": { + "type": "keyword", + "ignore_above": 1024 } } }, "network": { "properties": { "application": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "bytes": { "type": "long" }, "community_id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "direction": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "forwarded_ip": { "type": "ip" }, "iana_number": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 + }, + "inner": { + "properties": { + "vlan": { + "properties": { + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + } + } }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "packets": { "type": "long" }, "protocol": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "transport": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "type": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 + }, + "vlan": { + "properties": { + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } } } }, "observer": { "properties": { + "egress": { + "properties": { + "interface": { + "properties": { + "alias": { + "type": "keyword", + "ignore_above": 1024 + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "vlan": { + "properties": { + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "zone": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, "geo": { "properties": { "city_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "continent_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "country_iso_code": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "country_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "location": { "type": "geo_point" }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "region_iso_code": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "region_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "hostname": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 + }, + "ingress": { + "properties": { + "interface": { + "properties": { + "alias": { + "type": "keyword", + "ignore_above": 1024 + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "vlan": { + "properties": { + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "zone": { + "type": "keyword", + "ignore_above": 1024 + } + } }, "ip": { "type": "ip" }, "mac": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 }, "os": { "properties": { "family": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "full": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "kernel": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "platform": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "version": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, + "product": { + "type": "keyword", + "ignore_above": 1024 + }, "serial_number": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "type": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "vendor": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "version": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "organization": { "properties": { "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 } } }, "os": { "properties": { "family": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "full": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "kernel": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "platform": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "version": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, - "process": { + "package": { "properties": { - "args": { - "ignore_above": 1024, - "type": "keyword" + "architecture": { + "type": "keyword", + "ignore_above": 1024 }, - "executable": { - "ignore_above": 1024, - "type": "keyword" + "build_version": { + "type": "keyword", + "ignore_above": 1024 }, - "hash": { - "properties": { - "md5": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha1": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha256": { - "ignore_above": 1024, - "type": "keyword" - }, - "sha512": { - "ignore_above": 1024, - "type": "keyword" - } - } + "checksum": { + "type": "keyword", + "ignore_above": 1024 + }, + "description": { + "type": "keyword", + "ignore_above": 1024 + }, + "install_scope": { + "type": "keyword", + "ignore_above": 1024 + }, + "installed": { + "type": "date" + }, + "license": { + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, - "pgid": { - "type": "long" + "path": { + "type": "keyword", + "ignore_above": 1024 }, - "pid": { - "type": "long" + "reference": { + "type": "keyword", + "ignore_above": 1024 }, - "ppid": { + "size": { "type": "long" }, - "start": { - "type": "date" + "type": { + "type": "keyword", + "ignore_above": 1024 }, - "thread": { - "properties": { - "id": { - "type": "long" - }, - "name": { - "ignore_above": 1024, - "type": "keyword" - } + "version": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "pe": { + "properties": { + "company": { + "type": "keyword", + "ignore_above": 1024 + }, + "description": { + "type": "keyword", + "ignore_above": 1024 + }, + "file_version": { + "type": "keyword", + "ignore_above": 1024 + }, + "original_file_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "product": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "process": { + "properties": { + "args": { + "type": "keyword", + "ignore_above": 1024 + }, + "args_count": { + "type": "long" + }, + "code_signature": { + "properties": { + "exists": { + "type": "boolean" + }, + "status": { + "type": "keyword", + "ignore_above": 1024 + }, + "subject_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "trusted": { + "type": "boolean" + }, + "valid": { + "type": "boolean" + } + } + }, + "command_line": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "entity_id": { + "type": "keyword", + "ignore_above": 1024 + }, + "executable": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "exit_code": { + "type": "long" + }, + "hash": { + "properties": { + "md5": { + "type": "keyword", + "ignore_above": 1024 + }, + "sha1": { + "type": "keyword", + "ignore_above": 1024 + }, + "sha256": { + "type": "keyword", + "ignore_above": 1024 + }, + "sha512": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "name": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "parent": { + "properties": { + "args": { + "type": "keyword", + "ignore_above": 1024 + }, + "args_count": { + "type": "long" + }, + "code_signature": { + "properties": { + "exists": { + "type": "boolean" + }, + "status": { + "type": "keyword", + "ignore_above": 1024 + }, + "subject_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "trusted": { + "type": "boolean" + }, + "valid": { + "type": "boolean" + } + } + }, + "command_line": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "entity_id": { + "type": "keyword", + "ignore_above": 1024 + }, + "executable": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "exit_code": { + "type": "long" + }, + "hash": { + "properties": { + "md5": { + "type": "keyword", + "ignore_above": 1024 + }, + "sha1": { + "type": "keyword", + "ignore_above": 1024 + }, + "sha256": { + "type": "keyword", + "ignore_above": 1024 + }, + "sha512": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "name": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "pgid": { + "type": "long" + }, + "pid": { + "type": "long" + }, + "ppid": { + "type": "long" + }, + "start": { + "type": "date" + }, + "thread": { + "properties": { + "id": { + "type": "long" + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "title": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "uptime": { + "type": "long" + }, + "working_directory": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + } + } + }, + "pe": { + "properties": { + "company": { + "type": "keyword", + "ignore_above": 1024 + }, + "description": { + "type": "keyword", + "ignore_above": 1024 + }, + "file_version": { + "type": "keyword", + "ignore_above": 1024 + }, + "original_file_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "product": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "pgid": { + "type": "long" + }, + "pid": { + "type": "long" + }, + "ppid": { + "type": "long" + }, + "start": { + "type": "date" + }, + "thread": { + "properties": { + "id": { + "type": "long" + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } } }, "title": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "uptime": { "type": "long" }, "working_directory": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + } + } + }, + "registry": { + "properties": { + "data": { + "properties": { + "bytes": { + "type": "keyword", + "ignore_above": 1024 + }, + "strings": { + "type": "keyword", + "ignore_above": 1024 + }, + "type": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "hive": { + "type": "keyword", + "ignore_above": 1024 + }, + "key": { + "type": "keyword", + "ignore_above": 1024 + }, + "path": { + "type": "keyword", + "ignore_above": 1024 + }, + "value": { + "type": "keyword", + "ignore_above": 1024 } } }, "related": { "properties": { + "hash": { + "type": "keyword", + "ignore_above": 1024 + }, "ip": { "type": "ip" + }, + "user": { + "type": "keyword", + "ignore_above": 1024 } } }, @@ -1543,11 +2441,55 @@ } } }, + "rule": { + "properties": { + "author": { + "type": "keyword", + "ignore_above": 1024 + }, + "category": { + "type": "keyword", + "ignore_above": 1024 + }, + "description": { + "type": "keyword", + "ignore_above": 1024 + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "license": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + }, + "reference": { + "type": "keyword", + "ignore_above": 1024 + }, + "ruleset": { + "type": "keyword", + "ignore_above": 1024 + }, + "uuid": { + "type": "keyword", + "ignore_above": 1024 + }, + "version": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, "server": { "properties": { "address": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "as": { "properties": { @@ -1557,8 +2499,14 @@ "organization": { "properties": { "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 } } } @@ -1568,41 +2516,41 @@ "type": "long" }, "domain": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "geo": { "properties": { "city_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "continent_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "country_iso_code": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "country_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "location": { "type": "geo_point" }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "region_iso_code": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "region_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, @@ -1610,8 +2558,8 @@ "type": "ip" }, "mac": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "nat": { "properties": { @@ -1629,43 +2577,67 @@ "port": { "type": "long" }, + "registered_domain": { + "type": "keyword", + "ignore_above": 1024 + }, + "top_level_domain": { + "type": "keyword", + "ignore_above": 1024 + }, "user": { "properties": { "domain": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "email": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "full_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "group": { "properties": { + "domain": { + "type": "keyword", + "ignore_above": 1024 + }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "hash": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 } } } @@ -1674,28 +2646,36 @@ "service": { "properties": { "ephemeral_id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 + }, + "node": { + "properties": { + "name": { + "type": "keyword", + "ignore_above": 1024 + } + } }, "state": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "type": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "version": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, @@ -1717,8 +2697,8 @@ "source": { "properties": { "address": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "as": { "properties": { @@ -1728,8 +2708,14 @@ "organization": { "properties": { "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 } } } @@ -1739,41 +2725,41 @@ "type": "long" }, "domain": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "geo": { "properties": { "city_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "continent_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "country_iso_code": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "country_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "location": { "type": "geo_point" }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "region_iso_code": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "region_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, @@ -1781,8 +2767,8 @@ "type": "ip" }, "mac": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "nat": { "properties": { @@ -1800,43 +2786,67 @@ "port": { "type": "long" }, + "registered_domain": { + "type": "keyword", + "ignore_above": 1024 + }, + "top_level_domain": { + "type": "keyword", + "ignore_above": 1024 + }, "user": { "properties": { "domain": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "email": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "full_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "group": { "properties": { + "domain": { + "type": "keyword", + "ignore_above": 1024 + }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "hash": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 } } } @@ -1853,8 +2863,8 @@ } }, "tags": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "tcp": { "properties": { @@ -1878,11 +2888,57 @@ } } }, + "threat": { + "properties": { + "framework": { + "type": "keyword", + "ignore_above": 1024 + }, + "tactic": { + "properties": { + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + }, + "reference": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "technique": { + "properties": { + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "reference": { + "type": "keyword", + "ignore_above": 1024 + } + } + } + } + }, "timeseries": { "properties": { "instance": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, @@ -1894,6 +2950,78 @@ "certificate_not_valid_before": { "type": "date" }, + "cipher": { + "type": "keyword", + "ignore_above": 1024 + }, + "client": { + "properties": { + "certificate": { + "type": "keyword", + "ignore_above": 1024 + }, + "certificate_chain": { + "type": "keyword", + "ignore_above": 1024 + }, + "hash": { + "properties": { + "md5": { + "type": "keyword", + "ignore_above": 1024 + }, + "sha1": { + "type": "keyword", + "ignore_above": 1024 + }, + "sha256": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "issuer": { + "type": "keyword", + "ignore_above": 1024 + }, + "ja3": { + "type": "keyword", + "ignore_above": 1024 + }, + "not_after": { + "type": "date" + }, + "not_before": { + "type": "date" + }, + "server_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "subject": { + "type": "keyword", + "ignore_above": 1024 + }, + "supported_ciphers": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "curve": { + "type": "keyword", + "ignore_above": 1024 + }, + "established": { + "type": "boolean" + }, + "next_protocol": { + "type": "keyword", + "ignore_above": 1024 + }, + "resumed": { + "type": "boolean" + }, "rtt": { "properties": { "handshake": { @@ -1904,6 +3032,114 @@ } } } + }, + "server": { + "properties": { + "certificate": { + "type": "keyword", + "ignore_above": 1024 + }, + "certificate_chain": { + "type": "keyword", + "ignore_above": 1024 + }, + "hash": { + "properties": { + "md5": { + "type": "keyword", + "ignore_above": 1024 + }, + "sha1": { + "type": "keyword", + "ignore_above": 1024 + }, + "sha256": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "issuer": { + "type": "keyword", + "ignore_above": 1024 + }, + "ja3s": { + "type": "keyword", + "ignore_above": 1024 + }, + "not_after": { + "type": "date" + }, + "not_before": { + "type": "date" + }, + "subject": { + "type": "keyword", + "ignore_above": 1024 + }, + "x509": { + "properties": { + "issuer": { + "properties": { + "common_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "distinguished_name": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "not_after": { + "type": "keyword", + "ignore_above": 1024 + }, + "not_before": { + "type": "keyword", + "ignore_above": 1024 + }, + "public_key_algorithm": { + "type": "keyword", + "ignore_above": 1024 + }, + "public_key_exponent": { + "type": "long" + }, + "public_key_size": { + "type": "long" + }, + "serial_number": { + "type": "keyword", + "ignore_above": 1024 + }, + "signature_algorithm": { + "type": "keyword", + "ignore_above": 1024 + }, + "subject": { + "properties": { + "common_name": { + "type": "keyword", + "ignore_above": 1024 + }, + "distinguished_name": { + "type": "keyword", + "ignore_above": 1024 + } + } + } + } + } + } + }, + "version": { + "type": "keyword", + "ignore_above": 1024 + }, + "version_protocol": { + "type": "keyword", + "ignore_above": 1024 } } }, @@ -1912,16 +3148,16 @@ "trace": { "properties": { "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "transaction": { "properties": { "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } } @@ -1930,83 +3166,123 @@ "url": { "properties": { "domain": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 + }, + "extension": { + "type": "keyword", + "ignore_above": 1024 }, "fragment": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "full": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "original": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "password": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "path": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "port": { "type": "long" }, "query": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 + }, + "registered_domain": { + "type": "keyword", + "ignore_above": 1024 }, "scheme": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 + }, + "top_level_domain": { + "type": "keyword", + "ignore_above": 1024 }, "username": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "user": { "properties": { "domain": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "email": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "full_name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "group": { "properties": { + "domain": { + "type": "keyword", + "ignore_above": 1024 + }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "hash": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "id": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 } } }, @@ -2015,370 +3291,467 @@ "device": { "properties": { "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "original": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "os": { "properties": { "family": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "full": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "kernel": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "name": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 }, "platform": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 }, "version": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } }, "version": { - "ignore_above": 1024, - "type": "keyword" + "type": "keyword", + "ignore_above": 1024 } } - } - } - }, - "settings": { - "index": { - "mapping": { - "total_fields": { - "limit": "10000" + }, + "vlan": { + "properties": { + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "name": { + "type": "keyword", + "ignore_above": 1024 + } } }, - "number_of_replicas": "1", - "number_of_shards": "1", - "query": { - "default_field": [ - "message", - "tags", - "agent.ephemeral_id", - "agent.id", - "agent.name", - "agent.type", - "agent.version", - "as.organization.name", - "client.address", - "client.as.organization.name", - "client.domain", - "client.geo.city_name", - "client.geo.continent_name", - "client.geo.country_iso_code", - "client.geo.country_name", - "client.geo.name", - "client.geo.region_iso_code", - "client.geo.region_name", - "client.mac", - "client.user.domain", - "client.user.email", - "client.user.full_name", - "client.user.group.id", - "client.user.group.name", - "client.user.hash", - "client.user.id", - "client.user.name", - "cloud.account.id", - "cloud.availability_zone", - "cloud.instance.id", - "cloud.instance.name", - "cloud.machine.type", - "cloud.provider", - "cloud.region", - "container.id", - "container.image.name", - "container.image.tag", - "container.name", - "container.runtime", - "destination.address", - "destination.as.organization.name", - "destination.domain", - "destination.geo.city_name", - "destination.geo.continent_name", - "destination.geo.country_iso_code", - "destination.geo.country_name", - "destination.geo.name", - "destination.geo.region_iso_code", - "destination.geo.region_name", - "destination.mac", - "destination.user.domain", - "destination.user.email", - "destination.user.full_name", - "destination.user.group.id", - "destination.user.group.name", - "destination.user.hash", - "destination.user.id", - "destination.user.name", - "dns.answers.class", - "dns.answers.data", - "dns.answers.name", - "dns.answers.type", - "dns.header_flags", - "dns.id", - "dns.op_code", - "dns.question.class", - "dns.question.name", - "dns.question.registered_domain", - "dns.question.type", - "dns.response_code", - "dns.type", - "ecs.version", - "error.code", - "error.id", - "error.message", - "event.action", - "event.category", - "event.code", - "event.dataset", - "event.hash", - "event.id", - "event.kind", - "event.module", - "event.original", - "event.outcome", - "event.provider", - "event.timezone", - "event.type", - "file.device", - "file.directory", - "file.extension", - "file.gid", - "file.group", - "file.hash.md5", - "file.hash.sha1", - "file.hash.sha256", - "file.hash.sha512", - "file.inode", - "file.mode", - "file.name", - "file.owner", - "file.path", - "file.target_path", - "file.type", - "file.uid", - "geo.city_name", - "geo.continent_name", - "geo.country_iso_code", - "geo.country_name", - "geo.name", - "geo.region_iso_code", - "geo.region_name", - "group.id", - "group.name", - "hash.md5", - "hash.sha1", - "hash.sha256", - "hash.sha512", - "host.architecture", - "host.geo.city_name", - "host.geo.continent_name", - "host.geo.country_iso_code", - "host.geo.country_name", - "host.geo.name", - "host.geo.region_iso_code", - "host.geo.region_name", - "host.hostname", - "host.id", - "host.mac", - "host.name", - "host.os.family", - "host.os.full", - "host.os.kernel", - "host.os.name", - "host.os.platform", - "host.os.version", - "host.type", - "host.user.domain", - "host.user.email", - "host.user.full_name", - "host.user.group.id", - "host.user.group.name", - "host.user.hash", - "host.user.id", - "host.user.name", - "http.request.body.content", - "http.request.method", - "http.request.referrer", - "http.response.body.content", - "http.version", - "log.level", - "log.logger", - "log.original", - "network.application", - "network.community_id", - "network.direction", - "network.iana_number", - "network.name", - "network.protocol", - "network.transport", - "network.type", - "observer.geo.city_name", - "observer.geo.continent_name", - "observer.geo.country_iso_code", - "observer.geo.country_name", - "observer.geo.name", - "observer.geo.region_iso_code", - "observer.geo.region_name", - "observer.hostname", - "observer.mac", - "observer.os.family", - "observer.os.full", - "observer.os.kernel", - "observer.os.name", - "observer.os.platform", - "observer.os.version", - "observer.serial_number", - "observer.type", - "observer.vendor", - "observer.version", - "organization.id", - "organization.name", - "os.family", - "os.full", - "os.kernel", - "os.name", - "os.platform", - "os.version", - "process.args", - "process.executable", - "process.hash.md5", - "process.hash.sha1", - "process.hash.sha256", - "process.hash.sha512", - "process.name", - "process.thread.name", - "process.title", - "process.working_directory", - "server.address", - "server.as.organization.name", - "server.domain", - "server.geo.city_name", - "server.geo.continent_name", - "server.geo.country_iso_code", - "server.geo.country_name", - "server.geo.name", - "server.geo.region_iso_code", - "server.geo.region_name", - "server.mac", - "server.user.domain", - "server.user.email", - "server.user.full_name", - "server.user.group.id", - "server.user.group.name", - "server.user.hash", - "server.user.id", - "server.user.name", - "service.ephemeral_id", - "service.id", - "service.name", - "service.state", - "service.type", - "service.version", - "source.address", - "source.as.organization.name", - "source.domain", - "source.geo.city_name", - "source.geo.continent_name", - "source.geo.country_iso_code", - "source.geo.country_name", - "source.geo.name", - "source.geo.region_iso_code", - "source.geo.region_name", - "source.mac", - "source.user.domain", - "source.user.email", - "source.user.full_name", - "source.user.group.id", - "source.user.group.name", - "source.user.hash", - "source.user.id", - "source.user.name", - "tracing.trace.id", - "tracing.transaction.id", - "url.domain", - "url.fragment", - "url.full", - "url.original", - "url.password", - "url.path", - "url.query", - "url.scheme", - "url.username", - "user.domain", - "user.email", - "user.full_name", - "user.group.id", - "user.group.name", - "user.hash", - "user.id", - "user.name", - "user_agent.device.name", - "user_agent.name", - "user_agent.original", - "user_agent.os.family", - "user_agent.os.full", - "user_agent.os.kernel", - "user_agent.os.name", - "user_agent.os.platform", - "user_agent.os.version", - "user_agent.version", - "agent.hostname", - "error.type", - "timeseries.instance", - "cloud.project.id", - "cloud.image.id", - "host.os.build", - "host.os.codename", - "kubernetes.pod.name", - "kubernetes.pod.uid", - "kubernetes.namespace", - "kubernetes.node.name", - "kubernetes.replicaset.name", - "kubernetes.deployment.name", - "kubernetes.statefulset.name", - "kubernetes.container.name", - "kubernetes.container.image", - "jolokia.agent.version", - "jolokia.agent.id", - "jolokia.server.product", - "jolokia.server.version", - "jolokia.server.vendor", - "jolokia.url", - "monitor.type", - "monitor.name", - "monitor.id", - "monitor.status", - "monitor.check_group", - "http.response.body.hash", - "fields.*" - ] - }, - "refresh_interval": "5s" + "vulnerability": { + "properties": { + "category": { + "type": "keyword", + "ignore_above": 1024 + }, + "classification": { + "type": "keyword", + "ignore_above": 1024 + }, + "description": { + "type": "keyword", + "fields": { + "text": { + "type": "text", + "norms": false + } + }, + "ignore_above": 1024 + }, + "enumeration": { + "type": "keyword", + "ignore_above": 1024 + }, + "id": { + "type": "keyword", + "ignore_above": 1024 + }, + "reference": { + "type": "keyword", + "ignore_above": 1024 + }, + "report_id": { + "type": "keyword", + "ignore_above": 1024 + }, + "scanner": { + "properties": { + "vendor": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "score": { + "properties": { + "base": { + "type": "float" + }, + "environmental": { + "type": "float" + }, + "temporal": { + "type": "float" + }, + "version": { + "type": "keyword", + "ignore_above": 1024 + } + } + }, + "severity": { + "type": "keyword", + "ignore_above": 1024 + } + } + } } } + }, + "settings": { + "index": { + "mapping": { + "total_fields": { + "limit": "10000" + } + }, + "number_of_replicas": "1", + "number_of_shards": "1", + "query": { + "default_field": [ + "message", + "tags", + "agent.ephemeral_id", + "agent.id", + "agent.name", + "agent.type", + "agent.version", + "as.organization.name", + "client.address", + "client.as.organization.name", + "client.domain", + "client.geo.city_name", + "client.geo.continent_name", + "client.geo.country_iso_code", + "client.geo.country_name", + "client.geo.name", + "client.geo.region_iso_code", + "client.geo.region_name", + "client.mac", + "client.user.domain", + "client.user.email", + "client.user.full_name", + "client.user.group.id", + "client.user.group.name", + "client.user.hash", + "client.user.id", + "client.user.name", + "cloud.account.id", + "cloud.availability_zone", + "cloud.instance.id", + "cloud.instance.name", + "cloud.machine.type", + "cloud.provider", + "cloud.region", + "container.id", + "container.image.name", + "container.image.tag", + "container.name", + "container.runtime", + "destination.address", + "destination.as.organization.name", + "destination.domain", + "destination.geo.city_name", + "destination.geo.continent_name", + "destination.geo.country_iso_code", + "destination.geo.country_name", + "destination.geo.name", + "destination.geo.region_iso_code", + "destination.geo.region_name", + "destination.mac", + "destination.user.domain", + "destination.user.email", + "destination.user.full_name", + "destination.user.group.id", + "destination.user.group.name", + "destination.user.hash", + "destination.user.id", + "destination.user.name", + "dns.answers.class", + "dns.answers.data", + "dns.answers.name", + "dns.answers.type", + "dns.header_flags", + "dns.id", + "dns.op_code", + "dns.question.class", + "dns.question.name", + "dns.question.registered_domain", + "dns.question.type", + "dns.response_code", + "dns.type", + "ecs.version", + "error.code", + "error.id", + "error.message", + "event.action", + "event.category", + "event.code", + "event.dataset", + "event.hash", + "event.id", + "event.kind", + "event.module", + "event.original", + "event.outcome", + "event.provider", + "event.timezone", + "event.type", + "file.device", + "file.directory", + "file.extension", + "file.gid", + "file.group", + "file.hash.md5", + "file.hash.sha1", + "file.hash.sha256", + "file.hash.sha512", + "file.inode", + "file.mode", + "file.name", + "file.owner", + "file.path", + "file.target_path", + "file.type", + "file.uid", + "geo.city_name", + "geo.continent_name", + "geo.country_iso_code", + "geo.country_name", + "geo.name", + "geo.region_iso_code", + "geo.region_name", + "group.id", + "group.name", + "hash.md5", + "hash.sha1", + "hash.sha256", + "hash.sha512", + "host.architecture", + "host.geo.city_name", + "host.geo.continent_name", + "host.geo.country_iso_code", + "host.geo.country_name", + "host.geo.name", + "host.geo.region_iso_code", + "host.geo.region_name", + "host.hostname", + "host.id", + "host.mac", + "host.name", + "host.os.family", + "host.os.full", + "host.os.kernel", + "host.os.name", + "host.os.platform", + "host.os.version", + "host.type", + "host.user.domain", + "host.user.email", + "host.user.full_name", + "host.user.group.id", + "host.user.group.name", + "host.user.hash", + "host.user.id", + "host.user.name", + "http.request.body.content", + "http.request.method", + "http.request.referrer", + "http.response.body.content", + "http.version", + "log.level", + "log.logger", + "log.original", + "network.application", + "network.community_id", + "network.direction", + "network.iana_number", + "network.name", + "network.protocol", + "network.transport", + "network.type", + "observer.geo.city_name", + "observer.geo.continent_name", + "observer.geo.country_iso_code", + "observer.geo.country_name", + "observer.geo.name", + "observer.geo.region_iso_code", + "observer.geo.region_name", + "observer.hostname", + "observer.mac", + "observer.os.family", + "observer.os.full", + "observer.os.kernel", + "observer.os.name", + "observer.os.platform", + "observer.os.version", + "observer.serial_number", + "observer.type", + "observer.vendor", + "observer.version", + "organization.id", + "organization.name", + "os.family", + "os.full", + "os.kernel", + "os.name", + "os.platform", + "os.version", + "process.args", + "process.executable", + "process.hash.md5", + "process.hash.sha1", + "process.hash.sha256", + "process.hash.sha512", + "process.name", + "process.thread.name", + "process.title", + "process.working_directory", + "server.address", + "server.as.organization.name", + "server.domain", + "server.geo.city_name", + "server.geo.continent_name", + "server.geo.country_iso_code", + "server.geo.country_name", + "server.geo.name", + "server.geo.region_iso_code", + "server.geo.region_name", + "server.mac", + "server.user.domain", + "server.user.email", + "server.user.full_name", + "server.user.group.id", + "server.user.group.name", + "server.user.hash", + "server.user.id", + "server.user.name", + "service.ephemeral_id", + "service.id", + "service.name", + "service.state", + "service.type", + "service.version", + "source.address", + "source.as.organization.name", + "source.domain", + "source.geo.city_name", + "source.geo.continent_name", + "source.geo.country_iso_code", + "source.geo.country_name", + "source.geo.name", + "source.geo.region_iso_code", + "source.geo.region_name", + "source.mac", + "source.user.domain", + "source.user.email", + "source.user.full_name", + "source.user.group.id", + "source.user.group.name", + "source.user.hash", + "source.user.id", + "source.user.name", + "tracing.trace.id", + "tracing.transaction.id", + "url.domain", + "url.fragment", + "url.full", + "url.original", + "url.password", + "url.path", + "url.query", + "url.scheme", + "url.username", + "user.domain", + "user.email", + "user.full_name", + "user.group.id", + "user.group.name", + "user.hash", + "user.id", + "user.name", + "user_agent.device.name", + "user_agent.name", + "user_agent.original", + "user_agent.os.family", + "user_agent.os.full", + "user_agent.os.kernel", + "user_agent.os.name", + "user_agent.os.platform", + "user_agent.os.version", + "user_agent.version", + "agent.hostname", + "error.type", + "timeseries.instance", + "cloud.project.id", + "cloud.image.id", + "host.os.build", + "host.os.codename", + "kubernetes.pod.name", + "kubernetes.pod.uid", + "kubernetes.namespace", + "kubernetes.node.name", + "kubernetes.replicaset.name", + "kubernetes.deployment.name", + "kubernetes.statefulset.name", + "kubernetes.container.name", + "kubernetes.container.image", + "jolokia.agent.version", + "jolokia.agent.id", + "jolokia.server.product", + "jolokia.server.version", + "jolokia.server.vendor", + "jolokia.url", + "monitor.type", + "monitor.name", + "monitor.id", + "monitor.status", + "monitor.check_group", + "http.response.body.hash", + "fields.*" + ] + }, + "refresh_interval": "5s" + } } } diff --git a/x-pack/test/functional/services/machine_learning/index.ts b/x-pack/test/functional/services/machine_learning/index.ts index f5adf63825163b..b792f17efcbcab 100644 --- a/x-pack/test/functional/services/machine_learning/index.ts +++ b/x-pack/test/functional/services/machine_learning/index.ts @@ -30,3 +30,4 @@ export { MachineLearningSecurityCommonProvider } from './security_common'; export { MachineLearningSecurityUIProvider } from './security_ui'; export { MachineLearningSettingsProvider } from './settings'; export { MachineLearningSingleMetricViewerProvider } from './single_metric_viewer'; +export { MachineLearningTestResourcesProvider } from './test_resources'; diff --git a/x-pack/test/functional/services/machine_learning/test_resources.ts b/x-pack/test/functional/services/machine_learning/test_resources.ts new file mode 100644 index 00000000000000..0d61c1413b9884 --- /dev/null +++ b/x-pack/test/functional/services/machine_learning/test_resources.ts @@ -0,0 +1,219 @@ +/* + * 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 { ProvidedType } from '@kbn/test/types/ftr'; + +import { savedSearches } from './test_resources_data'; + +import { FtrProviderContext } from '../../ftr_provider_context'; + +const COMMON_HEADERS = { + 'kbn-xsrf': 'some-xsrf-token', +}; + +export enum SavedObjectType { + CONFIG = 'config', + DASHBOARD = 'dashboard', + INDEX_PATTERN = 'index-pattern', + SEARCH = 'search', + VISUALIZATION = 'visualization', +} + +export type MlTestResourcesi = ProvidedType; + +export function MachineLearningTestResourcesProvider({ getService }: FtrProviderContext) { + const kibanaServer = getService('kibanaServer'); + const log = getService('log'); + const supertest = getService('supertest'); + + return { + async setKibanaTimeZoneToUTC() { + await kibanaServer.uiSettings.update({ + 'dateFormat:tz': 'UTC', + }); + }, + + async resetKibanaTimeZone() { + await kibanaServer.uiSettings.unset('dateFormat:tz'); + }, + + async savedObjectExists(id: string, objectType: SavedObjectType): Promise { + const response = await supertest.get(`/api/saved_objects/${objectType}/${id}`); + return response.status === 200; + }, + + async getSavedObjectIdByTitle( + title: string, + objectType: SavedObjectType + ): Promise { + log.debug(`Searching for '${objectType}' with title '${title}'...`); + const findResponse = await supertest + .get(`/api/saved_objects/_find?type=${objectType}`) + .set(COMMON_HEADERS) + .expect(200) + .then((res: any) => res.body); + + for (const savedObject of findResponse.saved_objects) { + const objectTitle = savedObject.attributes.title; + if (objectTitle === title) { + log.debug(` > Found '${savedObject.id}'`); + return savedObject.id; + } + } + log.debug(` > Not found`); + }, + + async getIndexPatternId(title: string): Promise { + return this.getSavedObjectIdByTitle(title, SavedObjectType.INDEX_PATTERN); + }, + + async getSavedSearchId(title: string): Promise { + return this.getSavedObjectIdByTitle(title, SavedObjectType.SEARCH); + }, + + async createIndexPattern(title: string, timeFieldName?: string): Promise { + log.debug( + `Creating index pattern with title '${title}'${ + timeFieldName !== undefined ? ` and time field '${timeFieldName}'` : '' + }` + ); + + const createResponse = await supertest + .post(`/api/saved_objects/${SavedObjectType.INDEX_PATTERN}`) + .set(COMMON_HEADERS) + .send({ attributes: { title, timeFieldName } }) + .expect(200) + .then((res: any) => res.body); + + log.debug(` > Created with id '${createResponse.id}'`); + return createResponse.id; + }, + + async createIndexPatternIfNeeded(title: string, timeFieldName?: string): Promise { + const indexPatternId = await this.getIndexPatternId(title); + if (indexPatternId !== undefined) { + log.debug(`Index pattern with title '${title}' already exists. Nothing to create.`); + return indexPatternId; + } else { + return await this.createIndexPattern(title, timeFieldName); + } + }, + + async createSavedSearch(title: string, body: object): Promise { + log.debug(`Creating saved search with title '${title}'`); + + const createResponse = await supertest + .post(`/api/saved_objects/${SavedObjectType.SEARCH}`) + .set(COMMON_HEADERS) + .send(body) + .expect(200) + .then((res: any) => res.body); + + log.debug(` > Created with id '${createResponse.id}'`); + return createResponse.id; + }, + + async createSavedSearchIfNeeded(savedSearch: any): Promise { + const title = savedSearch.requestBody.attributes.title; + const savedSearchId = await this.getSavedSearchId(title); + if (savedSearchId !== undefined) { + log.debug(`Saved search with title '${title}' already exists. Nothing to create.`); + return savedSearchId; + } else { + const body = await this.updateSavedSearchRequestBody( + savedSearch.requestBody, + savedSearch.indexPatternTitle + ); + return await this.createSavedSearch(title, body); + } + }, + + async updateSavedSearchRequestBody(body: object, indexPatternTitle: string): Promise { + const indexPatternId = await this.getIndexPatternId(indexPatternTitle); + if (indexPatternId === undefined) { + throw new Error( + `Index pattern '${indexPatternTitle}' to base saved search on does not exist. ` + ); + } + + // inject index pattern id + const updatedBody = JSON.parse(JSON.stringify(body), (_key, value) => { + if (value === 'INDEX_PATTERN_ID_PLACEHOLDER') { + return indexPatternId; + } else { + return value; + } + }); + + // make searchSourceJSON node a string + const searchSourceJsonNode = updatedBody.attributes.kibanaSavedObjectMeta.searchSourceJSON; + const searchSourceJsonString = JSON.stringify(searchSourceJsonNode); + updatedBody.attributes.kibanaSavedObjectMeta.searchSourceJSON = searchSourceJsonString; + + return updatedBody; + }, + + async createSavedSearchFarequoteFilterIfNeeded() { + await this.createSavedSearchIfNeeded(savedSearches.farequoteFilter); + }, + + async createSavedSearchFarequoteLuceneIfNeeded() { + await this.createSavedSearchIfNeeded(savedSearches.farequoteLucene); + }, + + async createSavedSearchFarequoteKueryIfNeeded() { + await this.createSavedSearchIfNeeded(savedSearches.farequoteKuery); + }, + + async createSavedSearchFarequoteFilterAndLuceneIfNeeded() { + await this.createSavedSearchIfNeeded(savedSearches.farequoteFilterAndLucene); + }, + + async createSavedSearchFarequoteFilterAndKueryIfNeeded() { + await this.createSavedSearchIfNeeded(savedSearches.farequoteFilterAndKuery); + }, + + async deleteIndexPattern(title: string) { + log.debug(`Deleting index pattern with title '${title}'...`); + + const indexPatternId = await this.getIndexPatternId(title); + if (indexPatternId === undefined) { + log.debug(`Index pattern with title '${title}' does not exists. Nothing to delete.`); + return; + } else { + await supertest + .delete(`/api/saved_objects/${SavedObjectType.INDEX_PATTERN}/${indexPatternId}`) + .set(COMMON_HEADERS) + .expect(200); + + log.debug(` > Deleted index pattern with id '${indexPatternId}'`); + } + }, + + async deleteSavedSearch(title: string) { + log.debug(`Deleting saved search with title '${title}'...`); + + const savedSearchId = await this.getSavedSearchId(title); + if (savedSearchId === undefined) { + log.debug(`Saved search with title '${title}' does not exists. Nothing to delete.`); + return; + } else { + await supertest + .delete(`/api/saved_objects/${SavedObjectType.SEARCH}/${savedSearchId}`) + .set(COMMON_HEADERS) + .expect(200); + + log.debug(` > Deleted saved searchwith id '${savedSearchId}'`); + } + }, + + async deleteSavedSearches() { + for (const search of Object.values(savedSearches)) { + await this.deleteSavedSearch(search.requestBody.attributes.title); + } + }, + }; +} diff --git a/x-pack/test/functional/services/machine_learning/test_resources_data.ts b/x-pack/test/functional/services/machine_learning/test_resources_data.ts new file mode 100644 index 00000000000000..dd600077182f93 --- /dev/null +++ b/x-pack/test/functional/services/machine_learning/test_resources_data.ts @@ -0,0 +1,249 @@ +/* + * 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. + */ + +export const savedSearches = { + farequoteFilter: { + indexPatternTitle: 'ft_farequote', + requestBody: { + attributes: { + title: 'ft_farequote_filter', + description: '', + hits: 0, + columns: ['_source'], + sort: ['@timestamp', 'desc'], + version: 1, + kibanaSavedObjectMeta: { + searchSourceJSON: { + highlightAll: true, + version: true, + query: { + query: '', + language: 'lucene', + }, + filter: [ + { + meta: { + index: 'INDEX_PATTERN_ID_PLACEHOLDER', + negate: false, + disabled: false, + alias: null, + type: 'phrase', + key: 'airline', + value: 'ASA', + params: { + query: 'ASA', + type: 'phrase', + }, + }, + query: { + match: { + airline: { + query: 'ASA', + type: 'phrase', + }, + }, + }, + $state: { + store: 'appState', + }, + }, + ], + indexRefName: 'kibanaSavedObjectMeta.searchSourceJSON.index', + }, + }, + }, + references: [ + { + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + id: 'INDEX_PATTERN_ID_PLACEHOLDER', + }, + ], + }, + }, + farequoteLucene: { + indexPatternTitle: 'ft_farequote', + requestBody: { + attributes: { + title: 'ft_farequote_lucene', + description: '', + hits: 0, + columns: ['_source'], + sort: ['@timestamp', 'desc'], + version: 1, + kibanaSavedObjectMeta: { + searchSourceJSON: { + highlightAll: true, + version: true, + query: { + query: 'airline:A*', + language: 'lucene', + }, + filter: [], + indexRefName: 'kibanaSavedObjectMeta.searchSourceJSON.index', + }, + }, + }, + references: [ + { + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + id: 'INDEX_PATTERN_ID_PLACEHOLDER', + }, + ], + }, + }, + farequoteKuery: { + indexPatternTitle: 'ft_farequote', + requestBody: { + attributes: { + title: 'ft_farequote_kuery', + description: '', + hits: 0, + columns: ['_source'], + sort: ['@timestamp', 'desc'], + version: 1, + kibanaSavedObjectMeta: { + searchSourceJSON: { + highlightAll: true, + version: true, + query: { + query: 'airline: A* and responsetime > 5', + language: 'kuery', + }, + filter: [], + indexRefName: 'kibanaSavedObjectMeta.searchSourceJSON.index', + }, + }, + }, + references: [ + { + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + id: 'INDEX_PATTERN_ID_PLACEHOLDER', + }, + ], + }, + }, + farequoteFilterAndLucene: { + indexPatternTitle: 'ft_farequote', + requestBody: { + attributes: { + title: 'ft_farequote_filter_and_lucene', + description: '', + hits: 0, + columns: ['_source'], + sort: ['@timestamp', 'desc'], + version: 1, + kibanaSavedObjectMeta: { + searchSourceJSON: { + highlightAll: true, + version: true, + query: { + query: 'responsetime:>50', + language: 'lucene', + }, + filter: [ + { + meta: { + index: 'INDEX_PATTERN_ID_PLACEHOLDER', + negate: false, + disabled: false, + alias: null, + type: 'phrase', + key: 'airline', + value: 'ASA', + params: { + query: 'ASA', + type: 'phrase', + }, + }, + query: { + match: { + airline: { + query: 'ASA', + type: 'phrase', + }, + }, + }, + $state: { + store: 'appState', + }, + }, + ], + indexRefName: 'kibanaSavedObjectMeta.searchSourceJSON.index', + }, + }, + }, + references: [ + { + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + id: 'INDEX_PATTERN_ID_PLACEHOLDER', + }, + ], + }, + }, + farequoteFilterAndKuery: { + indexPatternTitle: 'ft_farequote', + requestBody: { + attributes: { + title: 'ft_farequote_filter_and_kuery', + description: '', + hits: 0, + columns: ['_source'], + sort: ['@timestamp', 'desc'], + version: 1, + kibanaSavedObjectMeta: { + searchSourceJSON: { + highlightAll: true, + version: true, + query: { + query: 'responsetime > 49', + language: 'kuery', + }, + filter: [ + { + meta: { + index: 'INDEX_PATTERN_ID_PLACEHOLDER', + negate: false, + disabled: false, + alias: null, + type: 'phrase', + key: 'airline', + value: 'ASA', + params: { + query: 'ASA', + type: 'phrase', + }, + }, + query: { + match: { + airline: { + query: 'ASA', + type: 'phrase', + }, + }, + }, + $state: { + store: 'appState', + }, + }, + ], + indexRefName: 'kibanaSavedObjectMeta.searchSourceJSON.index', + }, + }, + }, + references: [ + { + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + id: 'INDEX_PATTERN_ID_PLACEHOLDER', + }, + ], + }, + }, +}; diff --git a/x-pack/test/functional/services/ml.ts b/x-pack/test/functional/services/ml.ts index af7cb51f4e3f09..be3d3e0c960168 100644 --- a/x-pack/test/functional/services/ml.ts +++ b/x-pack/test/functional/services/ml.ts @@ -33,6 +33,7 @@ import { MachineLearningSecurityUIProvider, MachineLearningSettingsProvider, MachineLearningSingleMetricViewerProvider, + MachineLearningTestResourcesProvider, } from './machine_learning'; export function MachineLearningProvider(context: FtrProviderContext) { @@ -67,6 +68,7 @@ export function MachineLearningProvider(context: FtrProviderContext) { const securityUI = MachineLearningSecurityUIProvider(context, securityCommon); const settings = MachineLearningSettingsProvider(context); const singleMetricViewer = MachineLearningSingleMetricViewerProvider(context); + const testResources = MachineLearningTestResourcesProvider(context); return { anomaliesTable, @@ -95,5 +97,6 @@ export function MachineLearningProvider(context: FtrProviderContext) { securityUI, settings, singleMetricViewer, + testResources, }; } diff --git a/x-pack/test/functional/services/transform.ts b/x-pack/test/functional/services/transform.ts index 74416ea070882f..f0ca5f81bd5ecb 100644 --- a/x-pack/test/functional/services/transform.ts +++ b/x-pack/test/functional/services/transform.ts @@ -17,6 +17,8 @@ import { TransformWizardProvider, } from './transform_ui'; +import { MachineLearningTestResourcesProvider } from './machine_learning'; + export function TransformProvider(context: FtrProviderContext) { const api = TransformAPIProvider(context); const management = TransformManagementProvider(context); @@ -25,6 +27,7 @@ export function TransformProvider(context: FtrProviderContext) { const securityUI = TransformSecurityUIProvider(context, securityCommon); const sourceSelection = TransformSourceSelectionProvider(context); const table = TransformTableProvider(context); + const testResources = MachineLearningTestResourcesProvider(context); const wizard = TransformWizardProvider(context); return { @@ -35,6 +38,7 @@ export function TransformProvider(context: FtrProviderContext) { securityUI, sourceSelection, table, + testResources, wizard, }; } diff --git a/x-pack/test/functional_endpoint/apps/endpoint/host_list.ts b/x-pack/test/functional_endpoint/apps/endpoint/host_list.ts index 9a4ffecf85d52c..35843dc6a76db1 100644 --- a/x-pack/test/functional_endpoint/apps/endpoint/host_list.ts +++ b/x-pack/test/functional_endpoint/apps/endpoint/host_list.ts @@ -12,7 +12,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const esArchiver = getService('esArchiver'); const testSubjects = getService('testSubjects'); - describe('host list', function() { + // FLAKY: https://github.com/elastic/kibana/issues/63621 + describe.skip('host list', function() { this.tags('ciGroup7'); const sleep = (ms = 100) => new Promise(resolve => setTimeout(resolve, ms)); before(async () => { diff --git a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts.ts b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts.ts index bce8e08cd16d35..bbf8881f0c62a9 100644 --- a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts.ts +++ b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts.ts @@ -343,15 +343,15 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await testSubjects.click('collapsedItemActions'); - await pageObjects.triggersActionsUI.toggleSwitch('enableSwitch'); + await pageObjects.triggersActionsUI.toggleSwitch('disableSwitch'); await pageObjects.triggersActionsUI.searchAlerts(createdAlert.name); await testSubjects.click('collapsedItemActions'); - const enableSwitchAfterDisable = await testSubjects.find('enableSwitch'); - const isChecked = await enableSwitchAfterDisable.getAttribute('aria-checked'); - expect(isChecked).to.eql('false'); + const disableSwitchAfterDisable = await testSubjects.find('disableSwitch'); + const isChecked = await disableSwitchAfterDisable.getAttribute('aria-checked'); + expect(isChecked).to.eql('true'); }); it('should re-enable single alert', async () => { @@ -361,21 +361,21 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await testSubjects.click('collapsedItemActions'); - await pageObjects.triggersActionsUI.toggleSwitch('enableSwitch'); + await pageObjects.triggersActionsUI.toggleSwitch('disableSwitch'); await pageObjects.triggersActionsUI.searchAlerts(createdAlert.name); await testSubjects.click('collapsedItemActions'); - await pageObjects.triggersActionsUI.toggleSwitch('enableSwitch'); + await pageObjects.triggersActionsUI.toggleSwitch('disableSwitch'); await pageObjects.triggersActionsUI.searchAlerts(createdAlert.name); await testSubjects.click('collapsedItemActions'); - const enableSwitchAfterReEnable = await testSubjects.find('enableSwitch'); - const isChecked = await enableSwitchAfterReEnable.getAttribute('aria-checked'); - expect(isChecked).to.eql('true'); + const disableSwitchAfterReEnable = await testSubjects.find('disableSwitch'); + const isChecked = await disableSwitchAfterReEnable.getAttribute('aria-checked'); + expect(isChecked).to.eql('false'); }); it('should mute single alert', async () => { @@ -507,9 +507,9 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await testSubjects.click('collapsedItemActions'); - const enableSwitch = await testSubjects.find('enableSwitch'); - const isChecked = await enableSwitch.getAttribute('aria-checked'); - expect(isChecked).to.eql('false'); + const disableSwitch = await testSubjects.find('disableSwitch'); + const isChecked = await disableSwitch.getAttribute('aria-checked'); + expect(isChecked).to.eql('true'); }); it('should enable all selection', async () => { @@ -532,9 +532,9 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { await testSubjects.click('collapsedItemActions'); - const enableSwitch = await testSubjects.find('enableSwitch'); - const isChecked = await enableSwitch.getAttribute('aria-checked'); - expect(isChecked).to.eql('true'); + const disableSwitch = await testSubjects.find('disableSwitch'); + const isChecked = await disableSwitch.getAttribute('aria-checked'); + expect(isChecked).to.eql('false'); }); it('should delete all selection', async () => { diff --git a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/connectors.ts b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/connectors.ts index 0e6f991be24d0c..562f64656319e4 100644 --- a/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/connectors.ts +++ b/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/connectors.ts @@ -185,7 +185,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { expect(searchResultsAfterDelete.length).to.eql(0); }); - it('should not be able to delete a pre-configured connector', async () => { + it('should not be able to delete a preconfigured connector', async () => { const preconfiguredConnectorName = 'xyz'; await pageObjects.triggersActionsUI.searchConnectors(preconfiguredConnectorName); @@ -196,7 +196,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { expect(await testSubjects.exists('preConfiguredTitleMessage')).to.be(true); }); - it('should not be able to edit a pre-configured connector', async () => { + it('should not be able to edit a preconfigured connector', async () => { const preconfiguredConnectorName = 'xyz'; await pageObjects.triggersActionsUI.searchConnectors(preconfiguredConnectorName); diff --git a/x-pack/test/licensing_plugin/legacy/updates.ts b/x-pack/test/licensing_plugin/legacy/updates.ts index 5fa1299d1f285f..03b61b9db87f89 100644 --- a/x-pack/test/licensing_plugin/legacy/updates.ts +++ b/x-pack/test/licensing_plugin/legacy/updates.ts @@ -50,14 +50,9 @@ export default function(ftrContext: FtrProviderContext) { await scenario.startBasic(); await scenario.waitForPluginToDetectLicenseUpdate(); - const { body: legacyBasicLicense, header: legacyBasicLicenseHeaders } = await supertest - .get('/api/xpack/v1/info') - .expect(200); + const { body: legacyBasicLicense } = await supertest.get('/api/xpack/v1/info').expect(200); expect(legacyBasicLicense.license?.type).to.be('basic'); expect(legacyBasicLicense.features).to.have.property('security'); - expect(legacyBasicLicenseHeaders['kbn-xpack-sig']).to.not.be( - legacyInitialLicenseHeaders['kbn-xpack-sig'] - ); // banner shown only when license expired not just deleted await testSubjects.missingOrFail('licenseExpiredBanner'); diff --git a/x-pack/test/plugin_api_integration/plugins/event_log/server/init_routes.ts b/x-pack/test/plugin_api_integration/plugins/event_log/server/init_routes.ts new file mode 100644 index 00000000000000..c5f3e65581df97 --- /dev/null +++ b/x-pack/test/plugin_api_integration/plugins/event_log/server/init_routes.ts @@ -0,0 +1,228 @@ +/* + * 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 { + RequestHandlerContext, + KibanaRequest, + KibanaResponseFactory, + IKibanaResponse, + IRouter, + Logger, + RouteValidationResultFactory, +} from 'kibana/server'; +import { IEventLogService, IEventLogger } from '../../../../../plugins/event_log/server'; +import { IValidatedEvent } from '../../../../../plugins/event_log/server/types'; + +export const logEventRoute = (router: IRouter, eventLogger: IEventLogger, logger: Logger) => { + router.post( + { + path: `/api/log_event_fixture/{id}/_log`, + validate: { + // removed validation as schema is currently broken in tests + // blocked by: https://github.com/elastic/kibana/issues/61652 + params: (value: any, { ok }: RouteValidationResultFactory) => ok(value), + body: (value: any, { ok }: RouteValidationResultFactory) => ok(value), + }, + }, + async function( + context: RequestHandlerContext, + req: KibanaRequest, + res: KibanaResponseFactory + ): Promise> { + const { id } = req.params as { id: string }; + const event: IValidatedEvent = req.body; + logger.info(`test fixture: log event: ${id} ${JSON.stringify(event)}`); + try { + await context.core.savedObjects.client.get('event_log_test', id); + logger.info(`found existing saved object`); + } catch (ex) { + logger.info(`log event error: ${ex}`); + await context.core.savedObjects.client.create('event_log_test', {}, { id }); + logger.info(`created saved object`); + } + eventLogger.logEvent(event); + logger.info(`logged`); + return res.ok({}); + } + ); +}; + +export const registerProviderActionsRoute = ( + router: IRouter, + eventLogService: IEventLogService, + logger: Logger +) => { + router.post( + { + path: '/api/log_event_fixture/{provider}/_registerProviderActions', + validate: { + body: value => ({ value }), + params: (value: any, { ok }: RouteValidationResultFactory) => ok(value), + }, + options: { authRequired: false }, + }, + (context, request, response) => { + const { provider } = request.params as { provider: string }; + const actions = request.body; + try { + logger.info( + `test register provider actions: ${provider}, actions: ${JSON.stringify(actions)}` + ); + + eventLogService.registerProviderActions(provider, actions); + logger.info(`registered`); + } catch (e) { + return response.badRequest({ body: e }); + } + return response.ok({ body: {} }); + } + ); +}; + +export const isProviderActionRegisteredRoute = ( + router: IRouter, + eventLogService: IEventLogService, + logger: Logger +) => { + router.get( + { + path: `/api/log_event_fixture/{provider}/{action}/_isProviderActionRegistered`, + validate: { + params: (value: any, { ok }: RouteValidationResultFactory) => ok(value), + }, + }, + async function( + context: RequestHandlerContext, + req: KibanaRequest, + res: KibanaResponseFactory + ): Promise> { + const { provider, action } = req.params as { provider: string; action: string }; + logger.info(`test provider actions is registered: ${provider} for action: ${action}`); + + return res.ok({ + body: { + isProviderActionRegistered: eventLogService.isProviderActionRegistered(provider, action), + }, + }); + } + ); +}; + +export const getProviderActionsRoute = ( + router: IRouter, + eventLogService: IEventLogService, + logger: Logger +) => { + router.get( + { + path: `/api/log_event_fixture/{provider}/getProviderActions`, + validate: { + params: (value: any, { ok }: RouteValidationResultFactory) => ok(value), + }, + }, + async function( + context: RequestHandlerContext, + req: KibanaRequest, + res: KibanaResponseFactory + ): Promise> { + const { provider } = req.params as { provider: string }; + + logger.info(`test if get all provider actions is registered`); + return res.ok({ + body: { actions: [...(eventLogService.getProviderActions().get(provider) ?? [])] }, + }); + } + ); +}; + +export const getLoggerRoute = ( + router: IRouter, + eventLogService: IEventLogService, + logger: Logger +) => { + router.get( + { + path: `/api/log_event_fixture/getEventLogger/{event}`, + validate: { + params: (value: any, { ok }: RouteValidationResultFactory) => ok(value), + }, + }, + async function( + context: RequestHandlerContext, + req: KibanaRequest, + res: KibanaResponseFactory + ): Promise> { + const { event } = req.params as { event: string }; + logger.info(`test get event logger for event: ${event}`); + + return res.ok({ + body: { eventLogger: eventLogService.getLogger({ event: { provider: event } }) }, + }); + } + ); +}; + +export const isIndexingEntriesRoute = ( + router: IRouter, + eventLogService: IEventLogService, + logger: Logger +) => { + router.get( + { + path: `/api/log_event_fixture/isIndexingEntries`, + validate: {}, + }, + async function( + context: RequestHandlerContext, + req: KibanaRequest, + res: KibanaResponseFactory + ): Promise> { + logger.info(`test if event logger is indexing entries`); + return res.ok({ body: { isIndexingEntries: eventLogService.isIndexingEntries() } }); + } + ); +}; + +export const isEventLogServiceEnabledRoute = ( + router: IRouter, + eventLogService: IEventLogService, + logger: Logger +) => { + router.get( + { + path: `/api/log_event_fixture/isEventLogServiceEnabled`, + validate: {}, + }, + async function( + context: RequestHandlerContext, + req: KibanaRequest, + res: KibanaResponseFactory + ): Promise> { + logger.info(`test if event logger is enabled`); + return res.ok({ body: { isEnabled: eventLogService.isEnabled() } }); + } + ); +}; + +export const isEventLogServiceLoggingEntriesRoute = ( + router: IRouter, + eventLogService: IEventLogService, + logger: Logger +) => { + router.get( + { + path: `/api/log_event_fixture/isEventLogServiceLoggingEntries`, + validate: {}, + }, + async function( + context: RequestHandlerContext, + req: KibanaRequest, + res: KibanaResponseFactory + ): Promise> { + logger.info(`test if event logger is logging entries`); + return res.ok({ body: { isLoggingEntries: eventLogService.isLoggingEntries() } }); + } + ); +}; diff --git a/x-pack/test/plugin_api_integration/plugins/event_log/server/plugin.ts b/x-pack/test/plugin_api_integration/plugins/event_log/server/plugin.ts index 1b6db3a9a31b4b..2ef932d19e9eee 100644 --- a/x-pack/test/plugin_api_integration/plugins/event_log/server/plugin.ts +++ b/x-pack/test/plugin_api_integration/plugins/event_log/server/plugin.ts @@ -4,24 +4,18 @@ * you may not use this file except in compliance with the Elastic License. */ +import { Plugin, CoreSetup, Logger, PluginInitializerContext } from 'kibana/server'; +import { IEventLogService, IEventLogClientService } from '../../../../../plugins/event_log/server'; import { - Plugin, - CoreSetup, - RequestHandlerContext, - KibanaRequest, - KibanaResponseFactory, - IKibanaResponse, - IRouter, - Logger, - PluginInitializerContext, - RouteValidationResultFactory, -} from 'kibana/server'; -import { - IEventLogService, - IEventLogClientService, - IEventLogger, -} from '../../../../../plugins/event_log/server'; -import { IValidatedEvent } from '../../../../../plugins/event_log/server/types'; + logEventRoute, + registerProviderActionsRoute, + isProviderActionRegisteredRoute, + getProviderActionsRoute, + getLoggerRoute, + isIndexingEntriesRoute, + isEventLogServiceLoggingEntriesRoute, + isEventLogServiceEnabledRoute, +} from './init_routes'; // this plugin's dependendencies export interface EventLogFixtureSetupDeps { @@ -57,42 +51,17 @@ export class EventLogFixturePlugin }); logEventRoute(router, eventLogger, this.logger); + + // event log service api routes + registerProviderActionsRoute(router, eventLog, this.logger); + isProviderActionRegisteredRoute(router, eventLog, this.logger); + getProviderActionsRoute(router, eventLog, this.logger); + getLoggerRoute(router, eventLog, this.logger); + isIndexingEntriesRoute(router, eventLog, this.logger); + isEventLogServiceLoggingEntriesRoute(router, eventLog, this.logger); + isEventLogServiceEnabledRoute(router, eventLog, this.logger); } public start() {} public stop() {} } - -const logEventRoute = (router: IRouter, eventLogger: IEventLogger, logger: Logger) => { - router.post( - { - path: `/api/log_event_fixture/{id}/_log`, - validate: { - // removed validation as schema is currently broken in tests - // blocked by: https://github.com/elastic/kibana/issues/61652 - params: (value: any, { ok }: RouteValidationResultFactory) => ok(value), - body: (value: any, { ok }: RouteValidationResultFactory) => ok(value), - }, - }, - async function( - context: RequestHandlerContext, - req: KibanaRequest, - res: KibanaResponseFactory - ): Promise> { - const { id } = req.params as { id: string }; - const event: IValidatedEvent = req.body; - logger.info(`test fixture: log event: ${id} ${JSON.stringify(event)}`); - try { - await context.core.savedObjects.client.get('event_log_test', id); - logger.info(`found existing saved object`); - } catch (ex) { - logger.info(`log event error: ${ex}`); - await context.core.savedObjects.client.create('event_log_test', {}, { id }); - logger.info(`created saved object`); - } - eventLogger.logEvent(event); - logger.info(`logged`); - return res.ok({}); - } - ); -}; diff --git a/x-pack/test/plugin_api_integration/test_suites/event_log/service_api_integration.ts b/x-pack/test/plugin_api_integration/test_suites/event_log/service_api_integration.ts index b055b22879bf91..2de395308ce74c 100644 --- a/x-pack/test/plugin_api_integration/test_suites/event_log/service_api_integration.ts +++ b/x-pack/test/plugin_api_integration/test_suites/event_log/service_api_integration.ts @@ -3,9 +3,181 @@ * 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/expect.js'; +import { IEvent } from '../../../../plugins/event_log/server'; +import { FtrProviderContext } from '../../ftr_provider_context'; + +export default function({ getService }: FtrProviderContext) { + const es = getService('legacyEs'); + const supertest = getService('supertest'); + const log = getService('log'); + const config = getService('config'); + const retry = getService('retry'); -export default function() { describe('Event Log service API', () => { - it('should allow logging an event', async () => {}); + it('should check if it is enabled', async () => { + const configValue = config + .get('kbnTestServer.serverArgs') + .find((val: string) => val === '--xpack.eventLog.enabled=true'); + const result = await isEventLogServiceEnabled(); + expect(configValue).to.be.eql(`--xpack.eventLog.enabled=${result.body.isEnabled}`); + }); + + it('should check if logging entries is enabled', async () => { + const configValue = config + .get('kbnTestServer.serverArgs') + .find((val: string) => val === '--xpack.eventLog.logEntries=true'); + const result = await isEventLogServiceLoggingEntries(); + expect(configValue).to.be.eql(`--xpack.eventLog.logEntries=${result.body.isLoggingEntries}`); + }); + + it('should check if indexing entries is enabled', async () => { + const configValue = config + .get('kbnTestServer.serverArgs') + .find((val: string) => val === '--xpack.eventLog.indexEntries=true'); + const result = await isIndexingEntries(); + const exists = await es.indices.exists({ index: '.kibana-event-log-*' }); + expect(exists).to.be.eql(true); + expect(configValue).to.be.eql( + `--xpack.eventLog.indexEntries=${result.body.isIndexingEntries}` + ); + }); + + it('should be able to check if provider actions is registered', async () => { + const initResult = await isProviderActionRegistered('provider3', 'action1'); + + if (!initResult.body.isProviderActionRegistered) { + await registerProviderActions('provider3', ['action1']); + } + const result1 = await isProviderActionRegistered('provider3', 'action1'); + expect(result1.body.isProviderActionRegistered).to.be.eql(true); + + const result = await isProviderActionRegistered('provider3', 'action2'); + expect(result.body.isProviderActionRegistered).to.be.eql(false); + }); + + it('should return error message if provider is registered', async () => { + const initResult = await isProviderActionRegistered('duplication', 'action1'); + + if (!initResult.body.isProviderActionRegistered) { + await registerProviderActions('duplication', ['action1', 'action2']); + } + + const result = await registerProviderActions('duplication', ['action1', 'action2']); + expect(result.badRequest).to.be.eql(true); + }); + + it('should allow to register provider actions and return all provider actions', async () => { + const initResult = await isProviderActionRegistered('provider1', 'action1'); + + if (!initResult.body.isProviderActionRegistered) { + await registerProviderActions('provider1', ['action1', 'action2']); + } + + const providerActions = await getProviderActions('provider1'); + expect(providerActions.body.actions).to.be.eql(['action1', 'action2']); + }); + + it('should allow to get event logger event log service', async () => { + const initResult = await isProviderActionRegistered('provider2', 'action1'); + + if (!initResult.body.isProviderActionRegistered) { + await registerProviderActions('provider2', ['action1', 'action2']); + } + const eventLogger = await getEventLogger('provider2'); + expect(eventLogger.body.eventLogger.initialProperties).to.be.eql({ + event: { provider: 'provider2' }, + }); + }); + + it('should allow write an event to index document if indexing entries is enabled', async () => { + const initResult = await isProviderActionRegistered('provider4', 'action1'); + + if (!initResult.body.isProviderActionRegistered) { + await registerProviderActions('provider4', ['action1', 'action2']); + } + + const eventId = '1'; + const event: IEvent = { + event: { action: 'action1', provider: 'provider4' }, + kibana: { saved_objects: [{ type: 'event_log_test', id: eventId }] }, + }; + await logTestEvent(eventId, event); + + await retry.try(async () => { + const uri = `/api/event_log/event_log_test/${eventId}/_find`; + log.debug(`calling ${uri}`); + const result = await supertest + .get(uri) + .set('kbn-xsrf', 'foo') + .expect(200); + expect(result.body.data.length).to.be.eql(1); + }); + }); }); + + async function registerProviderActions(provider: string, actions: string[]) { + log.debug(`registerProviderActions ${provider}`); + return await supertest + .post(`/api/log_event_fixture/${provider}/_registerProviderActions`) + .set('kbn-xsrf', 'xxx') + .send(actions); + } + + async function isProviderActionRegistered(provider: string, action: string) { + log.debug(`isProviderActionRegistered ${provider} for action ${action}`); + return await supertest + .get(`/api/log_event_fixture/${provider}/${action}/_isProviderActionRegistered`) + .set('kbn-xsrf', 'foo') + .expect(200); + } + + async function getProviderActions(provider: string) { + log.debug(`getProviderActions ${provider}`); + return await supertest + .get(`/api/log_event_fixture/${provider}/getProviderActions`) + .set('kbn-xsrf', 'xxx') + .expect(200); + } + + async function getEventLogger(event: string) { + log.debug(`isProviderActionRegistered for event ${event}`); + return await supertest + .get(`/api/log_event_fixture/getEventLogger/${event}`) + .set('kbn-xsrf', 'foo') + .expect(200); + } + + async function isIndexingEntries() { + log.debug(`isIndexingEntries`); + return await supertest + .get(`/api/log_event_fixture/isIndexingEntries`) + .set('kbn-xsrf', 'foo') + .expect(200); + } + + async function isEventLogServiceEnabled() { + log.debug(`isEventLogServiceEnabled`); + return await supertest + .get(`/api/log_event_fixture/isEventLogServiceEnabled`) + .set('kbn-xsrf', 'foo') + .expect(200); + } + + async function isEventLogServiceLoggingEntries() { + log.debug(`isEventLogServiceLoggingEntries`); + return await supertest + .get(`/api/log_event_fixture/isEventLogServiceLoggingEntries`) + .set('kbn-xsrf', 'foo') + .expect(200); + } + + async function logTestEvent(id: string, event: IEvent) { + log.debug(`Logging Event for Saved Object ${id}`); + return await supertest + .post(`/api/log_event_fixture/${id}/_log`) + .set('kbn-xsrf', 'foo') + .send(event) + .expect(200); + } } diff --git a/x-pack/test/siem_cypress/runner.ts b/x-pack/test/siem_cypress/runner.ts index 2462f75d4d0a49..b84e2953cc1422 100644 --- a/x-pack/test/siem_cypress/runner.ts +++ b/x-pack/test/siem_cypress/runner.ts @@ -23,7 +23,7 @@ export async function SiemCypressTestRunner({ getService }: FtrProviderContext) await procs.run('cypress', { cmd: 'yarn', args: ['cypress:run'], - cwd: resolve(__dirname, '../../legacy/plugins/siem'), + cwd: resolve(__dirname, '../../plugins/siem'), env: { FORCE_COLOR: '1', CYPRESS_baseUrl: Url.format(config.get('servers.kibana')), diff --git a/x-pack/tsconfig.json b/x-pack/tsconfig.json index 55f697fb4f5ec0..a540c7e3c97868 100644 --- a/x-pack/tsconfig.json +++ b/x-pack/tsconfig.json @@ -11,7 +11,7 @@ ], "exclude": [ "test/**/*", - "legacy/plugins/siem/cypress/**/*", + "plugins/siem/cypress/**/*", "legacy/plugins/apm/e2e/cypress/**/*", "**/typespec_tests.ts" ],